!(function () { "use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var t = function (e, n) { return (t = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(e, n); }; function e(e, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null" ); function r() { this.constructor = e; } t(e, n), (e.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r())); } var n, r = function () { return (r = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function i(t, e, n, r) { var i, o = arguments.length, a = o < 3 ? e : null === r ? (r = Object.getOwnPropertyDescriptor(e, n)) : r; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, e, n, r); else for (var s = t.length - 1; s >= 0; s--) (i = t[s]) && (a = (o < 3 ? i(a) : o > 3 ? i(e, n, a) : i(e, n)) || a); return o > 3 && a && Object.defineProperty(e, n, a), a; } function o() { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t), i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r; } !(function (t) { (t[(t.None = 0)] = "None"), (t[(t.Deflate = 1)] = "Deflate"), (t[(t.LZMA = 2)] = "LZMA"); })(n || (n = {})); var a = (function () { function t() { (this.compression = n.None), (this.swfVersion = 0), (this.useAVM1 = !0), (this.backgroundColor = 4294967295), (this.bounds = null), (this.frameRate = 0), (this.frameCount = 0), (this.attributes = null), (this.sceneAndFrameLabelData = null), (this.bytesLoaded = 0), (this.bytesTotal = length), (this.pendingUpdateDelays = 0), (this.framesLoaded = 0); } return ( (t.prototype.mapSWFVersionToFPVersion = function () { var t = { 6: "FP6", 7: "FP7", 8: "FP8", 9: "FP9", 10: "FP10", 11: "FP10_2", 12: "FP10_3", 13: "FP11_0", 14: "FP11_1", 15: "FP11_2", 16: "FP11_3", 17: "FP11_4", 18: "FP11_5", 19: "FP11_6", 20: "FP11_7", 21: "FP11_8", 22: "FP11_9", 23: "FP12", 24: "FP13", 25: "FP14", 26: "FP15", 27: "FP16", 28: "FP17", 29: "FP18", 30: "FP19", 31: "FP20", 32: "FP21", 33: "FP22", 34: "FP23", 35: "FP24", 36: "FP25", 37: "FP26", 38: "FP27", 39: "FP28", 40: "FP29", 41: "FP30", 42: "FP31", }; this.fpVersion = t[this.swfVersion] ? t[this.swfVersion] : "unmappedSWFVersion:" + this.swfVersion; }), t ); })(), s = (function (t) { function n(e, n, r) { void 0 === e && (e = ""), void 0 === n && (n = 0), void 0 === r && (r = ""); var i = t.call(this, e) || this; return ( (i._errorID = 0), (i._messsage = ""), (i._name = ""), (i._messsage = e), (i._name = r), (i._errorID = n), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "message", { get: function () { return this._messsage; }, set: function (t) { this._messsage = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "name", { get: function () { return this._name; }, set: function (t) { this._name = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "errorID", { get: function () { return this._errorID; }, enumerable: !0, configurable: !0, }), n ); })(Error), u = (function (t) { function n(e, n) { return ( void 0 === e && (e = null), void 0 === n && (n = 0), t.call( this, e || "An abstract method was called! Either an instance of an abstract export class was created,or an abstract method was not overridden by the subclass.", n ) || this ); } return e(n, t), n; })(s), l = (function () { function t(t) { (this.type = void 0), (this.target = void 0), (this._iAllowedToPropagate = !0), (this._iAllowedToImmediatlyPropagate = !0), (this.type = t); } return ( (t.prototype.clone = function () { return new t(this.type); }), t ); })(), c = (function (t) { function n(e, n, r) { void 0 === r && (r = null); var i = t.call(this, e) || this; return (i._asset = n), (i._prevName = r || i._asset.name), i; } return ( e(n, t), Object.defineProperty(n.prototype, "asset", { get: function () { return this._asset; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "prevName", { get: function () { return this._prevName; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._asset, this._prevName); }), (n.INVALIDATE = "invalidate"), (n.CLEAR = "clear"), (n.RENAME = "rename"), (n.ENTER_FRAME = "enterFrame"), (n.EXIT_FRAME = "exitFrame"), (n.ASSET_CONFLICT_RESOLVED = "assetConflictResolved"), (n.ASSET_COMPLETE = "assetComplete"), (n.TEXTURE_SIZE_ERROR = "textureSizeError"), n ); })(l), h = (function () { function t(t) { void 0 === t && (t = null), (this._listenerObjects = {}), (this._t = t || this); } return ( (t.prototype.addEventListener = function (t, e) { var n = this._listenerObjects[t]; void 0 === n && (n = this._listenerObjects[t] = new p()), n.addEventListener(e); }), (t.prototype.removeEventListener = function (t, e) { var n = this._listenerObjects[t]; n && (n.removeEventListener(e), 0 == n.numListeners && delete this._listenerObjects[t]); }), (t.prototype.dispatchEvent = function (t) { var e = this._listenerObjects[t.type]; e && ((t.target = this._t), e.dispatchEvent(t)); }), (t.prototype.hasEventListener = function (t, e) { return ( void 0 !== this._listenerObjects[t] && (null != e ? -1 !== this._listenerObjects[t].getEventListenerIndex(e) : this._listenerObjects[t].numListeners > 0) ); }), (t.prototype.removeAllEventListeners = function () { this._listenerObjects = {}; }), t ); })(), p = (function () { function t() { (this._index = 0), (this._listeners = new Array()), (this.numListeners = 0); } return ( (t.prototype.addEventListener = function (t) { -1 === this._listeners.indexOf(t) && (this._listeners.push(t), this.numListeners++); }), (t.prototype.removeEventListener = function (t) { var e = this._listeners.indexOf(t); -1 !== e && (this._listeners.splice(e, 1), e <= this._index && this._index--, this.numListeners--); }), (t.prototype.dispatchEvent = function (t) { var e = this.numListeners; for ( this._index = 0; this._index < e && this._index < this.numListeners && (this._listeners[this._index](t), t._iAllowedToImmediatlyPropagate); this._index++ ); }), (t.prototype.getEventListenerIndex = function (t) { return this._listeners.indexOf(t); }), t ); })(), d = (function () { function t() {} return ( Object.defineProperty(t, "Current", { get: function () { return this.id; }, enumerable: !0, configurable: !0, }), (t.Next = function () { return this.id++; }), (t.id = 0), t ); })(), f = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._abstractionPool = {}), (n.id = d.Next()), null == e && (e = "null"), (n._name = e), (n._originalName = e), n.updateFullPath(), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "adaptee", { get: function () { return this; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "adapter", { get: function () { return this._adapter || this; }, set: function (t) { this._adapter = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { throw new u(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "originalName", { get: function () { return this._originalName; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "name", { get: function () { return this._name; }, set: function (t) { var e = this._name; (this._name = t), null == this._name && (this._name = "null"), this.updateFullPath(), this.dispatchEvent(new c(c.RENAME, this, e)); }, enumerable: !0, configurable: !0, }), (n.prototype.invalidate = function () { this.dispatchEvent(new c(c.INVALIDATE, this)); }), (n.prototype.dispose = function () { throw new u(); }), (n.prototype.clone = function () { throw new u(); }), (n.prototype.clear = function () { this.dispatchEvent(new c(c.CLEAR, this)); }), Object.defineProperty(n.prototype, "assetNamespace", { get: function () { return this._namespace; }, set: function (t) { (this._namespace = t || n.DEFAULT_NAMESPACE), this.updateFullPath(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assetFullPath", { get: function () { return this._full_path; }, enumerable: !0, configurable: !0, }), (n.prototype.assetPathEquals = function (t, e) { return this._name == t && (!e || this._namespace == e); }), (n.prototype.isAsset = function (t) { return this.assetType == t.assetType; }), (n.prototype.resetAssetPath = function (t, e, r) { void 0 === e && (e = null), void 0 === r && (r = !0), (this._name = t || "null"), (this._namespace = e || n.DEFAULT_NAMESPACE), r && (this._originalName = this._name), this.updateFullPath(); }), (n.prototype.updateFullPath = function () { this._full_path = [this._namespace, this._name]; }), (n.prototype.getAbstraction = function (t) { return ( this._abstractionPool[t.id] || (this._abstractionPool[t.id] = new (t.requestAbstraction(this))( this, t )) ); }), (n.prototype.clearAbstraction = function (t) { delete this._abstractionPool[t.id]; }), (n.DEFAULT_NAMESPACE = "default"), n ); })(h), g = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e._stopped = !1), (e._loops = 0), (e._id = -1), (e._isLooping = !1), (e._isPlaying = !1), (e._isDecoding = !1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "stopped", { get: function () { return this._stopped; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "onSoundComplete", { set: function (t) { t && this.addEventListener(n.COMPLETE, t); }, enumerable: !0, configurable: !0, }), (n.prototype.isLooping = function () { return this._isLooping; }), (n.prototype.isPlaying = function () { return this._isPlaying; }), (n.prototype.isDecoding = function () { return this._isDecoding; }), (n.prototype.play = function (t, e, n, r, i) { (this.loops = n), (this._id = r || -1), (this._isLooping = this.loops > 0); }), Object.defineProperty(n.prototype, "loops", { get: function () { return this._loops; }, set: function (t) { this._loops = "number" == typeof t ? t : t ? 1e3 : 0; }, enumerable: !0, configurable: !0, }), (n.prototype.dispatchRestart = function () { this.dispatchEvent(n.RESTART_EVENT); }), (n.prototype.tryRestartLoop = function () { return ( this._loops--, !(this._loops <= 0) && (!!this.restart() || ((this._loops = 0), !1)) ); }), (n.prototype.completeInternally = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = !0), (e && this.tryRestartLoop()) || (t && this.dispatchEvent(n.COMPLETE_EVENT)); }), (n.prototype.dispatchComplete = function () { this.dispatchEvent(n.COMPLETE_EVENT); }), (n.prototype.dispatchStop = function (t) { void 0 === t && (t = !1), this.dispatchEvent(t ? n.ERROR_EVENT : n.STOP_EVENT), (this.owner = null), (this._stopped = !0), this.removeAllEventListeners(); }), (n.COMPLETE = "complete"), (n.RESTART = "restart"), (n.STOP = "stop"), (n.ERROR = "error"), (n.RESTART_EVENT = new l(n.RESTART)), (n.COMPLETE_EVENT = new l(n.COMPLETE)), (n.STOP_EVENT = new l(n.STOP)), (n.ERROR_EVENT = new l(n.ERROR)), n ); })(h), _ = (function (t) { function n(e, n, r) { void 0 === e && (e = 0), void 0 === n && (n = 1), void 0 === r && (r = 1); var i = t.call(this) || this; return ( (i._groupID = 0), (i._groupVolume = 1), (i._groupPan = 0), (i._startTime = 0), (i._groupID = e), (i._groupVolume = n), (i._groupPan = r), (i._sourceOpenDelegate = function (t) { return i._sourceOpen(t); }), (i._updateEndDelegate = function (t) { return i._updateEnd(t); }), (i._audio = new Audio()), (i._audio.ontimeupdate = function (t) { return i._onTimeUpdate(t); }), i._updateSource(), i ); } return ( e(n, t), (n.stopAllSounds = function (t) { void 0 === t && (t = -1); var e = n._channels.length; if (t < 0) { for (var r = 0; r < e; r++) n._channels[r].stop(); n._channels.length = 0; } else { var i = []; for (r = 0; r < e; r++) n._channels[r].groupID == t ? n._channels[r].stop() : (i[i.length] = n._channels[r]); n._channels = i; } }), (n.setChannelGroupVolume = function (t, e) { void 0 === e && (e = -1); var r = n._channels.length; if (e < 0) for (var i = 0; i < r; i++) n._channels[i].groupVolume = t; else for (i = 0; i < r; i++) n._channels[i].groupID == e && (n._channels[i].groupVolume = t); }), Object.defineProperty(n.prototype, "duration", { get: function () { return this._duration; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "currentTime", { get: function () { return this._audio.currentTime - this._startTime; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupID", { get: function () { return this._groupID; }, set: function (t) { this._groupID = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupVolume", { get: function () { return this._groupVolume; }, set: function (t) { this._groupVolume != t && ((this._groupVolume = t), (this._audio.volume = this._groupVolume * this._volume)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupPan", { get: function () { return this._groupPan; }, set: function (t) {}, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "volume", { get: function () { return this._volume; }, set: function (t) { this._volume != t && ((this._volume = t), (this._audio.volume = this._volume)); }, enumerable: !0, configurable: !0, }), (n.prototype.isPlaying = function () { return this._isPlaying; }), (n.prototype.isLooping = function () { return this._isLooping; }), (n.prototype.isDecoding = function () { return !1; }), Object.defineProperty(n.prototype, "pan", { get: function () { return 0; }, set: function (t) {}, enumerable: !0, configurable: !0, }), (n.prototype.restart = function () { return ( console.warn("[StreamingAudioChannel] Restart not implemented"), !1 ); }), (n.prototype.play = function (e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = !1), t.prototype.play.call(this, e, n, r, 0), (this._isPlaying = !0), (this._isLooping || this._isLooping != this.loops > 0) && ((this._isLooping = this.loops > 0), (this._sourceDirty = !0)), this._sourceDirty && this._updateSource(), (this._buffer = e), (this._offset = n), (this._audio.volume = this._groupVolume * this._volume), this._isQueuing || this._isOpening || this._queueBuffer(); }), (n.prototype.stopInternally = function (e) { void 0 === e && (e = !1), this._audio.pause(), (this._isPlaying = !1), (this._isLooping = !1), t.prototype.completeInternally.call(this, e, e); }), (n.prototype.stop = function () { this.stopInternally(!1), this.dispatchStop(!1); }), (n.prototype._sourceOpen = function (t) { if ( ((this._isOpening = !1), this._mediaSource.activeSourceBuffers.length) ) return ( console.log("ERR: double sourceopen event called"), void this.dispatchStop(!0) ); (this._sourceBuffer = this._mediaSource.addSourceBuffer("audio/mpeg")), this._sourceBuffer.addEventListener( "updateend", this._updateEndDelegate ), this._isPlaying && this._queueBuffer(); }), (n.prototype._queueBuffer = function () { (this._isQueuing = !0), (this._startTime = this._sourceBuffer.timestampOffset), this._sourceBuffer.appendBuffer(this._buffer); }), (n.prototype._updateEnd = function (t) { (this._isQueuing = !1), this._isLooping && this._mediaSource.endOfStream(), (this._duration = this._sourceBuffer.timestampOffset - this._startTime), (this._audio.currentTime = this._startTime + this._offset), this._audio.play(); }), (n.prototype._onTimeUpdate = function (t) { !this._isLooping && this._duration < this._audio.currentTime - this._startTime + 0.1 && this.stopInternally(!0); }), (n.prototype._updateSource = function () { this._mediaSource && this._disposeSource(), (this._isQueuing = !1), (this._isOpening = !0), (this._mediaSource = new MediaSource()), this._mediaSource.addEventListener( "sourceopen", this._sourceOpenDelegate ), (this._urlString = URL.createObjectURL(this._mediaSource)), (this._audio.src = this._urlString), (this._audio.loop = this._isLooping), (this._sourceDirty = !1); }), (n.prototype._disposeSource = function () { this._isOpening || (this._sourceBuffer.timestampOffset && this._sourceBuffer.remove(0, this._sourceBuffer.timestampOffset), this._sourceBuffer.removeEventListener( "updateend", this._updateEndDelegate ), this._mediaSource.removeSourceBuffer(this._sourceBuffer), delete this._sourceBuffer, (this._sourceBuffer = null)), this._mediaSource.removeEventListener( "sourceopen", this._sourceOpenDelegate ), URL.revokeObjectURL(this._urlString), delete this._mediaSource, (this._mediaSource = null); }), (n.maxChannels = 4), (n._channels = new Array()), n ); })(g), m = (function (t) { function n(e, r, i) { void 0 === e && (e = 0), void 0 === r && (r = 1), void 0 === i && (i = 1); var o = t.call(this) || this; return ( (o._volume = 1), (o._pan = -1), (o._groupID = 0), (o._groupVolume = 1), (o._groupPan = 0), (o._startTime = 0), (o._groupID = e), (o._groupVolume = r), (o._groupPan = i), (o._audioCtx = n.getAudioContext()), (o._usingNativePanner = "function" == typeof o._audioCtx.createStereoPanner), (o._gainNode = o._audioCtx.createGain()), (o._gainNode.gain.value = o._groupVolume * o._volume), (o._pannerNode = o._usingNativePanner ? o._audioCtx.createStereoPanner() : o._audioCtx.createPanner()), (o.pan = 0), o._gainNode.connect(o._pannerNode), o._pannerNode.connect(o._audioCtx.destination), (o._onEndedDelegate = function (t) { return o._onEnded(t); }), o ); } return ( e(n, t), (n.getOfflineContext = function (t, e, n) { void 0 === t && (t = 1), void 0 === e && (e = 0), void 0 === n && (n = 44100); var r = self.OfflineAudioContext || self.webkitOfflineAudioContext; return r ? new r(t, e, n) : null; }), (n.getAudioContext = function () { var t = self.AudioContext || self.webkitAudioContext; return ( !n._audioCtx && t && (n._audioCtx = new t()), n._audioCtx && "suspended" == n._audioCtx.state && n._audioCtx.resume(), n._audioCtx ); }), (n.stopAllSounds = function (t) { void 0 === t && (t = -1); var e = n._channels.length; if (t < 0) { for (var r = 0; r < e; r++) n._channels[r].stop(); n._channels.length = 0; } else { var i = []; for (r = 0; r < e; r++) n._channels[r].groupID == t ? n._channels[r].stop() : (i[i.length] = n._channels[r]); n._channels = i; } }), (n.setChannelGroupVolume = function (t, e) { void 0 === e && (e = -1); var r = n._channels.length; if (e < 0) for (var i = 0; i < r; i++) n._channels[i].groupVolume = t; else for (i = 0; i < r; i++) n._channels[i].groupID == e && (n._channels[i].groupVolume = t); }), Object.defineProperty(n.prototype, "duration", { get: function () { return this._duration; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "currentTime", { get: function () { return this._isDecoding ? this._currentTime : this._audioCtx.currentTime - this._startTime; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupID", { get: function () { return this._groupID; }, set: function (t) { this._groupID = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupVolume", { get: function () { return this._groupVolume; }, set: function (t) { this._groupVolume != t && ((this._groupVolume = t), (this._gainNode.gain.value = this._groupVolume * this._volume)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupPan", { get: function () { return this._groupPan; }, set: function (t) {}, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "volume", { get: function () { return this._volume; }, set: function (t) { this._volume != t && ((this._volume = t), (this._gainNode.gain.value = this._groupVolume * this._volume)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pan", { get: function () { return this._pan; }, set: function (t) { if (this._pan != t) if (((this._pan = t), this._usingNativePanner)) this._pannerNode.pan.value = this._pan; else { var e = this._pan * (Math.PI / 2); this._pannerNode.setPosition(Math.sin(e), 0, Math.cos(e)); } }, enumerable: !0, configurable: !0, }), (n.prototype.restart = function () { if (((this._isPlaying = !1), this._stopped)) throw "You can't restart channel that was fully stopped"; var t = n._decodeCache[this._id]; return ( !!t && ((this._isPlaying = !0), this.executeBuffer(t), this.dispatchRestart(), !0) ); }), (n.prototype.play = function (e, r, i, o, a) { void 0 === r && (r = 0), void 0 === i && (i = !1), void 0 === o && (o = 0), 0 !== e.byteLength ? (t.prototype.play.call(this, e, r, i, o, a), (this._isPlaying = !0), (this._currentTime = r), (this._isDecoding = !0), n._decodeCache[o] ? this.executeBuffer(n._decodeCache[o]) : n._errorCache[o] ? (this.stopInternally(!1), this.dispatchStop(!0)) : this._decodeAndExecute(e, a)) : console.warn("[WabAudioChannel] Input buffer is empty"); }), (n.prototype.stopInternally = function (e) { void 0 === e && (e = !0), this._isPlaying && ((this._isPlaying = !1), (this._isLooping = !1), (this._isDecoding = !1), this._source && this._disposeSource(), t.prototype.completeInternally.call(this, e, e)); }), (n.prototype.stop = function () { this.stopInternally(!1), this.dispatchStop(!1); }), (n.prototype._decodeAndExecute = function (t, e) { var r = this, i = this._audioCtx; try { e && e.sampleRate && e.sampleRate !== this._audioCtx.sampleRate && e.samplesCount && (i = n.getOfflineContext( 2, e.samplesCount + e.startOffset, e.sampleRate )); } catch (t) { console.warn( "[WebAudioChannel] Error when try create Offline Context:", t.message, e ); } var o = i.decodeAudioData( t.slice(0), function (t) { return r._onDecodeComplete(t, e); }, function (t) { return r._onError(t); } ); o instanceof self.Promise && o.catch(function (t) { return r._onError(t); }); }), (n.prototype._onDecodeComplete = function (t, e) { n._decodeCache[this._id] || (e && e.startOffset > 0 && (t = this.removeSilent( t, e.startOffset, e.samplesCount, e.sampleRate )), (n._decodeCache[this._id] = t)), (t = n._decodeCache[this._id]), this._isPlaying && this.executeBuffer(t); }), (n.prototype.executeBuffer = function (t) { this._source && this._disposeSource(), (this._isDecoding = !1), (this._source = this._audioCtx.createBufferSource()), this._source.connect(this._gainNode), (this._source.buffer = t), (this._duration = t.duration), (this._pan = 0), (this._startTime = this._audioCtx.currentTime - this._currentTime), (this._source.onended = this._onEndedDelegate); try { var e = this._groupVolume, n = this._pan; (this._groupVolume = -1), (this._pan = -1), (this.groupVolume = e), (this.pan = n), this._source.start(this._audioCtx.currentTime, this._currentTime); } catch (t) { console.warn("[WebAudioChannel] Error starting audio: " + t), this.dispatchStop(!0), this._disposeSource(); } }), (n.prototype._onError = function (t) { console.warn("[WebAudioChannel] Error with decoding audio data:", t), (n._errorCache[this._id] = !0), (this._isDecoding = !1), this.stopInternally(!1), this.dispatchStop(!0); }), (n.prototype._onEnded = function (t) { this.stopInternally(!0); }), (n.prototype._disposeSource = function () { (this._source.onended = null), this._source.stop(this._audioCtx.currentTime), this._source.disconnect(), (this._source = null); }), (n.prototype.removeSilent = function (t, e, n, r) { void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), (n = n || t.length), (r = r || t.sampleRate), (e = Math.ceil((t.sampleRate * e) / r)), (n = ((t.sampleRate * n) / r) | 0); for ( var i = Math.min(t.length, n + e), o = this._audioCtx.createBuffer( t.numberOfChannels, n, t.sampleRate ), a = 0; a < t.numberOfChannels; a++ ) o.copyToChannel(t.getChannelData(a).subarray(e, i), a, 0); return o; }), (n.maxChannels = 64), (n._channels = new Array()), (n._decodeCache = {}), (n._errorCache = {}), n ); })(g), y = m.getAudioContext(); if (y && "suspended" === y.state) { var A = function () { y.resume(); var t = y.createBuffer(1, 1, 22050), e = y.createBufferSource(); (e.buffer = t), e.connect(y.destination), e.start(), setTimeout(function () { "running" === y.state && document.removeEventListener("mousedown", A, !1); }, 0); }; document.addEventListener("mousedown", A, !1); } var v = (function (t) { function n(e) { void 0 === e && (e = 4); var n = t.call(this) || this; return ( (n._mode = "Typed array"), (n.maxlength = Math.max((e + 255) & -256, 4)), (n.arraybytes = new ArrayBuffer(n.maxlength)), (n.unalignedarraybytestemp = new ArrayBuffer(16)), n ); } return ( e(n, t), (n.prototype.ensureWriteableSpace = function (t) { this.ensureSpace(t + this.position); }), (n.prototype.setArrayBuffer = function (t) { this.ensureSpace(t.byteLength), (this.length = t.byteLength); var e = new Int8Array(t); new Int8Array(this.arraybytes, 0, this.length).set(e), (this.position = 0); }), (n.prototype.writeArrayBuffer = function (t) { this.ensureWriteableSpace(t.byteLength); var e = new Int8Array(t); new Int8Array(this.arraybytes, this.length, t.byteLength).set(e), (this.length += t.byteLength), (this.position = this.length); }), (n.prototype.writeByteArray = function (t) { this.ensureWriteableSpace(t.length); var e = new Int8Array(t.arraybytes, 0, t.length); new Int8Array(this.arraybytes, this.length, t.length).set(e), (this.length += t.length), (this.position = this.length); }), (n.prototype.getBytesAvailable = function () { return this.length - this.position; }), (n.prototype.ensureSpace = function (t) { if (t > this.maxlength) { var e = (t + 255) & -256, n = new ArrayBuffer(e), r = new Uint8Array(this.arraybytes, 0, this.length); new Uint8Array(n, 0, this.length).set(r), (this.arraybytes = n), (this.maxlength = e); } }), (n.prototype.writeObject = function (t) { console.log("writeObject not implemented yet in core/ByteArray"); }), (n.prototype.readObject = function () { return ( console.log("readObject not implemented yet in core/ByteArray"), {} ); }), (n.prototype.writeByte = function (t) { this.ensureWriteableSpace(1), (new Int8Array(this.arraybytes)[this.position++] = ~~t), this.position > this.length && (this.length = this.position); }), (n.prototype.readByte = function () { if (this.position >= this.length) throw ( "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length ); return new Int8Array(this.arraybytes)[this.position++]; }), (n.prototype.readBytes = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = 0), null == n && (n = t.length), t.ensureWriteableSpace(e + n); var r = new Int8Array(t.arraybytes), i = new Int8Array(this.arraybytes); r.set(i.subarray(this.position, this.position + n), e), (this.position += n), n + e > t.length && (t.length += n + e - t.length); }), (n.prototype.writeUnsignedByte = function (t) { this.ensureWriteableSpace(1), (new Uint8Array(this.arraybytes)[this.position++] = 255 & ~~t), this.position > this.length && (this.length = this.position); }), (n.prototype.readUnsignedByte = function () { if (this.position >= this.length) throw ( "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length ); return new Uint8Array(this.arraybytes)[this.position++]; }), (n.prototype.writeUnsignedShort = function (t) { if ((this.ensureWriteableSpace(2), 0 == (1 & this.position))) { new Uint16Array(this.arraybytes)[this.position >> 1] = 65535 & ~~t; } else { new Uint16Array(this.unalignedarraybytestemp, 0, 1)[0] = 65535 & ~~t; var e = new Uint8Array(this.arraybytes, this.position, 2), n = new Uint8Array(this.unalignedarraybytestemp, 0, 2); e.set(n); } (this.position += 2), this.position > this.length && (this.length = this.position); }), (n.prototype.readUTFBytes = function (t) { for ( var e = "", n = this.position + t, r = new DataView(this.arraybytes); this.position < n; ) { var i = r.getUint8(this.position++); if (i < 128) { if (0 == i) break; e += String.fromCharCode(i); } else if (i < 224) e += String.fromCharCode( ((63 & i) << 6) | (127 & r.getUint8(this.position++)) ); else if (i < 240) { var o = r.getUint8(this.position++); e += String.fromCharCode( ((31 & i) << 12) | ((127 & o) << 6) | (127 & r.getUint8(this.position++)) ); } else { o = r.getUint8(this.position++); var a = r.getUint8(this.position++); e += String.fromCharCode( ((15 & i) << 18) | ((127 & o) << 12) | ((a << 6) & 127) | (127 & r.getUint8(this.position++)) ); } } return e; }), (n.prototype.writeUTFBytes = function (t) { var e = encodeURIComponent(t).replace( /%([0-9A-F]{2})/g, function (t, e) { return String.fromCharCode(parseInt("0x" + e)); } ); this.ensureWriteableSpace(4 + e.length), this.writeInt(e.length); for (var n = 0; n < e.length; n++) this.writeUnsignedByte(e.charCodeAt(n)); if (e.length % 4) { var r = e.length % 4; for (n = 0; n < r; n++) this.writeUnsignedByte(0); } return e.length; }), (n.prototype.readInt = function () { var t = new DataView(this.arraybytes).getInt32(this.position, !0); return (this.position += 4), t; }), (n.prototype.readShort = function () { var t = new DataView(this.arraybytes).getInt16(this.position, !0); return (this.position += 2), t; }), (n.prototype.readDouble = function () { var t = new DataView(this.arraybytes).getFloat64(this.position, !0); return (this.position += 8), t; }), (n.prototype.readUnsignedShort = function () { if (this.position > this.length + 2) throw ( "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length ); if (0 == (1 & this.position)) { var t = new Uint16Array(this.arraybytes), e = this.position >> 1; return (this.position += 2), t[e]; } t = new Uint16Array(this.unalignedarraybytestemp, 0, 1); var n = new Uint8Array(this.arraybytes, this.position, 2); return ( new Uint8Array(this.unalignedarraybytestemp, 0, 2).set(n), (this.position += 2), t[0] ); }), (n.prototype.writeUnsignedInt = function (t) { if ((this.ensureWriteableSpace(4), 0 == (3 & this.position))) { new Uint32Array(this.arraybytes)[this.position >> 2] = 4294967295 & ~~t; } else { new Uint32Array(this.unalignedarraybytestemp, 0, 1)[0] = 4294967295 & ~~t; var e = new Uint8Array(this.arraybytes, this.position, 4), n = new Uint8Array(this.unalignedarraybytestemp, 0, 4); e.set(n); } (this.position += 4), this.position > this.length && (this.length = this.position); }), (n.prototype.writeInt = function (t) { if ((this.ensureWriteableSpace(4), 0 == (3 & this.position))) { new Int32Array(this.arraybytes)[this.position >> 2] = ~~t; } else { new Int32Array(this.unalignedarraybytestemp, 0, 1)[0] = ~~t; var e = new Uint8Array(this.arraybytes, this.position, 4), n = new Uint8Array(this.unalignedarraybytestemp, 0, 4); e.set(n); } (this.position += 4), this.position > this.length && (this.length = this.position); }), (n.prototype.readUnsignedInt = function () { if (this.position > this.length + 4) throw ( "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length ); if (0 == (3 & this.position)) { var t = new Uint32Array(this.arraybytes), e = this.position >> 2; return (this.position += 4), t[e]; } t = new Uint32Array(this.unalignedarraybytestemp, 0, 1); var n = new Uint8Array(this.arraybytes, this.position, 4); return ( new Uint8Array(this.unalignedarraybytestemp, 0, 4).set(n), (this.position += 4), t[0] ); }), (n.prototype.writeFloat = function (t) { if ((this.ensureWriteableSpace(4), 0 == (3 & this.position))) { new Float32Array(this.arraybytes)[this.position >> 2] = t; } else { new Float32Array(this.unalignedarraybytestemp, 0, 1)[0] = t; var e = new Uint8Array(this.arraybytes, this.position, 4), n = new Uint8Array(this.unalignedarraybytestemp, 0, 4); e.set(n); } (this.position += 4), this.position > this.length && (this.length = this.position); }), (n.prototype.readFloat = function () { if (this.position > this.length + 4) throw ( "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length ); if (0 == (3 & this.position)) { var t = new Float32Array(this.arraybytes), e = this.position >> 2; return (this.position += 4), t[e]; } t = new Float32Array(this.unalignedarraybytestemp, 0, 1); var n = new Uint8Array(this.arraybytes, this.position, 4); return ( new Uint8Array(this.unalignedarraybytestemp, 0, 4).set(n), (this.position += 4), t[0] ); }), n ); })( (function () { function t() { (this.position = 0), (this.length = 0), (this._mode = ""); } return ( (t.prototype.writeByte = function (t) { throw "Virtual method"; }), (t.prototype.readByte = function () { throw "Virtual method"; }), (t.prototype.writeUnsignedByte = function (t) { throw "Virtual method"; }), (t.prototype.readUnsignedByte = function () { throw "Virtual method"; }), (t.prototype.writeUnsignedShort = function (t) { throw "Virtual method"; }), (t.prototype.readUnsignedShort = function () { throw "Virtual method"; }), (t.prototype.writeUnsignedInt = function (t) { throw "Virtual method"; }), (t.prototype.readUnsignedInt = function () { throw "Virtual method"; }), (t.prototype.writeFloat = function (t) { throw "Virtual method"; }), (t.prototype.toFloatBits = function (t) { throw "Virtual method"; }), (t.prototype.readFloat = function (t) { throw "Virtual method"; }), (t.prototype.fromFloatBits = function (t) { throw "Virtual method"; }), (t.prototype.getBytesAvailable = function () { throw new u("ByteArrayBase, getBytesAvailable() not implemented "); }), (t.prototype.toString = function () { return ( "[ByteArray] ( " + this._mode + " ) position=" + this.position + " length=" + this.length ); }), (t.prototype.compareEqual = function (t, e) { (null == e || e > this.length - this.position) && (e = this.length - this.position), e > t.length - t.position && (e = t.length - t.position); for (var n = e, r = !0; r && e >= 4; ) (e -= 4), this.readUnsignedInt() != t.readUnsignedInt() && (r = !1); for (; r && e >= 1; ) e--, this.readUnsignedByte() != t.readUnsignedByte() && (r = !1); return (this.position -= n - e), (t.position -= n - e), r; }), (t.prototype.writeBase64String = function (t) {}), (t.prototype.dumpToConsole = function () { var t = this.position; this.position = 0; function e(t, e) { for ( var n = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", ], r = "", i = 0; i < e; i++ ) r = n[(t >> (i << 2)) & 15] + r; return r; } for (var n = 0; n < this.length; n += 8) { for ( var r = e(n, 4) + ":", i = 0; i < 8 && n + i < this.length; i++ ) r += " " + e(this.readUnsignedByte(), 2); console.log(r); } this.position = t; }), (t.prototype.readBase64String = function (e) { return ( (null == e || e > this.length - this.position) && (e = this.length - this.position), e > 0 ? t.internalGetBase64String(e, this.readUnsignedByte, this) : "" ); }), (t.internalGetBase64String = function (e, n, r) { for (var i, o, a, s, u, l, c, h = "", p = t.Base64Key; e >= 3; ) (s = (i = n.apply(r)) >> 2), (u = ((3 & i) << 4) | ((o = n.apply(r)) >> 4)), (l = ((15 & o) << 2) | ((a = n.apply(r)) >> 6)), (c = 63 & a), (h += p.charAt(s) + p.charAt(u) + p.charAt(l) + p.charAt(c)), (e -= 3); return ( 2 == e ? ((s = (i = n.apply(r)) >> 2), (u = ((3 & i) << 4) | ((o = n.apply(r)) >> 4)), (l = (15 & o) << 2), (h += p.charAt(s) + p.charAt(u) + p.charAt(l) + "=")) : 1 == e && ((s = (i = n.apply(r)) >> 2), (u = (3 & i) << 4), (h += p.charAt(s) + p.charAt(u) + "==")), h ); }), (t.Base64Key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), t ); })() ), b = (function () { function t() {} return ( (t.arrayBufferToBase64 = function (t, e) { for ( var n = "", r = new Uint8Array(t), i = r.byteLength, o = 0; o < i; o++ ) n += String.fromCharCode(r[o]); return "data:" + e + ";base64," + window.btoa(n); }), (t.arrayBufferToAudio = function (e, n) { var r = t.arrayBufferToBase64(e, "audio/" + n), i = new Audio(); return (i.src = r), i; }), (t.arrayBufferToImage = function (e) { var n = t.arrayBufferToBase64(e, "image/png"), r = new Image(); return (r.src = n), r; }), (t.byteArrayToImage = function (e) { var n = t.arrayBufferToBase64(e.arraybytes, "image/png"), r = new Image(); return (r.src = n), r; }), (t.byteArrayToAudio = function (e, n) { var r = t.arrayBufferToBase64(e.arraybytes, "audio/" + n), i = new Audio(); return (i.src = r), i; }), (t.blobToImage = function (t) { var e = (window.URL || window.webkitURL).createObjectURL(t), n = new Image(); return (n.src = e), n; }), (t.blobToAudio = function (t) { var e = (window.URL || window.webkitURL).createObjectURL(t), n = new Audio(); return (n.src = e), n; }), (t.toByteArray = function (t) { var e = new v(); return e.setArrayBuffer(t), e; }), (t.toString = function (t, e) { if ((void 0 === e && (e = 0), "string" == typeof t)) { var n = t; if (null != n.substr) return n.substr(0, n.length); } if (t instanceof v) { var r = t; return ( (r.position = 0), r.readUTFBytes(Math.min(r.getBytesAvailable(), e)) ); } return null; }), t ); })(), C = (function (t) { function n(e, n, r) { void 0 === e && (e = 0), void 0 === n && (n = 1), void 0 === r && (r = 1); var i = t.call(this) || this; return ( (i._groupID = 0), (i._groupVolume = 1), (i._groupPan = 0), (i._startTime = 0), (i._groupID = e), (i._groupVolume = n), (i._groupPan = r), (i._audio = new Audio()), (i._audio.ontimeupdate = function (t) { return i._onTimeUpdate(t); }), i ); } return ( e(n, t), (n.stopAllSounds = function (t) { void 0 === t && (t = -1); var e = n._channels.length; if (t < 0) { for (var r = 0; r < e; r++) n._channels[r].stop(); n._channels.length = 0; } else { var i = []; for (r = 0; r < e; r++) n._channels[r].groupID == t ? n._channels[r].stop() : (i[i.length] = n._channels[r]); n._channels = i; } }), (n.setChannelGroupVolume = function (t, e) { void 0 === e && (e = -1); var r = n._channels.length; if (e < 0) for (var i = 0; i < r; i++) n._channels[i].groupVolume = t; else for (i = 0; i < r; i++) n._channels[i].groupID == e && (n._channels[i].groupVolume = t); }), Object.defineProperty(n.prototype, "duration", { get: function () { return this._duration; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "currentTime", { get: function () { return this._audio.currentTime - this._startTime; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pan", { get: function () { return 0; }, set: function (t) {}, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupID", { get: function () { return this._groupID; }, set: function (t) { this._groupID = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupVolume", { get: function () { return this._groupVolume; }, set: function (t) { this._groupVolume != t && ((this._groupVolume = t), (this._audio.volume = this._groupVolume * this._volume)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "groupPan", { get: function () { return this._groupPan; }, set: function (t) {}, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "volume", { get: function () { return this._volume; }, set: function (t) { this._volume != t && ((this._volume = t), (this._audio.volume = this._volume)); }, enumerable: !0, configurable: !0, }), (n.prototype.isPlaying = function () { return this._isPlaying; }), (n.prototype.isLooping = function () { return this._isLooping; }), (n.prototype.isDecoding = function () { return !1; }), (n.prototype.restart = function () { if (((this._isPlaying = !1), this._stopped)) throw "You can't restart channel that was fully stopped"; return ( !!this._audio && ((this._isPlaying = !0), this._audio.play(), this.dispatchRestart(), !0) ); }), (n.prototype.play = function (e, r, i, o) { var a = this; void 0 === r && (r = 0), void 0 === i && (i = !1), void 0 === o && (o = 0), t.prototype.play.call(this, e, r, i, o), (this._isPlaying = !0), (this._isLooping = this.loops > 0), (this._audio.src = n._base64Cache[o] || (n._base64Cache[o] = b.arrayBufferToBase64(e, "audio/mp3"))); var s = this._audio; this._audio.addEventListener( "loadedmetadata", function () { (s.currentTime = r), s.play(); }, !1 ), this._audio.addEventListener( "error", function (t) { console.log("error in audio", t), a.dispatchStop(!0); }, !1 ), this._audio.addEventListener( "canplay", function (t) { console.log("canplay in audio", t); }, !1 ), this._audio.addEventListener( "canplaythrough", function (t) { console.log("canplaythrough in audio", t); }, !1 ), this._audio.addEventListener( "abort", function (t) { console.log("abort in audio", t), a.dispatchStop(!0); }, !1 ), this._audio.addEventListener( "loadstart", function (t) { console.log("loadstart in audio", t); }, !1 ), this._audio.addEventListener( "suspend", function (t) { console.log("suspend in audio", t); }, !1 ); }), (n.prototype.stopInternally = function (e) { void 0 === e && (e = !1), this._audio.pause(), (this._isPlaying = !1), (this._isLooping = !1), t.prototype.completeInternally.call(this, e, e); }), (n.prototype.stop = function () { this.stopInternally(!1), this.dispatchStop(!1); }), (n.prototype._onTimeUpdate = function (t) { !this._isLooping && this._audio.duration < this._audio.currentTime - this._startTime + 0.1 && this.stopInternally(!0); }), (n.maxChannels = 4), (n._channels = new Array()), (n._base64Cache = {}), n ); })(g), I = (function () { function t() {} return ( (t.setVolume = function (e, n) { if ((void 0 === n && (n = -1), n < 0)) for (var r = t._channelGroupVolumes.length, i = 0; i < r; i++) t._channelGroupVolumes[i] = e; else t._channelGroupVolumes[n] = e; m.setChannelGroupVolume(e, n), _.setChannelGroupVolume(e, n), C.setChannelGroupVolume(e, n); }), (t.getVolume = function (e) { return void 0 === e && (e = 0), t._channelGroupVolumes[e]; }), (t.setExternalSoundInterface = function (e) { null != e.startSound ? null != e.stopSound ? (t._externalSoundInterface = e) : console.log( "Could not set the externalSoundInterface, because it does not provide a 'stopSound' function" ) : console.log( "Could not set the externalSoundInterface, because it does not provide a 'startSound' function" ); }), (t.getExternalSoundInterface = function () { return t._externalSoundInterface; }), (t.stopAllSounds = function () { m.stopAllSounds(), _.stopAllSounds(), C.stopAllSounds(); }), (t.getChannel = function (e, n) { void 0 === n && (n = 0); var r = e > 5e7 ? _ : m; t.isIE && (r = C); for (var i = 0; r._channels[i] && r._channels[i].isPlaying(); ) i++; if (i == r.maxChannels) { for (var o = void 0, a = r._channels.length, s = 0; s < a; s++) if (!(o = r._channels[s]).isLooping() && !o.isDecoding()) return ( (o.groupID = n), (o.groupVolume = t._channelGroupVolumes[n]), (o.groupPan = t._channelGroupPanning[n]), r._channels.push(r._channels.splice(s, 1)[0]), o.stop(), o ); return null; } return (r._channels[i] = new r( n, t._channelGroupVolumes[n], t._channelGroupPanning[n] )); }), (t.isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g)), (t._externalSoundInterface = null), (t._channelGroupVolumes = [1]), (t._channelGroupPanning = [0.5]), t ); })(), E = (function (t) { function n(e, n) { void 0 === n && (n = 0); var r = t.call(this) || this; return ( (r._volume = 1), (r._pan = 0), (r._audioChannels = []), (r._isPlaying = !1), (r._channelsPlaying = 0), (r._data = e), (r._channelGroup = n), (r.onChannelCompleteStopError = r.onChannelCompleteStopError.bind(r)), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "isPlaying", { get: function () { return !!this._audioChannel && this._audioChannel.isPlaying(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.detachChannel = function (t) { t && ((t.owner = null), t.removeEventListener(g.COMPLETE, this.onChannelCompleteStopError), t.removeEventListener(g.STOP, this.onChannelCompleteStopError), t.removeEventListener(g.ERROR, this.onChannelCompleteStopError)); }), (n.prototype.attachChannel = function (t) { t && ((t.owner = this), t.addEventListener(g.COMPLETE, this.onChannelCompleteStopError), t.addEventListener(g.STOP, this.onChannelCompleteStopError), t.addEventListener(g.ERROR, this.onChannelCompleteStopError)); }), (n.prototype.onChannelCompleteStopError = function (t) { var e = t.target, n = this._audioChannels.indexOf(e); n >= 0 && (this.detachChannel(e), this._audioChannels.splice(n, 1), this._channelsPlaying--), 0 === this._channelsPlaying && (this.stopInternal(!1), this._onSoundComplete && this._onSoundComplete()); }), Object.defineProperty(n.prototype, "pan", { get: function () { return this._pan; }, set: function (t) { this._pan != t && ((this._pan = t), this._audioChannel && (this._audioChannel.pan = this._pan)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "channelGroup", { get: function () { return this._channelGroup; }, set: function (t) { if (this._channelGroup != t) { this._channelGroup = t; for ( var e = I.getVolume(t), n = 0; n < this._audioChannels.length; n++ ) this._audioChannels[n].groupVolume = e; } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "volume", { get: function () { return this._volume; }, set: function (t) { if (this._volume != t) { (this._volume = t), this._audioChannel && (this._audioChannel.volume = this._volume); for (var e = 0; e < this._audioChannels.length; e++) this._audioChannels[e].volume = this._volume; } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "currentTime", { get: function () { return this._audioChannel ? this._audioChannel.currentTime : 0; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "duration", { get: function () { return this._audioChannel ? this._audioChannel.duration : 0; }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { (this._isPlaying = !1), this.stop(); }), (n.prototype.play = function (t, e) { return ( void 0 === e && (e = !1), (this._isPlaying = !0), (this._audioChannel = I.getChannel( this._data.size, this.channelGroup )), this._audioChannel && (this._channelsPlaying++, this._audioChannels.push(this._audioChannel), (this._audioChannel.volume = this._volume), this.attachChannel(this._audioChannel), this._data.play(this._audioChannel, t, e, this.id)), this._audioChannel ); }), Object.defineProperty(n.prototype, "onSoundComplete", { set: function (t) { this._onSoundComplete = t; }, enumerable: !0, configurable: !0, }), (n.prototype.stopInternal = function (t) { void 0 === t && (t = !1), (this._isPlaying = !1); for (var e = 0, n = this._audioChannels; e < n.length; e++) { var r = n[e]; (r.stopped || t) && this.detachChannel(r), t && r.stop(); } (this._channelsPlaying = 0), (this._audioChannels.length = 0), (this._audioChannel = null); }), (n.prototype.stop = function () { this.stopInternal(!0); }), (n.prototype.clone = function () { var t = new n(this._data); return (t.name = this.name), t; }), (n.assetType = "[asset WaveAudio]"), n ); })(f), x = (function () { function t(t, e) { t instanceof Blob ? (this._blob = t) : t instanceof v ? (this._buffer = t.arraybytes) : ArrayBuffer.isView(t) ? (this._buffer = t.buffer) : (this._buffer = t), (this.meta = e); } return ( Object.defineProperty(t.prototype, "size", { get: function () { return this._buffer ? this._buffer.byteLength : this._blob.size; }, enumerable: !0, configurable: !0, }), (t.prototype.play = function (t, e, n, r) { var i = this; if (this._buffer) t.play(this._buffer, e, n, r, this.meta); else if (!this._loading) { this._loading = !0; var o = new FileReader(); (o.onload = function (o) { return i._blobConverted(o, t, e, n, r); }), o.readAsArrayBuffer(this._blob); } }), (t.prototype._blobConverted = function (t, e, n, r, i) { (this._buffer = t.target.result), e.play(this._buffer, n, r, i, this.meta); }), t ); })(), w = (function () { function t() {} return ( (t.float32ColorToARGB = function (t) { return [ (4278190080 & t) >>> 24, (16711680 & t) >>> 16, (65280 & t) >>> 8, 255 & t, ]; }), (t.f32_RGBA_To_f32_ARGB = function (t) { return ( ((255 & t) << 24) | (((4278190080 & t) >>> 24) << 16) | (((16711680 & t) >>> 16) << 8) | ((65280 & t) >>> 8) ); }), (t.f32_RGB_To_f32_ARGB = function (t) { return ( ((255 & t) << 24) | (((4278190080 & t) >>> 24) << 16) | (((16711680 & t) >>> 16) << 8) | ((65280 & t) >>> 8) ); }), (t.prototype.getAlphaFromF32RGBA = function (t) { return 255 & t; }), (t.ARGBtoFloat32 = function (t, e, n, r) { return (t << 24) | (e << 16) | (n << 8) | r; }), (t.componentToHex = function (t) { var e = t.toString(16); return 1 == e.length ? "0" + e : e; }), (t.RGBToHexString = function (e) { return ( "#" + t.componentToHex(e[1]) + t.componentToHex(e[2]) + t.componentToHex(e[3]) ); }), (t.ARGBToHexString = function (e) { return ( "#" + t.componentToHex(e[0]) + t.componentToHex(e[1]) + t.componentToHex(e[2]) + t.componentToHex(e[3]) ); }), (t.interpolateFloat32Color = function (t, e, n) { var r = 1 - n; return ( ((((4278190080 & t) >>> 24) * r + ((4278190080 & e) >>> 24) * n) << 24) | ((((16711680 & t) >>> 16) * r + ((16711680 & e) >>> 16) * n) << 16) | ((((65280 & t) >>> 8) * r + ((65280 & e) >>> 8) * n) << 8) | ((255 & t) * r + (255 & e) * n) ); }), t ); })(), S = (function () { function t(t, e, n, r, i, o, a, s) { void 0 === t && (t = 1), void 0 === e && (e = 1), void 0 === n && (n = 1), void 0 === r && (r = 1), void 0 === i && (i = 0), void 0 === o && (o = 0), void 0 === a && (a = 0), void 0 === s && (s = 0), (this._isDirty = !1), t instanceof Float32Array ? (this._rawData = t) : ((this._rawData = new Float32Array(8)), (this.redMultiplier = Number(t)), (this.greenMultiplier = e), (this.blueMultiplier = n), (this.alphaMultiplier = r), (this.redOffset = i), (this.greenOffset = o), (this.blueOffset = a), (this.alphaOffset = s)); } return ( Object.defineProperty(t.prototype, "isDirty", { get: function () { return this._isDirty; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "isIdentity", { get: function () { return !this._isDirty; }, enumerable: !0, configurable: !0, }), (t.prototype.concat = function (t) { (this._rawData[0] *= t._rawData[0]), (this._rawData[1] *= t._rawData[1]), (this._rawData[2] *= t._rawData[2]), (this._rawData[3] *= t._rawData[3]), (this._rawData[4] += t._rawData[4]), (this._rawData[5] += t._rawData[5]), (this._rawData[6] += t._rawData[6]), (this._rawData[7] += t._rawData[7]), (this._isDirty = this._isDirty || t._isDirty); }), Object.defineProperty(t.prototype, "alphaMultiplier", { get: function () { return this._rawData[3]; }, set: function (t) { (this._rawData[3] = t), (this._isDirty = this._isDirty || 1 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "alphaOffset", { get: function () { return this._rawData[7]; }, set: function (t) { (this._rawData[7] = t), (this._isDirty = this._isDirty || 0 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "blueMultiplier", { get: function () { return this._rawData[2]; }, set: function (t) { (this._rawData[2] = t), (this._isDirty = this._isDirty || 1 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "blueOffset", { get: function () { return this._rawData[6]; }, set: function (t) { (this._rawData[6] = t), (this._isDirty = this._isDirty || 0 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "greenMultiplier", { get: function () { return this._rawData[1]; }, set: function (t) { (this._rawData[1] = t), (this._isDirty = this._isDirty || 1 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "greenOffset", { get: function () { return this._rawData[5]; }, set: function (t) { (this._rawData[5] = t), (this._isDirty = this._isDirty || 0 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "redMultiplier", { get: function () { return this._rawData[0]; }, set: function (t) { (this._rawData[0] = t), (this._isDirty = this._isDirty || 1 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "redOffset", { get: function () { return this._rawData[4]; }, set: function (t) { (this._rawData[4] = t), (this._isDirty = this._isDirty || 0 !== t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "color", { get: function () { return ( (this._rawData[4] << 16) | (this._rawData[5] << 8) | this._rawData[6] ); }, set: function (t) { var e = w.float32ColorToARGB(t); (this._rawData[4] = e[1]), (this._rawData[5] = e[2]), (this._rawData[6] = e[3]), (this._rawData[0] = 0), (this._rawData[1] = 0), (this._rawData[2] = 0), (this._isDirty = !0); }, enumerable: !0, configurable: !0, }), (t.prototype.copyRawDataFrom = function (t) { var e = this._rawData; (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (this._isDirty = !0); }), (t.prototype.clear = function () { (this._rawData[0] = 1), (this._rawData[1] = 1), (this._rawData[2] = 1), (this._rawData[3] = 1), (this._rawData[4] = 0), (this._rawData[5] = 0), (this._rawData[6] = 0), (this._rawData[7] = 0), (this._isDirty = !1); }), (t.prototype.clone = function () { var e = new t(); return e.copyFrom(this), e; }), (t.prototype.copyFrom = function (t) { var e = t._rawData, n = this._rawData; (n[0] = e[0]), (n[1] = e[1]), (n[2] = e[2]), (n[3] = e[3]), (n[4] = e[4]), (n[5] = e[5]), (n[6] = e[6]), (n[7] = e[7]), (this._isDirty = t._isDirty); }), (t.prototype.copyTo = function (t) { t.copyFrom(this); }), (t.prototype.prepend = function (t) { (this._rawData[4] += t._rawData[4] * this._rawData[0]), (this._rawData[5] += t._rawData[5] * this._rawData[1]), (this._rawData[6] += t._rawData[6] * this._rawData[2]), (this._rawData[7] += t._rawData[7] * this._rawData[3]), (this.redMultiplier *= t.redMultiplier), (this.greenMultiplier *= t.greenMultiplier), (this.blueMultiplier *= t.blueMultiplier), (this.alphaMultiplier *= t.alphaMultiplier), (this._isDirty = this._isDirty || t._isDirty); }), (t.prototype._isRenderable = function () { return 0 != this._rawData[3] || this._rawData[7] > 0; }), t ); })(), D = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._transform = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "transform", { get: function () { return this._transform; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._transform); }), (n.INVALIDATE_MATRIX3D = "invalidateMatrix3D"), (n.INVALIDATE_COLOR_TRANSFORM = "invalidateColorTransform"), n ); })(l), T = (function (t) { function n(e, n) { return ( void 0 === e && (e = null), void 0 === n && (n = 0), t.call(this, e || "ArgumentError", n) || this ); } return e(n, t), n; })(s), P = (function () { function t(t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0), (this._rawData = new Float32Array(2)), (this._rawData[0] = t), (this._rawData[1] = e); } return ( Object.defineProperty(t.prototype, "x", { get: function () { return this._rawData[0]; }, set: function (t) { this._rawData[0] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "y", { get: function () { return this._rawData[1]; }, set: function (t) { this._rawData[1] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "length", { get: function () { return Math.sqrt( this._rawData[0] * this._rawData[0] + this._rawData[1] * this._rawData[1] ); }, enumerable: !0, configurable: !0, }), (t.prototype.add = function (e) { return new t( this._rawData[0] + e._rawData[0], this._rawData[1] + e._rawData[1] ); }), (t.prototype.clone = function () { return new t(this.x, this.y); }), (t.prototype.copyFrom = function (t) { (this._rawData[0] = t._rawData[0]), (this._rawData[1] = t._rawData[1]); }), (t.prototype.equals = function (t) { return ( this._rawData[0] === t._rawData[0] && this._rawData[1] == t._rawData[1] ); }), (t.prototype.normalize = function (t) { void 0 === t && (t = 1); var e = this.length; if ((0 !== this.x || 0 !== this.y) && e) { var n = t / e; (this._rawData[0] *= n), (this._rawData[1] *= n); } }), (t.prototype.offset = function (t, e) { (this._rawData[0] += t), (this._rawData[1] += e); }), (t.prototype.setTo = function (t, e) { (this._rawData[0] = t), (this._rawData[1] = e); }), (t.prototype.subtract = function (e) { return new t(this.x - e.x, this.y - e.y); }), (t.prototype.toString = function () { return "[Point] (x=" + this.x + ", y=" + this.y + ")"; }), (t.distance = function (t, e) { var n = e.x - t.x, r = e.y - t.y; return 0 === n ? Math.abs(r) : 0 === r ? Math.abs(n) : Math.sqrt(n * n + r * r); }), (t.interpolate = function (e, n, r) { var i = 1 - r, o = e._rawData, a = n._rawData; return new t(o[0] * r + a[0] * i, o[1] * r + a[1] * i); }), (t.polar = function (e, n) { return new t(e * Math.cos(n), e * Math.sin(n)); }), t ); })(), O = (function () { function t(t, e, n, r, i, o) { if ( (void 0 === t && (t = 1), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 1), void 0 === i && (i = 0), void 0 === o && (o = 0), (this.rawData = new Float32Array(6)), t instanceof Float32Array) ) this.copyRawDataFrom(t); else { var a = this.rawData; (a[0] = Number(t)), (a[1] = e), (a[2] = n), (a[3] = r), (a[4] = i), (a[5] = o); } } return ( Object.defineProperty(t.prototype, "a", { get: function () { return this.rawData[0]; }, set: function (t) { this.rawData[0] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "b", { get: function () { return this.rawData[1]; }, set: function (t) { this.rawData[1] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "c", { get: function () { return this.rawData[2]; }, set: function (t) { this.rawData[2] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "d", { get: function () { return this.rawData[3]; }, set: function (t) { this.rawData[3] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "tx", { get: function () { return this.rawData[4]; }, set: function (t) { this.rawData[4] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "ty", { get: function () { return this.rawData[5]; }, set: function (t) { this.rawData[5] = t; }, enumerable: !0, configurable: !0, }), (t.prototype.copyRawDataFrom = function (t, e) { void 0 === e && (e = 0); var n = this.rawData; (n[0] = t[e + 0]), (n[1] = t[e + 1]), (n[2] = t[e + 2]), (n[3] = t[e + 3]), (n[4] = t[e + 4]), (n[5] = t[e + 5]); }), (t.prototype.clone = function () { var e = this.rawData; return new t(e[0], e[1], e[2], e[3], e[4], e[5]); }), (t.prototype.concat = function (t) { var e = this.rawData, n = t.rawData, r = e[0] * n[0], i = 0, o = 0, a = e[3] * n[3], s = e[4] * n[0] + n[4], u = e[5] * n[3] + n[5]; (0 === e[1] && 0 === e[2] && 0 === n[1] && 0 === n[2]) || ((r += e[1] * n[2]), (a += e[2] * n[1]), (i += e[0] * n[1] + e[1] * n[3]), (o += e[2] * n[0] + e[3] * n[2]), (s += e[5] * n[2]), (u += e[4] * n[1])), (e[0] = r), (e[1] = i), (e[2] = o), (e[3] = a), (e[4] = s), (e[5] = u); }), (t.prototype.copyColumnFrom = function (t, e) { var n = this.rawData, r = e._rawData; if (t > 2) throw "Column " + t + " out of bounds (2)"; 0 == t ? ((n[0] = r[0]), (n[1] = r[1])) : 1 == t ? ((n[2] = r[0]), (n[3] = r[1])) : ((n[4] = r[0]), (n[5] = r[1])); }), (t.prototype.copyColumnTo = function (t, e) { var n = this.rawData, r = e._rawData; if (t > 2) throw new T( "ArgumentError, Column " + t + " out of bounds [0, ..., 2]" ); 0 == t ? ((r[0] = n[0]), (r[1] = n[1]), (r[2] = 0)) : 1 == t ? ((r[0] = n[2]), (r[1] = n[3]), (r[2] = 0)) : ((r[0] = n[4]), (r[1] = n[5]), (r[2] = 1)); }), (t.prototype.copyFrom = function (t) { var e = this.rawData, n = t.rawData; (e[0] = n[0]), (e[1] = n[1]), (e[2] = n[2]), (e[3] = n[3]), (e[4] = n[4]), (e[5] = n[5]); }), (t.prototype.copyRowFrom = function (t, e) { var n = this.rawData, r = e._rawData; if (t > 2) throw new T( "ArgumentError, Row " + t + " out of bounds [0, ..., 2]" ); 0 == t ? ((n[0] = r[0]), (n[2] = r[1]), (n[4] = r[2])) : ((n[1] = r[0]), (n[3] = r[1]), (n[5] = r[2])); }), (t.prototype.copyRowTo = function (t, e) { var n = this.rawData, r = e._rawData; if (t > 2) throw new T( "ArgumentError, Row " + t + " out of bounds [0, ..., 2]" ); 0 == t ? ((r[0] = n[0]), (r[1] = n[2]), (r[2] = n[4])) : 1 == t ? ((r[0] = n[1]), (r[1] = n[3]), (r[2] = n[5])) : ((r[0] = 0), (r[1] = 0), (r[2] = 1)); }), (t.prototype.createBox = function (t, e, n, r, i) { void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0); var o = this.rawData; if (0 !== n) { var a = Math.cos(n), s = Math.sin(n); (o[0] = a * t), (o[1] = s * e), (o[2] = -s * t), (o[3] = a * e); } else (o[0] = t), (o[1] = 0), (o[2] = 0), (o[3] = e); (o[4] = r), (o[5] = i); }), (t.prototype.createGradientBox = function (t, e, n, r, i) { void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), this.createBox(t / 1638.4, e / 1638.4, n, r + t / 2, i + e / 2); }), (t.prototype.deltaTransformPoint = function (t) { var e = this.rawData; return new P(t.x * e[0] + t.y * e[2], t.x * e[1] + t.y * e[3]); }), (t.prototype.identity = function () { var t = this.rawData; (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 1), (t[4] = 0), (t[5] = 0); }), (t.prototype.invert = function () { var t = this.rawData, e = t[1], n = t[2], r = t[4], i = t[5]; if (0 === e && 0 === n) { var o = (t[0] = 1 / t[0]), a = (t[3] = 1 / t[3]); return (t[1] = t[2] = 0), (t[4] = -o * r), void (t[5] = -a * i); } var s = t[0], u = t[3], l = s * u - e * n; if (0 !== l) { l = 1 / l; var c; (c = t[0] = u * l), (e = t[1] = -e * l), (n = t[2] = -n * l), (u = t[3] = s * l), (t[4] = -(c * r + n * i)), (t[5] = -(e * r + u * i)); } else this.identity(); }), (t.prototype.multiply = function (e) { var n = new t(); return ( (n.a = this.a * e.a + this.b * e.c), (n.b = this.a * e.b + this.b * e.d), (n.c = this.c * e.a + this.d * e.c), (n.d = this.c * e.b + this.d * e.d), (n.tx = this.tx * e.a + this.ty * e.c + e.tx), (n.ty = this.tx * e.b + this.ty * e.d + e.ty), n ); }), (t.prototype.rotate = function (t) { if (0 !== t) { var e = this.rawData, n = Math.cos(t), r = Math.sin(t), i = e[0], o = e[1], a = e[2], s = e[3], u = e[4], l = e[5]; (e[0] = i * n - o * r), (e[1] = i * r + o * n), (e[2] = a * n - s * r), (e[3] = a * r + s * n), (e[4] = u * n - l * r), (e[5] = u * r + l * n); } }), (t.prototype.scale = function (t, e) { var n = this.rawData; 1 !== t && ((n[0] *= t), (n[1] *= t), (n[4] *= t)), 1 !== e && ((n[2] *= e), (n[3] *= e), (n[5] *= e)); }), (t.prototype.setTo = function (t, e, n, r, i, o) { var a = this.rawData; (a[0] = t), (a[2] = e), (a[1] = n), (a[3] = r), (a[4] = i), (a[5] = o); }), (t.prototype.toString = function () { return ( "[Matrix] (a=" + this.a + ", b=" + this.b + ", c=" + this.c + ", d=" + this.d + ", tx=" + this.tx + ", ty=" + this.ty + ")" ); }), (t.prototype.transformPoint = function (t) { var e = this.rawData; return new P( t.x * e[0] + t.y * e[2] + e[4], t.x * e[1] + t.y * e[3] + e[5] ); }), (t.prototype.translate = function (t, e) { (this.rawData[4] += t), (this.rawData[5] += e); }), t ); })(), B = (function () { function t(t, e, n, r) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 1), (this._rawData = new Float32Array(4)); var i = this._rawData; (i[0] = t), (i[1] = e), (i[2] = n), (i[3] = r); } return ( Object.defineProperty(t.prototype, "x", { get: function () { return this._rawData[0]; }, set: function (t) { this._rawData[0] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "y", { get: function () { return this._rawData[1]; }, set: function (t) { this._rawData[1] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "z", { get: function () { return this._rawData[2]; }, set: function (t) { this._rawData[2] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "w", { get: function () { return this._rawData[3]; }, set: function (t) { this._rawData[3] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "length", { get: function () { return Math.sqrt(this.lengthSquared); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "lengthSquared", { get: function () { var t = this._rawData; return t[0] * t[0] + t[1] * t[1] + t[2] * t[2]; }, enumerable: !0, configurable: !0, }), (t.prototype.add = function (e) { var n = this._rawData, r = e._rawData; return new t(n[0] + r[0], n[1] + r[1], n[2] + r[2]); }), (t.angleBetween = function (t, e) { return Math.acos(t.dotProduct(e) / (t.length * e.length)); }), (t.prototype.clone = function () { var e = this._rawData; return new t(e[0], e[1], e[2], e[3]); }), (t.combine = function (e, n, r, i, o) { var a = e._rawData, s = n._rawData; return ( (o = o || new t()).setTo( a[0] * r + s[0] * i, a[1] * r + s[1] * i, a[2] * r + s[2] * i, 1 ), o ); }), (t.prototype.copyFrom = function (t) { var e = this._rawData, n = t._rawData; (e[0] = n[0]), (e[1] = n[1]), (e[2] = n[2]), (e[3] = n[3]); }), (t.prototype.crossProduct = function (e, n) { void 0 === n && (n = null), null == n && (n = new t()); var r = this._rawData, i = e._rawData, o = n._rawData; return ( (o[0] = r[1] * i[2] - r[2] * i[1]), (o[1] = r[2] * i[0] - r[0] * i[2]), (o[2] = r[0] * i[1] - r[1] * i[0]), n ); }), (t.prototype.decrementBy = function (t) { var e = this._rawData, n = t._rawData; (e[0] -= n[0]), (e[1] -= n[1]), (e[2] -= n[2]); }), (t.distance = function (t, e) { var n = t._rawData, r = e._rawData, i = n[0] - r[0], o = n[1] - r[1], a = n[2] - r[2]; return Math.sqrt(i * i + o * o + a * a); }), (t.prototype.dotProduct = function (t) { var e = this._rawData, n = t._rawData; return e[0] * n[0] + e[1] * n[1] + e[2] * n[2]; }), (t.prototype.equals = function (t, e) { void 0 === e && (e = !1); var n = this._rawData, r = t._rawData; return ( n[0] == r[0] && n[1] == r[1] && n[2] == r[2] && (!e || n[3] == r[3]) ); }), (t.prototype.identity = function () { var t = this._rawData; (t[0] = 0), (t[1] = 0), (t[2] = 0), (t[3] = 1); }), (t.prototype.incrementBy = function (t) { var e = this._rawData, n = t._rawData; (e[0] += n[0]), (e[1] += n[1]), (e[2] += n[2]); }), (t.prototype.nearEquals = function (t, e, n) { void 0 === n && (n = !0); var r = this._rawData, i = t._rawData; return ( Math.abs(r[0] - i[0]) < e && Math.abs(r[1] - i[1]) < e && Math.abs(r[2] - i[2]) < e && (!n || Math.abs(r[3] - i[3]) < e) ); }), (t.prototype.negate = function () { var t = this._rawData; (t[0] = -t[0]), (t[1] = -t[1]), (t[2] = -t[2]); }), (t.prototype.normalize = function (t) { void 0 === t && (t = 1); var e = this.length; if (e) { var n = this._rawData, r = t / e; (n[0] *= r), (n[1] *= r), (n[2] *= r); } return e; }), (t.prototype.project = function () { var t = this._rawData; (t[0] /= t[3]), (t[1] /= t[3]), (t[2] /= t[3]); }), (t.prototype.scaleBy = function (t) { var e = this._rawData; (e[0] *= t), (e[1] *= t), (e[2] *= t); }), (t.prototype.setTo = function (t, e, n, r) { void 0 === r && (r = 1); var i = this._rawData; (i[0] = t), (i[1] = e), (i[2] = n), (i[3] = r); }), (t.prototype.subtract = function (e) { var n = this._rawData, r = e._rawData; return new t(n[0] - r[0], n[1] - r[1], n[2] - r[2]); }), (t.prototype.toString = function () { var t = this._rawData; return ( "[Vector3D] (x:" + t[0] + " ,y:" + t[1] + ", z" + t[2] + ", w:" + t[3] + ")" ); }), (t.X_AXIS = new t(1, 0, 0)), (t.Y_AXIS = new t(0, 1, 0)), (t.Z_AXIS = new t(0, 0, 1)), t ); })(), M = (function () { function t(t, e, n, r, i, o) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), void 0 === o && (o = 0), (this.x = t), (this.y = e), (this.z = n), (this.width = r), (this.height = i), (this.depth = o); } return ( Object.defineProperty(t.prototype, "back", { get: function () { return this.z + this.depth; }, set: function (t) { this.depth = t - this.z; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "bottom", { get: function () { return this.y + this.height; }, set: function (t) { this.height = t - this.y; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "bottomRightBack", { get: function () { return ( null == this._bottomRightBack && (this._bottomRightBack = new B()), (this._bottomRightBack.x = this.x + this.width), (this._bottomRightBack.y = this.y + this.height), (this._bottomRightBack.z = this.z + this.depth), this._bottomRightBack ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "front", { get: function () { return this.z; }, set: function (t) { (this.depth += this.z - t), (this.z = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "left", { get: function () { return this.x; }, set: function (t) { (this.width += this.x - t), (this.x = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "right", { get: function () { return this.x + this.width; }, set: function (t) { this.width = t - this.x; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "size", { get: function () { return ( null == this._size && (this._size = new B()), (this._size.x = this.width), (this._size.y = this.height), (this._size.z = this.depth), this._size ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "top", { get: function () { return this.y; }, set: function (t) { (this.height += this.y - t), (this.y = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "topLeftFront", { get: function () { return ( null == this._topLeftFront && (this._topLeftFront = new B()), (this._topLeftFront.x = this.x), (this._topLeftFront.y = this.y), (this._topLeftFront.z = this.z), this._topLeftFront ); }, enumerable: !0, configurable: !0, }), (t.prototype.clone = function () { return new t( this.x, this.y, this.z, this.width, this.height, this.depth ); }), (t.prototype.contains = function (t, e, n) { return ( this.x <= t && this.x + this.width >= t && this.y <= e && this.y + this.height >= e && this.z <= n && this.z + this.depth >= n ); }), (t.prototype.containsPoint = function (t) { return ( this.x <= t.x && this.x + this.width >= t.x && this.y <= t.y && this.y + this.height >= t.y && this.z <= t.z && this.z + this.depth >= t.z ); }), (t.prototype.containsBox = function (t) { return ( this.x <= t.x && this.x + this.width >= t.x + t.width && this.y <= t.y && this.y + this.height >= t.y + t.height && this.z <= t.z && this.z + this.depth >= t.z + t.depth ); }), (t.prototype.copyFrom = function (t) { (this.x = t.x), (this.y = t.y), (this.z = t.z), (this.width = t.width), (this.height = t.height), (this.depth = t.depth); }), (t.prototype.equals = function (t) { return ( this.x == t.x && this.y == t.y && this.z == t.z && this.width == t.width && this.height == t.height && this.depth == t.depth ); }), (t.prototype.inflate = function (t, e, n) { (this.x -= t / 2), (this.y -= e / 2), (this.z -= n / 2), (this.width += t / 2), (this.height += e / 2), (this.depth += n / 2); }), (t.prototype.inflatePoint = function (t) { (this.x -= t.x / 2), (this.y -= t.y / 2), (this.z -= t.z / 2), (this.width += t.x / 2), (this.height += t.y / 2), (this.depth += t.z / 2); }), (t.prototype.intersection = function (e) { if (this.intersects(e)) { var n = new t(); return ( this.x > e.x ? ((n.x = this.x), (n.width = e.x - this.x + e.width), n.width > this.width && (n.width = this.width)) : ((n.x = e.x), (n.width = this.x - e.x + this.width), n.width > e.width && (n.width = e.width)), this.y > e.y ? ((n.y = this.y), (n.height = e.y - this.y + e.height), n.height > this.height && (n.height = this.height)) : ((n.y = e.y), (n.height = this.y - e.y + this.height), n.height > e.height && (n.height = e.height)), this.z > e.z ? ((n.z = this.z), (n.depth = e.z - this.z + e.depth), n.depth > this.depth && (n.depth = this.depth)) : ((n.z = e.z), (n.depth = this.z - e.z + this.depth), n.depth > e.depth && (n.depth = e.depth)), n ); } return new t(); }), (t.prototype.intersects = function (t) { return ( this.x + this.width >= t.x && this.x <= t.x + t.width && this.y + this.height >= t.y && this.y <= t.y + t.height && this.z + this.depth >= t.z && this.z <= t.z + t.depth ); }), (t.prototype.rayIntersection = function (t, e, n) { if ((void 0 === n && (n = null), this.containsPoint(t))) return 0; var r, i, o, a, s, u = this.width / 2, l = this.height / 2, c = this.depth / 2, h = this.x + u, p = this.y + l, d = this.z + c, f = t.x - h, g = t.y - p, _ = t.z - d, m = e.x, y = e.y, A = e.z; return ( m < 0 && (a = (u - f) / m) > 0 && ((o = _ + a * A), (i = g + a * y) > -l && i < l && o > -c && o < c && (n && ((n.x = 1), (n.y = 0), (n.z = 0)), (s = !0))), !s && m > 0 && (a = (-u - f) / m) > 0 && ((o = _ + a * A), (i = g + a * y) > -l && i < l && o > -c && o < c && (n && ((n.x = -1), (n.y = 0), (n.z = 0)), (s = !0))), !s && y < 0 && (a = (l - g) / y) > 0 && ((o = _ + a * A), (r = f + a * m) > -u && r < u && o > -c && o < c && (n && ((n.x = 0), (n.y = 1), (n.z = 0)), (s = !0))), !s && y > 0 && (a = (-l - g) / y) > 0 && ((o = _ + a * A), (r = f + a * m) > -u && r < u && o > -c && o < c && (n && ((n.x = 0), (n.y = -1), (n.z = 0)), (s = !0))), !s && A < 0 && (a = (c - _) / A) > 0 && ((r = f + a * m), (i = g + a * y) > -l && i < l && r > -u && r < u && (n && ((n.x = 0), (n.y = 0), (n.z = 1)), (s = !0))), !s && A > 0 && (a = (-c - _) / A) > 0 && ((r = f + a * m), (i = g + a * y) > -l && i < l && r > -u && r < u && (n && ((n.x = 0), (n.y = 0), (n.z = -1)), (s = !0))), s ? a : -1 ); }), (t.prototype.closestPointToPoint = function (t, e) { var n; return ( void 0 === e && (e = null), null == e && (e = new B()), (n = t.x) < this.x && (n = this.x), n > this.x + this.width && (n = this.x + this.width), (e.x = n), (n = t.y) < this.y + this.height && (n = this.y + this.height), n > this.y && (n = this.y), (e.y = n), (n = t.z) < this.z && (n = this.z), n > this.z + this.depth && (n = this.z + this.depth), (e.z = n), e ); }), (t.prototype.offset = function (t, e, n) { (this.x += t), (this.y += e), (this.z += n); }), (t.prototype.offsetPosition = function (t) { (this.x += t.x), (this.y += t.y), (this.z += t.z); }), (t.prototype.identity = function () { (this.x = 0), (this.y = 0), (this.z = 0), (this.width = 0), (this.height = 0), (this.depth = 0); }), (t.prototype.setTo = function (t, e, n, r, i, o) { (this.x = t), (this.y = e), (this.z = n), (this.width = r), (this.height = i), (this.depth = o); }), (t.prototype.toString = function () { return ( "[Box] (x=" + this.x + ", y=" + this.y + ", z=" + this.z + ", width=" + this.width + ", height=" + this.height + ", depth=" + this.depth + ")" ); }), (t.prototype.union = function (e, n) { var r, i, o; return ( void 0 === n && (n = null), null == n && (n = new t()), null == e ? (n.copyFrom(this), n) : (this.x < e.x ? ((r = e.x - this.x + e.width), (n.x = this.x), (n.width = r < this.width ? this.width : r)) : ((r = this.x - e.x + this.width), (n.x = e.x), (n.width = r < e.width ? e.width : r)), this.y < e.y ? ((i = e.y - this.y + e.height), (n.y = this.y), (n.height = i < this.height ? this.height : i)) : ((i = this.y - e.y + this.height), (n.y = e.y), (n.height = i < e.height ? e.height : i)), this.z < e.z ? ((o = e.z - this.z + e.depth), (n.z = this.z), (n.depth = o < this.depth ? this.depth : o)) : ((o = this.z - e.z + this.depth), (n.z = e.z), (n.depth = o < e.depth ? e.depth : o)), n) ); }), t ); })(), L = (function () { function t() {} return ( (t.RADIANS_TO_DEGREES = 180 / Math.PI), (t.DEGREES_TO_RADIANS = Math.PI / 180), t ); })(), N = (function () { function t() {} return ( (t.AXIS_ANGLE = "axisAngle"), (t.EULER_ANGLES = "eulerAngles"), (t.QUATERNION = "quaternion"), t ); })(), R = (function () { function t(t, e, n, r) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), (this.x = t), (this.y = e), (this.z = n), (this.radius = r); } return ( (t.prototype.rayIntersection = function (t, e, n) { if (this.containsPoint(t)) return 0; var r, i = t.x - this.x, o = t.y - this.y, a = t.z - this.z, s = e.x, u = e.y, l = e.z, c = s * s + u * u + l * l, h = 2 * (i * s + o * u + a * l), p = h * h - 4 * c * (i * i + o * o + a * a - this.radius * this.radius); if (p >= 0 && (r = (-h - Math.sqrt(p)) / (2 * c)) >= 0) return ( (n.x = i + r * s), (n.y = o + r * u), (n.z = a + r * l), n.normalize(), r ); return -1; }), (t.prototype.containsPoint = function (t) { var e = t.x - this.x, n = t.y - this.y, r = t.z - this.z; return Math.sqrt(e * e + n * n + r * r) <= this.radius; }), (t.prototype.copyFrom = function (t) { (this.x = t.x), (this.y = t.y), (this.z = t.z), (this.radius = t.radius); }), (t.prototype.union = function (e, n) { if ( (void 0 === n && (n = null), null == n && (n = new t()), null == e) ) return n.copyFrom(this), n; var r = e.x - this.x, i = e.y - this.y, o = e.z - this.z; return ( (n.radius = (Math.sqrt(r * r + i * i + o * o) + e.radius + this.radius) / 2), (n.x = this.x + r / 2), (n.y = this.y + i / 2), (n.z = this.z + o / 2), n ); }), (t.prototype.toString = function () { return ( "Sphere [x:" + this.x + ", y:" + this.y + ", z:" + this.z + ", radius:" + this.radius + "]" ); }), t ); })(), F = (function () { function t(t) { void 0 === t && (t = null), (this._position = new B()), (this._positionDirty = !0), null != t ? (this._rawData = t) : ((this._rawData = new Float32Array(16)), this.identity()); } return ( (t.getAxisRotationMatrix = function (e, n, r, i, o) { void 0 === o && (o = null), null == o && (o = new t()); var a, s, u = o._rawData, l = i * L.DEGREES_TO_RADIANS, c = Math.cos(l), h = Math.sin(l), p = 1 - c; return ( (u[0] = c + e * e * p), (u[5] = c + n * n * p), (u[10] = c + r * r * p), (a = e * n * p), (s = r * h), (u[1] = a + s), (u[4] = a - s), (a = e * r * p), (s = n * h), (u[8] = a + s), (u[2] = a - s), (a = n * r * p), (s = e * h), (u[9] = a - s), (u[6] = a + s), (u[3] = 0), (u[7] = 0), (u[11] = 0), (u[12] = 0), (u[13] = 0), (u[14] = 0), (u[15] = 1), o.invalidatePosition(), o ); }), (t.getPointAtMatrix = function (e, n, r, i) { var o; void 0 === i && (i = null), null == i && (i = new t()); var a = i._rawData, s = n.clone(); s.normalize(), (o = r.clone()).normalize(); var u = o.crossProduct(s); return ( u.normalize(), u.length < 0.05 && ((u.x = o.y), (u.y = o.x), (u.z = 0), u.normalize()), (o = s.crossProduct(u)), (a[0] = u.x), (a[1] = u.y), (a[2] = u.z), (a[3] = 0), (a[4] = o.x), (a[5] = o.y), (a[6] = o.z), (a[7] = 0), (a[8] = s.x), (a[9] = s.y), (a[10] = s.z), (a[11] = 0), (a[12] = u.dotProduct(e)), (a[13] = o.dotProduct(e)), (a[14] = s.dotProduct(e)), (a[15] = 1), i.invalidatePosition(), i ); }), (t.getQuaternionMatrix = function (e, n) { void 0 === n && (n = null), null == n && (n = new t()); var r = n._rawData, i = e.x, o = e.y, a = e.z, s = e.w, u = i * i, l = i * o, c = i * a, h = i * s, p = o * o, d = o * a, f = o * s, g = a * a, _ = a * s; return ( (r[0] = 1 - 2 * (p + g)), (r[1] = 2 * (l + _)), (r[2] = 2 * (c - f)), (r[4] = 2 * (l - _)), (r[5] = 1 - 2 * (u + g)), (r[6] = 2 * (d + h)), (r[8] = 2 * (c + f)), (r[9] = 2 * (d - h)), (r[10] = 1 - 2 * (u + p)), (r[3] = 0), (r[7] = 0), (r[11] = 0), (r[12] = 0), (r[13] = 0), (r[14] = 0), (r[15] = 1), n.invalidatePosition(), n ); }), (t.compare = function (t, e) { for (var n = t._rawData, r = e._rawData, i = 0; i < 16; ++i) if (n[i] != r[i]) return !1; return !0; }), Object.defineProperty(t.prototype, "determinant", { get: function () { var t = this._rawData; return ( (t[0] * t[5] - t[4] * t[1]) * (t[10] * t[15] - t[14] * t[11]) - (t[0] * t[9] - t[8] * t[1]) * (t[6] * t[15] - t[14] * t[7]) + (t[0] * t[13] - t[12] * t[1]) * (t[6] * t[11] - t[10] * t[7]) + (t[4] * t[9] - t[8] * t[5]) * (t[2] * t[15] - t[14] * t[3]) - (t[4] * t[13] - t[12] * t[5]) * (t[2] * t[11] - t[10] * t[3]) + (t[8] * t[13] - t[12] * t[9]) * (t[2] * t[7] - t[6] * t[3]) ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "position", { get: function () { return ( this._positionDirty && ((this._positionDirty = !1), (this._position.x = this._rawData[12]), (this._position.y = this._rawData[13]), (this._position.z = this._rawData[14])), this._position ); }, enumerable: !0, configurable: !0, }), (t.prototype.append = function (t) { var e = this._rawData, n = t._rawData, r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], u = e[5], l = e[6], c = e[7], h = e[8], p = e[9], d = e[10], f = e[11], g = e[12], _ = e[13], m = e[14], y = e[15], A = n[0], v = n[1], b = n[2], C = n[3], I = n[4], E = n[5], x = n[6], w = n[7], S = n[8], D = n[9], T = n[10], P = n[11], O = n[12], B = n[13], M = n[14], L = n[15]; (e[0] = r * A + i * I + o * S + a * O), (e[1] = r * v + i * E + o * D + a * B), (e[2] = r * b + i * x + o * T + a * M), (e[3] = r * C + i * w + o * P + a * L), (e[4] = s * A + u * I + l * S + c * O), (e[5] = s * v + u * E + l * D + c * B), (e[6] = s * b + u * x + l * T + c * M), (e[7] = s * C + u * w + l * P + c * L), (e[8] = h * A + p * I + d * S + f * O), (e[9] = h * v + p * E + d * D + f * B), (e[10] = h * b + p * x + d * T + f * M), (e[11] = h * C + p * w + d * P + f * L), (e[12] = g * A + _ * I + m * S + y * O), (e[13] = g * v + _ * E + m * D + y * B), (e[14] = g * b + _ * x + m * T + y * M), (e[15] = g * C + _ * w + m * P + y * L), (this._positionDirty = !0); }), (t.prototype.appendRotation = function (e, n) { this.append(t.getAxisRotationMatrix(n.x, n.y, n.z, e, t._tempMatrix)); }), (t.prototype.appendSkew = function (e, n, r) { if (0 != e || 0 != n || 0 != r) { var i = t._tempMatrix._rawData; (i[0] = 1), (i[1] = 0), (i[2] = 0), (i[3] = 0), (i[4] = e), (i[5] = 1), (i[6] = 0), (i[7] = 0), (i[8] = n), (i[9] = r), (i[10] = 1), (i[11] = 0), (i[12] = 0), (i[13] = 0), (i[14] = 0), (i[15] = 1), this.append(t._tempMatrix); } }), (t.prototype.appendScale = function (e, n, r) { if (1 != e || 1 != n || 1 != r) { var i = t._tempMatrix._rawData; (i[0] = e), (i[1] = 0), (i[2] = 0), (i[3] = 0), (i[4] = 0), (i[5] = n), (i[6] = 0), (i[7] = 0), (i[8] = 0), (i[9] = 0), (i[10] = r), (i[11] = 0), (i[12] = 0), (i[13] = 0), (i[14] = 0), (i[15] = 1), this.append(t._tempMatrix); } }), (t.prototype.appendTranslation = function (t, e, n) { var r = this._rawData, i = r[3], o = r[7], a = r[11], s = r[15]; (r[0] += t * i), (r[1] += e * i), (r[2] += n * i), (r[4] += t * o), (r[5] += e * o), (r[6] += n * o), (r[8] += t * a), (r[9] += e * a), (r[10] += n * a), (r[12] += t * s), (r[13] += e * s), (r[14] += n * s), (this._positionDirty = !0); }), (t.prototype.clone = function () { var e = new t(); return e.copyFrom(this), e; }), (t.prototype.copyColumnFrom = function (t, e) { if (t < 0 || t > 3) throw new T( "ArgumentError, Column " + t + " out of bounds [0, ..., 3]" ); var n = this._rawData, r = e._rawData; (n[(t *= 4)] = r[0]), (n[t + 1] = r[1]), (n[t + 2] = r[2]), (n[t + 3] = r[3]), (this._positionDirty = !0); }), (t.prototype.copyColumnTo = function (t, e, n) { if ((void 0 === n && (n = !1), t < 0 || t > 3)) throw new T( "ArgumentError, Column " + t + " out of bounds [0, ..., 3]" ); t *= 4; var r = this._rawData, i = e._rawData; n ? ((i[0] = -r[t]), (i[1] = -r[t + 1]), (i[2] = -r[t + 2]), (i[3] = -r[t + 3])) : ((i[0] = r[t]), (i[1] = r[t + 1]), (i[2] = r[t + 2]), (i[3] = r[t + 3])); }), (t.prototype.copyFrom = function (t, e) { void 0 === e && (e = !1); var n = t._rawData, r = this._rawData; (r[0] = n[0]), (r[5] = n[5]), (r[10] = n[10]), (r[15] = n[15]), e ? ((r[1] = n[4]), (r[2] = n[8]), (r[3] = n[12]), (r[4] = n[1]), (r[6] = n[9]), (r[7] = n[13]), (r[8] = n[2]), (r[9] = n[6]), (r[11] = n[14]), (r[12] = n[3]), (r[13] = n[7]), (r[14] = n[11])) : ((r[1] = n[1]), (r[2] = n[2]), (r[3] = n[3]), (r[4] = n[4]), (r[6] = n[6]), (r[7] = n[7]), (r[8] = n[8]), (r[9] = n[9]), (r[11] = n[11]), (r[12] = n[12]), (r[13] = n[13]), (r[14] = n[14])), (this._positionDirty = !0); }), (t.prototype.copyTo = function (t, e) { void 0 === e && (e = !1), t.copyFrom(this, e); }), (t.prototype.copyRawDataFrom = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = !1); var r = this._rawData; (r[0] = t[e + 0]), (r[5] = t[e + 5]), (r[10] = t[e + 10]), (r[15] = t[e + 15]), n ? ((r[e + 1] = t[4]), (r[e + 2] = t[8]), (r[e + 3] = t[12]), (r[e + 4] = t[1]), (r[e + 6] = t[9]), (r[e + 7] = t[13]), (r[e + 8] = t[2]), (r[e + 9] = t[6]), (r[e + 11] = t[14]), (r[e + 12] = t[3]), (r[e + 13] = t[7]), (r[e + 14] = t[11])) : ((r[1] = t[e + 1]), (r[2] = t[e + 2]), (r[3] = t[e + 3]), (r[4] = t[e + 4]), (r[6] = t[e + 6]), (r[7] = t[e + 7]), (r[8] = t[e + 8]), (r[9] = t[e + 9]), (r[11] = t[e + 11]), (r[12] = t[e + 12]), (r[13] = t[e + 13]), (r[14] = t[e + 14])), (this._positionDirty = !0); }), (t.prototype.copyRawDataTo = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = !1); var r = this._rawData; (t[e] = r[0]), (t[e + 5] = r[5]), (t[e + 10] = r[10]), (t[e + 15] = r[15]), n ? ((t[e + 1] = r[4]), (t[e + 2] = r[8]), (t[e + 3] = r[12]), (t[e + 4] = r[1]), (t[e + 6] = r[9]), (t[e + 7] = r[13]), (t[e + 8] = r[2]), (t[e + 9] = r[6]), (t[e + 11] = r[14]), (t[e + 12] = r[3]), (t[e + 13] = r[7]), (t[e + 14] = r[11])) : ((t[e + 1] = r[1]), (t[e + 2] = r[2]), (t[e + 3] = r[3]), (t[e + 4] = r[4]), (t[e + 6] = r[6]), (t[e + 7] = r[7]), (t[e + 8] = r[8]), (t[e + 9] = r[9]), (t[e + 11] = r[11]), (t[e + 12] = r[12]), (t[e + 13] = r[13]), (t[e + 14] = r[14])); }), (t.prototype.copyRowFrom = function (t, e) { if (t < 0 || t > 3) throw new T( "ArgumentError, Row " + t + " out of bounds [0, ..., 3]" ); var n = this._rawData, r = e._rawData; (n[t] = r[0]), (n[t + 4] = r[1]), (n[t + 8] = r[2]), (n[t + 12] = r[3]), (this._positionDirty = !0); }), (t.prototype.copyRowTo = function (t, e, n) { if ((void 0 === n && (n = !1), t < 0 || t > 3)) throw new T( "ArgumentError, Row " + t + " out of bounds [0, ..., 3]" ); var r = this._rawData, i = e._rawData; n ? ((i[0] = -r[t]), (i[1] = -r[t + 4]), (i[2] = -r[t + 8]), (i[3] = -r[t + 12])) : ((i[0] = r[t]), (i[1] = r[t + 4]), (i[2] = r[t + 8]), (i[3] = r[t + 12])); }), (t.prototype.decompose = function (e) { void 0 === e && (e = "eulerAngles"), null == this._components && (this._components = [new B(), new B(), new B(), new B()]); var n = t.COL_X; n.setTo(this._rawData[0], this._rawData[1], this._rawData[2]); var r = t.COL_Y; r.setTo(this._rawData[4], this._rawData[5], this._rawData[6]); var i = t.COL_Z; i.setTo(this._rawData[8], this._rawData[9], this._rawData[10]); var o = this._components[3], a = this._components[2]; (o.x = n.length), n.scaleBy(1 / o.x), (a.x = n.dotProduct(r)), B.combine(r, n, 1, -a.x, r), (o.y = r.length), r.scaleBy(1 / o.y), (a.x /= o.y), (a.y = n.dotProduct(i)), B.combine(i, n, 1, -a.y, i), (a.z = r.dotProduct(i)), B.combine(i, r, 1, -a.z, i), (o.z = i.length), i.scaleBy(1 / o.z), (a.y /= o.z), (a.z /= o.z), n.dotProduct(r.crossProduct(i)) < 0 && ((o.z = -o.z), (i.x = -i.x), (i.y = -i.y), (i.z = -i.z)); var s = this._components[1]; switch (e) { case N.AXIS_ANGLE: s.w = Math.acos((n.x + r.y + i.z - 1) / 2); var u = Math.sqrt( (r.z - i.y) * (r.z - i.y) + (i.x - n.z) * (i.x - n.z) + (n.y - r.x) * (n.y - r.x) ); (s.x = (r.z - i.y) / u), (s.y = (i.x - n.z) / u), (s.z = (n.y - r.x) / u); break; case N.QUATERNION: var l = n.x + r.y + i.z; l > 0 ? ((s.w = Math.sqrt(1 + l) / 2), (s.x = (r.z - i.y) / (4 * s.w)), (s.y = (i.x - n.z) / (4 * s.w)), (s.z = (n.y - r.x) / (4 * s.w))) : n.x > r.y && n.x > i.z ? ((s.x = Math.sqrt(1 + n.x - r.y - i.z) / 2), (s.w = (r.z - i.y) / (4 * s.x)), (s.y = (n.y + r.x) / (4 * s.x)), (s.z = (i.x + n.z) / (4 * s.x))) : r.y > i.z ? ((s.y = Math.sqrt(1 + r.y - n.x - i.z) / 2), (s.x = (n.y + r.x) / (4 * s.y)), (s.w = (i.x - n.z) / (4 * s.y)), (s.z = (r.z + i.y) / (4 * s.y))) : ((s.z = Math.sqrt(1 + i.z - n.x - r.y) / 2), (s.x = (i.x + n.z) / (4 * s.z)), (s.y = (r.z + i.y) / (4 * s.z)), (s.w = (n.y - r.x) / (4 * s.z))); break; case N.EULER_ANGLES: (s.y = Math.asin(-n.z)), 1 != n.z && -1 != n.z ? ((s.x = Math.atan2(r.z, i.z)), (s.z = Math.atan2(n.y, n.x))) : ((s.z = 0), (s.x = Math.atan2(r.x, r.y))); } return this._components[0].copyFrom(this.position), this._components; }), (t.prototype.deltaTransformVector = function (t, e) { void 0 === e && (e = null); var n = t.x, r = t.y, i = t.z; e || (e = new B()); var o = this._rawData, a = e._rawData; return ( (a[0] = n * o[0] + r * o[4] + i * o[8]), (a[1] = n * o[1] + r * o[5] + i * o[9]), (a[2] = n * o[2] + r * o[6] + i * o[10]), (a[3] = n * o[3] + r * o[7] + i * o[11]), e ); }), (t.prototype.deltaTransformVectors = function (t, e) { for ( var n = this._rawData, r = n[0], i = n[1], o = n[2], a = n[4], s = n[5], u = n[6], l = n[8], c = n[9], h = n[10], p = 0, d = t.length, f = 0; f < d; f += 3 ) { var g = t[f], _ = t[f + 1], m = t[f + 2]; (e[p++] = r * g + a * _ + l * m), (e[p++] = i * g + s * _ + c * m), (e[p++] = o * g + u * _ + h * m); } }), (t.prototype.identity = function () { var t = this._rawData; (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 0), (t[5] = 1), (t[6] = 0), (t[7] = 0), (t[8] = 0), (t[9] = 0), (t[10] = 1), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), (this._positionDirty = !0); }), (t.prototype.invert = function () { var t = this.determinant, e = Math.abs(t) > 1e-11, n = this._rawData; if (e) { t = 1 / t; var r = n[0], i = n[1], o = n[2], a = n[3], s = n[4], u = n[5], l = n[6], c = n[7], h = n[8], p = n[9], d = n[10], f = n[11], g = n[12], _ = n[13], m = n[14], y = n[15]; (n[0] = t * (u * (d * y - m * f) - p * (l * y - m * c) + _ * (l * f - d * c))), (n[1] = -t * (i * (d * y - m * f) - p * (o * y - m * a) + _ * (o * f - d * a))), (n[2] = t * (i * (l * y - m * c) - u * (o * y - m * a) + _ * (o * c - l * a))), (n[3] = -t * (i * (l * f - d * c) - u * (o * f - d * a) + p * (o * c - l * a))), (n[4] = -t * (s * (d * y - m * f) - h * (l * y - m * c) + g * (l * f - d * c))), (n[5] = t * (r * (d * y - m * f) - h * (o * y - m * a) + g * (o * f - d * a))), (n[6] = -t * (r * (l * y - m * c) - s * (o * y - m * a) + g * (o * c - l * a))), (n[7] = t * (r * (l * f - d * c) - s * (o * f - d * a) + h * (o * c - l * a))), (n[8] = t * (s * (p * y - _ * f) - h * (u * y - _ * c) + g * (u * f - p * c))), (n[9] = -t * (r * (p * y - _ * f) - h * (i * y - _ * a) + g * (i * f - p * a))), (n[10] = t * (r * (u * y - _ * c) - s * (i * y - _ * a) + g * (i * c - u * a))), (n[11] = -t * (r * (u * f - p * c) - s * (i * f - p * a) + h * (i * c - u * a))), (n[12] = -t * (s * (p * m - _ * d) - h * (u * m - _ * l) + g * (u * d - p * l))), (n[13] = t * (r * (p * m - _ * d) - h * (i * m - _ * o) + g * (i * d - p * o))), (n[14] = -t * (r * (u * m - _ * l) - s * (i * m - _ * o) + g * (i * l - u * o))), (n[15] = t * (r * (u * d - p * l) - s * (i * d - p * o) + h * (i * l - u * o))); } return (this._positionDirty = !0), e; }), (t.prototype.isIdentity = function () { var t = this._rawData; return ( 1 == t[0] && 0 == t[1] && 0 == t[2] && 0 == t[3] && 0 == t[4] && 1 == t[5] && 0 == t[6] && 0 == t[7] && 0 == t[8] && 0 == t[9] && 1 == t[10] && 0 == t[11] && 0 == t[12] && 0 == t[13] && 0 == t[14] && 1 == t[15] ); }), (t.prototype.prepend = function (t) { var e = this._rawData, n = t._rawData, r = n[0], i = n[1], o = n[2], a = n[3], s = n[4], u = n[5], l = n[6], c = n[7], h = n[8], p = n[9], d = n[10], f = n[11], g = n[12], _ = n[13], m = n[14], y = n[15], A = e[0], v = e[1], b = e[2], C = e[3], I = e[4], E = e[5], x = e[6], w = e[7], S = e[8], D = e[9], T = e[10], P = e[11], O = e[12], B = e[13], M = e[14], L = e[15]; (e[0] = r * A + i * I + o * S + a * O), (e[1] = r * v + i * E + o * D + a * B), (e[2] = r * b + i * x + o * T + a * M), (e[3] = r * C + i * w + o * P + a * L), (e[4] = s * A + u * I + l * S + c * O), (e[5] = s * v + u * E + l * D + c * B), (e[6] = s * b + u * x + l * T + c * M), (e[7] = s * C + u * w + l * P + c * L), (e[8] = h * A + p * I + d * S + f * O), (e[9] = h * v + p * E + d * D + f * B), (e[10] = h * b + p * x + d * T + f * M), (e[11] = h * C + p * w + d * P + f * L), (e[12] = g * A + _ * I + m * S + y * O), (e[13] = g * v + _ * E + m * D + y * B), (e[14] = g * b + _ * x + m * T + y * M), (e[15] = g * C + _ * w + m * P + y * L), (this._positionDirty = !0); }), (t.prototype.prependRotation = function (e, n) { this.prepend( t.getAxisRotationMatrix(n.x, n.y, n.z, e, t._tempMatrix) ); }), (t.prototype.prependScale = function (e, n, r) { if (1 != e || 1 != n || 1 != r) { var i = t._tempMatrix._rawData; (i[0] = e), (i[1] = 0), (i[2] = 0), (i[3] = 0), (i[4] = 0), (i[5] = n), (i[6] = 0), (i[7] = 0), (i[8] = 0), (i[9] = 0), (i[10] = r), (i[11] = 0), (i[12] = 0), (i[13] = 0), (i[14] = 0), (i[15] = 1), this.prepend(t._tempMatrix); } }), (t.prototype.prependTranslation = function (e, n, r) { var i = t._tempMatrix._rawData; (i[0] = 1), (i[1] = 0), (i[2] = 0), (i[3] = 0), (i[4] = 0), (i[5] = 1), (i[6] = 0), (i[7] = 0), (i[8] = 0), (i[9] = 0), (i[10] = 1), (i[11] = 0), (i[12] = e), (i[13] = n), (i[14] = r), (i[15] = 1), this.prepend(t._tempMatrix); }), (t.prototype.recompose = function (e) { var n = e[0] || this.position; this.identity(); var r = e[3]; !r || (1 == r.x && 1 == r.y && 1 == r.z) || this.appendScale(r.x, r.y, r.z); var i, o, a = e[2]; !a || (0 == a.x && 0 == a.y && 0 == a.z) || this.appendSkew(a.x, a.y, a.z); var s = t._tempMatrix._rawData; (s[12] = 0), (s[13] = 0), (s[14] = 0), (s[15] = 0); var u = e[1]; if (u) { var l = -u.x; 0 != l && ((i = Math.sin(l)), (o = Math.cos(l)), (s[0] = 1), (s[1] = 0), (s[2] = 0), (s[3] = 0), (s[4] = 0), (s[5] = o), (s[6] = -i), (s[7] = 0), (s[8] = 0), (s[9] = i), (s[10] = o), (s[11] = 0), this.append(t._tempMatrix)), 0 != (l = -u.y) && ((i = Math.sin(l)), (o = Math.cos(l)), (s[0] = o), (s[1] = 0), (s[2] = i), (s[3] = 0), (s[4] = 0), (s[5] = 1), (s[6] = 0), (s[7] = 0), (s[8] = -i), (s[9] = 0), (s[10] = o), (s[11] = 0), this.append(t._tempMatrix)), 0 != (l = -u.z) && ((i = Math.sin(l)), (o = Math.cos(l)), (s[0] = o), (s[1] = -i), (s[2] = 0), (s[3] = 0), (s[4] = i), (s[5] = o), (s[6] = 0), (s[7] = 0), (s[8] = 0), (s[9] = 0), (s[10] = 1), (s[11] = 0), this.append(t._tempMatrix)); } return ( (this._rawData[12] = n.x), (this._rawData[13] = n.y), (this._rawData[14] = n.z), e[0] && (this._positionDirty = !0), (this._rawData[15] = 1), !0 ); }), (t.prototype.reflect = function (t) { var e = t.a, n = t.b, r = t.c, i = t.d, o = -2 * e * n, a = -2 * e * r, s = -2 * n * r, u = this._rawData; (u[0] = 1 - 2 * e * e), (u[4] = o), (u[8] = a), (u[12] = -2 * e * i), (u[1] = o), (u[5] = 1 - 2 * n * n), (u[9] = s), (u[13] = -2 * n * i), (u[2] = a), (u[6] = s), (u[10] = 1 - 2 * r * r), (u[14] = -2 * r * i), (u[3] = 0), (u[7] = 0), (u[11] = 0), (u[15] = 1), (this._positionDirty = !0); }), (t.prototype.transformBox = function (t, e) { if ((void 0 === e && (e = null), null == t)) throw new T("ArgumentError, box cannot be null"); e || (e = new M()); var n = t.width / 2, r = t.height / 2, i = t.depth / 2, o = t.x + n, a = t.y + r, s = t.z + i, u = this._rawData[0], l = this._rawData[4], c = this._rawData[8], h = this._rawData[12], p = this._rawData[1], d = this._rawData[5], f = this._rawData[9], g = this._rawData[13], _ = this._rawData[2], m = this._rawData[6], y = this._rawData[10], A = o * u + a * l + s * c + h, v = o * p + a * d + s * f + g, b = o * _ + a * m + s * y + this._rawData[14], C = Math.max( Math.abs(n * u + r * l + i * c), Math.abs(-n * u + r * l + i * c), Math.abs(n * u - r * l + i * c), Math.abs(n * u + r * l - i * c) ), I = Math.max( Math.abs(n * p + r * d + i * f), Math.abs(-n * p + r * d + i * f), Math.abs(n * p - r * d + i * f), Math.abs(n * p + r * d - i * f) ), E = Math.max( Math.abs(n * _ + r * m + i * y), Math.abs(-n * _ + r * m + i * y), Math.abs(n * _ - r * m + i * y), Math.abs(n * _ + r * m - i * y) ); return ( (e.width = 2 * C), (e.height = 2 * I), (e.depth = 2 * E), (e.x = A - C), (e.y = v - I), (e.z = b - E), e ); }), (t.prototype.transformSphere = function (t, e) { if ((void 0 === e && (e = null), null == t)) throw new T("ArgumentError, sphere cannot be null"); var n = new M( t.x - t.radius, t.y - t.radius, t.z - t.radius, 2 * t.radius, 2 * t.radius, 2 * t.radius ); return ( this.transformBox(n, n), e || (e = new R()), (e.x = n.x + n.width / 2), (e.y = n.y + n.height / 2), (e.z = n.z + n.depth / 2), (e.radius = Math.max(n.width, n.height, n.depth)), e ); }), (t.prototype.transformVector = function (t, e) { if ((void 0 === e && (e = null), null == t)) throw new T("ArgumentError, vector cannot be null"); var n = t.x, r = t.y, i = t.z, o = t.w; e || (e = new B()); var a = this._rawData, s = e._rawData; return ( (s[0] = n * a[0] + r * a[4] + i * a[8] + o * a[12]), (s[1] = n * a[1] + r * a[5] + i * a[9] + o * a[13]), (s[2] = n * a[2] + r * a[6] + i * a[10] + o * a[14]), (s[3] = n * a[3] + r * a[7] + i * a[11] + o * a[15]), e ); }), (t.prototype.transformVectors = function (t, e) { for ( var n = 0, r = 0, i = 0, o = 0, a = this._rawData; n + 3 <= t.length; ) (r = t[n]), (i = t[n + 1]), (o = t[n + 2]), (e[n] = r * a[0] + i * a[4] + o * a[8] + a[12]), (e[n + 1] = r * a[1] + i * a[5] + o * a[9] + a[13]), (e[n + 2] = r * a[2] + i * a[6] + o * a[10] + a[14]), (n += 3); }), (t.prototype.transpose = function () { var e = this._rawData, n = t._tempMatrix._rawData; this.copyRawDataTo(n, 0, !0), (e[1] = n[1]), (e[2] = n[2]), (e[3] = n[3]), (e[4] = n[4]), (e[6] = n[6]), (e[7] = n[7]), (e[8] = n[8]), (e[9] = n[9]), (e[11] = n[11]), (e[12] = n[12]), (e[13] = n[13]), (e[14] = n[14]), (this._positionDirty = !0); }), (t.prototype.invalidatePosition = function () { this._positionDirty = !0; }), (t.prototype.toFixed = function (t) { var e = Math.pow(10, t); return ( "matrix3d(" + Math.round(this._rawData[0] * e) / e + "," + Math.round(this._rawData[1] * e) / e + "," + Math.round(this._rawData[2] * e) / e + "," + Math.round(this._rawData[3] * e) / e + "," + Math.round(this._rawData[4] * e) / e + "," + Math.round(this._rawData[5] * e) / e + "," + Math.round(this._rawData[6] * e) / e + "," + Math.round(this._rawData[7] * e) / e + "," + Math.round(this._rawData[8] * e) / e + "," + Math.round(this._rawData[9] * e) / e + "," + Math.round(this._rawData[10] * e) / e + "," + Math.round(this._rawData[11] * e) / e + "," + Math.round(this._rawData[12] * e) / e + "," + Math.round(this._rawData[13] * e) / e + "," + Math.round(this._rawData[14] * e) / e + "," + Math.round(this._rawData[15] * e) / e + ")" ); }), (t.prototype.toString = function () { return ( "matrix3d(" + Math.round(1e3 * this._rawData[0]) / 1e3 + "," + Math.round(1e3 * this._rawData[1]) / 1e3 + "," + Math.round(1e3 * this._rawData[2]) / 1e3 + "," + Math.round(1e3 * this._rawData[3]) / 1e3 + "," + Math.round(1e3 * this._rawData[4]) / 1e3 + "," + Math.round(1e3 * this._rawData[5]) / 1e3 + "," + Math.round(1e3 * this._rawData[6]) / 1e3 + "," + Math.round(1e3 * this._rawData[7]) / 1e3 + "," + Math.round(1e3 * this._rawData[8]) / 1e3 + "," + Math.round(1e3 * this._rawData[9]) / 1e3 + "," + Math.round(1e3 * this._rawData[10]) / 1e3 + "," + Math.round(1e3 * this._rawData[11]) / 1e3 + "," + Math.round(1e3 * this._rawData[12]) / 1e3 + "," + Math.round(1e3 * this._rawData[13]) / 1e3 + "," + Math.round(1e3 * this._rawData[14]) / 1e3 + "," + Math.round(1e3 * this._rawData[15]) / 1e3 + ")" ); }), (t.CALCULATION_MATRIX = new t()), (t._tempMatrix = new t()), (t.COL_X = new B()), (t.COL_Y = new B()), (t.COL_Z = new B()), t ); })(), k = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._inverseMatrix3D = new F()), (n._matrix = null), (n._rotation = new B()), (n._scale = new B(1, 1, 1)), (n._skew = new B()), (n._rawData = e || new Float32Array(24)), (n._matrix3D = new F(new Float32Array(n._rawData.buffer, 0, 16))), (n._colorTransform = new S( new Float32Array(n._rawData.buffer, 64, 8) )), null == e && (n._matrix3D.identity(), n._colorTransform.clear()), (n._components = new Array(4)), (n._components[1] = n._rotation), (n._components[2] = n._skew), (n._components[3] = n._scale), n.invalidateComponents(), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "backVector", { get: function () { return ( this._backVector || (this._backVector = new B()), this._matrix3D.copyColumnTo(2, this._backVector, !0), this._backVector ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "colorTransform", { get: function () { return this._colorTransform; }, set: function (t) { if (t) { var e = t._rawData, n = this._colorTransform._rawData; (n[0] = e[0]), (n[1] = e[1]), (n[2] = e[2]), (n[3] = e[3]), (n[4] = e[4]), (n[5] = e[5]), (n[6] = e[6]), (n[7] = e[7]); } else this._colorTransform.clear(); this.invalidateColorTransform(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "inverseMatrix3D", { get: function () { return ( this._inverseMatrix3DDirty && ((this._inverseMatrix3DDirty = !1), this._inverseMatrix3D.copyFrom(this.matrix3D), this._inverseMatrix3D.invert()), this._inverseMatrix3D ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "downVector", { get: function () { return ( this._downVector || (this._downVector = new B()), this._matrix3D.copyColumnTo(1, this._downVector, !0), this._downVector ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "forwardVector", { get: function () { return ( this._forwardVector || (this._forwardVector = new B()), this._matrix3D.copyColumnTo(2, this._forwardVector), this._forwardVector ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "leftVector", { get: function () { return ( this._leftVector || (this._leftVector = new B()), this._matrix3D.copyColumnTo(0, this._backVector, !0), this._leftVector ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "matrix", { get: function () { return ( this._matrix || (this._matrix = new O()), this._matrix3DDirty && this.updateMatrix3D(), (this._matrix.a = this._matrix3D._rawData[0]), (this._matrix.b = this._matrix3D._rawData[1]), (this._matrix.c = this._matrix3D._rawData[4]), (this._matrix.d = this._matrix3D._rawData[5]), (this._matrix.tx = this._matrix3D._rawData[12]), (this._matrix.ty = this._matrix3D._rawData[13]), this._matrix ); }, set: function (t) { t && (this._matrix3D.identity(), (this._matrix3D._rawData[0] = t.a), (this._matrix3D._rawData[1] = t.b), (this._matrix3D._rawData[4] = t.c), (this._matrix3D._rawData[5] = t.d), (this._matrix3D._rawData[12] = t.tx), (this._matrix3D._rawData[13] = t.ty), this.invalidateComponents(), (this._matrix3DDirty = !1), (this._inverseMatrix3DDirty = !0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "matrix3D", { get: function () { return this._matrix3DDirty && this.updateMatrix3D(), this._matrix3D; }, set: function (t) { if (t) { var e = t._rawData, n = this._matrix3D._rawData; (n[0] = e[0]), (n[1] = e[1]), (n[2] = e[2]), (n[3] = e[3]), (n[4] = e[4]), (n[5] = e[5]), (n[6] = e[6]), (n[7] = e[7]), (n[8] = e[8]), (n[9] = e[9]), (n[10] = e[10]), (n[11] = e[11]), (n[12] = e[12]), (n[13] = e[13]), (n[14] = e[14]), (n[15] = e[15]); } else this._matrix3D.identity(); this.invalidateComponents(), (this._matrix3DDirty = !1), (this._inverseMatrix3DDirty = !0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pixelBounds", { get: function () { return this._pixelBounds; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "position", { get: function () { return this._matrix3D.position; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rightVector", { get: function () { return ( this._rightVector || (this._rightVector = new B()), this._matrix3D.copyColumnTo(0, this._rightVector), this._rightVector ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rotation", { get: function () { return ( this._componentsDirty && this._updateComponents(), this._rotation ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scale", { get: function () { return ( this._componentsDirty && this._updateComponents(), this._scale ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "skew", { get: function () { return ( this._componentsDirty && this._updateComponents(), this._skew ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "upVector", { get: function () { return ( this._upVector || (this._upVector = new B()), this._matrix3D.copyColumnTo(1, this._upVector), this._upVector ); }, enumerable: !0, configurable: !0, }), (n.prototype.append = function (t) { console.log( "append(" + t + ") is not implemented yet in core/Transform" ); }), (n.prototype.clearColorTransform = function () { this._colorTransform && (this._colorTransform.clear(), this.invalidateColorTransform()); }), (n.prototype.clearMatrix3D = function () { this._matrix3D.identity(), this.invalidateComponents(); }), (n.prototype.clone = function () { var t = new n(); return this.copyRawDataTo(t), t; }), (n.prototype.copyRawDataTo = function (t) { this._matrix3DDirty && this.updateMatrix3D(); var e = t._rawData, n = this._rawData; (e[0] = n[0]), (e[1] = n[1]), (e[2] = n[2]), (e[3] = n[3]), (e[4] = n[4]), (e[5] = n[5]), (e[6] = n[6]), (e[7] = n[7]), (e[8] = n[8]), (e[9] = n[9]), (e[10] = n[10]), (e[11] = n[11]), (e[12] = n[12]), (e[13] = n[13]), (e[14] = n[14]), (e[15] = n[15]), (e[16] = n[16]), (e[17] = n[17]), (e[18] = n[18]), (e[19] = n[19]), (e[20] = n[20]), (e[21] = n[21]), (e[22] = n[22]), (e[23] = n[23]), this.invalidateComponents(), this.invalidateColorTransform(); }), (n.prototype.dispose = function () {}), (n.prototype.invalidateColorTransform = function () { this._invalidateColorTransform || (this._invalidateColorTransform = new D( D.INVALIDATE_COLOR_TRANSFORM, this )), this.dispatchEvent(this._invalidateColorTransform); }), (n.prototype.invalidateComponents = function () { this.invalidatePosition(), (this._componentsDirty = !0); }), (n.prototype.invalidateMatrix3D = function () { (this._inverseMatrix3DDirty = !0), this._matrix3DDirty || ((this._matrix3DDirty = !0), this._invalidateMatrix3D || (this._invalidateMatrix3D = new D(D.INVALIDATE_MATRIX3D, this)), this.dispatchEvent(this._invalidateMatrix3D)); }), (n.prototype.invalidatePosition = function () { (this._inverseMatrix3DDirty = !0), this._matrix3D.invalidatePosition(), this._invalidateMatrix3D || (this._invalidateMatrix3D = new D(D.INVALIDATE_MATRIX3D, this)), this.dispatchEvent(this._invalidateMatrix3D); }), (n.prototype.lookAt = function (t, e) { void 0 === e && (e = null), null == e && (e = B.Y_AXIS); var n = F.getPointAtMatrix( new B(), t.subtract(this._matrix3D.position), e, F.CALCULATION_MATRIX ).decompose()[1]; this.rotateTo(n.x, n.y, n.z); }), (n.prototype.moveBackward = function (t) { this.translateLocal(B.Z_AXIS, -t); }), (n.prototype.moveDown = function (t) { this.translateLocal(B.Y_AXIS, -t); }), (n.prototype.moveForward = function (t) { this.translateLocal(B.Z_AXIS, t); }), (n.prototype.moveLeft = function (t) { this.translateLocal(B.X_AXIS, -t); }), (n.prototype.moveRight = function (t) { this.translateLocal(B.X_AXIS, t); }), (n.prototype.moveTo = function (t, e, n) { (this._matrix3D._rawData[12] = t), (this._matrix3D._rawData[13] = e), (this._matrix3D._rawData[14] = n), this.invalidatePosition(); }), (n.prototype.moveUp = function (t) { this.translateLocal(B.Y_AXIS, t); }), (n.prototype.pitch = function (t) { this.rotate(B.X_AXIS, t); }), (n.prototype.roll = function (t) { this.rotate(B.Z_AXIS, t); }), (n.prototype.rotate = function (t, e) { this.matrix3D.prependRotation(e, t), this.invalidateComponents(); }), (n.prototype.rotateTo = function (t, e, n) { this._componentsDirty && this._updateComponents(), (this._rotation.x = t), (this._rotation.y = e), (this._rotation.z = n), this.invalidateMatrix3D(); }), (n.prototype.scaleTo = function (t, e, n) { this._componentsDirty && this._updateComponents(), (this._scale.x = t), (this._scale.y = e), (this._scale.z = n), this.invalidateMatrix3D(); }), (n.prototype.skewTo = function (t, e, n) { this._componentsDirty && this._updateComponents(), (this._skew.x = t), (this._skew.y = e), (this._skew.z = n), this.invalidateMatrix3D(); }), (n.prototype.translate = function (t, e) { var n = t.x, r = t.y, i = t.z, o = e / Math.sqrt(n * n + r * r + i * i); this.matrix3D.appendTranslation(n * o, r * o, i * o), this.invalidatePosition(); }), (n.prototype.translateLocal = function (t, e) { var n = t.x, r = t.y, i = t.z, o = e / Math.sqrt(n * n + r * r + i * i); this.matrix3D.prependTranslation(n * o, r * o, i * o), this.invalidatePosition(); }), (n.prototype.updateMatrix3D = function () { this._matrix3D.recompose(this._components), (this._matrix3DDirty = !1); }), (n.prototype.yaw = function (t) { this.rotate(B.Y_AXIS, t); }), (n.prototype._updateComponents = function () { var t, e = this._matrix3D.decompose(); (t = e[1]), (this._rotation.x = t.x), (this._rotation.y = t.y), (this._rotation.z = t.z), (t = e[2]), (this._skew.x = t.x), (this._skew.y = t.y), (this._skew.z = t.z), (t = e[3]), (this._scale.x = t.x), (this._scale.y = t.y), (this._scale.z = t.z), (this._componentsDirty = !1); }), n ); })(h), U = (function (t) { function n(e, n) { return ( void 0 === e && (e = ""), void 0 === n && (n = 0), t.call( this, "PartialImplementationError - this function is in development. Required Dependency: " + e, n ) || this ); } return e(n, t), n; })(s), j = (function (t) { function n(e, n) { return ( void 0 === e && (e = null), void 0 === n && (n = 0), t.call(this, e || "RangeError", n) || this ); } return e(n, t), n; })(s), V = (function (t) { function n(e, n, r, i) { void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = null); var o = t.call(this, e) || this; return (o._url = n), (o._content = r), (o._assets = i), o; } return ( e(n, t), Object.defineProperty(n.prototype, "content", { get: function () { return this._content; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "url", { get: function () { return this._url; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assets", { get: function () { return this._assets; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._url, this._content, this._assets); }), (n.LOADER_START = "loaderStart"), (n.LOADER_COMPLETE = "loaderComplete"), n ); })(l), Q = (function (t) { function n(e, n) { void 0 === n && (n = ""); var r = t.call(this, e) || this; return (r._message = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "message", { get: function () { return this._message; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._message); }), (n.PARSE_COMPLETE = "parseComplete"), (n.PARSE_ERROR = "parseError"), (n.READY_FOR_DEPENDENCIES = "readyForDependencies"), n ); })(l), G = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._projection = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "projection", { get: function () { return this._projection; }, enumerable: !0, configurable: !0, }), (n.INVALIDATE_FRUSTUM_MATRIX3D = "invalidateFrustumMatrix3D"), (n.INVALIDATE_VIEW_MATRIX3D = "invalidateViewMatrix3D"), n ); })(l), z = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.TIMER = "timer"), (n.TIMER_COMPLETE = "timerComplete"), n ); })(l), H = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._urlLoader = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "urlLoader", { get: function () { return this._urlLoader; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._urlLoader); }), (n.HTTP_STATUS = "httpStatus"), (n.LOAD_ERROR = "loadError"), (n.LOAD_PROGRESS = "loadProgress"), (n.LOAD_START = "loadStart"), (n.LOAD_COMPLETE = "loadComplete"), n ); })(l), X = (function () { function t() {} return ( (t.BACK = 0), (t.FRONT = 1), (t.IN = 0), (t.OUT = 1), (t.INTERSECT = 2), t ); })(), Y = (function () { function t(e, n, r, i) { void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), (this.a = e), (this.b = n), (this.c = r), (this.d = i), (this._iAlignment = 0 == e && 0 == n ? t.ALIGN_XY_AXIS : 0 == n && 0 == r ? t.ALIGN_YZ_AXIS : 0 == e && 0 == r ? t.ALIGN_XZ_AXIS : t.ALIGN_ANY); } return ( (t.prototype.fromPoints = function (e, n, r) { var i = n.x - e.x, o = n.y - e.y, a = n.z - e.z, s = r.x - e.x, u = r.y - e.y, l = r.z - e.z; (this.a = o * l - a * u), (this.b = a * s - i * l), (this.c = i * u - o * s), (this.d = this.a * e.x + this.b * e.y + this.c * e.z), 0 == this.a && 0 == this.b ? (this._iAlignment = t.ALIGN_XY_AXIS) : 0 == this.b && 0 == this.c ? (this._iAlignment = t.ALIGN_YZ_AXIS) : 0 == this.a && 0 == this.c ? (this._iAlignment = t.ALIGN_XZ_AXIS) : (this._iAlignment = t.ALIGN_ANY); }), (t.prototype.fromNormalAndPoint = function (e, n) { (this.a = e.x), (this.b = e.y), (this.c = e.z), (this.d = this.a * n.x + this.b * n.y + this.c * n.z), 0 == this.a && 0 == this.b ? (this._iAlignment = t.ALIGN_XY_AXIS) : 0 == this.b && 0 == this.c ? (this._iAlignment = t.ALIGN_YZ_AXIS) : 0 == this.a && 0 == this.c ? (this._iAlignment = t.ALIGN_XZ_AXIS) : (this._iAlignment = t.ALIGN_ANY); }), (t.prototype.normalize = function () { var t = 1 / Math.sqrt(this.a * this.a + this.b * this.b + this.c * this.c); return ( (this.a *= t), (this.b *= t), (this.c *= t), (this.d *= t), this ); }), (t.prototype.distance = function (e) { return this._iAlignment == t.ALIGN_YZ_AXIS ? this.a * e.x - this.d : this._iAlignment == t.ALIGN_XZ_AXIS ? this.b * e.y - this.d : this._iAlignment == t.ALIGN_XY_AXIS ? this.c * e.z - this.d : this.a * e.x + this.b * e.y + this.c * e.z - this.d; }), (t.prototype.classifyPoint = function (e, n) { return ( void 0 === n && (n = 0.01), this.d != this.d ? X.FRONT : (r = this._iAlignment == t.ALIGN_YZ_AXIS ? this.a * e.x - this.d : this._iAlignment == t.ALIGN_XZ_AXIS ? this.b * e.y - this.d : this._iAlignment == t.ALIGN_XY_AXIS ? this.c * e.z - this.d : this.a * e.x + this.b * e.y + this.c * e.z - this.d) < -n ? X.BACK : r > n ? X.FRONT : X.INTERSECT ); var r; }), (t.prototype.toString = function () { return ( "Plane3D [a:" + this.a + ", b:" + this.b + ", c:" + this.c + ", d:" + this.d + "]" ); }), (t.ALIGN_ANY = 0), (t.ALIGN_XY_AXIS = 1), (t.ALIGN_YZ_AXIS = 2), (t.ALIGN_XZ_AXIS = 3), t ); })(), q = (function () { function t() {} return ( (t.initDistributions = function () { (this._distributions = new Array()), (this._distributions[0] = new Array(0.3082841, 0.4320919)), (this._distributions[1] = new Array( 0.3082841, 0.4320919, -0.2274942, -0.6640266 )), (this._distributions[2] = new Array( 0.8742689, 0.0009265686, -0.6864116, -0.5536607, -0.2325206, 0.7678371 )), (this._distributions[3] = new Array( 0.3913446, -0.7084417, -0.7511101, -0.5935929, -0.2323436, 0.5320091, 0.8435315, 0.5035911 )), (this._distributions[4] = new Array( 0.2122471, -0.5771395, -0.8543506, -0.1763534, 0.5189021, 0.8323698, -0.3616908, 0.5865368, 0.9523004, -0.04948437 )), (this._distributions[5] = new Array( 0.5791035, 0.3496495, 0.2959551, -0.6006749, -0.2419119, -0.06879545, -0.7403072, 0.6110353, -0.04555973, 0.8059174, -0.5275017, -0.737129 )), (this._distributions[6] = new Array( 0.06941478, 0.8519508, -0.7441907, 0.2426432, 0.6439992, -0.2405252, -0.1007523, -0.2327587, -0.6427067, -0.7248485, 0.8050759, 0.5492936, 0.3573822, -0.8824506 )), (this._distributions[7] = new Array( 0.8509863, 0.4452587, -0.09507271, 0.2073005, 0.1706571, -0.6434793, 0.8029777, -0.2718274, -0.4401725, 0.8196304, 0.2715359, 0.8598521, -0.8121575, -0.006447683, -0.6486837, -0.7237598 )), (this._distributions[8] = new Array( 0.6951686, -0.2680728, -0.04933243, 0.3710589, 0.6592212, 0.3661054, -0.01579228, -0.6909603, -0.3275101, -0.1756866, 0.3811549, 0.9218544, -0.216032, 0.9755028, -0.7065172, 0.3355389, -0.6579109, -0.6798355 )), (this._distributions[9] = new Array( 0.6181276, -0.09790418, -0.2537868, -0.5570995, -0.1964931, 0.3459414, 0.3474613, -0.8885581, 0.5135743, 0.5753114, -0.9549091, 0.1480672, -0.8711916, -0.4293123, -0.6928071, 0.6190156, -0.13369, 0.8892705, 0.0548224, -0.1246777 )), (this._distributions[10] = new Array( 0.4853027, -0.5080479, -0.1331675, -0.506597, 0.139575, 0.01316885, 0.803486, -0.07568797, 0.5240274, 0.4883182, -0.4334005, 0.1207938, -0.7794577, -0.3985141, 0.1576432, -0.9861221, -0.3712867, 0.6959021, 0.1517378, 0.9847429, -0.9762396, 0.1661073 )), (this._distributions[11] = new Array( -0.2790166, -0.01252619, 0.3389016, 0.3921154, 0.2408341, -0.313211, -0.8151779, -0.3898362, -0.6347761, 0.3486495, 0.09471484, -0.7722448, -0.1385674, 0.6364574, 0.2456331, 0.9295807, -0.3864306, -0.8247881, 0.6111673, -0.7164014, 0.8287669, 0.05466961, 0.837706, 0.5415626 )), (this._distributions[12] = new Array( 0.056417, 0.3185693, -0.8245888, 0.1882799, 0.8575996, 0.1136829, 0.1070375, 0.875332, 0.4076743, -0.06000621, -0.4311306, 0.7239349, 0.2677574, -0.538472, -0.08486642, -0.2083647, -0.888989, -0.3906443, -0.4768958, -0.6664082, 0.09334993, -0.9861541, 0.808736, -0.455949, 0.5889823, 0.7660807 )), (this._distributions[13] = new Array( -0.2681346, -0.3955857, -0.1315102, -0.8852947, -0.5143692, 0.09551838, 0.4344836, -0.546945, -0.8620899, -0.3813288, 0.1650431, 0.02034803, -0.1543657, 0.3842218, -0.828457, 0.5376903, -0.6145, -0.7818927, -0.2639062, 0.8784655, 0.1912684, 0.9720125, 0.3135219, 0.5224229, 0.7850655, 0.4592297, 0.7465045, -0.1368916 )), (this._distributions[14] = new Array( 0.4241029, 0.695281, 0.150511, -0.02304107, -0.2482675, 0.9120338, 0.8057325, 0.2622084, -0.2445909, 0.2765962, 0.8588713, -0.1772072, 0.3117845, -0.4385471, -0.3923851, -0.3298936, -0.1751254, -0.7405846, 0.6926506, -0.684163, -0.9304563, -0.3254691, -0.8533293, 0.1523024, 0.2510415, -0.917345, -0.6239773, -0.7105472, -0.6104624, 0.6041355 )), (this._distributions[15] = new Array( 0.5844554, 0.06651045, 0.1343258, 0.6756578, 0.3799674, -0.6301104, 0.5590436, 0.7940555, 0.09574714, 0.02262517, 0.8697868, 0.393301, 0.003945862, -0.421735, 0.9043913, -0.2432393, -0.4844007, 0.7190998, -0.3201078, 0.2972371, -0.3852352, -0.6341155, -0.5413069, -0.09223081, -0.8468984, -0.5126905, 0.004156174, -0.8633173, -0.9681889, -0.03305046, -0.846509, 0.4414353 )), (this._distributions[16] = new Array( 0.4506488, 0.657668, 0.4621297, 0.07441051, -0.2782125, 0.6201044, 0.9750003, 0.09110117, 0.1019436, 0.2986514, 0.03457398, 0.9631706, 0.542098, -0.5505635, 0.8675668, 0.4938077, -0.5414361, 0.2655292, -0.7941836, 0.6003053, -0.09847672, -0.1001604, -0.9316511, -0.08572888, 0.07286467, -0.611899, -0.5232627, -0.4082253, -0.5481608, -0.827938, -0.1551939, -0.9621193, 0.9220031, -0.3315949 )), (this._distributions[17] = new Array( 0.197908, -0.4697656, -0.4474689, -0.3428435, 0.8529873, -0.2228634, 0.6022478, -0.5469642, 0.2545276, -0.931133, -0.1507547, -0.7855865, -0.07606658, 0.1011628, 0.3046715, 0.2785755, 0.4698432, -0.1064076, 0.6831254, 0.4152522, 0.1374381, 0.8363233, -0.2166121, 0.6682042, 0.5511393, 0.7996449, -0.4278994, 0.28836, -0.8875198, 0.2181732, -0.8772842, -0.2818254, -0.7000262, 0.5762185, -0.6062385, -0.7439126 )), (this._distributions[18] = new Array( 0.6645703, -0.05678739, 0.5720971, 0.4533803, -0.07660709, 0.08802763, 0.5163431, -0.4426552, 0.1163455, -0.3404382, -0.4004807, -0.5046007, 0.2932099, -0.8201418, -0.5322125, 0.03834766, -0.1490209, -0.8817304, -0.8000439, -0.3509448, 0.5260983, 0.8421043, 0.1197811, 0.6963812, 0.9498612, 0.3122156, -0.9285746, 0.02120355, -0.6670724, 0.7217396, 0.9155889, -0.3510147, -0.271941, 0.4727852, 0.318879, 0.1634057, -0.2686755, 0.9253026 )), (this._distributions[19] = new Array( 0.5064292, 0.422527, 0.8935515, -0.06610427, 0.1199719, 0.175568, 0.403388, -0.2003276, 0.1657927, 0.8154403, 0.9301245, 0.2929218, -0.1644068, 0.6201534, 0.7113559, -0.6589743, -0.3364046, -0.1799502, 0.02109996, -0.392765, -0.382213, 0.3219992, -0.9201946, 0.1207967, -0.726185, 0.4291916, -0.7443482, -0.2480059, -0.5147594, 0.7418784, 0.1935272, -0.7406143, -0.3643523, -0.5559214, -0.7147766, -0.6326278, -0.2524151, -0.9096627, 0.5161405, 0.7908453 )), (this._distributions[20] = new Array( 0.7921003, -0.3032096, 0.5992879, -0.009052323, 0.2538549, -0.1872749, 0.7053444, 0.3677175, 0.5417761, -0.8170255, 0.9749611, 0.1210478, 0.1969143, -0.6117041, -0.1824499, -0.4634196, -0.1181338, -0.8668742, -0.3050112, -0.1352596, -0.4409327, -0.7082354, -0.03225285, 0.1171548, 0.3113096, 0.3250439, -0.8166144, -0.463995, -0.01014475, 0.4715334, -0.6868284, 0.05091889, -0.4011163, 0.2717285, -0.06756835, 0.8307694, -0.7938535, 0.4352129, -0.4663842, 0.7165329, 0.559729, 0.8093995 )), (this._distributions[21] = new Array( 0.07832243, 0.426151, -0.3856795, 0.5799953, 0.01970797, 0.06706189, 0.4822682, 0.3014512, -0.1532982, 0.87485, -0.4959527, 0.07888043, 0.260601, -0.2304784, 0.4996209, 0.7167382, 0.585986, -0.04265174, -0.7679967, 0.5509416, -0.9041753, 0.1802134, -0.8407655, -0.4442826, -0.2058258, -0.2636995, -0.4984115, -0.5928579, 0.2926032, -0.7886473, -0.06933882, -0.621177, 0.578115, -0.4813387, 0.8981777, -0.3291056, 0.1942733, 0.9255584, 0.8084362, 0.5066984, 0.9920095, 0.03103104, -0.2403206, -0.9389018 )), (this._distributions[22] = new Array( -0.5691095, 0.1014316, -0.7788262, 0.384012, -0.8253665, -0.1645582, -0.1830993, 0.002997211, -0.2555013, -0.4177977, -0.6640869, -0.4794711, -0.2351242, 0.5850121, 0.02436554, 0.2825883, 0.006061143, -0.8200245, 0.1618791, -0.3063331, -0.3765897, -0.7249815, 0.6092919, -0.6769328, -0.5956934, 0.6957655, 0.5383642, 0.4522677, -0.1489165, 0.9125596, 0.4167473, 0.1335986, 0.1898309, 0.5874342, 0.2288171, 0.9624356, 0.7540846, -0.07672304, 0.8986252, 0.2788797, 0.3555991, -0.9262139, 0.8454325, -0.4027667, 0.4945236, -0.2935512 )), (this._distributions[23] = new Array( -0.4481403, -0.3758374, -0.8877251, 0.08739938, 0.05015831, -0.1339983, -0.4070427, -0.8534173, 0.1019274, -0.5503222, -0.445998, 0.1997541, -0.8686263, -0.2788867, -0.7695944, -0.6033704, -0.05515742, -0.885711, -0.7714347, 0.5790485, 0.3466263, -0.8799297, 0.4487582, -0.5321087, -0.2461368, 0.6053771, -0.05568117, 0.2457351, -0.4668669, 0.8523816, 0.8103387, -0.4255538, 0.4054182, -0.175663, -0.2802011, -0.08920153, 0.2665959, 0.382935, 0.555679, 0.1621837, 0.105246, 0.8420411, 0.6921161, 0.6902903, 0.880946, 0.2483067, 0.9699264, -0.1021767 )), (this._distributions[24] = new Array( -0.1703323, -0.3119385, 0.2916039, -0.2988263, -0.008472982, -0.9277695, -0.7730271, -0.3277904, 0.3440474, -0.6815342, -0.2910278, 0.03461745, -0.6764899, -0.657078, -0.3505501, -0.7311988, -0.03478927, 0.3258755, -0.6048835, 0.159423, 0.2035525, 0.02212214, 0.5116573, 0.2226856, 0.6664805, -0.2500189, 0.7147882, -0.6609634, 0.03030632, -0.5763278, -0.2516585, 0.6116219, -0.9434413, -0.0116792, 0.9061816, 0.2491155, 0.182867, 0.6076167, 0.286593, 0.9485695, -0.5992439, 0.6970096, -0.2082874, 0.9416641, 0.9880044, -0.1541709, -0.9122881, 0.331555, 0.7324886, 0.6725098 )), (this._distributions[25] = new Array( 0.3869598, -0.04974834, 0.7168844, -0.0693711, -0.07166742, 0.1725325, 0.4599592, 0.3232779, 0.5872094, -0.4198674, 0.2442266, -0.625667, 0.1254557, 0.4500048, -0.2290154, -0.1803567, 0.890583, 0.3373493, 0.1256081, 0.7853789, -0.2676466, 0.5305805, -0.7063224, 0.252168, -0.3989835, 0.1189921, 0.09617215, -0.2451447, 0.6302541, 0.6085876, 0.9380925, -0.3234899, 0.5086241, -0.8573482, 0.03576187, -0.9876697, -0.0876712, -0.6365195, -0.5276513, 0.823456, -0.6935764, -0.2240411, -0.5212318, -0.5383121, -0.2116208, 0.9639363, -0.9840096, 0.02743555, -0.3991577, -0.8994547, -0.7830126, 0.614068 )), (this._distributions[26] = new Array( -0.8366601, 0.4464895, -0.5917366, -0.02073906, -0.9845258, 0.1635625, -0.3097973, 0.4379579, -0.5478154, 0.7173221, -0.1685888, 0.9261969, 0.01503595, 0.6046097, 0.4452421, 0.5449086, 0.0315687, 0.1944619, 0.3753404, 0.8688548, 0.4143643, 0.1396648, 0.8711032, 0.4304703, 0.7328773, 0.1461501, 0.6374492, -0.3521495, 0.145613, -0.1341466, 0.9040975, -0.135123, -0.7839059, -0.5450199, -0.516019, -0.3320859, -0.206158, -0.4431106, -0.9703014, -0.2368356, -0.2473119, -0.0864351, 0.2130725, -0.4604077, -0.003726701, -0.7122303, -0.4072131, -0.6833169, 0.1632999, -0.9776646, 0.4686888, -0.680495, -0.2293511, -0.9509777 )), (this._distributions[27] = new Array( 0.107311, -0.1311369, -0.4194764, -0.3148777, 0.6171439, -0.2745973, 0.2796618, 0.1937153, -0.09106886, 0.4180236, 0.6044006, 0.05577846, 0.02927299, -0.6738263, -0.2580845, 0.1179939, -0.09023564, -0.3830024, 0.3570953, -0.5000587, 0.81591, -0.5518309, 0.9300217, -0.1257987, 0.4904627, -0.8381903, -0.3163182, -0.8632009, 0.1137595, -0.9875998, 0.8390043, 0.3538185, 0.2149114, 0.4993694, 0.5191584, 0.3833552, 0.5002763, 0.7061465, -0.2567276, 0.9068756, -0.5197366, 0.3467845, 0.03668867, 0.9734009, -0.5347553, 0.66747, -0.9028882, 0.1023768, -0.8967977, 0.412834, -0.5821944, 0.0426479, -0.8032165, -0.2397038, -0.5597343, -0.6358021 )), (this._distributions[28] = new Array( -0.6562496, -0.1781036, -0.9301494, 0.1185208, -0.3861143, -0.4153562, -0.1560799, -0.1099607, -0.5587025, 0.395218, -0.5322112, -0.699701, -0.5008639, 0.08726846, -0.970524, -0.1963461, -0.813577, -0.5185111, -0.1644458, 0.298, -0.3216791, 0.639982, 0.3315373, 0.3339162, 0.2383235, -0.00105722, 0.1137828, 0.5450742, -0.01899921, 0.8798413, 0.2849685, 0.8255596, 0.6974412, 0.2123175, 0.7588523, 0.5470437, 0.5102502, -0.1687844, 0.5853448, 0.8033476, 0.2590716, -0.5262504, 0.5607718, -0.6342825, 0.8666443, -0.1491841, 0.8341052, -0.4935003, -0.1568441, -0.6634066, 0.2512113, -0.8769391, -0.2559827, -0.9572457, -0.01928852, -0.3966542, -0.750667, 0.6409678 )), (this._distributions[29] = new Array( 0.3454786, -0.04837726, 0.2649553, 0.2406852, 0.5599093, -0.3839145, -0.1111814, -0.05502108, 0.7586042, -0.05818377, 0.2519488, -0.4665135, -0.1264972, 0.2602723, -0.08766216, -0.3671907, 0.6428129, 0.3999204, -0.6105871, -0.1246869, -0.4589451, -0.7646643, -0.03021116, -0.7899352, -0.6036922, -0.4293956, -0.2481938, 0.6534185, 0.102798, 0.6784465, -0.6392644, 0.4821358, -0.6789002, 0.1779133, -0.9140783, -0.1989647, -0.9262617, 0.3381507, 0.4794891, -0.8093274, 0.3959447, 0.668478, 0.9602883, 0.2272305, -0.123672, 0.9210883, 0.2375148, 0.9523395, -0.52898, 0.7973378, -0.382433, 0.1228794, 0.695015, 0.6948439, 0.7530277, -0.6458191, 0.8777987, -0.3272956, 0.2318525, -0.962768 )), (this._distributions[30] = new Array( 0.4518921, -0.1146195, 0.4720805, -0.4238748, 0.3655423, 0.1806341, 0.1589939, -0.23568, 0.7673324, -0.5149941, 0.01163658, 0.09045836, 0.7010971, 0.1245747, 0.7518286, -0.1855433, 0.4960719, 0.4601022, 0.2566979, -0.6308268, -0.0654714, -0.5126389, -0.1823319, -0.1343282, -0.1464312, 0.4883236, -0.3858738, 0.203523, 0.1484799, 0.4432284, -0.477109, -0.116241, 0.2719092, 0.7208626, 0.9104174, 0.3578536, -0.5956199, 0.7662588, -0.6996251, 0.3678654, -0.2514512, 0.9251933, 0.1275825, -0.9478135, -0.204608, -0.8611552, 0.4264838, -0.877443, 0.9854161, 0.05521112, 0.5912951, 0.7997434, 0.1140349, 0.982093, -0.9324368, -0.2094094, -0.42436, -0.6441524, -0.6722705, -0.3554261, -0.7844236, 0.08587621 )), (this._distributions[31] = new Array( -0.4206714, -0.5613642, -0.8733016, -0.3373051, -0.1046226, -0.2902999, -0.1318562, -0.8434365, 0.1145093, -0.5962623, -0.4965627, -0.1873259, -0.5011808, -0.8546229, -0.7165636, -0.5743566, 0.1090901, 0.2017643, 0.3404809, -0.220455, -0.1989015, 0.2372122, -0.4538706, 0.0979171, 0.4514146, -0.572846, 0.2314168, -0.8514503, -0.4247236, 0.5650803, -0.943347, 0.04514639, -0.1309718, 0.5221877, -0.7004157, 0.4561877, 0.6306441, 0.04448673, 0.4301621, 0.5766876, 0.1078042, 0.7245752, 0.3875354, 0.2794483, 0.702876, -0.2924213, 0.7360667, -0.6210318, 0.7486517, 0.6531103, 0.4898235, 0.8591025, 0.6549174, 0.3854057, -0.2596106, 0.7916998, 0.9251194, -0.05296265, -0.5620695, 0.820877, -0.01228026, 0.9937211, 0.9612103, 0.2628758 )); }), (t.getDistribution = function (t) { return ( this._distributions || this.initDistributions(), t < 1 || t > 32 ? null : this._distributions[t - 1] ); }), t ); })(), K = (function () { function t(t, e, n, r) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), (this._rawData = new Float32Array(4)); var i = this._rawData; (i[0] = t), (i[1] = e), (i[2] = n), (i[3] = r); } return ( (t.prototype.axCallPublicProperty = function (t, e) { return null; }), (t.prototype.axGetPublicProperty = function (t) { return null; }), (t.prototype.axSetPublicProperty = function (t) { return null; }), Object.defineProperty(t.prototype, "height", { get: function () { return this._rawData[3]; }, set: function (t) { this._rawData[3] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "width", { get: function () { return this._rawData[2]; }, set: function (t) { this._rawData[2] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "x", { get: function () { return this._rawData[0]; }, set: function (t) { this._rawData[0] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "y", { get: function () { return this._rawData[1]; }, set: function (t) { this._rawData[1] = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "bottom", { get: function () { return this._rawData[1] + this._rawData[3]; }, set: function (t) { this._rawData[3] = t - this._rawData[1]; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "bottomRight", { get: function () { return ( null == this._bottomRight && (this._bottomRight = new P()), (this._bottomRight._rawData[0] = this._rawData[0] + this._rawData[2]), (this._bottomRight._rawData[1] = this._rawData[1] + this._rawData[3]), this._bottomRight ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "left", { get: function () { return this._rawData[0]; }, set: function (t) { (this._rawData[2] += this._rawData[0] - t), (this._rawData[0] = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "right", { get: function () { return this._rawData[0] + this._rawData[2]; }, set: function (t) { this._rawData[2] = t - this._rawData[0]; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "size", { get: function () { return ( null == this._size && (this._size = new P()), (this._size._rawData[0] = this._rawData[2]), (this._size._rawData[1] = this._rawData[3]), this._size ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "top", { get: function () { return this._rawData[1]; }, set: function (t) { (this._rawData[3] += this._rawData[1] - t), (this._rawData[1] = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "topLeft", { get: function () { return ( null == this._topLeft && (this._topLeft = new P()), (this._topLeft._rawData[0] = this._rawData[0]), (this._topLeft._rawData[1] = this._rawData[1]), this._topLeft ); }, enumerable: !0, configurable: !0, }), (t.prototype.clone = function () { var e = this._rawData; return new t(e[0], e[1], e[2], e[3]); }), (t.prototype.contains = function (t, e) { var n = this._rawData; return n[0] <= t && n[0] + n[2] >= t && n[1] <= e && n[1] + n[3] >= e; }), (t.prototype.containsPoint = function (t) { var e = this._rawData, n = t._rawData; return ( e[0] <= n[0] && e[0] + e[2] >= n[0] && e[1] <= n[1] && e[1] + e[3] >= n[1] ); }), (t.prototype.containsRect = function (t) { var e = this._rawData, n = t._rawData; return ( e[0] <= n[0] && e[0] + e[2] >= n[0] + n[2] && e[1] <= n[1] && e[1] + e[3] >= n[1] + n[3] ); }), (t.prototype.copyFrom = function (t) { var e = this._rawData, n = t._rawData; (e[0] = n[0]), (e[1] = n[1]), (e[2] = n[2]), (e[3] = n[3]); }), (t.prototype.equals = function (t) { var e = this._rawData, n = t._rawData; return e[0] == n[0] && e[1] == n[1] && e[2] == n[2] && e[3] == n[3]; }), (t.prototype.inflate = function (t, e) { var n = this._rawData; (n[0] -= t / 2), (n[1] -= e / 2), (n[2] += t / 2), (n[3] += e / 2); }), (t.prototype.inflatePoint = function (t) { var e = this._rawData; (e[0] -= t.x / 2), (e[1] -= t.y / 2), (e[2] += t.x / 2), (e[3] += t.y / 2); }), (t.prototype.intersection = function (e) { var n = this._rawData, r = e._rawData; if (this.intersects(e)) { var i = new t(), o = i._rawData; return ( n[0] > r[0] ? ((o[0] = n[0]), (o[2] = r[0] - n[0] + r[2]), o[2] > n[2] && (o[2] = n[2])) : ((o[0] = r[0]), (o[2] = n[0] - r[0] + n[2]), o[2] > r[2] && (o[2] = r[2])), n[1] > r[1] ? ((o[1] = n[1]), (o[3] = r[1] - n[1] + r[3]), o[3] > n[3] && (o[3] = n[3])) : ((o[1] = r[1]), (o[3] = n[1] - r[1] + n[3]), o[3] > r[3] && (o[3] = r[3])), i ); } return new t(); }), (t.prototype.intersects = function (t) { var e = this._rawData, n = t._rawData; return ( e[0] + e[2] > n[0] && e[0] < n[0] + n[2] && e[1] + e[3] > n[1] && e[1] < n[1] + n[3] ); }), (t.prototype.isEmpty = function () { var t = this._rawData; return 0 == t[0] && 0 == t[1] && 0 == t[2] && 0 == t[3]; }), (t.prototype.offset = function (t, e) { (this._rawData[0] += t), (this._rawData[1] += e); }), (t.prototype.offsetPoint = function (t) { (this._rawData[0] += t.x), (this._rawData[1] += t.y); }), (t.prototype.setEmpty = function () { var t = this._rawData; (t[0] = 0), (t[1] = 0), (t[2] = 0), (t[3] = 0); }), (t.prototype.setTo = function (t, e, n, r) { var i = this._rawData; (i[0] = t), (i[1] = e), (i[2] = n), (i[3] = r); }), (t.prototype.toString = function () { return ( "[Rectangle] (x=" + this.x + ", y=" + this.y + ", width=" + this.width + ", height=" + this.height + ")" ); }), (t.prototype.union = function (e) { var n = this._rawData, r = e._rawData, i = new t(), o = i._rawData; return ( n[0] < r[0] ? ((o[0] = n[0]), (o[2] = r[0] - n[0] + r[2]), o[2] < n[2] && (o[2] = n[2])) : ((o[0] = r[0]), (o[2] = n[0] - r[0] + n[2]), o[2] < r[2] && (o[2] = r[2])), n[1] < r[1] ? ((o[1] = n[1]), (o[3] = r[1] - n[1] + r[3]), o[3] < n[3] && (o[3] = n[3])) : ((o[1] = r[1]), (o[3] = n[1] - r[1] + n[3]), o[3] < r[3] && (o[3] = r[3])), i ); }), t ); })(), W = (function (t) { function n(e, n) { var r = t.call(this) || this; return ( (r._invalid = !0), (r._asset = e), (r._pool = n), (r._onClearDelegate = function (t) { return r.onClear(t); }), (r._onInvalidateDelegate = function (t) { return r.onInvalidate(t); }), r._asset && (r._asset.addEventListener(c.CLEAR, r._onClearDelegate), r._asset.addEventListener(c.INVALIDATE, r._onInvalidateDelegate)), r ); } return ( e(n, t), Object.defineProperty(n, "ID_COUNT", { get: function () { return d.Next(); }, set: function (t) {}, enumerable: !0, configurable: !0, }), (n.prototype.onClear = function (t) { this._asset && (this._asset.removeEventListener(c.CLEAR, this._onClearDelegate), this._asset.removeEventListener( c.INVALIDATE, this._onInvalidateDelegate )), this._asset.clearAbstraction(this._pool), (this._pool = null), (this._asset = null); }), (n.prototype.onInvalidate = function (t) { this._invalid = !0; }), n ); })(f), J = (function () { function t(t, e, n, r) { (this._assets = t), this.filter(e, n, r); } return ( Object.defineProperty(t.prototype, "currentAsset", { get: function () { return this._idx < this._filtered.length ? this._filtered[this._idx] : null; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "numAssets", { get: function () { return this._filtered.length; }, enumerable: !0, configurable: !0, }), (t.prototype.next = function () { var t = null; return ( this._idx < this._filtered.length && (t = this._filtered[this._idx]), this._idx++, t ); }), (t.prototype.reset = function () { this._idx = 0; }), (t.prototype.setIndex = function (t) { this._idx = t; }), (t.prototype.filter = function (t, e, n) { if (t || e) { var r = void 0, i = void 0; (r = 0), (this._filtered = new Array()); for (var o = this._assets.length, a = 0; a < o; a++) (i = this._assets[a]), (t && i.adaptee.assetType != t) || (e && i.adaptee.assetNamespace != e) || ((null == n || n(i)) && (this._filtered[r++] = i)); } else this._filtered = this._assets; }), t ); })(), $ = (function () { function t() {} return (t.FAVOR_OLD = "favorOld"), (t.FAVOR_NEW = "favorNew"), t; })(), Z = (function () { function t() {} return ( (t.prototype.resolveConflict = function (t, e, n, r) { throw new u(); }), (t.prototype.create = function () { throw new u(); }), (t.prototype._pUpdateNames = function (t, e, n, r, i, o) { var a = o === $.FAVOR_NEW ? r : n, s = o === $.FAVOR_NEW ? n : r, u = s.adaptee.name; (i[a.adaptee.name] = a), (i[e] = s), s.adaptee.resetAssetPath(e, t, !1), s.adaptee.dispatchEvent( new c(c.ASSET_CONFLICT_RESOLVED, s.adaptee, u) ); }), t ); })(), tt = (function (t) { function n() { return t.call(this) || this; } return ( e(n, t), (n.prototype.resolveConflict = function (t, e, n, r) { throw new s( "Asset name collision while AssetLibrary.namingStrategy set to AssetLibrary.THROW_ERROR. Asset path: " + t.adaptee.assetFullPath ); }), (n.prototype.create = function () { return new n(); }), n ); })(Z), et = (function (t) { function n() { return t.call(this) || this; } return ( e(n, t), (n.prototype.resolveConflict = function (t, e, n, r) {}), (n.prototype.create = function () { return new n(); }), n ); })(Z), nt = (function (t) { function n(e) { void 0 === e && (e = "."); var n = t.call(this) || this; return (n._separator = e), (n._next_suffix = {}), n; } return ( e(n, t), (n.prototype.resolveConflict = function (t, e, n, r) { var i, o, a, s = t.adaptee.name; s.indexOf(this._separator) >= 0 ? ((o = s.substring(0, s.lastIndexOf(this._separator))), (a = parseInt(s.substring(o.length - 1))), isNaN(a) && ((o = s), (a = 0))) : ((o = s), (a = 0)), 0 == a && this._next_suffix.hasOwnProperty(o) && (a = this._next_suffix[o]); do { a++, (i = o.concat(this._separator, a.toString())); } while (n.hasOwnProperty(i)); (this._next_suffix[o] = a), this._pUpdateNames(e.adaptee.assetNamespace, i, e, t, n, r); }), (n.prototype.create = function () { return new n(this._separator); }), n ); })(Z), rt = (function () { function t(t) {} return ( (t.APPEND_NUM_SUFFIX = new nt()), (t.IGNORE = new et()), (t.THROW_ERROR = new tt()), t ); })(), it = (function () { function t() {} return ( (t.TEXT = "text"), (t.VARIABLES = "variables"), (t.BLOB = "blob"), (t.ARRAY_BUFFER = "arraybuffer"), (t.BINARY = "binary"), t ); })(), ot = (function () { function t() {} return (t.POST = "POST"), (t.GET = "GET"), t; })(), at = (function () { function t(t) { void 0 === t && (t = null), (this._variables = new Object()), null !== t && this.decode(t); } return ( (t.prototype.decode = function (t) { t = t.split("+").join(" "); for (var e, n = /[?&]?([^=]+)=([^&]*)/g; (e = n.exec(t)); ) this._variables[decodeURIComponent(e[1])] = decodeURIComponent( e[2] ); }), (t.prototype.toString = function () { return ""; }), Object.defineProperty(t.prototype, "variables", { get: function () { return this._variables; }, set: function (t) { this._variables = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "formData", { get: function () { var t = new FormData(); for (var e in this._variables) t.append(e, this._variables[e]); return t; }, enumerable: !0, configurable: !0, }), t ); })(), st = (function (t) { function n() { var e = t.call(this) || this; return ( (e._bytesLoaded = 0), (e._bytesTotal = 0), (e._dataFormat = it.TEXT), (e._loadError = !1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "url", { get: function () { return this._request ? this._request.url : ""; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "data", { get: function () { return this._data; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "dataFormat", { get: function () { return this._dataFormat; }, set: function (t) { this._dataFormat = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "bytesLoaded", { get: function () { return this._bytesLoaded; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "bytesTotal", { get: function () { return this._bytesTotal; }, enumerable: !0, configurable: !0, }), (n.prototype.load = function (t) { (this._request = t), this.initXHR(), t.method === ot.POST ? this.postRequest(t) : this.getRequest(t); }), (n.prototype.isSupported = function () { return null != window; }), (n.prototype.close = function () { this._XHR.abort(), this.disposeXHR(); }), (n.prototype.dispose = function () { this._XHR && this._XHR.abort(), this.disposeXHR(); }), (n.prototype.setResponseType = function (t, e) { switch (e) { case it.ARRAY_BUFFER: case it.BLOB: case it.TEXT: t.responseType = e; break; case it.VARIABLES: t.responseType = it.TEXT; break; case it.BINARY: t.responseType = ""; } }), (n.prototype.getRequest = function (t) { try { this._XHR.open(t.method, t.url, t.async), this.setResponseType(this._XHR, this._dataFormat), this._XHR.send(); } catch (t) { this.handleXmlHttpRequestException(t); } }), (n.prototype.postRequest = function (t) { if ( ((this._loadError = !1), this._XHR.open(t.method, t.url, t.async), null != t.data) ) if (t.data instanceof at) { var e = t.data; try { (this._XHR.responseType = "text"), this._XHR.send(e.formData); } catch (t) { this.handleXmlHttpRequestException(t); } } else this.setResponseType(this._XHR, this._dataFormat), t.data ? this._XHR.send(t.data) : this._XHR.send(); else this._XHR.send(); }), (n.prototype.handleXmlHttpRequestException = function (t) { t.code; }), (n.prototype.initXHR = function () { var t = this; this._XHR || ((this._XHR = new XMLHttpRequest()), (this._XHR.onloadstart = function (e) { return t.onLoadStart(e); }), (this._XHR.onprogress = function (e) { return t.onProgress(e); }), (this._XHR.onabort = function (e) { return t.onAbort(e); }), (this._XHR.onerror = function (e) { return t.onLoadError(e); }), (this._XHR.onload = function (e) { return t.onLoadComplete(e); }), (this._XHR.ontimeout = function (e) { return t.onTimeOut(e); }), (this._XHR.onloadend = function (e) { return t.onLoadEnd(e); }), (this._XHR.onreadystatechange = function (e) { return t.onReadyStateChange(e); })); }), (n.prototype.disposeXHR = function () { null !== this._XHR && ((this._XHR.onloadstart = null), (this._XHR.onprogress = null), (this._XHR.onabort = null), (this._XHR.onerror = null), (this._XHR.onload = null), (this._XHR.ontimeout = null), (this._XHR.onloadend = null), (this._XHR = null)); }), (n.prototype.decodeURLVariables = function (t) { var e = new Object(); t = t.split("+").join(" "); for (var n, r = /[?&]?([^=]+)=([^&]*)/g; (n = r.exec(t)); ) e[decodeURIComponent(n[1])] = decodeURIComponent(n[2]); return e; }), (n.prototype.onReadyStateChange = function (t) { 4 == this._XHR.readyState && ((this._status = this._XHR.status), 404 == this._status && ((this._loadError = !0), this.dispatchEvent( this._loadErrorEvent || (this._loadErrorEvent = new H(H.LOAD_ERROR, this)) )), this.dispatchEvent( this._statusEvent || (this._statusEvent = new H(H.HTTP_STATUS, this)) )); }), (n.prototype.onLoadEnd = function (t) { this._loadError; }), (n.prototype.onTimeOut = function (t) {}), (n.prototype.onAbort = function (t) {}), (n.prototype.onProgress = function (t) { (this._bytesTotal = t.total), (this._bytesLoaded = t.loaded), this.dispatchEvent( this._progressEvent || (this._progressEvent = new H(H.LOAD_PROGRESS, this)) ); }), (n.prototype.onLoadStart = function (t) { this.dispatchEvent( this._loadStartEvent || (this._loadStartEvent = new H(H.LOAD_START, this)) ); }), (n.prototype.onLoadComplete = function (t) { if (!0 !== this._loadError) { switch (this._dataFormat) { case it.TEXT: this._data = this._XHR.responseText; break; case it.VARIABLES: this._data = this.decodeURLVariables(this._XHR.responseText); break; case it.BLOB: case it.ARRAY_BUFFER: case it.BINARY: this._data = this._XHR.response; break; default: this._data = this._XHR.responseText; } this.dispatchEvent( this._loadCompleteEvent || (this._loadCompleteEvent = new H(H.LOAD_COMPLETE, this)) ); } }), (n.prototype.onLoadError = function (t) { (this._loadError = !0), this.dispatchEvent( this._loadErrorEvent || (this._loadErrorEvent = new H(H.LOAD_ERROR, this)) ); }), n ); })(h), ut = (function () { function t(t, e, n, r, i, o, a, s) { void 0 === o && (o = !1), void 0 === a && (a = !1), void 0 === s && (s = 0), (this._assets = []), (this._dependencies = []), (this._id = t), (this._sub_id = s), (this._request = e), (this._data = n), (this._parser = r), (this._parentParser = i), (this._retrieveAsRawData = o), (this._suppressAssetEvents = a); } return ( Object.defineProperty(t.prototype, "id", { get: function () { return this._id; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "sub_id", { get: function () { return this._sub_id; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "request", { get: function () { return this._request; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "data", { get: function () { return this._data; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "parser", { get: function () { return this._parser; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "parentParser", { get: function () { return this._parentParser; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "retrieveAsRawData", { get: function () { return this._retrieveAsRawData; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "suppresAssetEvents", { get: function () { return this._suppressAssetEvents; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "assets", { get: function () { return this._assets; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "dependencies", { get: function () { return this._dependencies; }, enumerable: !0, configurable: !0, }), (t.prototype.setData = function (t) { this._data = t; }), (t.prototype.setParser = function (t) { this._parser = t; }), (t.prototype.resolve = function () { this._parentParser && this._parentParser._iResolveDependency(this); }), (t.prototype.resolveFailure = function () { this._parentParser && this._parentParser._iResolveDependencyFailure(this); }), (t.prototype.resolveName = function (t) { return this._parentParser ? this._parentParser._iResolveDependencyName(this, t) : t.name; }), t ); })(), lt = (function () { function t(e, n) { void 0 === e && (e = !0), void 0 === n && (n = null), (this._includeDependencies = e), (this._dependencyBaseUrl = n || ""), (this._embeddedDataByUrl = {}), (this._remappedUrls = {}), (this._materialMode = t.UNDEFINED), (this._externalAssetMode = t.PRELOADED); } return ( Object.defineProperty(t.prototype, "includeDependencies", { get: function () { return this._includeDependencies; }, set: function (t) { this._includeDependencies = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "materialMode", { get: function () { return this._materialMode; }, set: function (t) { this._materialMode = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "externalAssetMode", { get: function () { return this._externalAssetMode; }, set: function (t) { this._externalAssetMode = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "dependencyBaseUrl", { get: function () { return this._dependencyBaseUrl; }, set: function (t) { this._dependencyBaseUrl = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "overrideAbsolutePaths", { get: function () { return this._overrideAbsPath; }, set: function (t) { this._overrideAbsPath = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "overrideFullURLs", { get: function () { return this._overrideFullUrls; }, set: function (t) { this._overrideFullUrls = t; }, enumerable: !0, configurable: !0, }), (t.prototype.mapUrl = function (t, e) { this._remappedUrls[t] = e; }), (t.prototype.mapUrlToData = function (t, e) { this._embeddedDataByUrl[t] = e; }), (t.prototype._iHasDataForUrl = function (t) { return this._embeddedDataByUrl.hasOwnProperty(t); }), (t.prototype._iGetDataForUrl = function (t) { return this._embeddedDataByUrl[t]; }), (t.prototype._iHasMappingForUrl = function (t) { return this._remappedUrls.hasOwnProperty(t); }), (t.prototype._iGetRemappedUrl = function (t) { return this._remappedUrls[t]; }), (t.UNDEFINED = 0), (t.SINGLEPASS_MATERIALS = 1), (t.MULTIPASS_MATERIALS = 2), (t.ON_DEMAND = "onDemand"), (t.PRELOADED = "preloaded"), t ); })(), ct = (function (t) { function n(e) { void 0 === e && (e = 0); var n = t.call(this) || this; return ( (n._materialMode = e), (n._stack = new Array()), (n._onReadyForDependenciesDelegate = function (t) { return n._onReadyForDependencies(t); }), (n._onParseCompleteDelegate = function (t) { return n._onParseComplete(t); }), (n._onParseErrorDelegate = function (t) { return n._onParseError(t); }), (n._onLoadProgressDelegate = function (t) { return n._onLoadProgress(t); }), (n._onLoadCompleteDelegate = function (t) { return n._onLoadComplete(t); }), (n._onLoadErrorDelegate = function (t) { return n._onLoadError(t); }), (n._onTextureSizeErrorDelegate = function (t) { return n._onTextureSizeError(t); }), (n._onAssetCompleteDelegate = function (t) { return n._onAssetComplete(t); }), n ); } return ( e(n, t), (n.enableParser = function (t) { n._parsers.indexOf(t) < 0 && n._parsers.push(t); }), (n.enableParsers = function (t) { for (var e = 0; e < t.length; e++) n.enableParser(t[e]); }), Object.defineProperty(n.prototype, "baseDependency", { get: function () { return this._baseDependency; }, enumerable: !0, configurable: !0, }), (n.prototype.load = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), (this._uri = t.url = t.url.replace(/\\/g, "/")), (this._context = e), (this._namespace = n), this.dispatchEvent(new V(V.LOADER_START, this._uri, null, null)), (this._baseDependency = new ut("", t, null, r, null)), this._retrieveDependency(this._baseDependency); }), (n.prototype.loadData = function (t, e, n, r, i) { void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = null), (this._uri = r), (this._context = n), (this._namespace = r), this.dispatchEvent(new V(V.LOADER_START, this._uri, null, null)), (this._baseDependency = new ut(e, null, t, i, null)), this._retrieveDependency(this._baseDependency); }), (n.prototype._retrieveNext = function (t) { if ( (void 0 === t && (t = null), this._currentDependency.dependencies.length) ) { var e = this._currentDependency.dependencies.pop(); this._stack.push(this._currentDependency), this._retrieveDependency(e); } else if ( this._currentDependency.parser && this._currentDependency.parser.parsingPaused ) this._currentDependency.parser._iResumeParsing(); else if (this._stack && this._stack.length) { var n = this._currentDependency; (this._currentDependency = this._stack.pop()), n.success && n.resolve(), this._retrieveNext(t); } else this.dispatchEvent( new V( V.LOADER_COMPLETE, this._uri, this._baseDependency.parser.content, this._baseDependency.assets ) ); }), (n.prototype._retrieveDependency = function (t) { var e; this._context && 0 != this._context.materialMode && (this._materialMode = this._context.materialMode), (this._currentDependency = t), (e = t.data), this._context && t.request && (this._context._iHasDataForUrl(t.request.url) ? (e = this._context._iGetDataForUrl(t.request.url)) : this._context.externalAssetMode != lt.ON_DEMAND || ("jpg" != this.getSuffix(t.request.url) && "png" != this.getSuffix(t.request.url)) || ((e = t.request), t.parser || t.setParser(this.getParserFromSuffix(t.request.url)))), e ? (e.constructor === Function && (e = new e()), t.setData(e), t.retrieveAsRawData ? (t.resolve(), this._retrieveNext()) : this._parseDependency(t)) : ((t.loader = new st()), this._addEventListeners(t.loader), (t.request.url = this._resolveDependencyUrl(t)), t.retrieveAsRawData ? (t.loader.dataFormat = it.BINARY) : (t.parser || t.setParser(this.getParserFromSuffix(t.request.url)), t.parser ? (t.loader.dataFormat = t.parser.dataFormat) : (t.loader.dataFormat = it.BINARY)), t.loader.load(t.request)); }), (n.prototype._joinUrl = function (t, e) { return ( ("/" != e.charAt(0) && "\\" != e.charAt(0)) || (e = e.substr(1)), "." == e.charAt(0) && (e = e.substr(2)), 0 == t.length ? e : (("/" != t.charAt(t.length - 1) && "\\" != t.charAt(t.length - 1)) || (t = t.substr(0, t.length - 1)), t.concat("/", e)) ); }), (n.prototype._resolveDependencyUrl = function (t) { var e = t.request.url; if (this._context && this._context._iHasMappingForUrl(e)) return this._context._iGetRemappedUrl(e); if (e == this._uri) return e; var n, r = new RegExp("/^[a-zA-Z]{3,4}:///"); if ("/" == e.charAt(0)) return this._context && this._context.overrideAbsolutePaths ? this._joinUrl(this._context.dependencyBaseUrl, e) : e; if (r.test(e) && this._context && this._context.overrideFullURLs) { var i = e.replace(r, ""); return this._joinUrl(this._context.dependencyBaseUrl, i); } return this._context && this._context.dependencyBaseUrl ? ((n = this._context.dependencyBaseUrl), this._joinUrl(n, e)) : ((n = this._uri.substring(0, this._uri.lastIndexOf("/") + 1)), this._joinUrl(n, e)); }), (n.prototype._retrieveParserDependencies = function () { if (this._currentDependency) { for ( var t = this._currentDependency.parser.dependencies, e = t.length, n = 0; n < e; n++ ) this._currentDependency.dependencies[n] = t[n]; (t.length = 0), this._stack.push(this._currentDependency), this._retrieveNext(); } }), (n.prototype._resolveParserDependencies = function () { (this._currentDependency.success = !0), this._currentDependency.parser && this._currentDependency.parser.dependencies.length && (!this._context || this._context.includeDependencies) ? this._retrieveParserDependencies() : this._retrieveNext(); }), (n.prototype._onLoadError = function (t) { if (!this.hasEventListener(H.LOAD_ERROR)) throw new Error(); this.dispatchEvent(t), this._currentDependency != this._baseDependency ? (this._currentDependency.resolveFailure(), this._retrieveNext()) : this.dispose(); }), (n.prototype._onParseError = function (t) { if (!this.hasEventListener(Q.PARSE_ERROR)) throw new Error(t.message); this.dispatchEvent(t), this._retrieveNext(); }), (n.prototype._onAssetComplete = function (t) { this._currentDependency && this._currentDependency.assets.push(t.asset), t.asset.resetAssetPath(t.asset.name, this._namespace), this._currentDependency.suppresAssetEvents || this.dispatchEvent(t); }), (n.prototype._onReadyForDependencies = function (t) { this._context && !this._context.includeDependencies ? t.target._iResumeParsing() : this._retrieveParserDependencies(); }), (n.prototype._onLoadProgress = function (t) { this.dispatchEvent(t); }), (n.prototype._onLoadComplete = function (t) { var e = t.urlLoader; this.dispatchEvent(t), this._removeEventListeners(e), this._currentDependency.setData(e.data), this._currentDependency.retrieveAsRawData ? this._resolveParserDependencies() : this._parseDependency(this._currentDependency); }), (n.prototype._onParseComplete = function (t) { var e = t.target; e.removeEventListener( Q.READY_FOR_DEPENDENCIES, this._onReadyForDependenciesDelegate ), e.removeEventListener( Q.PARSE_COMPLETE, this._onParseCompleteDelegate ), e.removeEventListener(Q.PARSE_ERROR, this._onParseErrorDelegate), e.removeEventListener( c.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate ), e.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), this._resolveParserDependencies(); }), (n.prototype._onTextureSizeError = function (t) { (t.asset.name = this._currentDependency.resolveName(t.asset)), this.dispatchEvent(t); }), (n.prototype._addEventListeners = function (t) { t.addEventListener(H.LOAD_PROGRESS, this._onLoadProgressDelegate), t.addEventListener(H.LOAD_COMPLETE, this._onLoadCompleteDelegate), t.addEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate); }), (n.prototype._removeEventListeners = function (t) { t.removeEventListener(H.LOAD_PROGRESS, this._onLoadProgressDelegate), t.removeEventListener( H.LOAD_COMPLETE, this._onLoadCompleteDelegate ), t.removeEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate); }), (n.prototype.stop = function () { this.dispose(); }), (n.prototype.dispose = function () { (this._context = null), (this._stack = null), this._currentDependency && this._currentDependency.loader && this._removeEventListeners(this._currentDependency.loader), (this._currentDependency = null); }), (n.prototype._getParserFromData = function (t) { for (var e = n._parsers.length - 1; e >= 0; e--) if (n._parsers[e].supportsData(t)) return new n._parsers[e](); return null; }), (n.prototype._parseDependency = function (t) { var e = t.parser; if ((e || t.setParser((e = this._getParserFromData(t.data))), e)) e.addEventListener( Q.READY_FOR_DEPENDENCIES, this._onReadyForDependenciesDelegate ), e.addEventListener( Q.PARSE_COMPLETE, this._onParseCompleteDelegate ), e.addEventListener(Q.PARSE_ERROR, this._onParseErrorDelegate), e.addEventListener( c.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate ), e.addEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), t.request && t.request.url && (e._iFileName = t.request.url), (e.materialMode = this._materialMode), e.parseAsync(t.data); else { var n = "No parser defined. To enable all parsers for auto-detection, use Parsers.enableAllBundled()"; if (!this.hasEventListener(Q.PARSE_ERROR)) throw new Error(n); this.dispatchEvent(new Q(Q.PARSE_ERROR, n)), this._retrieveNext(); } }), (n.prototype.getParserFromSuffix = function (t) { for ( var e = this.getSuffix(t), r = n._parsers.length - 1; r >= 0; r-- ) { var i = n._parsers[r]; if (i.supportsType(e)) return new i(); } return null; }), (n.prototype.getSuffix = function (t) { var e = t.indexOf("?") > 0 ? t.split("?")[0] : t; return e.substr(e.lastIndexOf(".") + 1).toLowerCase(); }), (n._parsers = new Array()), n ); })(h), ht = (function (t) { function n() { var e, n = t.call(this) || this; return ( (n._loaderSessionsGarbage = new Array()), (n._assets = new Array()), (n._assetDictionary = new Object()), (n._loaderSessions = new Array()), (n.conflictStrategy = rt.IGNORE.create()), (n.conflictPrecedence = $.FAVOR_NEW), (n._onAssetRenameDelegate = function (t) { return n._onAssetRename(t); }), (n._onAssetConflictResolvedDelegate = function (t) { return n._onAssetConflictResolved(t); }), (n._onLoaderStartDelegate = function (t) { return n._onLoaderStart(t); }), (n._onLoaderCompleteDelegate = function (t) { return n._onLoaderComplete(t); }), (n._onTextureSizeErrorDelegate = function (t) { return n._onTextureSizeError(t); }), (n._onAssetCompleteDelegate = function (t) { return n._onAssetComplete(t); }), (n._onLoadErrorDelegate = function (t) { return n._onLoadError(t); }), (n._onParseErrorDelegate = function (t) { return n._onParseError(t); }), (n._errorDelegateSelector = (((e = {})[H.LOAD_ERROR] = n._onLoadErrorDelegate), (e[Q.PARSE_ERROR] = n._onParseErrorDelegate), e)), n ); } return ( e(n, t), (n.prototype.addEventListener = function (e, n) { if (e == H.LOAD_ERROR || e == Q.PARSE_ERROR) for (var r = void 0; r < this._loaderSessions.length; r++) this._loaderSessions[r].addEventListener( e, this._errorDelegateSelector[e] ); t.prototype.addEventListener.call(this, e, n); }), (n.prototype.removeEventListener = function (e, n) { if (e == H.LOAD_ERROR || e == Q.PARSE_ERROR) for (var r = void 0; r < this._loaderSessions.length; r++) this._loaderSessions[r].removeEventListener( e, this._errorDelegateSelector[e] ); t.prototype.removeEventListener.call(this, e, n); }), (n.getInstance = function (t) { return ( void 0 === t && (t = "default"), t || (t = "default"), n._iInstances.hasOwnProperty(t) || (n._iInstances[t] = new n()), n._iInstances[t] ); }), (n.prototype.enableParser = function (t) { ct.enableParser(t); }), (n.prototype.enableParsers = function (t) { ct.enableParsers(t); }), Object.defineProperty(n.prototype, "conflictStrategy", { get: function () { return this._strategy; }, set: function (t) { if (!t) throw new s( "namingStrategy must not be null. To ignore naming, use AssetLibrary.IGNORE" ); this._strategy = t.create(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "conflictPrecedence", { get: function () { return this._strategyPreference; }, set: function (t) { this._strategyPreference = t; }, enumerable: !0, configurable: !0, }), (n.prototype.createIterator = function (t, e, n) { return ( void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = null), new J(this._assets, t, e, n) ); }), (n.prototype.load = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), this.getLoader().load(t, e, n, r); }), (n.prototype.loadData = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), this.getLoader().loadData(t, "", e, n, r); }), (n.prototype.getLoader = function () { var t = new ct(); return ( this._loaderSessions.push(t), t.addEventListener(V.LOADER_START, this._onLoaderStartDelegate), t.addEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), t.addEventListener( c.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate ), t.addEventListener(c.ASSET_COMPLETE, this._onAssetCompleteDelegate), this.hasEventListener(H.LOAD_ERROR) && t.addEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), this.hasEventListener(Q.PARSE_ERROR) && t.addEventListener(Q.PARSE_ERROR, this._onParseErrorDelegate), t ); }), (n.prototype.stopLoader = function (t) { var e = this._loaderSessions.indexOf(t); if (-1 == e) throw new Error("loader is not an active session"); this._loaderSessions.splice(e, 1), this._killLoaderSession(t); }), (n.prototype.getAsset = function (t, e) { return ( void 0 === e && (e = null), this._assetDictDirty && this.rehashAssetDict(), null == e && (e = f.DEFAULT_NAMESPACE), this._assetDictionary.hasOwnProperty(e) ? this._assetDictionary[e][t.toString().toLowerCase()] : null ); }), (n.prototype.getAllAssets = function () { return this._assets; }), (n.prototype.addAsset = function (t) { if (!(this._assets.indexOf(t) >= 0)) { var e = this.getAsset(t.adaptee.name, t.adaptee.assetNamespace), n = t.adaptee.assetNamespace || f.DEFAULT_NAMESPACE; null != e && this._strategy.resolveConflict( t, e, this._assetDictionary[n], this._strategyPreference ), this._assets.push(t), this._assetDictionary.hasOwnProperty(n) || (this._assetDictionary[n] = new Object()), (this._assetDictionary[n][ t.adaptee.name.toString().toLowerCase() ] = t), t.adaptee.addEventListener(c.RENAME, this._onAssetRenameDelegate), t.adaptee.addEventListener( c.ASSET_CONFLICT_RESOLVED, this._onAssetConflictResolvedDelegate ); } }), (n.prototype.removeAsset = function (t, e) { void 0 === e && (e = !0), this.removeAssetFromDict(t), t.adaptee.removeEventListener( c.RENAME, this._onAssetRenameDelegate ), t.adaptee.removeEventListener( c.ASSET_CONFLICT_RESOLVED, this._onAssetConflictResolvedDelegate ); var n = this._assets.indexOf(t); n >= 0 && this._assets.splice(n, 1), e && t.dispose(); }), (n.prototype.removeAssetByName = function (t, e, n) { void 0 === e && (e = null), void 0 === n && (n = !0); var r = this.getAsset(t, e); return r && this.removeAsset(r, n), r; }), (n.prototype.removeAllAssets = function (t) { if ((void 0 === t && (t = !0), t)) for (var e = this._assets.length, n = 0; n < e; n++) this._assets[n].dispose(); (this._assets.length = 0), this.rehashAssetDict(); }), (n.prototype.removeNamespaceAssets = function (t, e) { void 0 === t && (t = null), void 0 === e && (e = !0); var n, r = 0, i = this._assets.concat(); (this._assets.length = 0), null == t && (t = f.DEFAULT_NAMESPACE); for (var o = i.length, a = 0; a < o; a++) (n = i[a]).adaptee.assetNamespace == t ? (e && n.dispose(), this.removeAssetFromDict(n, !1)) : (this._assets[r++] = n); this._assetDictionary.hasOwnProperty(t) && delete this._assetDictionary[t]; }), (n.prototype.removeAssetFromDict = function (t, e) { void 0 === e && (e = !0), this._assetDictDirty && this.rehashAssetDict(); var n = t.adaptee.assetNamespace; this._assetDictionary.hasOwnProperty(n) && (this._assetDictionary[n].hasOwnProperty( t.adaptee.name.toString().toLowerCase() ) && delete this._assetDictionary[n][ t.adaptee.name.toString().toLowerCase() ], e && !Object.keys(this._assetDictionary[n]).length && delete this._assetDictionary[n]); }), (n.prototype.stop = function () { for (var t = this._loaderSessions.length, e = 0; e < t; e++) this._killLoaderSession(this._loaderSessions[e]); this._loaderSessions = new Array(); }), (n.prototype.rehashAssetDict = function () { var t, e; this._assetDictionary = {}; for (var n = this._assets.length, r = 0; r < n; r++) (e = (t = this._assets[r]).adaptee.assetNamespace), this._assetDictionary.hasOwnProperty(e) || (this._assetDictionary[e] = {}), (this._assetDictionary[e][ t.adaptee.name.toString().toLowerCase() ] = t); this._assetDictDirty = !1; }), (n.prototype._onLoadError = function (t) { this.dispatchEvent(t); }), (n.prototype._onParseError = function (t) { this.dispatchEvent(t); }), (n.prototype._onAssetComplete = function (t) { this.addAsset(t.asset.adapter), this.dispatchEvent(t); }), (n.prototype._onTextureSizeError = function (t) { this.dispatchEvent(t); }), (n.prototype._onLoaderStart = function (t) { this.dispatchEvent(t); }), (n.prototype._onLoaderComplete = function (t) { this.stopLoader(t.target), this.dispatchEvent(t); }), (n.prototype._killLoaderSession = function (t) { t.removeEventListener(V.LOADER_START, this._onLoaderStartDelegate), t.removeEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), t.removeEventListener( c.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate ), t.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), this.hasEventListener(H.LOAD_ERROR) && t.removeEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), this.hasEventListener(Q.PARSE_ERROR) && t.removeEventListener(Q.PARSE_ERROR, this._onParseErrorDelegate), t.stop(); }), (n.prototype._onAssetRename = function (t) { var e = t.target.adapter, n = this.getAsset(e.adaptee.assetNamespace, e.adaptee.name); if (null != n) this._strategy.resolveConflict( e, n, this._assetDictionary[e.adaptee.assetNamespace], this._strategyPreference ); else { var r = this._assetDictionary[t.asset.assetNamespace]; if (null == r) return; (r[t.prevName] = null), (r[t.asset.name.toString().toLowerCase()] = t.asset); } }), (n.prototype._onAssetConflictResolved = function (t) { this.dispatchEvent(t.clone()); }), (n._iInstances = new Object()), n ); })(h), pt = (function () { function t() {} return ( (t.getBundle = function (t) { return void 0 === t && (t = "default"), ht.getInstance(t); }), (t.enableParser = function (t) { ct.enableParser(t); }), (t.enableParsers = function (t) { ct.enableParsers(t); }), Object.defineProperty(t, "conflictStrategy", { get: function () { return t.getBundle().conflictStrategy; }, set: function (e) { t.getBundle().conflictStrategy = e; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t, "conflictPrecedence", { get: function () { return t.getBundle().conflictPrecedence; }, set: function (e) { t.getBundle().conflictPrecedence = e; }, enumerable: !0, configurable: !0, }), (t.createIterator = function (e, n, r) { return ( void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), t.getBundle().createIterator(e, n, r) ); }), (t.load = function (e, n, r, i) { void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = null), t.getBundle().load(e, n, r, i); }), (t.loadData = function (e, n, r, i) { void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = null), t.getBundle().loadData(e, n, r, i); }), (t.stop = function () { t.getBundle().stop(); }), (t.getLoader = function () { return t.getBundle().getLoader(); }), (t.getAsset = function (e, n) { return void 0 === n && (n = null), t.getBundle().getAsset(e, n); }), (t.getAllAssets = function () { return t.getBundle().getAllAssets(); }), (t.addEventListener = function (e, n) { t.getBundle().addEventListener(e, n); }), (t.removeEventListener = function (e, n) { t.getBundle().removeEventListener(e, n); }), (t.addAsset = function (e) { t.getBundle().addAsset(e); }), (t.removeAsset = function (e, n) { void 0 === n && (n = !0), t.getBundle().removeAsset(e, n); }), (t.removeAssetByName = function (e, n, r) { return ( void 0 === n && (n = null), void 0 === r && (r = !0), t.getBundle().removeAssetByName(e, n, r) ); }), (t.removeAllAssets = function (e) { void 0 === e && (e = !0), t.getBundle().removeAllAssets(e); }), (t.removeNamespaceAssets = function (e, n) { void 0 === e && (e = null), void 0 === n && (n = !0), t.getBundle().removeNamespaceAssets(e, n); }), t ); })(), dt = (function () { function t(t) { void 0 === t && (t = null), (this.method = ot.GET), (this.async = !0), (this._url = t); } return ( Object.defineProperty(t.prototype, "url", { get: function () { return this._url; }, set: function (t) { this._url = t; }, enumerable: !0, configurable: !0, }), (t.prototype.dispose = function () { (this.data = null), (this._url = null); }), t ); })(), ft = (function (t) { function n(e, n) { void 0 === n && (n = 0); var r = t.call(this) || this; if ( ((r._repeatCount = 0), (r._currentCount = 0), (r._running = !1), (r._delay = e), (r._repeatCount = n), isNaN(e) || e < 0) ) throw new s("Delay is negative or not a number"); return r; } return ( e(n, t), Object.defineProperty(n.prototype, "currentCount", { get: function () { return this._currentCount; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "delay", { get: function () { return this._delay; }, set: function (t) { (this._delay = t), this._running && (this.stop(), this.start()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "repeatCount", { get: function () { return this._repeatCount; }, set: function (t) { this._repeatCount = t; }, enumerable: !0, configurable: !0, }), (n.prototype.reset = function () { this._running && this.stop(), (this._currentCount = 0); }), Object.defineProperty(n.prototype, "running", { get: function () { return this._running; }, enumerable: !0, configurable: !0, }), (n.prototype.start = function () { var t = this; (this._running = !0), clearInterval(this._iid), (this._iid = setInterval(function () { return t.tick(); }, this._delay)); }), (n.prototype.stop = function () { (this._running = !1), clearInterval(this._iid); }), (n.prototype.tick = function () { this._currentCount++, this._repeatCount > 0 && this._currentCount >= this._repeatCount ? (this.stop(), this.dispatchEvent(new z(z.TIMER)), this.dispatchEvent(new z(z.TIMER_COMPLETE))) : this.dispatchEvent(new z(z.TIMER)); }), n ); })(h); function gt() { return Date.now(); } var _t, mt = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n._materialMode = 0), (n._dataFormat = e), (n._dependencies = new Array()), (n._pOnIntervalDelegate = function (t) { return n._pOnInterval(t); }), n ); } return ( e(n, t), (n.supportsType = function (t) { throw new u(); }), Object.defineProperty(n.prototype, "content", { get: function () { return this._pContent; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "parsingFailure", { get: function () { return this._parsingFailure; }, set: function (t) { this._parsingFailure = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "parsingPaused", { get: function () { return this._parsingPaused; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "parsingComplete", { get: function () { return this._parsingComplete; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "materialMode", { get: function () { return this._materialMode; }, set: function (t) { this._materialMode = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "data", { get: function () { return this._data; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "dataFormat", { get: function () { return this._dataFormat; }, enumerable: !0, configurable: !0, }), (n.prototype.parseAsync = function (t, e) { void 0 === e && (e = 30), (this._data = t), this._pStartParsing(e); }), (n.prototype.parseSync = function (t) { this._data = t; for (var e = n.MORE_TO_PARSE; e == n.MORE_TO_PARSE; ) e = this._pProceedParsing(); return this._pContent; }), Object.defineProperty(n.prototype, "dependencies", { get: function () { return this._dependencies; }, enumerable: !0, configurable: !0, }), (n.prototype._iResolveDependency = function (t) { throw new u(); }), (n.prototype._iResolveDependencyFailure = function (t) { throw new u(); }), (n.prototype._iResolveDependencyName = function (t, e) { return e.name; }), (n.prototype._iResumeParsing = function () { (this._parsingPaused = !1), this._timer && this._timer.start(), this._isParsing || this._pOnInterval(); }), (n.prototype._pFinalizeAsset = function (t, e) { void 0 === e && (e = null), (t.name = e || t.name || t.assetType), this.dispatchEvent(new c(c.ASSET_COMPLETE, t)); }), (n.prototype._pProceedParsing = function () { throw new u(); }), (n.prototype._pDieWithError = function (t) { void 0 === t && (t = "Unknown parsing error"), this._timer && (this._timer.removeEventListener( z.TIMER, this._pOnIntervalDelegate ), this._timer.stop(), (this._timer = null)), this.dispatchEvent(new Q(Q.PARSE_ERROR, t)); }), (n.prototype._pAddDependency = function (t, e, n, r, i, o, a) { void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = !1), void 0 === o && (o = !1), void 0 === a && (a = 0); var s = new ut(t, e, r, n, this, i, o, a); return this._dependencies.push(s), s; }), (n.prototype._pPauseAndRetrieveDependencies = function () { this._pPauseParsing(), this.dispatchEvent(new Q(Q.READY_FOR_DEPENDENCIES)); }), (n.prototype._pPauseParsing = function () { this._timer && this._timer.stop(), (this._parsingPaused = !0); }), (n.prototype._pHasTime = function () { return gt() - this._lastFrameTime < this._frameLimit; }), (n.prototype._pOnInterval = function (t) { (this._lastFrameTime = gt()), (this._isParsing = !0), this._pProceedParsing() && !this._parsingFailure && this._pFinishParsing(), (this._isParsing = !1); }), (n.prototype._pStartParsing = function (t) { (this._frameLimit = t), (this._timer = new ft(this._frameLimit, 0)), this._timer.addEventListener(z.TIMER, this._pOnIntervalDelegate), this._timer.start(), this._pOnInterval(); }), (n.prototype._pFinishParsing = function () { this._timer && (this._timer.removeEventListener( z.TIMER, this._pOnIntervalDelegate ), this._timer.stop()), (this._timer = null), (this._parsingComplete = !0), (this._isParsing = !1), this.dispatchEvent(new Q(Q.PARSE_COMPLETE)); }), (n.prototype._pGetTextData = function () { return b.toString(this._data); }), (n.prototype._pGetByteData = function () { return b.toByteArray(this._data); }), (n.prototype._pGetData = function () { return this._data; }), (n.PARSING_DONE = !0), (n.MORE_TO_PARSE = !1), n ); })(h), yt = (function (t) { function n() { return t.call(this, it.BLOB) || this; } return ( e(n, t), (n.supportsType = function (t) { return "wav" == (t = t.toLowerCase()) || "mp3" == t || "ogg" == t; }), (n.supportsData = function (t) { if (!(t instanceof v)) return !1; var e = t; return !!n.parseFileType(e); }), (n.prototype._pStartParsing = function (e) { delete this._pContent, (this._pContent = null), t.prototype._pStartParsing.call(this, e); }), (n.prototype._pProceedParsing = function () { return ( (this._pContent = new E(new x(this.data))), this._pFinalizeAsset(this._pContent, this._iFileName), mt.PARSING_DONE ); }), (n.parseFileType = function (t) { if (((t.position = 0), 65504 == (65504 & t.readUnsignedShort()))) return "mp3"; t.position = 0; var e = t.readUnsignedByte(), n = t.readUnsignedByte(), r = t.readUnsignedByte(); return (73 === e && 68 === n && 51 === r) || (255 === e && 251 === n) || (255 === e && 243 === n && 130 === r) ? "mp3" : ((t.position = 0), "RIFF" == t.readUTFBytes(4) ? "wav" : ((t.position = 0), "OggS" == t.readUTFBytes(4) ? "ogg" : ((t.position = 0), null))); }), (n.processFilename = function (t) { return t; }), n ); })(mt); !(function (t) { (t[(t.LEFT_HANDED = 0)] = "LEFT_HANDED"), (t[(t.RIGHT_HANDED = 1)] = "RIGHT_HANDED"); })(_t || (_t = {})); var At = (function (t) { function n(e) { void 0 === e && (e = _t.LEFT_HANDED); var n = t.call(this) || this; return ( (n._viewMatrix3D = new F()), (n._inverseViewMatrix3D = new F()), (n._frustumMatrix3D = new F()), (n._near = 20), (n._far = 3e3), (n._scale = 1), (n._ratio = 1), (n._originX = 0), (n._originY = 0), (n._frustumRect = new K()), (n._viewFrustumCorners = []), (n._viewMatrix3DDirty = !0), (n._inverseViewMatrix3DDirty = !0), (n._frustumMatrix3DDirty = !0), (n._viewFrustumCornersDirty = !0), (n._viewFrustumPlanesDirty = !0), (n._coordinateSystem = e), (n._onInvalidateConcatenatedMatrix3DDelegate = function (t) { return n._onInvalidateConcatenatedMatrix3D(t); }), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "transform", { get: function () { return ( this._transform || (this.transform = new k()), this._transform ); }, set: function (t) { this._transform != t && (this._transform && this._transform.removeEventListener( D.INVALIDATE_MATRIX3D, this._onInvalidateConcatenatedMatrix3DDelegate ), (this._transform = t), this._transform && this._transform.addEventListener( D.INVALIDATE_MATRIX3D, this._onInvalidateConcatenatedMatrix3DDelegate ), this._invalidateViewMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "coordinateSystem", { get: function () { return this._coordinateSystem; }, set: function (t) { this._coordinateSystem != t && ((this._coordinateSystem = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scale", { get: function () { return ( this._propertiesDirty && this._updateProperties(), this._scale ); }, set: function (t) { this._scale != t && ((this._scale = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "ratio", { get: function () { return ( this._propertiesDirty && this._updateProperties(), this._ratio ); }, set: function (t) { this._ratio != t && ((this._ratio = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "frustumMatrix3D", { get: function () { return ( this._frustumMatrix3DDirty && this._updateFrustumMatrix3D(), this._frustumMatrix3D ); }, set: function (t) { (this._frustumMatrix3D = t), this._invalidateViewMatrix3D(), this._invalidateProperties(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "viewFrustumCorners", { get: function () { if (this._viewFrustumCornersDirty) { (this._viewFrustumCornersDirty = !1), this._frustumMatrix3DDirty && this._updateFrustumMatrix3D(); var t = this._frustumRect.left, e = this._frustumRect.right, n = this._frustumRect.top, r = this._frustumRect.bottom; this._propertiesDirty && this._updateProperties(); var i = this._near, o = this._far, a = this._viewFrustumCorners; (a[0] = a[9] = i * t), (a[3] = a[6] = i * e), (a[1] = a[4] = i * n), (a[7] = a[10] = i * r), (a[12] = a[21] = o * t), (a[15] = a[18] = o * e), (a[13] = a[16] = o * n), (a[19] = a[22] = o * r), (a[2] = a[5] = a[8] = a[11] = i), (a[14] = a[17] = a[20] = a[23] = o), this._transform && this._transform.matrix3D.transformVectors(a, a); } return this._viewFrustumCorners; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "viewFrustumPlanes", { get: function () { if (this._viewFrustumPlanesDirty) { if ( ((this._viewFrustumPlanesDirty = !1), !this._viewFrustumPlanes) ) { this._viewFrustumPlanes = []; for (var t = 0; t < 6; ++t) this._viewFrustumPlanes[t] = new Y(); } var e = this.viewMatrix3D._rawData, n = void 0, r = e[0], i = e[4], o = e[8], a = e[12], s = e[1], u = e[5], l = e[9], c = e[13], h = e[2], p = e[6], d = e[10], f = e[14], g = e[3], _ = e[7], m = e[11], y = e[15], A = void 0, v = void 0, b = void 0, C = void 0; (C = this._viewFrustumPlanes[0]), (A = g + r), (v = _ + i), (b = m + o), (n = 1 / Math.sqrt(A * A + v * v + b * b)), (C.a = A * n), (C.b = v * n), (C.c = b * n), (C.d = -(y + a) * n), (C = this._viewFrustumPlanes[1]), (A = g - r), (v = _ - i), (b = m - o), (n = 1 / Math.sqrt(A * A + v * v + b * b)), (C.a = A * n), (C.b = v * n), (C.c = b * n), (C.d = (a - y) * n), (C = this._viewFrustumPlanes[2]), (A = g + s), (v = _ + u), (b = m + l), (n = 1 / Math.sqrt(A * A + v * v + b * b)), (C.a = A * n), (C.b = v * n), (C.c = b * n), (C.d = -(y + c) * n), (C = this._viewFrustumPlanes[3]), (A = g - s), (v = _ - u), (b = m - l), (n = 1 / Math.sqrt(A * A + v * v + b * b)), (C.a = A * n), (C.b = v * n), (C.c = b * n), (C.d = (c - y) * n), (C = this._viewFrustumPlanes[4]), (A = h), (v = p), (b = d), (n = 1 / Math.sqrt(A * A + v * v + b * b)), (C.a = A * n), (C.b = v * n), (C.c = b * n), (C.d = -f * n), (C = this._viewFrustumPlanes[5]), (A = g - h), (v = _ - p), (b = m - d), (n = 1 / Math.sqrt(A * A + v * v + b * b)), (C.a = A * n), (C.b = v * n), (C.c = b * n), (C.d = (f - y) * n); } return this._viewFrustumPlanes; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "near", { get: function () { return ( this._propertiesDirty && this._updateProperties(), this._near ); }, set: function (t) { t != this._near && ((this._near = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "originX", { get: function () { return ( this._propertiesDirty && this._updateProperties(), this._originX ); }, set: function (t) { this._originX != t && ((this._originX = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "originY", { get: function () { return ( this._propertiesDirty && this._updateProperties(), this._originY ); }, set: function (t) { this._originY != t && ((this._originY = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "far", { get: function () { return this._propertiesDirty && this._updateProperties(), this._far; }, set: function (t) { t != this._far && ((this._far = t), this._invalidateFrustumMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "frustumRect", { get: function () { return ( this._frustumMatrix3DDirty && this._updateFrustumMatrix3D(), this._frustumRect ); }, enumerable: !0, configurable: !0, }), (n.prototype.project = function (t, e) { throw new u(); }), (n.prototype.unproject = function (t, e, n, r) { throw new u(); }), Object.defineProperty(n.prototype, "viewMatrix3D", { get: function () { return ( this._viewMatrix3DDirty && ((this._viewMatrix3DDirty = !1), this._transform ? (this._viewMatrix3D.copyFrom( this._transform.inverseMatrix3D ), this._viewMatrix3D.append(this.frustumMatrix3D)) : this._viewMatrix3D.copyFrom(this.frustumMatrix3D)), this._viewMatrix3D ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "inverseViewMatrix3D", { get: function () { return ( this._inverseViewMatrix3DDirty && ((this._inverseViewMatrix3DDirty = !1), this._inverseViewMatrix3D.copyFrom(this.viewMatrix3D), this._inverseViewMatrix3D.invert()), this._inverseViewMatrix3D ); }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { throw new u(); }), (n.prototype._invalidateProperties = function () { this._propertiesDirty = !0; }), (n.prototype._invalidateViewMatrix3D = function () { (this._viewMatrix3DDirty = !0), (this._inverseViewMatrix3DDirty = !0), (this._viewFrustumCornersDirty = !0), (this._viewFrustumPlanesDirty = !0), this.dispatchEvent(new G(G.INVALIDATE_VIEW_MATRIX3D, this)); }), (n.prototype._invalidateFrustumMatrix3D = function () { this._propertiesDirty && this._updateProperties(), (this._frustumMatrix3DDirty = !0), this.dispatchEvent(new G(G.INVALIDATE_FRUSTUM_MATRIX3D, this)), this._invalidateViewMatrix3D(); }), (n.prototype._updateFrustumMatrix3D = function () { this._frustumMatrix3DDirty = !1; }), (n.prototype._updateProperties = function () { this._propertiesDirty = !1; }), (n.prototype._onInvalidateConcatenatedMatrix3D = function (t) { this._invalidateViewMatrix3D(); }), n ); })(h), vt = (function (t) { function n(e, n) { void 0 === e && (e = 1), void 0 === n && (n = _t.LEFT_HANDED); var r = t.call(this, n) || this; return (r.scale = e), r; } return ( e(n, t), (n.prototype.project = function (t, e) { void 0 === e && (e = null); var n = this.viewMatrix3D.transformVector(t, e); return ( (n.y = -n.y), (n.z = (n.z * (this._far - this._near) + this._far + this._near) / 2), (n.w = 1), n ); }), (n.prototype.unproject = function (t, e, n, r) { return ( void 0 === r && (r = null), null == r && (r = new B()), (r.x = t * n), (r.y = -e * n), (r.z = (2 * n - this._far - this._near) / (this._far - this._near)), (r.w = 1), this.inverseViewMatrix3D.transformVector(r, r), (r.w = 1), r ); }), (n.prototype.clone = function () { var t = new n(this.scale, this._coordinateSystem); return ( (t._near = this._near), (t._far = this._far), (t._coordinateSystem = this._coordinateSystem), t ); }), (n.prototype._updateFrustumMatrix3D = function () { t.prototype._updateFrustumMatrix3D.call(this); var e = this._frustumMatrix3D._rawData, n = this._scale, r = this._scale / this._ratio; (this._frustumRect.left = (0.5 * (this._originX - 1)) / r), (this._frustumRect.top = (0.5 * (this._originY - 1)) / n), (this._frustumRect.right = this._frustumRect.left + 1 / r), (this._frustumRect.bottom = this._frustumRect.top + 1 / n), (e[0] = 2 * r), (e[5] = 2 * n), (e[12] = this._originX), (e[13] = this._originY), (e[10] = 2 / (this._far - this._near)), (e[14] = -(this._far + this._near) / (this._far - this._near)), (e[1] = e[2] = e[3] = e[4] = e[6] = e[7] = e[8] = e[9] = e[11] = 0), (e[15] = 1), this._frustumMatrix3D.invalidatePosition(); }), (n.prototype._updateProperties = function () { t.prototype._updateProperties.call(this); var e = this._frustumMatrix3D._rawData; (this._near = -(e[14] + 1) / e[10]), (this._far = -(e[14] - 1) / e[10]), (this._originX = e[8]), (this._originY = e[9]), (this._scale = e[5] / 2), (this._ratio = (0.5 * this._scale) / e[0]); }), n ); })(At), bt = (function (t) { function n(e, n) { void 0 === e && (e = 60), void 0 === n && (n = _t.LEFT_HANDED); var r = t.call(this, n) || this; return (r.fieldOfView = e), r; } return ( e(n, t), Object.defineProperty(n.prototype, "fieldOfView", { get: function () { return (360 * Math.atan(0.5 / this.scale)) / Math.PI; }, set: function (t) { this.scale = 0.5 / Math.tan((t * Math.PI) / 360); }, enumerable: !0, configurable: !0, }), (n.prototype.project = function (t, e) { void 0 === e && (e = null); var n = this.viewMatrix3D.transformVector(t, e); return ( (n.x = n.x / n.w), (n.y = -n.y / n.w), (n.z = n.w), (n.w = 1), n ); }), (n.prototype.unproject = function (t, e, n, r) { return ( void 0 === r && (r = null), null == r && (r = new B()), (r.x = t * n), (r.y = -e * n), (r.z = ((this._far + this._near) / (this._far - this._near)) * n - (2 * this._far * this._near) / (this._far - this._near)), (r.w = n), this.inverseViewMatrix3D.transformVector(r, r), (r.w = 1), r ); }), (n.prototype.clone = function () { var t = new n(this.fieldOfView, this._coordinateSystem); return ( (t._near = this._near), (t._far = this._far), (t._coordinateSystem = this._coordinateSystem), t ); }), (n.prototype._updateFrustumMatrix3D = function () { t.prototype._updateFrustumMatrix3D.call(this); var e = this._frustumMatrix3D._rawData, n = this._scale, r = this._scale / this._ratio; (this._frustumRect.left = (0.5 * (this._originX - 1)) / r), (this._frustumRect.top = (0.5 * (this._originY - 1)) / n), (this._frustumRect.right = this._frustumRect.left + 1 / r), (this._frustumRect.bottom = this._frustumRect.top + 1 / n), (e[0] = 2 * r), (e[5] = 2 * n), (e[8] = this._originX), (e[9] = this._originY), (e[10] = (this._far + this._near) / (this._far - this._near)), (e[11] = 1), (e[1] = e[2] = e[3] = e[4] = e[6] = e[7] = e[12] = e[13] = e[15] = 0), (e[14] = (-2 * this._far * this._near) / (this._far - this._near)), this._coordinateSystem == _t.RIGHT_HANDED && (e[5] = -e[5]), this._frustumMatrix3D.invalidatePosition(); }), (n.prototype._updateProperties = function () { t.prototype._updateProperties.call(this); var e = this._frustumMatrix3D._rawData; (this._near = e[14] / (-1 - e[10])), (this._far = e[14] / (1 - e[10])), (this._scale = e[5] / 2), (this._ratio = (0.5 * this._scale) / e[0]), (this._originX = e[8]), (this._originY = e[9]); }), n ); })(At), Ct = (function () { function t() {} return ( (t.setElementSize = function (t, e, n) { t && ((t.style.width = e + "px"), (t.style.height = n + "px"), (t.width = e), (t.height = n)); }), (t.setElementWidth = function (t, e) { t && ((t.style.width = e + "px"), (t.width = e)); }), (t.setElementHeight = function (t, e) { t && ((t.style.height = e + "px"), (t.height = e)); }), (t.setElementX = function (t, e) { t && ((t.style.position = "absolute"), (t.style.left = e + "px")); }), (t.setElementY = function (t, e) { t && ((t.style.position = "absolute"), (t.style.top = e + "px")); }), (t.getElementVisibility = function (t) { return !!t && "visible" == t.style.visibility; }), (t.setElementVisibility = function (t, e) { t && (t.style.visibility = e ? "visible" : "hidden"); }), (t.setElementAlpha = function (t, e) { t instanceof HTMLCanvasElement && (t.getContext("2d").globalAlpha = e); }), (t.setElementPosition = function (t, e, n, r) { void 0 === r && (r = !1), t && ((t.style.position = r ? "absolute" : "relative"), (t.style.left = e + "px"), (t.style.top = n + "px")); }), t ); })(), It = {}, Et = (function () { function t() {} return ( (t.breakpoint = function () { t.break(); }), (t.throwPIROnKeyWordOnly = function (e, n) { void 0 === n && (n = !0), (t.keyword = n ? e : null); }), (t.throwPIR = function (e, n, r) { if (this.LOG_PI_ERRORS_ONLY_ONCE) { var i = e + n; if (It[i]) return; It[i] = !0; } if ( (t.logPIR("PartialImplementationError " + e, n, r), t.THROW_ERRORS) ) { if (t.keyword) if (-1 == (e + n + r).indexOf(t.keyword)) return; throw new U(e + "." + n + ": " + r); } }), (t.logPIR = function (e, n, r) { if ((void 0 === r && (r = ""), t.LOG_PI_ERRORS)) { var i = e + "." + n; r && (i += ": " + r), console.warn(i); } }), (t.log = function () { for (var e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; t.ENABLE_LOG && console.log(e); }), (t.THROW_ERRORS = !1), (t.ENABLE_LOG = !0), (t.LOG_PI_ERRORS = !0), (t.LOG_PI_ERRORS_ONLY_ONCE = !0), (t.keyword = null), t ); })(), xt = (function () { function t(t, e) { var n = this; (this._active = !1), (this._argsArray = new Array()), (this._getTimer = gt), this.setCallback(t, e), (this._rafUpdateFunction = function () { n._active && n._tick(); }), this._argsArray.push(this._dt); } return ( (t.prototype.setCallback = function (t, e) { (this._callback = t), (this._callbackContext = e); }), (t.prototype.start = function () { (this._prevTime = this._getTimer()), (this._active = !0), window && (window.requestAnimationFrame ? window.requestAnimationFrame(this._rafUpdateFunction) : window.mozRequestAnimationFrame ? (window.requestAnimationFrame = window.mozRequestAnimationFrame) : window.webkitRequestAnimationFrame ? (window.requestAnimationFrame = window.webkitRequestAnimationFrame) : window.oRequestAnimationFrame && (window.requestAnimationFrame = window.oRequestAnimationFrame)); }), (t.prototype.stop = function () { this._active = !1; }), Object.defineProperty(t.prototype, "active", { get: function () { return this._active; }, enumerable: !0, configurable: !0, }), (t.prototype._tick = function () { (this._currentTime = this._getTimer()), (this._dt = this._currentTime - this._prevTime), (this._argsArray[0] = this._dt), this._callback.apply(this._callbackContext, this._argsArray), window.requestAnimationFrame(this._rafUpdateFunction), (this._prevTime = this._currentTime); }), t ); })(), wt = (function () { function t() {} return ( (t.getChildrenWithTag = function (t, e) { var n = document.createDocumentFragment(); if (t) for (var r = t.childNodes.length, i = 0; i < r; i++) { var o = t.childNodes[i]; null != o && o.nodeName == e && n.appendChild(o); } return n.childNodes; }), (t.filterListByParam = function (t, e, n) { var r = document.createDocumentFragment(); if (t) for (var i = t.length, o = 0; o < i; o++) { var a = t[o]; null != a && a.attributes.getNamedItem(e).value == n && r.appendChild(a); } return r.childNodes; }), (t.strToXml = function (t) { return new DOMParser().parseFromString(t, "text/xml"); }), (t.nodeToString = function (t) { return t ? new XMLSerializer().serializeToString(t) : ""; }), (t.readAttributeValue = function (t, e) { var n = t.attributes; if (null == n) return ""; var r = n.getNamedItem(e); return r ? r.value : ""; }), (t.writeAttributeValue = function (t, e, n) { var r = document.createAttribute(e); (r.value = n), (r = t.attributes.setNamedItem(r)), console.log( "XmlUltils - writeAttributeValue() - name: " + r.name + ", value: " + r.value ); }), (t.hasAttribute = function (t, e) { var n = t.attributes; return null != n && null != n.getNamedItem(e); }), t ); })(); var St = (function () { function t() {} return ( (t.register = function (t) { -1 === this.serviceLibraries.indexOf(t) && this.serviceLibraries.push(t); }), (t.init = function () { return ((t = this.serviceLibraries.map(function (t) { return t.init(); })), (e = t.map(function (t) { return Promise.resolve(t).then( function (t) { return { status: "fulfilled", value: t }; }, function (t) { return { status: "rejected", reason: t }; } ); })), Promise.all(e)).then(function () {}); var t, e; }), (t.serviceLibraries = []), t ); })(); console.debug("AwayJS - Core - 0.9.31"), ct.enableParser(yt); var Dt, Tt = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._avmVersion = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "avmVersion", { get: function () { return this._avmVersion; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._avmVersion); }), (n.AVM_COMPLETE = "avmComplete"), n ); })(l), Pt = (function () { return function (t, e) { (this.normal = new B()), (this.rayPosition = new B()), (this.rayDirection = new B()), (this.entityNode = t), (this.pickGroup = e); }; })(); !(function (t) { (t[(t.SPHERE = 0)] = "SPHERE"), (t[(t.SPHERE_FAST = 1)] = "SPHERE_FAST"), (t[(t.SPHERE_BOUNDS = 2)] = "SPHERE_BOUNDS"), (t[(t.SPHERE_BOUNDS_FAST = 3)] = "SPHERE_BOUNDS_FAST"), (t[(t.BOX = 4)] = "BOX"), (t[(t.BOX_FAST = 5)] = "BOX_FAST"), (t[(t.BOX_BOUNDS = 6)] = "BOX_BOUNDS"), (t[(t.BOX_BOUNDS_FAST = 7)] = "BOX_BOUNDS_FAST"), (t[(t.NULL = 8)] = "NULL"); })(Dt || (Dt = {})); var Ot, Bt, Mt, Lt, Nt, Rt, Ft = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._boundsPicker = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "boundsPicker", { get: function () { return this._boundsPicker; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._boundsPicker); }), (n.INVALIDATE_BOUNDS = "invalidateBounds"), n ); })(l), kt = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype.clone = function () { return new n(this.type); }), (n.INVALIDATE_MATRIX3D = "invalidateMatrix3D"), (n.INVALIDATE_COLOR_TRANSFORM = "invalidateColorTransform"), n ); })(l), Ut = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; if ( ((r._targetCoordinateSpace = e), (r._picker = n.picker), (r._strokeFlag = n.strokeFlag), (r._fastFlag = n.fastFlag), (r._onInvalidateBoundsDelegate = function (t) { return r._onInvalidateBounds(t); }), (r._onInvalidateMatrix3DDelegate = function (t) { return r._onInvalidateMatrix3D(t); }), r._picker.addEventListener( Ft.INVALIDATE_BOUNDS, r._onInvalidateBoundsDelegate ), r._targetCoordinateSpace != r._picker.node) ) { for (var i = r._picker.node; i && i != r._targetCoordinateSpace; ) i.container.transform.addEventListener( D.INVALIDATE_MATRIX3D, r._onInvalidateMatrix3DDelegate ), (i = i.parent); i || r._targetCoordinateSpace.addEventListener( kt.INVALIDATE_MATRIX3D, r._onInvalidateMatrix3DDelegate ); } return r; } return ( e(n, t), (n.prototype._onInvalidateBounds = function (t) { this._invalid = !0; }), (n.prototype._onInvalidateMatrix3D = function (t) { this._invalid = !0; }), (n.prototype.onClear = function (e) { if ( (t.prototype.onClear.call(this, e), this._picker.removeEventListener( Ft.INVALIDATE_BOUNDS, this._onInvalidateBoundsDelegate ), this._targetCoordinateSpace != this._picker.node) ) { for ( var n = this._picker.node; n && n != this._targetCoordinateSpace; ) n.container.transform.removeEventListener( D.INVALIDATE_MATRIX3D, this._onInvalidateMatrix3DDelegate ), (n = n.parent); n || this._targetCoordinateSpace.removeEventListener( kt.INVALIDATE_MATRIX3D, this._onInvalidateMatrix3DDelegate ); } (this._targetCoordinateSpace = null), (this._picker = null); }), (n.prototype.nullify = function () { throw new u(); }), (n.prototype.isInFrustum = function (t, e) { throw new u(); }), (n.prototype.clone = function () { throw new u(); }), (n.prototype.rayIntersection = function (t, e, n) { return -1; }), (n.prototype.classifyToPlane = function (t) { throw new u(); }), (n.prototype._update = function () { this._invalid = !1; }), n ); })(W), jt = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e._x = 0), (e._y = 0), (e._z = 0), (e._width = 0), (e._height = 0), (e._depth = 0), (e._centerX = 0), (e._centerY = 0), (e._centerZ = 0), (e._halfExtentsX = 0), (e._halfExtentsY = 0), (e._halfExtentsZ = 0), e ); } return ( e(n, t), (n.prototype.nullify = function () { (this._x = this._y = this._z = 0), (this._width = this._height = this._depth = 0), (this._centerX = this._centerY = this._centerZ = 0), (this._halfExtentsX = this._halfExtentsY = this._halfExtentsZ = 0); }), (n.prototype.isInFrustum = function (t, e) { if ((this._invalid && this._update(), null != this._box)) { for (var n = 0; n < e; ++n) { var r = t[n], i = r.a, o = r.b, a = r.c, s = i < 0 ? -this._halfExtentsX : this._halfExtentsX, u = o < 0 ? -this._halfExtentsY : this._halfExtentsY, l = a < 0 ? -this._halfExtentsZ : this._halfExtentsZ; if ( i * (this._centerX + s) + o * (this._centerY + u) + a * (this._centerZ + l) - r.d < 0 ) return !1; } return !0; } }), (n.prototype.rayIntersection = function (t, e, n) { return ( this._invalid && this._update(), null == this._box ? -1 : this._box.rayIntersection(t, e, n) ); }), (n.prototype.getBox = function () { return this._invalid && this._update(), this._box; }), (n.prototype.classifyToPlane = function (t) { var e = t.a, n = t.b, r = t.c, i = e * this._centerX + n * this._centerY + r * this._centerZ - t.d; e < 0 && (e = -e), n < 0 && (n = -n), r < 0 && (r = -r); var o = e * this._halfExtentsX + n * this._halfExtentsY + r * this._halfExtentsZ; return i > o ? X.FRONT : i < -o ? X.BACK : X.INTERSECT; }), (n.prototype._update = function () { var e; t.prototype._update.call(this), this._targetCoordinateSpace != this._picker.node && (this._targetCoordinateSpace == this._picker.node.parent ? (e = this._picker.node.container.transform.matrix3D) : (e = this._picker.node.getMatrix3D().clone()).append( this._targetCoordinateSpace.getInverseMatrix3D() )), (this._box = this._picker._getBoxBoundsInternal( e, this._strokeFlag, this._fastFlag, this._box )), null != this._box && ((this._halfExtentsX = this._box.width / 2), (this._halfExtentsY = this._box.height / 2), (this._halfExtentsZ = this._box.depth / 2), (this._centerX = this._box.x + this._halfExtentsX), (this._centerY = this._box.y + this._halfExtentsY), (this._centerZ = this._box.z + this._halfExtentsZ)); }), n ); })(Ut), Vt = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e._radius = 0), (e._centerX = 0), (e._centerY = 0), (e._centerZ = 0), e ); } return ( e(n, t), (n.prototype.nullify = function () { (this._centerX = this._centerY = this._centerZ = 0), (this._radius = 0); }), (n.prototype.isInFrustum = function (t, e) { this._invalid && this._update(); for (var n = 0; n < e; ++n) { var r = t[n], i = r.a < 0 ? -this._radius : this._radius, o = r.b < 0 ? -this._radius : this._radius, a = r.c < 0 ? -this._radius : this._radius; if ( r.a * (this._centerX + i) + r.b * (this._centerY + o) + r.c * (this._centerZ + a) - r.d < 0 ) return !1; } return !0; }), (n.prototype.rayIntersection = function (t, e, n) { return ( this._invalid && this._update(), this._sphere.rayIntersection(t, e, n) ); }), (n.prototype.getSphere = function () { return this._invalid && this._update(), this._sphere; }), (n.prototype.classifyToPlane = function (t) { var e = t.a, n = t.b, r = t.c, i = e * this._centerX + n * this._centerY + r * this._centerZ - t.d; e < 0 && (e = -e), n < 0 && (n = -n), r < 0 && (r = -r); var o = (e + n + r) * this._radius; return i > o ? X.FRONT : i < -o ? X.BACK : X.INTERSECT; }), (n.prototype._update = function () { var e; t.prototype._update.call(this), this._targetCoordinateSpace && (this._targetCoordinateSpace == this._picker.node ? (e = this._picker.node.container.transform.matrix3D) : ((e = this._picker.node.getMatrix3D().clone()), this._targetCoordinateSpace.parent && e.append( this._targetCoordinateSpace.parent.getInverseMatrix3D() ))), (this._sphere = this._picker._getSphereBoundsInternal( null, e, this._strokeFlag, this._fastFlag, this._sphere )); var n = this._picker.node.getMatrix3D(), r = this._sphere.x, i = this._sphere.y, o = this._sphere.z, a = this._sphere.radius, s = n._rawData, u = s[0], l = s[4], c = s[8], h = s[12], p = s[1], d = s[5], f = s[9], g = s[13], _ = s[2], m = s[6], y = s[10], A = s[14]; (this._centerX = r * u + i * l + o * c + h), (this._centerY = r * p + i * d + o * f + g), (this._centerZ = r * _ + i * m + o * y + A); var v = u + l + c, b = p + d + f, C = _ + m + y; this._radius = a * Math.sqrt((v * v + b * b + C * C) / 3); }), n ); })(Ut), Qt = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.isInFrustum = function (t, e) { return !0; }), (n.prototype.classifyToPlane = function (t) { return X.INTERSECT; }), n ); })(Ut), Gt = (function () { function t(e, n) { (this.id = d.Next()), (this._picker = e), (this._strokeFlag = t._strokeDict[n]), (this._fastFlag = t._fastDict[n]), (this._boundingVolumeClass = t._boundsDict[n]); } return ( Object.defineProperty(t.prototype, "picker", { get: function () { return this._picker; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "strokeFlag", { get: function () { return this._strokeFlag; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "fastFlag", { get: function () { return this._fastFlag; }, enumerable: !0, configurable: !0, }), (t.prototype.requestAbstraction = function (t) { return this._boundingVolumeClass; }), (t.prototype.dispose = function () {}), (t._strokeDict = (((Ot = {})[Dt.BOX] = !1), (Ot[Dt.BOX_FAST] = !1), (Ot[Dt.BOX_BOUNDS] = !0), (Ot[Dt.BOX_BOUNDS_FAST] = !0), (Ot[Dt.SPHERE] = !1), (Ot[Dt.SPHERE_FAST] = !1), (Ot[Dt.SPHERE_BOUNDS] = !0), (Ot[Dt.SPHERE_FAST] = !0), (Ot[Dt.NULL] = !1), Ot)), (t._fastDict = (((Bt = {})[Dt.BOX] = !1), (Bt[Dt.BOX_FAST] = !0), (Bt[Dt.BOX_BOUNDS] = !1), (Bt[Dt.BOX_BOUNDS_FAST] = !0), (Bt[Dt.SPHERE] = !1), (Bt[Dt.SPHERE_FAST] = !0), (Bt[Dt.SPHERE_BOUNDS] = !1), (Bt[Dt.SPHERE_FAST] = !0), (Bt[Dt.NULL] = !1), Bt)), (t._boundsDict = (((Mt = {})[Dt.BOX] = jt), (Mt[Dt.BOX_FAST] = jt), (Mt[Dt.BOX_BOUNDS] = jt), (Mt[Dt.BOX_BOUNDS_FAST] = jt), (Mt[Dt.SPHERE] = Vt), (Mt[Dt.SPHERE_FAST] = Vt), (Mt[Dt.SPHERE_BOUNDS] = Vt), (Mt[Dt.SPHERE_FAST] = Vt), (Mt[Dt.NULL] = Qt), Mt)), t ); })(), zt = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._boundingVolumePools = new Object()), (r._orientedBoxBounds = []), (r._orientedBoxBoundsDirty = [!0, !0]), (r._orientedSphereBounds = []), (r._orientedSphereBoundsDirty = [!0, !0]), (r._pickables = []), (r.shapeFlag = !1), (r.id = d.Next()), (r._view = n.view), (r._node = e.parent), (r._pickGroup = n), (r._pickingCollision = new Pt(e, n)), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "pickingCollision", { get: function () { return this._pickingCollision; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "view", { get: function () { return this._view; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "node", { get: function () { return this._node; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pickGroup", { get: function () { return this._pickGroup; }, enumerable: !0, configurable: !0, }), (n.prototype.getBoundingVolume = function (t, e) { void 0 === t && (t = null), void 0 === e && (e = null), null == t && (t = this._node), null == e && (e = this._node.container.defaultBoundingVolume); var n = this._boundingVolumePools[e] || (this._boundingVolumePools[e] = new Gt(this, e)); return t.getAbstraction(n); }), (n.prototype.hitTestPoint = function (t, e, n) { return ( void 0 === n && (n = !1), this._hitTestPointInternal(this._node, t, e, n, !1) ); }), (n.prototype._hitTestPointInternal = function (t, e, n, r, i) { if ( (void 0 === r && (r = !1), void 0 === i && (i = !1), !(-1 == this._node.getMaskId() || (i && r))) ) return !1; this._invalid && this._update(); var o = new P(e, n); this._node.globalToLocal(o, o); var a = this._getBoxBoundsInternal(null, !1, !0); if (null == a || !a.contains(o.x, o.y, 0)) return !1; if ( !r || "[asset TextField]" == this._node.container.assetType || "[asset Billboard]" == this._node.container.assetType ) return !0; for (var s = this._pickables.length, u = !1, l = 0; l < s; l++) if (this._pickables[l].hitTestPoint(o.x, o.y, 0)) { u = !0; break; } if (!u) return !1; var c = this._node.getMaskOwners(); if (c) { var h = c.length, p = void 0, d = void 0, f = void 0, g = void 0; for (l = 0; l < h; l++) if ((p = c[l]).isDescendant(t)) { (f = (d = p.getMasks()).length), (g = !1); for (var _ = 0; _ < f; _++) if ( (p = d[_]).isDescendant(t) && p && this._pickGroup .getBoundsPicker(p.partition) ._hitTestPointInternal(t, e, n, r, !0) ) { g = !0; break; } if (!g) return !1; } } return !0; }), (n.prototype.isInFrustum = function (t, e) { return this._isInFrustumInternal(this._node, t, e); }), (n.prototype._isInFrustumInternal = function (t, e, n) { return this.getBoundingVolume(t).isInFrustum(e, n); }), (n.prototype.isIntersectingRay = function (t, e) { return this._isIntersectingRayInternal(this._node, t, e); }), (n.prototype._isIntersectingRayInternal = function (t, e, n) { var r = this._node.getInverseMatrix3D(); r.transformVector(e, this._pickingCollision.rayPosition), r.deltaTransformVector(n, this._pickingCollision.rayDirection); var i = this.getBoundingVolume().rayIntersection( this._pickingCollision.rayPosition, this._pickingCollision.rayDirection, this._pickingCollision.normal ); return ( !(i < 0 || !this._isIntersectingMasks(t, e, n)) && ((this._pickingCollision.rayEntryDistance = i), (this._pickingCollision.globalRayPosition = e), (this._pickingCollision.globalRayDirection = n), (this._pickingCollision.rayOriginIsInsideBounds = 0 == i), !0) ); }), (n.prototype.isIntersectingShape = function (t) { for (var e = !1, n = 0; n < this._pickables.length; n++) if (this._pickables[n].testCollision(this._pickingCollision, t)) { if (!t) return !0; e = !0; } return e; }), (n.prototype.getBoxBounds = function (t, e, n) { return ( void 0 === t && (t = null), void 0 === e && (e = !1), void 0 === n && (n = !1), this._getBoxBoundsInternal(t ? t.transform.matrix3D : null, e, n) ); }), (n.prototype._getBoxBoundsInternal = function (t, e, n, r, i) { void 0 === t && (t = null), void 0 === e && (e = !0), void 0 === n && (n = !0), void 0 === r && (r = null), void 0 === i && (i = null), this._invalid && this._update(); var o = this._pickables.length; if (o) if (n) { var a = void 0, s = e ? 1 : 0; if (this._orientedBoxBoundsDirty[s]) { this._orientedBoxBoundsDirty[s] = !1; for (var u = 0; u < o; u++) a = this._pickables[u].getBoxBounds( null, e, this._orientedBoxBounds[s], a ); this._orientedBoxBounds[s] = a; } else a = this._orientedBoxBounds[s]; null != a && (i = t ? t.transformBox(a).union(i, i || r) : a.union(i, i || r)); } else for (u = 0; u < o; u++) i = this._pickables[u].getBoxBounds(t, e, r, i); return i; }), (n.prototype.getSphereBounds = function (t, e, n) { return ( void 0 === t && (t = null), void 0 === e && (e = !1), void 0 === n && (n = !1), this._getSphereBoundsInternal( null, t ? t.transform.matrix3D : null, e, n ) ); }), (n.prototype._getSphereBoundsInternal = function (t, e, n, r, i, o) { void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = !0), void 0 === r && (r = !0), void 0 === i && (i = null), void 0 === o && (o = null), this._invalid && this._update(); var a = this._getBoxBoundsInternal(e, n); if (null != a) { t || (((t = new B()).x = a.x + a.width / 2), (t.y = a.y + a.height / 2), (t.z = a.z + a.depth / 2)); var s = this._pickables.length; if (s) if (r) { var u = void 0, l = n ? 1 : 0; if (this._orientedSphereBoundsDirty[l]) { this._orientedSphereBoundsDirty[l] = !1; for (var c = 0; c < s; c++) u = this._pickables[c].getSphereBounds( t, null, n, this._orientedSphereBounds[l], u ); this._orientedSphereBounds[l] = u; } else u = this._orientedSphereBounds[l]; null != u && (o = e ? e.transformSphere(u).union(o, o || i) : u.union(o, o || i)); } else for (c = 0; c < s; c++) o = this._pickables[c].getSphereBounds(t, e, n, i, o); return o; } }), (n.prototype.applyTraversable = function (t) { this._pickables.push(t.getAbstraction(this)); }), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), (this._pickables = []), (this._orientedBoxBoundsDirty[0] = !0), (this._orientedBoxBoundsDirty[1] = !0), (this._orientedSphereBoundsDirty[0] = !0), (this._orientedSphereBoundsDirty[1] = !0), this.dispatchEvent(new Ft(Ft.INVALIDATE_BOUNDS, this)); }), (n.prototype.onClear = function (e) { for (var n in (t.prototype.onClear.call(this, e), this._boundingVolumePools)) this._boundingVolumePools[n].dispose(), delete this._boundingVolumePools[n]; }), (n.prototype.requestAbstraction = function (t) { return n._pickPickableClassPool[t.assetType]; }), (n.registerPickable = function (t, e) { n._pickPickableClassPool[e.assetType] = t; }), (n.prototype._update = function () { (this._invalid = !1), this._node.container._acceptTraverser(this); }), (n.prototype._isIntersectingMasks = function (t, e, n) { var r = this._node.getMaskOwners(); if (r) for ( var i = r.length, o = void 0, a = void 0, s = void 0, u = void 0, l = 0; l < i; l++ ) if ((o = r[l]).isDescendant(t)) { (s = (a = o.getMasks()).length), (u = !1); for (var c = 0; c < s; c++) if ( (o = a[c]).isDescendant(t) && o && this._pickGroup .getRaycastPicker(o.partition) ._getCollisionInternal(e, n, !0, !0, null) ) { u = !0; break; } if (!u) return !1; } return !0; }), (n._pickPickableClassPool = new Object()), n ); })(W), Ht = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._node = n.node), (r._view = n.view), (r._pickGroup = n.pickGroup), r ); } return ( e(n, t), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._view = null); }), (n.prototype.hitTestPoint = function (t, e, n) { throw new u(); }), (n.prototype.getBoxBounds = function (t, e, n, r) { return void 0 === r && (r = null), r; }), (n.prototype.getSphereBounds = function (t, e, n, r, i) { return void 0 === i && (i = null), i; }), (n.prototype.testCollision = function (t, e) { throw new u(); }), n ); })(W); !(function (t) { (t[(t.MOUSE_ENABLED = 1)] = "MOUSE_ENABLED"), (t[(t.VISIBLE = 2)] = "VISIBLE"), (t[(t.MASK_ID = 4)] = "MASK_ID"), (t[(t.MASKS = 8)] = "MASKS"), (t[(t.COLOR_TRANSFORM = 16)] = "COLOR_TRANSFORM"), (t[(t.SCENE_TRANSFORM = 32)] = "SCENE_TRANSFORM"), (t[(t.SCALE9 = 64)] = "SCALE9"), (t[(t.ALL = 127)] = "ALL"); })(Lt || (Lt = {})), (function (t) { (t[(t.DEFAULT = 0)] = "DEFAULT"), (t[(t.CAMERA_PLANE = 1)] = "CAMERA_PLANE"), (t[(t.CAMERA_POSITION = 2)] = "CAMERA_POSITION"); })(Nt || (Nt = {})), (function (t) { (t[(t.REGISTRATION_POINT = 0)] = "REGISTRATION_POINT"), (t[(t.TRANSFORM_POINT = 1)] = "TRANSFORM_POINT"); })(Rt || (Rt = {})); var Xt, Yt, qt, Kt, Wt, Jt, $t, Zt, te, ee, ne, re, ie, oe, ae, se, ue = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._view = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "view", { get: function () { return this._view; }, enumerable: !0, configurable: !0, }), (n.INVALIDATE_VIEW_MATRIX3D = "invalidateViewMatrix3D"), (n.INVALIDATE_SIZE = "invalidateSize"), n ); })(l), le = (function (t) { function n(e, n, r) { void 0 === n && (n = null), void 0 === r && (r = null); var i = t.call(this, e) || this; return (i.entity = n), (i.index = r), i; } return ( e(n, t), (n.prototype.clone = function () { return new n(this.type, this.entity, this.index); }), (n.ADD_CHILD_AT = "addChildAt"), (n.REMOVE_CHILD_AT = "removeChildAt"), (n.INVALIDATE_ENTITY = "invalidateEntity"), (n.CLEAR_ENTITY = "clearEntity"), n ); })(l), ce = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r.property = n), r; } return ( e(n, t), (n.prototype.clone = function () { return new n(this.type, this.property); }), (n.INVALIDATE_PROPERTY = "invalidateProperty"), n ); })(l), he = (function () { return function () {}; })(), pe = (function () { return function () {}; })(), de = (function () { return function (t, e, n, r, i, o, a, s, u, l) { (this.a = new pe()), (this.b = new pe()), (this.flags = new he()), (this.dest = t), (this.a.format = e), (this.a.size = n), (this.b.format = r), (this.b.size = i), (this.opcode = o), (this.flags.simple = a), (this.flags.horizontal = s), (this.flags.fragonly = u), (this.flags.matrix = l); }; })(), fe = (function () { function t() {} return ( Object.defineProperty(t, "map", { get: function () { return ( t._map || ((t._map = new Array()), (t._map.mov = new de( "vector", "vector", 4, "none", 0, 0, !0, null, null, null )), (t._map.add = new de( "vector", "vector", 4, "vector", 4, 1, !0, null, null, null )), (t._map.sub = new de( "vector", "vector", 4, "vector", 4, 2, !0, null, null, null )), (t._map.mul = new de( "vector", "vector", 4, "vector", 4, 3, !0, null, null, null )), (t._map.div = new de( "vector", "vector", 4, "vector", 4, 4, !0, null, null, null )), (t._map.rcp = new de( "vector", "vector", 4, "none", 0, 5, !0, null, null, null )), (t._map.min = new de( "vector", "vector", 4, "vector", 4, 6, !0, null, null, null )), (t._map.max = new de( "vector", "vector", 4, "vector", 4, 7, !0, null, null, null )), (t._map.frc = new de( "vector", "vector", 4, "none", 0, 8, !0, null, null, null )), (t._map.sqt = new de( "vector", "vector", 4, "none", 0, 9, !0, null, null, null )), (t._map.rsq = new de( "vector", "vector", 4, "none", 0, 10, !0, null, null, null )), (t._map.pow = new de( "vector", "vector", 4, "vector", 4, 11, !0, null, null, null )), (t._map.log = new de( "vector", "vector", 4, "none", 0, 12, !0, null, null, null )), (t._map.exp = new de( "vector", "vector", 4, "none", 0, 13, !0, null, null, null )), (t._map.nrm = new de( "vector", "vector", 4, "none", 0, 14, !0, null, null, null )), (t._map.sin = new de( "vector", "vector", 4, "none", 0, 15, !0, null, null, null )), (t._map.cos = new de( "vector", "vector", 4, "none", 0, 16, !0, null, null, null )), (t._map.crs = new de( "vector", "vector", 4, "vector", 4, 17, !0, !0, null, null )), (t._map.dp3 = new de( "vector", "vector", 4, "vector", 4, 18, !0, !0, null, null )), (t._map.dp4 = new de( "vector", "vector", 4, "vector", 4, 19, !0, !0, null, null )), (t._map.abs = new de( "vector", "vector", 4, "none", 0, 20, !0, null, null, null )), (t._map.neg = new de( "vector", "vector", 4, "none", 0, 21, !0, null, null, null )), (t._map.sat = new de( "vector", "vector", 4, "none", 0, 22, !0, null, null, null )), (t._map.ted = new de( "vector", "vector", 4, "sampler", 1, 38, !0, null, !0, null )), (t._map.kil = new de( "none", "scalar", 1, "none", 0, 39, !0, null, !0, null )), (t._map.tex = new de( "vector", "vector", 4, "sampler", 1, 40, !0, null, !0, null )), (t._map.m33 = new de( "vector", "matrix", 3, "vector", 3, 23, !0, null, null, !0 )), (t._map.m44 = new de( "vector", "matrix", 4, "vector", 4, 24, !0, null, null, !0 )), (t._map.m43 = new de( "vector", "matrix", 3, "vector", 4, 25, !0, null, null, !0 )), (t._map.ddx = new de( "vector", "vector", 4, "none", 0, 26, !0, null, !0, null )), (t._map.ddy = new de( "vector", "vector", 4, "none", 0, 27, !0, null, !0, null )), (t._map.sge = new de( "vector", "vector", 4, "vector", 4, 41, !0, null, null, null )), (t._map.slt = new de( "vector", "vector", 4, "vector", 4, 42, !0, null, null, null )), (t._map.sgn = new de( "vector", "vector", 4, "vector", 4, 43, !0, null, null, null )), (t._map.seq = new de( "vector", "vector", 4, "vector", 4, 44, !0, null, null, null )), (t._map.sne = new de( "vector", "vector", 4, "vector", 4, 45, !0, null, null, null ))), t._map ); }, enumerable: !1, configurable: !0, }), t ); })(), ge = (function () { return function (t, e) { void 0 === t && (t = null), void 0 === e && (e = null), (this.name = ""), (this.version = 0), (this.native = {}), (this.name = t), (this.version = e), (this.data = new v()); }; })(), _e = (function () { return function (t, e) { (this.code = t), (this.desc = e); }; })(), me = (function () { function t() {} return ( Object.defineProperty(t, "map", { get: function () { return ( t._map || ((t._map = {}), (t._map.va = new _e(0, "vertex attribute")), (t._map.fc = new _e(1, "fragment constant")), (t._map.vc = new _e(1, "vertex constant")), (t._map.ft = new _e(2, "fragment temporary")), (t._map.vt = new _e(2, "vertex temporary")), (t._map.vo = new _e(3, "vertex output")), (t._map.op = new _e(3, "vertex output")), (t._map.fd = new _e(3, "fragment depth output")), (t._map.fo = new _e(3, "fragment output")), (t._map.oc = new _e(3, "fragment output")), (t._map.v = new _e(4, "varying")), (t._map.vi = new _e(4, "varying output")), (t._map.fi = new _e(4, "varying input")), (t._map.fs = new _e(5, "sampler")), (t._map.vn = new _e(15, "native")), (t._map.fn = new _e(15, "native"))), t._map ); }, enumerable: !1, configurable: !0, }), t ); })(), ye = (function () { return function (t, e, n) { (this.shift = t), (this.mask = e), (this.value = n); }; })(), Ae = (function () { function t() {} return ( Object.defineProperty(t, "map", { get: function () { return ( t._map || ((t._map = new Array()), (t._map.rgba = new ye(8, 15, 0)), (t._map.rg = new ye(8, 15, 5)), (t._map.r = new ye(8, 15, 4)), (t._map.compressed = new ye(8, 15, 1)), (t._map.compressed_alpha = new ye(8, 15, 2)), (t._map.dxt1 = new ye(8, 15, 1)), (t._map.dxt5 = new ye(8, 15, 2)), (t._map["2d"] = new ye(12, 15, 0)), (t._map.cube = new ye(12, 15, 1)), (t._map["3d"] = new ye(12, 15, 2)), (t._map.centroid = new ye(16, 1, 1)), (t._map.ignoresampler = new ye(16, 4, 4)), (t._map.clamp = new ye(20, 15, 0)), (t._map.repeat = new ye(20, 15, 1)), (t._map.wrap = new ye(20, 15, 1)), (t._map.nomip = new ye(24, 15, 0)), (t._map.mipnone = new ye(24, 15, 0)), (t._map.mipnearest = new ye(24, 15, 1)), (t._map.miplinear = new ye(24, 15, 2)), (t._map.nearest = new ye(28, 15, 0)), (t._map.linear = new ye(28, 15, 1))), t._map ); }, enumerable: !1, configurable: !0, }), t ); })(), ve = (function () { function t() { (this.nativeInstructionLastRegister = 65534), (this.r = { vertex: null, fragment: null }), (this.cur = new ge()); } return ( (t.prototype.assemble = function (t, e, n) { void 0 === e && (e = null), void 0 === n && (n = null), n || (n = 1), e && this.addHeader(e, n); var r = t.replace(/[\f\n\r\v]+/g, "\n").split("\n"); for (var i in r) this.processLine(r[i], +i); return this.r; }), (t.prototype.processLine = function (t, e) { var n = t.search("//"); if ( (-1 != n && (t = t.slice(0, n)), (t = t.replace(/^\s+|\s+$/g, "")).length > 0) ) { var r = t.search(/<.*>/g), i = null; -1 != r && ((i = t.slice(r).match(/([\w\.\-\+]+)/gi)), (t = t.slice(0, r))); for (var o, a = {}, s = 0; (o = t.indexOf("#native")) > 0; ) { var u = o, l = (o = t.indexOf("native#", o)) > -1 ? o + 7 : t.length; (a["nat" + s] = t.substring(u + 7, l - 7)), (t = t.substring(0, u) + "nat" + s + t.substring(l)), s++; } var c = t.match(/([\w\.\+\[\]]+)/gi); if (!c || c.length < 1) t.length >= 3 && console.log("Warning: bad line " + e + ": " + t); else switch (c[0]) { case "part": this.addHeader(c[1], Number(c[2])); break; case "endpart": if (!this.cur) throw "Unexpected endpart"; return (this.cur.data.position = 0), void (this.cur = null); default: if (!this.cur) return void console.log( "Warning: bad line " + e + ": " + t + " (Outside of any part definition)" ); if ("comment" == this.cur.name) return; var h = fe.map[c[0]]; if (!h) throw "Bad opcode " + c[0] + " " + e + ": " + t; this.emitOpcode(this.cur, h.opcode); var p = 1; if (h.dest && "none" != h.dest) { if (!this.emitDest(this.cur, c[p++], h.dest)) throw ( "Bad destination register " + c[p - 1] + " " + e + ": " + t ); } else this.emitZeroDword(this.cur); if (h.a && "none" != h.a.format) { if (!this.emitSource(this.cur, c[p++], h.a, a)) throw ( "Bad source register " + c[p - 1] + " " + e + ": " + t ); } else this.emitZeroQword(this.cur); if (h.b && "none" != h.b.format) { if ("sampler" == h.b.format) { if (!this.emitSampler(this.cur, c[p++], h.b, i)) throw ( "Bad sampler register " + c[p - 1] + " " + e + ": " + t ); } else if (!this.emitSource(this.cur, c[p++], h.b, a)) throw ( "Bad source register " + c[p - 1] + " " + e + ": " + t ); } else this.emitZeroQword(this.cur); } } }), (t.prototype.emitHeader = function (t) { switch ( (t.data.writeUnsignedByte(160), t.data.writeUnsignedInt(t.version), t.version >= 16 && t.data.writeUnsignedByte(0), t.data.writeUnsignedByte(161), t.name) ) { case "fragment": t.data.writeUnsignedByte(1); break; case "vertex": t.data.writeUnsignedByte(0); break; case "cpu": t.data.writeUnsignedByte(2); break; default: t.data.writeUnsignedByte(255); } }), (t.prototype.emitOpcode = function (t, e) { t.data.writeUnsignedInt(e); }), (t.prototype.emitZeroDword = function (t) { t.data.writeUnsignedInt(0); }), (t.prototype.emitZeroQword = function (t) { t.data.writeUnsignedInt(0), t.data.writeUnsignedInt(0); }), (t.prototype.emitDest = function (t, e, n) { var r = e.match(/([fov]?[tpocidavs])(\d*)(\.[xyzw]{1,4})?/i); if (!me.map[r[1]]) return !1; var i = { num: r[2] ? r[2] : 0, code: me.map[r[1]].code, mask: this.stringToMask(r[3]), }; return ( t.data.writeUnsignedShort(i.num), t.data.writeUnsignedByte(i.mask), t.data.writeUnsignedByte(i.code), !0 ); }), (t.prototype.stringToMask = function (t) { if (!t) return 15; var e = 0; return ( -1 != t.indexOf("x") && (e |= 1), -1 != t.indexOf("y") && (e |= 2), -1 != t.indexOf("z") && (e |= 4), -1 != t.indexOf("w") && (e |= 8), e ); }), (t.prototype.stringToSwizzle = function (t) { if (!t) return 228; var e = { x: 0, y: 1, z: 2, w: 3 }, n = 0; if ("." != t.charAt(0)) throw "Missing . for swizzle"; return ( t.length > 1 && (n |= e[t.charAt(1)]), t.length > 2 ? (n |= e[t.charAt(2)] << 2) : (n |= (3 & n) << 2), t.length > 3 ? (n |= e[t.charAt(3)] << 4) : (n |= (12 & n) << 2), t.length > 4 ? (n |= e[t.charAt(4)] << 6) : (n |= (48 & n) << 2), n ); }), (t.prototype.emitSampler = function (t, e, n, r) { var i = e.match(/fs(\d*)/i); if (!i || !i[1]) return !1; t.data.writeUnsignedShort(parseInt(i[1])), t.data.writeUnsignedByte(0), t.data.writeUnsignedByte(0); for (var o = 5, a = 0, s = 0; s < r.length; s++) { var u = Ae.map[r[s].toLowerCase()]; u ? (0 != ((a >> u.shift) & u.mask) && console.log("Warning, duplicate sampler option"), (a |= u.mask << u.shift), (o &= ~(u.mask << u.shift)), (o |= u.value << u.shift)) : console.log("Warning, unknown sampler option: ", r[s]); } return t.data.writeUnsignedInt(o), !0; }), (t.prototype.emitSource = function (t, e, n, r) { var i; r && e in r && ((this.cur.native[this.nativeInstructionLastRegister] = r[e]), (e = ("vertex" === this.cur.name ? "vn" : "fn") + this.nativeInstructionLastRegister), this.nativeInstructionLastRegister--); var o = e.match( /vc\[(v[tcai])(\d+)\.([xyzw])([+-]\d+)?\](\.[xyzw]{1,4})?/i ); if (o) { if (!me.map[o[1]]) return !1; t.data.writeUnsignedShort(0 | +o[2]), t.data.writeByte(0 | +o[4]), t.data.writeUnsignedByte(this.stringToSwizzle(o[5])), t.data.writeUnsignedByte(1), t.data.writeUnsignedByte(me.map[o[1]].code), t.data.writeUnsignedByte({ x: 0, y: 1, z: 2, w: 3 }[o[3]]), t.data.writeUnsignedByte(128); } else { if ( ((i = e.match(/([fov]?[tpocidavsn])(\d*)(\.[xyzw]{1,4})?/i)), !me.map[i[1]]) ) return !1; t.data.writeUnsignedShort(0 | i[2]), t.data.writeUnsignedByte(0), t.data.writeUnsignedByte(this.stringToSwizzle(i[3])), t.data.writeUnsignedByte(me.map[i[1]].code), t.data.writeUnsignedByte(0), t.data.writeUnsignedByte(0), t.data.writeUnsignedByte(0); } return !0; }), (t.prototype.addHeader = function (t, e) { if ((void 0 === e && (e = 1), null == this.r[t])) (this.r[t] = new ge(t, e)), this.emitHeader(this.r[t]); else if (this.r[t].version != e) throw "Multiple versions for part " + t; this.cur = this.r[t]; }), t ); })(), be = (function () { return function () { (this.progid = 0), (this.version = 0), (this.type = ""); }; })(), Ce = (function () { return function () { var t, e; (this.regread = (((t = {})[0] = []), (t[1] = []), (t[4] = []), (t[2] = []), (t[3] = []), (t[5] = []), (t[15] = []), t)), (this.regwrite = (((e = {})[0] = []), (e[1] = []), (e[4] = []), (e[2] = []), (e[3] = []), (e[5] = []), (e[15] = []), e)), (this.hasindirect = !1), (this.writedepth = !1), (this.hasmatrix = !1), (this.samplers = []), (this.constants = 0), (this.tokens = []), (this.header = new be()), (this.native = {}); }; })(), Ie = (function () { return function (t, e, n, r, i, o, a, s, u, l, c) { (this.s = t), (this.flags = e), (this.dest = n), (this.a = r), (this.b = i), (this.matrixwidth = o), (this.matrixheight = a), (this.ndwm = s), (this.scalar = u), (this.dm = l), (this.lod = c); }; })(), Ee = (function () { function t(t) {} return ( (t.lib = (((Xt = {})[24] = "\n// agal lib fun: multiply matrix4 onto v\nvec4 mul_mat44 (int matIndex, vec4 v) {\n\treturn vec4(\n\t\tdot(v, vc[matIndex + 0]),\n\t\tdot(v, vc[matIndex + 1]),\n\t\tdot(v, vc[matIndex + 2]),\n\t\tdot(v, vc[matIndex + 3])\n\t);\n}\n"), Xt)), (t.agal2glsllut = [ new Ie( "%dest = %cast(%a);\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(%a + %b);\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(%a - %b);\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(%a * %b);\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(%a / %b);\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(1.0) / %a;\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(min(%a,%b));\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(max(%a,%b));\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(fract(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(sqrt(abs(%a)));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(inversesqrt(abs(%a)));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(pow(abs(%a),%b));\n", 0, !0, !0, !0, null, null, null, null, null, null ), new Ie( "%dest = %cast(log2(abs(%a)));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(exp2(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(normalize(vec3( %a ) ));\n", 0, !0, !0, !1, null, null, !0, null, null, null ), new Ie( "%dest = %cast(sin(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(cos(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(cross(vec3(%a),vec3(%b)));\n", 0, !0, !0, !0, null, null, !0, null, null, null ), new Ie( "%dest = %cast(dot(vec3(%a),vec3(%b)));\n", 0, !0, !0, !0, null, null, !0, null, null, null ), new Ie( "%dest = %cast(dot(vec4(%a),vec4(%b)));\n", 0, !0, !0, !0, null, null, !0, null, null, null ), new Ie( "%dest = %cast(abs(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(%a * -1.0);\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(clamp(%a,0.0,1.0));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(dot(vec3(%a),vec3(%b)));\n", null, !0, !0, !0, 3, 3, !0, null, null, null ), new Ie( "%dest = %cast(mul_mat44(%ib,vec4(%a)));\n", null, !0, !0, !0, 4, 4, !0, null, null, null ), new Ie( "%dest = %cast(dot(vec4(%a),vec4(%b)));\n", null, !0, !0, !0, 4, 3, !0, null, null, null ), new Ie( "%dest = %cast(dFdx(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "%dest = %cast(dFdy(%a));\n", 0, !0, !0, !1, null, null, null, null, null, null ), new Ie( "if (float(%a)==float(%b)) {;\n", 0, !1, !0, !0, null, null, null, !0, null, null ), new Ie( "if (float(%a)!=float(%b)) {;\n", 0, !1, !0, !0, null, null, null, !0, null, null ), new Ie( "if (float(%a)>=float(%b)) {;\n", 0, !1, !0, !0, null, null, null, !0, null, null ), new Ie( "if (float(%a)= 16 && (t.readUnsignedByte(), (e.version >>= 1)), 161 != t.readUnsignedByte()) ) throw "Bad AGAL: Missing 0xa1 magic byte."; switch (((e.progid = t.readUnsignedByte()), e.progid)) { case 1: e.type = "fragment"; break; case 0: e.type = "vertex"; break; case 2: e.type = "cpu"; break; default: e.type = ""; } for (var n = new Ce(), r = []; t.position < t.length; ) { var i = new we(); i.opcode = t.readUnsignedInt(); var o = Ee.agal2glsllut[i.opcode]; if (!o) throw "Opcode not valid or not implemented yet: " + i.opcode; o.matrixheight && (n.hasmatrix = !0), o.dest ? ((i.dest.regnum = t.readUnsignedShort()), (i.dest.mask = t.readUnsignedByte()), (i.dest.regtype = t.readUnsignedByte()), (n.regwrite[i.dest.regtype][i.dest.regnum] |= i.dest.mask)) : ((i.dest = null), t.readUnsignedInt()), o.a ? this.readReg(i.a, 1, n, t) : ((i.a = null), t.readUnsignedInt(), t.readUnsignedInt()), o.b ? this.readReg(i.b, 0 | o.matrixheight, n, t) : ((i.b = null), t.readUnsignedInt(), t.readUnsignedInt()), r.push(i); } return (n.header = e), (n.tokens = r), n; }), (t.prototype.readReg = function (t, e, n, r) { if ( ((t.regnum = r.readUnsignedShort()), (t.indexoffset = r.readByte()), (t.swizzle = r.readUnsignedByte()), (t.regtype = r.readUnsignedByte()), (n.regread[t.regtype][t.regnum] = 15), 5 === t.regtype ? ((t.lodbiad = t.indexoffset), (t.indexoffset = void 0), (t.swizzle = void 0), (t.readmode = r.readUnsignedByte()), (t.dim = t.readmode >> 4), (t.readmode &= 15), (t.special = r.readUnsignedByte()), (t.wrap = t.special >> 4), (t.special &= 15), (t.mipmap = r.readUnsignedByte()), (t.filter = t.mipmap >> 4), (t.mipmap &= 15), (n.samplers[t.regnum] = t)) : ((t.indexregtype = r.readUnsignedByte()), (t.indexselect = r.readUnsignedByte()), (t.indirectflag = r.readUnsignedByte())), t.indirectflag && (n.hasindirect = !0), !t.indirectflag && e) ) for (var i = 0; i < e; i++) n.regread[t.regtype][t.regnum + i] = n.regread[t.regtype][t.regnum]; }), t ); })(), De = { PREF_WEBGL_VERSION: 2, USE_300_SHADERS_FOR_WEBGL2: !0, ENABLE_MULTISAMPLE_TEXTURE: !0, ENABLE_ANTIALIAS: !0, ENABLE_WEAK_REF: !0, PROFILE_CONTEXT_LOST: !1, ENABLE_UNLOAD_BITMAP: !0, MAX_BITMAP_UNLOAD_TASKS: 10, MAX_BITMAP_UNLOAD_TASKS_ASYNC: 50, ENABLE_UNLOAD_TEXTURE: !0, ENABLE_TEXTURE_POOLING: !1, ENABLE_UNLOAD_BUFFER: !0, MAX_BUFFER_POOL_SIZE: 300, MAX_BUFFER_ALIVE_TIME: 5e3, ENABLE_BUFFER_POOLING: !0, ENABLE_VAO: !0, ENABLE_UNIFORM_CACHE: !1, ENABLE_ASYNC_READ: !0, ENABLE_PARSER_NATIVE_BITMAP: !0, ENABLE_TEXTURE_REF_CLONE: !1, UNSAFE_USE_AUTOINDEXED_SAMPLER: !0, UNSAFE_USE_AUTOINDEXED_ATTRIBUTES: !0, FILTERS_USE_INSTANCED_COPY: !1, }, Te = (function () { function t() { (this._usedLibs = {}), (this._usedTemps = {}); } return ( (t.prototype._linkLib = function (t) { var e = this._usedLibs; return !e[t] && Ee.lib[t] ? ((e[t] = !0), (this._header += "\n" + Ee.lib[t] + "\n"), !0) : e[t]; }), (t.prototype.parse = function (e, n, r) { void 0 === r && (r = !1), (r = r), (this._usedTemps = {}), (this._usedLibs = {}), (this._header = ""), (this._body = ""), (this._header += r ? "#version 300 es\n" : "#version 100\n"), (this._header += "precision " + n + " float;\n"); var i = e.header.type[0], o = e.regread[1].length; o > 0 && (this._header += "uniform vec4 " + i + "c[" + o + "];\n"); for (var a = 0; a < e.regread[0].length; a++) e.regread[0][a] && (this._header += (r ? "in" : "attribute") + " vec4 va" + a + ";\n"); for (a = 0; a < e.regread[4].length || a < e.regwrite[4].length; a++) (e.regread[4][a] || e.regwrite[4][a]) && (this._header += r ? ("vertex" === e.header.type ? "out" : "in") + " vec4 vi" + a + ";\n" : "varying vec4 vi" + a + ";\n"); for (a = 0; a < e.samplers.length; a++) e.samplers[a] && (this._header += "uniform sampler" + t.SAMPLERS[3 & e.samplers[a].dim] + " fs" + a + ";\n"); "vertex" == e.header.type ? (this._header += "vec4 outpos;\n") : r && (this._header += "out vec4 outColor;\n"), e.writedepth && (this._header += "vec4 tmp_FragDepth;\n"); var s = !1; this._body += "void main() {\n"; for (a = 0; a < e.tokens.length; a++) { var u = e.tokens[a], l = Ee.agal2glsllut[u.opcode], c = this._linkLib(u.opcode); if ( ((-1 == l.s.indexOf("dFdx") && -1 == l.s.indexOf("dFdy")) || (s = !0), !l) ) throw "Opcode not valid or not implemented yet: "; for (var h = c ? 1 : l.matrixheight || 1, p = 0; p < h; p++) { var d = " " + l.s, f = "", g = "float", _ = ""; if (u.dest) { if (l.matrixheight && !c) { if (1 != ((u.dest.mask >> p) & 1)) continue; (_ = t.SWIZZLE[p]), (f = this.regtostring( u.dest.regtype, u.dest.regnum, e, i, r )), (f += "." + _); } else if ( ((f = this.regtostring( u.dest.regtype, u.dest.regnum, e, i, r )), 15 != u.dest.mask) ) { var m = 0; switch ( ((_ = ""), 1 & u.dest.mask && (m++, (_ += "x")), 2 & u.dest.mask && (m++, (_ += "y")), 4 & u.dest.mask && (m++, (_ += "z")), 8 & u.dest.mask && (m++, (_ += "w")), (f += "." + _), m) ) { case 1: g = "float"; break; case 2: g = "vec2"; break; case 3: g = "vec3"; break; default: throw "Unexpected destination mask"; } } else (g = "vec4"), (_ = "xyzw"); if (2 == u.dest.regtype && !this._usedTemps[u.dest.regnum]) { var y = i + "t" + u.dest.regnum; "vec4" === g ? (f = "vec4 " + y) : (d = " vec4 " + y + ";\n" + d), (this._usedTemps[u.dest.regnum] = !0); } d = (d = (d = d.replace("%dest", f)).replace( "%cast", g )).replace("%dm", _); } var A = 15; if ( (!l.ndwm && l.dest && u.dest && (A = u.dest.mask), u.a && (d = (d = d.replace( "%a", this.sourcetostring(u.a, 0, A, l.scalar, e, i, r) )).replace("%ia", "" + u.a.regnum)), u.b && ((d = (d = d.replace( "%b", this.sourcetostring(u.b, p, A, l.scalar, e, i, r) )).replace("%ib", "" + u.b.regnum)), 5 == u.b.regtype)) ) { var v = t.SAMPLERS[u.b.dim], b = ["vec2", "vec3", "vec3"][u.b.dim]; d = (d = (d = d.replace("%texdim", r ? "" : v)).replace( "%texsize", b )).replace("%lod", ""); } this._body += d; } } return ( "vertex" == e.header.type && (this._body += " gl_Position = vec4(outpos.x, outpos.y, outpos.z*2.0 - outpos.w, outpos.w);\n"), s && "fragment" == e.header.type && (this._header = "#extension GL_OES_standard_derivatives : enable\n" + this._header), e.writedepth && (this._body += " gl_FragDepth = clamp(tmp_FragDepth,0.0,1.0);\n"), (this._body += "}\n"), this._header + this._body ); }), (t.prototype.regtostring = function (t, e, n, r, i) { switch (t) { case 0: return "va" + e; case 1: return n.header.type[0] + "c[" + e + "]"; case 2: return r + "t" + e; case 3: return "vertex" == n.header.type ? "outpos" : i ? "outColor" : "gl_FragColor"; case 4: return "vi" + e; case 5: return "fs" + e; case 15: if (void 0 === n.native[e]) throw "Native mapping not presented for register:" + e; return n.native[e]; default: throw "Unknown register type"; } }), (t.prototype.sourcetostring = function (e, n, r, i, o, a, s) { var u, l = t.SWIZZLE; if (e.indirectflag) { u = "vcarrr[int(" + this.regtostring(e.indexregtype, e.regnum, o, a, s) + "." + l[e.indexselect] + ")"; var c = n + e.indexoffset; c < 0 && (u += c.toString()), c > 0 && (u += "+" + c.toString()), (u += "]"); } else u = this.regtostring(e.regtype, e.regnum + n, o, a, s); return 5 == e.regtype || 15 == e.regtype ? u : i ? u + "." + l[(e.swizzle >> 0) & 3] : ((228 == e.swizzle && 15 == r) || ((u += "."), 1 & r && (u += l[(e.swizzle >> 0) & 3]), 2 & r && (u += l[(e.swizzle >> 2) & 3]), 4 & r && (u += l[(e.swizzle >> 4) & 3]), 8 & r && (u += l[(e.swizzle >> 6) & 3])), u); }), (t.SWIZZLE = ["x", "y", "z", "w"]), (t.SAMPLERS = ["2D", "Cube", "3D", ""]), (t.maxvertexconstants = 128), (t.maxfragconstants = 28), (t.maxtemp = 8), (t.maxstreams = 8), (t.maxtextures = 8), t ); })(); !(function (t) { (t[(t.DESTINATION_ALPHA = 0)] = "DESTINATION_ALPHA"), (t[(t.DESTINATION_COLOR = 1)] = "DESTINATION_COLOR"), (t[(t.ONE = 2)] = "ONE"), (t[(t.ONE_MINUS_DESTINATION_ALPHA = 3)] = "ONE_MINUS_DESTINATION_ALPHA"), (t[(t.ONE_MINUS_DESTINATION_COLOR = 4)] = "ONE_MINUS_DESTINATION_COLOR"), (t[(t.ONE_MINUS_SOURCE_ALPHA = 5)] = "ONE_MINUS_SOURCE_ALPHA"), (t[(t.ONE_MINUS_SOURCE_COLOR = 6)] = "ONE_MINUS_SOURCE_COLOR"), (t[(t.SOURCE_ALPHA = 7)] = "SOURCE_ALPHA"), (t[(t.SOURCE_COLOR = 8)] = "SOURCE_COLOR"), (t[(t.ZERO = 9)] = "ZERO"); })(Yt || (Yt = {})), (function (t) { (t[(t.ADD = 0)] = "ADD"), (t[(t.SUBTRACT = 1)] = "SUBTRACT"), (t[(t.REVERSE_SUBTRACT = 2)] = "REVERSE_SUBTRACT"), (t[(t.MIN = 3)] = "MIN"), (t[(t.MAX = 4)] = "MAX"); })(qt || (qt = {})), (function (t) { (t[(t.COLOR = 1)] = "COLOR"), (t[(t.DEPTH = 2)] = "DEPTH"), (t[(t.STENCIL = 4)] = "STENCIL"), (t[(t.ALL = 7)] = "ALL"); })(Kt || (Kt = {})), (function (t) { (t[(t.ALWAYS = 0)] = "ALWAYS"), (t[(t.EQUAL = 1)] = "EQUAL"), (t[(t.GREATER = 2)] = "GREATER"), (t[(t.GREATER_EQUAL = 3)] = "GREATER_EQUAL"), (t[(t.LESS = 4)] = "LESS"), (t[(t.LESS_EQUAL = 5)] = "LESS_EQUAL"), (t[(t.NEVER = 6)] = "NEVER"), (t[(t.NOT_EQUAL = 7)] = "NOT_EQUAL"); })(Wt || (Wt = {})), (function (t) { (t[(t.TRIANGLES = 0)] = "TRIANGLES"), (t[(t.LINES = 1)] = "LINES"); })(Jt || (Jt = {})), (function (t) { (t[(t.MIPLINEAR = 0)] = "MIPLINEAR"), (t[(t.MIPNEAREST = 1)] = "MIPNEAREST"), (t[(t.MIPNONE = 2)] = "MIPNONE"); })($t || ($t = {})), (function (t) { (t[(t.BASELINE = 0)] = "BASELINE"), (t[(t.BASELINE_CONSTRAINED = 1)] = "BASELINE_CONSTRAINED"), (t[(t.BASELINE_EXTENDED = 2)] = "BASELINE_EXTENDED"); })(Zt || (Zt = {})), (function (t) { (t[(t.FRAGMENT = 0)] = "FRAGMENT"), (t[(t.SAMPLER = 1)] = "SAMPLER"), (t[(t.VERTEX = 2)] = "VERTEX"); })(te || (te = {})), (function (t) { (t[(t.DECREMENT_SATURATE = 0)] = "DECREMENT_SATURATE"), (t[(t.DECREMENT_WRAP = 1)] = "DECREMENT_WRAP"), (t[(t.INCREMENT_SATURATE = 2)] = "INCREMENT_SATURATE"), (t[(t.INCREMENT_WRAP = 3)] = "INCREMENT_WRAP"), (t[(t.INVERT = 4)] = "INVERT"), (t[(t.KEEP = 5)] = "KEEP"), (t[(t.SET = 6)] = "SET"), (t[(t.ZERO = 7)] = "ZERO"); })(ee || (ee = {})), (function (t) { (t[(t.LINEAR = 0)] = "LINEAR"), (t[(t.NEAREST = 1)] = "NEAREST"); })(ne || (ne = {})), (function (t) { (t[(t.BGRA = 0)] = "BGRA"), (t[(t.BGRA_PACKED = 1)] = "BGRA_PACKED"), (t[(t.BGR_PACKED = 2)] = "BGR_PACKED"), (t[(t.COMPRESSED = 3)] = "COMPRESSED"), (t[(t.COMPRESSED_ALPHA = 4)] = "COMPRESSED_ALPHA"); })(re || (re = {})), (function (t) { (t[(t.BACK = 0)] = "BACK"), (t[(t.FRONT = 1)] = "FRONT"), (t[(t.FRONT_AND_BACK = 2)] = "FRONT_AND_BACK"), (t[(t.NONE = 3)] = "NONE"); })(ie || (ie = {})), (function (t) { (t[(t.FLOAT_1 = 0)] = "FLOAT_1"), (t[(t.FLOAT_2 = 1)] = "FLOAT_2"), (t[(t.FLOAT_3 = 2)] = "FLOAT_3"), (t[(t.FLOAT_4 = 3)] = "FLOAT_4"), (t[(t.BYTE_1 = 4)] = "BYTE_1"), (t[(t.BYTE_2 = 5)] = "BYTE_2"), (t[(t.BYTE_3 = 6)] = "BYTE_3"), (t[(t.BYTE_4 = 7)] = "BYTE_4"), (t[(t.UNSIGNED_BYTE_1 = 8)] = "UNSIGNED_BYTE_1"), (t[(t.UNSIGNED_BYTE_2 = 9)] = "UNSIGNED_BYTE_2"), (t[(t.UNSIGNED_BYTE_3 = 10)] = "UNSIGNED_BYTE_3"), (t[(t.UNSIGNED_BYTE_4 = 11)] = "UNSIGNED_BYTE_4"), (t[(t.SHORT_1 = 12)] = "SHORT_1"), (t[(t.SHORT_2 = 13)] = "SHORT_2"), (t[(t.SHORT_3 = 14)] = "SHORT_3"), (t[(t.SHORT_4 = 15)] = "SHORT_4"), (t[(t.UNSIGNED_SHORT_1 = 16)] = "UNSIGNED_SHORT_1"), (t[(t.UNSIGNED_SHORT_2 = 17)] = "UNSIGNED_SHORT_2"), (t[(t.UNSIGNED_SHORT_3 = 18)] = "UNSIGNED_SHORT_3"), (t[(t.UNSIGNED_SHORT_4 = 19)] = "UNSIGNED_SHORT_4"); })(oe || (oe = {})), (function (t) { (t[(t.CLAMP = 0)] = "CLAMP"), (t[(t.REPEAT = 1)] = "REPEAT"); })(ae || (ae = {})), (function (t) { (t[(t.AUTO = 0)] = "AUTO"), (t[(t.WEBGL = 1)] = "WEBGL"), (t[(t.FLASH = 2)] = "FLASH"), (t[(t.GLES = 3)] = "GLES"), (t[(t.NATIVE = 4)] = "NATIVE"), (t[(t.SOFTWARE = 5)] = "SOFTWARE"); })(se || (se = {})); var Pe = (function () { function t(t, e) { void 0 === t && (t = -1), void 0 === e && (e = null), (this.id = t), (this.type = e), (this.wrap = 0), (this.filter = 0), (this.mipfilter = 0), (this.boundedTexture = null), (this._dirty = !0); } return ( Object.defineProperty(t.prototype, "valid", { get: function () { return null !== this.type && this.id >= 0; }, enumerable: !1, configurable: !0, }), (t.prototype.set = function (t, e, n) { return ( (this._dirty = this._dirty || t != t || e != e || n != n), (this.wrap = t), (this.filter = e), (this.mipfilter = n), this ); }), (t.prototype.equals = function (t) { return ( this.type === t.type && this.wrap === t.wrap && this.filter === t.filter && this.mipfilter === t.mipfilter ); }), (t.prototype.copyFrom = function (t) { return ( (this.type = t.type), (this.wrap = t.wrap), (this.filter = t.filter), (this.mipfilter = t.mipfilter), this ); }), (t.prototype.dispose = function () { (this.id = -1), (this.type = null), (this.wrap = 0), (this.filter = 0), (this.mipfilter = 0); }), t ); })(), Oe = (function () { return function (t, e, n) { (this.x = t), (this.y = e), (this.id = n); }; })(), Be = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._image = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "image", { get: function () { return this._image; }, enumerable: !1, configurable: !0, }), (n.INVALIDATE_MIPMAPS = "invalidateMipmaps"), n ); })(l), Me = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._stage = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "stage", { get: function () { return this._stage; }, enumerable: !1, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._stage); }), (n.STAGE_ERROR = "stageError"), (n.CONTEXT_CREATED = "contextCreated"), (n.CONTEXT_DISPOSED = "contextDisposed"), (n.CONTEXT_RECREATED = "contextRecreated"), (n.INVALIDATE_SIZE = "invalidateSize"), n ); })(l), Le = (function (t) { function n(e, n, r) { void 0 === e && (e = !1), void 0 === n && (n = !1), void 0 === r && (r = !1); var i = t.call(this) || this; return (i._repeat = e), (i._smooth = n), (i._mipmap = r), i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "repeat", { get: function () { return this._repeat; }, set: function (t) { this._repeat != t && (this._repeat = t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "smooth", { get: function () { return this._smooth; }, set: function (t) { this._smooth != t && (this._smooth = t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "mipmap", { get: function () { return this._mipmap; }, set: function (t) { this._mipmap != t && (this._mipmap = t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "imageRect", { get: function () { return this._imageRect; }, set: function (t) { this._imageRect != t && ((this._imageRect = t), this._updateRect()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "frameRect", { get: function () { return this._frameRect; }, set: function (t) { this._frameRect != t && ((this._frameRect = t), this._updateRect()); }, enumerable: !1, configurable: !0, }), (n.prototype._updateRect = function () {}), (n.assetType = "[asset Sampler]"), n ); })(f), Ne = (function () { function t() {} return ( (t.getImageBuffer = function (t) { var e = this.CANVAS || (this.CANVAS = document.createElement("canvas")), n = e.getContext("2d"); return ( t instanceof HTMLImageElement ? ((e.width = t.naturalWidth), (e.height = t.naturalHeight)) : ((e.width = t.width), (e.height = t.height)), n.drawImage(t, 0, 0), n.getImageData(0, 0, e.width, e.height).data ); }), (t.imageToBitmapImage2D = function (e, n, r) { var i, o; void 0 === n && (n = !0), void 0 === r && (r = null), r || (r = new this._defaultFactoryCtor()), e instanceof HTMLImageElement ? ((i = e.naturalWidth), (o = e.naturalHeight)) : ((i = e.width), (o = e.height)); var a = r.createImage2D(i, o, !0, null, n); return ( a.addLazySymbol({ needParse: !0, definition: { width: i, height: o, isPMA: !0, data: null }, lazyParser: function () { return ( (this.needParse = !1), (this.definition.data = t.getImageBuffer(e)), (this.lazyParser = null), this ); }, }), a ); }), (t.isImage2DValid = function (t) { return ( null == t || (this.isDimensionValid(t.width, t.powerOfTwo) && this.isDimensionValid(t.height, t.powerOfTwo)) ); }), (t.isHTMLImageElementValid = function (t) { return ( null == t || (this.isDimensionValid(t.width) && this.isDimensionValid(t.height)) ); }), (t.isDimensionValid = function (t, e) { return ( void 0 === e && (e = !0), t >= 1 && t <= this.MAX_SIZE && (!e || this.isPowerOfTwo(t)) ); }), (t.isPowerOfTwo = function (t) { return !!t && (t & -t) == t; }), (t.getBestPowerOf2 = function (t) { for (var e = 1; e < t; ) e <<= 1; return e > this.MAX_SIZE && (e = this.MAX_SIZE), e; }), (t.getDefaultImage2D = function () { return ( this._defaultBitmapImage2D || this.createDefaultImage2D(), this._defaultBitmapImage2D ); }), (t.getDefaultImageCube = function () { return ( this._defaultBitmapImageCube || this.createDefaultImageCube(), this._defaultBitmapImageCube ); }), (t.getDefaultSampler = function () { return ( this._defaultSampler || this.createDefaultSampler(), this._defaultSampler ); }), (t.createDefaultImageCube = function () { this._defaultBitmapImage2D || this.createDefaultImage2D(); for ( var t = new this._defaultBitmapCubeCtor( this._defaultBitmapImage2D.width ), e = 0; e < 6; e++ ) t.drawBitmap( e, this._defaultBitmapImage2D.data, 0, 0, this._defaultBitmapImage2D.width, this._defaultBitmapImage2D.height ); this._defaultBitmapImageCube = t; }), (t.createDefaultSampler = function () { this._defaultSampler = new Le(); }), (t.createDefaultImage2D = function () { var t, e, n = new this._defaultBitmap2DCtor(8, 8, !1, 0); for (t = 0; t < 8; t++) for (e = 0; e < 8; e++) (1 & e) ^ (1 & t) && n.setPixel(t, e, 16777215); return n; }), (t.registerDefaults = function (t, e, n) { (this._defaultBitmap2DCtor = t), (this._defaultBitmapCubeCtor = e), (this._defaultFactoryCtor = n); }), (t.MAX_SIZE = 8192), t ); })(), Re = (function (t) { function n() { var e = t.call(this) || this; return (e._pFormat = "bgra"), e; } return ( e(n, t), Object.defineProperty(n.prototype, "format", { get: function () { return this._pFormat; }, enumerable: !1, configurable: !0, }), (n.prototype.invalidateMipmaps = function () { this.dispatchEvent(new Be(Be.INVALIDATE_MIPMAPS, this)); }), n ); })(f), Fe = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.usages = 0), (r._invalidMipmaps = !0), (r._invalidMapper = !0), (r._stage = n), (r._onInvalidateMipmapsDelegate = function (t) { return r._onInvalidateMipmaps(t); }), r._asset.addEventListener( Be.INVALIDATE_MIPMAPS, r._onInvalidateMipmapsDelegate ), r ); } return ( e(n, t), (n.prototype.getTexture = function () { return ( this._texture || (this._createTexture(), (this._invalid = !0)), this._texture ); }), (n.prototype.getType = function () { throw new u(); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._texture && (this._texture.dispose(), (this._texture = null)); }), (n.prototype.activate = function (t, e) { void 0 === e && (e = null), e || (e = Ne.getDefaultSampler()); var n = !(!e.mipmap || this._stage.globalDisableMipmap) && e.mipmap; this._stage.setSamplerAt(t, e), this._stage.context.setTextureAt(t, this.getTexture()), !this._mipmap && n && ((this._mipmap = !0), (this._invalidMipmaps = !0)), this._invalidMipmaps && ((this._invalidMipmaps = !1), n && this._texture.generateMipmaps()); }), (n.prototype._createTexture = function () { throw new u(); }), (n.prototype._onInvalidateMipmaps = function (t) { this._invalidMipmaps = !0; }), n ); })(W), ke = (function (t) { function n(e, n, r) { void 0 === r && (r = !0); var i = t.call(this) || this; return ( (i._powerOfTwo = !0), (i._isDisposed = !1), (i._rect = new K(0, 0, Math.round(e), Math.round(n))), (i._powerOfTwo = r), i._testDimensions(), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "isDisposed", { get: function () { return this._isDisposed; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return this._rect.height; }, set: function (t) { this._setSize(this._rect.width, t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "alphaChannel", { get: function () { return this._alphaChannel; }, set: function (t) { this._alphaChannel = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "rect", { get: function () { return this._rect; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "width", { get: function () { return this._rect.width; }, set: function (t) { this._setSize(t, this._rect.height); }, enumerable: !1, configurable: !0, }), (n.prototype.dispose = function () { (this._isDisposed = !0), this.clear(); }), (n.prototype._setSize = function (t, e) { (t = Math.round(t)), (e = Math.round(e)), (this._rect.width == t && this._rect.height == e) || (this.clear(), (this._rect.width = t), (this._rect.height = e), this._testDimensions()); }), (n.prototype._testDimensions = function () { if ( this._powerOfTwo && (!Ne.isDimensionValid(this._rect.width) || !Ne.isDimensionValid(this._rect.height)) ) throw new Error( "Invalid dimension: Width and height must be power of 2 and cannot exceed 2048" ); }), Object.defineProperty(n.prototype, "powerOfTwo", { get: function () { return this._powerOfTwo; }, set: function (t) { this._powerOfTwo != t && ((this._powerOfTwo = t), this._testDimensions()); }, enumerable: !1, configurable: !0, }), (n.assetType = "[image Image2D]"), n ); })(Re), Ue = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.getType = function () { return "2d"; }), (n.prototype._createTexture = function () { this._texture = this._stage.context.createTexture( this._asset.width, this._asset.height, re.BGRA, !0 ); }), n ); })(Fe); function je(t, e) { return t.priority - e.priority; } var Ve = (function () { function t() {} return ( (t.createManager = function (t) { t = Object.assign( { name: Qe.name + ":" + this.managers.length }, t || {} ); var e = new Qe(t); return this.managers.push(e), this.managers.sort(je), e; }), (t.executeAll = function () { for (var t = 0, e = this.managers; t < e.length; t++) { var n = e[t], r = n.execute(); r && console.debug( "[UnloadService:" + n.name + ", tick: " + this.tick + "] unloaded:", r ); } this.tick++; }), (t.clearAll = function () { for (var t = 0, e = this.managers; t < e.length; t++) { e[t].clear(); } (this.tick = 0), (this.managers.length = 0); }), (t.tick = 0), (t.managers = []), t ); })(), Qe = (function () { function t(e) { var n; (this._tasks = new Set()), (this.name = t.name), (this.priority = 0), (this.keepAliveTime = 1e4), (this.exectuionTimeout = 5e3), (this.unloadTaskShift = 1e3), (this.maxUnloadTask = 100), (this._lastExecutionTime = 0), (this._lastCorrectedTime = -1), e && ((this.name = e.name || this.name), (this.priority = null !== (n = e.priority) && void 0 !== n ? n : this.priority), (this.keepAliveTime = e.keepAliveTime || this.keepAliveTime), (this.maxUnloadTask = e.maxUnloadTasks || this.maxUnloadTask), (this.exectuionTimeout = e.exectionPeriod || this.exectuionTimeout)); } return ( Object.defineProperty(t.prototype, "correctedTime", { get: function () { var e = performance.now(); return ( (this._lastCorrectedTime < 0 || this._lastCorrectedTime - e >= t.MIN_QUANT) && (e += t.MIN_QUANT), (this._lastCorrectedTime = e) ); }, enumerable: !1, configurable: !0, }), (t.prototype.addTask = function (t) { return !(!t || this._tasks.has(t)) && (this._tasks.add(t), !0); }), (t.prototype.removeTask = function (t) { return this._tasks.delete(t); }), (t.prototype.execute = function (t) { if ((void 0 === t && (t = !1), this._tasks.size)) { var e = this.correctedTime; if (!t) { if (!this._lastExecutionTime) return void (this._lastExecutionTime = e); if (e - this._lastExecutionTime < this.exectuionTimeout) return; } this._lastExecutionTime = e; for ( var n = [], r = this._tasks.values(), i = 0, o = this._tasks.size; i < o; i++ ) { var a = r.next().value; if ( a.canUnload && e - a.lastUsedTime > (a.keepAliveTime || this.keepAliveTime) && (a.unload(), (n[n.length] = a), n.length >= this.maxUnloadTask) ) { this._lastExecutionTime -= this.exectuionTimeout - this.unloadTaskShift; break; } } for (var s = 0, u = n; s < u.length; s++) { var l = u[s]; this._tasks.delete(l); } return n.length; } }), (t.prototype.clear = function () { this._tasks.clear(); }), (t.MIN_QUANT = 32), t ); })(), Ge = 2147483647, ze = 127773, He = 256, Xe = 255, Ye = 4096, qe = (function () { function t(t) { (this.seed = 0), t <= 0 && (t = (-t % (Ge - 1)) + 1), t > Ge - 1 && (t = Ge - 1), (this.seed = t); } return ( (t.prototype.next = function () { var t = (this.seed % ze) * 16807 - 2836 * ((this.seed / ze) | 0); return t <= 0 && (t += Ge), t; }), t ); })(); function Ke(t) { return t * t * (3 - 2 * t); } function We(t, e, n) { return e + t * (n - e); } var Je = (function () { function t(t, e) { (this.gradient = t), (this.lattice_selector = e); } return ( (t.prototype.noise2 = function (t, e, n) { var r = e[0] + Ye, i = 0 | r, o = i + 1, a = r - (0 | r), s = a - 1, u = e[1] + Ye, l = 0 | u, c = l + 1, h = u - (0 | u), p = h - 1; n && (i >= n.wrap_x && (i -= n.width), o >= n.wrap_x && (o -= n.width), l >= n.wrap_y && (l -= n.height), c >= n.wrap_y && (c -= n.height)), (i &= Xe), (o &= Xe), (l &= Xe), (c &= Xe); var d = this.lattice_selector[i], f = this.lattice_selector[o], g = this.lattice_selector[d + l], _ = this.lattice_selector[f + l], m = this.lattice_selector[d + c], y = this.lattice_selector[f + c], A = Ke(a), v = Ke(h), b = this.gradient[t][g], C = a * b[0] + h * b[1], I = this.gradient[t][_], E = We(A, C, s * I[0] + h * I[1]), x = this.gradient[t][m], w = a * x[0] + p * x[1], S = this.gradient[t][y], D = We(A, w, s * S[0] + p * S[1]); return We(v, E, D); }), (t.prototype.turbulence = function (t, e, n, r, i, o, a, s, u) { void 0 === u && (u = null); var l = null; if (o) { if (0 !== n[0]) { var c = Math.floor(s[0] * n[0]) / s[0], h = Math.ceil(s[0] * n[0]) / s[0]; n[0] / c < h / n[0] ? (n[0] = c) : (n[0] = h); } if (0 !== n[1]) { (c = Math.floor(s[1] * n[1]) / s[1]), (h = Math.ceil(s[1] * n[1]) / s[1]); n[1] / c < h / n[1] ? (n[1] = c) : (n[1] = h); } var p = (s[0] * n[0] + 0.5) | 0, d = (s[1] * n[1] + 0.5) | 0; l = { width: p, height: d, wrap_x: (a[0] * n[0]) | (4096 + p), wrap_y: (a[1] * n[1]) | (4096 + d), }; } for (var f = 0, g = 1, _ = [0, 0], m = 0; m < r; m++) { var y = u ? u[m] : _, A = [(e[0] + y[0]) * n[0] * g, (e[1] + y[1]) * n[1] * g], v = this.noise2(t, A, l); (f += (i ? v : Math.abs(v)) / g), (g *= 2), l && ((l.width *= 2), (l.wrap_x = 2 * l.wrap_x - Ye), (l.height *= 2), (l.wrap_y = 2 * l.wrap_y - Ye)); } return f; }), (t.fromSeed = function (e) { for ( var n, r = Array.from({ length: 514 }, function () { return 0; }), i = [], o = new qe(e), a = 0; a < 4; a++ ) { i[a] = Array.from({ length: 514 }, function () { return [0, 0]; }); for (var s = 0; s < He; s++) { r[s] = s; for (var u = 0; u < 2; u++) (e = o.next()), (o.seed = e), (i[a][s][u] = ((e % 512) - He) / He); (n = Math.sqrt( i[a][s][0] * i[a][s][0] + i[a][s][1] * i[a][s][1] )), (i[a][s][0] /= n), (i[a][s][1] /= n); } } for (s = 255; s >= 0; s--) { a = r[s]; (e = o.next()), (o.seed = e); u = e % He; (r[s] = r[u]), (r[u] = a); } for (s = 0; s < 258; s++) { r[He + s] = r[s]; for (a = 0; a < 4; a++) for (u = 0; u < 2; u++) i[a][He + s][u] = i[a][s][u]; } return new t(i, r); }), t ); })(), $e = (function () { function t() {} return ( (t.drawBitmap = function (e, n, r, i, o, a, s, u, l, c, h) { if ((void 0 === h && (h = null), h || l != i || c != o)) { h || (h = new O()).scale(l / i, c / o); var p = Math.sqrt(h.a * h.a + h.b * h.b), d = Math.sqrt(h.c * h.c + h.d * h.d), f = i * p, g = o * d; if ( ((h.tx += s), (h.ty += u), (s = Math.floor(h.tx)), (u = Math.floor(h.ty)), h.invert(), p >= 1 || d >= 1) ) for (var _ = new P(), m = s; m < s + f; m++) for (var y = u; y < u + g; y++) { (_.x = m), (_.y = y), (_ = h.transformPoint(_)); var A = t.sampleBilinear(_.x, _.y, e, i, o); t.applyPixel32(a, l, c, m, y, A); } else { var v = new P(), b = new P(); for (m = s; m < s + f; m++) for (y = u; y < u + g; y++) { (v.x = m), (v.y = y), (v = h.transformPoint(v)), (b.x = m + 1), (b.y = y + 1), (b = h.transformPoint(b)); A = t.sampleBox(v.x + n, v.y + r, b.x + n, b.y + r, e, i, o); t.applyPixel32(a, l, c, m, y, A); } } h.invert(); } else for (m = s; m < s + i; m++) for (y = u; y < u + o; y++) { A = t.sample(m - s + n, y - u + r, e, i, o); t.applyPixel32(a, l, c, m, y, A); } }), (t.applyPixel32 = function (t, e, n, r, i, o) { if ( ((r = Math.floor(r)), (i = Math.floor(i)), !(r < 0 || r >= e || i >= n || i < 0)) ) { var a = 4 * (r + i * e); (t[a] = o[0]), (t[a + 1] = o[1]), (t[a + 2] = o[2]), (t[a + 3] = o[3]), (t[a] = 255 & t[a]), (t[a + 1] = 255 & t[a + 1]), (t[a + 2] = 255 & t[a + 2]), (t[a + 3] = 255 & t[a + 3]); } }), (t.sampleBilinear = function (e, n, r, i, o, a, s) { void 0 === a && (a = 1), void 0 === s && (s = 1); var u = t.sample(e, n, r, i, o), l = t.sample(e + a, n, r, i, o), c = t.sample(e, n + s, r, i, o), h = t.sample(e + a, n + s, r, i, o), p = e; p -= Math.floor(p); var d = t.interpolateColor(u, l, p), f = t.interpolateColor(c, h, p), g = n; return (g -= Math.floor(g)), t.interpolateColor(d, f, g); }), (t.sample = function (t, e, n, r, i) { (t = Math.floor(t)), (e = Math.floor(e)); var o = [0, 0, 0, 0]; if (t < 0 || t >= r || e < 0 || e >= i) return o; var a = 4 * (t + e * r); return ( (o[0] = n[a]), (o[1] = n[a + 1]), (o[2] = n[a + 2]), (o[3] = n[a + 3]), o ); }), (t.sampleBox = function (e, n, r, i, o, a, s) { var u, l, c, h, p = 0, d = [0, 0, 0, 0], f = Math.floor(n), g = Math.ceil(i); for ( f = Math.max(Math.min(f, s - 1), 0), g = Math.max(Math.min(g, s - 1), 0), l = f; l < g; l++ ) { (h = 1), l < n && (h *= 1 - (n - l)), l > i && (h *= 1 - (l - i)); var _ = Math.floor(e), m = Math.ceil(r); for ( _ = Math.max(Math.min(_, a - 1), 0), m = Math.max(Math.min(m, a - 1), 0), u = _; u < m; u++ ) { c = h; var y = t.sample(u, l, o, a, s); u < e && (c *= 1 - (e - u)), u > r && (c *= 1 - (u - r)), (d[0] += y[0] * c), (d[1] += y[1] * c), (d[2] += y[2] * c), (d[3] += y[3] * c), (p += c); } } return ( (d[0] /= p), (d[1] /= p), (d[2] /= p), (d[3] /= p), (d[0] = 255 & d[0]), (d[1] = 255 & d[1]), (d[2] = 255 & d[2]), (d[3] = 255 & d[3]), d ); }), (t.interpolateColor = function (t, e, n) { var r = []; return ( (r[0] = t[0] + (e[0] - t[0]) * n), (r[1] = t[1] + (e[1] - t[1]) * n), (r[2] = t[2] + (e[2] - t[2]) * n), (r[3] = t[3] + (e[3] - t[3]) * n), r ); }), t ); })(), Ze = "WeakRef" in window, tn = !1; function en(t, e) { return ( void 0 === e && (e = !0), ((e ? 4278190080 & t : 4278190080) | ((255 & t) << 16) | (65280 & t) | (((16711680 & t) >> 16) & 255)) >>> 0 ); } var nn = (function (t) { function n(e, r, i, o, a, s) { void 0 === i && (i = !0), void 0 === o && (o = null), void 0 === a && (a = !0), void 0 === s && (s = null); var u = t.call(this, e, r, a) || this; return ( (u._isSymbolSource = !1), (u._isWeakRef = !1), (u._unpackPMA = !0), (u._locked = !1), (u._floodStack = []), (u._nestedBitmap = []), (u.wasUpload = !1), (u._needUpload = !1), (u.isUnloaded = !1), (u.lastUsedTime = 0), s && n.getManager(s), (u._transparent = i), (u._stage = s), null != o && u.fillRect(u._rect, o), u ); } return ( e(n, t), (n.getManager = function (t) { if (!t) return null; if (this._unloadManager) return this._unloadManager; var e = t.context.hasFence; return ( (this._unloadManager = Ve.createManager({ name: "BitmapImage2D" + (e ? "async" : ""), priority: 0, maxUnloadTasks: e ? De.MAX_BITMAP_UNLOAD_TASKS_ASYNC : De.MAX_BITMAP_UNLOAD_TASKS, exectionPeriod: 100, })), this._unloadManager ); }), (n.prototype.getDataInternal = function (t, e) { if ( (void 0 === t && (t = !0), this.applySymbol(), this._data || (!t && !this._alphaChannel) || (this._data = new Uint8ClampedArray( this.width * this.height * 4 )), this._alphaChannel) ) { for ( var n = this._alphaChannel, r = this._data, i = 0; i < n.length; i++ ) n[i] <= 1 && (r[4 * i + 0] = r[4 * i + 1] = r[4 * i + 2] = 0), (r[4 * i + 3] = n[i]); (this._alphaChannel = null), (this._transparent = !0), (this._unpackPMA = !1); } return this._data; }), Object.defineProperty(n.prototype, "sourceBitmap", { get: function () { return this._sourceBitmap; }, enumerable: !1, configurable: !0, }), (n.prototype.invalidateGPU = function () { (this._needUpload = !0), this.invalidate(); }), (n.prototype.invalidate = function () { this._needUpload && (this._locked || ((this._needUpload = !1), t.prototype.invalidate.call(this))); }), Object.defineProperty(n.prototype, "canUnload", { get: function () { return !( this._sourceBitmap || this._nestedBitmap.length || this._locked || this._isSymbolSource ); }, enumerable: !1, configurable: !0, }), (n.prototype.unmarkToUnload = function () { var t; null === (t = n.getManager(this._stage)) || void 0 === t || t.removeTask(this); }), (n.prototype.markToUnload = function () { n.getManager(this._stage) && (this._isSymbolSource || ((this.lastUsedTime = n._unloadManager.correctedTime), n._unloadManager.addTask(this))); }), (n.prototype.unload = function () { (this.lastUsedTime = -1), this.dispatchEvent(new c(n.UNLOAD_EVENT, this)), this.invalidateGPU(); }), (n.prototype.addMipLevel = function (t) { this._customMipLevels || (this._customMipLevels = []), this._customMipLevels.push(t); }), Object.defineProperty(n.prototype, "mipLevels", { get: function () { return this._customMipLevels; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "transparent", { get: function () { return this._transparent; }, set: function (t) { this._transparent = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "unpackPMA", { get: function () { return this._unpackPMA && this._transparent; }, enumerable: !1, configurable: !0, }), (n.prototype.addLazySymbol = function (t) { (this._lazySymbol = t), (this._isSymbolSource = !0), this.invalidateGPU(); }), (n.prototype.applySymbol = function () { return ( !!this._lazySymbol && (this._lazySymbol.needParse && this._lazySymbol.lazyParser(), (this._data = this._lazySymbol.definition.data), (this._unpackPMA = !this._lazySymbol.definition.isPMA), (this._lazySymbol = null), !0) ); }), (n.prototype.useWeakRef = function () { tn || ((tn = !0), (Ze = Ze && De.ENABLE_WEAK_REF) && console.debug( "[ImageBitmap2D Experemental] Use WeakRef for ImageBitmap2D" )), Ze && !this._isWeakRef && ((this._isWeakRef = !0), this._finalizer || (this._finalizer = new FinalizationRegistry( this.onAdapterDropped.bind(this) )), (this.adapter = this._adapter)); }), (n.prototype.unuseWeakRef = function () { this._isWeakRef && ((this._isWeakRef = !1), this._finalizer.unregister(this), (this._weakRefAdapter = null), (this.adapter = this._adapter)); }), Object.defineProperty(n.prototype, "isWeakRef", { get: function () { return this._isWeakRef; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "adapter", { get: function () { return ( (this._weakRefAdapter ? this._weakRefAdapter.deref() : this._adapter) || this ); }, set: function (t) { this._isWeakRef ? (this._finalizer.unregister(this), t ? ((this._weakRefAdapter = new WeakRef(t)), this._finalizer.register(t, this.id, this)) : (this._weakRefAdapter = null), (this._adapter = null)) : (this._adapter = t); }, enumerable: !1, configurable: !0, }), (n.prototype.onAdapterDropped = function (t) { console.debug( "[ImageBitmap2D Experemental] Disposing adaptee, GC runs for:", t ), this.dispose(); }), (n.prototype.addNestedReference = function (t) { this._sourceBitmap ? this._sourceBitmap.addNestedReference(t) : (this._nestedBitmap.push(t), (t._sourceBitmap = this)); }), (n.prototype.dropNestedReference = function (t) { var e = this._nestedBitmap.indexOf(t); return e > -1 && !!this._nestedBitmap.splice(e, 1); }), (n.prototype.dropAllReferences = function (t) { if ((void 0 === t && (t = !0), this._nestedBitmap.length)) { for (var e = 0, n = this._nestedBitmap; e < n.length; e++) { n[e].dropAllReferences(!1); } this._nestedBitmap.length = 0; } if (this._sourceBitmap) { var r = this._sourceBitmap; (this._sourceBitmap = null), t && r.dropNestedReference(this), this.deepClone(r); } }), (n.prototype.deepClone = function (t) { this.setPixels(this._rect, t.data), this.invalidateGPU(); }), (n.prototype.copyTo = function (t) { return t.deepClone(this), t; }), (n.prototype.clone = function () { var t = new n( this._rect.width, this._rect.height, this._transparent, null, this._powerOfTwo ); return t.deepClone(this), t; }), (n.prototype.colorTransform = function (t, e) { var n, r, i; this.dropAllReferences(); var o = this.data; for (n = 0; n < t.width; ++n) for (r = 0; r < t.height; ++r) (o[(i = 4 * (n + t.x + (r + t.y) * this._rect.width))] = o[i] * e.redMultiplier + e.redOffset), (o[i + 1] = o[i + 1] * e.greenMultiplier + e.greenOffset), (o[i + 2] = o[i + 2] * e.blueMultiplier + e.blueOffset), (o[i + 3] = o[i + 3] * e.alphaMultiplier + e.alphaOffset); this.invalidateGPU(); }), (n.prototype.copyChannel = function (t, e, n, r, i) { this.dropAllReferences(); var o, a, s, u = t.data, l = this.data, c = Math.round(Math.log(r) / Math.log(2)), h = Math.round(Math.log(i) / Math.log(2)), p = Math.round(e.x), d = Math.round(e.y), f = Math.round(n.x), g = Math.round(n.y); for (o = 0; o < e.width; ++o) for (a = 0; a < e.height; ++a) (s = 4 * (o + p + (a + d) * t.width)), (l[4 * (o + f + (a + g) * this._rect.width) + h] = u[s + c]); this.invalidateGPU(); }), (n.prototype.merge = function (t, e, n, r, i, o, a) { this.dropAllReferences(); var s, u, l, c = this.getDataInternal(!0), h = t.data; for (r = ~~r, i = ~~i, o = ~~o, a = ~~a, s = 0; s < e.width; ++s) for (u = 0; u < e.height; ++u) (c[(l = 4 * (s + e.x + (u + e.y) * this.width))] = ~~( (h[l] * r + c[l] * (256 - r)) / 256 )), (c[l + 1] = ~~((h[l + 1] * i + c[l + 1] * (256 - i)) / 256)), (c[l + 2] = ~~((h[l + 2] * o + c[l + 2] * (256 - o)) / 256)), (c[l + 3] = ~~((h[l + 3] * a + c[l + 3] * (256 - a)) / 256)); this.invalidateGPU(); }), (n.prototype.dispose = function () { var t; null === (t = n.getManager(this._stage)) || void 0 === t || t.removeTask(this), this._isWeakRef && this._finalizer.unregister(this), this.dropAllReferences(), (this._data = null), (this._rect = null), (this._transparent = null), (this._locked = null), (this._isDisposed = !0), this.clear(); }), (n.prototype.getColorBoundsRect = function (t, e, n) { void 0 === n && (n = !0); var r = new Uint32Array(this.getDataInternal(!0).buffer), i = this.rect; (e = en(e, this._transparent)), (t = en(t, this._transparent)); for ( var o = i.width, a = i.height, s = 0, u = 0, l = !1, c = 0; c < i.height; c++ ) for (var h = 0; h < i.width; h++) { var p = r[c * i.width + h]; (((p = (p & t) >>> 0) === e && n) || (p !== e && !n)) && ((l = !0), (o = h < o ? h : o), (s = h > s ? h : s), (a = c < a ? c : a), (u = c > u ? c : u)); } return l ? new K(o, a, s - o + 1, u - a + 1) : new K(0, 0, 0, 0); }), (n.prototype.hitTest = function (t, e, n, r, i) { if (n instanceof P) return ((this.getPixel32(n.x - t.x, n.y - t.y) >> 24) & 255) >= e; if (n instanceof K) { if ( (((n = n.clone()).x -= t.x), (n.y -= t.y), !this._rect.intersects(n)) ) return !1; for (var o = n.y; o < n.bottom; o++) for (var a = n.x; a < n.right; a++) { if (((this.getPixel32(a, o) >> 24) & 255) >= e) return !0; } } else null !== n && console.warn( "[BitmapImage2D] HitTest not implemented for:", n.assetType ); return !1; }), (n.prototype.floodFill = function (t, e, n) { this.dropAllReferences(); var r = t, i = e; (t |= 0), (e |= 0); var o = new Uint32Array(this.getDataInternal(!0).buffer), a = this._rect.width, s = this._rect.height, u = this._floodStack; u.length = a * s * 2; var l = o[t + e * a], c = w.float32ColorToARGB(n), h = c[0], p = c[1], d = c[2], f = c[3], g = (((h = this._transparent ? h : 255) << 24) | ((f = ((f * h) / 255) | 0) << 16) | ((d = ((d * h) / 255) | 0) << 8) | (p = ((p * h) / 255) | 0)) >>> 0; if (g !== l) { var _, m, y = 0, A = 0; for (u[A++] = t, u[A++] = e; A > 0; ) { if (A / 2 > o.length) throw ( "[BitmapImage2D] FloodFill bug, to many interation: " + r + ":" + i ); for (e = u[--A], y = t = u[--A]; y >= 0 && o[e * a + y] === l; ) y--; for (y++, _ = m = !1; y < a && o[e * a + y] === l; ) (o[e * a + y] = g), !_ && e > 0 && o[(e - 1) * a + y] === l ? ((u[A++] = y), (u[A++] = e - 1), (_ = !0)) : _ && e > 0 && o[(e - 1) * a + y] !== l && (_ = !1), !m && e < s - 1 && o[(e + 1) * a + y] === l ? ((u[A++] = y), (u[A++] = e + 1), (m = !0)) : m && e < s - 1 && o[(e + 1) * a + y] !== l && (m = !1), y++; } this.invalidateGPU(); } }), (n.prototype.perlinNoise = function (t, e, n, r, i, o, a, s, u) { void 0 === a && (a = 7), void 0 === s && (s = !1), void 0 === u && (u = null); var l = this.width, c = this.height, h = this.getDataInternal(!0, !0), p = Je.fromSeed(r), d = null; if (u) if (((d = []), "number" == typeof u[0])) for (var f = 0; f < u.length; f += 2) d[f / 2] = [u[f + 0], u[f + 1]]; else if (u[0] instanceof P) for (f = 0; f < u.length; f += 2) d[f / 2] = [u[f].x, u[f].y]; for (var g = 0; g < c; g++) for (var _ = 0; _ < l; _++) { var m = [0, 0, 0, 0], y = 4 * (_ + g * l); if (s) (m[0] = p.turbulence( 0, [_, g], [1 / t, 1 / e], n, o, i, [0, 0], [l, c], d )), (m[1] = m[2] = m[0]), (m[3] = 1), 0 != (8 & a) && (m[3] = p.turbulence( 1, [_, g], [1 / t, 1 / e], n, o, i, [0, 0], [l, c], d )); else for (var A = 0; A < 4; A++) (m[A] = 3 === A ? 1 : -1), 0 != (a & (1 << A)) && (m[A] = p.turbulence( A, [_, g], [1 / t, 1 / e], n, o, i, [0, 0], [l, c], d )); for (f = 0; f < 4; f++) { var v = 0; (v = o ? (255 * m[f] + 255 + 0.5) / 2 : 255 * m[f] + 0.5), (h[y + f] = 0 | v), this._transparent || (h[y + 3] = 255); } } this.invalidateGPU(); }), (n.prototype.drawBitmap = function (t, e, n, r, i, o) { void 0 === o && (o = null), this.dropAllReferences(), $e.drawBitmap( t, e, n, r, i, this.data, 0, 0, this._rect.width, this._rect.height, o ), this.invalidateGPU(); }), (n.prototype.fillRect = function (t, e) { if ((this.dropAllReferences(), !this._data)) try { this._data = new Uint8ClampedArray(this.width * this.height * 4); } catch (t) { console.error(this.width, this.height); } var n = ~~t.x, r = ~~t.y, i = ~~t.width, o = ~~t.height, a = new Uint32Array(this._data.buffer), s = 0; if (this._transparent) { var u = w.float32ColorToARGB(e), l = u[0], c = u[1], h = u[2], p = u[3]; (s = w.ARGBtoFloat32( l, ((p * l) / 255) | 0, ((h * l) / 255) | 0, ((c * l) / 255) | 0 ) >>> 0), (this._unpackPMA = !1); } else s = en(16777215 & e, !1); if ( 0 == n && 0 == r && i == this._rect.width && o == this._rect.height ) a.fill(s); else { var d = void 0, f = void 0; for (d = 0; d < o; ++d) (f = n + (d + r) * this._rect.width), a.fill(s, f, f + i); } this.invalidateGPU(); }), (n.prototype.getPixel = function (t, e) { if (!this._rect.contains(t, e)) return 0; var n = 4 * (~~t + ~~e * this._rect.width), r = this._data, i = r[n + 0], o = r[n + 1], a = r[n + 2], s = r[n + 3]; return s ? (((255 * i) / s) << 16) | (((255 * o) / s) << 8) | ((255 * a) / s) : 0; }), (n.prototype.getPixel32 = function (t, e) { if (!this._rect.contains(t, e)) return 0; var n = 4 * (~~t + ~~e * this._rect.width), r = this.getDataInternal(!0), i = r[n++], o = r[n++], a = r[n++], s = r[n]; return s ? ((s << 24) | (((255 * i) / s) << 16) | (((255 * o) / s) << 8) | ((255 * a) / s)) >>> 0 : 0; }), (n.prototype.getPixels = function (t) { if (t.equals(this._rect)) return this.getDataInternal(!0, !1); for ( var e, n = this.getDataInternal(!0, !1), r = new Uint8ClampedArray(t.width * t.height * 4), i = 0 | t.x, o = 0 | t.y, a = 0 | t.width, s = 0 | t.height, u = 0; u < s; ++u ) (e = i + (u + o) * this._rect.width), r.set(n.subarray(4 * e, 4 * (e + a)), u * a * 4); return r; }), (n.prototype.getPixelData = function (t, e, n) { var r = 4 * (t + e * this._rect.width), i = this.getDataInternal(!0); (n[0] = i[r++]), (n[1] = i[r++]), (n[2] = i[r++]), (n[3] = i[r]); }), (n.prototype.setPixelData = function (t, e, n) { this.dropAllReferences(); var r = 4 * (t + e * this._rect.width), i = this.getDataInternal(!0); (i[r + 0] = n[0]), (i[r + 1] = n[1]), (i[r + 2] = n[2]), (i[r + 3] = this._transparent ? n[3] : 255), this.invalidateGPU(); }), (n.prototype.lock = function () { this._locked || (this._locked = !0); }), (n.prototype.setArray = function (t, e) { var n, r, i, o; this.dropAllReferences(); var a = this.getDataInternal(!0); for (n = 0; n < t.width; ++n) for (r = 0; r < t.height; ++r) (o = w.float32ColorToARGB(e[n + r * t.width])), (a[(i = 4 * (n + t.x + (r + t.y) * this._rect.width)) + 0] = o[1]), (a[i + 1] = o[2]), (a[i + 2] = o[3]), (a[i + 3] = this._transparent ? o[0] : 255); this.invalidateGPU(); }), (n.prototype.setPixel = function (t, e, n) { if (this._rect.contains(t, e)) { this.dropAllReferences(); var r = 4 * (~~t + ~~e * this._rect.width), i = w.float32ColorToARGB(n), o = this.getDataInternal(!0); (o[r + 0] = i[1]), (o[r + 1] = i[2]), (o[r + 2] = i[3]), (o[r + 3] = 255), this.invalidateGPU(); } }), (n.prototype.setPixelFromArray = function (t, e, n) { this.dropAllReferences(); var r = 4 * (t + e * this._rect.width), i = this.getDataInternal(!0); (i[r + 0] = (n[1] * n[0]) | 0), (i[r + 1] = (n[2] * n[0]) | 0), (i[r + 2] = (n[3] * n[0]) | 0), (i[r + 3] = (255 * n[0]) | 0), (this._unpackPMA = !1), this.invalidateGPU(); }), (n.prototype.setPixel32 = function (t, e, n) { if (this._rect.contains(t, e)) { this.dropAllReferences(); var r = 4 * (~~t + ~~e * this._rect.width), i = w.float32ColorToARGB(n), o = this.getDataInternal(!0), a = this._transparent ? i[0] / 255 : 1; (o[r + 0] = (i[1] * a) | 0), (o[r + 1] = (i[2] * a) | 0), (o[r + 2] = (i[3] * a) | 0), (o[r + 3] = this._transparent ? i[0] : 255), this.invalidateGPU(); } }), (n.prototype.setPixels = function (t, e) { this.dropAllReferences(); var n = this.getDataInternal(!0); if (t.equals(this._rect)) n.set(e), (this._unpackPMA = !1); else { for ( var r = this._rect.width, i = t.width, o = 0; o < t.height; ++o ) n.set( e.subarray(o * i * 4, (o + 1) * i * 4), 4 * (t.x + (o + t.y) * r) ); console.warn( "[BitmapImage2D] Mixed texture mode - array should be a PMA.", this.id ); } this.invalidateGPU(); }), (n.prototype.applyFilter = function (t, e, n, r) { return !1; }), (n.prototype.unlock = function () { this._locked && ((this._locked = !1), this.invalidate()); }), Object.defineProperty(n.prototype, "alphaChannel", { set: function (t) { if ((this.dropAllReferences(), t)) { if (t.length !== this.width * this.height) throw "error when trying to merge the alpha channel into the image.the length of the alpha channel should be 1/4 of the length of the imageData"; if (this._data && this.wasUpload) { for (var e = this._alphaChannel, n = 0; n < e.length; n++) this._data[4 * n + 3] = e[n]; return (this._unpackPMA = !1), void this.invalidateGPU(); } (this._alphaChannel = t), (this._unpackPMA = !1); } }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "data", { get: function () { return this.getDataInternal(!0); }, enumerable: !1, configurable: !0, }), (n.prototype._setSize = function (e, n) { this.dropAllReferences(); var r = this.data; this._data = new Uint8ClampedArray(4 * e * n); for ( var i = this._rect.width < e ? this._rect.width : e, o = this._rect.height < n ? this._rect.height : n, a = 0; a < o; ++a ) this._data.set(r.subarray(a * i * 4, (a + 1) * i * 4), a * e * 4); t.prototype._setSize.call(this, e, n); }), (n.UNLOAD_EVENT = "unload"), (n.assetType = "[image BitmapImage2D]"), n ); })(ke), rn = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.onUnload = function () { r._texture && (r._texture.dispose(), (r._texture = null), (r._invalid = !0), (r._asset.wasUpload = !1)); }), r._asset.addEventListener(nn.UNLOAD_EVENT, r.onUnload), r ); } return ( e(n, t), (n.prototype.onClear = function (e) { this._asset.removeEventListener(nn.UNLOAD_EVENT, this.onUnload), t.prototype.onClear.call(this, e); }), (n.prototype.getTexture = function () { var e = this._asset; if (e.isDisposed) throw "Illegal upload of disposed BitmapImage2D:" + e.id; var n = e.sourceBitmap; if (n) return n.getAbstraction(this._stage).getTexture(); e.markToUnload(), t.prototype.getTexture.call(this); var r = e.getDataInternal(!1, !0), i = this._texture; if (this._invalid && r) { i.uploadFromArray(new Uint8Array(r.buffer), 0, e.unpackPMA), (e.wasUpload = !0); var o = e.mipLevels; if (o && o.length > 0) { for (var a = 0; a < o.length; a++) i.uploadFromArray( new Uint8Array(o[a].data.buffer), a + 1, e.transparent ); (this._mipmap = !0), (this._invalidMipmaps = !1); } else this._invalidMipmaps = !0; } return (this._invalid = !1), this._texture; }), n ); })(Ue), on = (function () { function t() {} return (t.ALPHA = 8), (t.BLUE = 4), (t.GREEN = 2), (t.RED = 1), t; })(), an = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this, 1, 1) || this; return ( (r._specularSource = e), (r._glossSource = n), (r._output = new nn(1, 1, !1, 16777215)), r._testSize(), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "specularSource", { get: function () { return this._specularSource; }, set: function (t) { this._specularSource != t && ((this._specularSource = t), this.invalidate(), this._testSize()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "glossSource", { get: function () { return this._glossSource; }, set: function (t) { this._glossSource != t && ((this._glossSource = t), this.invalidate(), this._testSize()); }, enumerable: !1, configurable: !0, }), (n.prototype.clone = function () { return new n(this._specularSource, this._glossSource); }), (n.prototype.dispose = function () { t.prototype.dispose.call(this), (this._rect = null), this._output.dispose(); }), Object.defineProperty(n.prototype, "data", { get: function () { var t = new P(); return ( this._output.fillRect(this._rect, 16777215), this._glossSource && this._output.copyChannel( this._glossSource, this._rect, t, on.GREEN, on.GREEN ), this._specularSource && this._output.copyChannel( this._specularSource, this._rect, t, on.RED, on.RED ), this._output.data ); }, enumerable: !1, configurable: !0, }), (n.prototype._setSize = function (e, n) { t.prototype._setSize.call(this, e, n), this._output._setSize(e, n); }), (n.prototype._testSize = function () { var t, e; this._specularSource ? ((t = this._specularSource.width), (e = this._specularSource.height)) : this._glossSource ? ((t = this._glossSource.width), (e = this._glossSource.height)) : ((t = 1), (e = 1)), t != this._output.width && e != this._output.height && (this._output.dispose(), (this._output = new nn(t, e, !1, 16777215))), this._setSize(t, e); }), (n.assetType = "[asset SpecularImage2D]"), n ); })(ke), sn = (function (t) { function n(e) { var n = t.call(this) || this; return (n._size = e), n._testDimensions(), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "size", { get: function () { return this._size; }, set: function (t) { this._size != t && this._setSize(this._size); }, enumerable: !1, configurable: !0, }), (n.prototype._setSize = function (t) { this._size != t && this.clear(), (this._size = t), this._testDimensions(); }), (n.prototype._testDimensions = function () { if (!Ne.isDimensionValid(this._size)) throw new Error( "Invalid dimension: Width and height must be power of 2 and cannot exceed 2048" ); }), (n.assetType = "[image ImageCube]"), n ); })(Re), un = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.getType = function () { return "cube"; }), (n.prototype._createTexture = function () { this._texture = this._stage.context.createCubeTexture( this._asset.size, re.BGRA, !1 ); }), n ); })(Fe), ln = (function (t) { function n(e, n, r) { void 0 === n && (n = !0), void 0 === r && (r = null); var i = t.call(this, e) || this; (i._data = new Array(6)), (i._locked = !1), (i._transparent = n); for (var o = 0; o < 6; o++) (i._data[o] = new Uint8ClampedArray(4 * i._size * i._size)), null != r && i.fillRect(o, new K(0, 0, e, e), r); return i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "transparent", { get: function () { return this._transparent; }, set: function (t) { this._transparent = t; }, enumerable: !1, configurable: !0, }), (n.prototype.clone = function () { for (var t = new n(this._size, this.transparent), e = 0; e < 6; e++) t.setPixels(e, new K(0, 0, this._size, this._size), this.data[e]); return t; }), (n.prototype.colorTransform = function (t, e, n) { var r, i, o, a = this.data[t]; for (r = 0; r < e.width; ++r) for (i = 0; i < e.height; ++i) (a[(o = 4 * (r + e.x + (i + e.y) * this._size))] = a[o] * n.redMultiplier + n.redOffset), (a[o + 1] = a[o + 1] * n.greenMultiplier + n.greenOffset), (a[o + 2] = a[o + 2] * n.blueMultiplier + n.blueOffset), (a[o + 3] = a[o + 3] * n.alphaMultiplier + n.alphaOffset); this._locked || this.invalidate(); }), (n.prototype.copyChannel = function (t, e, n, r, i, o) { var a, s, u, l = e.data, c = this._data[t], h = Math.round(Math.log(i) / Math.log(2)), p = Math.round(Math.log(o) / Math.log(2)), d = Math.round(n.x), f = Math.round(n.y), g = Math.round(r.x), _ = Math.round(r.y); for (a = 0; a < n.width; ++a) for (s = 0; s < n.height; ++s) (u = 4 * (a + d + (s + f) * e.width)), (c[4 * (a + g + (s + _) * this._size) + p] = l[u + h]); this._locked || this.invalidate(); }), (n.prototype.dispose = function () { t.prototype.dispose.call(this); for (var e = 0; e < 6; e++) this._data[e] = null; (this._transparent = null), (this._locked = null); }), (n.prototype.drawBitmap = function (t, e, n, r, i, o, a) { void 0 === a && (a = null), $e.drawBitmap( e, n, r, i, o, this.data[t], 0, 0, this._size, this._size, a ), this._locked || this.invalidate(); }), (n.prototype.fillRect = function (t, e, n) { var r = new Uint32Array(this._data[t].buffer), i = ~~e.x, o = ~~e.y, a = ~~e.width, s = ~~e.height, u = this._transparent ? 4294967295 & n : 4278190080 + (16777215 & n); if (0 == i && 0 == o && a == this._size && s == this._size) r.fill(u); else { var l = void 0, c = void 0; for (l = 0; l < s; ++l) (c = i + (l + o) * this._size), r.fill(u, c, c + a); } this._locked || this.invalidate(); }), (n.prototype.getPixel = function (t, e, n) { var r, i, o, a, s = 4 * (~~e + ~~n * this._size), u = this.data[t]; return ( (r = u[s + 0]), (i = u[s + 1]), (o = u[s + 2]), (a = u[s + 3]) ? (((255 * r) / a) << 16) | (((255 * i) / a) << 8) | ((255 * o) / a) : 0 ); }), (n.prototype.getPixel32 = function (t, e, n) { var r, i, o, a, s = 4 * (~~e + ~~n * this._size), u = this.data[t]; return ( (r = u[s++]), (i = u[s++]), (o = u[s++]), (a = u[s]) ? (a << 24) | (((255 * r) / a) << 16) | (((255 * i) / a) << 8) | ((255 * o) / a) : 0 ); }), (n.prototype.lock = function () { this._locked || (this._locked = !0); }), (n.prototype.setArray = function (t, e, n) { var r, i, o, a, s = this.data[t]; for (r = 0; r < e.width; ++r) for (i = 0; i < e.height; ++i) (a = w.float32ColorToARGB(n[r + i * e.width])), (s[(o = 4 * (r + e.x + (i + e.y) * this._size)) + 0] = a[1]), (s[o + 1] = a[2]), (s[o + 2] = a[3]), (s[o + 3] = this._transparent ? a[0] : 255); this._locked || this.invalidate(); }), (n.prototype.setPixel = function (t, e, n, r) { var i = 4 * (~~e + ~~n * this._size), o = w.float32ColorToARGB(r), a = this.data[t]; (a[i + 0] = o[1]), (a[i + 1] = o[2]), (a[i + 2] = o[3]), (a[i + 3] = 255), this._locked || this.invalidate(); }), (n.prototype.setPixel32 = function (t, e, n, r) { var i = 4 * (~~e + ~~n * this._size), o = w.float32ColorToARGB(r), a = this.data[t]; (a[i + 0] = o[1]), (a[i + 1] = o[2]), (a[i + 2] = o[3]), (a[i + 3] = this._transparent ? o[0] : 255), this._locked || this.invalidate(); }), (n.prototype.setPixels = function (t, e, n) { if ( 0 == e.x && 0 == e.y && e.width == this._size && e.height == this._size ) this._data[t].set(n); else { var r = void 0, i = this._size, o = e.width, a = this._data[t]; for (r = 0; r < e.height; ++r) a.set( n.subarray(r * o * 4, (r + 1) * o * 4), 4 * (e.x + (r + e.y) * i) ); } this._locked || this.invalidate(); }), (n.prototype.unlock = function () { this._locked && ((this._locked = !1), this.invalidate()); }), Object.defineProperty(n.prototype, "data", { get: function () { return this._data; }, enumerable: !1, configurable: !0, }), (n.prototype._setSize = function (e) { for (var n = 0; n < 6; n++) { var r = this.data[n]; this._data[n] = new Uint8ClampedArray(4 * e * e); for (var i = this._size < e ? this._size : e; 0 < i; ++n) this._data[n].set(r.subarray(0 * i * 4, 1 * i * 4), 0 * e * 4); } t.prototype._setSize.call(this, e); }), (n.assetType = "[image BitmapImageCube]"), (n.posX = 0), (n.negX = 1), (n.posY = 2), (n.negY = 3), (n.posZ = 4), (n.negZ = 5), n ); })(sn), cn = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.getTexture = function () { if ((t.prototype.getTexture.call(this), this._invalid)) { this._invalid = !1; for (var e = 0; e < 6; ++e) this._texture.uploadFromArray( new Uint8Array(this._asset.data[e].buffer), e, 0, this._asset.transparent ); this._invalidMipmaps = !0; } return this._texture; }), n ); })(un), hn = (function (t) { function n(e) { var n = t.call(this, 8, 8, !0) || this; return (n._urlRequest = e), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "urlRequest", { get: function () { return this._urlRequest; }, set: function (t) { this._urlRequest = t; }, enumerable: !1, configurable: !0, }), (n.prototype.clone = function () { return new n(this._urlRequest); }), (n.assetType = "[image ExternalImage2D]"), n ); })(ke), pn = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.getTexture = function () { return ( t.prototype.getTexture.call(this), this._invalid && ((this._invalid = !1), this._texture.uploadFromURL(this._asset.urlRequest, 0), (this._invalidMipmaps = !0)), this._texture ); }), n ); })(Ue), dn = (function () { function t() {} return ( (t.ADD = "add"), (t.ALPHA = "alpha"), (t.DARKEN = "darken"), (t.DIFFERENCE = "difference"), (t.ERASE = "erase"), (t.HARDLIGHT = "hardlight"), (t.INVERT = "invert"), (t.LAYER = "layer"), (t.LIGHTEN = "lighten"), (t.MULTIPLY = "multiply"), (t.NORMAL = "normal"), (t.OVERLAY = "overlay"), (t.SCREEN = "screen"), (t.SHADER = "shader"), (t.SUBTRACT = "subtract"), t ); })(), fn = (function () { function t(e, n, r) { void 0 === r && (r = -1), (this._component = r), (this._regName = e), (this._index = n), (this._toStr = this._regName), this._index >= 0 && (this._toStr += this._index), r > -1 && (this._toStr += "." + t.COMPONENTS[r]); } return ( (t.prototype.toString = function () { return this._toStr; }), Object.defineProperty(t.prototype, "regName", { get: function () { return this._regName; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "index", { get: function () { return this._index; }, enumerable: !1, configurable: !0, }), (t.COMPONENTS = ["x", "y", "z", "w"]), t ); })(), gn = (function () { function t(t, e, n) { void 0 === n && (n = !0), (this._regName = t), (this._regCount = e), (this._persistent = n), this.initRegisters(t, e); } return ( (t.prototype.requestFreeVectorReg = function () { for (var t = 0; t < this._regCount; ++t) if (!this.isRegisterUsed(t)) return ( this._persistent && this._usedVectorCount[t]++, this._vectorRegisters[t] ); throw new Error("Register overflow!"); }), (t.prototype.requestFreeRegComponent = function () { for (var t = 0; t < this._regCount; ++t) if (!(this._usedVectorCount[t] > 0)) for (var e = 0; e < 4; ++e) if (0 == this._usedSingleCount[e][t]) return ( this._persistent && this._usedSingleCount[e][t]++, this._registerComponents[e][t] ); throw new Error("Register overflow!"); }), (t.prototype.addUsage = function (t, e) { t._component > -1 ? (this._usedSingleCount[t._component][t.index] += e) : (this._usedVectorCount[t.index] += e); }), (t.prototype.removeUsage = function (t) { if (t._component > -1) { if (--this._usedSingleCount[t._component][t.index] < 0) throw new Error("More usages removed than exist!"); } else if (--this._usedVectorCount[t.index] < 0) throw new Error("More usages removed than exist!"); }), (t.prototype.dispose = function () { (this._vectorRegisters = null), (this._registerComponents = null), (this._usedSingleCount = null), (this._usedVectorCount = null); }), (t.prototype.hasRegisteredRegs = function () { for (var t = 0; t < this._regCount; ++t) if (this.isRegisterUsed(t)) return !0; return !1; }), (t.prototype.initRegisters = function (e, n) { var r = t._initPool(e, n); (this._vectorRegisters = t._regPool[r]), (this._registerComponents = t._regCompsPool[r]), (this._usedVectorCount = this._initArray(Array(n), 0)), (this._usedSingleCount = new Array(4)), (this._usedSingleCount[0] = this._initArray(new Array(n), 0)), (this._usedSingleCount[1] = this._initArray(new Array(n), 0)), (this._usedSingleCount[2] = this._initArray(new Array(n), 0)), (this._usedSingleCount[3] = this._initArray(new Array(n), 0)); }), (t._initPool = function (e, n) { var r = e + n; if (null != t._regPool[r]) return r; var i = new Array(n); t._regPool[r] = i; var o = [[], [], [], []]; t._regCompsPool[r] = o; for (var a = 0; a < n; ++a) { i[a] = new fn(e, a); for (var s = 0; s < 4; ++s) o[s][a] = new fn(e, a, s); } return r; }), (t.prototype.isRegisterUsed = function (t) { if (this._usedVectorCount[t] > 0) return !0; for (var e = 0; e < 4; ++e) if (this._usedSingleCount[e][t] > 0) return !0; return !1; }), (t.prototype._initArray = function (t, e) { for (var n = t.length, r = 0; r < n; r++) t[r] = e; return t; }), (t._regPool = new Object()), (t._regCompsPool = new Object()), t ); })(), _n = (function () { function t(t) { (this._numUsedVertexConstants = 0), (this._numUsedFragmentConstants = 0), (this._numUsedStreams = 0), (this._numUsedTextures = 0), (this._numUsedVaryings = 0), (this._profile = t), this.reset(); } return ( (t.prototype.reset = function () { (this._fragmentTempCache = new gn("ft", 8, !1)), (this._vertexTempCache = new gn("vt", 8, !1)), (this._varyingCache = new gn("v", 8)), (this._textureCache = new gn("fs", 8)), (this._vertexAttributesCache = new gn("va", 8)), (this._fragmentConstantsCache = new gn("fc", 28)), (this._vertexConstantsCache = new gn("vc", 128)), (this._fragmentOutputRegister = new fn("oc", -1)), (this._vertexOutputRegister = new fn("op", -1)), (this._numUsedVertexConstants = 0), (this._numUsedStreams = 0), (this._numUsedTextures = 0), (this._numUsedVaryings = 0), (this._numUsedFragmentConstants = 0); }), (t.prototype.dispose = function () { this._fragmentTempCache.dispose(), this._vertexTempCache.dispose(), this._varyingCache.dispose(), this._fragmentConstantsCache.dispose(), this._vertexAttributesCache.dispose(), (this._fragmentTempCache = null), (this._vertexTempCache = null), (this._varyingCache = null), (this._fragmentConstantsCache = null), (this._vertexAttributesCache = null), (this._fragmentOutputRegister = null), (this._vertexOutputRegister = null); }), (t.prototype.addFragmentTempUsages = function (t, e) { this._fragmentTempCache.addUsage(t, e); }), (t.prototype.removeFragmentTempUsage = function (t) { this._fragmentTempCache.removeUsage(t); }), (t.prototype.addVertexTempUsages = function (t, e) { this._vertexTempCache.addUsage(t, e); }), (t.prototype.removeVertexTempUsage = function (t) { this._vertexTempCache.removeUsage(t); }), (t.prototype.getFreeFragmentVectorTemp = function () { return this._fragmentTempCache.requestFreeVectorReg(); }), (t.prototype.getFreeFragmentSingleTemp = function () { return this._fragmentTempCache.requestFreeRegComponent(); }), (t.prototype.getFreeVarying = function () { return ( ++this._numUsedVaryings, this._varyingCache.requestFreeVectorReg() ); }), (t.prototype.getFreeFragmentConstant = function () { return ( ++this._numUsedFragmentConstants, this._fragmentConstantsCache.requestFreeVectorReg() ); }), (t.prototype.getFreeVertexConstant = function () { return ( ++this._numUsedVertexConstants, this._vertexConstantsCache.requestFreeVectorReg() ); }), (t.prototype.getFreeVertexVectorTemp = function () { return this._vertexTempCache.requestFreeVectorReg(); }), (t.prototype.getFreeVertexSingleTemp = function () { return this._vertexTempCache.requestFreeRegComponent(); }), (t.prototype.getFreeVertexAttribute = function () { return ( ++this._numUsedStreams, this._vertexAttributesCache.requestFreeVectorReg() ); }), (t.prototype.getFreeTextureReg = function () { return ( ++this._numUsedTextures, this._textureCache.requestFreeVectorReg() ); }), Object.defineProperty(t.prototype, "fragmentOutputRegister", { get: function () { return this._fragmentOutputRegister; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedVertexConstants", { get: function () { return this._numUsedVertexConstants; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedFragmentConstants", { get: function () { return this._numUsedFragmentConstants; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedStreams", { get: function () { return this._numUsedStreams; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedTextures", { get: function () { return this._numUsedTextures; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedVaryings", { get: function () { return this._numUsedVaryings; }, enumerable: !1, configurable: !0, }), t ); })(), mn = (function () { function t(t) { void 0 === t && (t = !1), (this._vertexConstantData = new Float32Array([ 0, 0, 0, 0, 0, 0, 0, 0, ])), (this._isValid = !0), (this.activateInternaly = !1), (this.sourceSamplerIndex = 0), (this._program3DInvalid = !0), (this.inputRect = new K()), (this.destRect = new K()), (this.needClear = !1), (this._requireDepthRender = t), (this._registerCache = new _n(Zt.BASELINE)); } return ( Object.defineProperty(t.prototype, "isValid", { get: function () { return this._isValid; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "source", { get: function () { return this._source; }, set: function (t) { this._source = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "target", { get: function () { return this._target; }, set: function (t) { this._target = t; }, enumerable: !1, configurable: !0, }), (t.prototype.dispose = function () { this._program3D && this._program3D.dispose(); }), (t.prototype.invalidateProgram = function () { this._program3DInvalid = !0; }), (t.prototype.updateProgram = function (t) { this._program3D && this._program3D.dispose(), (this._program3D = t.context.createProgram()), this._registerCache.reset(); var e = new ve().assemble( "part vertex 1\n" + this.getVertexCode() + "endpart" ).vertex.data, n = new ve().assemble( "part fragment 1\n" + this.getFragmentCode() + "endpart" ).fragment.data; (this._program3D.name = this.constructor.name), this._program3D.upload(e, n), (this._program3DInvalid = !1); }), (t.prototype.getVertexCode = function () { var t = this._registerCache.getFreeVertexVectorTemp(), e = this._registerCache.getFreeVertexConstant(), n = this._registerCache.getFreeVertexAttribute(); this._positionIndex = n.index; var r = this._registerCache.getFreeVertexConstant(); return ( (this._uvVarying = this._registerCache.getFreeVarying()), "mul " + t + ".xy, " + n + ", " + e + ".zw\nadd " + t + ".xy, " + t + ", " + e + ".xy\nmov " + t + ".w, " + n + ".w\nmov op, " + t + "\nmul " + t + ".xy, " + n + ", " + r + ".zw\nadd " + this._uvVarying + ", " + t + ", " + r + ".xy\n" ); }), (t.prototype.getFragmentCode = function () { throw new u(); }), (t.prototype.getProgram = function (t) { return ( this._program3DInvalid && this.updateProgram(t), this._program3D ); }), (t.prototype.computeVertexData = function () { var t = this._vertexConstantData, e = this.destRect, n = this.inputRect, r = this._target, i = this._source; n.width * n.height == 0 && ((n.width = this._source.width), (n.height = this._source.height)), e.width * e.height == 0 && ((e.width = n.width), (e.height = n.height)), (t[0] = (2 * e.x) / r.width - 1), (t[1] = (2 * e.y) / r.height - 1), (t[2] = (2 * e.width) / r.width), (t[3] = (2 * e.height) / r.height), (t[4] = n.x / i.width), (t[5] = n.y / i.height), (t[6] = n.width / i.width), (t[7] = n.height / i.height); }), (t.prototype.preActivate = function (t) {}), (t.prototype.activate = function (t, e, n) { this.computeVertexData(); var r = t.context; this.source.getAbstraction(t).activate(this.sourceSamplerIndex), r.setProgramConstantsFromArray(te.VERTEX, this._vertexConstantData); }), (t.prototype.deactivate = function (t) {}), Object.defineProperty(t.prototype, "requireDepthRender", { get: function () { return this._requireDepthRender; }, enumerable: !1, configurable: !0, }), t ); })(), yn = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "name", { get: function () { return this.constructor.name; }, enumerable: !1, configurable: !0, }), (n.prototype.updateProgram = function (t) { this._program3D && this._program3D.dispose(), (this._program3D = t.context.createProgram()), (this._program3D.name = this.name), this._program3D.uploadRaw( this.getVertexCode(), this.getFragmentCode() ), (this._program3DInvalid = !1); }), (n.prototype.activate = function (t, e, n) { this.computeVertexData(), this._source.getAbstraction(t).activate(this.sourceSamplerIndex), this._program3D.uploadUniform( "uTexMatrix", this._vertexConstantData ); }), (n.prototype.getVertexCode = function () { return "\nprecision highp float;\nuniform vec4 uTexMatrix[2];\n\n/* AGAL legacy atrib resolver require this names */\nattribute vec4 va0; // position\n\nvarying vec2 vUv;\nvoid main() {\n\tvec4 pos = va0;\n\n\tpos.xy = pos.xy * uTexMatrix[0].zw + uTexMatrix[0].xy;\n\tpos.z = pos.z * 2.0 - pos.w;\n\n gl_Position = pos;\n\n\tvUv = clamp((va0.xy * uTexMatrix[1].zw) + uTexMatrix[1].xy, 0., 1.);\n}\n\n"; }), (n.prototype.getFragmentCode = function () { return "\nprecision highp float;\nuniform sampler2D uSampler0;\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color = texture2D(uSampler0, vUv);\n gl_FragColor = color;\n}\n\n"; }), n ); })(mn), An = (function (t) { function n(e, n, r) { void 0 === n && (n = -1), void 0 === r && (r = !0); var i = t.call(this) || this; return ( (i.horizontalPass = !0), (i._stepSize = 1), (i._amount = e), (i._data = new Float32Array([0, 0, 0])), (i.stepSize = n), (i.horizontalPass = r), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "name", { get: function () { return ( "FilterBlurTask:" + (this.horizontalPass ? "hor" : "vert") + ":" + this._amount ); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "amount", { get: function () { return this._amount; }, set: function (t) { this._amount != t && ((this._amount = t), this.invalidateProgram(), this.calculateStepSize()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "stepSize", { get: function () { return this._stepSize; }, set: function (t) { this._stepSize != t && ((this._stepSize = t), this.calculateStepSize(), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), (n.prototype.getFragmentCode = function () { for ( var t = this.horizontalPass, e = [], n = 1, r = this._realStepSize; r <= this._amount; r += this._realStepSize ) e.push( "\n\t\t\t\t\t\tuv." + (t ? "x" : "y") + " += uBlurData[1];\n\t\t\t\t\t\tcolor += texture2D(fs0, uv);\n\t\t\t" ), ++n; return ( "\n\t\t\tprecision highp float;\n\t\t\tuniform vec3 uBlurData;\n\t\t\tuniform sampler2D fs0;\n\n\t\t\tvarying vec2 vUv;\n\t\t\t\n\t\t\tvoid main() {\n\t\t\t\tvec2 uv = vUv.xy;\n\t\t\t\tuv." + (t ? "x" : "y") + " -= uBlurData[0];\n\n\t\t\t\tvec4 color = texture2D(fs0, uv);\n\n\t\t\t\t" + e.join("\n") + "\n\n\t\t\t\tgl_FragColor = color * 1.0 / " + n.toFixed(1) + ";\n\t\t\t}\n\t\t" ); }), (n.prototype.activate = function (e, n, r) { t.prototype.computeVertexData.call(this); var i = this._program3D; this._source.getAbstraction(e).activate(0), i.uploadUniform("uTexMatrix", this._vertexConstantData), i.uploadUniform("uBlurData", this._data); }), (n.prototype.preActivate = function (t) { this.updateBlurData(); }), (n.prototype.updateBlurData = function () { var t = this.horizontalPass ? this._source.width : this._source.height; (this._data[0] = (0.5 * this._amount) / t), (this._data[1] = this._realStepSize / t); }), (n.prototype.calculateStepSize = function () { this._realStepSize = this._stepSize > 0 ? this._stepSize : this._amount > n.MAX_AUTO_SAMPLES ? this._amount / n.MAX_AUTO_SAMPLES : 1; }), (n.MAX_AUTO_SAMPLES = 15), n ); })(yn), vn = (function () { function t() { (this._tasks = []), (this._temp = []), (this._activeTaskIndex = -1), (this.imageScale = 1); } return ( Object.defineProperty(t.prototype, "isValid", { get: function () { for (var t = 0, e = this._tasks; t < e.length; t++) { if (!e[t].isValid) return !1; } return !0; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "requireBlend", { get: function () { return !1; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "blendDst", { get: function () { return Yt.ZERO; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "blendSrc", { get: function () { return Yt.ONE; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "requireDepthRender", { get: function () { return this._requireDepthRender; }, enumerable: !1, configurable: !0, }), (t.prototype.addTask = function (t) { this._tasks.push(t), null == this._requireDepthRender && (this._requireDepthRender = t.requireDepthRender); }), (t.prototype.nextTask = function () { return this._activeTaskIndex < this._tasks.length ? this._tasks[++this._activeTaskIndex] : null; }), (t.prototype.hasNextTask = function () { return this._tasks.length < this._activeTaskIndex; }), (t.prototype.meashurePad = function (t, e) { return void 0 === e && (e = t.clone()), t === e || e.copyFrom(t), e; }), (t.prototype.setRenderState = function (t, e, n, r, i) { (this._activeTaskIndex = -1), (this._tasks[0].inputRect = n), (this._tasks[0].source = t), (this._tasks[this._tasks.length - 1].destRect = r), (this._tasks[this._tasks.length - 1].target = e); }), (t.prototype.dispose = function () { for (var t = 0, e = this._tasks; t < e.length; t++) { e[t].dispose(); } this._tasks.length = 0; }), (t.prototype.update = function (t, e) {}), (t.prototype.clear = function (t) { for (var e = 0, n = this._temp; e < n.length; e++) { var r = n[e]; t.pushTemp(r); } (this._temp.length = 0), (this._activeTaskIndex = -1), (this.imageScale = 1); }), t ); })(), bn = (function () { function t() {} return ( (t.meashureBlurPad = function (t, e, n, r, i) { void 0 === r && (r = !1); var o = this.blurFilterStepWidths[n - 1]; if (r) { var a = o / 4; (t -= a), (e -= a); } var s = Math.ceil((t < 1 ? 1 : t) * o), u = Math.ceil((e < 1 ? 1 : e) * o); return (i = i || new P()).setTo(s, u), i; }), (t.colorToArray = function (t, e, n) { return ( ((n = n || [])[0] = ((t >> 16) & 255) / 255), (n[1] = ((t >> 8) & 255) / 255), (n[2] = ((t >> 0) & 255) / 255), (n[3] = e), n ); }), (t.colorToU8 = function (t, e, n, r) { return ( void 0 === r && (r = 0), (n[0 + r] = (t >> 16) & 255), (n[1 + r] = (t >> 8) & 255), (n[2 + r] = (t >> 0) & 255), (n[3 + r] = (255 * e) | 0), n ); }), (t.nonAlocUnion = function (t, e, n) { var r = t._rawData, i = e._rawData, o = n._rawData; return ( o.set(r), i[0] < r[0] && (o[0] = i[0]), i[1] < r[1] && (o[1] = i[1]), (o[2] = Math.max(i[0] + i[2], r[0] + r[2])), (o[2] -= o[0]), (o[3] = Math.max(i[1] + i[3], r[1] + r[3])), (o[3] -= o[1]), n ); }), (t.blurFilterStepWidths = [ 0.5, 1.05, 1.35, 1.55, 1.75, 1.9, 2, 2.1, 2.2, 2.3, 2.5, 3, 3, 3.5, 3.5, ]), t ); })(); function Cn(t, e) { return function (n, r, i) { (e = e || r), Object.defineProperty(n, r, { set: function (n) { this[t][e] = n; }, get: function () { return this[t][e]; }, }); }; } var In = Symbol("Model propery list"); function En(t, e) { t[In] || (t[In] = []), t[In].push(e); } var xn, wn, Sn, Dn, Tn, Pn, On, Bn, Mn, Ln, Nn, Rn = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n.imageScale = 1), (n._hBlurTask = new An((null == e ? void 0 : e.blurX) || 4, -1, !0)), (n._vBlurTask = new An((null == e ? void 0 : e.blurY) || 4, -1, !1)), n.addTask(n._hBlurTask), n.addTask(n._vBlurTask), n ); } return ( e(n, t), (n.prototype.applyProps = function (t) { "blurX" in t && (this.blurX = t.blurX), "blurY" in t && (this.blurY = t.blurY), "imageScale" in t && (this.imageScale = t.imageScale || 1); }), Object.defineProperty(n.prototype, "stepSize", { get: function () { return this._hBlurTask.stepSize; }, set: function (t) { (this._hBlurTask.stepSize = t), (this._vBlurTask.stepSize = t); }, enumerable: !1, configurable: !0, }), (n.prototype.meashurePad = function (t, e) { void 0 === e && (e = t); var n = bn.meashureBlurPad(this.blurX, this.blurY, 3, !0); return ( e.copyFrom(t), (e.x -= n.x), (e.y -= n.y), (e.width += n.x), (e.height += n.y), e ); }), (n.prototype.setRenderState = function (t, e, n, r, i) { var o = i.popTemp(t.width, t.height); (this._hBlurTask.needClear = !0), this._hBlurTask.inputRect.setTo(0, 0, t.width, t.height), this._hBlurTask.destRect.setTo(0, 0, t.width, t.height), (this._vBlurTask.clipRect = new K(0, 0, t.width, t.height)), (this._hBlurTask.clipRect = this._vBlurTask.clipRect), this._vBlurTask.inputRect.copyFrom(r), this._vBlurTask.destRect.copyFrom(r), (this._hBlurTask.source = t), (this._hBlurTask.target = o), (this._vBlurTask.source = o), (this._vBlurTask.target = e), (this._temp = [o]); }), (n.filterName = "blur"), i([En], n.prototype, "imageScale", void 0), i([En, Cn("_hBlurTask", "amount")], n.prototype, "blurX", void 0), i([En, Cn("_vBlurTask", "amount")], n.prototype, "blurY", void 0), n ); })(vn), Fn = (function () { function t(t, e, n, r) { (this.usages = 0), (this.disposedAt = -1), (this.disposed = !1), (this._pool = t), (this.stage = e), (this.vertexString = n), (this.fragmentString = r), this.stage.registerProgram(this); } return ( (t.prototype.dispose = function () { this.usages--, this.usages || this._pool.disposeItem(this.vertexString + this.fragmentString); }), (t.prototype.disposeFinaly = function () { this.stage && this.stage.unRegisterProgram(this), this.program && this.program.dispose(), (this.program = null), (this.usages = 0), (this.vertexString = void 0), (this.fragmentString = void 0), (this.disposedAt = -1), (this.stage = void 0), (this.disposed = !0); }), (t.PROGRAMDATA_ID_COUNT = 0), t ); })(), kn = (function () { function t(t) { (this._pool = {}), (this._disposedPool = {}), (this.keepAlive = 1e3), (this._stage = t); } return ( (t.prototype.collect = function () { var t = Date.now(); for (var e in this._disposedPool) { var n = this._disposedPool[e]; ((!n.usages && n.disposedAt + this.keepAlive < t) || n.disposed) && (delete this._pool[e], delete this._disposedPool[e], n.disposeFinaly()); } }), (t.prototype.getItem = function (t, e) { var n = t + e, r = this._pool[n] || (this._pool[n] = new Fn(this, this._stage, t, e)); return ( (r.disposedAt = -1), delete this._disposedPool[n], this.collect(), r ); }), (t.prototype.disposeItem = function (t) { var e = this._pool[t]; e && ((e.disposedAt = Date.now()), (this._disposedPool[t] = e)); }), t ); })(), Un = (function () { function t(e) { (this.textureType = ""), (this._state = new Pe()), (this._context = e), (this._gl = e._gl), (this._id = t.TEXTURE_ID++); } return ( Object.defineProperty(t.prototype, "id", { get: function () { return this._id; }, enumerable: !1, configurable: !0, }), (t.prototype.dispose = function () { this._gl.deleteTexture(this._glTexture); }), Object.defineProperty(t.prototype, "glTexture", { get: function () { return this._glTexture; }, enumerable: !1, configurable: !0, }), (t.prototype.generateMipmaps = function () { throw new u(); }), (t.TEXTURE_ID = 0), t ); })(), jn = (function (t) { function n(e, n) { var r = t.call(this, e) || this; (r._textureSelectorDictionary = new Array(6)), (r.textureType = "textureCube"); var i = r._gl; return ( (r._size = n), (r._glTexture = r._gl.createTexture()), (r._textureSelectorDictionary[0] = i.TEXTURE_CUBE_MAP_POSITIVE_X), (r._textureSelectorDictionary[1] = i.TEXTURE_CUBE_MAP_NEGATIVE_X), (r._textureSelectorDictionary[2] = i.TEXTURE_CUBE_MAP_POSITIVE_Y), (r._textureSelectorDictionary[3] = i.TEXTURE_CUBE_MAP_NEGATIVE_Y), (r._textureSelectorDictionary[4] = i.TEXTURE_CUBE_MAP_POSITIVE_Z), (r._textureSelectorDictionary[5] = i.TEXTURE_CUBE_MAP_NEGATIVE_Z), r ); } return ( e(n, t), (n.prototype.uploadFromArray = function (t, e, n, r) { if ( (void 0 === n && (n = 0), void 0 === r && (r = !1), t.length != this._size * this._size * 4) ) throw new Error( "Array is not the correct length for texture dimensions" ); t instanceof Array && (t = new Uint8Array(t)), this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP, this._glTexture), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r), this._gl.texImage2D( this._textureSelectorDictionary[e], n, this._gl.RGBA, this._size, this._size, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t ), this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP, null); }), (n.prototype.uploadCompressedTextureFromArray = function (t, e, n) {}), Object.defineProperty(n.prototype, "size", { get: function () { return this._size; }, enumerable: !1, configurable: !0, }), (n.prototype.generateMipmaps = function () { this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP, this._glTexture), this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); }), n ); })(Un), Vn = (function () { function t(t, e) { void 0 === e && (e = De.MAX_BUFFER_POOL_SIZE), (this._tCtrl = t), (this.maxStoreSize = e), (this._store = []), De.ENABLE_UNLOAD_BUFFER && (this._manager = Ve.createManager({ name: t.name, keepAliveTime: De.MAX_BUFFER_ALIVE_TIME, })); } return ( (t.prototype.create = function (e, n, r, i) { var o = this._store.pop(); return ( o ? De.ENABLE_UNLOAD_BUFFER && (this._manager.removeTask(o), (o.lastUsedTime = this._manager.correctedTime)) : ((o = new this._tCtrl(e, n, r, i)).id = t.GLOBAL_POOL_ID++), o.apply && o.apply(e, n, r, i), o ); }), (t.prototype.store = function (t) { return ( this._store.length !== this.maxStoreSize && (this._store.push(t), De.ENABLE_UNLOAD_BUFFER && ((t.lastUsedTime = this._manager.correctedTime), this._manager.addTask(t)), !0) ); }), (t.prototype.remove = function (t) { var e = this._store.indexOf(t); return e > -1 && (this._store.splice(e, 1), !0); }), (t.prototype.clear = function () { this._manager && this._manager.clear(); }), (t.GLOBAL_POOL_ID = 0), t ); })(), Qn = (function () { function t(t, e) { (this._context = t), (this.canUnload = !0), (this._lastMemoryUsage = 0), (this._gl = t._gl), (this._buffer = this._gl.createBuffer()), (this._numIndices = e), t.stats.counter.index++; } return ( Object.defineProperty(t, "pool", { get: function () { return this._pool || (this._pool = new Vn(t)); }, enumerable: !1, configurable: !0, }), (t.create = function (t, e) { return this.pool.create(t, e); }), (t.prototype.uploadFromArray = function (t, e, n) { void 0 === e && (e = 0), this.uploadFromByteArray(t.buffer, e, n); }), (t.prototype.uploadFromByteArray = function (t, e, n) { void 0 === e && (e = 0), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, this._buffer), (this._context.stats.memory.index -= this._lastMemoryUsage), (this._lastMemoryUsage = t.byteLength - 2 * e), (this._context.stats.memory.index += this._lastMemoryUsage), e ? this._gl.bufferSubData(this._gl.ELEMENT_ARRAY_BUFFER, 2 * e, t) : this._gl.bufferData( this._gl.ELEMENT_ARRAY_BUFFER, t, this._gl.STATIC_DRAW ); }), (t.prototype.dispose = function () { t.pool.store(this) || this.unload(); }), (t.prototype.apply = function (t, e) { this._numIndices = e; }), (t.prototype.unload = function () { t.pool.remove(this), this._gl.deleteBuffer(this._buffer), (this._buffer = null), this._context.stats.counter.index--, (this._context.stats.memory.index -= this._lastMemoryUsage); }), Object.defineProperty(t.prototype, "numIndices", { get: function () { return this._numIndices; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "glBuffer", { get: function () { return this._buffer; }, enumerable: !1, configurable: !0, }), t ); })(), Gn = { 35664: { size: 2, method: "uniform2fv" }, 35665: { size: 3, method: "uniform3fv" }, 35666: { size: 4, method: "uniform4fv" }, 35674: { size: 4, method: "uniformMatrix2fv" }, 35675: { size: 9, method: "uniformMatrix3fv" }, 35676: { size: 16, method: "uniformMatrix4fv" }, 35678: { size: 1, method: "uniform1i" }, 5126: { size: 1, method: "uniform1f" }, }, zn = /(#define|#version|precision).*\n/gi, Hn = (function () { function t(e) { (this._context = e), (this._id = t.ProgramID++), (this._uniformCache = new Array(16)), (this._focusId = 0), (this._gl = e._gl); } return ( Object.defineProperty(t.prototype, "focusId", { get: function () { return this._focusId; }, enumerable: !1, configurable: !0, }), (t.prototype.upload = function (e, n) { var r = this._gl.getShaderPrecisionFormat( this._gl.VERTEX_SHADER, this._gl.HIGH_FLOAT ).precision, i = this._gl.getShaderPrecisionFormat( this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT ).precision, o = t._aglslParser.parse( t._tokenizer.decribeAGALPart(e), r ? "highp" : "mediump", 2 === this._context.glVersion ), a = t._aglslParser.parse( t._tokenizer.decribeAGALPart(n), i ? "highp" : "mediump", 2 === this._context.glVersion ); this.name || (this.name = "PROG_AGAL_" + this._id), this.uploadRaw(o, a); }), (t.prototype.uploadRaw = function (e, n) { this.name || (this.name = "PROG_GLSL_" + this._id); var r = e + n; if (r in t.programCache) return ( (this._program = t.programCache[r]), void this._program.usage++ ); (e = this.insertName(e)), (n = this.insertName(n)); var i = this._gl.createShader(this._gl.VERTEX_SHADER), o = this._gl.createShader(this._gl.FRAGMENT_SHADER), a = this._gl.createProgram(); if ( (this._context.stats.counter.program++, this._gl.shaderSource(i, e), this._gl.compileShader(i), !this._gl.getShaderParameter(i, this._gl.COMPILE_STATUS)) ) throw new Error(this._gl.getShaderInfoLog(i)); if ( (this._gl.shaderSource(o, n), this._gl.compileShader(o), !this._gl.getShaderParameter(o, this._gl.COMPILE_STATUS)) ) throw new Error(this._gl.getShaderInfoLog(o)); if ( (this._gl.attachShader(a, i), this._gl.attachShader(a, o), this._gl.linkProgram(a), !this._gl.getProgramParameter(a, this._gl.LINK_STATUS)) ) throw new Error(this._gl.getProgramInfoLog(a)); this._gl.deleteShader(i), this._gl.deleteShader(o), (this._program = { program: a, uniforms: {}, attributes: {}, usage: 1, }), (t.programCache[r] = this._program), this.reset(), this.grabLocationData(e, n); }), (t.prototype.grabLocationData = function (t, e) { for ( var n = this._program.uniforms, r = this._program.attributes, i = this._gl, o = this._program.program, a = i.getProgramParameter(o, i.ACTIVE_UNIFORMS), s = i.getProgramParameter(o, i.ACTIVE_ATTRIBUTES), u = 0; u < a; u++ ) { var l = (h = i.getActiveUniform(o, u)).name.indexOf("["), c = { type: h.type, size: h.size, location: i.getUniformLocation(o, h.name), }; n[-1 === l ? h.name : h.name.substring(0, l)] = c; } for (u = 0; u < s; u++) { var h; r[(h = i.getActiveAttrib(o, u)).name] = { type: h.type, size: h.size, location: i.getAttribLocation(o, h.name), }; } for (var p = e.indexOf("uniform sampler", 0), d = 0; p >= 0; ) { var f = e.indexOf(";", p + 2), g = (_ = e.substring(p, f).split(" "))[_.length - 1]; n["fs" + d] || (n["fs" + d] = n[g]), (p = e.indexOf("uniform sampler", f)), d++; } for (p = t.indexOf("attribute", 0), d = 0; p >= 0; ) { f = t.indexOf(";", p + 2); var _, m = (_ = t.substring(p, f).split(" "))[_.length - 1]; r["va" + d] || (r["va" + d] = r[m]), (p = t.indexOf("attribute", f)), d++; } }), (t.prototype.insertName = function (t) { var e = t.match(zn) || [], n = e[e.length - 1], r = n ? t.lastIndexOf(n) + n.length : 0; return ( t.substr(0, r) + "\n#define SHADER_NAME " + this.name + "\n\n" + t.substr(r) ); }), (t.prototype.reset = function () { this._uniformCache.fill(""); }), (t.prototype.getUniformLocation = function (e, n) { void 0 === n && (n = -1); var r = "number" == typeof n ? t._getAGALUniformName(e, n) : n, i = this._program.uniforms[r]; return i ? i.location : null; }), (t.prototype.getAttribLocation = function (t) { var e = this._program.attributes["va" + t]; return e ? e.location : -1; }), (t._getAGALUniformName = function (t, e) { return ( void 0 === e && (e = -1), -1 === e ? this._uniformLocationNameDictionary[t] : this._uniformLocationNameDictionary[t] + e ); }), (t.prototype._needCache = function (t, e) { var n = this._uniformCache[t], r = e instanceof Float32Array ? new Uint32Array(e.buffer).join("") : "" + e; return n && r === n ? void 0 : r; }), (t.prototype.uploadUniform = function (t, e) { var n = this._program.uniforms[t]; if (!n) return !1; if (!Gn[n.type]) throw "[ProgramWebGL] Unsupported uniform type:" + n.type; var r = Gn[n.type], i = r.size, o = r.method; if (1 === i) return ( "number" == typeof e || 1 === n.size ? this._gl[o](n.location, "number" == typeof e ? e : e[0]) : this._gl[o + "v"](n.location, e), !0 ); var a = e; if (a.length !== n.size * i) throw ( "[ProgramWebGL] Invalid data length for " + t + ", expected " + n.size * i + ", actual " + a.length ); n.type === this._gl.FLOAT_MAT2 || n.type === this._gl.FLOAT_MAT3 || n.type === this._gl.FLOAT_MAT4 ? this._gl[o](n.location, !1, a) : this._gl[o](n.location, a); }), (t.prototype.uniform1i = function (t, e, n) { var r = this.getUniformLocation(t, e); r && this._gl.uniform1i(r, n); }), (t.prototype.uniform4fv = function (t, e) { var n = this.getUniformLocation(t); n && this._gl.uniform4fv(n, e); }), (t.prototype.dispose = function () { this.reset(); }), (t.prototype.focusProgram = function () { this._focusId++, this._uniformCache.fill(""), this._gl.useProgram(this._program.program); }), Object.defineProperty(t.prototype, "glProgram", { get: function () { return this._program; }, enumerable: !1, configurable: !0, }), (t.programCache = {}), (t.ProgramID = 0), (t._tokenizer = new Se()), (t._aglslParser = new Te()), (t._uniformLocationNameDictionary = ["fc", "fs", "vc"]), t ); })(), Xn = (function (t) { function n(e, n, r) { var i = t.call(this, e) || this; if ( ((i.textureType = "texture2d"), (i._isFilled = !1), (i._isPMA = !1), (i._isRT = !1), (i._isMipmaped = !1), (i.lastUsedTime = 0), !n || !r) ) throw new Error( "Incorrected size of texture { width: " + n + ", height: " + r + "}" ); return ( (i._width = n), (i._height = r), (i._glTexture = i._gl.createTexture()), i._context.stats.counter.texture++, (i._context.stats.memory.texture += n * r * 8), i ); } return ( e(n, t), (n.store = function (t) { var e = (t._width << 16) | t._height, r = n._pool[e] || (n._pool[e] = []); return r.indexOf(t) > -1 ? ((t.lastUsedTime = this.unloadManager.correctedTime), !0) : !(r.length >= this.SIZE_POOL_LIMIT) && (r.push(t), (t.lastUsedTime = this.unloadManager.correctedTime), this.unloadManager.addTask(t), !0); }), (n.remove = function (t) { var e = (t._width << 16) | t._height, r = n._pool[e]; if (!r || !r.length) return !1; var i = r.indexOf(t); return i > -1 && !!r.splice(i, 1); }), (n.create = function (t, e, r) { var i, o = (e << 16) | 0 | r, a = null === (i = n._pool[o]) || void 0 === i ? void 0 : i.pop(); return a ? (this.unloadManager.removeTask(a), a) : new n(t, e, r); }), Object.defineProperty(n.prototype, "canUnload", { get: function () { return this._glTexture && !this._isRT; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "isPOT", { get: function () { return !( this._width & (this._width - 1) || this._height & (this._height - 1) ); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "width", { get: function () { return this._width; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return this._height; }, enumerable: !1, configurable: !0, }), (n.prototype.dispose = function () { this.unload(); }), (n.prototype.unload = function () { n.remove(this), this._context.stats.counter.texture--, (this._context.stats.memory.texture -= this.width * this.height * 8), this._context._texContext.disposeTexture(this), (this._glTexture = null), this._state.dispose(); }), (n.prototype.uploadFromArray = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = !1), this._context._texContext.uploadFromArray(this, t, e, n), (this._isFilled = !0), (this._isPMA = n); }), (n.prototype.uploadFromURL = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = !1), this._context._texContext.uploadFromArray(this, null, e, n), (this._isFilled = !0), (this._isPMA = n); }), (n.prototype.uploadCompressedTextureFromArray = function (t, e, n) {}), (n.prototype.generateMipmaps = function () { if (this.isPOT || 2 === this._context.glVersion) { var t = this._context._texContext.bindTexture(this, !0); this._gl.generateMipmap(this._gl.TEXTURE_2D), this._context._texContext.bindTexture(t, !0), (this._isMipmaped = !0); } }), (n.SIZE_POOL_LIMIT = 10), (n.unloadManager = Ve.createManager({ keepAliveTime: 2e4, name: "TextureWebGL", priority: 1e3, })), (n._pool = {}), n ); })(Un), Yn = (function () { function t(t, e, n) { (this._context = t), (this._lastMemoryUsage = 0), (this.instanced = !1), (this.dynamic = !1), (this.canUnload = !0), (this._gl = t._gl), (this._buffer = this._gl.createBuffer()), (this._numVertices = e), (this._dataPerVertex = n), t.stats.counter.vertex++; } return ( Object.defineProperty(t, "pool", { get: function () { return this._pool || (this._pool = new Vn(t)); }, enumerable: !1, configurable: !0, }), (t.create = function (t, e, n) { return this.pool.create(t, e, n); }), (t.prototype.initAsDynamic = function (t) { void 0 === t && (t = this._numVertices), 0 !== t && ((this._numVertices = t), (this.dynamic = !0), (this._context.stats.memory.vertex -= this._lastMemoryUsage), (this._lastMemoryUsage = t * this._dataPerVertex), (this._context.stats.memory.vertex += this._lastMemoryUsage), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._buffer), this._gl.bufferData( this._gl.ARRAY_BUFFER, t * this._dataPerVertex, this._gl.DYNAMIC_DRAW )); }), (t.prototype.uploadFromArray = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = this._numVertices), this.uploadFromByteArray(t, e, n); }), (t.prototype.uploadFromByteArray = function (t, e, n) { var r = this._gl; r.bindBuffer(r.ARRAY_BUFFER, this._buffer), (e || t.byteLength < this._numVertices * this._dataPerVertex) && this.dynamic ? r.bufferSubData(r.ARRAY_BUFFER, e * this._dataPerVertex, t) : ((this._numVertices = t.byteLength / this._dataPerVertex), (this._context.stats.memory.vertex -= this._lastMemoryUsage), (this._lastMemoryUsage = t.byteLength), (this._context.stats.memory.vertex += this._lastMemoryUsage), r.bufferData( r.ARRAY_BUFFER, t, this.dynamic ? r.DYNAMIC_DRAW : r.STATIC_DRAW )); }), Object.defineProperty(t.prototype, "numVertices", { get: function () { return this._numVertices; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "dataPerVertex", { get: function () { return this._dataPerVertex; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "glBuffer", { get: function () { return this._buffer; }, enumerable: !1, configurable: !0, }), (t.prototype.dispose = function () { (this.instanced = !1), (this.dynamic = !1), t.pool.store(this) || this.unload(); }), (t.prototype.apply = function (t, e, n) { (this._numVertices = e), (this._dataPerVertex = n); }), (t.prototype.unload = function () { t.pool.remove(this), this._gl.deleteBuffer(this._buffer), (this._buffer = null), this._context.stats.counter.vertex--, (this._context.stats.memory.vertex -= this._lastMemoryUsage); }), t ); })(), qn = (function (t) { function n(e, n, r) { var i = t.call(this, e, n) || this; return (i._context = r), i; } return ( e(n, t), (n.prototype.commit = function (t, e) { if (((this.type = t), !this.equals(e._state))) { e._state.copyFrom(this); var n = this._context._gl, r = e.isPOT || 2 === this._context.glVersion; this.wrap !== n.REPEAT || r ? (n.texParameteri(t, n.TEXTURE_WRAP_S, this.wrap), n.texParameteri(t, n.TEXTURE_WRAP_T, this.wrap)) : (n.texParameteri(t, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(t, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE)); var i = this.mipfilter; e._isMipmaped || (i = this.filter), n.texParameteri(t, n.TEXTURE_MAG_FILTER, this.filter), n.texParameteri(t, n.TEXTURE_MIN_FILTER, i), (this.boundedTexture = e); } }), n ); })(Pe), Kn = (function () { function t(t, e, n, r) { void 0 === r && (r = !1), (this._context = t), (this.width = e), (this.height = n), (this._colorOnly = r), (this.isMsaaTarget = !1), (this.memoryUsage = 0), this.init(); } return ( Object.defineProperty(t.prototype, "drawBuffer", { get: function () { return this._framebuffer; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "readBuffer", { get: function () { return this._framebuffer; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "isValid", { get: function () { return this._framebuffer && this._linkedTexture; }, enumerable: !1, configurable: !0, }), (t.prototype.init = function () { var t = this._context._gl; if ( ((this._framebuffer = t.createFramebuffer()), (this._depthStencil = this._colorOnly ? null : t.createRenderbuffer()), this._context.stats.counter.renderTarget++, this._depthStencil) ) { this.memoryUsage = this.width * this.height * 8; var e = this._context._texContext.bindRenderTarget(this, !1); t.bindRenderbuffer(t.RENDERBUFFER, this._depthStencil), t.framebufferRenderbuffer( t.FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, t.RENDERBUFFER, this._depthStencil ), t.renderbufferStorage( t.RENDERBUFFER, t.DEPTH_STENCIL, this.width, this.height ), t.bindRenderbuffer(t.RENDERBUFFER, null), this._context._texContext.bindRenderTarget(e, !0), (this._context.stats.memory.renderTarget += this.memoryUsage); } }), (t.prototype.linkTexture = function (t) { if (this._linkedTexture !== t) { var e = this._context._gl, n = this._context._texContext, r = null == t ? void 0 : t.glTexture, i = n.bindTexture(t, !0); if (t) { if (t.height !== this.height || t.width !== this.width) throw ( "Texture size and render target is differentexpected " + this.width + "x" + this.height + ", actual " + t.width + "x" + t.height ); t._isFilled || t.uploadFromArray(null, 0, !1); } var o = n.bindRenderTarget(this, !0); e.framebufferTexture2D( e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, r, 0 ), n.bindRenderTarget(o, !0), n.bindTexture(i, !0), (this._linkedTexture = t); } }), (t.prototype.present = function (t, e, n, r) { if (t) { if (t.isMsaaTarget) throw "Invalid opration, try copy noMSAA to MSAA"; if (!t.isValid) throw "Target RT MUST be valid and have texture link"; if (!this.isValid) throw "Source RT MUST be valid and have texture link"; var i = this._context._gl, o = this._context._texContext, a = e.x, s = e.y, u = e.width, l = e.height, c = (null == n ? void 0 : n.x) || 0, h = (null == n ? void 0 : n.y) || 0, p = o.bindRenderTarget(this), d = o.bindTexture(t._linkedTexture); i.copyTexSubImage2D(i.TEXTURE_2D, 0, c, h, a, s, u, l), o.bindTexture(d), o.bindRenderTarget(p); } }), (t.prototype.dispose = function () { this.unload(); }), (t.prototype.unload = function () { var t = this._context._gl, e = this._framebuffer, n = this._depthStencil; t.deleteFramebuffer(e), t.deleteRenderbuffer(n), (this._linkedTexture = null), (this._framebuffer = null), (this._depthStencil = null), this._context.stats.counter.renderTarget--, (this._context.stats.memory.renderTarget -= this.memoryUsage); }), t ); })(), Wn = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.isMsaaTarget = !0), e; } return ( e(n, t), Object.defineProperty(n.prototype, "readBuffer", { get: function () { return this._drawTarget.readBuffer; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "isValid", { get: function () { return ( this._framebuffer && this._drawTarget && this._drawTarget.isValid ); }, enumerable: !1, configurable: !0, }), (n.prototype.init = function () { var t = this._context._gl, e = this._context._texContext; this._context.stats.counter.renderTarget++, (this._framebuffer = t.createFramebuffer()), (this._depthStencil = this._colorOnly ? null : t.createRenderbuffer()), (this._color = t.createRenderbuffer()); var n = this._depthStencil, r = this._color, i = this.width, o = this.height, a = t.getParameter(t.MAX_SAMPLES), s = t.RENDERBUFFER, u = t.FRAMEBUFFER, l = t.COLOR_ATTACHMENT0, c = t.DEPTH_STENCIL_ATTACHMENT, h = t.RGBA8, p = t.DEPTH24_STENCIL8, d = e.bindRenderTarget(this); t.bindRenderbuffer(s, r), t.framebufferRenderbuffer(u, l, s, r), t.renderbufferStorageMultisample(s, a, h, i, o), (this.memoryUsage = i * o * 8 * Math.sqrt(a)), n && (t.bindRenderbuffer(s, n), t.framebufferRenderbuffer(u, c, s, n), t.renderbufferStorageMultisample(s, a, p, i, o), (this.memoryUsage *= 2)), e.bindRenderTarget(d, !0), (this._context.stats.memory.renderTarget += this.memoryUsage); }), (n.prototype.linkTarget = function (t) { if (t === this) throw "Framebuffer loop, linking to itself"; this._drawTarget = t; }), (n.prototype.present = function (t, e, n) { if ((void 0 === t && (t = this._drawTarget), this._framebuffer)) { if (t === this) throw "Framebuffer loop, presenting to itself"; if (t && t.isValid) { var r = ~~(null == e ? void 0 : e.x) || 0, i = ~~(null == e ? void 0 : e.y) || 0, o = ~~(null == e ? void 0 : e.width) || t.width, a = ~~(null == e ? void 0 : e.height) || t.height, s = ~~(null == n ? void 0 : n.x) || 0, u = ~~(null == n ? void 0 : n.y) || 0, l = t, c = s || u; c && !t.isMsaaTarget && ((l = this._drawTarget), (r = i = s = u = 0), (o = t.width), (a = t.height)); var h = this._context._gl; h.bindFramebuffer(h.READ_FRAMEBUFFER, this._framebuffer), h.bindFramebuffer(h.DRAW_FRAMEBUFFER, l._framebuffer), h.blitFramebuffer( r, i, r + o, i + a, s, u, s + o, u + a, h.COLOR_BUFFER_BIT, h.NEAREST ), c && !t.isMsaaTarget && this._drawTarget.present(t, e, n); } } }), (n.prototype.linkTexture = function (t) { throw "Texture can't be linked to MSAA render target"; }), (n.prototype.dispose = function () { this.unload(); }), (n.prototype.unload = function () { this._context._gl.deleteRenderbuffer(this._color), (this._color = null), (this._drawTarget = null), t.prototype.unload.call(this); }), n ); })(Kn), Jn = { texture2d: 3553, textureCube: 34067 }, $n = (((xn = {})[ae.REPEAT] = 10497), (xn[ae.CLAMP] = 33071), xn), Zn = (((wn = {})[ne.LINEAR] = 9729), (wn[ne.NEAREST] = 9728), wn), tr = (((Sn = {})[ne.LINEAR] = (((Dn = {})[$t.MIPNEAREST] = 9985), (Dn[$t.MIPLINEAR] = 9987), (Dn[$t.MIPNONE] = 9729), Dn)), (Sn[ne.NEAREST] = (((Tn = {})[$t.MIPNEAREST] = 9984), (Tn[$t.MIPLINEAR] = 9986), (Tn[$t.MIPNONE] = 9728), Tn)), Sn), er = Yt, nr = qt, rr = (((Pn = {})[er.ONE] = 1), (Pn[er.DESTINATION_ALPHA] = 772), (Pn[er.DESTINATION_COLOR] = 774), (Pn[er.ONE_MINUS_DESTINATION_ALPHA] = 773), (Pn[er.ONE_MINUS_DESTINATION_COLOR] = 775), (Pn[er.ONE_MINUS_SOURCE_ALPHA] = 771), (Pn[er.ONE_MINUS_SOURCE_COLOR] = 769), (Pn[er.SOURCE_ALPHA] = 770), (Pn[er.SOURCE_COLOR] = 768), (Pn[er.ZERO] = 0), Pn), ir = (((On = {})[nr.ADD] = 32774), (On[nr.SUBTRACT] = 32778), (On[nr.REVERSE_SUBTRACT] = 32779), (On[nr.MIN] = 32775), (On[nr.MAX] = 32776), On), or = (((Bn = {})[Jt.LINES] = 1), (Bn[Jt.TRIANGLES] = 4), Bn), ar = Wt, sr = (((Mn = {})[ar.ALWAYS] = 519), (Mn[ar.EQUAL] = 514), (Mn[ar.GREATER] = 516), (Mn[ar.GREATER_EQUAL] = 518), (Mn[ar.LESS] = 513), (Mn[ar.LESS_EQUAL] = 515), (Mn[ar.NEVER] = 512), (Mn[ar.NOT_EQUAL] = 517), Mn), ur = ee, lr = (((Ln = {})[ur.KEEP] = 7680), (Ln[ur.SET] = 7681), (Ln[ur.INCREMENT_SATURATE] = 7682), (Ln[ur.DECREMENT_SATURATE] = 7683), (Ln[ur.INVERT] = 5386), (Ln[ur.INCREMENT_WRAP] = 34055), (Ln[ur.DECREMENT_WRAP] = 34056), (Ln[ur.ZERO] = 0), Ln), cr = (function () { return function (t, e, n) { (this.size = t), (this.type = e), (this.normalized = n); }; })(), hr = oe, pr = (((Nn = {})[hr.FLOAT_1] = new cr(1, 5126, !1)), (Nn[hr.FLOAT_2] = new cr(2, 5126, !1)), (Nn[hr.FLOAT_3] = new cr(3, 5126, !1)), (Nn[hr.FLOAT_4] = new cr(4, 5126, !1)), (Nn[hr.BYTE_1] = new cr(1, 5120, !0)), (Nn[hr.BYTE_2] = new cr(2, 5120, !0)), (Nn[hr.BYTE_3] = new cr(3, 5120, !0)), (Nn[hr.BYTE_4] = new cr(4, 5120, !0)), (Nn[hr.UNSIGNED_BYTE_1] = new cr(1, 5121, !0)), (Nn[hr.UNSIGNED_BYTE_2] = new cr(2, 5121, !0)), (Nn[hr.UNSIGNED_BYTE_3] = new cr(3, 5121, !0)), (Nn[hr.UNSIGNED_BYTE_4] = new cr(4, 5121, !0)), (Nn[hr.SHORT_1] = new cr(1, 5122, !1)), (Nn[hr.SHORT_2] = new cr(2, 5122, !1)), (Nn[hr.SHORT_3] = new cr(3, 5122, !1)), (Nn[hr.SHORT_4] = new cr(4, 5122, !1)), (Nn[hr.UNSIGNED_SHORT_1] = new cr(1, 5123, !1)), (Nn[hr.UNSIGNED_SHORT_2] = new cr(2, 5123, !1)), (Nn[hr.UNSIGNED_SHORT_3] = new cr(3, 5123, !1)), (Nn[hr.UNSIGNED_SHORT_4] = new cr(4, 5123, !1)), Nn), dr = (function () { function t(e) { (this._context = e), (this._samplerStates = []), (this._currentRT = null); var n = (this._gl = e._gl); t.MAX_SAMPLERS = Math.min( t.MAX_SAMPLERS, n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS) - 1 ); for (var r = 0; r < t.MAX_SAMPLERS; ++r) (this._samplerStates[r] = new qn(r, null, e)), this._samplerStates[r].set( 2 === e.glVersion ? n.REPEAT : n.CLAMP_TO_EDGE, n.LINEAR, n.LINEAR ); } return ( (t.prototype.bindRenderTarget = function (t, e) { if ((void 0 === e && (e = !1), e && this._currentRT === t)) return t; var n = this._currentRT; return ( (this._currentRT = t), this._gl.bindFramebuffer( this._gl.FRAMEBUFFER, t ? t._framebuffer : null ), n ); }), (t.prototype.bindTexture = function (t, e, n) { if ( (void 0 === e && (e = !1), void 0 === n && (n = this._gl.TEXTURE_2D), e && t === this._lastBoundedTexture) ) return t; var r = this._lastBoundedTexture; return ( (this._lastBoundedTexture = t), this._gl.bindTexture(n, t ? t._glTexture : t), r ); }), (t.prototype.uploadFromArray = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = !1); var i = this._context._gl, o = t._width >>> n, a = t._height >>> n; if (e && e.length !== o * a * 4) throw new Error( "Array is not the correct length for texture dimensions: expected: " + o * a * 4 + ", exist: " + e.length ); e instanceof Array && (e = new Uint8Array(e)); var s = this.bindTexture(t, !0, i.TEXTURE_2D); i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r), i.texImage2D( i.TEXTURE_2D, n, i.RGBA, o, a, 0, i.RGBA, i.UNSIGNED_BYTE, e ), this.bindTexture(s, !0, i.TEXTURE_2D); }), (t.prototype.setTextureAt = function (t, e) { var n = this._context._gl, r = this._samplerStates[t], i = Jn[e.textureType]; return ( (e || r.type) && n.activeTexture(n.TEXTURE0 + t), e ? ((e._state.id = t), this.bindTexture(e, !1, i), r.commit(i, e), t) : (r.type && (r.boundedTexture && (r.boundedTexture._state.id = -1), this.bindTexture(null, !1, r.type), (r.boundedTexture = null), (r.type = null)), -1) ); }), (t.prototype.setSamplerStateAt = function (t, e, n, r) { if (!this._samplerStates[t]) throw "Sampler is out of bounds."; this._samplerStates[t].set($n[e], Zn[n], tr[n][r]); }), (t.prototype.unsafeCopyToTexture = function (t, e, n) { var r = this._context._gl, i = this.bindTexture(t, !1); r.copyTexSubImage2D( r.TEXTURE_2D, 0, n.x, n.y, e.x, e.y, e.width, e.height ), this.bindTexture(i, !0); }), (t.prototype.setRenderToTexture = function (t, e, n) { void 0 === e && (e = !1), void 0 === n && (n = !0), this._currentRT && this._currentRT.present(), this.setFrameBuffer(t, e, n); }), (t.prototype.setRenderToBackBuffer = function () { this._currentRT && this._currentRT.present(), this.bindRenderTarget(null, !0); }), (t.prototype.setFrameBuffer = function (t, e, n) { var r = t.width, i = t.height; t._renderTarget || this.initFrameBuffer(t, n, e), this.bindRenderTarget(t._renderTarget, !0), e ? (this._context.enableDepth(), this._context.enableStencil()) : (this._context.disableDepth(), this._context.disableStencil()), this._context.setViewport(0, 0, r, i); }), (t.prototype.initFrameBuffer = function (t, e, n) { var r = t.width, i = t.height, o = new Kn(this._context, r, i, !n); if ((o.linkTexture(t), e && 2 === this._context.glVersion)) { var a = new Wn(this._context, r, i, !n); a.linkTarget(o), (o = a); } t._renderTarget = o; }), (t.prototype.presentFrameBufferTo = function (t, e, n, r) { var i = this._context._gl, o = this._currentRT; e._renderTarget || this.initFrameBuffer(e, !1, !1); var a = e._renderTarget.drawBuffer; !t || !t.isMsaaTarget || i instanceof WebGLRenderingContext ? (this.bindRenderTarget(t, !0), this.unsafeCopyToTexture(e, n, r)) : a && (i.bindFramebuffer(i.READ_FRAMEBUFFER, t.drawBuffer), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, a), i.blitFramebuffer( 0 | n.x, 0 | n.y, (n.width + n.x) | 0, (n.height + n.y) | 0, 0 | r.x, 0 | r.y, (r.x + n.width) | 0, (r.y + n.height) | 0, i.COLOR_BUFFER_BIT, i.LINEAR )), this.blitTextureToRenderbuffer(e), this.bindRenderTarget(o, !0); }), (t.prototype.blitTextureToRenderbuffer = function (t) { var e = this._context._gl; if ( t._renderTarget.isMsaaTarget && e instanceof WebGL2RenderingContext ) { var n = t._width, r = t._height; e.bindFramebuffer(e.DRAW_FRAMEBUFFER, t._renderTarget.readBuffer), e.bindFramebuffer(e.READ_FRAMEBUFFER, t._renderTarget.drawBuffer), e.blitFramebuffer( 0, 0, n, r, 0, 0, n, r, e.COLOR_BUFFER_BIT, e.LINEAR ); } }), (t.prototype.disposeTexture = function (t) { var e = this._context._gl; t === this._lastBoundedTexture && (this._lastBoundedTexture = null), e.deleteTexture(t._glTexture), t._renderTarget && t._renderTarget.dispose(); }), (t.MAX_SAMPLERS = 16), t ); })(), fr = (function () { function t(e) { (this._context = e), (this._isRequireUnbound = !1); var n = e._gl; if (!t.isSupported(n)) throw "[VaoContextWebGL] VAO not supported!"; if ( window.WebGL2RenderingContext && n instanceof window.WebGL2RenderingContext ) (this._createVertexArray = n.createVertexArray.bind(n)), (this._deleteVertexArray = n.deleteVertexArray.bind(n)), (this._bindVertexArray = n.bindVertexArray.bind(n)); else { var r = n.getExtension("OES_vertex_array_object"); (this._createVertexArray = r.createVertexArrayOES.bind(r)), (this._deleteVertexArray = r.deleteVertexArrayOES.bind(r)), (this._bindVertexArray = r.bindVertexArrayOES.bind(r)); } } return ( (t.isSupported = function (t) { return ( !!( window.WebGL2RenderingContext && t instanceof window.WebGL2RenderingContext ) || t.getSupportedExtensions().indexOf("OES_vertex_array_object") > -1 ); }), (t.prototype.createVertexArray = function () { return this._context.stats.counter.vao++, this._createVertexArray(); }), (t.prototype.unbindVertexArrays = function () { this._bindVertexArray(null), (this._lastBoundedVao = null), (this._isRequireUnbound = !1); }), (t.prototype.bindVertexArray = function (t) { this._context.stateChangeCallback && this._context.stateChangeCallback("bindVertexArray"), t !== this._lastBoundedVao && (t ? ((this._isRequireUnbound = !1), (this._lastBoundedVao = t), this._bindVertexArray(t._vao)) : (this._isRequireUnbound = !0)); }), (t.prototype.deleteVertexArray = function (t) { this._lastBoundedVao === t && this._bindVertexArray(null), this._deleteVertexArray(t._vao), (this._lastBoundedVao = null), this._context.stats.counter.vao--; }), t ); })(), gr = (function () { function t(t) { (this._context = t), (this._vao = t._vaoContext.createVertexArray()); } return ( (t.prototype.attachIndexBuffer = function (t) { this._indexBuffer || (this.bind(), this._context.bindIndexBuffer(t), (this._indexBuffer = t)); }), (t.prototype.bind = function () { this._context._vaoContext.bindVertexArray(this); }), (t.prototype.unbind = function (t) { void 0 === t && (t = !1), t ? this._context._vaoContext.unbindVertexArrays() : this._context._vaoContext.bindVertexArray(null); }), (t.prototype.dispose = function () { this._context._vaoContext.deleteVertexArray(this), (this._vao = null); }), t ); })(), _r = (function () { function t() { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; (this.values = []), (this.fixedValues = []), (this.dirty = !0), (this._deltaDirty = []), (this._locked = !1), (this.values = Array.prototype.slice.call(arguments)); } return ( (t.prototype.lock = function (t) { if (((this._locked = t), t)) { for (var e = this.values, n = 0, r = e.length; n < r; n++) this.fixedValues[n] = e[n]; (this.fixedValues.length = e.length), (this.dirty = !1); } }), (t.prototype.set = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for ( var n = this._locked ? this.fixedValues : this.values, r = this.values, i = !1, o = 0; o < t.length; o++ ) (i = i || n[o] !== t[o]), (r[o] = t[o]); return (this.dirty = i); }), (t.prototype.setAt = function (t, e) { var n = (this._locked ? this.fixedValues : this.values)[t] !== e; return (this.values[t] = e), (this.dirty = this.dirty || n), n; }), (t.prototype.deltaDirty = function () { var t = this._deltaDirty, e = this.values, n = this.fixedValues; t.length = e.length; for (var r = 0; r < e.length; r++) t[r] = e[r] !== n[r]; return t; }), (t.prototype.reset = function () { this.set(); }), t ); })(), mr = (function () { function t(t, e) { void 0 === e && (e = 0), (this._contex = t), (this._alreadyInit = !1), (this._size = 0), (this._gl = t._gl), (this._buffer = this._gl.createBuffer()), (this._size = e), t.stats.counter.pbo++; } return ( (t.unboundAll = function () { this._lastBounded && this._lastBounded.unbind(); }), (t.isSuported = function (t) { return ( window.WebGL2RenderingContext && t instanceof window.WebGL2RenderingContext ); }), Object.defineProperty(t.prototype, "alive", { get: function () { return !!this._buffer; }, enumerable: !1, configurable: !0, }), (t.prototype.read = function (e) { var n = e.length; if (n <= 0 || n !== this._size) throw "Buffer length MUST be a same size as buffer on read state!"; var r = this._gl; t._lastBounded !== this && (r.bindBuffer(r.PIXEL_PACK_BUFFER, this._buffer), (t._lastBounded = this)), r.getBufferSubData(r.PIXEL_PACK_BUFFER, 0, e); }), (t.prototype.bind = function (e) { if ((void 0 === e && (e = 0), 0 === this._size && 0 === e)) throw "Buffer require size for bounding"; var n = this._gl; t._lastBounded !== this && n.bindBuffer(n.PIXEL_PACK_BUFFER, this._buffer), (!this._alreadyInit || (this._size !== e && e > 0)) && ((this._contex.stats.memory.pbo -= this._size), e > 0 && (this._size = e), n.bufferData(n.PIXEL_PACK_BUFFER, this._size, n.DYNAMIC_READ), (this._alreadyInit = !0), (this._contex.stats.memory.pbo += this._size)), (t._lastBounded = this); }), (t.prototype.unbind = function () { t._lastBounded === this && (this._gl.bindBuffer(this._gl.PIXEL_PACK_BUFFER, null), (t._lastBounded = null)); }), (t.prototype.dispose = function () { this.unbind(), this._gl.deleteBuffer(this._buffer), (this._buffer = null), (this._size = 0), (this._gl = null), this._contex.stats.counter.pbo--, (this._contex.stats.memory.pbo += this._size); }), t ); })(), yr = (function () { function t(t) { (this._context = t), (this.pool = []), (this._tasks = []), (this._gl = t._gl); } return ( (t.prototype.readPixels = function (t, e, n, r) { var i = this, o = this.pool.pop() || new mr(this._context); o.bind(n * r * 4); var a = this._gl; a.readPixels(t, e, n, r, a.RGBA, a.UNSIGNED_BYTE, 0); var s = a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE, 0); return a.isSync(s) ? new Promise(function (t) { i._tasks.push({ task: t, pbo: o, fence: s }); }) : (console.warn( "[FenceContextWebGL] Fence return invalid state, closig task immediate:", s ), Promise.resolve(o)); }), (t.prototype.tick = function () { if (0 !== this._tasks.length) { var t = this._gl, e = this._tasks; this._tasks = []; for (var n = 0; n < e.length; n++) { var r = e[n], i = !1; t.isSync(r.fence) || (console.warn( "[FenceContextWebGL] Task has invalid fence state, closig task immediate:", r.fence ), (i = !0)), i || t.getSyncParameter(r.fence, t.SYNC_STATUS) === t.SIGNALED ? (r.task(r.pbo), t.deleteSync(r.fence), (e[n] = void 0)) : this._tasks.push(r); } } }), (t.prototype.release = function (t) { t.alive && this.pool.push(t); }), (t.prototype.unboundAll = function () { mr.unboundAll(); }), (t.prototype.dispose = function () { (this._tasks = null), this.pool.forEach(function (t) { return t.dispose(); }), (this.pool = []), (this._gl = null); }), (t.isSupported = mr.isSuported), t ); })(), Ar = (function () { function t() { (this.counter = { index: 0, vertex: 0, vao: 0, texture: 0, renderTarget: 0, program: 0, pbo: 0, total: 0, }), (this.memory = { index: 0, vertex: 0, texture: 0, renderTarget: 0, pbo: 0, get total() { return ( this.index + this.vertex + this.texture + this.renderTarget + this.pbo ); }, }); } return ( (t.prototype.toTableLikeMB = function () { var t = {}; for (var e in this.counter) t[e] = { count: this.counter[e], memory: (this.memory[e] || 0) / 1048576, }; return t; }), (t.prototype.toString = function () { var t = this.toTableLikeMB(), e = [ "\n" + "type".padStart(16, " ") + " | " + "count".padStart(5) + " | " + "mem MB".padStart(6) + "\n", ]; for (var n in t) e.push( n.padStart(16) + " | " + t[n].count.toFixed().padStart(5) + " | " + t[n].memory.toFixed(4).padStart(8) ); return e.join("\n") + "\n"; }), (t.prototype.toTableConsole = function () { console.table(this.toTableLikeMB()); }), t ); })(), vr = ""; window._AWAY_DEBUG_ = Object.assign(window._AWAY_DEBUG_ || {}, { forceLineMode: function (t) { void 0 === t && (t = !1), (vr = t ? "line" : ""); }, }); var br, Cr, Ir = (function () { function t(t, e) { void 0 === e && (e = !1), (this.stats = new Ar()), (this._drawing = !0), (this._viewportState = new _r(0, 0, 0, 0)), (this._blendState = new _r(0, ir[qt.ADD], ir[qt.ADD], 0, 0, -1, -1)), (this._colorMapState = new _r(!0, !0, !0, !0)), (this._clearColorState = new _r(0, 0, 0, 0)), (this._clearSD = new _r(0, -1)), (this._depthState = new _r(0, 0, 0)), (this._stencilState = new _r(0, 1, 0)), (this._cullState = new _r(0, 0, 0)), (this._stencilReferenceValue = 0), (this._stencilReadMask = 255), (this._separateStencil = !1), (this._lastBoundedIndexBuffer = null), (this._hasVao = !1), (this._instancedEnabled = !1), (this._instancesCount = 1), (this._container = t), this.initWebGL(e); } return ( (t.prototype.hasInstancing = function () { return ( this._gl instanceof self.WebGL2RenderingContext || !!this._angleInstanced ); }), Object.defineProperty(t.prototype, "hasFence", { get: function () { return !!this._fenceContext; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "hasVao", { get: function () { return this._hasVao; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "glVersion", { get: function () { return this._glVersion; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "pixelRatio", { get: function () { return this._pixelRatio; }, set: function (t) { this._pixelRatio = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "container", { get: function () { return this._container; }, set: function (t) { (this._container = t), this.initWebGL(); }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "standardDerivatives", { get: function () { return this._standardDerivatives; }, enumerable: !1, configurable: !0, }), (t.prototype.assertLost = function (t) {}), (t.prototype.initWebGL = function (t) { void 0 === t && (t = !1); var e = { alpha: t, antialias: De.ENABLE_ANTIALIAS, stencil: !0 }; try { 2 === De.PREF_WEBGL_VERSION && ((this._gl = this._container.getContext("webgl2", e)), (this._glVersion = 2)), this._gl || ((this._gl = this._container.getContext("webgl", e) || this._container.getContext("experimental-webgl", e)), (this._glVersion = 1), 2 === De.PREF_WEBGL_VERSION && console.warn( "[CONTEXT] Preferred WebGL2 not supported on you device. WebGL1 will used!" )), console.debug( "[CONTEXT] Preferred WebGL: " + De.PREF_WEBGL_VERSION + ", used: " + this._glVersion ); } catch (t) {} if (this._gl) { var n = this._gl; (this._standardDerivatives = 2 === this._glVersion || !!n.getExtension("OES_standard_derivatives")), (this._stencilCompareMode = n.ALWAYS), (this._stencilCompareModeBack = n.ALWAYS), (this._stencilCompareModeFront = n.ALWAYS), (this._pixelRatio = self.devicePixelRatio || 1); } else alert("WebGL is not available."); (this._texContext = new dr(this)), fr.isSupported(this._gl) ? ((this._vaoContext = new fr(this)), (this._hasVao = !0)) : console.warn("[ContextWebGL] VAO isn't supported"), yr.isSupported(this._gl) ? (this._fenceContext = new yr(this)) : console.warn("[ContextWebGL] FenceSync isn't supported"), 1 === this._glVersion && (this._angleInstanced = this._gl.getExtension( "ANGLE_instanced_arrays" )), this._blendState.lock(!0), (window._AWAY_CONTEXT_STATS_ = this.stats); }), (t.prototype.gl = function () { return this._gl; }), (t.prototype.clear = function (t, e, n, r, i, o, a) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 1), void 0 === i && (i = 1), void 0 === o && (o = 0), void 0 === a && (a = Kt.ALL), this.stateChangeCallback && this.stateChangeCallback("clear"), this._drawing || (this.updateBlendStatus(), (this._drawing = !0)); var s = 0; a & Kt.COLOR && (this._clearColorState.set(t, e, n, r) && this._gl.clearColor(t, e, n, r), (s |= this._gl.COLOR_BUFFER_BIT)), a & Kt.STENCIL && ((s |= this._gl.STENCIL_BUFFER_BIT), this._clearSD.setAt(0, o) && this._gl.clearStencil(o)), a & Kt.DEPTH && ((s |= this._gl.DEPTH_BUFFER_BIT), this._clearSD.setAt(0, i) && this._gl.clearDepth(i)), this._gl.clear(s); }), (t.prototype.configureBackBuffer = function (t, e, n, r) { void 0 === r && (r = !0), this.stateChangeCallback && this.stateChangeCallback("setBackBuffer"), (this._width = t * this._pixelRatio), (this._height = e * this._pixelRatio), r ? (this.enableStencil(), this.enableDepth()) : (this.disableStencil(), this.disableDepth()), this._viewportState.set(0, 0, this._width, this._height) && this._gl.viewport(0, 0, this._width, this._height); }), (t.prototype.createCubeTexture = function (t, e, n, r) { return new jn(this, t); }), (t.prototype.createIndexBuffer = function (t) { return Qn.create(this, t); }), (t.prototype.createProgram = function () { return new Hn(this); }), (t.prototype.createTexture = function (t, e, n, r, i) { return Xn.create(this, t, e); }), (t.prototype.createVertexBuffer = function (t, e) { return Yn.create(this, t, e); }), (t.prototype.createVao = function () { if (!this._hasVao) throw "VAO isn'n supported"; return new gr(this); }), (t.prototype.dispose = function () {}), (t.prototype.drawToBitmapImage2D = function (t, e, n) { void 0 === e && (e = !0), void 0 === n && (n = !1), this.stateChangeCallback && this.stateChangeCallback("drawToBitmap"); var r, i = new Uint8Array(t.getDataInternal().buffer), o = this._texContext._currentRT, a = this._fenceContext, s = t.width, u = t.height; n && !a && (r = Promise.resolve(!1)); var l = this._texContext._currentRT; return ( o.isMsaaTarget && (o.present(), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, o.readBuffer)), n && a ? (r = a.readPixels(0, 0, s, u).then(function (n) { return n.read(i), e && t.invalidateGPU(), a.release(n), !0; })) : (a && a.unboundAll(), this._gl.readPixels( 0, 0, s, u, this._gl.RGBA, this._gl.UNSIGNED_BYTE, i ), e && t.invalidateGPU()), this._texContext.bindRenderTarget(l, !1), r ); }), (t.prototype.beginInstancedRender = function (t) { if ((void 0 === t && (t = 1), !this.hasInstancing())) throw "Instanced rendering not supported"; (this._instancedEnabled = !0), (this._instancesCount = t); }), (t.prototype.drawIndices = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = -1), this.stateChangeCallback && this.stateChangeCallback("drawIndices"); var i = this._gl; if (!this._drawing) throw "Need to clear before drawing if the buffer has not been cleared since the last present() call."; this.updateBlendStatus(), this._lastBoundedIndexBuffer && !this._lastBoundedIndexBuffer.glBuffer && (this._lastBoundedIndexBuffer = null), (this._hasVao && this._vaoContext._lastBoundedVao) || (this._lastBoundedIndexBuffer !== e && i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, e.glBuffer), (this._lastBoundedIndexBuffer = e)), (t = "line" === vr ? Jt.LINES : t); var o = or[t], a = -1 == r ? e.numIndices : r, s = i.UNSIGNED_SHORT, u = 2 * n, l = this._instancesCount; this._instancedEnabled ? this._angleInstanced ? this._angleInstanced.drawElementsInstancedANGLE(o, a, s, u, l) : i.drawElementsInstanced(o, a, s, u, l) : i.drawElements(o, a, s, u), (this._instancedEnabled = !1), (this._instancesCount = 1), this.assertLost("drawElements"); }), (t.prototype.bindIndexBuffer = function (t) { this.stateChangeCallback && this.stateChangeCallback("bindIndexBuffer"), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, t.glBuffer), (this._lastBoundedIndexBuffer = t); }), (t.prototype.drawVertices = function (t, e, n) { if ( (void 0 === e && (e = 0), void 0 === n && (n = -1), !this._drawing) ) throw "Need to clear before drawing if the buffer has not been cleared since the last present() call."; if ( (this.stateChangeCallback && this.stateChangeCallback("drawVertices"), 0 != n) ) { this.updateBlendStatus(), (t = "line" === vr ? Jt.LINES : t); var r = or[t], i = this._instancesCount; this._instancedEnabled ? this._angleInstanced ? this._angleInstanced.drawArraysInstancedANGLE(r, e, n, i) : this._gl.drawArraysInstanced(r, e, n, i) : this._gl.drawArrays(r, e, n), (this._instancedEnabled = !1), (this._instancesCount = 1), this.assertLost("drawArrays"); } }), (t.prototype.present = function () { this.stateChangeCallback && this.stateChangeCallback("present"), this._fenceContext && this._fenceContext.tick(); }), (t.prototype.setBlendState = function (t) { this.stateChangeCallback && this.stateChangeCallback("setBlendState"), this._blendState.setAt(0, +t); }), (t.prototype.setBlendEquation = function (t, e) { void 0 === e && (e = t), this._blendState.setAt(1, ir[t]), this._blendState.setAt(2, ir[e]); }), (t.prototype.setBlendFactors = function (t, e, n, r) { this.stateChangeCallback && this.stateChangeCallback("setBlendFactors"); var i = rr[t], o = rr[e], a = this._gl; if (null == n) this._blendState.set(1, a.FUNC_ADD, a.FUNC_ADD, i, o, -1, -1); else { if (typeof n != typeof r) throw "[Context] sourceAlphaFactor and destinationAlphaFactor MUST be BOTH presented for separated blend mode"; var s = rr[n], u = rr[r]; this._blendState.set(1, a.FUNC_ADD, a.FUNC_ADD, i, o, s, u); } }), (t.prototype.setColorMask = function (t, e, n, r) { this.stateChangeCallback && this.stateChangeCallback("setColorMask"), this._colorMapState.set(t, e, n, r) && this._gl.colorMask(t, e, n, r); }), (t.prototype.setCulling = function (t, e) { if ( (void 0 === e && (e = _t.LEFT_HANDED), this.stateChangeCallback && this.stateChangeCallback("setCulling"), t === ie.NONE) ) this._cullState.setAt(0, 0) && this._gl.disable(this._gl.CULL_FACE); else { this._cullState.setAt(0, 1) && this._gl.enable(this._gl.CULL_FACE); var n = this.translateTriangleFace(t, e); this._cullState.setAt(1, n) && this._gl.cullFace(n); } }), (t.prototype.setDepthTest = function (t, e) { this.stateChangeCallback && this.stateChangeCallback("setDepthTest"); var n = sr[e]; this._depthState.setAt(1, +t) && this._gl.depthMask(t), this._depthState.setAt(2, n) && this._gl.depthFunc(n); }), (t.prototype.setViewport = function (t, e, n, r) { this.stateChangeCallback && this.stateChangeCallback("setViewport"), this._viewportState.set(t, e, n, r) && this._gl.viewport(t, e, n, r); }), (t.prototype.enableDepth = function () { this.stateChangeCallback && this.stateChangeCallback("enableDepth"), this._depthState.setAt(0, 1) && this._gl.enable(this._gl.DEPTH_TEST); }), (t.prototype.disableDepth = function () { this.stateChangeCallback && this.stateChangeCallback("disableDepth"), this._depthState.setAt(0, 0) && this._gl.disable(this._gl.DEPTH_TEST); }), (t.prototype.enableStencil = function () { this.stateChangeCallback && this.stateChangeCallback("enableStencil"), this._stencilState.setAt(0, 1) && this._gl.enable(this._gl.STENCIL_TEST); }), (t.prototype.disableStencil = function () { this.stateChangeCallback && this.stateChangeCallback("disableStencil"), this._stencilState.setAt(0, 0) && this._gl.disable(this._gl.STENCIL_TEST); }), (t.prototype.setStencilActions = function (t, e, n, r, i, o) { void 0 === t && (t = ie.FRONT_AND_BACK), void 0 === e && (e = Wt.ALWAYS), void 0 === n && (n = ee.KEEP), void 0 === r && (r = ee.KEEP), void 0 === i && (i = ee.KEEP), void 0 === o && (o = _t.LEFT_HANDED), this.stateChangeCallback && this.stateChangeCallback("setStencilActions"), (this._separateStencil = t != ie.FRONT_AND_BACK); var a = sr[e], s = lr[i], u = lr[r], l = lr[n]; this._separateStencil ? t == ie.BACK ? ((this._stencilCompareModeBack = a), this._gl.stencilFuncSeparate( this._gl.BACK, a, this._stencilReferenceValue, this._stencilReadMask ), this._gl.stencilOpSeparate(this._gl.BACK, s, u, l)) : t == ie.FRONT && ((this._stencilCompareModeFront = a), this._gl.stencilFuncSeparate( this._gl.FRONT, a, this._stencilReferenceValue, this._stencilReadMask ), this._gl.stencilOpSeparate(this._gl.FRONT, s, u, l)) : ((this._stencilCompareMode = a), this._gl.stencilFunc( a, this._stencilReferenceValue, this._stencilReadMask ), this._gl.stencilOp(s, u, l)), this.assertLost("setStencilActions"); }), (t.prototype.setStencilReferenceValue = function (t, e, n) { void 0 === e && (e = 255), void 0 === n && (n = 255), this.stateChangeCallback && this.stateChangeCallback("setStencilReferenceValue"), (this._stencilReferenceValue = t), (this._stencilReadMask = e), this._separateStencil ? (this._gl.stencilFuncSeparate( this._gl.FRONT, this._stencilCompareModeFront, t, e ), this._gl.stencilFuncSeparate( this._gl.BACK, this._stencilCompareModeBack, t, e )) : this._gl.stencilFunc(this._stencilCompareMode, t, e), this._gl.stencilMask(n), this.assertLost("setStencilReferenceValue"); }), (t.prototype.setProgram = function (t) { this._currentProgram !== t && (this.stateChangeCallback && this.stateChangeCallback("setProgram"), (this._currentProgram = t), t.focusProgram(), this.assertLost("setProgram")); }), (t.prototype.setProgramConstantsFromArray = function (t, e) { e.length && this._currentProgram.uniform4fv(t, e); }), (t.prototype.setScissorRectangle = function (t) { if ( (this.stateChangeCallback && this.stateChangeCallback("setScissorRectangle"), t) ) { var e = !!this._texContext._currentRT ? 1 : this._pixelRatio; this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(t.x * e, t.y * e, t.width * e, t.height * e), this.assertLost("scissor"); } else this._gl.disable(this._gl.SCISSOR_TEST); }), (t.prototype.setTextureAt = function (t, e) { this.stateChangeCallback && this.stateChangeCallback("setTextureAt"); var n = this._texContext.setTextureAt(t, e); n >= 0 && this._currentProgram.uniform1i(te.SAMPLER, t, n); }), (t.prototype.setSamplerStateAt = function (t, e, n, r) { this.stateChangeCallback && this.stateChangeCallback("setSamplerStateAt"), this._texContext.setSamplerStateAt(t, e, n, r), this.assertLost("setSamplerStateAt"); }), (t.prototype.setVertexBufferAt = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = 4), this.stateChangeCallback && this.stateChangeCallback("setVertexBufferAt"); var i = this._currentProgram ? this._currentProgram.getAttribLocation(t) : -1, o = this._gl; if ( (this.hasVao && this._vaoContext._isRequireUnbound && this._vaoContext.unbindVertexArrays(), e) ) { (this._currentArrayBuffer != e || (this.hasVao && this._vaoContext._lastBoundedVao)) && ((this._currentArrayBuffer = e), o.bindBuffer(o.ARRAY_BUFFER, e ? e.glBuffer : null)); var a = pr[r]; o.enableVertexAttribArray(i), o.vertexAttribPointer( i, a.size, a.type, a.normalized, e.dataPerVertex, n ), this._instancedEnabled && e.instanced && (this._angleInstanced ? this._angleInstanced.vertexAttribDivisorANGLE(i, 1) : o.vertexAttribDivisor(i, 1)), this.assertLost("setVertexBufferAt"); } else i > -1 && o.disableVertexAttribArray(t); }), (t.prototype.setRenderToTexture = function (t, e, n, r, i) { void 0 === e && (e = !1), void 0 === n && (n = 0), this.stateChangeCallback && this.stateChangeCallback("setRenderToTexture"), this._texContext.setRenderToTexture(t, e, n > 1), this.assertLost("setRenderToTexture"); }), (t.prototype.setRenderToBackBuffer = function () { this.stateChangeCallback && this.stateChangeCallback("setRenderToBackBuffer"), this._texContext.setRenderToBackBuffer(), this.assertLost("setRenderToBackBuffer"); }), (t.prototype.copyToTexture = function (t, e, n) { if ( (this.stateChangeCallback && this.stateChangeCallback("setRenderToBackBuffer"), !this._texContext._currentRT) ) throw "[ContextWebGL] Try to copy from invalid frambuffer"; this._texContext.presentFrameBufferTo( this._texContext._currentRT, t, e, n ), this.assertLost("copyToTexture"); }), (t.prototype.updateBlendStatus = function () { var t = this._blendState; if (t.dirty) { var e = t.values, n = t.deltaDirty(); t.lock(!0), e[0] || !n[0] ? (n[0] && this._gl.enable(this._gl.BLEND), (n[0] || n[1] || n[2]) && (e[1] !== e[2] ? this._gl.blendEquationSeparate(e[1], e[2]) : this._gl.blendEquation(e[1])), (n[0] || n[3] || n[4] || -1 !== e[5]) && (-1 !== e[5] ? this._gl.blendFuncSeparate(e[3], e[4], e[5], e[6]) : this._gl.blendFunc(e[3], e[4]))) : this._gl.disable(this._gl.BLEND); } }), (t.prototype.finish = function () { this._gl.flush(), this._gl.finish(), this._fenceContext && this._fenceContext.tick(), this.assertLost("finish"); }), (t.prototype.translateTriangleFace = function (t, e) { switch (t) { case ie.BACK: return e == _t.LEFT_HANDED ? this._gl.FRONT : this._gl.BACK; case ie.FRONT: return e == _t.LEFT_HANDED ? this._gl.BACK : this._gl.FRONT; case ie.FRONT_AND_BACK: return this._gl.FRONT_AND_BACK; default: throw "Unknown ContextGLTriangleFace type."; } }), t ); })(), Er = (function (t) { function n() { var e = t.call(this, 256, 256, !0) || this; return ( (e._data = new Uint8Array(262144)), (e._gradMap = {}), (e._count = 0), e ); } return ( e(n, t), (n.getAtlassForHash = function (t, e) { var r; void 0 === e && (e = !0); for (var i = 0, o = this.gradientAtlasses; i < o.length; i++) { if ((u = o[i]).hasGradient(t)) { r = u; break; } } if (r) return r; if (!e) return null; for (var a = 0, s = this.gradientAtlasses; a < s.length; a++) { var u; if (!(u = s[a]).full) return u; } return (r = new n()), this.gradientAtlasses.push(r), r; }), (n.computeHash = function (t, e, n) { return ( t.join("") + e.map(function (t) { return (255 * t) | 0; }) + n.join("") ); }), Object.defineProperty(n.prototype, "full", { get: function () { return 256 === this._count; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "lenght", { get: function () { return this._count; }, enumerable: !1, configurable: !0, }), (n.prototype.hasGradient = function (t) { return t in this._gradMap; }), (n.prototype.getGradient = function (t) { return this._gradMap[t]; }), (n.prototype.setGradient = function (t, e, r) { if (!t || !e || !r) return null; if (0 !== r.length) { var i = n.computeHash(t, e, r); if (i in this._gradMap) return this._gradMap[i]; if (256 === this._count) return null; var o = this._count; return ( this._count++, this.fillRow(t, e, r, o), (this._gradMap[i] = { index: o, hash: i }) ); } }), (n.prototype.fillRow = function (t, e, n, r) { var i = n.length, o = [0, 0, 0, 0], a = [0, 0, 0, 0], s = new Uint8Array(this._data.buffer, 1024 * r, 1024); s.fill(0); for (var u = 0; u < i - 1; u++) { bn.colorToU8(t[u + 0], e[u + 0], o), bn.colorToU8(t[u + 1], e[u + 1], a); for (var l = n[u + 0], c = n[u + 1], h = l; h < c; h++) { var p = (h - l) / (c - l), d = 4 * h; (s[d + 0] = (o[0] + (a[0] - o[0]) * p) | 0), (s[d + 1] = (o[1] + (a[1] - o[1]) * p) | 0), (s[d + 2] = (o[2] + (a[2] - o[2]) * p) | 0), (s[d + 3] = (o[3] + (a[3] - o[3]) * p) | 0); var f = s[d + 3] / 255; (s[d + 0] = (s[d + 0] * f) | 0), (s[d + 1] = (s[d + 1] * f) | 0), (s[d + 2] = (s[d + 2] * f) | 0); } } this.invalidate(); }), (n.gradientAtlasses = []), n ); })(ke), xr = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.getTexture = function () { return ( t.prototype.getTexture.call(this), this._invalid && this._texture.uploadFromArray(this._asset._data, 0, !1), (this._invalid = !1), this._texture ); }), n ); })(Ue), wr = (function (t) { function n() { var e = t.call(this) || this; return ( (e.activateInternaly = !1), (e._currentIndex = 0), (e._gradInvalid = !1), (e._renderMode = "color"), (e._shadowColor = 0), (e._shadowAlpha = 1), (e._highlightColor = 1048575), (e._highlightAlpha = 1), (e._dirInvalid = !1), (e._angle = 45), (e._distance = 4), (e.strength = 1), (e._knockout = !1), (e._type = "inner"), (e._focusId = -1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "name", { get: function () { return "BevelTask:" + this._renderMode; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "renderMode", { get: function () { return this._renderMode; }, set: function (t) { t !== this._renderMode && ((this._renderMode = t), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "shadowColor", { get: function () { return this._shadowColor; }, set: function (t) { this.shadowColor !== t && ((this._shadowColor = t), (this._gradInvalid = !0), (this.renderMode = "color")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "shadowAlpha", { get: function () { return this._shadowAlpha; }, set: function (t) { t !== this._shadowAlpha && ((this._shadowAlpha = t), (this._gradInvalid = !0), (this.renderMode = "color")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "highlightColor", { get: function () { return this._highlightColor; }, set: function (t) { this._highlightColor !== t && ((this._highlightColor = t), (this._gradInvalid = !0), (this.renderMode = "color")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "highlightAlpha", { get: function () { return this._highlightAlpha; }, set: function (t) { this._highlightAlpha !== t && ((this._highlightAlpha = t), (this._gradInvalid = !0), (this.renderMode = "color")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "angle", { get: function () { return this._angle; }, set: function (t) { t !== this._angle && ((this._angle = t), (this._dirInvalid = !0)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "distance", { get: function () { return this._distance; }, set: function (t) { t !== this._distance && ((this._distance = t), (this._dirInvalid = !0)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "colors", { get: function () { return this._colors; }, set: function (t) { (this._colors = t), t.length && ((this._gradInvalid = !0), (this.renderMode = "gradient")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "alphas", { get: function () { return this._alphas; }, set: function (t) { (this._alphas = t), t.length && ((this._gradInvalid = !0), (this.renderMode = "gradient")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "ratios", { get: function () { return this._ratios; }, set: function (t) { (this._ratios = t), t.length && ((this._gradInvalid = !0), (this.renderMode = "gradient")); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "knockout", { get: function () { return this._knockout; }, set: function (t) { t !== this._knockout && ((this._knockout = t), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "type", { get: function () { return this._type; }, set: function (t) { t !== this._type && ((this._type = t), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), (n.prototype.getVertexCode = function () { return "\nprecision highp float;\nuniform vec4 uTexMatrix[2];\nuniform vec4 uTexMatrixSource;\n\n/* AGAL legacy atribb resolver MUST reolver this as va0 */\nattribute vec4 aPos; // position\n\nvarying vec2 vUv[2];\n\nvoid main() {\n\tvec4 pos = aPos;\n\n\tpos.xy = pos.xy * uTexMatrix[0].zw + uTexMatrix[0].xy;\n\tpos.z = pos.z * 2.0 - pos.w;\n\n gl_Position = pos;\n\n\tvUv[0] = clamp((aPos.xy * uTexMatrix[1].zw) + uTexMatrix[1].xy, 0., 1.);\n\tvUv[1] = clamp((aPos.xy * uTexMatrixSource.zw) + uTexMatrixSource.xy , 0., 1.);\n}\n\n"; }), (n.prototype.getFragmentCode = function () { var t, e, n; return ( (t = this._renderMode), (e = this._knockout), (n = this._type), void 0 === t && (t = "color"), void 0 === e && (e = !1), void 0 === n && (n = "inner"), "\nprecision highp float;\nvarying vec2 vUv[2];\n\nuniform float uStrength;\nuniform vec2 uDir;\n\n/* AGAL uniforms will be reolved this as fs0 */\n// blur\nuniform sampler2D uBlur;\n/* AGAL uniforms will be reolved this as fs1 */\n// source\nuniform sampler2D uSource;\n" + ("color" === t ? "\nuniform vec4 uHColor;\nuniform vec4 uSColor;\n\nvec4 bevel(float shadow, float high) {\n\tfloat factor = high - shadow;\n\n\tshadow = min(1., max(0., factor) * uStrength) * uSColor.a;\n\thigh = min(1., max(0., -factor) * uStrength) * uHColor.a;\n\n\treturn vec4(uSColor.rgb * shadow + uHColor.rgb * high, shadow + high);\n}" : "\n// gradient\nuniform sampler2D uGrad;\nuniform float uGradIndex;\n\nvec4 bevel(float shadow, float high) {\n\tshadow *= uStrength;\n\thigh *= uStrength;\n\n\tvec2 pos = vec2(0.5 * (1. + shadow - high), uGradIndex);\n\n\treturn texture2D(uGrad, pos) * (shadow + high);\n}") + "\n\nvoid main() {\n\tvec4 color = texture2D(uSource, vUv[1]);\n\t\n\tfloat a = color.a;\n\n\t// LOOL.. there are a bug - we PMA it twice, devide to compense\n\t// if (a > 0.) color.a /= a;\n\n\tfloat shadow = texture2D(uBlur, vUv[0] + uDir).a;\n\tfloat high = texture2D(uBlur, vUv[0] - uDir).a;\n\t" + (n && "inner" !== n ? "" : "vec4 outColor = bevel(shadow, high) * color.a;") + "\n\t" + ("outer" === n ? "vec4 outColor = bevel(shadow, high) * (1.0 - color.a);" : "") + "\n\t" + ("full" === n ? "vec4 outColor = bevel(shadow, high);" : "") + "\n\t" + (e ? "gl_FragColor = outColor;" : "gl_FragColor = color * (1.0 - outColor.a) + outColor;") + "\n\n\t//gl_FragColor *= a;\n}" ); }), (n.prototype._regenColorMap = function () { if (this._gradInvalid && "gradient" === this._renderMode) { var t = Er.computeHash(this._colors, this._alphas, this._ratios); if (((this._gradInvalid = !1), this._currentHash !== t)) { var e = (this._currentAtlass = Er.getAtlassForHash(t, !0)); e.hasGradient(t) ? (this._currentIndex = e.getGradient(t).index) : (this._currentIndex = e.setGradient( this._colors, this._alphas, this.ratios ).index), (this._currentHash = t), (this._gradInvalid = !1); } } }), (n.prototype.preActivate = function (t) { "gradient" === this._renderMode && this._regenColorMap(); }), (n.prototype.activate = function (e, n, r) { t.prototype.computeVertexData.call(this); var i = this._source, o = this.inputRect, a = this.sourceImage, s = this._program3D, u = s.focusId !== this._focusId; if ( (s.uploadUniform("uTexMatrix", this._vertexConstantData), u || this._dirInvalid) ) { var l = (this.angle * Math.PI) / 180; s.uploadUniform("uDir", [ (Math.cos(l) * this.distance) / i.width, (Math.sin(l) * this.distance) / i.height, ]); } s.uploadUniform("uStrength", this.strength), s.uploadUniform("uTexMatrixSource", [ 0, 0, o.width / a.width, o.height / a.height, ]), i.getAbstraction(e).activate(0), a.getAbstraction(e).activate(1), "gradient" === this._renderMode ? (this._currentAtlass.getAbstraction(e).activate(2), s.uploadUniform( "uGradIndex", this._currentIndex / this._currentAtlass.height )) : (this._gradInvalid || u) && (s.uploadUniform( "uSColor", bn.colorToArray(this._shadowColor, this._shadowAlpha) ), s.uploadUniform( "uHColor", bn.colorToArray(this._highlightColor, this._highlightAlpha) )), (this._focusId = s.focusId), (this._dirInvalid = !1); }), n ); })(yn), Sr = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n._bevelTask = new wr()), (n.distance = 1), (n.angle = 45), (n.highlightColor = 16777215), (n.highlightAlpha = 1), (n.shadowColor = 1), (n.shadowAlpha = 0), (n.alphas = []), (n.colors = []), (n.ratios = []), (n.strength = 1), (n.type = "inner"), (n.knockout = !1), n.addTask(n._bevelTask), n.applyProps(e), n ); } return ( e(n, t), (n.prototype.applyProps = function (t) { for (var e = 0, n = this[In]; e < n.length; e++) { var r = n[e]; r in t && (this[r] = t[r]); } }), (n.prototype.meashurePad = function (t, e) { void 0 === e && (e = t); var n = bn.meashureBlurPad(this.blurX, this.blurY, 3, !1); e.copyFrom(t); var r = this.distance; if ("inner" !== this.type && r > 0) { var i = (this.angle * Math.PI) / 180; (n.x += Math.sin(i) * r * 2), (n.y += Math.sin(i) * r * 2); } return ( (e.x -= n.x), (e.y -= n.y), (e.width += n.x), (e.height += n.y), e ); }), (n.prototype.setRenderState = function (e, n, r, i, o) { t.prototype.setRenderState.call(this, e, n, r, i, o); var a = this._hBlurTask.target, s = o.popTemp(a.width, a.height); this._bevelTask.inputRect.copyFrom(this._vBlurTask.inputRect), this._bevelTask.destRect.copyFrom(i), this._vBlurTask.inputRect.setTo(0, 0, 0, 0), this._vBlurTask.destRect.setTo(0, 0, 0, 0), (this._vBlurTask.target = s), (this._bevelTask.source = s), (this._bevelTask.sourceImage = e), (this._bevelTask.target = n), this._temp.push(s); }), (n.filterName = "bevel"), i([En, Cn("_bevelTask")], n.prototype, "distance", void 0), i([En, Cn("_bevelTask")], n.prototype, "angle", void 0), i([En, Cn("_bevelTask")], n.prototype, "highlightColor", void 0), i([En, Cn("_bevelTask")], n.prototype, "highlightAlpha", void 0), i([En, Cn("_bevelTask")], n.prototype, "shadowColor", void 0), i([En, Cn("_bevelTask")], n.prototype, "shadowAlpha", void 0), i([En, Cn("_bevelTask")], n.prototype, "alphas", void 0), i([En, Cn("_bevelTask")], n.prototype, "colors", void 0), i([En, Cn("_bevelTask")], n.prototype, "ratios", void 0), i([En, Cn("_bevelTask")], n.prototype, "strength", void 0), i([En], n.prototype, "quality", void 0), i([En, Cn("_bevelTask")], n.prototype, "type", void 0), i([En, Cn("_bevelTask")], n.prototype, "knockout", void 0), n ); })(Rn), Dr = new Float32Array([1, 1, 1, 1, 0, 0, 0, 0]), Tr = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, ]), Pr = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e.activateInternaly = !1), (e._dataChanged = !1), (e._mode = ""), (e._focusId = -1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "transform", { get: function () { return this._transform; }, set: function (t) { if (this._transform !== t || t) { if ( ((this._transform = t), (this._dataChanged = !0), (this._fragData && 8 === this._fragData.length) || (this._fragData = new Float32Array(8)), t) ) { this._fragData.set(t._rawData); for (var e = 4; e < 8; e++) this._fragData[e] /= 255; this._fragData[7] > 0 && (this._fragData[7] = 0); } else this._fragData.set(Dr); var n = t ? "transform" : ""; this._mode !== n && ((this._mode = n), this.invalidateProgram()); } }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "matrix", { get: function () { return this._matrix; }, set: function (t) { if ( ((this._matrix = t), (this._fragData && 20 === this._fragData.length) || (this._fragData = new Float32Array(20)), t) ) for (var e = 0; e < 4; e++) { for (var n = 0; n < 4; n++) this._fragData[n + 4 * e] = t[n + 5 * e]; this._fragData[16 + e] = t[4 + 5 * e] / 255; } else this._fragData.set(Tr); var r = t ? "matrix" : ""; this._mode !== r && ((this._mode = r), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "name", { get: function () { return "CopyPixel:" + this._mode; }, enumerable: !1, configurable: !0, }), (n.prototype.getFragmentCode = function () { return ( "\nprecision highp float;\nuniform sampler2D fs0;\n\nvarying vec2 vUv;\n\n" + ("transform" === (t = this._mode) ? "\nuniform vec4 uTransformData[2];\n\nvec4 transform(vec4 color) {\n\tif (color.a > 0.0) {\n\t\tcolor.rgb /= color.a;\n\t}\n\n\tcolor *= clamp(uTransformData[0], 0.0, 1.0);\t\n\tcolor += uTransformData[1];\n\n\tcolor.rgb *= clamp(color.a, 0., 1.);\n\treturn color;\n}\n" : "matrix" === t ? "\nuniform vec4 uTransformData[5];\n\nvec4 transform(vec4 color) {\n\tif (color.a > 0.0) {\n\t\tcolor.rgb /= color.a;\n\t}\n\n\tvec4 ret = uTransformData[4];\n\tret.r += dot(color, uTransformData[0]);\n\tret.g += dot(color, uTransformData[1]);\n\tret.b += dot(color, uTransformData[2]);\n\tret.a += dot(color, uTransformData[3]);\n\n\tret = clamp(ret, 0., 1.);\n\tret.rgb *= ret.a;\n\t\n\treturn ret;\n}\n" : "") + "\nvoid main() {\n\tvec4 color = texture2D(fs0, vUv);\n\n gl_FragColor = " + (t ? "transform(color)" : "color") + ";\n}" ); var t; }), (n.prototype.activate = function (e, n, r) { t.prototype.computeVertexData.call(this), this._source.getAbstraction(e).activate(0); var i = this._program3D; i.uploadUniform("uTexMatrix", this._vertexConstantData), this._mode && (this._dataChanged || i.focusId !== this._focusId) && i.uploadUniform("uTransformData", this._fragData), (this._focusId = i.focusId), (this._dataChanged = !1); }), n ); })(yn), Or = (((br = {})[""] = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]), (br[dn.NORMAL] = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]), (br[dn.LAYER] = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]), (br[dn.ERASE] = [Yt.ZERO, Yt.ONE_MINUS_SOURCE_ALPHA]), br), Br = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n._blendDst = Yt.ONE_MINUS_SOURCE_ALPHA), (n._blendSrc = Yt.ONE), (n._requireBlend = !0), (n._blend = ""), (n._copyPixelTask = new Pr()), n.addTask(n._copyPixelTask), e && n.applyProps(e), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "blendDst", { get: function () { return this._blendDst; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "blendSrc", { get: function () { return this._blendSrc; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "requireBlend", { get: function () { return this._requireBlend; }, set: function (t) { !this._requireBlend && t && (this.blend = ""), (this._requireBlend = t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "blend", { get: function () { return this._blend; }, set: function (t) { var e = Or[t]; (this._requireBlend = !!e), e && ((this._blendDst = e[1]), (this._blendSrc = e[0])); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "colorTransform", { get: function () { return this._copyPixelTask.transform; }, set: function (t) { (this._copyPixelTask.transform = t), t || (this._requireBlend = !1); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "matrix", { get: function () { return this._copyPixelTask.matrix; }, set: function (t) { (this._copyPixelTask.matrix = t), t || (this._requireBlend = !1); }, enumerable: !1, configurable: !0, }), (n.prototype.applyProps = function (t) { this.matrix = null == t ? void 0 : t.matrix; }), (n.filterName = "colorMatrix"), n ); })(vn), Mr = (function (t) { function n() { var e = t.call(this) || this; return ( (e._opDecode = { "<": "slt ", "<=": "sge ", ">": "slt ", ">=": "sge ", "==": "seq ", "!=": "sne ", }), (e._thDecode = { "<": !1, "<=": !0, ">": !0, ">=": !1, "==": !1, "!=": !1, }), (e._operation = "<"), (e._threshold = 0), (e._thresholdRGBA = new B()), (e._color = 0), (e._colorRGBA = new B()), (e._mask = 0), (e._maskRGBA = new B()), (e._copySource = !1), (e._decodeVector = new B(65025, 255, 1, 16581375)), (e._fragmentConstantData = new Float32Array([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65025, 255, 1, 16581375, ])), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "operation", { get: function () { return this._operation; }, set: function (t) { this._operation != t && ((this._operation = t), (this._op = this._opDecode[t]), (this._th = this._thDecode[t]), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "threshold", { get: function () { return this._threshold; }, set: function (t) { this._threshold != t && ((this._threshold = t), (this._thresholdRGBA.x = ((t >> 16) & 255) / 255), (this._thresholdRGBA.y = ((t >> 8) & 255) / 255), (this._thresholdRGBA.z = (255 & t) / 255), (this._thresholdRGBA.w = ((t >> 24) & 255) / 255)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { if (this._color != t) { this._color = t; var e = ((t >> 24) & 255) / 255; (this._colorRGBA.x = (e * ((t >> 16) & 255)) / 255), (this._colorRGBA.y = (e * ((t >> 8) & 255)) / 255), (this._colorRGBA.z = (e * (255 & t)) / 255), (this._colorRGBA.w = e); } }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "mask", { get: function () { return this._mask; }, set: function (t) { this._mask != t && ((this._mask = t), (this._maskRGBA.x = ((t >> 16) & 255) / 255), (this._maskRGBA.y = ((t >> 8) & 255) / 255), (this._maskRGBA.z = (255 & t) / 255), (this._maskRGBA.w = ((t >> 24) & 255) / 255)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "copySource", { get: function () { return this._copySource; }, set: function (t) { this._copySource != t && ((this._copySource = t), this.invalidateProgram()); }, enumerable: !1, configurable: !0, }), (n.prototype.getFragmentCode = function () { var t = this._registerCache.getFreeFragmentVectorTemp(); this._registerCache.addFragmentTempUsages(t, 1); var e = this._registerCache.getFreeTextureReg(); this.sourceSamplerIndex = e.index; var n = this._registerCache.getFreeFragmentConstant(); this._fragmentConstantsIndex = n.index; var r, i = this._registerCache.getFreeFragmentConstant(), o = this._registerCache.getFreeFragmentConstant(), a = this._registerCache.getFreeFragmentConstant(); if (this._copySource) { var s = this._registerCache.getFreeFragmentVectorTemp(); this._registerCache.addFragmentTempUsages(s, 1); var u = this._registerCache.getFreeFragmentVectorTemp(); this._registerCache.addFragmentTempUsages(u, 1), (r = "tex " + t + ", " + this._uvVarying + ", " + e + " <2d,linear,clamp>\nmul " + s + ", " + t + ", " + o + "\ndp4 " + s + ", " + s + ", " + a + "\n" + this._op + s + ", " + (this._th ? n : s) + ", " + (this._th ? s : n) + "\nsub " + u + ", " + a + ".zzzz, " + s + "\nmul " + s + ", " + s + ", " + i + "\nmul " + u + ", " + u + ", " + t + "\nadd " + t + ", " + s + ", " + u + "\nmov oc, " + t + "\n"), this._registerCache.removeFragmentTempUsage(u), this._registerCache.removeFragmentTempUsage(s); } else r = "tex " + t + ", " + this._uvVarying + ", " + e + " <2d,linear,clamp>\nmul " + t + ", " + t + ", " + o + "\ndp4 " + t + ", " + t + ", " + a + "\n" + this._op + t + ", " + (this._th ? n : t) + ", " + (this._th ? t : n) + "\nmul " + t + ", " + t + ", " + i + "\nmov oc, " + t + "\n"; return this._registerCache.removeFragmentTempUsage(t), r; }), (n.prototype.activate = function (e, n, r) { t.prototype.computeVertexData.call(this); var i = new B( this._thresholdRGBA.x * this._maskRGBA.x, this._thresholdRGBA.y * this._maskRGBA.y, this._thresholdRGBA.z * this._maskRGBA.z, this._thresholdRGBA.w * this._maskRGBA.w ).dotProduct(this._decodeVector), o = this._fragmentConstantsIndex, a = this._fragmentConstantData; (a[o] = i), (a[o + 1] = i), (a[o + 2] = i), (a[o + 3] = i), (a[o + 4] = this._colorRGBA.x), (a[o + 5] = this._colorRGBA.y), (a[o + 6] = this._colorRGBA.z), (a[o + 7] = this._colorRGBA.w), (a[o + 8] = this._maskRGBA.x), (a[o + 9] = this._maskRGBA.y), (a[o + 10] = this._maskRGBA.z), (a[o + 11] = this._maskRGBA.w); var s = e.context; s.setProgramConstantsFromArray(te.VERTEX, this._vertexConstantData), s.setProgramConstantsFromArray( te.FRAGMENT, this._fragmentConstantData ), this._source.getAbstraction(e).activate(this.sourceSamplerIndex); }), n ); })(mn), Lr = (function (t) { function n() { var e = t.call(this) || this; return (e._thresholdTask = new Mr()), e.addTask(e._thresholdTask), e; } return ( e(n, t), i([Cn("_thresholdTask")], n.prototype, "operation", void 0), i([Cn("_thresholdTask")], n.prototype, "color", void 0), i([Cn("_thresholdTask")], n.prototype, "mask", void 0), i([Cn("_thresholdTask")], n.prototype, "copySource", void 0), i([Cn("_thresholdTask")], n.prototype, "threshold", void 0), n ); })(vn), Nr = function (t, e) { return ( void 0 === t && (t = 1), void 0 === e && (e = !1), "\nprecision highp float;\nuniform vec4 uPosMatrix;\nuniform vec4 uTexMatrix[" + t + "];\n\n/* AGAL legacy atribb resolver MUST reolver this as va0 */\nattribute vec4 aPos; // position\n\nvarying vec2 vUv[" + t + "];\n" + (e ? "varying vec4 vUvLim[" + t + "];" : "") + "\n\nvoid main() {\n\tvec4 pos = aPos;\n\n\tpos.xy = pos.xy * uPosMatrix.zw + uPosMatrix.xy;\n\tpos.z = pos.z * 2.0 - pos.w;\n\n gl_Position = pos;\n\t" + (function (t, e) { return ( void 0 === t && (t = 1), void 0 === e && (e = !1), Array.from({ length: t }, function (t, n) { var r = "vUv[" + n + "] = aPos.xy * uTexMatrix[" + n + "].zw + uTexMatrix[" + n + "].xy;"; return ( e && (r += "\nvUvLim[" + n + "] = vec4(uTexMatrix[" + n + "].xy, uTexMatrix[" + n + "].zw + uTexMatrix[" + n + "].xy);"), r ); }).join("\n") ); })(t, e) + "\n}\n\n" ); }, Rr = (function (t) { function n(e, n) { void 0 === e && (e = 1), void 0 === n && (n = !1); var r = t.call(this, !1) || this; (r._uvBlocks = e), (r._limits = n), (r.uvMatrices = []), (r._dataBuffer = new Float32Array(4 * e + 4)), (r.posMatrix = r._dataBuffer.subarray(0, 4)), (r._vertexConstantData = r._dataBuffer.subarray(0, 8)), (r._uvMatricesBuffer = r._dataBuffer.subarray(4, 4 + 4 * e)); for (var i = 0; i < e; i++) r.uvMatrices[i] = r._uvMatricesBuffer.subarray(4 * i, 4 * (i + 1)); return r; } return ( e(n, t), (n.prototype.getVertexCode = function () { return Nr(this._uvBlocks, this._limits); }), (n.prototype.uploadVertexData = function () { this.computeVertexData(), this._program3D.uploadUniform("uPosMatrix", this.posMatrix), this._program3D.uploadUniform("uTexMatrix", this._uvMatricesBuffer); }), n ); })(yn), Fr = (function (t) { function n() { var e = t.call(this, 2, !0) || this; return ( (e.mode = "wrap"), (e.componentX = 1), (e.componentY = 2), (e.mapPoint = new P(0, 0)), (e._uColor = [0, 0, 0, 0]), (e._color = 0), (e._alpha = 0), (e.scaleX = 1), (e.scaleY = 1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "isValid", { get: function () { return this.mapBitmap && !this.mapBitmap.isDisposed; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { this._color !== t && ((this._color = t), bn.colorToArray(this._color, this._alpha, this._uColor)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._alpha; }, set: function (t) { this._alpha !== t && ((this._alpha = t), (this._uColor[3] = this._alpha)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "name", { get: function () { return ( "Displacement:" + this.mode + ":" + this.componentX + ":" + this.componentY ); }, enumerable: !1, configurable: !0, }), (n.prototype.getFragmentCode = function () { return (function (t) { var e = t.compX, n = void 0 === e ? 0 : e, r = t.compY, i = void 0 === r ? 1 : r, o = t.mode, a = void 0 === o ? "wrap" : o; return ( "\nprecision highp float;\n\n// source\nuniform sampler2D fs0;\n// map\nuniform sampler2D fs1;\nuniform vec2 uMapPoint;\nuniform vec2 uScale;\n" + ("color" === a ? "uniform vec4 uColor;" : "") + "\n\nvarying vec2 vUv[2];\nvarying vec4 vUvLim[2];\n\nvoid main() {\n\tvec4 map = texture2D(fs1, vUv[1] - uMapPoint);\n\tvec2 offset = vec2(map[" + (0 | n) + "] - 0.5, map[" + (0 | i) + "] - 0.5) * uScale * 2.0; \n\n\tvec2 uv = vUv[0] + offset;\n\n\t// invalid, we must remap onto vUvLim[0]\n\t" + (a && "wrap" !== a ? "" : "uv = fract(uv);") + "\n\t" + ("clamp" === a ? "uv = clamp(uv, vUvLim[0].xy, vUvLim[0].zw);" : "") + "\n\n\t" + ("ignore" === a ? "uv = vUv;" : "") + "\n\t" + ("color" === a ? "bool outside = uv.x < 0. || uv.x > 1. || uv.y < 0. || uv.y > 1.;" : "") + "\n\n\t" + ("color" === a ? "gl_FragColor = outside ? uColor : texture2D(fs0, uv);" : "gl_FragColor = texture2D(fs0, uv);") + "\n\t\n\t//gl_FragColor = map;\n}\n\n" ); })({ compX: Math.log2(this.componentX), compY: Math.log2(this.componentY), mode: this.mode, }); }), (n.prototype.activate = function (e, n, r) { t.prototype.computeVertexData.call(this); var i = this.inputRect, o = this.destRect, a = this.mapBitmap, s = this._program3D; this.uvMatrices[1].set( [0, 0, a.width / o.width, a.height / o.height], 0 ), this.uploadVertexData(), s.uploadUniform("uScale", [ this.scaleX / i.width, this.scaleY / i.height, ]), s.uploadUniform("uMapPoint", [ this.mapPoint.x / a.width, this.mapPoint.y / a.height, ]), "color" === this.mode && s.uploadUniform("uColor", this._uColor), this._source.getAbstraction(e).activate(0), this.mapBitmap.getAbstraction(e).activate(1); }), n ); })(Rr), kr = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n._displacement = new Fr()), n.addTask(n._displacement), n.applyProps(e), n ); } return ( e(n, t), (n.prototype.applyProps = function (t) { if (t) for (var e = 0, n = this[In]; e < n.length; e++) { var r = n[e]; r in t && (this[r] = t[r]); } }), (n.prototype.meashurePad = function (e, n) { return ( ((n = t.prototype.meashurePad.call(this, e, n)).x = Math.max( 0, (n.x - this.scaleX / 4) | 0 )), (n.y = Math.max(0, (n.y - this.scaleY / 4) | 0)), (n.width += Math.ceil(this.scaleX / 4)), (n.height += Math.ceil(this.scaleY / 4)), n ); }), (n.filterName = "displacement"), i([En, Cn("_displacement")], n.prototype, "mapBitmap", void 0), i([En, Cn("_displacement")], n.prototype, "mapPoint", void 0), i([En, Cn("_displacement")], n.prototype, "componentX", void 0), i([En, Cn("_displacement")], n.prototype, "componentY", void 0), i([En, Cn("_displacement")], n.prototype, "scaleX", void 0), i([En, Cn("_displacement")], n.prototype, "scaleY", void 0), i([En, Cn("_displacement")], n.prototype, "mode", void 0), i([En, Cn("_displacement")], n.prototype, "color", void 0), i([En, Cn("_displacement")], n.prototype, "alpha", void 0), n ); })(vn), Ur = (function (t) { function n() { var e = t.call(this, 2) || this; return ( (e._uColor = new Float32Array([0, 0, 0, 0])), (e._uProps = new Float32Array([1, 0, 1, 1])), (e._uDir = new Float32Array([0, 0])), (e._color = 0), (e._alpha = 1), (e._angle = 0), (e._distance = 1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "strength", { get: function () { return this._uProps[0]; }, set: function (t) { this._uProps[0] = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "inner", { get: function () { return !!this._uProps[1]; }, set: function (t) { this._uProps[1] = t ? 1 : 0; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "knockout", { get: function () { return !this._uProps[2]; }, set: function (t) { this._uProps[2] = t ? 0 : 1; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "hideObject", { get: function () { return !this._uProps[3]; }, set: function (t) { this._uProps[3] = t ? 0 : 1; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { (this._color = t), bn.colorToArray(this._color, this._alpha, this._uColor); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._uColor[3]; }, set: function (t) { this._uColor[3] = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "angle", { get: function () { return this._angle; }, set: function (t) { this._angle = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "distance", { get: function () { return this._distance; }, set: function (t) { this._distance = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "name", { get: function () { return "DropShadowTask"; }, enumerable: !1, configurable: !0, }), (n.prototype.getFragmentCode = function () { return "\nprecision highp float;\n\nuniform sampler2D uBlur;\nuniform sampler2D uSource;\nuniform vec4 uColor;\n// strength, inner, not knokout, not hideObject\nuniform vec4 uProps;\nuniform vec2 uDir;\n\nvarying vec2 vUv[2];\n\nvoid main() {\n vec4 color = uColor;\n\n float outer = 1. - uProps[1];\n float inner = uProps[1];\n\tfloat shadow = texture2D(uBlur, vUv[0] + uDir).a;\t\n\n\tvec4 main = texture2D(uSource, vUv[1]);\n\n\t// mask inner by main\n\tshadow = outer * shadow + (1. - shadow) * inner * main.a;\n\n\tcolor.a = clamp(color.a * shadow * uProps[0], 0., 1.);\n\tcolor.rgb *= color.a;\n\n\tif (uProps[3] > 0.0) {\n\t\tvec4 composite = main * uProps[2];\n\n\t\tcolor = \n\t\t\touter * (composite + (1. - main.a) * color) + \n\t\t\tinner * (composite * (1. - color.a) + color);\n\t}\n\t\n\tgl_FragColor = color;\n}"; }), (n.prototype.activate = function (t) { var e = this.sourceImage, n = this._source; this.uvMatrices[1].set( [ 0, 0, this.inputRect.width / e.width, this.inputRect.height / e.height, ], 0 ); var r = (Math.PI * this._angle) / 180; (this._uDir[0] = (-Math.cos(r) * this._distance) / n.width), (this._uDir[1] = (-Math.sin(r) * this._distance) / n.height), n.getAbstraction(t).activate(0), e.getAbstraction(t).activate(1), this.uploadVertexData(), this._program3D.uploadUniform("uColor", this._uColor), this._program3D.uploadUniform("uProps", this._uProps), this._program3D.uploadUniform("uDir", this._uDir); }), n ); })(Rr), jr = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n._shadowTask = new Ur()), (n.distance = 0), (n.angle = 0), (n.color = 0), (n.alpha = 1), (n.strength = 1), (n.inner = !1), (n.knockout = !1), (n.hideObject = !1), n.addTask(n._shadowTask), n.applyProps(e), n ); } return ( e(n, t), (n.prototype.applyProps = function (t) { if (t) { for (var e = 0, r = this[In]; e < r.length; e++) { var i = r[e]; i in t && (this[i] = t[i]); } t.filterName === n.filterNameAlt && ((this.angle = 0), (this.distance = 0)); } }), (n.prototype.meashurePad = function (t, e) { void 0 === e && (e = t); var n = bn.meashureBlurPad(this.blurX, this.blurY, 3, !1); e.copyFrom(t); var r = this.distance; if (!this.inner && r > 0) { var i = (this.angle * Math.PI) / 180; (n.x += Math.sin(i) * r * 2), (n.y += Math.sin(i) * r * 2); } return ( (e.x -= n.x), (e.y -= n.y), (e.width += n.x), (e.height += n.y), e ); }), (n.prototype.setRenderState = function (e, n, r, i, o) { t.prototype.setRenderState.call(this, e, n, r, i, o); var a = this._hBlurTask.target, s = o.popTemp(a.width, a.height); this._shadowTask.inputRect.copyFrom(this._vBlurTask.inputRect), this._shadowTask.destRect.copyFrom(i), this._vBlurTask.inputRect.setTo(0, 0, 0, 0), this._vBlurTask.destRect.setTo(0, 0, 0, 0), (this._vBlurTask.target = s), (this._shadowTask.source = s), (this._shadowTask.sourceImage = e), (this._shadowTask.target = n), this._temp.push(s); }), (n.filterName = "dropShadow"), (n.filterNameAlt = "glow"), i([En, Cn("_shadowTask")], n.prototype, "distance", void 0), i([En, Cn("_shadowTask")], n.prototype, "angle", void 0), i([En, Cn("_shadowTask")], n.prototype, "color", void 0), i([En, Cn("_shadowTask")], n.prototype, "alpha", void 0), i([En, Cn("_shadowTask")], n.prototype, "strength", void 0), i([En], n.prototype, "quality", void 0), i([En, Cn("_shadowTask")], n.prototype, "inner", void 0), i([En, Cn("_shadowTask")], n.prototype, "knockout", void 0), i([En, Cn("_shadowTask")], n.prototype, "hideObject", void 0), n ); })(Rn); var Vr, Qr = (((Cr = {})[""] = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]), (Cr[dn.NORMAL] = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]), (Cr[dn.LAYER] = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]), (Cr[dn.ERASE] = [Yt.ZERO, Yt.ONE_MINUS_SOURCE_ALPHA]), Cr), Gr = (function () { function t(e) { (this._samplerIds = Array.from( { length: t.SAMPLERS_LIMIT }, function (t) { return 0; } )), (this._instanceData = new Float32Array(t.TASKS_LIMIT * t.DATA_COUNT)), (this._instanceView = this._instanceData), (this._copyTasks = []), (this._images = []), (this._blendDst = Yt.ONE_MINUS_SOURCE_ALPHA), (this._blendSrc = Yt.ONE), (this._requireBlend = !0), (this._blend = ""), (this._mustBeFlushed = !1), (this._manager = e), (this._stage = e.stage); } return ( Object.defineProperty(t.prototype, "blendDst", { get: function () { return this._blendDst; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "blendSrc", { get: function () { return this._blendSrc; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "requireBlend", { get: function () { return this._requireBlend; }, set: function (t) { !this._requireBlend && t && (this.blend = ""), (this._requireBlend = t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "blend", { get: function () { return this._blend; }, set: function (t) { var e = Qr[t]; (this._requireBlend = !!e), e && ((this._blendDst = e[1]), (this._blendSrc = e[0])); }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "mustBeFlushed", { get: function () { return this._mustBeFlushed; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "prog", { get: function () { var e; return ( this._prog || ((this._prog = this._stage.context.createProgram()), (this._prog.name = "CopyShaderInstanced:" + t.SAMPLERS_LIMIT), this._prog.uploadRaw( "\nprecision highp float;\n\n/* AGAL legacy atrib resolver require this names */\nattribute vec4 va0; // position\nattribute vec4 va1; // posMatrix\nattribute vec4 va2; // uvMatrix\nattribute float va3; // SamplerId\n\nvarying vec2 vUv;\nvarying float vId;\n\nvoid main() {\n\tvec4 pos = va0;\n\t\n\tpos.xy = pos.xy * va1.zw + va1.xy;\n\tpos.z = pos.z * 2.0 - pos.w;\n\n\tvUv = va0.xy * va2.zw + va2.xy;\n\tvId = va3;\n\tgl_Position = pos;\n}", (void 0 === (e = t.SAMPLERS_LIMIT) && (e = 1), "\nprecision highp float;\nuniform sampler2D uTex[" + e + "];\n\nvarying vec2 vUv;\nvarying float vId;\n\nvoid main() {\n\t" + (function (t) { for (var e = [], n = 0; n < t; n++) 0 === n ? e.push( "\tif (vId < " + (n + 0.5).toFixed(1) + ")\n\t\t\t\t\t\tgl_FragColor = texture2D(uTex[" + (0 | n) + "], vUv);\n\t\t\t\t" ) : e.push( "\telse if (vId < " + (n + 0.5).toFixed(1) + ")\n\t\t\t\t\t\tgl_FragColor = texture2D(uTex[" + (0 | n) + "], vUv);\n\t\t\t\t" ); return ( e.push( "\telse gl_FragColor = vec4(1.0, 0.0, 1.0, 0.0);" ), e.join("\n") ); })(e) + "\n}") )), this._prog ); }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "length", { get: function () { return this._copyTasks.length; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "target", { get: function () { return this._target; }, set: function (t) { this._target = t; }, enumerable: !1, configurable: !0, }), (t.prototype.addCopyTask = function (e, n, r) { var i = this._images.indexOf(r); -1 === i && ((i = this._images.length), this._images.push(r)), this._copyTasks.push({ from: e.clone(), to: n.clone(), source: r, samplerID: i, }), (this._images.length !== t.SAMPLERS_LIMIT && this._copyTasks.length !== t.TASKS_LIMIT) || (this._mustBeFlushed = !0); }), (t.prototype.fillInstancesBuffer = function (t, e) { var n = this._instanceView, r = e.to, i = e.from, o = this._target, a = e.source; r.width * r.height == 0 && ((r.width = i.width), (r.height = i.height)), (n[0 + (t *= 9)] = (2 * r.x) / o.width - 1), (n[1 + t] = (2 * r.y) / o.height - 1), (n[2 + t] = (2 * r.width) / o.width), (n[3 + t] = (2 * r.height) / o.height), (n[4 + t] = i.x / a.width), (n[5 + t] = i.y / a.height), (n[6 + t] = i.width / a.width), (n[7 + t] = i.height / a.height), (n[8 + t] = e.samplerID); }), (t.prototype.activateElements = function () { var e = this._stage.context; this._vertexBuffer || ((this._vertexBuffer = e.createVertexBuffer(6, 8)), this._vertexBuffer.uploadFromArray( new Float32Array([0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]), 0, 6 ), (this._instanceBuffer = e.createVertexBuffer( t.TASKS_LIMIT, 4 * t.DATA_COUNT )), this._instanceBuffer.initAsDynamic(t.TASKS_LIMIT), (this._instanceBuffer.instanced = !0), (this._instanceBuffer.dynamic = !0)), this._vao ? this._vao.bind() : ((this._vao = e.hasVao ? e.createVao() : null), this._vao && this._vao.bind(), e.setVertexBufferAt(0, this._vertexBuffer, 0, oe.FLOAT_2), e.setVertexBufferAt(1, this._instanceBuffer, 0, oe.FLOAT_4), e.setVertexBufferAt(2, this._instanceBuffer, 16, oe.FLOAT_4), e.setVertexBufferAt(3, this._instanceBuffer, 32, oe.FLOAT_1)), this._instanceBuffer.uploadFromArray(this._instanceView); }), (t.prototype.deactivateElements = function () { this._vao && this._vao.unbind(); }), (t.prototype.prepareTask = function () { var t = this._copyTasks, e = t.length; e !== this._instanceView.length / 9 && (this._instanceView = new Float32Array( this._instanceData.buffer, 0, 9 * e )); for (var n = 0; n < e; n++) this.fillInstancesBuffer(n, t[n]); var r = this._images, i = r.length; for (n = 0; n < i; n++) r[n].getAbstraction(this._stage).activate(n), (this._samplerIds[n] = n); this._prog.uploadUniform("uTex", this._samplerIds); }), (t.prototype.flush = function () { if (0 !== this._copyTasks.length) { var t = this._stage, e = t.context; e.beginInstancedRender(this._copyTasks.length), t.setRenderTarget(this._target, !1, 0, 0, !0), e.setBlendFactors(this._blendSrc, this._blendDst), e.setBlendState(!!this.requireBlend), e.setCulling(ie.NONE), e.setProgram(this.prog), this.prepareTask(), this.activateElements(), e.drawVertices(Jt.TRIANGLES, 0, 6), this.deactivateElements(), (this._target = null), (this._mustBeFlushed = !1), (this._images.length = 0), (this._copyTasks.length = 0); } }), (t.DATA_COUNT = 9), (t.SAMPLERS_LIMIT = 16), (t.TASKS_LIMIT = 100), t ); })(), zr = new K(), Hr = new K(), Xr = new K(), Yr = Object.freeze(new P(0, 0)), qr = (function () { function t(e) { var n; (this._stage = e), (this._texturePool = {}), (this._filterCache = {}), (this._filterConstructors = (((n = {})[Sr.filterName] = Sr), (n[Rn.filterName] = Rn), (n[kr.filterName] = kr), (n[Br.filterName] = Br), (n[jr.filterName] = jr), (n[jr.filterNameAlt] = jr), n)), (t._instance = this); } return ( Object.defineProperty(t, "MAX_TMP_TEXTURE", { get: function () { return Ne.MAX_SIZE; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t, "instance", { get: function () { return this._instance; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "context", { get: function () { return this._stage.context; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "stage", { get: function () { return this._stage; }, enumerable: !1, configurable: !0, }), (t.prototype.popTemp = function (e, n, r) { void 0 === r && (r = !1); var i = Math.max(t.MIN_TMP_TEXTURE, 2 << Math.log2(e - 1)), o = Math.max(t.MIN_TMP_TEXTURE, 2 << Math.log2(n - 1)); (i > t.MAX_TMP_TEXTURE || o > t.MAX_TMP_TEXTURE) && (console.warn( "[Filter manager] Temporary texture size " + i + "x" + o + " for " + e + "x" + n + " is bigger that limit, clamp to " + t.MAX_TMP_TEXTURE ), (i = Math.min(i, t.MAX_TMP_TEXTURE)), (o = Math.min(o, t.MAX_TMP_TEXTURE))); var a, s = i + "_" + o + "_" + ~~(r = r && 2 === this.context.glVersion); return ( this._texturePool[s] ? (a = this._texturePool[s].pop()) : (this._texturePool[s] = []), a || (((a = new ke(i, o, !0)).poolKey = s), (a.antialiasQuality = r ? 8 : 0)), a ); }), (t.prototype.pushTemp = function (t) { var e = t; e && e.poolKey && this._texturePool[e.poolKey].push(e); }), (t.prototype._initFilterElements = function () { this._filterVertexBuffer || ((this._filterVertexBuffer = this.context.createVertexBuffer(6, 8)), this._filterVertexBuffer.uploadFromArray( new Float32Array([0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]), 0, 6 ), (this._filterSampler = new Le(!1, !1, !1))); }), (t.prototype._bindFilterElements = function () { var t = this.context; if (this._filterVAO) this._filterVAO.bind(); else { var e = t.hasVao ? t.createVao() : null; e && e.bind(), t.setVertexBufferAt(0, this._filterVertexBuffer, 0, oe.FLOAT_2), (this._filterVAO = e); } }), (t.prototype._unbindFilterElements = function () { this._filterVAO && this._filterVAO.unbind(!0); }), (t.prototype.getFilter = function (t, e) { if (!this._filterCache[t] && !this._filterConstructors[t]) return ( console.warn("[FilterManager] Filter not implemented:", t), null ); var n = this._filterCache[t]; return n ? (n.applyProps(e), n) : (this._filterCache[t] = new this._filterConstructors[t](e)); }), (t.prototype.applyFilter = function (t, e, n, r, i, o, a) { var s = "string" == typeof i ? o : i; if (!s || !s.filterName) return !1; var u = s.filterName, l = this.getFilter(u, s); return ( !(!l || !l.isValid) && (this.renderFilter(t, e, n || t.rect, r || t.rect, l), !0) ); }), (t.prototype.computeFiltersPadding = function (t, e, n) { void 0 === n && (n = t.clone()); for (var r = 0, i = e; r < i.length; r++) { var o = i[r]; if (o) { var a = this.getFilter(o.filterName, o); a && a.isValid && bn.nonAlocUnion(n, a.meashurePad(t, zr), n); } } return n; }), (t.prototype.applyFilters = function (t, e, n, r, i) { var o, a = this, s = i.filter(function (t) { return t && a._filterConstructors[t.filterName]; }); if (0 === s.length) return !1; if (1 === s.length) return ( !!(h = this.getFilter(s[0].filterName, s[0])).isValid && (this.renderFilter(t, e, n || t.rect, r || t.rect, h, !0), !0) ); for ( var u = this.popTemp(e.width, e.height), l = this.popTemp(e.width, e.height), c = 0; c < s.length; c++ ) { var h; if (!(h = this.getFilter(s[c].filterName, s[c])).isValid) return !1; var p = 0 === c ? t : u, d = c === s.length - 1 ? e : l; this.renderFilter( p, d, n || t.rect, r || t.rect, h, c < s.length - 1 ), (u = (o = [l, u])[0]), (l = o[1]); } return this.pushTemp(u), this.pushTemp(l), !0; }), (t.prototype.renderFilter = function (t, e, n, r, i, o) { void 0 === o && (o = !1), this._initFilterElements(); var a = this._stage, s = this.context, u = Xr; r instanceof P ? u.setTo(r.x, r.y, n.width, n.height) : u.copyFrom(r); var l = t === e, c = e; l && ((c = this.popTemp(u.width, u.height)), (u.x = 0), (u.y = 0)), i.setRenderState(t, c, n, u, this), s.setBlendFactors(i.blendSrc, i.blendDst), s.setBlendState(i.requireBlend), s.setCulling(ie.NONE); for (var h, p = !0; (h = i.nextTask()); ) h.preActivate(a), a.setRenderTarget(h.target, !1, 0, 0, !0), a.setScissor(h.clipRect), ((l && i.requireBlend) || h.needClear || (o && !i.hasNextTask())) && s.clear(0, 0, 0, 0, 0, 0, Kt.ALL), s.setProgram(h.getProgram(a)), s.setDepthTest(!1, Wt.LESS_EQUAL), p && (this._bindFilterElements(), (p = !1)), h.activate(a, null, null), s.drawVertices(Jt.TRIANGLES, 0, 6), s._texContext._currentRT.present(), h.deactivate(a); l && (this.copyPixels(c, e, u, r, !1), this.pushTemp(c)), i.clear(this), a.setScissor(null), this._unbindFilterElements(); }), (t.prototype.copyPixels = function (t, e, n, r, i, o) { var a = this; if ( (void 0 === i && (i = !1), void 0 === o && (o = ""), !( r.x < -n.width || r.x > e.width || r.y < -n.height || r.y > e.height )) ) { var s = zr; s.copyFrom(n); var u = Hr; if ( (u.setTo(r.x, r.y, n.width, n.height), s.x < 0 && ((s.width -= -s.x), (u.x += -s.x), (s.x = 0)), s.y < 0 && ((s.height -= -s.y), (u.y += -s.y), (s.y = 0)), s.right > t.width) ) { var l = t.width - s.right; s.width -= l; } if (s.bottom > t.height) { l = t.height - s.bottom; s.height -= l; } u.x < 0 && ((s.x += -u.x), (s.width -= -u.x), (u.x = 0)), u.y < 0 && ((s.y += -u.y), (s.height -= -u.y), (u.y = 0)), s.width > e.width - u.x && (s.width = e.width - u.x), s.height > e.height - u.y && (s.height = e.height - u.y), (u.width = s.width), (u.height = s.height); var c, h = 2 === this.context.glVersion && e.antialiasQuality > 0; if ( (!this._copyFilterInstanced || (this._copyFilterInstanced.target === e && this._copyFilterInstanced.target !== t) || this.flushDelayedTask("Manually"), e === t) ) { (c = this.popTemp(t.width, t.height)), this._stage.setRenderTarget(t, !1, 0, 0, !0), this._stage.setScissor(null); var p = c.getAbstraction(this._stage); this.context.copyToTexture(p.getTexture(), t.rect, Yr), this._stage.setRenderTarget(c, !1, 0, 0, !0); } if (i || h || o) { var d = (this._copyPixelFilter = this.getFilter(Br.filterName)); d instanceof Gr && (d.requireBlend !== i || (d.target !== e && d.target)) && d.flush(), (d.blend = o), (d.requireBlend = i), d instanceof Gr ? ((d.target = e), d.addCopyTask(s, u, c || t), (this.context.stateChangeCallback = null), d.mustBeFlushed || e === t ? d.flush() : (this.context.stateChangeCallback = function (t) { return a.flushDelayedTask(t); })) : (this.renderFilter(t, e, s, u, d), (d.requireBlend = !0)); } else { this.flushDelayedTask("copyPixelByTexture"), c || (this._stage.setRenderTarget(t, !1, 0, 0, !0), this._stage.setScissor(null)); var f = e.getAbstraction(this._stage); this.context.copyToTexture(f.getTexture(), s, u.topLeft); } c && this.pushTemp(c), this._stage.setRenderTarget(null); } }), (t.prototype.flushDelayedTask = function (t) { this._copyFilterInstanced && this._copyFilterInstanced.length && ((this.context.stateChangeCallback = null), console.debug( "[Instanced] Instanced copyPixel was flushed by:", t, this._copyFilterInstanced.length ), this._copyFilterInstanced.flush()); }), (t.prototype.threshold = function (t, e, n, r, i, o, a, s, u) { r.x < -n.width || r.x > e.width || r.y < -n.height || r.y > e.height || (this._thresholdFilter || (this._thresholdFilter = new Lr()), (this._thresholdFilter.operation = i), (this._thresholdFilter.threshold = o), (this._thresholdFilter.color = a), (this._thresholdFilter.mask = s), (this._thresholdFilter.copySource = u), this.renderFilter(t, e, n, r, this._thresholdFilter)); }), (t.prototype.colorTransform = function (t, e, n, r) { this._copyPixelFilter || (this._copyPixelFilter = this.getFilter(Br.filterName)), (this._copyPixelFilter.blend = ""), (this._copyPixelFilter.requireBlend = !1), (this._copyPixelFilter.colorTransform = r), this.renderFilter(t, e, n, n, this._copyPixelFilter), (this._copyPixelFilter.colorTransform = null); }), (t.MIN_TMP_TEXTURE = 64), t ); })(), Kr = (((Vr = {})[1] = [oe.BYTE_1, oe.BYTE_2, oe.BYTE_3, oe.BYTE_4]), (Vr[2] = [oe.SHORT_1, oe.SHORT_2, oe.SHORT_3, oe.SHORT_4]), (Vr[4] = [oe.FLOAT_1, oe.FLOAT_2, oe.FLOAT_3, oe.FLOAT_4]), (Vr[5] = [ oe.UNSIGNED_BYTE_1, oe.UNSIGNED_BYTE_2, oe.UNSIGNED_BYTE_3, oe.UNSIGNED_BYTE_4, ]), (Vr[6] = [ oe.UNSIGNED_SHORT_1, oe.UNSIGNED_SHORT_2, oe.UNSIGNED_SHORT_3, oe.UNSIGNED_SHORT_4, ]), Vr), Wr = { x: 0, y: 0 }, Jr = (function (t) { function n(e, n, r, i, o) { void 0 === o && (o = Zt.BASELINE); var a = t.call(this) || this; return ( (a._programData = new Array()), (a._x = 0), (a._y = 0), (a._touchPoints = new Array()), (a._stageIndex = -1), (a._antiAlias = 4), (a.savedTargetStack = []), (a._activeTargetConf = { mipSelector: 0, surfaceSelector: 0, target: null, depthStencil: !0, msaa: !0, }), (a._frameEndCallbackOnce = []), (a._initialised = !1), (a.globalDisableMipmap = !1), (a.globalDisableSmooth = !1), (a.numUsedStreams = 0), (a.numUsedTextures = 0), (a.id = W.ID_COUNT++), (a._programDataPool = new kn(a)), (a._container = e), a._container && (a._container.addEventListener("webglcontextlost", function (t) { return a.onContextLost(t); }), a._container.addEventListener("webglcontextrestored", function (t) { return a.onContextRestored(t); })), (a._stageIndex = n), (a._stageManager = r), Ct.setElementX(a._container, 0), Ct.setElementY(a._container, 0), (a._width = a._container.clientWidth), (a._height = a._container.clientHeight), (a.visible = !0), (a.filterManager = new qr(a)), a ); } return ( e(n, t), Object.defineProperty(n.prototype, "pixelRatio", { get: function () { return this._context.pixelRatio; }, set: function (t) { this._context.pixelRatio = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "glVersion", { get: function () { return this._context.glVersion; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "screenX", { get: function () { return this._screenX; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "screenY", { get: function () { return this._screenY; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "touchPoints", { get: function () { return this._touchPoints; }, enumerable: !1, configurable: !0, }), (n.prototype.requiestFrameEnd = function (t) { this._frameEndCallbackOnce.indexOf(t) > -1 || "function" != typeof t || this._frameEndCallbackOnce.push(t); }), (n.prototype.present = function () { this._context.present(), Ve.executeAll(); for (var t = 0, e = this._frameEndCallbackOnce; t < e.length; t++) { (0, e[t])(); } this._frameEndCallbackOnce.length = 0; }), (n.prototype.getProgramData = function (t, e) { return this._programDataPool.getItem(t, e); }), (n.prototype.pushRenderTargetConfig = function () { this.savedTargetStack.push(Object.assign({}, this._activeTargetConf)); }), (n.prototype.popRenderTarget = function () { if (0 !== this.savedTargetStack.length) { var t = this.savedTargetStack.pop(), e = t.target, n = t.depthStencil, r = t.surfaceSelector, i = t.mipSelector, o = t.msaa; this.setRenderTarget(e, n, r, i, !o); } }), (n.prototype.setRenderTarget = function (t, e, n, r, i) { void 0 === e && (e = !1), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = !1); var o = this._activeTargetConf; if ( o.target !== t || n !== o.surfaceSelector || r !== o.mipSelector || o.depthStencil !== e ) if ( ((o.msaa = !i), (o.target = t), (o.surfaceSelector = n), (o.mipSelector = r), (o.depthStencil = e), t) ) { var a = t.getAbstraction(this), s = "number" == typeof t.antialiasQuality ? t.antialiasQuality : this._antiAlias; this._context.setRenderToTexture( a.getTexture(), e, i ? 0 : s, n, r ), 0 != r && 1 != this._context.glVersion && ((a._invalidMipmaps = !1), (a._mipmap = !0)); } else this._context.setRenderToBackBuffer(), this.configureBackBuffer( this._width, this._height, this._antiAlias, o.depthStencil ); }), (n.prototype.copyPixels = function (t, e, n, r, i, o, a) { void 0 === a && (a = !1), this.filterManager.copyPixels(t, e, n, r, a); }), (n.prototype.threshold = function (t, e, n, r, i, o, a, s, u) { this.filterManager.threshold(t, e, n, r, i, o, a, s, u); }), (n.prototype.colorTransform = function (t, e, n, r) { this.filterManager.colorTransform(t, e, n, r); }), (n.prototype.requestAbstraction = function (t) { return n._abstractionClassPool[t.assetType]; }), (n.registerAbstraction = function (t, e) { n._abstractionClassPool[e.assetType] = t; }), (n.prototype.requestContext = function (t, e, n, r) { void 0 === t && (t = !1), void 0 === e && (e = Zt.BASELINE), void 0 === n && (n = se.AUTO), void 0 === r && (r = !1), null != this._usesSoftwareRendering && (this._usesSoftwareRendering = t), (this._profile = e); try { this._context = new Ir(this._container, r); } catch (t) { this.dispatchEvent(new Me(Me.STAGE_ERROR, this)); } this._context && this._callback(this._context); }), Object.defineProperty(n.prototype, "width", { get: function () { return (this._sizeDirty = !1), this._width; }, set: function (t) { this._width != t && ((this._container.style.width = t + "px"), (this._container.width = t * this.pixelRatio), (this._width = t), (this._backBufferDirty = !0), this._width && this._height && this._invalidateSize()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return (this._sizeDirty = !1), this._height; }, set: function (t) { this._height != t && ((this._container.style.height = t + "px"), (this._container.height = t * this.pixelRatio), (this._height = t), (this._backBufferDirty = !0), this._width && this._height && this._invalidateSize()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "x", { get: function () { return this._x; }, set: function (t) { this._x != t && (Ct.setElementX(this._container, t), (this._x = t)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "y", { get: function () { return this._y; }, set: function (t) { this._y != t && (Ct.setElementY(this._container, t), (this._y = t)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "visible", { get: function () { return Ct.getElementVisibility(this._container); }, set: function (t) { Ct.setElementVisibility(this._container, t); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "container", { get: function () { return this._container; }, set: function (t) { (this._container = t), this._context && (this._context.container = this._container); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "context", { get: function () { return this._context; }, enumerable: !1, configurable: !0, }), (n.prototype._invalidateSize = function () { this._sizeDirty || ((this._sizeDirty = !0), this.dispatchEvent(new Me(Me.INVALIDATE_SIZE, this))); }), Object.defineProperty(n.prototype, "profile", { get: function () { return this._profile; }, enumerable: !1, configurable: !0, }), (n.prototype.dispose = function () { this._stageManager.iRemoveStage(this), this.freeContext(), (this._stageManager = null), (this._stageIndex = -1), Ve.clearAll(); }), (n.prototype.configureBackBuffer = function (t, e, n, r) { (this.width = t), (this.height = e), (this._antiAlias = n), (this._activeTargetConf.depthStencil = r), this._context && this._context.configureBackBuffer(t, e, n, r); }), Object.defineProperty(n.prototype, "enableDepthAndStencil", { get: function () { return this._activeTargetConf.depthStencil; }, set: function (t) { this._activeTargetConf.depthStencil != t && ((this._activeTargetConf.depthStencil = t), (this._backBufferDirty = !0)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "renderSurfaceSelector", { get: function () { return this._activeTargetConf.surfaceSelector; }, enumerable: !1, configurable: !0, }), (n.prototype.clear = function (t, e, n, r, i, o, a) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 1), void 0 === i && (i = 1), void 0 === o && (o = 0), void 0 === a && (a = Kt.ALL), this._context && (this._backBufferDirty && null == this._activeTargetConf.target && ((this._backBufferDirty = !1), this.configureBackBuffer( this._width, this._height, this._antiAlias, this._activeTargetConf.depthStencil )), this._context.clear(t, e, n, r, i, o, a)); }), Object.defineProperty(n.prototype, "stageIndex", { get: function () { return this._stageIndex; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "usesSoftwareRendering", { get: function () { return this._usesSoftwareRendering; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "antiAlias", { get: function () { return this._antiAlias; }, set: function (t) { this._antiAlias != t && ((this._antiAlias = t), (this._backBufferDirty = !0)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { this._color = t; }, enumerable: !1, configurable: !0, }), (n.prototype.registerProgram = function (t) { for (var e = 0; null != this._programData[e]; ) e++; (this._programData[e] = t), (t.id = e); }), (n.prototype.unRegisterProgram = function (t) { (this._programData[t.id] = null), (t.id = -1); }), (n.prototype.interactionHandler = function (t) { var e = null != t.clientX ? t.clientX : t.changedTouches[0].clientX, n = null != t.clientY ? t.clientY : t.changedTouches[0].clientY, r = this._mapWindowToStage(e, n, Wr); if ( ((this._screenX = r.x), (this._screenY = r.y), (this._touchPoints.length = 0), t.touches) ) for (var i = void 0, o = t.touches.length, a = 0; a < o; a++) (i = t.touches[a]), (r = this._mapWindowToStage(i.clientX, i.clientY, Wr)), this._touchPoints.push(new Oe(r.x, r.y, i.identifier)); }), (n.prototype._mapWindowToStage = function (t, e, n) { void 0 === n && (n = { x: 0, y: 0 }); var r = this.container, i = r.parentElement ? r.getBoundingClientRect() : { x: 0, y: 0, width: 0, height: 0 }; return ( (n.x = ((t - i.x) * r.width) / (i.width * this.pixelRatio)), (n.y = ((e - i.y) * r.height) / (i.height * this.pixelRatio)), n ); }), (n.prototype.freeContext = function () { this._context && (this._context.dispose(), this.dispatchEvent(new Me(Me.CONTEXT_DISPOSED, this))), (this._context = null), (this._initialised = !1); }), (n.prototype.onContextLost = function (t) {}), (n.prototype.onContextRestored = function (t) {}), (n.prototype.recoverFromDisposal = function () { return !!this._context; }), (n.prototype._callback = function (t) { var e = t._gl; (Ne.MAX_SIZE = e.getParameter(e.MAX_TEXTURE_SIZE)), (this._context = t), (this._container = this._context.container), this._width && this._height && this._context.configureBackBuffer( this._width, this._height, this._antiAlias, this._activeTargetConf.depthStencil ), this.dispatchEvent( new Me( this._initialised ? Me.CONTEXT_RECREATED : Me.CONTEXT_CREATED, this ) ), (this._initialised = !0); }), (n.prototype.setVertexBuffer = function (t, e, n, r, i, o) { void 0 === o && (o = !1), this._context.setVertexBufferAt(t, e, i, Kr[o ? n + 4 : n][r - 1]); }), (n.prototype.setScissor = function (t) { this._backBufferDirty && null == this._activeTargetConf.target && ((this._backBufferDirty = !1), this.configureBackBuffer( this._width, this._height, this._antiAlias, this._activeTargetConf.depthStencil )), (this._lastScissorBox || t) && ((t && this._lastScissorBox && this._lastScissorBox.equals(t)) || (t ? (this._lastScissorBox || (this._lastScissorBox = new K()), this._lastScissorBox.copyFrom(t)) : (this._lastScissorBox = null), this._context.setScissorRectangle(t))); }), (n.prototype.setSamplerAt = function (t, e) { var n = e.repeat ? ae.REPEAT : ae.CLAMP, r = e.smooth && !this.globalDisableSmooth ? ne.LINEAR : ne.NEAREST, i = e.mipmap && !this.globalDisableMipmap ? $t.MIPLINEAR : $t.MIPNONE; this._context.setSamplerStateAt(t, n, r, i); }), (n._abstractionClassPool = {}), n ); })(h), $r = (function (t) { function n() { var e = t.call(this) || this; return ( (e._stages = new Array(n.STAGE_MAX_QUANTITY)), (e._onContextCreatedDelegate = function (t) { return e.onContextCreated(t); }), e ); } return ( e(n, t), (n.getInstance = function () { return ( null == this._instance && (this._instance = new n()), this._instance ); }), (n.prototype.getStageAt = function (t, e, r, i, o) { if ( (void 0 === e && (e = !1), void 0 === r && (r = Zt.BASELINE), void 0 === i && (i = se.AUTO), void 0 === o && (o = !1), t < 0 || t >= n.STAGE_MAX_QUANTITY) ) throw new T( "Index is out of bounds [0.." + n.STAGE_MAX_QUANTITY + "]" ); if (!this._stages[t]) { if ((n._numStages++, document && null == n.htmlCanvas)) ((a = document.createElement("canvas")).id = "stage" + t), document.body.appendChild(a); else if (n.htmlCanvas) var a = n.htmlCanvas; var s = (this._stages[t] = new Jr(a, t, this, e, r)); s.addEventListener( Me.CONTEXT_CREATED, this._onContextCreatedDelegate ), s.requestContext(e, r, i, o); } return this._stages[t]; }), (n.prototype.iRemoveStage = function (t) { n._numStages--, t.removeEventListener( Me.CONTEXT_CREATED, this._onContextCreatedDelegate ), (this._stages[t.stageIndex] = null); }), (n.prototype.getFreeStage = function (t, e, n, r) { void 0 === t && (t = !1), void 0 === e && (e = Zt.BASELINE), void 0 === n && (n = se.AUTO), void 0 === r && (r = !1); for (var i = 0, o = this._stages.length; i < o; ) { if (!this._stages[i]) return this.getStageAt(i, t, e, n, r); ++i; } return null; }), Object.defineProperty(n.prototype, "hasFreeStage", { get: function () { return n._numStages < n.STAGE_MAX_QUANTITY; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "numSlotsFree", { get: function () { return n.STAGE_MAX_QUANTITY - n._numStages; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "numSlotsUsed", { get: function () { return n._numStages; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "numSlotsTotal", { get: function () { return this._stages.length; }, enumerable: !1, configurable: !0, }), (n.prototype.onContextCreated = function (t) {}), (n.STAGE_MAX_QUANTITY = 8), (n.htmlCanvas = null), (n._numStages = 0), n ); })(h), Zr = (function () { function t() {} return ( (t.prototype.createImage2D = function (t, e, n, r, i) { return ( void 0 === n && (n = !0), void 0 === r && (r = null), void 0 === i && (i = !0), new nn(t, e, n, r, i) ); }), t ); })(); var ti = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this, it.BLOB) || this; return (r._factory = e || new Zr()), (r._alphaChannel = n), r; } return ( e(n, t), (n.supportsType = function (t) { return (t = t.toLowerCase().trim()), this.SUPPORTED_TYPES.includes(t); }), (n.supportsData = function (t) { if (t instanceof HTMLImageElement) return !0; if (!(t instanceof v)) return !1; var e = t; return ( (e.position = 0), 55551 == e.readUnsignedShort() || ((e.position = 0), 16973 == e.readShort() || ((e.position = 1), "PNG" == e.readUTFBytes(3) || ((e.position = 0), ("GIF" == e.readUTFBytes(3) && 14393 == e.readShort() && 97 == e.readByte()) || ((e.position = 0), "ATF" == e.readUTFBytes(3))))) ); }), (n.prototype._pFinalizeAsset = function (e, n) { this._alphaChannel && (e.alphaChannel = this._alphaChannel), t.prototype._pFinalizeAsset.call(this, e, n); }), (n.prototype._pProceedParsing = function () { var t, e, n = this; if (this._loadingImage) return mt.MORE_TO_PARSE; if ( (!this._htmlImageElement && this.data instanceof HTMLImageElement && (this._htmlImageElement = this.data), this._htmlImageElement) ) { var r = Ne.imageToBitmapImage2D( this._htmlImageElement, !1, this._factory ); return ( this._pFinalizeAsset(r, this._iFileName), (this._pContent = r), mt.PARSING_DONE ); } if (this.data instanceof dt) return ( (t = new hn(this.data)), this._pFinalizeAsset(t, this._iFileName), (this._pContent = t), mt.PARSING_DONE ); if (this.data instanceof v) (this.data.position = 0), (e = new Blob([this.data.arraybytes])); else if (this.data instanceof ArrayBuffer) e = new Blob([this.data]); else { if (!(this.data instanceof Blob)) throw "Unknow data"; e = this.data; } var i = (function (t, e) { if ("createImageBitmap" in self) return self.createImageBitmap(t).then(e), null; var n = URL.createObjectURL(t), r = new Image(); return ( (r.src = n), r.naturalWidth ? r : ((r.onload = function (t) { e(r), URL.revokeObjectURL(n); }), null) ); })(e, function (t) { return (n._htmlImageElement = t), n.onLoadComplete(null), !0; }); return ( i instanceof HTMLImageElement && i.naturalWidth && ((this._htmlImageElement = i), (t = Ne.imageToBitmapImage2D( this._htmlImageElement, !1, this._factory )), this._pFinalizeAsset(t, this._iFileName), (this._pContent = t)), (this._loadingImage = !0), mt.MORE_TO_PARSE ); }), (n.prototype.onLoadComplete = function (t) { this._loadingImage = !1; }), (n.SUPPORTED_TYPES = ["jpg", "jpeg", "png", "gif"]), n ); })(mt), ei = (function (t) { function n() { return t.call(this, it.TEXT) || this; } return ( e(n, t), (n.supportsType = function (t) { return "cube" == (t = t.toLowerCase()); }), (n.supportsData = function (t) { try { return !!JSON.parse(t); } catch (t) { return !1; } }), (n.prototype._iResolveDependency = function (t) {}), (n.prototype._iResolveDependencyFailure = function (t) {}), (n.prototype._pProceedParsing = function () { if (null != this._imgDependencyDictionary) { var t = new ln(this._getBitmapImage2D(n.posX).width), e = new K(0, 0, t.size, t.size); return ( t.setPixels(ln.posX, e, this._getBitmapImage2D(n.posX).data), t.setPixels(ln.negX, e, this._getBitmapImage2D(n.negX).data), t.setPixels(ln.posY, e, this._getBitmapImage2D(n.posY).data), t.setPixels(ln.negY, e, this._getBitmapImage2D(n.negY).data), t.setPixels(ln.posZ, e, this._getBitmapImage2D(n.posZ).data), t.setPixels(ln.negZ, e, this._getBitmapImage2D(n.negZ).data), (this._imgDependencyDictionary = null), (t.name = this._iFileName), this._pFinalizeAsset(t, this._iFileName), mt.PARSING_DONE ); } try { var r = JSON.parse(this.data), i = r.data, o = void 0; if ( (6 != i.length && this._pDieWithError( "ImageCubeParser: Error - cube texture should have exactly 6 images" ), r) ) { this._imgDependencyDictionary = new Object(); for (var a = 0; a < i.length; a++) (o = i[a]), (this._imgDependencyDictionary[o.id] = this._pAddDependency( o.id, new dt(o.image.toString()) )); return this._validateCubeData() ? (this._pPauseAndRetrieveDependencies(), mt.MORE_TO_PARSE) : (this._pDieWithError( "ImageCubeParser: JSON data error - cubes require id of: \n" + n.posX + ", " + n.negX + ", \n" + n.posY + ", " + n.negY + ", \n" + n.posZ + ", " + n.negZ ), mt.PARSING_DONE); } } catch (t) { this._pDieWithError("CubeTexturePaser Error parsing JSON"); } return mt.PARSING_DONE; }), (n.prototype._validateCubeData = function () { return ( null != this._imgDependencyDictionary[n.posX] && null != this._imgDependencyDictionary[n.negX] && null != this._imgDependencyDictionary[n.posY] && null != this._imgDependencyDictionary[n.negY] && null != this._imgDependencyDictionary[n.posZ] && null != this._imgDependencyDictionary[n.negZ] ); }), (n.prototype._getBitmapImage2D = function (t) { var e = this._imgDependencyDictionary[t]; return e ? e.assets[0] : null; }), (n.posX = "posX"), (n.negX = "negX"), (n.posY = "posY"), (n.negY = "negY"), (n.posZ = "posZ"), (n.negZ = "negZ"), n ); })(mt), ni = (function (t) { function n() { var e = t.call(this, it.TEXT) || this; return (e._parseState = 0), e; } return ( e(n, t), (n.supportsType = function (t) { return "xml" == (t = t.toLowerCase()); }), (n.supportsData = function (t) { try { var e = b.toString(t); return ( -1 != e.indexOf("TextureAtlas") || -1 != e.indexOf("textureatlas") ); } catch (t) { return !1; } }), (n.prototype._iResolveDependency = function (t) { t.assets.length ? ((this._imageData = t.assets[0]), this._pFinalizeAsset(this._imageData), (this._parseState = ri.PARSE_SUBTEXTURES)) : (this._parseState = ri.PARSE_COMPLETE); }), (n.prototype._iResolveDependencyFailure = function (t) { this._parseState = ri.PARSE_COMPLETE; }), (n.prototype._pProceedParsing = function () { switch (this._parseState) { case ri.PARSE_XML: try { (this._doc = wt.getChildrenWithTag( wt.strToXml(this._pGetTextData()), "TextureAtlas" )[0]), (this._imagePath = wt.readAttributeValue( this._doc, "imagePath" )), (this._subTextureNodes = wt.getChildrenWithTag( this._doc, "SubTexture" )), (this._parseState = ri.PARSE_IMAGE); } catch (t) { return mt.PARSING_DONE; } break; case ri.PARSE_IMAGE: if (!this._imagePath) return mt.PARSING_DONE; this._pAddDependency(this._imagePath, new dt(this._imagePath)), this._pPauseAndRetrieveDependencies(); break; case ri.PARSE_SUBTEXTURES: for ( var t, e, n, r, i, o, a = this._subTextureNodes.length, s = 0; s < a; s++ ) (e = this._subTextureNodes[s]), (t = new Le()), (n = wt.readAttributeValue(e, "x")), (r = wt.readAttributeValue(e, "y")), (i = wt.readAttributeValue(e, "width")), (o = wt.readAttributeValue(e, "height")), (n || r || i || o) && (t.imageRect = new K( parseInt(n) / this._imageData.width, parseInt(r) / this._imageData.height, parseInt(i) / this._imageData.width, parseInt(o) / this._imageData.height )), (n = wt.readAttributeValue(e, "frameX")), (r = wt.readAttributeValue(e, "frameY")), (i = wt.readAttributeValue(e, "frameWidth")), (o = wt.readAttributeValue(e, "frameHeight")), (n || r || i || o) && (t.frameRect = new K( parseInt(n), parseInt(r), parseInt(i), parseInt(o) )), this._pFinalizeAsset(t, wt.readAttributeValue(e, "name")); this._parseState = ri.PARSE_COMPLETE; break; case ri.PARSE_COMPLETE: return mt.PARSING_DONE; } return mt.MORE_TO_PARSE; }), n ); })(mt), ri = (function () { function t() {} return ( (t.PARSE_XML = 0), (t.PARSE_IMAGE = 1), (t.PARSE_SUBTEXTURES = 2), (t.PARSE_COMPLETE = 3), t ); })(), ii = (function () { return function () { (this.textures = new Array()), (this.animatableAttributes = new Array()), (this.animationTargetRegisters = new Array()); }; })(), oi = (function (t) { function n(e, n) { void 0 === e && (e = 0), void 0 === n && (n = 0); var r = t.call(this) || this; return ( (r._count = 0), (r._newCount = 0), (r._stride = 0), (r._newStride = 0), (r._viewVOs = new Array()), (r._stride = r._newStride = e), (r._count = r._newCount = n), (r._buffer = new ArrayBuffer(r._stride * r._count)), (r._bufferView = new Uint8Array(r._buffer, 0, r._buffer.byteLength)), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "stride", { get: function () { return this._lengthDirty && this._updateLength(), this._stride; }, set: function (t) { this._newStride != t && ((this._newStride = t), this.resize()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "count", { get: function () { return this._newCount; }, set: function (t) { this._newCount != t && ((this._newCount = t), this.resize()); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "buffer", { get: function () { return ( this._lengthDirty && this._updateLength(), (this._contentDirty = !1), this._buffer ); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "bufferView", { get: function () { return ( this._lengthDirty && this._updateLength(), (this._contentDirty = !1), this._bufferView ); }, set: function (t) { (this._bufferView = t), (this._buffer = this._bufferView.buffer); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "length", { get: function () { return this._count * this.stride; }, enumerable: !1, configurable: !0, }), (n.prototype.invalidate = function () { this._contentDirty || (t.prototype.invalidate.call(this), (this._contentDirty = !0)); }), (n.prototype.resize = function () { this._lengthDirty || (this.clear(), (this._lengthDirty = !0), this._newStride || ((this._buffer = null), (this._bufferView = null))); }), (n.prototype.cloneBufferView = function () { var t = new n(this._stride, this._count); return t.bufferView.set(this.bufferView), t; }), (n.prototype.clone = function () { var t = new n(this._stride, this._count); t.bufferView.set(this.bufferView); for (var e = this._viewVOs.length, r = 0; r < e; r++) this._viewVOs[r].view._internalClone(t); return t; }), (n.prototype.getView = function (t) { return t < this._viewVOs.length ? this._viewVOs[t].view : null; }), (n.prototype._setAttributes = function (t, e, n) { void 0 === n && (n = 0); var r = e instanceof Uint8Array ? e : new Uint8Array(e.buffer), i = this._viewVOs[t], o = i.length, a = i.offset, s = r.length / o; if ( (this.count < s + n && (this.count = s + n), this._lengthDirty && this._updateLength(), 1 == this._viewVOs.length) ) this._bufferView.set(r); else for (var u = 0; u < s; u++) this._bufferView.set( r.subarray(u * o, (u + 1) * o), (u + n) * this._stride + a ); this.invalidate(); }), (n.prototype._addView = function (t) { var e = new ai(t), n = this._viewVOs.length; (e.offset = n ? this._viewVOs[n - 1].offset + this._viewVOs[n - 1].length : 0), this._viewVOs.push(e), this._newStride < e.offset + e.length && ((this._newStride = e.offset + e.length), this.resize()), (t._index = n); }), (n.prototype._removeView = function (t) { var e = t._index, n = this._viewVOs.splice(e, 1)[0], r = this._viewVOs.length; n.dispose(); for (var i = e; i < r; i++) ((n = this._viewVOs[i]).offset = i ? this._viewVOs[i - 1].offset + this._viewVOs[i - 1].length : 0), (n.view._index = i); (this._newStride = r ? this._viewVOs[r - 1].offset + this._viewVOs[r - 1].length : 0), this.resize(); }), (n.prototype._getOffset = function (t) { return this._viewVOs[t].offset; }), (n.prototype._updateLength = function () { var t, e; this._lengthDirty = !1; var n = this._viewVOs.length, r = this._newStride * this._newCount; if (!this._buffer || this._buffer.byteLength != r) { var i = new ArrayBuffer(r), o = new Uint8Array(i, 0, i.byteLength), a = void 0, s = void 0, u = void 0, l = void 0; if (this._buffer) if (this._stride != this._newStride) { for (t = 0; t < n; t++) { for ( s = (a = this._viewVOs[t]).length, u = a.offset, l = a.oldOffset, e = 0; e < this._count; e++ ) null != l && o.set( new Uint8Array(this._buffer, e * this._stride + l, s), e * this._newStride + u ); a.oldOffset = a.offset; } this._stride = this._newStride; } else o.set( new Uint8Array( this._buffer, 0, Math.min(r, this._buffer.byteLength) ) ); (this._buffer = i), (this._bufferView = o); } this._count = this._newCount; }), (n.assetType = "[assets AttributesBuffer]"), n ); })(f), ai = (function () { function t(t) { (this.view = t), (this.length = t.size * t.dimensions); } return ( (t.prototype.dispose = function () { this.view = null; }), (t.prototype.clone = function () { return new t(this.view); }), t ); })(), si = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._stage = n), (r._attributesBuffer = e), r; } return ( e(n, t), Object.defineProperty(n.prototype, "vertexValid", { get: function () { return !this._invalid && this._vertexBuffer; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "indexValid", { get: function () { return !this._invalid && this._indexBuffer; }, enumerable: !1, configurable: !0, }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._attributesBuffer = null), this._indexBuffer && (this._indexBuffer.dispose(), (this._indexBuffer = null)), this._vertexBuffer && (this._vertexBuffer.dispose(), (this._vertexBuffer = null)); }), (n.prototype.activate = function (t, e, n, r, i) { void 0 === i && (i = !1), this._stage.setVertexBuffer(t, this._getVertexBuffer(), e, n, r, i); }), (n.prototype.draw = function (t, e, n) { this._stage.context.drawIndices(t, this._getIndexBuffer(), e, n); }), (n.prototype._getIndexBuffer = function () { return ( this._indexBuffer || ((this._invalid = !0), (this._indexBuffer = this._stage.context.createIndexBuffer( (this._attributesBuffer.count * this._attributesBuffer.stride) / 2 ))), this._invalid && ((this._invalid = !1), this._indexBuffer.uploadFromByteArray( this._attributesBuffer.buffer, 0, this._attributesBuffer.length )), this._indexBuffer ); }), (n.prototype._getVertexBuffer = function () { return ( this._vertexBuffer || ((this._invalid = !0), (this._vertexBuffer = this._stage.context.createVertexBuffer( this._attributesBuffer.count, this._attributesBuffer.stride ))), this._invalid && ((this._invalid = !1), this._vertexBuffer.uploadFromByteArray( this._attributesBuffer.buffer, 0, this._attributesBuffer.count )), this._vertexBuffer ); }), n ); })(W); Jr.registerAbstraction(si, oi); var ui = (function (t) { function n(e, n, r, i) { void 0 === r && (r = 0), void 0 === i && (i = !1); var o = t.call(this) || this; return ( (o._arrayClass = e), (o._size = e.BYTES_PER_ELEMENT), (o._dimensions = n), (o._attributesBuffer = r instanceof oi ? r : new oi(o._dimensions * o._size, r)), o._attributesBuffer._addView(o), (o._unsigned = i), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "attributesBuffer", { get: function () { return this._attributesBuffer; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "size", { get: function () { return this._size; }, set: function (t) { this._size != t && ((this._size = t), this._attributesBuffer._removeView(this), this._attributesBuffer._addView(this)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "dimensions", { get: function () { return this._dimensions; }, set: function (t) { this._dimensions != t && ((this._dimensions = t), this._attributesBuffer._removeView(this), this._attributesBuffer._addView(this)); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "unsigned", { get: function () { return this._unsigned; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "count", { get: function () { return this._attributesBuffer.count; }, set: function (t) { this._attributesBuffer.count = t; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "offset", { get: function () { return this._attributesBuffer._getOffset(this._index); }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "length", { get: function () { return this._attributesBuffer.count * this._dimensions; }, enumerable: !1, configurable: !0, }), Object.defineProperty(n.prototype, "stride", { get: function () { return this._attributesBuffer.stride / this._size; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (t, e) { void 0 === e && (e = 0), this._attributesBuffer._setAttributes( this._index, t instanceof Array ? new this._arrayClass(t) : t, e ); }), (n.prototype.get = function (t, e) { return ( void 0 === e && (e = 0), new this._arrayClass( this._attributesBuffer.buffer, e * this._attributesBuffer.stride + this.offset, t * this.stride - this.offset / this.size ) ); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n( this._arrayClass, this._dimensions, t, this._unsigned )); }), (n.prototype.clone = function (t) { void 0 === t && (t = null), t && this._internalClone(t), this._cloneCache || this._attributesBuffer.clone(); var e = this._cloneCache; return (this._cloneCache = null), e; }), (n.prototype.invalidate = function () { t.prototype.invalidate.call(this), this._attributesBuffer.invalidate(); }), (n.prototype.dispose = function () { this._attributesBuffer && (this._attributesBuffer._removeView(this), (this._attributesBuffer = null)); }), (n.assetType = "[attributes AttributesView]"), n ); })(f), li = (function (t) { function n(e, n) { return ( void 0 === n && (n = !0), t.call(this, n ? Uint8Array : Int8Array, 4, e, n) || this ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (e, n) { void 0 === n && (n = 0), t.prototype.set.call(this, e, n); }), (n.prototype.get = function (e, n) { return void 0 === n && (n = 0), t.prototype.get.call(this, e, n); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n(t, this._arrayClass == Uint8Array)); }), (n.prototype.clone = function (e) { return void 0 === e && (e = null), t.prototype.clone.call(this, e); }), (n.assetType = "[attributes Byte4Attributes]"), n ); })(ui), ci = (function (t) { function n(e) { return t.call(this, Float32Array, 1, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (e, n) { void 0 === n && (n = 0), t.prototype.set.call(this, e, n); }), (n.prototype.get = function (e, n) { return void 0 === n && (n = 0), t.prototype.get.call(this, e, n); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n(t)); }), (n.prototype.clone = function (e) { return void 0 === e && (e = null), t.prototype.clone.call(this, e); }), (n.assetType = "[attributes Float1Attributes]"), n ); })(ui), hi = (function (t) { function n(e) { return t.call(this, Float32Array, 2, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (e, n) { void 0 === n && (n = 0), t.prototype.set.call(this, e, n); }), (n.prototype.get = function (e, n) { return void 0 === n && (n = 0), t.prototype.get.call(this, e, n); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n(t)); }), (n.prototype.clone = function (e) { return void 0 === e && (e = null), t.prototype.clone.call(this, e); }), (n.assetType = "[attributes Float2Attributes]"), n ); })(ui), pi = (function (t) { function n(e) { return t.call(this, Float32Array, 3, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (e, n) { void 0 === n && (n = 0), t.prototype.set.call(this, e, n); }), (n.prototype.get = function (e, n) { return void 0 === n && (n = 0), t.prototype.get.call(this, e, n); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n(t)); }), (n.prototype.clone = function (e) { return void 0 === e && (e = null), t.prototype.clone.call(this, e); }), (n.assetType = "[attributes Float3Attributes]"), n ); })(ui), di = (function (t) { function n(e) { return t.call(this, Float32Array, 4, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (e, n) { void 0 === n && (n = 0), t.prototype.set.call(this, e, n); }), (n.prototype.get = function (e, n) { return void 0 === n && (n = 0), t.prototype.get.call(this, e, n); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n(t)); }), (n.prototype.clone = function (e) { return void 0 === e && (e = null), t.prototype.clone.call(this, e); }), (n.assetType = "[attributes Float4Attributes]"), n ); })(ui), fi = (function (t) { function n(e, n) { return ( void 0 === n && (n = !0), t.call(this, n ? Uint16Array : Int16Array, 3, e, n) || this ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !1, configurable: !0, }), (n.prototype.set = function (e, n) { void 0 === n && (n = 0), t.prototype.set.call(this, e, n); }), (n.prototype.get = function (e, n) { return void 0 === n && (n = 0), t.prototype.get.call(this, e, n); }), (n.prototype._internalClone = function (t) { return (this._cloneCache = new n(t, this._arrayClass == Uint16Array)); }), (n.prototype.clone = function (e) { return void 0 === e && (e = null), t.prototype.clone.call(this, e); }), (n.assetType = "[attributes Short3Attributes]"), n ); })(ui), gi = { get PREF_VERSION() { return De.PREF_WEBGL_VERSION; }, set PREF_VERSION(t) { De.PREF_WEBGL_VERSION = 2 !== t ? 1 : 2; }, get PREF_MULTISAMPLE() { return De.ENABLE_MULTISAMPLE_TEXTURE; }, set PREF_MULTISAMPLE(t) { De.ENABLE_MULTISAMPLE_TEXTURE = !!t; }, PREF_MIPMAP: 1, PREF_REPEAT_WRAP: 1, }; console.debug("AwayJS - Stage - 0.11.116"), ct.enableParser(ti), ct.enableParser(ei), ct.enableParser(ni), Ne.registerDefaults(nn, ln, Zr), Jr.registerAbstraction(Ue, ke), Jr.registerAbstraction(un, sn), Jr.registerAbstraction(rn, nn), Jr.registerAbstraction(cn, ln), Jr.registerAbstraction(pn, hn), Jr.registerAbstraction(rn, an), Jr.registerAbstraction(xr, Er); var _i = (function () { function t(t, e) { (this.id = t.id), (this.partitionClass = e); } return ( (t.getRootNode = function (e, n) { return e.getAbstraction(new t(e, n)); }), (t.prototype.getNode = function (t) { return t.getAbstraction(this); }), (t.prototype.requestAbstraction = function (t) { return mi; }), t ); })(), mi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; (r._position = new B()), (r._matrix3D = new F()), (r._inverseMatrix3DDirty = !0), (r._orientationMatrix = new F()), (r._colorTransformDisabled = !1), (r._transformDisabled = !1), (r._maskId = -1), (r._masks = []), (r._childNodes = new Array()), (r._numChildNodes = 0), (r._hierarchicalPropsDirty = Lt.ALL), (r._onEvent = r._onEvent.bind(r)), (r.container = e), r.container.addEventListener(ce.INVALIDATE_PROPERTY, r._onEvent), r.container.addEventListener(le.ADD_CHILD_AT, r._onEvent), r.container.addEventListener(le.REMOVE_CHILD_AT, r._onEvent), r.container.addEventListener(le.INVALIDATE_ENTITY, r._onEvent), r.container.addEventListener(le.CLEAR_ENTITY, r._onEvent); for (var i = 0; i < e.numChildren; ++i) r.addChildAt(e.getChildAt(i), r._numChildNodes); return ( r.container.isEntity() && r.invalidateEntity(r.container), (r._hierarchicalPropsDirty = Lt.ALL), (r._activeTransform = r.container.transform), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "parent", { get: function () { return this._parent; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "partition", { get: function () { var t; if ( !this._partition || this._partitionClass !== this.container.partitionClass ) { if ( ((this._partitionClass = this.container.partitionClass), this.parent === this) ) throw "Self REF!!!"; (this._partition = this.container.partitionClass ? new this.container.partitionClass(this) : (null === (t = this._parent) || void 0 === t ? void 0 : t.partition) || new this._pool.partitionClass(this)), this.container.isEntity() && this.invalidateEntity(this.container); } return this._partition; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pickObjectNode", { get: function () { return ( this._pickObject != this.container.pickObject && ((this._pickObject = this.container.pickObject), this._pickObject ? ((this._pickObject.partitionClass = vi), (this._pickObjectNode = this._pickObject.getAbstraction( this._pool )), this._pickObject.pickObjectFromTimeline && this._pickObjectNode.setParent(this)) : (this._pickObjectNode.setParent(null), (this._pickObjectNode = null))), this._pickObjectNode ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "renderToImage", { get: function () { var t, e = this.container, n = e.cacheAsBitmap || (null === (t = e.filters) || void 0 === t ? void 0 : t.length) > 0 || (e.blendMode && !(e.blendMode === dn.LAYER || e.blendMode === dn.NORMAL)); return ( this._renderToImage !== n && ((this._renderToImage = n), this._renderToImage || this.partition.clearLocalNode()), this._renderToImage ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "boundsVisible", { get: function () { return !1; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pool", { get: function () { return this._pool; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "colorTransformDisabled", { get: function () { return this._colorTransformDisabled; }, set: function (t) { this._colorTransformDisabled = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "transformDisabled", { get: function () { return this._transformDisabled; }, set: function (t) { this._transformDisabled != t && ((this._transformDisabled = t), (this._colorTransformDisabled = t), this._transformDisabled ? (this._activeTransform = n._nullTransform) : (this._activeTransform = this.container.transform)); }, enumerable: !0, configurable: !0, }), (n.prototype.getScale9Container = function () { var t; return ( this._hierarchicalPropsDirty & Lt.SCALE9 && ((this._scale9Container = this.container.scale9Grid ? this.container : null === (t = this._parent) || void 0 === t ? void 0 : t.getScale9Container()), (this._hierarchicalPropsDirty ^= Lt.SCALE9)), this._scale9Container ); }), (n.prototype.getPosition = function () { return ( this._positionDirty && (this.container._registrationMatrix3D && this.container.alignmentMode === Rt.REGISTRATION_POINT ? ((this._position.x = -this.container._registrationMatrix3D._rawData[12]), (this._position.y = -this.container._registrationMatrix3D._rawData[13]), (this._position.z = -this.container._registrationMatrix3D._rawData[14]), (this._position = this.getMatrix3D().transformVector( this._position, this._position ))) : this.getMatrix3D().copyColumnTo(3, this._position), (this._positionDirty = !1)), this._position ); }), (n.prototype.getInverseMatrix3D = function () { return ( this._inverseMatrix3DDirty && (this._inverseMatrix3D || (this._inverseMatrix3D = new F()), (this._inverseMatrix3DDirty = !1), this._inverseMatrix3D.copyFrom(this.getMatrix3D()), this._inverseMatrix3D.invert()), this._inverseMatrix3D || (this._inverseMatrix3D = new F()) ); }), (n.prototype.getMatrix3D = function () { return ( this._hierarchicalPropsDirty & Lt.SCENE_TRANSFORM && (this._matrix3D.copyFrom(this._activeTransform.matrix3D), this.container._registrationMatrix3D && (this._matrix3D.prepend(this.container._registrationMatrix3D), this.container.alignmentMode != Rt.REGISTRATION_POINT && this._matrix3D.appendTranslation( -this.container._registrationMatrix3D._rawData[12] * this._activeTransform.scale.x, -this.container._registrationMatrix3D._rawData[13] * this._activeTransform.scale.y, -this.container._registrationMatrix3D._rawData[14] * this._activeTransform.scale.z )), this._parent && this._matrix3D.append(this._parent.getMatrix3D()), !this.container.maskMode && this.container.scrollRect ? this._matrix3D.prependTranslation( -this.container.scrollRect.x, -this.container.scrollRect.y, 0 ) : this.container.maskMode && this.container.scrollRect && this._matrix3D.prependTranslation( this.container.scrollRect.x, this.container.scrollRect.y, 0 ), (this._hierarchicalPropsDirty ^= Lt.SCENE_TRANSFORM), this.container._iController && this.container._iController.updateController()), this._matrix3D ); }), (n.prototype.getRenderMatrix3D = function (t) { if (this.container.orientationMode == Nt.CAMERA_PLANE) { var e = t.decompose(); return ( e[0].copyFrom(this.getPosition()), e[3].copyFrom(this._activeTransform.scale), this._orientationMatrix.recompose(e), this.container._registrationMatrix3D && (this._orientationMatrix.prepend( this.container._registrationMatrix3D ), this.container.alignmentMode != Rt.REGISTRATION_POINT && this._orientationMatrix.appendTranslation( -this.container._registrationMatrix3D._rawData[12] * this._activeTransform.scale.x, -this.container._registrationMatrix3D._rawData[13] * this._activeTransform.scale.y, -this.container._registrationMatrix3D._rawData[14] * this._activeTransform.scale.z )), this._orientationMatrix ); } return this.getMatrix3D(); }), (n.prototype.getColorTransform = function () { if (this._colorTransformDisabled) return n._nullColorTransform; if (this._hierarchicalPropsDirty & Lt.COLOR_TRANSFORM) { if ( ((this._hierarchicalPropsDirty ^= Lt.COLOR_TRANSFORM), this._colorTransformDisabled) ) return n._nullColorTransform; this._colorTransform || (this._colorTransform = new S()), this._parent && this._parent.getColorTransform() ? (this._colorTransform.copyFrom( this._parent.getColorTransform() ), this._colorTransform.prepend( this.container.transform.colorTransform )) : this._colorTransform.copyFrom( this.container.transform.colorTransform ); } return this._colorTransform || n._nullColorTransform; }), (n.prototype.getMaskId = function () { return ( this._hierarchicalPropsDirty & Lt.MASK_ID && ((this._maskId = -1 != this.container.maskId ? this.container.maskId : this._parent ? this._parent.getMaskId() : -1), (this._hierarchicalPropsDirty ^= Lt.MASK_ID)), this._maskId ); }), (n.prototype.getMasks = function (t) { if ((void 0 === t && (t = !1), !t)) return this._masks; if (this.container.masks) { var e = this.container.masks.length; this._masks.length = e; for (var n = 0; n < e; n++) this._masks[n] = this._pool.getNode( this.container.masks[n] ).partition.rootNode; } else this._masks.length = 0; return this._masks; }), (n.prototype.getMaskOwners = function () { var t; if (this._hierarchicalPropsDirty & Lt.MASKS) { var e = this.getMasks(!0); (this._maskOwners = (null === (t = this._parent) || void 0 === t ? void 0 : t.getMaskOwners()) && -1 == this.getMaskId() ? e.length ? this._parent.getMaskOwners().concat([this]) : this._parent.getMaskOwners().concat() : e.length ? [this] : null), (this._hierarchicalPropsDirty ^= Lt.MASKS); } return this._maskOwners; }), (n.prototype.globalToLocal = function (t, e) { void 0 === e && (e = null); var r = n._tempVector3D; r.setTo(t.x, t.y, 0); var i = this.getInverseMatrix3D().transformVector(r, r); return e || (e = new P()), (e.x = i.x), (e.y = i.y), e; }), (n.prototype.globalToLocal3D = function (t) { return this.getInverseMatrix3D().transformVector(t); }), (n.prototype.localToGlobal = function (t, e) { void 0 === e && (e = null); var r = n._tempVector3D; r.setTo(t.x, t.y, 0); var i = this.getMatrix3D().transformVector(r, r); return e || (e = new P()), (e.x = i.x), (e.y = i.y), e; }), (n.prototype.getBoundsPrimitive = function (t) { return null; }), (n.prototype._onEvent = function (t) { switch (t.type) { case le.CLEAR_ENTITY: return this.clearEntity(); case le.INVALIDATE_ENTITY: return this.invalidateEntity(t.entity); case le.REMOVE_CHILD_AT: return this.removeChildAt(t.index); case le.ADD_CHILD_AT: return this.addChildAt(t.entity, t.index); case ce.INVALIDATE_PROPERTY: return this.invalidateHierarchicalProperty(t.property); } }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this.container.removeEventListener( ce.INVALIDATE_PROPERTY, this._onEvent ), this.container.removeEventListener(le.ADD_CHILD_AT, this._onEvent), this.container.removeEventListener( le.REMOVE_CHILD_AT, this._onEvent ), this.container.removeEventListener( le.INVALIDATE_ENTITY, this._onEvent ), this.container.removeEventListener(le.CLEAR_ENTITY, this._onEvent), this._entityNode && this.clearEntity(); for (var n = 0; n < this._numChildNodes; n++) this._childNodes[n].onClear(e); this._pickObject && ((this._pickObject = null), this._pickObjectNode.setParent(null), (this._pickObjectNode = null)), this.clear(); }), (n.prototype.onInvalidate = function (e) { var n; t.prototype.onInvalidate.call(this, e), this.partition != (null === (n = this._parent) || void 0 === n ? void 0 : n.partition) && this._partition.invalidate(), this.container.isEntity() && this.invalidateEntity(this.container); }), (n.prototype.isInFrustum = function (t, e, n, r) { return !this.isInvisible(); }), (n.prototype.isInvisible = function () { var t; return ( this._hierarchicalPropsDirty & Lt.VISIBLE && ((this._invisible = !this._transformDisabled && (!this.container.visible || (null === (t = this.parent) || void 0 === t ? void 0 : t.isInvisible()))), (this._hierarchicalPropsDirty ^= Lt.VISIBLE)), this._invisible ); }), (n.prototype.isIntersectingRay = function (t, e, n, r) { return !0; }), (n.prototype.isRenderable = function () { return ( !this.isInvisible() && this.getColorTransform()._isRenderable() ); }), (n.prototype.isCastingShadow = function () { return !0; }), (n.prototype.dispose = function () { (this._parent = null), (this._childNodes = null); }), (n.prototype.acceptTraverser = function (t) { if ( (this.partition.rootNode == this && this.partition.updateEntities(), (t.partition === this.partition || t === t.getTraverser(this.partition)) && t.enterNode(this)) ) { this.container.maskMode || this._scrollRect === this.container.scrollRect || ((this._scrollRect = this.container.scrollRect), this._scrollRectNode && (this._scrollRectNode.setParent(null), (this._scrollRectNode = null)), this._scrollRect && ((this._scrollRectNode = this.container .getScrollRectPrimitive() .getAbstraction(this._pool)), (this._scrollRectNode.container.scrollRect = this._scrollRect), this._scrollRectNode.setParent(this))); for (var e = this._numChildNodes - 1; e >= 0; e--) this._childNodes[e].acceptTraverser(t); this._entityNode && this._entityNode.acceptTraverser(t); } }), (n.prototype.addChildAt = function (t, e) { var n = t.getAbstraction(this._pool); return ( n.setParent(this), e == this._numChildNodes ? this._childNodes.push(n) : this._childNodes.splice(e, 0, n), this._numChildNodes++, n ); }), (n.prototype.removeChildAt = function (t) { this._numChildNodes--; var e = t === this._numChildNodes ? this._childNodes.pop() : this._childNodes.splice(t, 1)[0]; return e.setParent(null), e; }), (n.prototype.invalidateEntity = function (t) { null == this._entityNode && ((this._entityNode = t.getAbstraction(this.partition)), this._entityNode.setParent(this)), this._partition.invalidateEntity(this._entityNode); }), (n.prototype.clearEntity = function () { this._partition.clearEntity(this._entityNode), this._entityNode.setParent(null), (this._entityNode = null); }), (n.prototype.startDrag = function () { this._isDragEntity = !0; }), (n.prototype.stopDrag = function () { this._isDragEntity = !1; }), (n.prototype.isDragEntity = function () { return this._isDragEntity; }), (n.prototype.isMouseDisabled = function () { var t; return ( !this.container.mouseEnabled || (null === (t = this.parent) || void 0 === t ? void 0 : t.isMouseChildrenDisabled()) ); }), (n.prototype.isMouseChildrenDisabled = function () { var t; return ( this._hierarchicalPropsDirty & Lt.MOUSE_ENABLED && ((this._mouseChildrenDisabled = !this.container.mouseChildren || (null === (t = this.parent) || void 0 === t ? void 0 : t.isMouseChildrenDisabled())), (this._hierarchicalPropsDirty ^= Lt.MOUSE_ENABLED)), this._mouseChildrenDisabled ); }), (n.prototype.isDescendant = function (t) { for (var e = this; e.parent; ) if ((e = e.parent) == t) return !0; return !1; }), (n.prototype.isAncestor = function (t) { return t.isDescendant(this); }), (n.prototype.invalidateHierarchicalProperty = function (t) { t & Lt.COLOR_TRANSFORM && this.dispatchEvent( this._invalidateColorTransformEvent || (this._invalidateColorTransformEvent = new kt( kt.INVALIDATE_COLOR_TRANSFORM )) ); var e = (this._hierarchicalPropsDirty ^ t) & t; if (e) { this._hierarchicalPropsDirty |= e; for (var n = 0; n < this._childNodes.length; ++n) this._childNodes[n].invalidateHierarchicalProperty(t); this._pickObjectNode && this._pickObjectNode.invalidateHierarchicalProperty(t), e & Lt.SCENE_TRANSFORM && ((this._positionDirty = !0), (this._inverseMatrix3DDirty = !0), this.dispatchEvent( this._invalidateMatrix3DEvent || (this._invalidateMatrix3DEvent = new kt( kt.INVALIDATE_MATRIX3D )) ), this.container.isEntity() && this.invalidateEntity(this.container)); } }), (n.prototype.setParent = function (t) { this._parent && (this._parent.partition !== this.partition && this._parent.partition.removeChild(this.partition), this.clear()), (this._parent = t), this._parent && (this._parent.partition !== this.partition && this._parent.partition.addChild(this.partition), this.container.isEntity() && this.invalidateEntity(this.container)), this.invalidateHierarchicalProperty(Lt.ALL); }), (n._nullTransform = new k()), (n._tempVector3D = new B()), (n._nullColorTransform = new S()), n ); })(W), yi = (function (t) { function n(e, n, r, i, o, a) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = !1), void 0 === i && (i = Zt.BASELINE), void 0 === o && (o = se.AUTO), void 0 === a && (a = !1); var s = t.call(this) || this; return ( (s._rect = new K()), (s._backgroundRed = 0), (s._backgroundGreen = 0), (s._backgroundBlue = 0), (s._focalLength = 1e3), (s._pixelRatio = 1), (s._frustumMatrix3D = new F()), (s._viewMatrix3D = new F()), (s._inverseViewMatrix3D = new F()), (s._components = new Array(4)), (s._offset = new B()), (s._scale = new B(1, 1, 1)), (s._frustumMatrix3DDirty = !0), (s._viewMatrix3DDirty = !0), (s._inverseViewMatrix3DDirty = !0), (s.backgroundAlpha = 1), (s.backgroundDepth = 1), (s.backgroundStencil = 0), (s.preservePixelRatio = !0), (s.preserveFocalLength = !1), (s.preserveDimensions = !1), (s._components[0] = s._offset), (s._components[3] = s._scale), (s._onInvalidateSizeDelegate = function (t) { return s._onInvalidateSize(t); }), (s._onInvalidateViewMatrix3DDelegate = function (t) { return s._onInvalidateViewMatrix3D(t); }), (s._projection = e || new bt()), s._projection.addEventListener( G.INVALIDATE_VIEW_MATRIX3D, s._onInvalidateViewMatrix3DDelegate ), n && (s._shareContext = !0), (s._stage = n || $r.getInstance().getFreeStage(r, i, o, a)), s._stage.addEventListener( Me.INVALIDATE_SIZE, s._onInvalidateSizeDelegate ), s._updateDimensions(), s._updateFocalLength(), s._updatePixelRatio(), s ); } return ( e(n, t), Object.defineProperty(n.prototype, "shareContext", { get: function () { return this._shareContext; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "x", { get: function () { return this._shareContext || this._target ? this._rect.x : this._stage.x; }, set: function (t) { if (this._shareContext || this._target) { if (this._rect.x == t) return; (this._offset.x = (this._rect.x = t) / this._targetWidth), this._invalidateViewMatrix3D(); } else this._stage.x = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "y", { get: function () { return this._shareContext || this._target ? this._rect.y : this._stage.y; }, set: function (t) { if (this._shareContext || this._target) { if (this._rect.y == t) return; (this._offset.y = (this._rect.y = t) / this._targetHeight), this._invalidateViewMatrix3D(); } else this._stage.y = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "width", { get: function () { return this._rect.width; }, set: function (t) { this._rect.width != t && ((this._rect.width = t), this._shareContext || this._target ? ((this._scale.x = t / this._targetWidth), this._updatePixelRatio(), this._invalidateViewMatrix3D()) : (this._stage.width = t), this._invalidateSize()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return this._rect.height; }, set: function (t) { this._rect.height != t && ((this._rect.height = t), this._shareContext || this._target ? ((this._scale.y = t / this._targetHeight), this._updateFocalLength(), this._updatePixelRatio(), this._invalidateViewMatrix3D()) : (this._stage.height = t), this._invalidateSize()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "backgroundColor", { get: function () { return this._backgroundColor; }, set: function (t) { this._backgroundColor != t && ((this._backgroundColor = t), (this._backgroundRed = ((t >> 16) & 255) / 255), (this._backgroundGreen = ((t >> 8) & 255) / 255), (this._backgroundBlue = (255 & t) / 255)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "focalLength", { get: function () { return this._focalLength; }, set: function (t) { this._focalLength != t && ((this._focalLength = t), this._updateFocalLength()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pixelRatio", { get: function () { return this._pixelRatio; }, set: function (t) { this._pixelRatio != t && ((this._pixelRatio = t), this._updatePixelRatio()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "projection", { get: function () { return this._projection; }, set: function (t) { if (null == t) throw new s("projection cannot be null"); this._projection != t && (this._projection.removeEventListener( G.INVALIDATE_VIEW_MATRIX3D, this._onInvalidateViewMatrix3DDelegate ), (this._projection = t), this._projection.addEventListener( G.INVALIDATE_VIEW_MATRIX3D, this._onInvalidateViewMatrix3DDelegate ), this._invalidateViewMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "target", { get: function () { return this._target; }, set: function (t) { this._target != t && this._updateTarget(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "stage", { get: function () { return this._stage; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "frustumMatrix3D", { get: function () { return ( this._frustumMatrix3DDirty && ((this._frustumMatrix3DDirty = !1), this._frustumMatrix3D.recompose(this._components), this._frustumMatrix3D.prepend( this._projection.frustumMatrix3D )), this._frustumMatrix3D ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "viewMatrix3D", { get: function () { return ( this._viewMatrix3DDirty && ((this._viewMatrix3DDirty = !1), this._viewMatrix3D.recompose(this._components), this._viewMatrix3D.prepend(this._projection.viewMatrix3D)), this._viewMatrix3D ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "inverseViewMatrix3D", { get: function () { return ( this._inverseViewMatrix3DDirty && ((this._inverseViewMatrix3DDirty = !1), this._inverseViewMatrix3D.copyFrom(this.viewMatrix3D), this._inverseViewMatrix3D.invert()), this._inverseViewMatrix3D ); }, enumerable: !0, configurable: !0, }), (n.prototype.clear = function (t, e, n, r, i) { void 0 === t && (t = !0), void 0 === e && (e = !0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = Kt.ALL), this._stage.setRenderTarget(this._target, e, n, r), this._stage.setScissor(null == this._target ? this._rect : null), t && this._stage.clear( this._backgroundRed, this._backgroundGreen, this._backgroundBlue, this.backgroundAlpha, this.backgroundDepth, this.backgroundStencil, i ); }), (n.prototype.present = function () { this._shareContext || null != this._target || this._stage.present(); }), (n.prototype.project = function (t, e) { return ( void 0 === e && (e = null), ((e = this._projection.project(t, e)).x = ((e.x + 1) * this.width) / 2), (e.y = ((e.y + 1) * this.height) / 2), e ); }), (n.prototype.unproject = function (t, e, n, r) { return ( void 0 === r && (r = null), this._projection.unproject( (2 * t) / this.width - 1, (2 * e) / this.height - 1, n, r ) ); }), (n.prototype.dispose = function () { this._target ? (this._target.removeEventListener( c.INVALIDATE, this._onInvalidateSizeDelegate ), (this._target = null)) : (this._stage.removeEventListener( Me.INVALIDATE_SIZE, this._onInvalidateSizeDelegate ), this._shareContext || null != this._target || this._stage.dispose(), (this._stage = null)), this._projection && (this._projection.removeEventListener( G.INVALIDATE_VIEW_MATRIX3D, this._onInvalidateViewMatrix3DDelegate ), (this._projection = null)); }), (n.prototype._onInvalidateSize = function (t) { this._updateDimensions(), this._updateFocalLength(), this._updatePixelRatio(), (this.preserveDimensions && (this._shareContext || null != this._target)) || this._invalidateSize(); }), (n.prototype._onInvalidateViewMatrix3D = function (t) { this._invalidateViewMatrix3D(); }), (n.prototype._updateTarget = function (t) { this._target ? this._target.removeEventListener( c.INVALIDATE, this._onInvalidateSizeDelegate ) : this._stage.removeEventListener( Me.INVALIDATE_SIZE, this._onInvalidateSizeDelegate ), (this._target = t), this._target ? this._target.addEventListener( c.INVALIDATE, this._onInvalidateSizeDelegate ) : this._stage.addEventListener( Me.INVALIDATE_SIZE, this._onInvalidateSizeDelegate ), this._updateDimensions(), this._updateFocalLength(), this._updatePixelRatio(), (this.preserveDimensions && (this._shareContext || null != this._target)) || this._invalidateSize(); }), (n.prototype._updateDimensions = function () { this._target ? this._target instanceof ke ? ((this._targetWidth = this._target.width), (this._targetHeight = this._target.height)) : this._target instanceof sn && ((this._targetWidth = this._target.size), (this._targetHeight = this._target.size)) : ((this._targetWidth = this._stage.width), (this._targetHeight = this._stage.height)), this.preserveDimensions && (this._shareContext || this._target) ? ((this._offset.x = this._rect.x / this._targetWidth), (this._offset.y = this._rect.y / this._targetHeight), (this._scale.x = this._rect.width / this._targetWidth), (this._scale.y = this._rect.height / this._targetHeight)) : ((this._rect.x = this._offset.x * this._targetWidth), (this._rect.y = this._offset.y * this._targetHeight), (this._rect.width = this._scale.x * this._targetWidth), (this._rect.height = this._scale.y * this._targetHeight)); }), (n.prototype._updateFocalLength = function () { this.preserveFocalLength ? (this.projection.scale = this._focalLength / this._rect.height) : (this._focalLength = this._projection.scale * this._rect.height); }), (n.prototype._updatePixelRatio = function () { this.preservePixelRatio ? (this._projection.ratio = (this._pixelRatio * this._rect.width) / this._rect.height) : (this._pixelRatio = (this._projection.ratio * this._rect.height) / this._rect.width); }), (n.prototype._invalidateViewMatrix3D = function () { (this._frustumMatrix3DDirty = !0), (this._viewMatrix3DDirty = !0), (this._inverseViewMatrix3DDirty = !0), this.dispatchEvent(new ue(ue.INVALIDATE_VIEW_MATRIX3D, this)); }), (n.prototype._invalidateSize = function () { this.dispatchEvent(new ue(ue.INVALIDATE_SIZE, this)); }), n ); })(f), Ai = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n._children = new Array()), (n._updateQueue = {}), (n.isUpdated = !1), (n._rootNode = e), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "parent", { get: function () { return this._parent; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rootNode", { get: function () { return this._rootNode; }, enumerable: !0, configurable: !0, }), (n.prototype.getLocalView = function (t) { if (!this._localView) { var e = n._defaultProjection; e || (((e = new bt()).coordinateSystem = _t.LEFT_HANDED), (e.originX = -1), (e.originY = -1), (e.transform = new k()), e.transform.moveTo(0, 0, -1e3), e.transform.lookAt(new B())), (this._localView = new yi(e, t, null, null, null, !0)), (this._localView.backgroundAlpha = 0); } return this._localView; }), (n.prototype.clearLocalView = function () { this._localView && (this._localView = null); }), (n.prototype.getLocalNode = function () { return ( this._localNode || ((this._localNode = _i.getRootNode(this._rootNode.container, vi)), (this._localNode.transformDisabled = !0), this.addChild(this._localNode.partition)), this._localNode ); }), (n.prototype.clearLocalNode = function () { this._localNode && (this.removeChild(this._localNode.partition), this._localNode.onClear(null), (this._localNode = null)); }), (n.prototype.addChild = function (t) { this._children.push(t), t.setParent(this), this._invalid || this.invalidate(); }), (n.prototype.removeChild = function (t) { this._children.splice(this._children.indexOf(t), 1)[0], t.setParent(null), this._invalid || this.invalidate(); }), (n.prototype.setParent = function (t) { this._parent = t; }), (n.prototype.traverse = function (t) { (this.isUpdated = this._invalid), (this._invalid = !1), this._rootNode.acceptTraverser(t); }), (n.prototype.invalidateEntity = function (t) { this._invalid || this.invalidate(), (this._updateQueue[t.id] = t); }), (n.prototype.updateEntity = function (t) { t.entity._iInternalUpdate(), this.updateNode(t); }), (n.prototype.updateNode = function (t) {}), (n.prototype.clearEntity = function (t) { this._invalid || this.invalidate(), delete this._updateQueue[t.id]; }), (n.prototype.findParentForNode = function (t) { return this._rootNode; }), (n.prototype.updateEntities = function () { for (var t in this._updateQueue) this.updateEntity(this._updateQueue[t]); this._updateQueue = {}; }), (n.prototype.invalidate = function () { (this._invalid = !0), t.prototype.invalidate.call(this), this._parent && this._parent.invalidate(); }), (n.prototype.clear = function () { t.prototype.clear.call(this), this._localView.dispose(), (this._localView = null); for (var e = 0; e < this._children.length; e++) this._children[e].clear(); }), (n.prototype.dispose = function () {}), (n.prototype.requestAbstraction = function (t) { return n._abstractionClassPool[t.assetType]; }), (n.registerAbstraction = function (t, e) { n._abstractionClassPool[e.assetType] = t; }), (n._abstractionClassPool = {}), n ); })(f), vi = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Ai), bi = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "parent", { get: function () { return this._parent; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pool", { get: function () { return this._pool; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "entity", { get: function () { return this._asset; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "partition", { get: function () { return this._pool; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "boundsVisible", { get: function () { return ( this._boundsVisible != this._asset.boundsVisible && ((this._boundsVisible = this._asset.boundsVisible), this._boundsVisible ? (this._boundsPrimitiveDirty = !0) : this._boundsPrimitive && (this._boundsPrimitive.setParent(null), (this._boundsPrimitive = null))), this._boundsVisible ); }, enumerable: !0, configurable: !0, }), (n.prototype.isCastingShadow = function () { return this._asset.castsShadows; }), (n.prototype.onClear = function (e) { this._pool.clearEntity(this), t.prototype.onClear.call(this, e), this.clear(); }), (n.prototype.onInvalidate = function (e) { this._pool.invalidateEntity(this), t.prototype.onInvalidate.call(this, e), this.invalidate(); }), (n.prototype.isInFrustum = function (t, e, n, r) { return !this.isInvisible(); }), (n.prototype.isInvisible = function () { return this._parent.isInvisible(); }), (n.prototype.getMaskId = function () { return this._parent.getMaskId(); }), (n.prototype.getBoundsPrimitive = function (t) { return ( this._boundsPrimitiveDirty && ((this._boundsPrimitiveDirty = !1), (this._boundsPrimitive = this.entity .getBoundsPrimitive(t.getBoundsPicker(this.partition)) .getAbstraction(this.partition)), this._boundsPrimitive.setParent(this._parent)), this._boundsPrimitive ); }), (n.prototype.isIntersectingRay = function (t, e, n, r) { return this.getAbstraction(r)._isIntersectingRayInternal(t, e, n); }), (n.prototype.isRenderable = function () { return this.parent.getColorTransform()._isRenderable(); }), (n.prototype.acceptTraverser = function (t) { t.enterNode(this) && t.applyEntity(this); }), (n.prototype.setParent = function (t) { t || this.onClear(null), (this._parent = t); }), n ); })(W), Ci = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.shapeFlag = !1), (r.findClosestCollision = !1), (r._entities = []), (r._pickers = []), (r._collectedEntities = []), (r.pickGroup = n.pickGroup), (r.partition = e), (r.rootNode = e.rootNode), r ); } return ( e(n, t), (n.prototype.traverse = function () { (this._entities.length = 0), (this._pickers.length = 0), this.partition.traverse(this); }), (n.prototype.getTraverser = function (t) { if (!t.rootNode.isMouseDisabled() || t.rootNode.isDragEntity()) { var e = this.pickGroup.getRaycastPicker(t); return ( e._isIntersectingRayInternal( this._rootEntity, this._globalRayPosition, this._globalRayDirection, this._shapeFlag ) && this._pickers.push(e), e ); } return this; }), Object.defineProperty(n.prototype, "dragNode", { get: function () { return this._dragNode; }, set: function (t) { this._dragNode != t && (this._dragNode && this._dragNode.stopDrag(), (this._dragNode = t), this._dragNode && this._dragNode.startDrag()); }, enumerable: !0, configurable: !0, }), (n.prototype.enterNode = function (t) { return ( !t.isInvisible() && t.getMaskId() == this._rootEntity.getMaskId() && (t.pickObjectNode ? (t.pickObjectNode.partition.traverse(this), !1) : t.isIntersectingRay( this._rootEntity, this._globalRayPosition, this._globalRayDirection, this.pickGroup )) ); }), (n.prototype.isIntersectingRay = function (t, e, n) { return ( void 0 === n && (n = !1), this._isIntersectingRayInternal(this.rootNode, t, e, n) ); }), (n.prototype._isIntersectingRayInternal = function (t, e, n, r) { return ( (this._rootEntity = t), (this._globalRayPosition = e), (this._globalRayDirection = n), (this._shapeFlag = this.shapeFlag || r), this.traverse(), !(!this._entities.length && !this._pickers.length) ); }), (n.prototype.getCollision = function (t, e, n, r) { return ( void 0 === n && (n = !1), void 0 === r && (r = null), this._getCollisionInternal(t, e, n, !1, r) ); }), (n.prototype.getViewCollision = function (t, e, r, i) { void 0 === r && (r = !1), void 0 === i && (i = null); var o = this.pickGroup.view, a = o.unproject(t, e, 0, n._rayPosition), s = o.unproject(t, e, 1, n._rayDirection); return s.decrementBy(a), this._getCollisionInternal(a, s, r, !1, i); }), (n.prototype._getCollisionInternal = function (t, e, n, r, i) { if (!this._isIntersectingRayInternal(this.rootNode, t, e, n)) return null; this._collectEntities(this._collectedEntities, this._dragNode); var o = this._getPickingCollision(i); return (this._collectedEntities.length = 0), o; }), (n.prototype.getObjectsUnderPoint = function (t, e) { if (!this._isIntersectingRayInternal(this.rootNode, t, e, !0)) return []; this._collectEntities(this._collectedEntities, this._dragNode); var n = this._getColliders(); return (this._collectedEntities.length = 0), n; }), (n.prototype._collectEntities = function (t, e) { for (var n, r, i = this._pickers.length, o = 0; o < i; o++) (n = this._pickers[o]).rootNode != e && n._collectEntities(t, e); for (o = 0; o < this._entities.length; ++o) ((r = this._entities[o]).pickingCollision.rootNode = this.rootNode), t.push(r); }), (n.prototype.setIgnoreList = function (t) { this._ignoredEntities = t; }), (n.prototype.isIgnored = function (t) { if (this._ignoredEntities) for (var e = this._ignoredEntities.length, n = 0; n < e; n++) if (this._ignoredEntities[n] == t) return !0; return !1; }), (n.sortOnNearT = function (t, e) { return t.pickingCollision.rayEntryDistance > e.pickingCollision.rayEntryDistance ? 1 : t.pickingCollision.rayEntryDistance < e.pickingCollision.rayEntryDistance ? -1 : 0; }), (n.prototype._getPickingCollision = function (t) { var e, r; void 0 === t && (t = null), (this._collectedEntities = this._collectedEntities.sort( n.sortOnNearT )); for ( var i = this._collectedEntities.length, o = 0; o < i && ((r = (e = this._collectedEntities[o]).pickingCollision), null == t || r.rayEntryDistance < t.rayEntryDistance); o++ ) if (this._shapeFlag || e.shapeFlag) (r.rayEntryDistance = Number.MAX_VALUE), e.isIntersectingShape(this.findClosestCollision) && (t = r); else if (!r.rayOriginIsInsideBounds) { t = r; break; } return ( t && n.updatePosition(t), this._dragNode && "[asset MovieClip]" == this._dragNode.container.assetType && this._dragNode.container.adapter && this._dragNode.container.adapter.setDropTarget( t ? t.entityNode : null ), t ); }), (n.prototype._getColliders = function () { for ( var t, e = [], n = this._collectedEntities.length, r = 0; r < n; r++ ) ((t = this._collectedEntities[r]).pickingCollision.rayEntryDistance = Number.MAX_VALUE), t.isIntersectingShape(!1) && e.push(t.node.container); return e; }), (n.updatePosition = function (t) { var e = t.position || (t.position = new B()), n = t.rayDirection, r = t.rayPosition, i = t.rayEntryDistance; (e.x = r.x + i * n.x), (e.y = r.y + i * n.y), (e.z = r.z + i * n.z); }), (n.prototype.dispose = function () {}), (n.prototype.applyEntity = function (t) { if (!this.isIgnored(t.entity)) { var e = t.getAbstraction(this.pickGroup); this._entities.push(e); } }), (n._rayPosition = new B()), (n._rayDirection = new B()), n ); })(W), Ii = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._boundingVolumePools = {}), (r._boundsPickers = []), (r._pickGroup = n.pickGroup), (r._partition = e), (r._node = e.rootNode), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "partition", { get: function () { return this._partition; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "node", { get: function () { return this._node; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "width", { get: function () { var t = this.getBoxBounds(); return null == t ? 0 : t.width; }, set: function (t) { var e = this._node.container.transform, r = this.getBoxBounds(); if (null != r) { var i = e.rotation, o = e.matrix3D, a = o.transformBox(r, n.tmpBox), s = a.width > 0 ? t / a.width : 1; if (0 !== i.z) { var u = n.tmpMatrix; u.copyFrom(o), u.appendScale(s || n.MINIMAL_SCALE, 1, 1); var l = u.decompose()[3]; e.scaleTo(l.x, l.y, l.z); } else { var c = e.scale; e.scaleTo(c.x * s || n.MINIMAL_SCALE, c.y, c.z); } } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { var t = this.getBoxBounds(); return null == t ? 0 : t.height; }, set: function (t) { var e = this._node.container.transform, r = this.getBoxBounds(); if (null != r) { var i = e.matrix3D, o = e.rotation, a = i.transformBox(r, n.tmpBox), s = a.height > 0 ? t / a.height : 1; if (0 !== o.z) { var u = n.tmpMatrix; u.copyFrom(i), u.appendScale(1, s || n.MINIMAL_SCALE, 1); var l = u.decompose()[3]; e.scaleTo(l.x, l.y, l.z); } else { var c = e.scale; e.scaleTo(c.x, c.y * s || n.MINIMAL_SCALE, c.z); } } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depth", { get: function () { var t = this.getBoxBounds(); return null == t ? 0 : t.depth * this._node.container.transform.scale.z; }, set: function (t) { var e = this.getBoxBounds(); null != e && 0 != e.depth && this._node.container.transform.scaleTo( this._node.container.transform.scale.x, this._node.container.transform.scale.y, t / e.depth ); }, enumerable: !0, configurable: !0, }), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), this.dispatchEvent(new Ft(Ft.INVALIDATE_BOUNDS, this)); }), (n.prototype.traverse = function () { (this._boundsPickers.length = 0), this._partition.traverse(this), (this._invalid = !1); }), (n.prototype.getTraverser = function (t) { var e = this._pickGroup.getBoundsPicker(t); return this._invalid && this._boundsPickers.push(e), e; }), (n.prototype.enterNode = function (t) { return !0; }), (n.prototype.getBoundingVolume = function (t, e) { void 0 === t && (t = null), void 0 === e && (e = null), null == t && (t = this._node), null == e && (e = this._node.container.defaultBoundingVolume); var n = this._boundingVolumePools[e] || (this._boundingVolumePools[e] = new Gt(this, e)); return t.getAbstraction(n); }), (n.prototype.getBoxBounds = function (t, e, n) { return ( void 0 === t && (t = null), void 0 === e && (e = !1), void 0 === n && (n = !1), this.getBoundingVolume( t, e ? n ? Dt.BOX_BOUNDS_FAST : Dt.BOX_BOUNDS : n ? Dt.BOX_FAST : Dt.BOX ).getBox() ); }), (n.prototype.getSphereBounds = function (t, e, n) { return ( void 0 === t && (t = null), void 0 === e && (e = !1), void 0 === n && (n = !1), this.getBoundingVolume( t, e ? n ? Dt.SPHERE_BOUNDS_FAST : Dt.SPHERE_BOUNDS : n ? Dt.SPHERE_FAST : Dt.SPHERE ).getSphere() ); }), (n.prototype.hitTestPoint = function (t, e, n) { return ( void 0 === n && (n = !1), this._hitTestPointInternal(this._node, t, e, n, !1) ); }), (n.prototype._hitTestPointInternal = function (t, e, r, i, o) { if ( (void 0 === i && (i = !1), void 0 === o && (o = !1), !(-1 == this._node.getMaskId() || (o && i))) ) return !1; this._invalid && this.traverse(); var a = n.tmpPoint; a.setTo(e, r), this._node.globalToLocal(a, a); var s = this.getBoxBounds(null, !1, !0); if (null == s || !s.contains(a.x, a.y, 0)) return !1; if ( !i || "[asset TextField]" == this._node.container.assetType || "[asset Billboard]" == this._node.container.assetType ) return !0; var u = this._boundsPickers.length; if (u) for (var l = 0; l < u; ++l) if (this._boundsPickers[l]._hitTestPointInternal(t, e, r, i, o)) return !0; }), (n.prototype.hitTestObject = function (t) { var e = t.getBoxBounds(this._node, !0, !0); if (null == e) return !1; var n = this.getBoxBounds(this._node, !0, !0); return ( null != n && !!e.intersects(n) && t .getBoxBounds(this._node, !0) .intersects(this.getBoxBounds(this._node, !0)) ); }), (n.prototype._getBoxBoundsInternal = function (t, e, n, r, i) { void 0 === t && (t = null), void 0 === e && (e = !0), void 0 === n && (n = !0), void 0 === r && (r = null), void 0 === i && (i = null), this._invalid && this.traverse(); var o = this._boundsPickers.length; if (o > 0) for (var a = new F(), s = 0; s < o; ++s) this._boundsPickers[s].node != this._node ? (t ? a.copyFrom(t) : a.identity(), a.prepend( this._boundsPickers[s].node.container.transform.matrix3D ), this._boundsPickers[s].node.container._registrationMatrix3D && a.prepend( this._boundsPickers[s].node.container ._registrationMatrix3D ), (i = this._boundsPickers[s]._getBoxBoundsInternal( a, e, n, r, i ))) : (i = this._boundsPickers[s]._getBoxBoundsInternal( t, e, n, r, i )); return i; }), (n.prototype._getSphereBoundsInternal = function (t, e, n, r, i, o) { void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = !0), void 0 === r && (r = !0), void 0 === i && (i = null), void 0 === o && (o = null), this._invalid && this.traverse(); var a = this._getBoxBoundsInternal(e, n, r); if (null != a) { t || (((t = new B()).x = a.x + a.width / 2), (t.y = a.y + a.height / 2), (t.z = a.z + a.depth / 2)); var s = this._boundsPickers.length; if (s > 0) for (var u = new F(), l = 0; l < s; ++l) this._boundsPickers[l].node != this._node ? (e ? u.copyFrom(e) : u.identity(), u.prepend( this._boundsPickers[l].node.container.transform.matrix3D ), this._boundsPickers[l].node.container ._registrationMatrix3D && u.prepend( this._boundsPickers[l].node.container ._registrationMatrix3D ), (o = this._boundsPickers[l]._getSphereBoundsInternal( t, u, n, r, i, o ))) : (o = this._boundsPickers[l]._getSphereBoundsInternal( t, e, n, r, i, o )); return o; } }), (n.prototype.isInFrustum = function (t, e) { return this._isInFrustumInternal(this._node, t, e); }), (n.prototype._isInFrustumInternal = function (t, e, n) { return this.getBoundingVolume(t).isInFrustum(e, n); }), (n.prototype.onClear = function (e) { for (var n in (t.prototype.onClear.call(this, e), this._boundingVolumePools)) this._boundingVolumePools[n].dispose(), delete this._boundingVolumePools[n]; }), (n.prototype.dispose = function () {}), (n.prototype.applyEntity = function (t) { this._boundsPickers.push(t.getAbstraction(this._pickGroup)); }), (n.tmpMatrix = new F()), (n.tmpPoint = new P()), (n.tmpBox = new M()), (n.MINIMAL_SCALE = 1e-5), n ); })(W), Ei = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._tabNodes = []), (r._customTabNodes = []), (r._customTabNodesSorted = []), (r._partition = e), (r._entity = e.rootNode), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "partition", { get: function () { return this._partition; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "entity", { get: function () { return this._entity; }, enumerable: !0, configurable: !0, }), (n.prototype.sortTabEnabledEntities = function () { if ( !(this._customTabNodes.length <= 0 && this._tabNodes.length <= 0) ) { var t, e = [], n = 0, r = 0; if (this._customTabNodes.length > 0) for (; n < this._customTabNodes.length; ) this._customTabNodes[n] && (this._customTabNodes[n] = this._customTabNodes[n].reverse()), n++; else { for (t = this._tabNodes.length, n = 0; n < t; n++) { var i = this._tabNodes[n], o = i.parent.getMatrix3D().position, a = Math.floor(o.y / 10); e.length <= a && (e.length = a + 1), e[a] || (e[a] = []), e[a].push(i); } for (this._tabNodes.length = 0, n = 0; n < e.length; n++) { var s = e[n]; if (s) for ( s = s.sort(function (t, e) { return t.parent.getMatrix3D().position.x > e.parent.getMatrix3D().position.x ? 1 : -1; }), r = 0; r < s.length; r++ ) this._tabNodes[this._tabNodes.length] = s[r]; } } } }), (n.prototype.traverse = function () { (this._tabNodes.length = 0), (this._customTabNodes.length = 0), (this._customTabNodesSorted.length = 0), this._partition.traverse(this), this.sortTabEnabledEntities(), (this._invalid = !1); }), (n.prototype.getTraverser = function (t) { return this; }), (n.prototype.getNextTabEntity = function (t) { if ( (this._invalid && this.traverse(), this._customTabNodes.length <= 0 && this._tabNodes.length <= 0) ) return t; if (this._customTabNodes.length > 0) { var e = 0, n = 0, r = 0, i = 0; if (t) for (; e < this._customTabNodes.length; ) { if (this._customTabNodes[e]) for (r = 0; r < this._customTabNodes[e].length; r++) if (this._customTabNodes[e][r] == t) { for (i = r + 1; i < this._customTabNodes[e].length; ) { if (this._customTabNodes[e][i]) return this._customTabNodes[e][i]; i++; } for (n = e + 1; n < this._customTabNodes.length; ) { if (this._customTabNodes[n]) for (i = 0; i < this._customTabNodes[n].length; i++) if (this._customTabNodes[n][i]) return this._customTabNodes[n][i]; n++; } for (n = 0; n < this._customTabNodes.length; ) { if (this._customTabNodes[n]) for (i = 0; i < this._customTabNodes[n].length; i++) if (this._customTabNodes[n][i]) return this._customTabNodes[n][i]; n++; } } e++; } for (n = 0; n < this._customTabNodes.length; ) { if (this._customTabNodes[n]) for (i = 0; i < this._customTabNodes[n].length; i++) if (this._customTabNodes[n][i]) return this._customTabNodes[n][i]; n++; } return t; } var o = this._tabNodes.length; for (e = 0; e < o; e++) if (this._tabNodes[e] == t) return e == o - 1 ? this._tabNodes[0] : this._tabNodes[e + 1]; return this._tabNodes[0]; }), (n.prototype.getPrevTabEntity = function (t) { if ( (this._invalid && this.traverse(), this._customTabNodes.length <= 0 && this._tabNodes.length <= 0) ) return t; if (this._customTabNodes.length > 0) { var e = this._customTabNodes.length, n = 0, r = 0, i = 0; if (t) for (; e > 0; ) if ((e--, this._customTabNodes[e])) for (r = this._customTabNodes[e].length - 1; r >= 0; r--) if (this._customTabNodes[e][r] == t) { for (i = r - 1; i > 0; ) if ((i--, this._customTabNodes[e][i])) return this._customTabNodes[e][i]; for (n = e - 1; n > 0; ) if ((n--, this._customTabNodes[n])) for ( i = this._customTabNodes[n].length - 1; i >= 0; i-- ) if (this._customTabNodes[n][i]) return this._customTabNodes[n][i]; for (n = this._customTabNodes.length; n > 0; ) if ((n--, this._customTabNodes[n])) for ( i = this._customTabNodes[n].length - 1; i >= 0; i-- ) if (this._customTabNodes[n][i]) return this._customTabNodes[n][i]; } for (n = this._customTabNodes.length - 1; n > 0; ) if ((n--, this._customTabNodes[n])) for (i = this._customTabNodes[n].length - 1; i >= 0; i--) if (this._customTabNodes[n][i]) return this._customTabNodes[n][i]; return t; } if (t) for (e = this._tabNodes.length - 1; e >= 0; e--) if (this._tabNodes[e] == t) return 0 == e ? this._tabNodes[this._tabNodes.length - 1] : this._tabNodes[e - 1]; return this._tabNodes[0]; }), (n.prototype.enterNode = function (t) { return !t.isInvisible(); }), (n.prototype.dispose = function () {}), (n.prototype.applyEntity = function (t) { var e = t, n = e.entity; n.tabEnabled && (("[asset TextField]" == n.assetType && "input" != n.type) || (n.tabIndex >= 0 ? (this._customTabNodes.length < n.tabIndex && (this._customTabNodes.length = n.tabIndex), this._customTabNodes[n.tabIndex] || (this._customTabNodes[n.tabIndex] = []), this._customTabNodes[n.tabIndex].push(e)) : (this._tabNodes[this._tabNodes.length] = e))); }), n ); })(W), xi = (function (t) { function n(e) { var r = t.call(this) || this; return ( (r.id = d.Next()), (r.view = e), (r._raycastPickerPool = new wi(r)), (r._boundsPickerPool = new Si(r)), (r._tabPickerPool = n._tabPickerPool || (n._tabPickerPool = new Di())), r ); } return ( e(n, t), Object.defineProperty(n, "instancePool", { get: function () { return n._instancePool; }, enumerable: !0, configurable: !0, }), (n.clearAllInstances = function () { for (var t in this._instancePool) delete this._instancePool[t]; }), (n.getInstance = function (t) { return ( this._instancePool[t.id] || (this._instancePool[t.id] = new n(t)) ); }), (n.clearInstance = function (t) { delete this._instancePool[t.id]; }), (n.prototype.requestAbstraction = function (t) { return zt; }), (n.prototype.getRaycastPicker = function (t) { return t.getAbstraction(this._raycastPickerPool); }), (n.prototype.getBoundsPicker = function (t) { return t.getAbstraction(this._boundsPickerPool); }), (n.prototype.getTabPicker = function (t) { return t.getAbstraction(this._tabPickerPool); }), (n._instancePool = new Object()), n ); })(h), wi = (function () { function t(t) { (this.id = d.Next()), (this.pickGroup = t); } return ( (t.prototype.requestAbstraction = function (t) { return Ci; }), t ); })(), Si = (function () { function t(t) { (this.id = d.Next()), (this.pickGroup = t); } return ( (t.prototype.requestAbstraction = function (t) { return Ii; }), t ); })(), Di = (function () { function t() { this.id = d.Next(); } return ( (t.prototype.requestAbstraction = function (t) { return Ei; }), t ); })(); console.debug("AwayJS - View - 0.6.39"); var Ti, Pi = (function () { function t(t, e, n, r) { (this._blendFactor = [Yt.ONE, Yt.ZERO]), (this._blendEquation = [qt.ADD, qt.ADD]), (this._invalidProgram = !0), (this._animationVertexCode = ""), (this._animationFragmentCode = ""), (this._vertexCode = ""), (this._fragmentCode = ""), (this._postAnimationFragmentCode = ""), (this.usesBlending = !1), (this.useImageRect = !1), (this.usesCurves = !1), (this.depthCompareMode = Wt.LESS_EQUAL), (this.writeDepth = !0), (this._defaultCulling = ie.BACK), (this._pInverseSceneMatrix = new Float32Array(16)), (this.ambientR = 255), (this.ambientG = 255), (this.ambientB = 255), (this.usesGlobalPosFragment = !1), (this.usesPositionFragment = !1), (this.imageIndices = new Array()), (this.id = W.ID_COUNT++), (this._renderElements = t), (this._renderMaterial = e), (this._pass = n), (this._stage = r), (this._view = t.renderGroup.view), (this.profile = this._stage.profile); } return ( Object.defineProperty(t.prototype, "view", { get: function () { return this._view; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "stage", { get: function () { return this._stage; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "pass", { get: function () { return this._pass; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "renderMaterial", { get: function () { return this._renderMaterial; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "programData", { get: function () { return ( this._invalidProgram && this._updateProgram(), this._programData ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "usesAnimation", { get: function () { return this._usesAnimation; }, set: function (t) { this._usesAnimation != t && ((this._usesAnimation = t), this.invalidateProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedVertexConstants", { get: function () { return ( this._invalidProgram && this._updateProgram(), this._numUsedVertexConstants ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedFragmentConstants", { get: function () { return ( this._invalidProgram && this._updateProgram(), this._numUsedFragmentConstants ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedStreams", { get: function () { return ( this._invalidProgram && this._updateProgram(), this._numUsedStreams ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "numUsedTextures", { get: function () { return ( this._invalidProgram && this._updateProgram(), this._numUsedTextures ); }, enumerable: !0, configurable: !0, }), (t.prototype.requestAbstraction = function (e) { return t._abstractionClassPool[e.assetType]; }), (t.registerAbstraction = function (e, n) { t._abstractionClassPool[n.assetType] = e; }), (t.prototype._includeDependencies = function () { this._renderMaterial.renderElements._includeDependencies(this), this._pass._includeDependencies(this); }), (t.prototype.reset = function () { (this.projectionDependencies = 0), (this.normalDependencies = 0), (this.colorDependencies = 0), (this.viewDirDependencies = 0), (this.uvDependencies = 0), (this.secondaryUVDependencies = 0), (this.globalPosDependencies = 0), (this.tangentDependencies = 0), (this.usesCommonData = !1), (this.usesGlobalPosFragment = !1), (this.usesPositionFragment = !1), (this.usesFragmentAnimation = !1), (this.usesTangentSpace = !1), (this.outputsNormals = !1), (this.outputsTangentNormals = !1); }), (t.prototype.setBlendMode = function (t) { switch ( ((this.usesBlending = !0), (this.usesPremultipliedAlpha = !0), (this._blendEquation = [0, 0]), t) ) { case dn.NORMAL: (this._blendFactor = [Yt.ONE, Yt.ZERO]), (this.usesBlending = !1), (this.usesPremultipliedAlpha = !1); break; case dn.LAYER: this._blendFactor = [Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA]; break; case dn.MULTIPLY: this._blendFactor = [ Yt.DESTINATION_COLOR, Yt.ONE_MINUS_SOURCE_ALPHA, Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA, ]; break; case dn.ADD: this._blendFactor = [Yt.ONE, Yt.ONE]; break; case dn.SCREEN: this._blendFactor = [ Yt.ONE, Yt.ONE_MINUS_SOURCE_COLOR, Yt.ONE, Yt.ONE_MINUS_SOURCE_ALPHA, ]; break; case dn.SUBTRACT: (this._blendFactor = [Yt.ONE, Yt.ONE, Yt.ONE, Yt.ONE]), (this._blendEquation = [qt.SUBTRACT, qt.ADD]); case dn.ALPHA: (this._blendFactor = [Yt.ZERO, Yt.SOURCE_ALPHA]), (this.usesPremultipliedAlpha = !1); break; default: throw new T("Unsupported blend mode: " + t); } }), (t.prototype._activate = function () { if (!this.programData.program) { this.programData.program = this._stage.context.createProgram(); var t = new ve().assemble( "part vertex 1\n" + this.programData.vertexString + "endpart" ).vertex, e = new ve().assemble( "part fragment 1\n" + this.programData.fragmentString + "endpart" ).fragment; this.programData.program.upload(t, e); } if ( (this._stage.context.setProgram(this.programData.program), this._stage.context.setCulling( this.useBothSides ? ie.NONE : this._defaultCulling, this._view.projection.coordinateSystem ), !this.usesTangentSpace && this.cameraPositionIndex >= 0) ) { var n = this._view.projection.transform.matrix3D.position; (this.vertexConstantData[this.cameraPositionIndex] = n.x), (this.vertexConstantData[this.cameraPositionIndex + 1] = n.y), (this.vertexConstantData[this.cameraPositionIndex + 2] = n.z); } this._stage.context.setDepthTest( this.writeDepth && !this.usesBlending, this.depthCompareMode ), this._stage.context.setBlendEquation( this._blendEquation[0], this._blendEquation[1] ), this._stage.context.setBlendFactors( this._blendFactor[0], this._blendFactor[1], this._blendFactor[2], this._blendFactor[3] ), (this.activeElements = null); }), (t.prototype._deactivate = function () { this._stage.context.setDepthTest(!0, Wt.LESS_EQUAL), (this.activeElements = null); }), (t.prototype._setRenderState = function (t) { var e; if ( (t.node.container.animator && t.node.container.animator.setRenderState(this, t), this.usesUVTransform) ) { var n = t.uvMatrix; n ? ((e = n.rawData), (this.vertexConstantData[this.uvMatrixIndex] = e[0]), (this.vertexConstantData[this.uvMatrixIndex + 1] = e[2]), (this.vertexConstantData[this.uvMatrixIndex + 3] = e[4]), (this.vertexConstantData[this.uvMatrixIndex + 4] = e[1]), (this.vertexConstantData[this.uvMatrixIndex + 5] = e[3]), (this.vertexConstantData[this.uvMatrixIndex + 7] = e[5])) : ((this.vertexConstantData[this.uvMatrixIndex] = 1), (this.vertexConstantData[this.uvMatrixIndex + 1] = 0), (this.vertexConstantData[this.uvMatrixIndex + 3] = 0), (this.vertexConstantData[this.uvMatrixIndex + 4] = 0), (this.vertexConstantData[this.uvMatrixIndex + 5] = 1), (this.vertexConstantData[this.uvMatrixIndex + 7] = 0)); } if (this.usesColorTransform) { var r = t.node.getColorTransform(); r ? ((e = r._rawData), (this.fragmentConstantData[this.colorTransformIndex] = e[0]), (this.fragmentConstantData[this.colorTransformIndex + 1] = e[1]), (this.fragmentConstantData[this.colorTransformIndex + 2] = e[2]), (this.fragmentConstantData[this.colorTransformIndex + 3] = e[3]), (this.fragmentConstantData[this.colorTransformIndex + 4] = e[4] / 255), (this.fragmentConstantData[this.colorTransformIndex + 5] = e[5] / 255), (this.fragmentConstantData[this.colorTransformIndex + 6] = e[6] / 255), (this.fragmentConstantData[this.colorTransformIndex + 7] = e[7] / 255)) : ((this.fragmentConstantData[this.colorTransformIndex] = 1), (this.fragmentConstantData[this.colorTransformIndex + 1] = 1), (this.fragmentConstantData[this.colorTransformIndex + 2] = 1), (this.fragmentConstantData[this.colorTransformIndex + 3] = 1), (this.fragmentConstantData[this.colorTransformIndex + 4] = 0), (this.fragmentConstantData[this.colorTransformIndex + 5] = 0), (this.fragmentConstantData[this.colorTransformIndex + 6] = 0), (this.fragmentConstantData[this.colorTransformIndex + 7] = 0)); } if ( (this.sceneNormalMatrixIndex >= 0 && this.sceneNormalMatrix.copyFrom(t.node.getInverseMatrix3D()), this.usesTangentSpace && this.cameraPositionIndex >= 0) ) { t.node .getInverseMatrix3D() .copyRawDataTo(this._pInverseSceneMatrix); var i = this._view.projection.transform.matrix3D.position, o = i.x, a = i.y, s = i.z; (this.vertexConstantData[this.cameraPositionIndex] = this._pInverseSceneMatrix[0] * o + this._pInverseSceneMatrix[4] * a + this._pInverseSceneMatrix[8] * s + this._pInverseSceneMatrix[12]), (this.vertexConstantData[this.cameraPositionIndex + 1] = this._pInverseSceneMatrix[1] * o + this._pInverseSceneMatrix[5] * a + this._pInverseSceneMatrix[9] * s + this._pInverseSceneMatrix[13]), (this.vertexConstantData[this.cameraPositionIndex + 2] = this._pInverseSceneMatrix[2] * o + this._pInverseSceneMatrix[6] * a + this._pInverseSceneMatrix[10] * s + this._pInverseSceneMatrix[14]); } }), (t.prototype.invalidateProgram = function () { this._invalidProgram = !0; }), (t.prototype.dispose = function () { this._programData.dispose(), (this._programData = null), this._registerCache.dispose(), (this._registerCache = null), (this._sharedRegisters = null); }), (t.prototype._updateProgram = function () { if ( ((this._invalidProgram = !1), (this._sharedRegisters = new ii()), (this._registerCache = new _n(this.profile)), this.reset(), this._includeDependencies(), this._initRegisterIndices(), this._compileDependencies(), (this._vertexCode += this._pass._getVertexCode( this._registerCache, this._sharedRegisters )), (this._fragmentCode += this._pass._getFragmentCode( this._registerCache, this._sharedRegisters )), (this._postAnimationFragmentCode += this._pass._getPostAnimationFragmentCode( this._registerCache, this._sharedRegisters )), this.usesPremultipliedAlpha) ) { var t = this._sharedRegisters.shadedTarget; this._postAnimationFragmentCode += "mul " + t + ".xyz, " + t + ", " + t + ".w\n"; } (this._postAnimationFragmentCode += "mov " + this._registerCache.fragmentOutputRegister + ", " + this._sharedRegisters.shadedTarget + "\n"), this._registerCache.removeFragmentTempUsage( this._sharedRegisters.shadedTarget ), this._compileAnimationCode(), this._initConstantData(); var e = this._stage.getProgramData( this._animationVertexCode + this._vertexCode, this._fragmentCode + this._animationFragmentCode + this._postAnimationFragmentCode ); this._programData != e && (this._programData && this._programData.dispose(), (this._programData = e), e.usages++); }), (t.prototype._initRegisterIndices = function () { (this.commonsDataIndex = -1), (this.cameraPositionIndex = -1), (this.curvesIndex = -1), (this.uvIndex = -1), (this.uvMatrixIndex = -1), (this.colorTransformIndex = -1), (this.secondaryUVIndex = -1), (this.normalIndex = -1), (this.colorBufferIndex = -1), (this.tangentIndex = -1), (this.sceneMatrixIndex = -1), (this.sceneNormalMatrixIndex = -1), (this.jointIndexIndex = -1), (this.jointWeightIndex = -1), (this.imageIndices.length = 0), (this._sharedRegisters.animatedPosition = this._registerCache.getFreeVertexVectorTemp()), this._registerCache.addVertexTempUsages( this._sharedRegisters.animatedPosition, 1 ), this._sharedRegisters.animatableAttributes.push( this._registerCache.getFreeVertexAttribute() ), this._sharedRegisters.animationTargetRegisters.push( this._sharedRegisters.animatedPosition ), (this._vertexCode = ""), (this._fragmentCode = ""), (this._postAnimationFragmentCode = ""), (this.usesCommonData || this.normalDependencies > 0) && ((this._sharedRegisters.commons = this._registerCache.getFreeFragmentConstant()), (this.commonsDataIndex = 4 * this._sharedRegisters.commons.index)), (this.tangentDependencies > 0 || this.outputsNormals) && ((this._sharedRegisters.tangentInput = this._registerCache.getFreeVertexAttribute()), (this.tangentIndex = this._sharedRegisters.tangentInput.index), (this._sharedRegisters.animatedTangent = this._registerCache.getFreeVertexVectorTemp()), this._registerCache.addVertexTempUsages( this._sharedRegisters.animatedTangent, 1 ), this.usesTangentSpace && ((this._sharedRegisters.bitangent = this._registerCache.getFreeVertexVectorTemp()), this._registerCache.addVertexTempUsages( this._sharedRegisters.bitangent, 1 )), this._sharedRegisters.animatableAttributes.push( this._sharedRegisters.tangentInput ), this._sharedRegisters.animationTargetRegisters.push( this._sharedRegisters.animatedTangent )), this.normalDependencies > 0 && ((this._sharedRegisters.normalInput = this._registerCache.getFreeVertexAttribute()), (this.normalIndex = this._sharedRegisters.normalInput.index), (this._sharedRegisters.animatedNormal = this._registerCache.getFreeVertexVectorTemp()), this._registerCache.addVertexTempUsages( this._sharedRegisters.animatedNormal, 1 ), this._sharedRegisters.animatableAttributes.push( this._sharedRegisters.normalInput ), this._sharedRegisters.animationTargetRegisters.push( this._sharedRegisters.animatedNormal )), this.uvDependencies > 0 && ((this._sharedRegisters.uvInput = this._registerCache.getFreeVertexAttribute()), (this.uvIndex = this._sharedRegisters.uvInput.index), this.usesUVTransform || ((this._sharedRegisters.animatedUV = this._registerCache.getFreeVertexVectorTemp()), this._registerCache.addVertexTempUsages( this._sharedRegisters.animatedUV, 1 ))), (this._sharedRegisters.shadedTarget = this._registerCache.getFreeFragmentVectorTemp()), this._registerCache.addFragmentTempUsages( this._sharedRegisters.shadedTarget, 1 ); }), (t.prototype._compileDependencies = function () { this.colorDependencies > 0 && this._compileColorCode(), this.globalPosDependencies > 0 && this._compileGlobalPositionCode(), this.usesPositionFragment && this._compilePositionCode(), this.usesCurves && this._compileCurvesCode(), this.usesColorTransform && this._compileColorTransformCode(), this.uvDependencies > 0 && this._compileUVCode(), this.secondaryUVDependencies > 0 && this._compileSecondaryUVCode(), this.normalDependencies > 0 && this._compileNormalCode(), this.viewDirDependencies > 0 && this._compileViewDirCode(), (this._vertexCode += this._renderElements._getVertexCode( this, this._registerCache, this._sharedRegisters )), (this._fragmentCode += this._renderElements._getFragmentCode( this, this._registerCache, this._sharedRegisters )); }), (t.prototype._initConstantData = function () { var t = this._registerCache, e = (this._numUsedVertexConstants = t.numUsedVertexConstants), n = (this._numUsedFragmentConstants = t.numUsedFragmentConstants); if ( ((this._numUsedStreams = t.numUsedStreams), (this._numUsedTextures = t.numUsedTextures), (this.vertexConstantData && this.vertexConstantData.length === 4 * e) || (this.vertexConstantData = new Float32Array(4 * e)), (this.fragmentConstantData && this.fragmentConstantData.length === 4 * n) || (this.fragmentConstantData = new Float32Array( 4 * this._registerCache.numUsedFragmentConstants )), this.viewMatrixIndex >= 0) ) { var r = new Float32Array( this.vertexConstantData.buffer, 4 * this.viewMatrixIndex, 16 ); this.viewMatrix ? (this.viewMatrix._rawData = r) : (this.viewMatrix = new F(r)); } else this.viewMatrix && (this.viewMatrix = null); if (this.sceneMatrixIndex >= 0) { r = new Float32Array( this.vertexConstantData.buffer, 4 * this.sceneMatrixIndex, 16 ); this.sceneMatrix ? (this.sceneMatrix._rawData = r) : (this.sceneMatrix = new F(r)); } else this.sceneMatrix && (this.sceneMatrix = null); if ( (this.commonsDataIndex >= 0 && ((this.fragmentConstantData[this.commonsDataIndex] = 0.5), (this.fragmentConstantData[this.commonsDataIndex + 1] = 0), (this.fragmentConstantData[this.commonsDataIndex + 2] = 1 / 255), (this.fragmentConstantData[this.commonsDataIndex + 3] = 1)), this.uvMatrixIndex >= 0 && ((this.vertexConstantData[this.uvMatrixIndex] = 1), (this.vertexConstantData[this.uvMatrixIndex + 1] = 0), (this.vertexConstantData[this.uvMatrixIndex + 2] = 0), (this.vertexConstantData[this.uvMatrixIndex + 3] = 0), (this.vertexConstantData[this.uvMatrixIndex + 4] = 0), (this.vertexConstantData[this.uvMatrixIndex + 5] = 1), (this.vertexConstantData[this.uvMatrixIndex + 6] = 0), (this.vertexConstantData[this.uvMatrixIndex + 7] = 0)), this.colorTransformIndex >= 0 && ((this.fragmentConstantData[this.colorTransformIndex] = 1), (this.fragmentConstantData[this.colorTransformIndex + 1] = 1), (this.fragmentConstantData[this.colorTransformIndex + 2] = 1), (this.fragmentConstantData[this.colorTransformIndex + 3] = 1), (this.fragmentConstantData[this.colorTransformIndex + 4] = 0), (this.fragmentConstantData[this.colorTransformIndex + 5] = 0), (this.fragmentConstantData[this.colorTransformIndex + 6] = 0), (this.fragmentConstantData[this.colorTransformIndex + 7] = 0)), this.sceneNormalMatrixIndex >= 0) ) { r = new Float32Array( this.vertexConstantData.buffer, 4 * this.sceneNormalMatrixIndex, 16 ); this.sceneNormalMatrix ? (this.sceneNormalMatrix._rawData = r) : (this.sceneNormalMatrix = new F(r)); } else this.sceneNormalMatrix && (this.sceneNormalMatrix = null); this.cameraPositionIndex >= 0 && (this.vertexConstantData[this.cameraPositionIndex + 3] = 1), this._pass._initConstantData(), this._usesAnimation && this._renderMaterial.animationSet.doneAGALCode(this); }), (t.prototype._compileColorCode = function () { (this._sharedRegisters.colorInput = this._registerCache.getFreeVertexAttribute()), (this.colorBufferIndex = this._sharedRegisters.colorInput.index), (this._sharedRegisters.colorVarying = this._registerCache.getFreeVarying()), (this._vertexCode += "mov " + this._sharedRegisters.colorVarying + ", " + this._sharedRegisters.colorInput + "\n"); }), (t.prototype._compileGlobalPositionCode = function () { var t = (this._sharedRegisters.globalPositionVertex = this._registerCache.getFreeVertexVectorTemp()); this._registerCache.addVertexTempUsages( t, this.globalPosDependencies ); var e = this._registerCache.getFreeVertexConstant(); this._registerCache.getFreeVertexConstant(), this._registerCache.getFreeVertexConstant(), this._registerCache.getFreeVertexConstant(), (this.sceneMatrixIndex = 4 * e.index); var n = this._sharedRegisters; (this._vertexCode += "m44 " + n.globalPositionVertex + ", " + n.animatedPosition + ", " + e + "\n"), this.usesGlobalPosFragment && ((n.globalPositionVarying = this._registerCache.getFreeVarying()), (this._vertexCode += "mov " + n.globalPositionVarying + ", " + n.globalPositionVertex + "\n")); }), (t.prototype._compilePositionCode = function () { var t = this._sharedRegisters; (t.positionVarying = this._registerCache.getFreeVarying()), (this._vertexCode += "mov " + t.positionVarying + ", " + t.animatedPosition + "\n"); }), (t.prototype._compileCurvesCode = function () { var t = this._sharedRegisters; (t.curvesInput = this._registerCache.getFreeVertexAttribute()), (this.curvesIndex = t.curvesInput.index), (t.curvesVarying = this._registerCache.getFreeVarying()), (this._vertexCode += "mov " + t.curvesVarying + ", " + t.curvesInput + "\n"); var e = this._registerCache.getFreeFragmentSingleTemp(); this._fragmentCode += "mul " + e + ", " + t.curvesVarying + ".y, " + t.curvesVarying + ".y\nsub " + e + ", " + e + ", " + t.curvesVarying + ".z\nmul " + e + ", " + e + ", " + t.curvesVarying + ".x\nkil " + e + "\n"; }), (t.prototype._compileColorTransformCode = function () { var t = this._registerCache.getFreeFragmentConstant(), e = this._registerCache.getFreeFragmentConstant(), n = this._sharedRegisters.shadedTarget; (this.colorTransformIndex = 4 * t.index), (this._postAnimationFragmentCode += "mul " + n + ", " + n + ", " + t + "\n"), (this._postAnimationFragmentCode += "add " + n + ", " + n + ", " + e + "\n"); }), (t.prototype._compileUVCode = function () { var t = this._sharedRegisters; if ( ((t.uvVarying = this._registerCache.getFreeVarying()), this.usesUVTransform) ) { var e = this._registerCache.getFreeVertexConstant(), n = this._registerCache.getFreeVertexConstant(); (this.uvMatrixIndex = 4 * e.index), (this._vertexCode += "dp4 " + t.uvVarying + ".x, " + t.uvInput + ", " + e + "\ndp4 " + t.uvVarying + ".y, " + t.uvInput + ", " + n + "\nmov " + t.uvVarying + ".zw, " + t.uvInput + ".zw \n"); } else this._vertexCode += "mov " + t.uvVarying + ", " + t.animatedUV + "\n"; }), (t.prototype._compileSecondaryUVCode = function () { var t = this._registerCache.getFreeVertexAttribute(), e = this._sharedRegisters; (this.secondaryUVIndex = t.index), (e.secondaryUVVarying = this._registerCache.getFreeVarying()), (this._vertexCode += "mov " + e.secondaryUVVarying + ", " + t + "\n"); }), (t.prototype._compileViewDirCode = function () { var t = this._registerCache.getFreeVertexConstant(), e = this._sharedRegisters; if ( ((e.viewDirVarying = this._registerCache.getFreeVarying()), (e.viewDirFragment = this._registerCache.getFreeFragmentVectorTemp()), this._registerCache.addFragmentTempUsages( e.viewDirFragment, this.viewDirDependencies ), (this.cameraPositionIndex = 4 * t.index), this.usesTangentSpace) ) { var n = this._registerCache.getFreeVertexVectorTemp(); this._vertexCode += "sub " + n + ", " + t + ", " + e.animatedPosition + "\nm33 " + e.viewDirVarying + ".xyz, " + n + ", " + e.animatedTangent + "\nmov " + e.viewDirVarying + ".w, " + e.animatedPosition + ".w\n"; } else (this._vertexCode += "sub " + e.viewDirVarying + ", " + t + ", " + e.globalPositionVertex + "\n"), this._registerCache.removeVertexTempUsage( this._sharedRegisters.globalPositionVertex ); this._fragmentCode += "nrm " + e.viewDirFragment + ".xyz, " + e.viewDirVarying + "\nmov " + e.viewDirFragment + ".w, " + e.viewDirVarying + ".w\n"; }), (t.prototype._compileNormalCode = function () { var t, e = this._sharedRegisters; if ( ((e.normalFragment = this._registerCache.getFreeFragmentVectorTemp()), this._registerCache.addFragmentTempUsages( e.normalFragment, this.normalDependencies ), this.outputsNormals && !this.outputsTangentNormals) ) return ( (this._vertexCode += this._pass._getNormalVertexCode( this._registerCache, e )), void (this._fragmentCode += this._pass._getNormalFragmentCode( this._registerCache, e )) ); if ( ((this.outputsNormals && this.usesTangentSpace) || (((t = new Array(3))[0] = this._registerCache.getFreeVertexConstant()), (t[1] = this._registerCache.getFreeVertexConstant()), (t[2] = this._registerCache.getFreeVertexConstant()), this._registerCache.getFreeVertexConstant(), (this.sceneNormalMatrixIndex = 4 * t[0].index), (e.normalVarying = this._registerCache.getFreeVarying())), this.outputsNormals) ) if (this.usesTangentSpace) (this._vertexCode += "nrm " + e.animatedNormal + ".xyz, " + e.animatedNormal + "\nnrm " + e.animatedTangent + ".xyz, " + e.animatedTangent + "\ncrs " + e.bitangent + ".xyz, " + e.animatedNormal + ", " + e.animatedTangent + "\n"), (this._fragmentCode += this._pass._getNormalFragmentCode( this._registerCache, e )); else { (e.tangentVarying = this._registerCache.getFreeVarying()), (e.bitangentVarying = this._registerCache.getFreeVarying()); var n = this._registerCache.getFreeVertexVectorTemp(); (this._vertexCode += "m33 " + n + ".xyz, " + e.animatedNormal + ", " + t[0] + "\nnrm " + e.animatedNormal + ".xyz, " + n + "\nm33 " + n + ".xyz, " + e.animatedTangent + ", " + t[0] + "\nnrm " + e.animatedTangent + ".xyz, " + n + "\nmov " + e.tangentVarying + ".x, " + e.animatedTangent + ".x \nmov " + e.tangentVarying + ".z, " + e.animatedNormal + ".x \nmov " + e.tangentVarying + ".w, " + e.normalInput + ".w \nmov " + e.bitangentVarying + ".x, " + e.animatedTangent + ".y \nmov " + e.bitangentVarying + ".z, " + e.animatedNormal + ".y \nmov " + e.bitangentVarying + ".w, " + e.normalInput + ".w \nmov " + e.normalVarying + ".x, " + e.animatedTangent + ".z \nmov " + e.normalVarying + ".z, " + e.animatedNormal + ".z \nmov " + e.normalVarying + ".w, " + e.normalInput + ".w \ncrs " + n + ".xyz, " + e.animatedNormal + ", " + e.animatedTangent + "\nmov " + e.tangentVarying + ".y, " + n + ".x \nmov " + e.bitangentVarying + ".y, " + n + ".y \nmov " + e.normalVarying + ".y, " + n + ".z \n"), this._registerCache.removeVertexTempUsage(e.animatedTangent); var r = this._registerCache.getFreeFragmentVectorTemp(); this._registerCache.addFragmentTempUsages(r, 1); var i = this._registerCache.getFreeFragmentVectorTemp(); this._registerCache.addFragmentTempUsages(i, 1); var o = this._registerCache.getFreeFragmentVectorTemp(); this._registerCache.addFragmentTempUsages(o, 1), (this._fragmentCode += "nrm " + r + ".xyz, " + e.tangentVarying + "\nmov " + r + ".w, " + e.tangentVarying + ".w\t\nnrm " + i + ".xyz, " + e.bitangentVarying + "\nnrm " + o + ".xyz, " + e.normalVarying + "\n"), (this._fragmentCode += this._pass._getNormalFragmentCode(this._registerCache, e) + "m33 " + e.normalFragment + ".xyz, " + e.normalFragment + ", " + r + "\nmov " + e.normalFragment + ".w, " + e.normalVarying + ".w\n"), this._registerCache.removeFragmentTempUsage(i), this._registerCache.removeFragmentTempUsage(r), this._registerCache.removeFragmentTempUsage(o); } else (this._vertexCode += "m33 " + e.normalVarying + ".xyz, " + e.animatedNormal + ", " + t[0] + "\nmov " + e.normalVarying + ".w, " + e.animatedNormal + ".w\n"), (this._fragmentCode += "nrm " + e.normalFragment + ".xyz, " + e.normalVarying + "\nmov " + e.normalFragment + ".w, " + e.normalVarying + ".w\n"), this.tangentDependencies > 0 && ((e.tangentVarying = this._registerCache.getFreeVarying()), (this._vertexCode += "m33 " + e.tangentVarying + ".xyz, " + e.animatedTangent + ", " + t[0] + "\nmov " + e.tangentVarying + ".w, " + e.animatedTangent + ".w\n")); this.usesTangentSpace || this._registerCache.removeVertexTempUsage(e.animatedNormal); }), (t.prototype._compileAnimationCode = function () { (this._animationVertexCode = ""), (this._animationFragmentCode = ""); var t = this._sharedRegisters; if (this._usesAnimation) { var e = this._renderMaterial.animationSet; (this._animationVertexCode += e.getAGALVertexCode( this, this._registerCache, t )), this.uvDependencies > 0 && !this.usesUVTransform && (this._animationVertexCode += e.getAGALUVCode( this, this._registerCache, t )), this.usesFragmentAnimation && (this._animationFragmentCode += e.getAGALFragmentCode( this, this._registerCache, t.shadedTarget )); } else { for (var n = t.animatableAttributes.length, r = 0; r < n; ++r) this._animationVertexCode += "mov " + t.animationTargetRegisters[r] + ", " + t.animatableAttributes[r] + "\n"; this.uvDependencies > 0 && !this.usesUVTransform && (this._animationVertexCode += "mov " + t.animatedUV + "," + t.uvInput + "\n"); } }), (t.prototype.setVertexConst = function (t, e, n, r, i) { void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), (t *= 4), (this.vertexConstantData[t++] = e), (this.vertexConstantData[t++] = n), (this.vertexConstantData[t++] = r), (this.vertexConstantData[t] = i); }), (t.prototype.setVertexConstFromArray = function (t, e) { t *= 4; for (var n = 0; n < e.length; n++) this.vertexConstantData[t++] = e[n]; }), (t.prototype.setVertexConstFromMatrix = function (t, e) { t *= 4; var n = e._rawData; (this.vertexConstantData[t++] = n[0]), (this.vertexConstantData[t++] = n[4]), (this.vertexConstantData[t++] = n[8]), (this.vertexConstantData[t++] = n[12]), (this.vertexConstantData[t++] = n[1]), (this.vertexConstantData[t++] = n[5]), (this.vertexConstantData[t++] = n[9]), (this.vertexConstantData[t++] = n[13]), (this.vertexConstantData[t++] = n[2]), (this.vertexConstantData[t++] = n[6]), (this.vertexConstantData[t++] = n[10]), (this.vertexConstantData[t++] = n[14]), (this.vertexConstantData[t++] = n[3]), (this.vertexConstantData[t++] = n[7]), (this.vertexConstantData[t++] = n[11]), (this.vertexConstantData[t] = n[15]); }), (t.prototype.setFragmentConst = function (t, e, n, r, i) { void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), (t *= 4), (this.fragmentConstantData[t++] = e), (this.fragmentConstantData[t++] = n), (this.fragmentConstantData[t++] = r), (this.fragmentConstantData[t] = i); }), (t._abstractionClassPool = new Object()), t ); })(), Oi = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._pass = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "pass", { get: function () { return this._pass; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._pass); }), (n.INVALIDATE = "invalidatePass"), n ); })(l), Bi = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._material = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "material", { get: function () { return this._material; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._material); }), (n.INVALIDATE_TEXTURES = "invalidateTextures"), (n.INVALIDATE_PASSES = "invalidatePasses"), n ); })(l), Mi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._owners = new Array()), (r._passes = new Array()), (r._invalidAnimation = !0), (r._invalidRender = !0), (r._invalidImages = !0), (r._imageIndices = new Object()), (r._usesAnimation = !1), (r.images = new Array()), (r.samplers = new Array()), (r.requiresBlending = !1), (r.materialID = e.id), (r._material = e), (r._renderElements = n), (r._stage = n.stage), (r._renderGroup = n.renderGroup), (r._onInvalidateTexturesDelegate = function (t) { return r.onInvalidateTextures(t); }), (r._onInvalidatePassesDelegate = function (t) { return r.onInvalidatePasses(t); }), r._material.addEventListener( Bi.INVALIDATE_TEXTURES, r._onInvalidateTexturesDelegate ), r._material.addEventListener( Bi.INVALIDATE_PASSES, r._onInvalidatePassesDelegate ), (r._onPassInvalidateDelegate = function (t) { return r.onPassInvalidate(t); }), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "animationSet", { get: function () { return this._animationSet; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "material", { get: function () { return this._material; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numImages", { get: function () { return this._invalidImages && this._updateImages(), this._numImages; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "renderOrderId", { get: function () { return ( this._invalidAnimation && this._updateAnimation(), this._renderOrderId ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numPasses", { get: function () { return ( this._invalidAnimation && this._updateAnimation(), this._passes.length ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "style", { get: function () { return this._material.style; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "renderGroup", { get: function () { return this._renderGroup; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "renderElements", { get: function () { return this._renderElements; }, enumerable: !0, configurable: !0, }), (n.prototype.activatePass = function (t) { var e; for ( this._activePass = this._passes[t], e = this._activePass.shader.numUsedStreams; e < this._stage.numUsedStreams; e++ ) this._stage.context.setVertexBufferAt(e, null); for ( e = this._activePass.shader.numUsedTextures; e < this._stage.numUsedTextures; e++ ) this._stage.context.setTextureAt(e, null); this._activePass._activate(this._renderGroup.view); }), (n.prototype.deactivatePass = function () { this._activePass._deactivate(), (this._stage.numUsedStreams = this._activePass.shader.numUsedStreams), (this._stage.numUsedTextures = this._activePass.shader.numUsedTextures); }), (n.prototype.addOwner = function (t) { var e; this._owners.push(t); var n = t.node.container.animator; if ((n && (e = n.animationSet), t.node.container.animator)) { if (this._animationSet && e != this._animationSet) throw new Error( "A Material instance cannot be shared across material owners with different animation sets" ); this._animationSet != e && ((this._animationSet = e), (this._invalidAnimation = !0)); } }), (n.prototype.removeOwner = function (t) { this._owners.splice(this._owners.indexOf(t), 1), this._owners.length || this.onClear(null); }), (n.prototype.getImageIndex = function (t, e) { return ( void 0 === e && (e = 0), this._invalidImages && this._updateImages(), this._imageIndices[t.id][e] ); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e); for (var n = this._passes.length, r = 0; r < n; r++) this._passes[r].removeEventListener( Oi.INVALIDATE, this._onPassInvalidateDelegate ), this._passes[r].dispose(); (this._passes = null), this._material.removeEventListener( Bi.INVALIDATE_TEXTURES, this._onInvalidateTexturesDelegate ), this._material.removeEventListener( Bi.INVALIDATE_PASSES, this._onInvalidatePassesDelegate ), (this._animationSet = null), (this._material = null), (this._renderElements = null), (this._stage = null), (this._owners = null); }), (n.prototype.onInvalidatePasses = function (t) { for (var e = this._passes.length, n = 0; n < e; n++) this._passes[n].invalidate(); (this._invalidAnimation = !0), (this._invalidImages = !0); }), (n.prototype.onPassInvalidate = function (t) { this._invalidAnimation = !0; }), (n.prototype.onInvalidateTextures = function (t) { for (var e = this._owners, n = e.length, r = 0; r < n; r++) e[r]._onInvalidateStyle(); }), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), (this._invalidRender = !0), (this._invalidAnimation = !0); }), (n.prototype._pClearPasses = function () { for (var t = this._passes.length, e = 0; e < t; ++e) this._passes[e].removeEventListener( Oi.INVALIDATE, this._onPassInvalidateDelegate ); this._passes.length = 0; }), (n.prototype._pAddPass = function (t) { this._passes.push(t), t.addEventListener(Oi.INVALIDATE, this._onPassInvalidateDelegate); }), (n.prototype._pRemovePass = function (t) { t.removeEventListener(Oi.INVALIDATE, this._onPassInvalidateDelegate), this._passes.splice(this._passes.indexOf(t), 1); }), (n.prototype._pUpdateRender = function () { this._invalidImages && this._updateImages(), (this._invalidRender = !1); }), (n.prototype._updateAnimation = function () { this._invalidRender && this._pUpdateRender(), (this._invalidAnimation = !1); for ( var t, e = this._getEnabledGPUAnimation(), n = 0, r = 1, i = this._passes.length, o = 0; o < i; o++ ) ((t = this._passes[o].shader).usesAnimation = e), t._programData ? (n += t._programData.id * r) : (n += t.programData.id * r), (r *= 1e3); if (this._usesAnimation != e) { this._usesAnimation = e; for (var a = this._owners, s = a.length, u = 0; u < s; u++) a[u]._onInvalidateElements(); } this._renderOrderId = n; }), (n.prototype._updateImages = function () { var t, e; this._invalidImages = !1; for ( var n, r, i, o, a = this._material.style, s = this._material.getNumTextures(), u = 0, l = 0; l < s; l++ ) { (r = (n = this._material.getTextureAt(l)).getNumImages()), (i = this._imageIndices[n.id] = new Array()); for (var c = 0; c < r; c++) (o = n.getImageAt(c) || (null === (t = a) || void 0 === t ? void 0 : t.getImageAt(n, c)) || Ne.getDefaultImage2D()), (this.images[u] = o.getAbstraction(this._stage)), (this.samplers[u] = n.getSamplerAt(c) || (null === (e = a) || void 0 === e ? void 0 : e.getSamplerAt(n, c)) || Ne.getDefaultSampler()), (i[c] = u++); } this._numImages = u; }), (n.prototype._getEnabledGPUAnimation = function () { if (this._animationSet) { this._animationSet.resetGPUCompatibility(); for ( var t = this._owners, e = t.length, n = this._passes.length, r = void 0, i = 0; i < n; i++ ) { (r = this._passes[i].shader).usesAnimation = !1; for (var o = 0; o < e; o++) t[o].node.container.animator && t[o].node.container.animator.testGPUCompatibility(r); } return !this._animationSet.usesCPU; } return !1; }), n ); })(W), Li = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "shader", { get: function () { return this._shader; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numUsedStreams", { get: function () { return this._shader.numUsedStreams; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numUsedTextures", { get: function () { return this._shader.numUsedTextures; }, enumerable: !0, configurable: !0, }), (n.prototype._includeDependencies = function (t) { (t.alphaThreshold = this._material.alphaThreshold), (t.useImageRect = this._material.imageRect), (t.usesCurves = this._material.curves), (t.useBothSides = this._material.bothSides), (t.usesUVTransform = this._material.animateUVs), (t.usesColorTransform = this._material.useColorTransform); }), (n.prototype.invalidate = function () { this._shader.invalidateProgram(), this.dispatchEvent(new Oi(Oi.INVALIDATE, this)); }), (n.prototype.dispose = function () { this._shader && (this._shader.dispose(), (this._shader = null)); }), (n.prototype._setRenderState = function (t) { this._shader._setRenderState(t); }), (n.prototype._activate = function () { this._shader._activate(); }), (n.prototype._deactivate = function () { this._shader._deactivate(); }), (n.prototype._initConstantData = function () {}), (n.prototype._getVertexCode = function (t, e) { return ""; }), (n.prototype._getFragmentCode = function (t, e) { return ""; }), (n.prototype._getPostAnimationFragmentCode = function (t, e) { return ""; }), (n.prototype._getNormalVertexCode = function (t, e) { return ""; }), (n.prototype._getNormalFragmentCode = function (t, e) { return ""; }), n ); })(Mi), Ni = (function () { function t(t, e, n) { (this.id = W.ID_COUNT++), (this.stage = t), (this._materialClassPool = e), (this.renderGroup = n); } return ( (t.prototype.requestAbstraction = function (t) { return this._materialClassPool[t.assetType]; }), (t.prototype._includeDependencies = function (t) {}), (t.prototype._getVertexCode = function (t, e, n) { return ""; }), (t.prototype._getFragmentCode = function (t, e, n) { return ""; }), t ); })(), Ri = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._renderable = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "renderable", { get: function () { return this._renderable; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._renderable); }), (n.INVALIDATE_MATERIAL = "invalidateMaterial"), (n.INVALIDATE_ELEMENTS = "invalidateElements"), (n.INVALIDATE_STYLE = "invalidateStyle"), n ); })(l), Fi = (function () { function t() {} return ( (t.getDefaultTextureMaterial = function () { return ( this._defaultTextureMaterial || this.createDefaultTextureMaterial(), this._defaultTextureMaterial ); }), (t.getDefaultCubeTextureMaterial = function () { return ( this._defaultCubeTextureMaterial || this.createDefaultCubeTextureMaterial(), this._defaultCubeTextureMaterial ); }), (t.getDefaultColorMaterial = function () { return ( t._defaultColorMaterial || t.createDefaultColorMaterial(), t._defaultColorMaterial ); }), (t.createDefaultTextureMaterial = function () { (this._defaultTextureMaterial = new this._defaultMaterialClass( Ne.getDefaultImage2D() )), (this._defaultTextureMaterial.name = "defaultTextureMaterial"); }), (t.createDefaultCubeTextureMaterial = function () { (this._defaultCubeTextureMaterial = new this._defaultMaterialClass( Ne.getDefaultImageCube() )), (this._defaultCubeTextureMaterial.name = "defaultCubeTextureMaterial"); }), (t.createDefaultColorMaterial = function () { (this._defaultColorMaterial = new this._defaultMaterialClass( 16777215 )), (this._defaultColorMaterial.name = "defaultColorMaterial"); }), (t.setDefaultMaterialClass = function (t) { this._defaultMaterialClass = t; }), t ); })(), ki = !0, Ui = !0, ji = 2, Vi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._materialDirty = !0), (r._elementsDirty = !0), (r._styleDirty = !0), (r._images = new Array()), (r._samplers = new Array()), (r._count = 0), (r._offset = 0), (r._maskId = -1), (r._onInvalidateElementsDelegate = function (t) { return r._onInvalidateElements(t); }), (r._onInvalidateMaterialDelegate = function (t) { return r._onInvalidateMaterial(t); }), (r._onInvalidateStyleDelegate = function (t) { return r._onInvalidateStyle(t); }), (r.node = n.node), (r._stage = n.stage), r._asset.addEventListener( Ri.INVALIDATE_ELEMENTS, r._onInvalidateElementsDelegate ), r._asset.addEventListener( Ri.INVALIDATE_MATERIAL, r._onInvalidateMaterialDelegate ), r._asset.addEventListener( Ri.INVALIDATE_STYLE, r._onInvalidateStyleDelegate ), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "images", { get: function () { return this._styleDirty && this._updateStyle(), this._images; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "samplers", { get: function () { return this._styleDirty && this._updateStyle(), this._samplers; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "uvMatrix", { get: function () { return this._styleDirty && this._updateStyle(), this._uvMatrix; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "maskId", { get: function () { return this._maskId; }, set: function (t) { t !== this._maskId && this._updateMaskHack(t >= 0), (this._maskId = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "stageElements", { get: function () { return ( this._elementsDirty && this._updateElements(), this._stageElements ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "renderMaterial", { get: function () { return ( this._materialDirty && this._updateMaterial(), this._renderMaterial ); }, enumerable: !0, configurable: !0, }), (n.prototype._updateMaskHack = function (t) {}), (n.prototype.executeRender = function (t, e, n, r) { var i = this._renderMaterial._activePass; i._setRenderState(this); var o = i.shader, a = this.stageElements; o.activeElements != a && ((o.activeElements = a), a._setRenderState(this, o)), this._stageElements.draw(this, o, this._count, this._offset); }), (n.prototype.onClear = function (e) { this._asset.removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate ), this._asset.removeEventListener( Ri.INVALIDATE_MATERIAL, this._onInvalidateMaterialDelegate ), this._asset.removeEventListener( Ri.INVALIDATE_STYLE, this._onInvalidateStyleDelegate ), t.prototype.onClear.call(this, e), (this.renderSceneTransform = null), (this._stage = null), (this.next = null), (this.maskOwners = null), this._renderMaterial.removeOwner(this), (this._renderMaterial = null), (this._stageElements = null); }), (n.prototype._onInvalidateElements = function (t) { this._elementsDirty = !0; }), (n.prototype._onInvalidateMaterial = function (t) { (this._materialDirty = !0), (this._styleDirty = !0); }), (n.prototype._onInvalidateStyle = function (t) { this._styleDirty = !0; }), (n.prototype._getStageElements = function () { throw new u(); }), (n.prototype._getRenderMaterial = function () { throw new u(); }), (n.prototype._getStyle = function () { throw new u(); }), (n.prototype._updateElements = function () { (this._stageElements = this._getStageElements()), (this._elementsDirty = !1); }), (n.prototype._updateMaterial = function () { var t = this._getRenderMaterial(); this._renderMaterial != t && (this._renderMaterial && this._renderMaterial.removeOwner(this), (this._renderMaterial = t), this._renderMaterial.addOwner(this)), (this._materialDirty = !1); }), (n.prototype._updateStyle = function () { var t = this._getStyle(); this._materialDirty && this._updateMaterial(); var e = this._renderMaterial.numImages, n = this._renderMaterial.material; (this._images.length = e), (this._samplers.length = e), (this._uvMatrix = t ? t.uvMatrix : n.style ? n.style.uvMatrix : null); for ( var r, i, o, a = this._renderMaterial.material.getNumTextures(), s = 0; s < a; s++ ) { e = (r = n.getTextureAt(s)).getNumImages(); for (var u = 0; u < e; u++) (o = this._renderMaterial.getImageIndex(r, u)), (i = t ? t.getImageAt(r, u) : null), (this._images[o] = i ? i.getAbstraction(this._stage) : null), (this._samplers[o] = t ? t.getSamplerAt(r, u) : null); } this._styleDirty = !1; }), (n.prototype.getDefaultMaterial = function () { return Fi.getDefaultTextureMaterial(); }), n ); })(W), Qi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.id = W.ID_COUNT++), (r._stage = n.stage), (r._onInvalidateElementsDelegate = function (t) { return r._onInvalidateElements(t); }), (r._onInvalidateMaterialDelegate = function (t) { return r._onInvalidateMaterial(t); }), (r._onInvalidateStyleDelegate = function (t) { return r._onInvalidateStyle(t); }), r._asset.addEventListener( Ri.INVALIDATE_ELEMENTS, r._onInvalidateElementsDelegate ), r._asset.addEventListener( Ri.INVALIDATE_MATERIAL, r._onInvalidateMaterialDelegate ), r._asset.addEventListener( Ri.INVALIDATE_STYLE, r._onInvalidateStyleDelegate ), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "stage", { get: function () { return this._stage; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "node", { get: function () { return this._asset.parent; }, enumerable: !0, configurable: !0, }), (n.prototype.onClear = function (e) { this._asset.removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate ), this._asset.removeEventListener( Ri.INVALIDATE_MATERIAL, this._onInvalidateMaterialDelegate ), this._asset.removeEventListener( Ri.INVALIDATE_STYLE, this._onInvalidateStyleDelegate ), t.prototype.onClear.call(this, e); }), (n.prototype._onInvalidateElements = function (t) {}), (n.prototype._onInvalidateMaterial = function (t) {}), (n.prototype._onInvalidateStyle = function (t) {}), (n.prototype.requestAbstraction = function (t) { return n._renderRenderableClassPool[t.assetType]; }), (n.registerRenderable = function (t, e) { n._renderRenderableClassPool[e.assetType] = t; }), (n._renderRenderableClassPool = new Object()), n ); })(W), Gi = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._style = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "style", { get: function () { return this._style; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._style); }), (n.INVALIDATE_PROPERTIES = "invalidateProperties"), n ); })(l), zi = (function (t) { function n() { var e = t.call(this) || this; return ( (e._samplers = new Object()), (e._images = new Object()), (e._color = 16777215), (e._onClearImage = function (t) { return e._invalidateProperties(); }), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "sampler", { get: function () { return this._sampler; }, set: function (t) { this._sampler != t && ((this._sampler = t), this._invalidateProperties()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "image", { get: function () { return this._image; }, set: function (t) { this._image != t && (this._image && this._image.removeEventListener(c.CLEAR, this._onClearImage), (this._image = t), this._image && this._image.addEventListener(c.CLEAR, this._onClearImage), this._invalidateProperties()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "uvMatrix", { get: function () { return this._uvMatrix; }, set: function (t) { this._uvMatrix != t && ((this._uvMatrix = t), this._invalidateProperties()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { this._color != t && ((this._color = t), this._invalidateProperties()); }, enumerable: !0, configurable: !0, }), (n.prototype.getImageAt = function (t, e) { return ( void 0 === e && (e = 0), (this._images[t.id] ? this._images[t.id][e] : null) || this._image ); }), (n.prototype.getSamplerAt = function (t, e) { return ( void 0 === e && (e = 0), (this._samplers[t.id] ? this._samplers[t.id][e] : null) || this._sampler ); }), (n.prototype.addImageAt = function (t, e, n) { void 0 === n && (n = 0), this._images[e.id] || (this._images[e.id] = new Array()), (this._images[e.id][n] = t), t.addEventListener(c.CLEAR, this._onClearImage), this._invalidateProperties(); }), (n.prototype.addSamplerAt = function (t, e, n) { void 0 === n && (n = 0), this._samplers[e.id] || (this._samplers[e.id] = new Array()), (this._samplers[e.id][n] = t), this._invalidateProperties(); }), (n.prototype.removeImageAt = function (t, e) { var n; void 0 === e && (e = 0); var r = null === (n = this._images[t.id]) || void 0 === n ? void 0 : n[e]; r && (r.removeEventListener(c.CLEAR, this._onClearImage), (this._images[t.id][e] = null), this._invalidateProperties()); }), (n.prototype.removeSamplerAt = function (t, e) { void 0 === e && (e = 0), this._samplers[t.id] && ((this._samplers[t.id][e] = null), this._invalidateProperties()); }), (n.prototype._invalidateProperties = function () { this.dispatchEvent(new Gi(Gi.INVALIDATE_PROPERTIES, this)); }), n ); })(h), Hi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._texture = e), (r._shader = n), (r._stage = n._stage), r; } return ( e(n, t), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._texture = null), (this._shader = null), (this._stage = null); }), (n.prototype._initVO = function (t) {}), (n.prototype._initConstants = function () {}), (n.prototype._getFragmentCode = function (t, e, n, r) { throw new u(); }), (n.prototype._setRenderState = function (t) {}), (n.prototype.activate = function () {}), (n.prototype.getTextureReg = function (t, e, n) { var r = this._shader.imageIndices.indexOf(t); if (-1 == r) { var i = e.getFreeTextureReg(); return n.textures.push(i), this._shader.imageIndices.push(t), i; } return n.textures[r]; }), n ); })(W), Xi = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._attributesView = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "attributesView", { get: function () { return this._attributesView; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._attributesView); }), (n.INVALIDATE_INDICES = "invalidateIndices"), (n.CLEAR_INDICES = "clearIndices"), (n.INVALIDATE_VERTICES = "invalidateVertices"), (n.CLEAR_VERTICES = "clearVertices"), n ); })(l), Yi = (function () { function t() {} return ( (t.generateFaceNormals = function (t, e, n, r, i) { void 0 === i && (i = 0); var o = t.get(r, i), a = e.get(e.count); null == n ? (n = new di(r + i)) : n.count < r + i && (n.count = r + i); var s, u, l, c, h, p, d, f, g, _, m, y, A, v, b, C, I, E, x, w = t.stride, S = e.dimensions, D = e.stride, T = n.get(r, i), P = r * w, O = 0, B = 0; if (3 == S) for (O = 0; O < P; O += w) (u = a[(s = o[O] * D)]), (h = a[s + 1]), (f = a[s + 2]), (l = a[(s = o[O + 1] * D)]), (p = a[s + 1]), (g = a[s + 2]), (c = a[(s = o[O + 2] * D)]), (d = a[s + 1]), (C = (y = a[s + 2] - f) * (v = p - h) - (m = d - h) * (b = g - f)), (I = (_ = c - u) * b - y * (A = l - u)), (E = m * A - _ * v), (x = Math.sqrt(C * C + I * I + E * E)), (T[B++] = C), (T[B++] = I), (T[B++] = E), (T[B++] = x); else if (2 == S) for (O = 0; O < P; O += w) (T[B++] = 0), (T[B++] = 0), (T[B++] = 1), (T[B++] = 1); return n; }), (t.generateNormals = function (t, e, n, r) { var i = t.get(t.count), o = e.get(e.count); null == n && (n = new pi(r)); var a, s, u = t.dimensions, l = n.stride, c = n.get(n.count), h = n.count * l; for (a = 0; a < h; a += l) (c[a] = 0), (c[a + 1] = 0), (c[a + 2] = 0); h = t.count * u; var p, d, f, g, _ = 0, m = 1, y = 2; for (a = 0; a < h; a += u) (c[(s = i[a] * l)] += o[_]), (c[s + 1] += o[m]), (c[s + 2] += o[y]), (c[(s = i[a + 1] * l)] += o[_]), (c[s + 1] += o[m]), (c[s + 2] += o[y]), (c[(s = i[a + 2] * l)] += o[_]), (c[s + 1] += o[m]), (c[s + 2] += o[y]), (_ += 4), (m += 4), (y += 4); for (h = n.count * l, a = 0; a < h; a += l) (p = c[a]), (d = c[a + 1]), (f = c[a + 2]), (g = 1 / Math.sqrt(p * p + d * d + f * f)), (c[a] = p * g), (c[a + 1] = d * g), (c[a + 2] = f * g); return n; }), (t.generateFaceTangents = function (t, e, n, r, i, o, a) { void 0 === o && (o = 0); var s = t.get(i, o), u = e.get(e.count), l = n.get(n.count); null == r ? (r = new di(i + o)) : r.count < i + o && (r.count = i + o); var c, h, p, d, f, g, _, m, y, A, v, b, C, I, E, x = t.dimensions, w = e.dimensions, S = e.stride, D = n.stride, T = r.get(i, o), P = 0, O = i * x; for (P = 0; P < O; P += x) (c = s[P]), (h = s[P + 1]), (p = s[P + 2]), (d = l[c * D + 1]), (_ = l[h * D + 1] - d), (m = l[p * D + 1] - d), (f = h * S), (g = p * S), (A = u[(d = c * S)]), (C = m * (u[f] - A) - _ * (u[g] - A)), (v = u[d + 1]), (I = m * (u[f + 1] - v) - _ * (u[g + 1] - v)), 3 == w ? ((b = u[d + 2]), (E = m * (u[f + 2] - b) - _ * (u[g + 2] - b))) : (E = 0), (y = 1 / Math.sqrt(C * C + I * I + E * E)), (T[P] = y * C), (T[P + 1] = y * I), (T[P + 2] = y * E); return r; }), (t.generateTangents = function (t, e, n, r, i) { var o = t.get(t.count), a = e.get(e.count), s = n.get(n.count); null == r && (r = new pi(i)); var u, l, c, h = t.dimensions, p = r.stride, d = r.get(r.count), f = r.count * p; for (u = 0; u < f; u += p) (d[u] = 0), (d[u + 1] = 0), (d[u + 2] = 0); var g, _, m, y, A = 0, v = 1, b = 2, C = 3; for (f = t.count * h, u = 0; u < f; u += h) (l = s[C]), (c = o[u] * p), (d[c++] += a[A] * l), (d[c++] += a[v] * l), (d[c] += a[b] * l), (c = o[u + 1] * p), (d[c++] += a[A] * l), (d[c++] += a[v] * l), (d[c] += a[b] * l), (c = o[u + 2] * p), (d[c++] += a[A] * l), (d[c++] += a[v] * l), (d[c] += a[b] * l), (A += 3), (v += 3), (b += 3), (C += 4); for (u = 0; u < f; u += p) (g = d[u]), (_ = d[u + 1]), (m = d[u + 2]), (y = 1 / Math.sqrt(g * g + _ * _ + m * m)), (d[u] = g * y), (d[u + 1] = _ * y), (d[u + 2] = m * y); return r; }), (t.generateColors = function (t, e, n, r, i) { void 0 === i && (i = 0), null == e && (e = new li(n)), e.count < r + i && (e.count = r + i); for ( var o = e.get(r, i), a = e.stride, s = e.count * a, u = 0; u < s; u += a ) (o[u] = 255), (o[u + 1] = 255), (o[u + 2] = 255), (o[u + 3] = 255); return e; }), (t.scale = function (t, e, n, r, i, o) { void 0 === o && (o = 0), r.count < i + o && (r.count = i + o); var a, s, u = new Float32Array([t, e, n]), l = r.get(i, o), c = r.stride, h = r.dimensions, p = i * c; for (a = 0; a < p; a += c) for (s = 0; s < h; s++) l[a + s] *= u[s]; r.invalidate(); }), (t.applyTransformation = function (t, e, n, r, i, o) { void 0 === o && (o = 0); var a, s, u, l, c, h, p, d = e.get(i, o), f = e.stride; n && ((a = n.get(i, o)), (s = n.stride)), r && ((u = r.get(i, o)), (l = r.stride)); var g, _ = new B(); (n || r) && ((g = t.clone()).invert(), g.transpose()); var m = 0, y = 0, A = 0; for (c = 0; c < i; ++c) (h = m + 1), (p = m + 2), (_.x = d[m]), (_.y = d[h]), (_.z = d[p]), (_ = t.transformVector(_)), (d[m] = _.x), (d[h] = _.y), (d[p] = _.z), (m += f), a && ((h = y + 1), (p = y + 2), (_.x = a[y]), (_.y = a[h]), (_.z = a[p]), (_ = g.deltaTransformVector(_)).normalize(), (a[y] = _.x), (a[h] = _.y), (a[p] = _.z), (y += s)), u && ((h = A + 1), (p = A + 2), (_.x = u[A]), (_.y = u[h]), (_.z = u[p]), (_ = g.deltaTransformVector(_)).normalize(), (u[A] = _.x), (u[h] = _.y), (u[p] = _.z), (A += l)); e.invalidate(), n && n.invalidate(), r && r.invalidate(); }), (t.getSubIndices = function (e, n, r, i) { void 0 === i && (i = 0); var o, a = e.attributesBuffer, s = e.length; if (((r.length = 0), s < t.LIMIT_INDICES && n < t.LIMIT_VERTS)) return a; var u, l, c = e.get(e.count, i), h = new Array(), p = t._indexSwap; for (p.length = s, o = 0; o < s; o++) p[o] = -1; var d = 0, f = i * e.dimensions; for ( o = 0; o < s + f && o + 1 < t.LIMIT_INDICES && d + 1 < t.LIMIT_VERTS; ) p[(u = c[o])] >= 0 ? (l = p[u]) : ((l = d++), (p[u] = l), (r[l] = u)), (h[o++] = l); return ( (a = new oi(e.size * e.dimensions, h.length / e.dimensions)), (e = e.clone(a)).set(h), a ); }), (t.getSubVertices = function (t, e) { if (!e.length) return t; var n, r, i = t.stride, o = t.bufferView, a = new Uint8Array(e.length * i), s = 0, u = 0, l = e.length; for (s = 0; s < l; s++) for (n = s * i, r = e[s] * i, u = 0; u < i; u++) a[n + u] = o[r + u]; return ((t = new oi(i, l)).bufferView = a), t; }), (t.tempFloat32x4 = new Float32Array(4)), (t.LIMIT_VERTS = 65535), (t.LIMIT_INDICES = 16777215), (t._indexSwap = new Array()), t ); })(), qi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.usages = 0), (r._vertices = new Object()), (r._verticesUpdated = new Object()), (r._indexMappings = Array()), (r._numIndices = 0), (r._elements = e), (r._stage = n), (r._onInvalidateIndicesDelegate = function (t) { return r._onInvalidateIndices(t); }), (r._onClearIndicesDelegate = function (t) { return r._onClearIndices(t); }), (r._onInvalidateVerticesDelegate = function (t) { return r._onInvalidateVertices(t); }), (r._onClearVerticesDelegate = function (t) { return r._onClearVertices(t); }), r._elements.addEventListener( Xi.CLEAR_INDICES, r._onClearIndicesDelegate ), r._elements.addEventListener( Xi.INVALIDATE_INDICES, r._onInvalidateIndicesDelegate ), r._elements.addEventListener( Xi.CLEAR_VERTICES, r._onClearVerticesDelegate ), r._elements.addEventListener( Xi.INVALIDATE_VERTICES, r._onInvalidateVerticesDelegate ), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "elements", { get: function () { return this._elements; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numIndices", { get: function () { return this._numIndices; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numVertices", { get: function () { return this._numVertices; }, enumerable: !0, configurable: !0, }), (n.prototype.getIndexMappings = function () { return ( this._indicesUpdated || this._updateIndices(), this._indexMappings ); }), (n.prototype.getIndexBufferGL = function () { return this._indicesUpdated || this._updateIndices(), this._indices; }), (n.prototype.getVertexBufferGL = function (t) { this._indicesUpdated || this._updateIndices(); var e = t.attributesBuffer.id; return ( this._verticesUpdated[e] || this._updateVertices(t), this._vertices[e] ); }), (n.prototype.activateVertexBufferVO = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = 0), this.getVertexBufferGL(e).activate( t, e.size, n || e.dimensions, e.offset + r, e.unsigned ); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._elements.removeEventListener( Xi.CLEAR_INDICES, this._onClearIndicesDelegate ), this._elements.removeEventListener( Xi.INVALIDATE_INDICES, this._onInvalidateIndicesDelegate ), this._elements.removeEventListener( Xi.CLEAR_VERTICES, this._onClearVerticesDelegate ), this._elements.removeEventListener( Xi.INVALIDATE_VERTICES, this._onInvalidateVerticesDelegate ), (this._elements = null), this._overflow && (this._overflow.onClear(e), (this._overflow = null)); }), (n.prototype._setRenderState = function (t, e) { this._verticesUpdated || this._updateIndices(); }), (n.prototype.draw = function (t, e, n, r) { throw new u(); }), (n.prototype._updateIndices = function (t) { void 0 === t && (t = 0); var e = this._elements.indices; if (e) { var n = Yi.getSubIndices( e, this._elements.numVertices, this._indexMappings, t ); (this._indices = n.getAbstraction(this._stage)), (this._numIndices = this._indices._attributesBuffer.count * e.dimensions); } else (this._indices = null), (this._numIndices = 0), (this._indexMappings = Array()); if ( ((t += this._numIndices), e && t < e.count * this._elements.indices.dimensions ? (this._overflow || (this._overflow = this._pGetOverflowElements()), this._overflow._updateIndices(t)) : this._overflow && (this._overflow.onClear(new c(c.CLEAR, this._elements)), (this._overflow = null)), (this._indicesUpdated = !0), this._indexMappings.length) ) for (var r in this._verticesUpdated) this._verticesUpdated[r] = !1; }), (n.prototype._updateVertices = function (t) { this._numVertices = this._elements.numVertices; var e = t.attributesBuffer.id, n = Yi.getSubVertices(t.attributesBuffer, this._indexMappings); (this._vertices[e] = n.getAbstraction(this._stage)), (this._verticesUpdated[e] = !0); }), (n.prototype._onInvalidateIndices = function (t) { t.attributesView && (this._indicesUpdated = !1); }), (n.prototype._onClearIndices = function (t) { t.attributesView && (this._indices.onClear(new c(c.CLEAR, t.attributesView)), (this._indices = null)); }), (n.prototype._onInvalidateVertices = function (t) { if (t.attributesView) { var e = t.attributesView.attributesBuffer.id; this._verticesUpdated[e] = !1; } }), (n.prototype._onClearVertices = function (t) { if (t.attributesView) { var e = t.attributesView.attributesBuffer.id; this._vertices[e] && (this._vertices[e].onClear(new c(c.CLEAR, t.attributesView)), delete this._vertices[e], delete this._verticesUpdated[e]); } }), (n.prototype._pGetOverflowElements = function () { throw new u(); }), n ); })(W), Ki = (function () { return function () {}; })(); !(function (t) { (t[(t.LINEAR = 0)] = "LINEAR"), (t[(t.RADIAL = 1)] = "RADIAL"); })(Ti || (Ti = {})); var Wi = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._renderer = e), (r._shader = new Pi(n, r, r, r._stage)), (r._texture = r._renderer.texture.getAbstraction(r._shader)), r._pAddPass(r), r ); } return ( e(n, t), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._texture.onClear(new c(c.CLEAR, this._renderer.texture)), (this._texture = null), (this._renderer = null); }), (n.prototype._pUpdateRender = function () { t.prototype._pUpdateRender.call(this); var e = this._asset; this.shader.setBlendMode(dn.LAYER), e.render(), (this.requiresBlending = !0), this.shader.setBlendMode(e.blendMode || dn.LAYER); }), (n.prototype._includeDependencies = function (e) { t.prototype._includeDependencies.call(this, e), e.uvDependencies++; }), (n.prototype._getFragmentCode = function (t, e) { return this._texture._getFragmentCode( e.shadedTarget, t, e, e.uvVarying ); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._texture._setRenderState(e); }), (n.prototype._activate = function () { t.prototype._activate.call(this), this._stage.context.setDepthTest(!1, Wt.LESS), this._texture.activate(); }), n ); })(Li), Ji = (function () { function t() { this._data = []; } return ( Object.defineProperty(t.prototype, "length", { get: function () { return this._data.length; }, enumerable: !0, configurable: !0, }), (t.prototype.toVec = function (t, e) { void 0 === t && (t = new B()), void 0 === e && (e = 0); for (var n = this._data[e], r = n.length, i = 0; i < 4; i++) t._rawData[i] = i < r ? n[i] : 0; return t; }), (t.prototype.fromVec = function (t, e) { void 0 === e && (e = 0); for (var n = this._data[e], r = n.length, i = 0; i < r; i++) n[i] = t._rawData[i]; return this; }), (t.prototype.setData = function (t, e, n) { return ( void 0 === n && (n = !1), (this._data[e] = n ? t.slice() : t), this ); }), (t.prototype.getData = function (t) { return this._data[t]; }), (t.prototype.lerpTo = function (t, e) { if (0 === e) return this; if (1 === e) return this.copyFrom(t); for (var n = 0; n < this._data.length; n++) for ( var r = t._data[n], i = this._data[n], o = 0; o < this._data[n].length; o++ ) i[o] = (1 - e) * i[o] + e * r[o]; return this; }), (t.prototype.add = function (t, e) { void 0 === e && (e = 1); for (var n = 0; n < this._data.length; n++) for ( var r = t._data[n], i = this._data[n], o = 0; o < this._data[n].length; o++ ) i[o] += r[o] * e; return this; }), (t.prototype.scale = function (t) { for (var e = 0; e < this._data.length; e++) for (var n = this._data[e], r = 0; r < this._data[e].length; r++) n[r] *= t; return this; }), (t.prototype.copyFrom = function (t) { for (var e = this._data, n = 0; n < t.length; n++) e[n] ? e[n].set(t._data[n]) : (e[n] = t._data[n].slice()); return this; }), (t.prototype.clone = function () { return new t().copyFrom(this); }), t ); })(), $i = (function () { function t(t, e) { (this.vertices = []), t && (this.vertices = t.map(function (t) { return t.clone(); })), e && (this.userData = e); } return ( Object.defineProperty(t.prototype, "middle", { get: function () { if (this._middle) return this._middle; this._middle = this.vertices[0].clone(); for (var t = 1; t < this.vertices.length; t++) this._middle.add(this.vertices[t]); return this._middle.scale(1 / this.vertices.length), this._middle; }, enumerable: !0, configurable: !0, }), (t.prototype.clone = function () { for (var e = new t(), n = this.vertices.length, r = 0; r < n; r++) e.vertices[r] = this.vertices[r].clone(); return ( this.userData && (e.userData = this.userData.clone ? this.userData.clone() : Object.assign({}, this.userData)), e ); }), (t.prototype.add = function (t, e) { return ( void 0 === e && (e = !1), this.vertices.push(e ? t.clone() : t), this ); }), Object.defineProperty(t.prototype, "length", { get: function () { return this.vertices.length; }, enumerable: !0, configurable: !0, }), t ); })(), Zi = (function () { function t() { (this.poly = []), (this.rect = new K()), (this.polySize = 3), (this.hasNGones = !1); } return ( (t.prototype.push = function (t) { return this.poly.push(t), this; }), (t.prototype.normalise = function () { if (this.hasNGones) { for (var t = [], e = 0, n = this.poly; e < n.length; e++) { var r = n[e]; if (!(r.length < this.polySize)) if (r.length !== this.polySize) for (var i = 1; i < r.length - 1; i++) { var o = new $i(); (o.userData = r.userData), o.add(r.vertices[0].clone()), o.add(r.vertices[i % r.length].clone()), o.add(r.vertices[(i + 1) % r.length].clone()), t.push(o); } else t.push(r); } return (this.poly = t), this; } }), (t.prototype.toFloatArray = function (t) { void 0 === t && (t = 0); var e = this.poly.length; if (0 === this.poly.length) return null; for ( var n = this.poly[0].vertices[0].getData(t).length, r = new Float32Array(e * n * 3), i = 0; i < 3 * e; i++ ) { var o = this.poly[(i / 3) | 0].vertices[i % 3]; r.set(o.getData(t), i * n); } return r; }), (t.fromAttributes = function (e, n, r, i) { void 0 === r && (r = 0); var o, a = new t(); a.polySize = r; for ( var s = e.map(function (t) { return t.get(n, 0); }), u = 0; u < n; u++ ) { u % r == 0 && ((o = new $i()).userData = i ? new i() : null), a.poly.push(o); var l = new Ji(); o.add(l); for (var c = 0; c < e.length; c++) { var h = e[c].offset, p = e[c].stride, d = e[c].dimensions; l.setData(s[c].slice(h + p * u, h + p * u + d), c); } } return a; }), t ); })(), to = (function () { function t() {} return ( (t.InFront = function (t, e, n) { return t.dotProduct(n) - e > this.EPS; }), (t.Behind = function (t, e, n) { return t.dotProduct(n) - e < -this.EPS; }), (t.OnPlane = function (t, e, n) { return !this.InFront(t, e, n) && !this.Behind(t, e, n); }), (t.Intersect = function (t, e, n, r) { var i = n / (n - r); return new Ji().copyFrom(t).lerpTo(e, i); }), (t.SliceNaive = function (t, e, n, r, i, o, a) { var s = this.Intersect(e, n, i, o); if (i < 0) if (a < 0) { var u = this.Intersect(n, r, o, a); t.push(new $i([n, u, s])) .push(new $i([u, r, e])) .push(new $i([s, u, e])); } else { var l = this.Intersect(e, r, i, a); t.push(new $i([e, s, l])) .push(new $i([s, n, r])) .push(new $i([l, s, r])); } else if (a < 0) { l = this.Intersect(e, r, i, a); t.push(new $i([e, s, l])) .push(new $i([l, s, n])) .push(new $i([n, r, l])); } else { u = this.Intersect(n, r, o, a); t.push(new $i([n, u, s])) .push(new $i([e, s, u])) .push(new $i([r, e, u])); } return t; }), (t.SliceAllNaive = function (t, e, n) { var r = new Zi(); r.polySize = t.polySize; for (var i = new B(), o = 0; o < t.poly.length; ++o) { var a = t.poly[o], s = a.vertices[0], u = a.vertices[1], l = a.vertices[2]; s.toVec(i, 0); var c = s.toVec(i).dotProduct(e) - n, h = u.toVec(i).dotProduct(e) - n, p = l.toVec(i).dotProduct(e) - n; c * h < 0 ? this.SliceNaive(r, s, u, l, c, h, p) : c * p < 0 ? this.SliceNaive(r, l, s, u, p, c, h) : h * p < 0 ? this.SliceNaive(r, u, l, s, h, p, c) : r.push(a); } return r; }), (t.SutherlandHodgman = function (t, e, n, r, i) { var o = new $i(), a = new $i(), s = t.length, u = t.vertices, l = new B(), c = new B(); n < 0 && ((n = -n), e.scaleBy(-1)); for ( var h = u[s - 1], p = h.toVec(l, 0), d = e.dotProduct(p) - n, f = 0; f < s; ++f ) { var g = u[f], _ = g.toVec(c, 0), m = e.dotProduct(_) - n; if (this.InFront(e, n, _)) { if (this.Behind(e, n, p)) { var y = this.Intersect(g, h, m, d); o.add(y), a.add(y, !0); } o.add(g, !0); } else if (this.Behind(e, n, _)) { if (this.InFront(e, n, p)) { y = this.Intersect(h, g, d, m); o.add(y, !1), a.add(y, !0); } else this.OnPlane(e, n, p) && a.add(h, !0); a.add(g, !0); } else o.add(g, !0), this.OnPlane(e, n, p) && a.add(g, !0); (p = (h = g.clone()).toVec(p, 0)), (d = m); } return ( o.length && (i && i(t, o, !1), r.polySize !== o.length && (r.hasNGones = !0), r.poly.push(o)), a.length && (i && i(t, a, !0), r.polySize !== a.length && (r.hasNGones = !0), r.poly.push(a)), r ); }), (t.SliceHodgman = function (t, e, n, r) { var i = new Zi(); i.polySize = t.polySize; for (var o = 0, a = t.poly; o < a.length; o++) { var s = a[o]; this.SutherlandHodgman(s, e, n, i, r); } return i; }), (t.EPS = 1e-4), t ); })(), eo = (function () { return function () { (this.cells = new Array()), (this.lastCollisionIndex = -1); }; })(), no = (function () { function t() {} return ( (t.hitTest = function (t, e, n, r, i, o, a) { void 0 === a && (a = 0); var s, u, l, c, h, p, d, f, g, _, m, y = i.positions, A = i.getCustomAtributes("curves"), v = y.stride, b = A ? A.stride : null, C = y.get(o, a), I = A ? A.get(o, a) : null; i.indices ? ((s = i.indices.get(o, a)), (C = y.get(y.count)), (I = A ? A.get(A.count) : null), (u = o * i.indices.dimensions)) : ((C = y.get(o, a)), (I = A ? A.get(o, a) : null), (u = o)); var E = i.hitTestCache[a] || (i.hitTestCache[a] = new eo()), x = E.lastCollisionIndex; if (-1 != x && x < u) t: { if ( (s ? ((l = s[x + 2]), (c = s[x + 1]), (h = s[x])) : ((l = x + 2), (c = x + 1), (h = x)), (p = C[l * v]), (d = C[l * v + 1]), (f = C[c * v]), (g = C[c * v + 1]), (_ = C[h * v]), (m = C[h * v + 1]), !( (p - t) * (g - d) + (d - e) * -(f - p) > 0 || (f - t) * (m - g) + (g - e) * -(_ - f) > 0 || (_ - t) * (d - m) + (m - e) * -(p - _) > 0 )) ) { if (I && -128 != I[l * b + 2]) { var w = (Z = 0.5 * (((K = t - p) * (q = m - d) - (Y = _ - p) * (W = e - d)) / (J = (H = f - p) * q - Y * (X = g - d))) + ($ = (H * W - K * X) / J)) * Z - $, S = I[l * b]; if (w > 0 && -128 == S) break t; if (w < 0 && 127 == S) break t; } return !0; } } if (u > 150) { var D = E.cells, T = D.length ? E.divisions : (E.divisions = Math.min(Math.ceil(Math.sqrt(u)), 32)), P = T / r.width, O = T / r.height, B = r.x, M = r.y; if (!D.length) { D.length = T * T; for (var L = 0; L < u; L += 3) { s ? ((l = s[L + 2]), (c = s[L + 1]), (h = s[L])) : ((l = L + 2), (c = L + 1), (h = L)), (p = C[l * v]), (d = C[l * v + 1]), (f = C[c * v]), (g = C[c * v + 1]), (_ = C[h * v]), (m = C[h * v + 1]); for ( var N = Math.floor((Math.min(p, f, _) - B) * P), R = Math.floor((Math.min(d, g, m) - M) * O), F = Math.floor((Math.max(p, f, _) - B) * P), k = Math.floor((Math.max(d, g, m) - M) * O), U = N; U <= F; U++ ) for (var j = R; j <= k; j++) { var V = U + j * T; (D[V] || (D[V] = new Array())).push(L); } } } var Q = D[Math.floor((t - B) * P) + Math.floor((e - M) * O) * T]; if (null == Q) return (E.lastCollisionIndex = -1), !1; for (var G = Q.length, z = 0; z < G; z++) { L = Q[z]; if ((h = s ? s[L] : L) != x) if ( (s ? ((l = s[L + 2]), (c = s[L + 1])) : ((l = L + 2), (c = L + 1)), (p = C[l * v]), (d = C[l * v + 1]), (f = C[c * v]), (g = C[c * v + 1]), (_ = C[h * v]), (m = C[h * v + 1]), !( (p - t) * (g - d) + (d - e) * -(f - p) > 0 || (f - t) * (m - g) + (g - e) * -(_ - f) > 0 || (_ - t) * (d - m) + (m - e) * -(p - _) > 0 )) ) { if (I && -128 != I[l * b + 2]) { (w = (Z = 0.5 * (((K = t - p) * (q = m - d) - (Y = _ - p) * (W = e - d)) / (J = (H = f - p) * q - Y * (X = g - d))) + ($ = (H * W - K * X) / J)) * Z - $), (S = I[l * b]); if (w > 0 && -128 == S) continue; if (w < 0 && 127 == S) continue; } return (E.lastCollisionIndex = L), !0; } } return (E.lastCollisionIndex = -1), !1; } for (L = 0; L < u; L += 3) { if ((h = s ? s[L] : L) != x) if ( (s ? ((l = s[L + 2]), (c = s[L + 1])) : ((l = L + 2), (c = L + 1)), (p = C[l * v]), (d = C[l * v + 1]), (f = C[c * v]), (g = C[c * v + 1]), (_ = C[h * v]), (m = C[h * v + 1]), !( (p - t) * (g - d) + (d - e) * -(f - p) > 0 || (f - t) * (m - g) + (g - e) * -(_ - f) > 0 || (_ - t) * (d - m) + (m - e) * -(p - _) > 0 )) ) { if (I && -128 != I[l * b + 2]) { var H, X, Y, q, K, W, J, $, Z; (w = (Z = 0.5 * (((K = t - p) * (q = m - d) - (Y = _ - p) * (W = e - d)) / (J = (H = f - p) * q - Y * (X = g - d))) + ($ = (H * W - K * X) / J)) * Z - $), (S = I[l * b]); if (w > 0 && -128 == S) continue; if (w < 0 && 127 == S) continue; } return (E.lastCollisionIndex = L), !0; } } return (E.lastCollisionIndex = -1), !1; }), (t.getBoxBounds = function (t, e, n, r, i, o, a) { var s; void 0 === a && (a = 0); var u, l, c = t.dimensions, h = t.stride, p = 0, d = 0, f = 0, g = 0, _ = 0, m = 0; if ( (e ? ((l = o * e.dimensions), (u = e.get(o, a)), (s = t.get(t.count))) : ((l = o), (s = t.get(o, a))), 0 == l) ) return i; var y, A, v, b, C, I = 0; for ( n && (C = n._rawData), null == i ? ((i = r || new M()), (y = u ? u[I] * h : I * h), n ? 3 == c ? ((A = s[y] * C[0] + s[y + 1] * C[4] + s[y + 2] * C[8] + C[12]), (v = s[y] * C[1] + s[y + 1] * C[5] + s[y + 2] * C[9] + C[13]), (b = s[y] * C[2] + s[y + 1] * C[6] + s[y + 2] * C[10] + C[14])) : ((A = s[y] * C[0] + s[y + 1] * C[4] + C[12]), (v = s[y] * C[1] + s[y + 1] * C[5] + C[13])) : ((A = s[y]), (v = s[y + 1]), (b = 3 == c ? s[y + 2] : 0)), (g = p = A), (_ = d = v), (m = f = 3 == c ? b : 0), I++) : ((g = (p = i.x) + i.width), (_ = (d = i.y) + i.height), (m = (f = i.z) + i.depth)); I < l; I++ ) (y = u ? u[I] * h : I * h), n ? 3 == c ? ((A = s[y] * C[0] + s[y + 1] * C[4] + s[y + 2] * C[8] + C[12]), (v = s[y] * C[1] + s[y + 1] * C[5] + s[y + 2] * C[9] + C[13]), (b = s[y] * C[2] + s[y + 1] * C[6] + s[y + 2] * C[10] + C[14])) : ((A = s[y] * C[0] + s[y + 1] * C[4] + C[12]), (v = s[y] * C[1] + s[y + 1] * C[5] + C[13])) : ((A = s[y]), (v = s[y + 1]), (b = 3 == c ? s[y + 2] : 0)), A < p ? (p = A) : A > g && (g = A), v < d ? (d = v) : v > _ && (_ = v), 3 == c && (b < f ? (f = b) : b > m && (m = b)); return ( (i.width = g - (i.x = p)), (i.height = _ - (i.y = d)), (i.depth = m - (i.z = f)), i ); }), (t.getSphereBounds = function (t, e, n, r, i, o, a) { void 0 === a && (a = 0); for ( var s, u, l, c, h = t.get(o, a), p = t.dimensions, d = t.stride, f = 0, g = o * d, _ = 0; _ < g; _ += d ) f < (s = (u = h[_] - e.x) * u + (l = h[_ + 1] - e.y) * l + (c = 3 == p ? h[_ + 2] - e.z : -e.z) * c) && (f = s); return ( null == i && (i = new R()), (i.x = e.x), (i.y = e.y), (i.z = e.z), (i.radius = Math.sqrt(f)), i ); }), (t.prepareScale9 = function (e, n, r, i, o, a) { if (0 !== e._numElements) throw "Indices not support yet"; for ( var s = i ? e.clone() : e, u = t.getBoxBounds( e.positions, e.indices, null, null, null, e._numElements | e._numVertices, 0 ), l = [-1 / 0, r.x, r.right, 1 / 0], c = [-1 / 0, r.y, r.bottom, 1 / 0], h = { from: 0, to: 0 }, p = { from: 0, to: 0 }, d = 1; d < 3; d++ ) u.x >= l[d] && (h.from = h.to = d), u.y >= c[d] && (p.from = p.to = d); for (d = 0; d < 3; d++) u.right > l[d] && d >= h.from && (h.to = d), u.bottom > c[d] && d >= p.from && (p.to = d); var f = Array.from({ length: 9 }, function (t) { return 0; }); if ( ((s.scale9Indices = f), (s.scale9Grid = r), (s.originalScale9Bounds = n), o) ) { if (2 !== s.positions.dimensions) throw "Emit UV support only 2D position buffer"; var g = s.positions.get(s._numVertices, 0).slice(0), _ = a.rawData; for (d = 0; d < g.length; d += 2) { var m = g[d + 0], y = g[d + 1]; (g[d + 0] = m * _[0] + y * _[2] + _[4]), (g[d + 1] = m * _[1] + y * _[3] + _[5]); } s.setUVs(g), s.invalidate(); } if (h.from === h.to && p.from === p.to) return (s.scale9Indices[3 * p.from + h.from] = s._numVertices), s; var A = s.uvs ? [s.positions, s.uvs] : [s.positions], v = Zi.fromAttributes(A, s._numVertices, 3), b = new B(0, 0); b.setTo(1, 0, 0, 0); for (d = h.from; d < h.to; d++) v = to.SliceAllNaive(v, b, l[d + 1]); b.setTo(0, 1, 0, 0); for (d = p.from; d < p.to; d++) v = to.SliceAllNaive(v, b, c[d + 1]); v.normalise(); for (var C = 0, I = v.poly; C < I.length; C++) { var E = I[C]; for (d = 0; d < 9; d++) { var x = E.middle.getData(0), w = x[0], S = x[1]; w >= l[d % 3] && w < l[(d % 3) + 1] && S >= c[(d / 3) | 0] && S < c[1 + ((d / 3) | 0)] && (E.userData = d); } } v.poly.sort(function (t, e) { return t.userData - e.userData; }); for (d = 0; d < v.poly.length; d++) { f[v.poly[d].userData] = 3 * d + 3; } var D = v.toFloatArray(0); if ((s.setPositions(D), s.uvs)) { var T = v.toFloatArray(1); s.setUVs(T); } return s.invalidate(), s; }), (t.updateScale9 = function (t, e, n, r, i, o) { if ( (void 0 === i && (i = !1), void 0 === o && (o = !1), 9 !== t.scale9Indices.length) ) throw "ElementUtils: Error - triangleElement does not provide valid slice9Indices!"; var a = t.scale9Grid, s = a.x - e.x, u = e.right - a.right, l = a.y - e.y, c = e.bottom - a.bottom, h = t.scale9Indices.length, p = e.width * n - (s + u), d = e.height * r - (l + c), f = 1, g = 1; p < 0 && ((p = 0), (f = (e.width * n) / (s + u))), d < 0 && ((d = 0), (g = (e.height * r) / (l + c))); var _, m, y, A = p / a.width, v = d / a.height, b = t.positions.stride, C = t.positions.offset; if ( (o ? (((_ = t.clone()).scale9Grid = t.scale9Grid), (_.initialScale9Positions = t.initialScale9Positions), (_.scale9Indices = t.scale9Indices), (m = _.positions.get(_._numVertices))) : (m = t.positions.get(t._numVertices)), i || !t.initialScale9Positions) ) { (y = []).length = 2 * t._numVertices; for (var I = 0, E = t.positions.length, x = 0; x < E; x += b) (y[I + 0] = m[C + x + 0]), (y[I + 1] = m[C + x + 1]), (I += 2); t.initialScale9Positions = y; } else y = t.initialScale9Positions; for ( var w = t.scale9Indices, S = [0, s * f - s * A, p - a.width * f], D = [0, l * g - l * v, d - a.height * g], T = C, P = 0, O = 0; O < h; O++ ) for ( var B = (O / 3) | 0, M = O % 3, L = 1 === M ? A : f, N = 1 === B ? v : g, R = S[M], F = D[B]; P < w[O]; ) { var k = y[2 * P + 0] - e.x, U = y[2 * P + 1] - e.y; (k = R + k * L), (U = F + U * N), (k /= n), (U /= r), (m[T + 0] = k + e.x), (m[T + 1] = U + e.y), (T += b), P++; } return o ? (_.positions.invalidate(), _.invalidate(), _) : (t.positions.invalidate(), t.invalidate(), t); }), t ); })(), ro = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n.isDynamic = !1), (n._customAttributesNames = new Array()), (n._customAttributes = new Object()), (n._autoDeriveNormals = !0), (n._autoDeriveTangents = !0), (n._boundsRequests = 0), (n._numElements = 0), (n._numVertices = 0), (n._verticesDirty = new Object()), (n._invalidateVertices = new Object()), (n.usages = 0), (n._concatenatedBuffer = e), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "concatenatedBuffer", { get: function () { return this._concatenatedBuffer; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "indices", { get: function () { return this._indices; }, enumerable: !0, configurable: !0, }), (n.prototype.getCustomAtributesNames = function () { return this._customAttributesNames; }), (n.prototype.getCustomAtributes = function (t) { return this._customAttributes[t]; }), Object.defineProperty(n.prototype, "numElements", { get: function () { return this._numElements; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numVertices", { get: function () { return this._numVertices; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "condensedIndexLookUp", { get: function () { return this._condensedIndexLookUp; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "autoDeriveNormals", { get: function () { return this._autoDeriveNormals; }, set: function (t) { this._autoDeriveNormals != t && (this._autoDeriveNormals = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "autoDeriveTangents", { get: function () { return this._autoDeriveTangents; }, set: function (t) { this._autoDeriveTangents != t && (this._autoDeriveTangents = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "useCondensedIndices", { get: function () { return this._useCondensedIndices; }, set: function (t) { this._useCondensedIndices != t && (this._useCondensedIndices = t); }, enumerable: !0, configurable: !0, }), (n.prototype.copyTo = function (t) { for (var e in (this.indices && t.setIndices(this.indices.clone()), this._customAttributes)) t.setCustomAttributes(e, this.getCustomAtributes(e).clone()); }), (n.prototype.dispose = function () { for (var t in (this.clear(), (this._boundsRequests = 0), this._convexHull && (this._convexHull.dispose(), (this._convexHull = null)), this._indices && (this._indices.dispose(), (this._indices = null)), this._customAttributes)) this._customAttributes[t].dispose(), delete this._customAttributes; }), (n.prototype.setIndices = function (t, e) { void 0 === e && (e = 0), t instanceof fi ? (this._indices && this.clearIndices(), (this._indices = t)) : t ? (this._indices || (this._indices = new fi()), this._indices.set(t, e)) : this._indices && (this._indices.dispose(), (this._indices = null), this.clearIndices()), this._indices ? ((this._numElements = this._indices.count), this.invalidateIndices()) : (this._numElements = 0); }), (n.prototype.setCustomAttributes = function (t, e, n) { if ((void 0 === n && (n = 0), e != this._customAttributes[t])) { if (e instanceof ui) this.clearVertices(this._customAttributes[t]), (this._customAttributes[t] = e); else if (e) this._customAttributes[t] || (this._customAttributes[t] = new pi(this._concatenatedBuffer)), this._customAttributes[t].set(e, n); else if (this._customAttributes[t]) return ( this.clearVertices(this._customAttributes[t]), this._customAttributesNames.splice( this._customAttributesNames.indexOf(t), 1 ), void delete this._customAttributes[t] ); this.invalidateVertices(this._customAttributes[t]), (this._verticesDirty[this._customAttributes[t].id] = !1), -1 == this._customAttributesNames.indexOf(t) && this._customAttributesNames.push(t); } }), (n.prototype.updateScale9 = function (t, e) { throw new u("UpdateScale9 MUST be overridden by subclass"); }), (n.prototype.prepareScale9 = function (t, e, n, r, i) { throw new u("prepareScale9 MUST be overridden by subclass"); }), (n.prototype.clone = function () { throw new u(); }), (n.prototype.applyTransformation = function (t, e, n) { throw new u(); }), (n.prototype.scale = function (t, e, n) { throw new u(); }), (n.prototype.scaleUV = function (t, e, n, r) { throw new u(); }), (n.prototype.getBoxBounds = function (t, e, n, r, i, o, a, s) { throw new u(); }), (n.prototype.getSphereBounds = function (t, e, n, r, i, o, a, s) { throw new u(); }), (n.prototype.hitTestPoint = function (t, e, n, r, i, o, a, s) { throw new u(); }), (n.prototype.invalidateIndices = function () { this._invalidateIndices || (this._invalidateIndices = new Xi( Xi.INVALIDATE_INDICES, this._indices )), this.dispatchEvent(this._invalidateIndices); }), (n.prototype.clearIndices = function () { this.dispatchEvent(new Xi(Xi.CLEAR_INDICES, this._indices)); }), (n.prototype.invalidateVertices = function (t) { t && !this._verticesDirty[t.id] && ((this._verticesDirty[t.id] = !0), this._invalidateVertices[t.id] || (this._invalidateVertices[t.id] = new Xi( Xi.INVALIDATE_VERTICES, t )), this.dispatchEvent(this._invalidateVertices[t.id])); }), (n.prototype.clearVertices = function (t) { t && (t.dispose(), this.dispatchEvent(new Xi(Xi.CLEAR_VERTICES, t)), (this._verticesDirty[t.id] = null), (this._invalidateVertices[t.id] = null)); }), (n.prototype.testCollision = function (t, e, n, r, i, o, a) { throw new u(); }), n ); })(f), io = (function () { function t(t, e) { (this.id = W.ID_COUNT++), (this.renderGroup = t), (this._rendererClass = e), (this.materialClassPool = e.materialClassPool); } return ( (t.prototype.requestAbstraction = function (t) { return this._rendererClass; }), t ); })(), oo = (function (t) { function n(e, n) { var r = t.call(this) || this; return ( (r._mappers = new Array()), (r._elementsPools = {}), (r.id = W.ID_COUNT++), (r.view = e), (r.stage = e.stage), (r.pickGroup = xi.getInstance(e)), (r._rendererPool = new io(r, n)), (r._materialClassPool = r._rendererPool.materialClassPool), (r.view.backgroundColor = n.defaultBackground), (r._onSizeInvalidateDelegate = function (t) { return r.onSizeInvalidate(t); }), (r._onContextUpdateDelegate = function (t) { return r.onContextUpdate(t); }), r.stage.addEventListener( Me.CONTEXT_CREATED, r._onContextUpdateDelegate ), r.stage.addEventListener( Me.CONTEXT_RECREATED, r._onContextUpdateDelegate ), r.view.addEventListener( ue.INVALIDATE_SIZE, r._onSizeInvalidateDelegate ), r ); } return ( e(n, t), (n.getInstance = function (t, e) { return ( e.renderGroupPool[t.id] || (e.renderGroupPool[t.id] = new n(t, e)) ); }), (n.clearInstance = function (t, e) { var n = e.renderGroupPool[t.id]; n && (n.clearAll(), delete e.renderGroupPool[t.id]); }), (n.prototype.clearAll = function () { this.stage.removeEventListener( Me.CONTEXT_CREATED, this._onContextUpdateDelegate ), this.stage.removeEventListener( Me.CONTEXT_RECREATED, this._onContextUpdateDelegate ), this.view.removeEventListener( ue.INVALIDATE_SIZE, this._onSizeInvalidateDelegate ); }), (n.prototype.update = function (t) { for (var e = this._mappers.length, n = 0; n < e; n++) this._mappers[n].update(t, this); }), (n.prototype.invalidate = function () { this._invalid = !0; }), (n.prototype._addMapper = function (t) { -1 == this._mappers.indexOf(t) && this._mappers.push(t); }), (n.prototype._removeMapper = function (t) { var e = this._mappers.indexOf(t); -1 != e && this._mappers.splice(e, 1); }), (n.prototype.onSizeInvalidate = function (t) { this.dispatchEvent(t); }), (n.prototype.onContextUpdate = function (t) { this.dispatchEvent(t); }), (n.prototype.getRenderElements = function (t) { var e = this._elementsPools[t.assetType]; return ( e || (e = this._elementsPools[t.assetType] = new n._renderElementsClassPool[t.assetType]( this.stage, this._materialClassPool, this )), e ); }), (n.prototype.requestAbstraction = function (t) { return Qi; }), (n.prototype.getRenderer = function (t) { return t.getAbstraction(this._rendererPool); }), (n.registerElements = function (t, e) { n._renderElementsClassPool[e.assetType] = t; }), (n._renderElementsClassPool = {}), n ); })(h), ao = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e._faceNormalsDirty = !0), (e._faceTangentsDirty = !0), (e.hitTestCache = new Object()), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "jointsPerVertex", { get: function () { return this._jointsPerVertex; }, set: function (t) { this._jointsPerVertex != t && ((this._jointsPerVertex = t), this._jointIndices && (this._jointIndices.dimensions = this._jointsPerVertex), this._jointWeights && (this._jointWeights.dimensions = this._jointsPerVertex)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "positions", { get: function () { return ( this._positions || this.setPositions(new pi(this._concatenatedBuffer)), this._positions ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "normals", { get: function () { return ( (this._normals && !this._verticesDirty[this._normals.id]) || this.setNormals(this._normals), this._normals ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "tangents", { get: function () { return ( (this._tangents && !this._verticesDirty[this._tangents.id]) || this.setTangents(this._tangents), this._tangents ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "faceNormals", { get: function () { return ( this._faceNormalsDirty && this.updateFaceNormals(), this._faceNormals ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "faceTangents", { get: function () { return ( this._faceTangentsDirty && this.updateFaceTangents(), this._faceTangents ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "uvs", { get: function () { if (!this._uvs && n.isIE) { var t = new ui(Float32Array, 2); t.set(this._positions.get(this._positions.count)); var e = t.attributesBuffer; (this._uvs = new hi(e)), t.dispose(); } return this._uvs; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "jointIndices", { get: function () { return this._jointIndices; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "jointWeights", { get: function () { return this._jointWeights; }, enumerable: !0, configurable: !0, }), (n.prototype.prepareScale9 = function (t, e, n, r, i) { return no.prepareScale9(this, t, e, n, r, i); }), (n.prototype.updateScale9 = function (t, e) { this.scale9Indices && no.updateScale9(this, this.originalScale9Bounds, t, e, !1, !1); }), (n.prototype.getBoxBounds = function (t, e, n, r, i, o, a, s) { return ( void 0 === r && (r = null), void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = 0), void 0 === s && (s = 0), (a = a || this._numElements || this._numVertices), this._boundsRequests++, no.getBoxBounds(this.positions, this.indices, r, i, o, a, s) ); }), (n.prototype.getSphereBounds = function (t, e, n, r, i, o, a, s) { return ( void 0 === n && (n = null), void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = 0), void 0 === s && (s = 0), no.getSphereBounds( this.positions, e, n, i, o, a || this._numVertices, s ) ); }), (n.prototype.hitTestPoint = function (t, e, n, r, i, o, a, s, u, l) { return ( void 0 === a && (a = 0), void 0 === s && (s = 0), no.hitTest( n, r, 0, o, this, a || this._numElements || this._numVertices, s ) ); }), (n.prototype.setPositions = function (t, e) { void 0 === e && (e = 0), t != this._positions && (t instanceof ui ? (this.clearVertices(this._positions), (this._positions = t)) : t ? (this._positions || (this._positions = new pi(this._concatenatedBuffer)), this._positions.set(t, e)) : (this.clearVertices(this._positions), (this._positions = new pi(this._concatenatedBuffer))), (this._numVertices = this._positions.count), this._autoDeriveNormals && this.invalidateVertices(this._normals), this._autoDeriveTangents && this.invalidateVertices(this._tangents), this.invalidateVertices(this._positions), (this._verticesDirty[this._positions.id] = !1), (this._convexHull = null)); }), (n.prototype.setNormals = function (t, e) { if ((void 0 === e && (e = 0), this._autoDeriveNormals)) this._normals = Yi.generateNormals( this.indices, this.faceNormals, this._normals, this._concatenatedBuffer ); else { if (t == this._normals) return; if (t instanceof pi) this.clearVertices(this._normals), (this._normals = t); else if (t) this._normals || (this._normals = new pi(this._concatenatedBuffer)), this._normals.set(t, e); else if (this._normals) return ( this.clearVertices(this._normals), void (this._normals = null) ); } this.invalidateVertices(this._normals), (this._verticesDirty[this._normals.id] = !1); }), (n.prototype.setTangents = function (t, e) { if ((void 0 === e && (e = 0), this._autoDeriveTangents)) this._tangents = Yi.generateTangents( this.indices, this.faceTangents, this.faceNormals, this._tangents, this._concatenatedBuffer ); else { if (t == this._tangents) return; if (t instanceof pi) this.clearVertices(this._tangents), (this._tangents = t); else if (t) this._tangents || (this._tangents = new pi(this._concatenatedBuffer)), this._tangents.set(t, e); else if (this._tangents) return ( this.clearVertices(this._tangents), void (this._tangents = null) ); } this.invalidateVertices(this._tangents), (this._verticesDirty[this._tangents.id] = !1); }), (n.prototype.setUVs = function (t, e) { if ((void 0 === e && (e = 0), t != this._uvs)) { if (t instanceof ui) this.clearVertices(this._uvs), (this._uvs = t); else if (t) this._uvs || (this._uvs = new hi(this._concatenatedBuffer)), this._uvs.set(t, e); else if (this._uvs) return this.clearVertices(this._uvs), void (this._uvs = null); this.invalidateVertices(this._uvs), (this._verticesDirty[this._uvs.id] = !1); } }), (n.prototype.setJointIndices = function (t, e) { if ((void 0 === e && (e = 0), t != this._jointIndices)) { if (t instanceof ui) this.clearVertices(this._jointIndices), (this._jointIndices = t); else if (t) { if ( (this._jointIndices || (this._jointIndices = new ui( Float32Array, this._jointsPerVertex, this._concatenatedBuffer )), this._useCondensedIndices) ) { var n = 0, r = void 0, i = 0, o = new Object(); for (this._condensedIndexLookUp = new Array(); n < t.length; ) null == o[(r = t[n])] && ((o[r] = i), (this._condensedIndexLookUp[i++] = r)), (t[n++] = o[r]); } this._jointIndices.set(t, e); } else if (this._jointIndices) return ( this.clearVertices(this._jointIndices), void (this._jointIndices = null) ); this.invalidateVertices(this._jointIndices), (this._verticesDirty[this._jointIndices.id] = !1); } }), (n.prototype.setJointWeights = function (t, e) { if ((void 0 === e && (e = 0), t != this._jointWeights)) { if (t instanceof ui) this.clearVertices(this._jointWeights), (this._jointWeights = t); else if (t) this._jointWeights || (this._jointWeights = new ui( Float32Array, this._jointsPerVertex, this._concatenatedBuffer )), this._jointWeights.set(t, e); else if (this._jointWeights) return ( this.clearVertices(this._jointWeights), void (this._jointWeights = null) ); this.invalidateVertices(this._jointWeights), (this._verticesDirty[this._jointWeights.id] = !1); } }), (n.prototype.dispose = function () { t.prototype.dispose.call(this), this._positions && (this._positions.dispose(), (this._positions = null)), this._normals && (this._normals.dispose(), (this._normals = null)), this._tangents && (this._tangents.dispose(), (this._tangents = null)), this._uvs && (this._uvs.dispose(), (this._uvs = null)), this._jointIndices && (this._jointIndices.dispose(), (this._jointIndices = null)), this._jointWeights && (this._jointWeights.dispose(), (this._jointWeights = null)), this._faceNormals && (this._faceNormals.dispose(), (this._faceNormals = null)), this._faceTangents && (this._faceTangents.dispose(), (this._faceTangents = null)); }), (n.prototype.setIndices = function (e, n) { void 0 === n && (n = 0), t.prototype.setIndices.call(this, e, n), (this._faceNormalsDirty = !0), (this._faceTangentsDirty = !0), this._autoDeriveNormals && this.invalidateVertices(this._normals), this._autoDeriveTangents && this.invalidateVertices(this._tangents); }), (n.prototype.copyTo = function (e) { t.prototype.copyTo.call(this, e); var n = this._autoDeriveNormals, r = this._autoDeriveTangents; (e.autoDeriveNormals = this._autoDeriveNormals = !1), (e.autoDeriveTangents = this._autoDeriveTangents = !1), e.setPositions(this.positions.clone()), this.normals && e.setNormals(this.normals.clone()), this.tangents && e.setTangents(this.tangents.clone()), this.uvs && e.setUVs(this.uvs.clone()), (e.jointsPerVertex = this._jointsPerVertex), this.jointIndices && e.setJointIndices(this.jointIndices.clone()), this.jointWeights && e.setJointWeights(this.jointWeights.clone()), (e.autoDeriveNormals = this._autoDeriveNormals = n), (e.autoDeriveTangents = this._autoDeriveTangents = r), this.scale9Indices && ((e.originalScale9Bounds = this.originalScale9Bounds), (e.scale9Grid = this.scale9Grid), (e.scale9Indices = this.scale9Indices), (e.initialScale9Positions = this.initialScale9Positions)); }), (n.prototype.clone = function () { var t = new n( this._concatenatedBuffer ? this._concatenatedBuffer.clone() : null ); return this.copyTo(t), t; }), (n.prototype.scaleUV = function (t, e, n, r) { void 0 === t && (t = 1), void 0 === e && (e = 1), void 0 === n && (n = 0), void 0 === r && (r = 0), this.uvs && Yi.scale(t, e, 0, this.uvs, n || this._numVertices, r); }), (n.prototype.scale = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = 0), Yi.scale(t, t, t, this.positions, e || this._numVertices, n); }), (n.prototype.applyTransformation = function (t, e, n) { void 0 === e && (e = 0), void 0 === n && (n = 0), Yi.applyTransformation( t, this.positions, this.normals, this.tangents, e || this._numVertices, n ); }), (n.prototype.updateFaceTangents = function () { (this._faceTangents = Yi.generateFaceTangents( this.indices, this.positions, this.uvs || this.positions, this._faceTangents, this.numElements )), (this._faceTangentsDirty = !1); }), (n.prototype.updateFaceNormals = function () { (this._faceNormals = Yi.generateFaceNormals( this.indices, this.positions, this._faceNormals, this.numElements )), (this._faceNormalsDirty = !1); }), (n.prototype.testCollision = function (t, e, n, r, i, o, a) { void 0 === a && (a = 0); var s, u, l, c, h, p, d, f, g, _, m, y, A, v, b, C, I, E, x, w, S, D, T, O, M, L, N, R, F, k, U, j, V, Q, G, z, H = e.rayPosition, X = e.rayDirection, Y = -1, q = i.bothSides, K = this.positions.get(o, a), W = this.positions.dimensions, J = this.positions.stride; this.indices && (o = (z = this.indices.get(this.numElements)).length); for (var $ = 0; $ < o; $ += 3) if ( (z ? ((u = z[$] * J), (l = z[$ + 1] * J), (c = z[$ + 2] * J)) : ((u = $ * J), (l = ($ + 1) * J), (c = ($ + 2) * J)), (E = K[u]), (D = K[l] - E), (M = K[c] - E), (x = K[u + 1]), (T = K[l + 1] - x), (L = K[c + 1] - x), 3 == W ? ((w = K[u + 2]), (S = K[l + 2]), (f = T * (N = K[c + 2] - w) - (O = S - w) * L), (g = O * M - D * N), (_ = D * L - T * M), (f *= R = 1 / Math.sqrt(f * f + g * g + _ * _)), (g *= R), (_ *= R)) : ((w = 0), (S = 0), (O = 0), (N = 0), (f = 0), (g = 0), (_ = D * L - T * M > 0 ? 1 : -1)), (F = f * X.x + g * +X.y + _ * X.z), (!q && F < 0) || (q && 0 != F)) ) { if ( ((k = -(f * E + g * x + _ * w)), (s = -(f * H.x + g * H.y + _ * H.z + k) / F), (Q = (h = (m = H.x + s * X.x) - E) * D + (p = (y = H.y + s * X.y) - x) * T + (d = (A = H.z + s * X.z) - w) * O), (G = h * M + p * L + d * N), (v = 1 / ((j = D * D + T * T + O * O) * (V = M * M + L * L + N * N) - (U = D * M + T * L + O * N) * U)), !isFinite(v)) ) continue; if (((I = v * (-U * Q + j * G)), (C = v * (V * Q - U * G)) < 0)) continue; if (I < 0) continue; if (!((b = 1 - C - I) < 0) && s > 0 && s < e.rayEntryDistance) { if ( ((Y = $ / 3), (e.rayEntryDistance = s), (e.position = e.position || new B()), e.position.setTo(m, y, A), (e.normal = e.normal || new B()), e.normal.setTo(f, g, _), this.uvs) ) { var Z = this.uvs.get(this.numVertices), tt = this.uvs.stride, et = z ? z[$] * tt : $ * tt, nt = new B(Z[et], Z[et + 1]); et = z ? z[$ + 1] * tt : ($ + 1) * tt; var rt = new B(Z[et], Z[et + 1]); et = z ? z[$ + 2] * tt : ($ + 2) * tt; var it = new B(Z[et], Z[et + 1]); e.uv = new P( b * nt.x + C * rt.x + I * it.x, b * nt.y + C * rt.y + I * it.y ); } if (((e.elementIndex = Y), !r)) return !0; } } return Y >= 0; }), (n.isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g)), (n.assetType = "[asset TriangleElements]"), n ); })(ro), so = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._vaoIsInvalid = !0), (r._triangleElements = e), !r._triangleElements.isDynamic && ki && n.context.hasVao && (r._vao = n.context.createVao()), r ); } return ( e(n, t), (n.prototype._onInvalidateIndices = function (e) { t.prototype._onInvalidateIndices.call(this, e), (this._vaoIsInvalid = !0); }), (n.prototype._onInvalidateVertices = function (e) { t.prototype._onInvalidateVertices.call(this, e), (this._vaoIsInvalid = !0); }), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), (this._vaoIsInvalid = !0); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._triangleElements = null), (this._vaoIsInvalid = !0), this._vao && (this._vao.dispose(), (this._vao = null)); }), (n.prototype._setRenderState = function (e, n) { this._vao && this._vao.bind(), t.prototype._setRenderState.call(this, e, n), (this._vao && !this._vaoIsInvalid) || (n.normalIndex >= 0 && this._triangleElements.autoDeriveNormals && this._triangleElements.normals, n.tangentIndex >= 0 && this._triangleElements.autoDeriveTangents && this._triangleElements.tangents, n.curvesIndex >= 0 && this.activateVertexBufferVO( n.curvesIndex, this._triangleElements.getCustomAtributes("curves") ), n.uvIndex >= 0 && this.activateVertexBufferVO( n.uvIndex, this._triangleElements.uvs || this._triangleElements.positions ), n.secondaryUVIndex >= 0 && this.activateVertexBufferVO( n.secondaryUVIndex, this._triangleElements.getCustomAtributes("secondaryUVs") || this._triangleElements.uvs || this._triangleElements.positions ), n.normalIndex >= 0 && this.activateVertexBufferVO( n.normalIndex, this._triangleElements.normals ), n.tangentIndex >= 0 && this.activateVertexBufferVO( n.tangentIndex, this._triangleElements.tangents ), n.jointIndexIndex >= 0 && this.activateVertexBufferVO( n.jointIndexIndex, this._triangleElements.jointIndices ), n.jointWeightIndex >= 0 && this.activateVertexBufferVO( n.jointIndexIndex, this._triangleElements.jointWeights ), this.activateVertexBufferVO(0, this._triangleElements.positions), (this._vaoIsInvalid = !1)); }), (n.prototype.draw = function (t, e, n, r) { var i = e.supportModernAPI; if (e.sceneMatrixIndex >= 0) e.sceneMatrix.copyFrom(t.renderSceneTransform, !0), e.viewMatrix.copyFrom(e.view.viewMatrix3D, !0); else { var o = F.CALCULATION_MATRIX; o.copyFrom(t.renderSceneTransform), o.append(e.view.viewMatrix3D), e.viewMatrix.copyFrom(o, !0); } if (i) e.syncUniforms(); else { var a = this._stage.context; a.setProgramConstantsFromArray(te.VERTEX, e.vertexConstantData), a.setProgramConstantsFromArray( te.FRAGMENT, e.fragmentConstantData ); } this._indices ? this.getIndexBufferGL().draw( Jt.TRIANGLES, 3 * r, 3 * n || this.numIndices ) : this._stage.context.drawVertices( Jt.TRIANGLES, r, n || this.numVertices ), this._vao && this._vao.unbind(); }), (n.prototype._pGetOverflowElements = function () { return new n(this._triangleElements, this._stage); }), n ); })(qi), uo = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._includeDependencies = function (t) {}), (n.prototype._getVertexCode = function (t, e, n) { var r = "", i = t.globalPosDependencies > 0 ? n.globalPositionVertex : n.animatedPosition, o = e.getFreeVertexConstant(); if ( (e.getFreeVertexConstant(), e.getFreeVertexConstant(), e.getFreeVertexConstant(), (t.viewMatrixIndex = 4 * o.index), t.projectionDependencies > 0) ) { n.projectionFragment = e.getFreeVarying(); var a = e.getFreeVertexVectorTemp(); r += "m44 " + a + ", " + i + ", " + o + "\nmov " + n.projectionFragment + ", " + a + "\nmov op, " + a + "\n"; } else r += "m44 op, " + i + ", " + o + "\n"; return r; }), (n.prototype._getFragmentCode = function (t, e, n) { return ""; }), n ); })(Ni); oo.registerElements(uo, ao), Jr.registerAbstraction(so, ao); var lo = (function () { function t() {} return ( (t.prototype.sortBlendedRenderables = function (t) { var e, n, r, i, o, a; if (!t || !t.next) return t; for (r = t, n = t.next; n; ) (n = n.next) && ((r = r.next), (n = n.next)); if ( ((e = r.next), (r.next = null), (t = this.sortBlendedRenderables(t)), (e = this.sortBlendedRenderables(e)), !t) ) return e; if (!e) return t; for (; t && e; ) t.zIndex < e.zIndex ? ((a = t), (t = t.next)) : ((a = e), (e = e.next)), i ? (o.next = a) : (i = a), (o = a); return t ? (o.next = t) : e && (o.next = e), i; }), (t.prototype.sortOpaqueRenderables = function (t) { var e, n, r, i, o, a; if (!t || !t.next) return t; for (r = t, n = t.next; n; ) (n = n.next) && ((r = r.next), (n = n.next)); (e = r.next), (r.next = null), (t = this.sortOpaqueRenderables(t)), (e = this.sortOpaqueRenderables(e)); var s = 0; if (!t) return e; if (!e) return t; for (; t && e && null != t && null != e; ) { var u = t.renderOrderId, l = e.renderOrderId; if (u == l) { var c = t.materialID, h = e.materialID; s = c == h ? (t.zIndex < e.zIndex ? 1 : -1) : c > h ? 1 : -1; } else s = u > l ? 1 : -1; s < 0 ? ((a = t), (t = t.next)) : ((a = e), (e = e.next)), i ? ((o.next = a), (o = a)) : ((i = a), (o = a)); } return t ? (o.next = t) : e && (o.next = e), i; }), t ); })(), co = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._cameraForward = new B()), (r._depthTextureDirty = !0), (r._depthPrepass = !1), (r._pNumElements = 0), (r._disableColor = !1), (r._disableClear = !1), (r._renderBlended = !0), (r._numCullPlanes = 0), (r._partition = e), (r._maskId = e.rootNode.getMaskId()), (r._onSizeInvalidateDelegate = function (t) { return r.onSizeInvalidate(t); }), (r._onContextUpdateDelegate = function (t) { return r.onContextUpdate(t); }), (r.renderableSorter = new lo()), (r._renderGroup = n.renderGroup), r._renderGroup.addEventListener( Me.CONTEXT_CREATED, r._onContextUpdateDelegate ), r._renderGroup.addEventListener( Me.CONTEXT_RECREATED, r._onContextUpdateDelegate ), r._renderGroup.addEventListener( ue.INVALIDATE_SIZE, r._onSizeInvalidateDelegate ), (r._view = r._renderGroup.view), (r._stage = r._renderGroup.stage), r._stage.context && (r._context = r._stage.context), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "partition", { get: function () { return this._partition; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "cullPlanes", { get: function () { return this._customCullPlanes; }, set: function (t) { this._customCullPlanes = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "renderBlended", { get: function () { return this._renderBlended; }, set: function (t) { this._renderBlended = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "disableColor", { get: function () { return this._disableColor; }, set: function (t) { this._disableColor != t && ((this._disableColor = t), (this._invalid = !0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "disableClear", { get: function () { return this._disableClear; }, set: function (t) { this._disableClear != t && ((this._disableClear = t), (this._invalid = !0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numElements", { get: function () { return this._pNumElements; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "context", { get: function () { return this._context; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "stage", { get: function () { return this._stage; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "view", { get: function () { return this._view; }, enumerable: !0, configurable: !0, }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._renderGroup.removeEventListener( Me.CONTEXT_CREATED, this._onContextUpdateDelegate ), this._renderGroup.removeEventListener( Me.CONTEXT_RECREATED, this._onContextUpdateDelegate ), this._renderGroup.removeEventListener( ue.INVALIDATE_SIZE, this._onSizeInvalidateDelegate ), (this._onContextUpdateDelegate = null), (this._onSizeInvalidateDelegate = null), (this._view = null), (this._stage = null), (this._context = null); }), (n.prototype.render = function (t, e, n, r) { void 0 === t && (t = !0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), (this._enableDepthAndStencil = t), (this._surfaceSelector = e), (this._mipmapSelector = n), (this._maskConfig = r), this._maskConfig && ((this._disableClear = !0), (this._disableColor = !0)), this._renderGroup.update(this._partition), this._view.target && this._view.target.invalidateMipmaps(), this._view.clear( !this._depthPrepass && !this._disableClear, t, e, n, !this._view.shareContext || this._view.target ? Kt.ALL : Kt.DEPTH ), this._context.setBlendFactors(Yt.ONE, Yt.ZERO), this._context.setDepthTest(!0, Wt.LESS_EQUAL), this.executeRender(t, e, n), (this._view.shareContext && !this._view.target) || (this._snapshotRequired && this._snapshotBitmapImage2D && (this._context.drawToBitmapImage2D(this._snapshotBitmapImage2D), (this._snapshotRequired = !1))); }), (n.prototype.traverse = function () { (this._pBlendedRenderableHead = null), (this._pOpaqueRenderableHead = null), (this._pNumElements = 0), (this._activeMaskOwners = null), (this._cameraTransform = this._view.projection.transform.matrix3D), (this._cameraForward = this._view.projection.transform.forwardVector), (this._cullPlanes = this._customCullPlanes ? this._customCullPlanes : this._view.projection.viewFrustumPlanes), (this._numCullPlanes = this._cullPlanes ? this._cullPlanes.length : 0), n._collectionMark++, this._partition.traverse(this), this.renderableSorter && ((this._pOpaqueRenderableHead = this.renderableSorter.sortOpaqueRenderables( this._pOpaqueRenderableHead )), (this._pBlendedRenderableHead = this.renderableSorter.sortBlendedRenderables( this._pBlendedRenderableHead ))), (this._invalid = !1); }), (n.prototype._iRenderCascades = function (t, e, n, r) {}), (n.prototype.executeRender = function (t, e, n) { this.traverse(), this._disableColor ? this._context.setColorMask(!1, !1, !1, !1) : this._context.setColorMask(!0, !0, !0, !0), this._maskConfig ? this._context.enableStencil() : this._context.disableStencil(), this.drawRenderables(this._pOpaqueRenderableHead), this._renderBlended && this.drawRenderables(this._pBlendedRenderableHead); }), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), this._renderGroup.invalidate(); }), (n.prototype.queueSnapshot = function (t) { (this._snapshotRequired = !0), (this._snapshotBitmapImage2D = t); }), (n.prototype.drawRenderables = function (t) { for (var e, n, r, i; t; ) { for ( i = (r = t.renderMaterial) ? r.numPasses : 1, (this._activeMasksDirty || this._checkMaskOwners(t.maskOwners)) && ((this._activeMaskOwners = t.maskOwners) ? this._renderMasks(this._activeMaskOwners) : this._maskConfig || this._context.disableStencil(), (this._activeMasksDirty = !1)), e = 0; e < i; e++ ) { r && r.activatePass(e), (n = t); do { n.executeRender( this._enableDepthAndStencil, this._surfaceSelector, this._mipmapSelector, this._maskConfig ), (n = n.next); } while ( n && n.renderMaterial == r && !(this._activeMasksDirty = this._checkMaskOwners(n.maskOwners)) ); r && r.deactivatePass(); } t = n; } }), (n.prototype.onContextUpdate = function (t) { this._context = this._stage.context; }), (n.prototype.onSizeInvalidate = function (t) { this._pRttBufferManager && ((this._pRttBufferManager.viewWidth = this._view.width), (this._pRttBufferManager.viewHeight = this._view.height)), (this._depthTextureDirty = !0); }), (n.prototype.enterNode = function (t) { var e = this._maskConfig || t.isInFrustum( this._partition.rootNode, this._cullPlanes, this._numCullPlanes, this._renderGroup.pickGroup ), r = t._collectionMark != n._collectionMark && t.isRenderable() && e && t.getMaskId() == this._maskId; return (t._collectionMark = n._collectionMark), r; }), (n.prototype.getTraverser = function (t) { if (t.rootNode.renderToImage) { var e = t.getLocalNode(), n = oo.getInstance( t.getLocalView(this._stage), this._traverserClass ); if ( !n.pickGroup.getBoundsPicker(e.partition).getBoxBounds(e, !0, !0) ) return this; var r = n.getRenderer(e.partition); return ( (r.rootView = this._view), (r.renderableSorter = null), (this._renderEntity = r), (this._zIndex = this._cameraTransform.position .subtract(t.rootNode.getPosition()) .dotProduct(this._cameraForward) + t.rootNode.container.zOffset), (this._renderSceneTransform = t.rootNode.getRenderMatrix3D( this._cameraTransform )), (this._entityMaskId = t.rootNode.getMaskId()), (this._entityMaskOwners = t.rootNode.getMaskOwners()), this.applyTraversable(r), r ); } return this; }), (n.prototype.applyEntity = function (t) { (this._renderEntity = t.getAbstraction(this._renderGroup)), (this._zIndex = this._cameraTransform.position .subtract(t.parent.getPosition()) .dotProduct(this._cameraForward) + t.entity.zOffset), (this._renderSceneTransform = t.parent.getRenderMatrix3D( this._cameraTransform )), (this._entityMaskId = t.parent.getMaskId()), (this._entityMaskOwners = t.parent.getMaskOwners()), t.entity._acceptTraverser(this); }), (n.prototype.applyTraversable = function (t) { var e = t.getAbstraction(this._renderEntity); (e.renderGroup = this._renderGroup), (e.cascaded = !1), (e.zIndex = this._zIndex), (e.maskId = this._entityMaskId), (e.maskOwners = this._entityMaskOwners), (e.renderSceneTransform = this._renderSceneTransform); var n = e.renderMaterial; (e.materialID = n.materialID), (e.renderOrderId = n.renderOrderId), n.requiresBlending ? ((e.next = this._pBlendedRenderableHead), (this._pBlendedRenderableHead = e)) : ((e.next = this._pOpaqueRenderableHead), (this._pOpaqueRenderableHead = e)), (this._pNumElements += e.stageElements.elements.numElements); }), (n.prototype._renderMasks = function (t) { var e = Math.log2(this._maskConfig) >> 1, n = this._maskConfig ? Math.pow(2, (e + 1) << 1) : 1, r = n; if (r > 255) console.warn("[RenderBase] Mask bit overflow, maskConfig %d", r); else { this._context.enableStencil(); for (var i, o, a, s = t.length, u = !0, l = 0; l < s; ++l) if ((o = (i = t[l].getMasks()).length)) { this._context.setStencilActions( ie.FRONT_AND_BACK, u ? Wt.ALWAYS : Wt.EQUAL, ee.SET, ee.SET, ee.KEEP ), (u = !1), this._context.setStencilReferenceValue( 255, r, (r = (r & n) + n) ), this._context.clear(0, 0, 0, 0, 0, 0, Kt.STENCIL); for (var c = 0; c < o; ++c) (a = i[c]) && this._renderGroup .getRenderer(a.partition) .render(!0, 0, 0, r); } u || this._context.setStencilActions( ie.FRONT_AND_BACK, Wt.EQUAL, ee.SET, ee.SET, ee.KEEP ), this._context.setStencilReferenceValue(255, r, this._maskConfig), this._disableColor || this._context.setColorMask(!0, !0, !0, !0); } }), (n.prototype._checkMaskOwners = function (t) { if (null == this._activeMaskOwners || null == t) return Boolean(this._activeMaskOwners != t); if (this._activeMaskOwners.length != t.length) return !0; for (var e, n, r, i = t.length, o = 0; o < i; o++) { if ( ((e = (n = t[o].getMasks()).length), (r = this._activeMaskOwners[o].getMasks()).length != e) ) return !0; for (var a = 0; a < e; a++) if (r[a] != n[a]) return !0; } return !1; }), (n._collectionMark = 0), n ); })(W), ho = (function (t) { function n() { var e = t.call(this) || this; return ( (e._numImages = 0), (e._images = new Array()), (e._samplers = new Array()), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "mappingMode", { get: function () { return this._mappingMode; }, set: function (t) { this._mappingMode != t && (this._mappingMode = t); }, enumerable: !0, configurable: !0, }), (n.prototype.getNumImages = function () { return this._numImages; }), (n.prototype.setNumImages = function (t) { this._numImages != t && ((this._numImages = t), (this._images.length = t), (this._samplers.length = t), this.invalidate()); }), (n.prototype.getImageAt = function (t) { return this._images[t]; }), (n.prototype.setImageAt = function (t, e) { (this._images[e] = t), this.invalidate(); }), (n.prototype.getSamplerAt = function (t) { return this._samplers[t]; }), (n.prototype.setSamplerAt = function (t, e) { (this._samplers[e] = t), this.invalidate(); }), n ); })(f), po = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return (n._mappingMode = e || Ti.LINEAR), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture Texture2D]"), n ); })(ho), fo = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture TextureCube]"), n ); })(ho), go = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return n.setNumImages(1), (n.image = e), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "sampler", { get: function () { return this._samplers[0]; }, set: function (t) { this._samplers[0] != t && this.setSamplerAt(t, 0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "image", { get: function () { return this._images[0]; }, set: function (t) { this._images[0] != t && this.setImageAt(t, 0); }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture ImageTextureCube]"), n ); })(fo), _o = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getFragmentCode = function (t, e, n, r) { this._imageIndex = this._shader.renderMaterial.getImageIndex( this._texture, 0 ); var i = this.getTextureReg(this._imageIndex, e, n); return ( (this._textureIndex = i.index), "tex " + t + ", " + r + ", " + i + " <" + this._shader.renderMaterial.images[this._imageIndex].getType() + ",linear,miplinear,wrap>\n" ); }), (n.prototype.activate = function () { var t = this._shader.renderMaterial.samplers[this._imageIndex]; this._shader.renderMaterial.images[this._imageIndex].activate( this._textureIndex, t ); }), (n.prototype._setRenderState = function (t) { var e = t.samplers[this._imageIndex], n = t.images[this._imageIndex]; n && e && n.activate(this._textureIndex, e); }), n ); })(Hi); Pi.registerAbstraction(_o, go); var mo = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this, n) || this; return r.setNumImages(1), (r.image = e), r; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "sampler", { get: function () { return this._samplers[0]; }, set: function (t) { this._samplers[0] != t && this.setSamplerAt(t, 0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "image", { get: function () { return this._images[0]; }, set: function (t) { if (this._images[0] != t) { if (!Ne.isImage2DValid(t)) throw new s( "Invalid imageData: Width and height must be power of 2 and cannot exceed 2048" ); this.setImageAt(t, 0); } }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture ImageTexture2D]"), n ); })(po), yo = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getFragmentCode = function (e, n, r, i) { var o, a = ""; if ( (this._texture.mappingMode == Ti.RADIAL && ((a += "mul " + (o = n.getFreeFragmentVectorTemp()) + ".xy, " + i + ", " + i + "\n"), (a += "add " + o + ".x, " + o + ".x, " + o + ".y\n"), (a += "sub " + o + ".y, " + o + ".y, " + o + ".y\n"), (a += "sqt " + o + ".x, " + o + ".x, " + o + ".x\n"), (i = o)), this._shader.useImageRect) ) { var s = n.getFreeFragmentConstant(); (this._samplerIndex = 4 * s.index), (a += "mul " + (o = n.getFreeFragmentVectorTemp()) + ", " + i + ", " + s + ".xy\n"), (a += "add " + o + ", " + o + ", " + s + ".zw\n"), (i = o); } if ( ((a += t.prototype._getFragmentCode.call(this, e, n, r, i)), this._shader.usesPremultipliedAlpha) ) { var u = n.getFreeFragmentSingleTemp(); (a += "sge " + u + " #native vec4(0.0) native#, " + e + ".w \n"), (a += "add " + u + ", " + u + "," + e + ".w \n"), (a += "div " + e + ".xyz, " + e + ", " + u + "\n"); } return a; }), (n.prototype.activate = function () { t.prototype.activate.call(this); var e = this._shader.renderMaterial.samplers[this._imageIndex]; if (this._shader.useImageRect) { var n = this._samplerIndex, r = this._shader.fragmentConstantData; e.imageRect ? ((r[n] = e.imageRect.width), (r[n + 1] = e.imageRect.height), (r[n + 2] = e.imageRect.x), (r[n + 3] = e.imageRect.y)) : ((r[n] = 1), (r[n + 1] = 1), (r[n + 2] = 0), (r[n + 3] = 0)); } }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e); var n = e.samplers[this._imageIndex]; if (this._shader.useImageRect && n) { var r = this._samplerIndex, i = this._shader.fragmentConstantData; n.imageRect ? ((i[r] = n.imageRect.width), (i[r + 1] = n.imageRect.height), (i[r + 2] = n.imageRect.x), (i[r + 3] = n.imageRect.y)) : ((i[r] = 1), (i[r + 1] = 1), (i[r + 2] = 0), (i[r + 3] = 0)); } }), n ); })(_o); Pi.registerAbstraction(yo, mo); var Ao = (function (t) { function n(e, r) { var i = t.call(this, e, r) || this; return ( (i._renderMatrix = new F()), (i._bounds = new M()), (i._paddedBounds = new K()), (i._boundsScale = 1), (i._textures = new Array()), (i._blendMode = dn.NORMAL), (i.animateUVs = !1), (i.bothSides = !1), (i.curves = !1), (i.imageRect = !1), (i.useColorTransform = !0), (i.alphaThreshold = 0), (i._lockBlendMode = !1), (i.node = e.rootNode), (i._onTextureInvalidate = function (t) { return i.invalidate(); }), (i._onInvalidateProperties = function (t) { return i._invalidateStyle(); }), (i._onInvalidateParentNode = function (t) { return i.onInvalidate(null); }), (i._onInvalidateColorTransform = function (t) { i.onInvalidate(null); }), e.parent && ((i._parentNode = e.parent.rootNode), i._parentNode.addEventListener( kt.INVALIDATE_MATRIX3D, i._onInvalidateParentNode ), i._parentNode.addEventListener( kt.INVALIDATE_COLOR_TRANSFORM, i._onInvalidateColorTransform )), i.node.container.addEventListener( Ri.INVALIDATE_STYLE, i._onInvalidateParentNode ), i.node.container.addEventListener( kt.INVALIDATE_COLOR_TRANSFORM, i._onInvalidateColorTransform ), (i.style = new zi()), (i.texture = new mo()), (i._boundsPicker = i._renderGroup.pickGroup.getBoundsPicker( i._partition )), (i._boundsDirty = !0), (i._traverserClass = n), i ); } return ( e(n, t), (n.isValidForCache = function (t) {}), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.getPaddedBounds = function () { return this._boundsDirty && this._updateBounds(), this._paddedBounds; }), (n.prototype.getBounds = function () { return this._boundsDirty && this._updateBounds(), this._bounds; }), Object.defineProperty(n.prototype, "blendMode", { get: function () { if (this._lockBlendMode) return dn.LAYER; var t = this.node.container.blendMode; switch (t) { case dn.LAYER: case dn.MULTIPLY: case dn.NORMAL: case dn.ADD: case dn.SCREEN: case dn.ALPHA: case dn.SUBTRACT: return t; } return dn.LAYER; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "style", { get: function () { return this._boundsDirty && this._updateBounds(), this._style; }, set: function (t) { this._style != t && (this._style && this._style.removeEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidateProperties ), (this._style = t), this._style && this._style.addEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidateProperties ), this._invalidateStyle()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.removeTexture(this._texture), (this._texture = t), this._texture && this.addTexture(this._texture), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), (n.prototype.render = function (e, n, r, i) { var o = this; void 0 === e && (e = !0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0); var a, s = this._stage, u = this._style.image; if (!u) return t.prototype.render.call(this, e, n, r, i); this._stage.pushRenderTargetConfig(), 2 === s.context.glVersion && De.ENABLE_MULTISAMPLE_TEXTURE && (a = s.filterManager.popTemp(u.width, u.height, !0)), (this._lockBlendMode = !0), (this.node.colorTransformDisabled = !1), this._initRender(a || u), t.prototype.render.call(this, e, n, r, i), (this.node.colorTransformDisabled = this.node.transformDisabled), (this._lockBlendMode = !1); var l = this.node.container.filters; l && l.length > 0 ? (l.forEach(function (t) { return t && (t.imageScale = o._boundsScale); }), s.filterManager.applyFilters(a || u, u, u.rect, u.rect, l)) : a && s.filterManager.copyPixels(a, u, u.rect, u.rect.topLeft, !1), a && s.filterManager.pushTemp(a), this._stage.popRenderTarget(); }), (n.prototype.preActivateRenderPass = function () {}), (n.prototype.getNumTextures = function () { return this._textures.length; }), (n.prototype.getTextureAt = function (t) { return this._textures[t]; }), (n.prototype.addTexture = function (t) { this._textures.push(t), t.addEventListener(c.INVALIDATE, this._onTextureInvalidate), this.invalidate(); }), (n.prototype.removeTexture = function (t) { this._textures.splice(this._textures.indexOf(t), 1), t.removeEventListener(c.INVALIDATE, this._onTextureInvalidate), this.invalidate(); }), (n.prototype.requestAbstraction = function (t) { return vo; }), (n.prototype.invalidatePasses = function () { this.dispatchEvent(new Bi(Bi.INVALIDATE_PASSES, this)); }), (n.prototype.enterNode = function (e) { var n = t.prototype.enterNode.call(this, e); return ( n && e.boundsVisible && this.applyEntity( e.getBoundsPrimitive(this._renderGroup.pickGroup) ), n ); }), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), this.dispatchEvent(new Ri(Ri.INVALIDATE_ELEMENTS, this)), this.dispatchEvent(new Ri(Ri.INVALIDATE_STYLE, this)), this.invalidate(), this.invalidatePasses(), (this._boundsDirty = !0); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this.texture.clear(), (this.texture = null), this.style.image.clear(), (this.style.image = null); }), (n.prototype._invalidateStyle = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_STYLE, this)); }), (n.prototype._updateBounds = function () { this._boundsDirty = !1; var t = this._renderMatrix, e = this.node.container, n = this._paddedBounds, r = this.rootView, i = r ? Math.min(3, r.projection.scale) : 1; (this._boundsScale = i), this._parentNode ? t.copyFrom(this._parentNode.getMatrix3D()) : t.identity(), 1 !== i && t.appendScale(i, i, i); var o = this._boundsPicker.getBoxBounds(this.node, !0, !0); o ? (this._bounds.copyFrom(o), t.transformBox(this._bounds, this._bounds), t.invert(), n.setTo( this._bounds.x, this._bounds.y, this._bounds.width, this._bounds.height ), e.filters && e.filters.length > 0 && (e.filters.forEach(function (t) { return t && (t.imageScale = i); }), this._stage.filterManager.computeFiltersPadding( n, e.filters, n )), (n.x = (n.x - 2) | 0), (n.y = (n.y - 2) | 0), (n.width = (n.width + 4) | 0), (n.height = (n.height + 4) | 0), this._style.image ? this._style.image._setSize(n.width, n.height) : ((this._style.image = new ke(n.width, n.height, !1)), (this._style.sampler = new Le(!1, Ui, !1)))) : console.error( "[CachedRenderer] Bounds invalid, supress calculation", this.node ); }), (n.prototype._initRender = function (t) { var e = this._paddedBounds, n = this._boundsScale, r = this._renderMatrix, i = e.x - this._bounds.x, o = e.y - this._bounds.y, a = this._view, s = a.projection; (r._rawData[14] = -1e3), (s.far = 4e3), (s.near = 1), (s.transform.matrix3D = r), (s.ratio = t.width / t.height), (s.originX = -1 - (2 * (e.x - 0.5 * i)) / t.width), (s.originY = -1 - (2 * (e.y - 0.5 * o)) / t.height), (s.scale = (1e3 * n) / t.height), (a.target = t); }), (n.registerMaterial = function (t, e) { n.materialClassPool[e.assetType] = t; }), (n.assetType = "[renderer CacheRenderer]"), (n.materialClassPool = {}), (n.renderGroupPool = {}), (n.defaultBackground = 0), n ); })(co), vo = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getStageElements = function () { var t = this._asset, e = t.getPaddedBounds(), n = t.getBounds(), r = e.x - n.x, i = e.y - n.y, o = F.CALCULATION_MATRIX; o.copyFrom(this.renderSceneTransform), o.appendScale(t._boundsScale, t._boundsScale, t._boundsScale), o.appendTranslation(0.5 * r, 0.5 * i, 0), o.invert(); var a = [ e.left, e.top, 0, e.right, e.bottom, 0, e.right, e.top, 0, e.left, e.top, 0, e.left, e.bottom, 0, e.right, e.bottom, 0, ]; o.transformVectors(a, a); var s = this._elements; return ( s ? s.setPositions(a) : ((s = this._elements = new ao(new oi(5, 6))).setPositions(a), s.setUVs([0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1])), s.getAbstraction(this._stage) ); }), (n.prototype.executeRender = function (e, n, r, i) { void 0 === e && (e = !0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), this._stage.context.setCulling(ie.NONE), t.prototype.executeRender.call(this, e, n, r, i); }), (n.prototype._getRenderMaterial = function () { return this._asset.getAbstraction( this.renderGroup.getRenderElements(this.stageElements.elements) ); }), (n.prototype._getStyle = function () { return this._asset.style; }), (n.assetType = "[render Renderer]"), n ); })(Vi); Ao.registerMaterial(Wi, Ao); var bo = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype.enterNode = function (e) { return e._collectionMark != co._collectionMark && e.isCastingShadow() ? t.prototype.enterNode.call(this, e) : ((e._collectionMark = co._collectionMark), !1); }), (n.registerMaterial = function (t, e) { n.materialClassPool[e.assetType] = t; }), (n.materialClassPool = {}), (n.renderGroupPool = {}), (n.defaultBackground = 0), n ); })(co), Co = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype.enterNode = function (e) { return e._collectionMark != co._collectionMark && e.isCastingShadow() ? t.prototype.enterNode.call(this, e) : ((e._collectionMark = co._collectionMark), !1); }), (n.registerMaterial = function (t, e) { n.materialClassPool[e.assetType] = t; }), (n.materialClassPool = {}), (n.renderGroupPool = {}), (n.defaultBackground = 0), n ); })(co), Io = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._depthRenderer = oo .getInstance(new yi(null, r.stage), bo) .getRenderer(e)), (r._distanceRenderer = oo .getInstance(new yi(null, r.stage), Co) .getRenderer(e)), (r._traverserClass = Ao), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "antiAlias", { get: function () { return this._stage.antiAlias; }, set: function (t) { this._stage.antiAlias = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depthPrepass", { get: function () { return this._depthPrepass; }, set: function (t) { this._depthPrepass = t; }, enumerable: !0, configurable: !0, }), (n.prototype.enterNode = function (e) { var n = t.prototype.enterNode.call(this, e); return ( n && e.boundsVisible && this.applyEntity( e.getBoundsPrimitive(this._renderGroup.pickGroup) ), n ); }), (n.prototype.render = function (e, n, r, i) { void 0 === e && (e = !0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), this._stage.recoverFromDisposal() && (this._requireDepthRender && this._renderSceneDepthToTexture(), this._depthPrepass && this._renderDepthPrepass(), t.prototype.render.call(this, e, n, r, i), i || this._view.present()); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._pRttBufferManager.dispose(), (this._pRttBufferManager = null), this._depthRenderer.onClear(e), this._distanceRenderer.onClear(e), (this._depthRenderer = null), (this._distanceRenderer = null), (this._depthRender = null); }), (n.prototype._renderDepthPrepass = function () { (this._depthRenderer.disableColor = !0), (this._depthRenderer.view.projection = this._view.projection), (this._depthRenderer.view.target = null), this._depthRenderer.render(), (this._depthRenderer.disableColor = !1); }), (n.prototype._renderSceneDepthToTexture = function () { (!this._depthTextureDirty && this._depthRender) || this.initDepthTexture(this._stage.context), this._depthRenderer.render(); }), (n.prototype.initDepthTexture = function (t) { (this._depthTextureDirty = !1), this._depthRender && this._depthRender.dispose(), (this._depthRender = new nn( this._pRttBufferManager.textureWidth, this._pRttBufferManager.textureHeight )), (this._depthRenderer.view.target = this._depthRender), (this._depthRenderer.view.projection = this._view.projection); }), (n.registerMaterial = function (t, e) { n.materialClassPool[e.assetType] = t; }), (n.materialClassPool = {}), (n.renderGroupPool = {}), (n.defaultBackground = 16777215), n ); })(co); Io.registerMaterial(Wi, Ao); var Eo, xo = (function () { function t() {} return (t.TRIANGLE = "triangle"), (t.LINE = "line"), t; })(), wo = (function () { function t() {} return ( (t.hitTest = function (t, e, n, r, i, o, a, s) { void 0 === s && (s = 0); var u, l, c, h, p, d, f, g, _ = o.positions, m = _.stride, y = _.get(a, s); o.indices ? ((u = o.indices.get(a, s)), (y = _.get(_.count)), (l = a * o.indices.dimensions)) : ((y = _.get(a, s)), (l = a)); var A = o.hitTestCache[s] || (o.hitTestCache[s] = new eo()), v = A.lastCollisionIndex; if (-1 != v && v < l) { u ? ((c = u[v] * m), (h = u[v + 1] * m)) : ((c = v * m), (h = (v + 1) * m)), (p = y[c]), (d = y[c + 1]), (f = y[h]); var b = p - t, C = d - e, I = (g = y[h + 1]) - d, E = -(f - p), x = Math.sqrt(I * I + E * E); if (!(Math.abs(b * I + C * E) > r * x)) if (!((G = b * E - C * I) > x * x || G < 0)) return !0; } if (l > 150) { var w = A.cells, S = w.length ? A.divisions : (A.divisions = Math.min(Math.ceil(Math.sqrt(l)), 32)), D = S / i.width, T = S / i.height, P = i.x, O = i.y; if (!w.length) { w.length = S * S; for (var B = 0; B < l; B += 3) { u ? ((c = u[B] * m), (h = u[B + 1] * m)) : ((c = B * m), (h = (B + 1) * m)), (p = y[c]), (d = y[c + 1]), (f = y[h]), (g = y[h + 1]); for ( var M = Math.floor((Math.min(p, f) - P) * D), L = Math.floor((Math.min(d, g) - O) * T), N = Math.floor((Math.max(p, f) - P) * D), R = Math.floor((Math.max(d, g) - O) * T), F = M; F <= N; F++ ) for (var k = L; k <= R; k++) { var U, j = F + k * S; (U = w[j] || (w[j] = new Array())).push(B); } } } if ( null == (U = w[Math.floor((t - P) * D) + Math.floor((e - O) * T) * S]) ) return (A.lastCollisionIndex = -1), !1; for (var V = U.length, Q = 0; Q < V; Q++) { B = U[Q]; u ? ((c = u[B] * m), (h = u[B + 1] * m)) : ((c = B * m), (h = (B + 1) * m)), (p = y[c]), (d = y[c + 1]), (f = y[h]); (b = p - t), (C = d - e), (I = (g = y[h + 1]) - d), (E = -(f - p)), (x = Math.sqrt(I * I + E * E)); if (!(Math.abs(b * I + C * E) > r * x)) if (!((G = b * E - C * I) > x * x || G < 0)) return (A.lastCollisionIndex = B), !0; } return (A.lastCollisionIndex = -1), !1; } for (B = 0; B < l; B += 6) { u ? ((c = u[B] * m), (h = u[B + 1] * m)) : ((c = B * m), (h = (B + 1) * m)), (p = y[c]), (d = y[c + 1]), (f = y[h]); var G; (b = p - t), (C = d - e), (I = (g = y[h + 1]) - d), (E = -(f - p)), (x = Math.sqrt(I * I + E * E)); if (!(Math.abs(b * I + C * E) > r * x)) if (!((G = b * E - C * I) > x * x || G < 0)) return (A.lastCollisionIndex = B), !0; } return (A.lastCollisionIndex = -1), !1; }), (t.getBoxBounds = function (t, e, n, r, i, o, a, s) { var u; void 0 === s && (s = 0); var l, c, h = t.dimensions, p = t.stride, d = 0, f = 0, g = 0, _ = 0; if ( (e ? ((c = a * e.dimensions), (l = e.get(a, s)), (u = t.get(t.count))) : ((c = a), (u = t.get(a, s))), 0 == c) ) return o; var m, y, A, v, b = 0; n && (v = n._rawData); for (b = 0; b < c; b += 3) (m = l ? l[b] * p : b * p), n ? 6 == h ? ((y = u[m] * v[0] + u[m + 1] * v[4] + u[m + 2] * v[8] + v[12]), (A = u[m] * v[1] + u[m + 1] * v[5] + u[m + 2] * v[9] + v[13]), u[m], v[2], u[m + 1], v[6], u[m + 2], v[10], v[14]) : ((y = u[m] * v[0] + u[m + 1] * v[4] + v[12]), (A = u[m] * v[1] + u[m + 1] * v[5] + v[13])) : ((y = u[m]), (A = u[m + 1]), 6 == h && u[m + 2]), 0 == b ? ((g = d = y), (_ = f = A)) : (y < d ? (d = y) : y > g && (g = y), A < f ? (f = A) : A > _ && (_ = A)); var C = new M(d, f); return ( (C.right = g), (C.bottom = _), this.mergeThinkness(C, r, n), C.union(o, o || i) ); }), (t.mergeThinkness = function (t, e, n) { var r, i = null === (r = n) || void 0 === r ? void 0 : r._rawData, o = n ? e.x * i[0] + e.y * i[4] : e.x, a = n ? e.x * i[1] + e.y * i[5] : e.y; return (t.x -= o), (t.y -= a), (t.right += o), (t.bottom += a), t; }), (t.getSphereBounds = function (t, e, n, r, i, o, a) { void 0 === a && (a = 0); for ( var s, u, l, c, h = t.get(o, a), p = t.dimensions, d = t.stride, f = 0, g = o * d, _ = 0; _ < g; _ += d ) f < (s = (u = h[_] - e.x) * u + (l = h[_ + 1] - e.y) * l + (c = 6 == p ? h[_ + 2] - e.z : -e.z) * c) && (f = s); return ( null == i && (i = new R()), (i.x = e.x), (i.y = e.y), (i.z = e.z), (i.radius = Math.sqrt(f)), i ); }), (t.prepareScale9 = function (e, n, r, i) { for ( var o = i ? e.clone() : e, a = t.getBoxBounds( e.positions, e.indices, null, new B(), null, null, e._numElements || e._numVertices ), s = [-1 / 0, r.x, r.right, 1 / 0], u = [-1 / 0, r.y, r.bottom, 1 / 0], l = { from: 0, to: 0 }, c = { from: 0, to: 0 }, h = 1; h < 3; h++ ) a.x > s[h] && (l.from = l.to = h), a.y > u[h] && (c.from = c.to = h); for (h = 0; h < 3; h++) a.right >= s[h] && h >= l.from && (l.to = h), a.bottom >= u[h] && h >= c.from && (c.to = h); (o.scale9Grid = r), (o.originalScale9Bounds = n); var p = (o.scale9Indices = Array.from({ length: 9 }, function (t) { return 0; })), d = this.restoreLineSegments(o); if (l.from === l.to && c.from === c.to) { var f = new Float32Array(3 * d.length); for (h = 0; h < d.length; h++) (f[3 * h + 0] = d[h].x), (f[3 * h + 1] = d[h].y), (f[3 * h + 2] = 0); return ( (o.initialScale9Positions = f), (o.scale9Indices[3 * c.from + l.from] = o._numElements || o._numVertices), o ); } for (var g = [], _ = 0; d.length; ) { for ( var m = d.pop(), y = d.pop(), A = 0, v = 0, b = !1, C = c.from; C <= c.to; C++ ) { var I = u[C + 1] - y.y, E = u[C + 1] - m.y; if (I * E < 0) { var x = I / (I - E), w = new B(y.x + x * (m.x - y.x), y.y + x * (m.y - y.y), 0, 0); d.push(w, m, y, w), (b = !0); break; } 0.5 * (y.y + m.y) > u[C] && 0.5 * (y.y + m.y) <= u[C + 1] && (v = C); for (var S = l.from; S <= l.to; S++) { var D = s[S + 1] - y.x, T = s[S + 1] - m.x; if (D * T < 0) { (x = D / (D - T)), (w = new B( y.x + x * (m.x - y.x), y.y + x * (m.y - y.y), 0, 0 )); d.push(w, m, y, w), (b = !0); break; } 0.5 * (y.x + m.x) > s[S] && 0.5 * (y.x + m.x) <= s[S + 1] && (A = S); } if (b) break; } b || (g[A + 3 * v] || (g[A + 3 * v] = []), g[A + 3 * v].push(y.x, y.y, 0, m.x, m.y, 0), (_ += 2)); } var P = new Float32Array(3 * _), O = new Float32Array(_); O.fill(o.thickness.get(1)[0]); var M = 0; for (h = 0; h < 9; h++) g[h] && (P.set(g[h], 3 * M), (M += g[h].length / 3), (p[h] = M)); return ( (o.initialScale9Positions = P), o.setPositions(P), o.setThickness(O), o.invalidate(), o ); }), (t.restoreLineSegments = function (t) { var e, n, r, i = t.positions, o = t.indices, a = t._numElements || t._numVertices, s = i.dimensions, u = i.stride; o ? ((r = a * o.dimensions), (e = o.get(a, 0)), (n = i.get(i.count))) : ((r = a), (n = i.get(a, 0))); for (var l = [], c = 0; c < r; c += 6) { var h = e ? e[c] * u : c * u; l.push(new B(n[h], n[h + 1], 6 === s ? n[h + 2] : 0, 0)), (h += 6 == s ? 3 : 2), l.push(new B(n[h], n[h + 1], 6 === s ? n[h + 2] : 0, 0)); } return l; }), (t.updateScale9 = function (t, e, n, r, i, o) { if (9 !== t.scale9Indices.length) throw "ElementUtils: Error - triangleElement does not provide valid slice9Indices!"; var a = t.scale9Grid, s = a.x - e.x, u = e.right - a.right, l = a.y - e.y, c = e.bottom - a.bottom, h = t.scale9Indices.length, p = e.width * n - (s + u), d = e.height * r - (l + c), f = 1, g = 1; p < 0 && ((p = 0), (f = (e.width * n) / (s + u))), d < 0 && ((d = 0), (g = (e.height * r) / (l + c))); for ( var _ = p / a.width, m = d / a.height, y = t.positions.stride, A = t.positions.offset, v = t.positions.dimensions, b = t.positions.get(t._numVertices), C = t.initialScale9Positions, I = t.scale9Indices, E = [0, s * f - s * _, p - a.width * f], x = [0, l * g - l * m, d - a.height * g], w = A, S = 0, D = 0; D < h; D++ ) for ( var T = (D / 3) | 0, P = D % 3, O = 1 === P ? _ : f, B = 1 === T ? m : g, M = E[P], L = x[T]; S < I[D]; ) { for ( var N = e.x + (M + (C[3 * S + 0] - e.x) * O) / n, R = e.y + (L + (C[3 * S + 1] - e.y) * B) / r, F = e.x + (M + (C[3 * S + 3] - e.x) * O) / n, k = e.y + (L + (C[3 * S + 4] - e.y) * B) / r, U = 0; U < 2; U++ ) { var j = w; (b[j++] = N), (b[j++] = R), 6 === v && (b[j++] = 0), (b[j++] = F), (b[j++] = k), 6 === v && (b[j++] = 0), (j = w += y), (b[j++] = F), (b[j++] = k), 6 === v && (b[j++] = 0), (b[j++] = N), (b[j++] = R), 6 === v && (b[j++] = 0), (w += y); } S += 2; } return t.positions.invalidate(), t.invalidate(), t; }), t ); })(); !(function (t) { (t[(t.HORIZONTAL = 0)] = "HORIZONTAL"), (t[(t.NONE = 1)] = "NONE"), (t[(t.NORMAL = 2)] = "NORMAL"), (t[(t.VERTICAL = 3)] = "VERTICAL"), (t[(t.HAIRLINE = 4)] = "HAIRLINE"); })(Eo || (Eo = {})), new M(); var So = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this, e) || this; return ( (n._thicknessScale = new B()), (n.hitTestCache = new Object()), (n.half_thickness = 5), (n.scaleMode = Eo.HAIRLINE), (n.dimension = 3), (n.dimension = ji), (n._positions = new ui(Float32Array, 2 * n.dimension, e)), n ); } return ( e(n, t), (n.prototype.getThicknessScale = function (t, e, n) { return ( n || this.scaleMode != Eo.HAIRLINE ? (e ? this._thicknessScale.copyFrom( e.getMatrix3D().decompose()[3] ) : this._thicknessScale.identity(), (this._thicknessScale.x *= (t.focalLength * t.pixelRatio) / 1e3), (this._thicknessScale.y *= t.focalLength / 1e3), this.scaleMode == Eo.NORMAL ? ((this._thicknessScale.x = !n || this.half_thickness * this._thicknessScale.x > 0.5 ? this.half_thickness : 0.5 / this._thicknessScale.x), (this._thicknessScale.y = !n || this.half_thickness * this._thicknessScale.y > 0.5 ? this.half_thickness : 0.5 / this._thicknessScale.y)) : this.scaleMode == Eo.HAIRLINE && ((this._thicknessScale.x = 0.5 / this._thicknessScale.x), (this._thicknessScale.y = 0.5 / this._thicknessScale.y))) : this._thicknessScale.identity(), this._thicknessScale ); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "positions", { get: function () { return this._positions; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "thickness", { get: function () { return this._thickness; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "colors", { get: function () { return this._colors || this.setColors(this._colors), this._colors; }, enumerable: !0, configurable: !0, }), (n.prototype.prepareScale9 = function (t, e, n, r, i) { return wo.prepareScale9(this, t, e, n); }), (n.prototype.updateScale9 = function (t, e) { this.scale9Indices && wo.updateScale9(this, this.originalScale9Bounds, t, e, !1, !1); }), (n.prototype.getBoxBounds = function (t, e, n, r, i, o, a, s) { return ( void 0 === e && (e = null), void 0 === n && (n = !1), void 0 === r && (r = null), void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = 0), void 0 === s && (s = 0), (a = a || this._numElements || this._numVertices), this._boundsRequests++, wo.getBoxBounds( this.positions, this.indices, r, this.getThicknessScale(t, e, n), i, o, a, s ) ); }), (n.prototype.getSphereBounds = function (t, e, n, r, i, o, a, s) { return ( void 0 === n && (n = null), void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = 0), void 0 === s && (s = 0), wo.getSphereBounds( this.positions, e, n, i, o, a || this._numVertices, s ) ); }), (n.prototype.hitTestPoint = function (t, e, n, r, i, o, a, s, u, l) { void 0 === a && (a = 0), void 0 === s && (s = 0); var c = this.getThicknessScale(t, e, !0), h = (c.x + c.y) / 2; return wo.hitTest( n, r, 0, h, o, this, a || this._numElements || this._numVertices, s ); }), (n.prototype.setPositions = function (t, e) { void 0 === e && (e = 0); var n = 2 * this.dimension; if (t instanceof ui) this.clearVertices(this._positions), (this._positions = t); else if (t) { for ( var r = 0, i = 0, o = 0, a = new Float32Array(4 * n * (t.length / 6)), s = new Uint16Array(t.length); r < t.length; ) if ( ((o / n) & 1 ? ((a[o++] = t[r + 3]), (a[o++] = t[r + 4]), 6 === n && (a[o++] = t[r + 5]), (a[o++] = t[r]), (a[o++] = t[r + 1]), 6 === n && (a[o++] = t[r + 2])) : ((a[o++] = t[r]), (a[o++] = t[r + 1]), 6 === n && (a[o++] = t[r + 2]), (a[o++] = t[r + 3]), (a[o++] = t[r + 4]), 6 === n && (a[o++] = t[r + 5])), 4 == ++i) ) { var u = o / n - 4; s.set([u, u + 1, u + 2, u + 3, u + 2, u + 1], r), (i = 0), (r += 6); } this._positions.set(a, 4 * e), this.setIndices(s, e); } else this.clearVertices(this._positions), (this._positions = new ui( Float32Array, n, this._concatenatedBuffer )); (this._numVertices = this._positions.count), this.invalidateVertices(this._positions), (this._verticesDirty[this._positions.id] = !1); }), (n.prototype.setThickness = function (t, e) { if ((void 0 === e && (e = 0), t instanceof ci)) this._thickness = t; else if (t) { this._thickness || (this._thickness = new ci(this._concatenatedBuffer)); for ( var n = 0, r = 0, i = 0, o = new Float32Array(4 * t.length); n < t.length; ) (o[i] = 1 & Math.floor(0.5 * i + 0.5) ? -t[n] : t[n]), 4 == ++r && ((r = 0), n++), i++; this._thickness.set(o, 4 * e); } else this._thickness && (this._thickness.dispose(), (this._thickness = null)); this.invalidateVertices(this._thickness), (this._verticesDirty[this._thickness.id] = !1); }), (n.prototype.setColors = function (t, e) { if ((void 0 === e && (e = 0), t)) { if (t == this._colors) return; if (t instanceof li) this.clearVertices(this._colors), (this._colors = t); else { this._colors || (this._colors = new li(this._concatenatedBuffer)); for ( var n = 0, r = 0, i = 0, o = new Uint8Array(4 * t.length); n < t.length; ) (i / 4) & 1 ? ((o[i] = t[n + 4]), (o[i + 1] = t[n + 5]), (o[i + 2] = t[n + 6]), (o[i + 3] = t[n + 7])) : ((o[i] = t[n]), (o[i + 1] = t[n + 1]), (o[i + 2] = t[n + 2]), (o[i + 3] = t[n + 3])), 4 == ++r && ((r = 0), (n += 8)), (i += 4); this._colors.set(o, 4 * e); } } else this._colors = Yi.generateColors( this.indices, this._colors, this._concatenatedBuffer, this._numVertices ); this.invalidateVertices(this._colors), (this._verticesDirty[this._colors.id] = !1); }), (n.prototype.dispose = function () { t.prototype.dispose.call(this), this._positions.dispose(), (this._positions = null), this._thickness && (this._thickness.dispose(), (this._thickness = null)), this._colors && (this._colors.dispose(), (this._colors = null)); }), (n.prototype.clone = function () { var t = new n( this._concatenatedBuffer ? this._concatenatedBuffer.clone() : null ); return ( t.setIndices(this.indices.clone()), t.setPositions(this._positions.clone()), this._thickness && t.setThickness(this._thickness.clone()), this._colors && t.setColors(this._colors.clone()), t ); }), (n.prototype.testCollision = function (t, e, n, r, i, o, a) { void 0 === a && (a = 0); var s = this.getThicknessScale(t, e.entityNode.parent, !0), u = (s.x + s.y) / 2, l = -e.rayPosition.z / e.rayDirection.z, c = new B( e.rayPosition.x + l * e.rayDirection.x, e.rayPosition.y + l * e.rayDirection.y ); return ( !!wo.hitTest(c.x, c.y, 0, u, n, this, this._numElements, a) && ((e.rayEntryDistance = l), (e.position = c), (e.normal = new B(0, 0, 1)), !0) ); }), (n.assetType = "[asset LineElements]"), n ); })(ro), Do = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._scale = new B()), (r._thickness = 1), (r._vaoIsInvalid = !0), (r._lineElements = e), (r._vao = n.context.hasVao && ki && !r._lineElements.isDynamic ? n.context.createVao() : null), r ); } return ( e(n, t), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), (this._vaoIsInvalid = !0); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._lineElements = null), (this._vaoIsInvalid = !0), this._vao && (this._vao.dispose(), (this._vao = null)); }), (n.prototype._setRenderState = function (e, n) { t.prototype._setRenderState.call(this, e, n); var r = this._asset, i = n.view, o = e.renderGroup.getRenderElements(e.stageElements.elements); this._vao && this._vao.bind(), (this._vao && !this._vaoIsInvalid) || (n.colorBufferIndex >= 0 && this.activateVertexBufferVO( n.colorBufferIndex, this._lineElements.colors ), this.activateVertexBufferVO( 0, this._lineElements.positions, r.dimension ), this.activateVertexBufferVO( o.secondaryPositionIndex, this._lineElements.positions, r.dimension, 2 * r.dimension * 2 ), this.activateVertexBufferVO( o.thicknessIndex, this._lineElements.thickness ), n.uvIndex >= 0 && this.activateVertexBufferVO( n.uvIndex, this._lineElements.positions, 2 ), (this._vaoIsInvalid = !1)); var a = o.uOffsets.oMisc, s = n.vertexConstantData; this._scale.copyFrom(e.node.getMatrix3D().decompose()[3]); var u = this._lineElements.scaleMode, l = this._lineElements.half_thickness; u == Eo.NORMAL ? ((s[a + 0] = (l * this._scale.x * this._thickness) / 1e3 > 0.5 / (i.focalLength * i.pixelRatio) ? (this._scale.x * this._thickness) / 1e3 : 0.5 / (l * i.focalLength * i.pixelRatio)), (s[a + 1] = (l * this._scale.y * this._thickness) / 1e3 > 0.5 / i.focalLength ? (this._scale.y * this._thickness) / 1e3 : 0.5 / (l * i.focalLength))) : u == Eo.HAIRLINE ? ((s[a + 0] = this._thickness / (i.focalLength * i.pixelRatio)), (s[a + 1] = this._thickness / i.focalLength)) : ((s[a + 0] = this._thickness / Math.min(i.width, i.height)), (s[a + 1] = this._thickness / Math.min(i.width, i.height))), (s[a + 2] = i.projection.near); }), (n.prototype.draw = function (t, e, n, r) { var i = this._stage.context; e.viewMatrix.copyFrom(e.view.frustumMatrix3D, !0); var o = F.CALCULATION_MATRIX; o.copyFrom(t.node.getMatrix3D()), o.append(e.view.projection.transform.inverseMatrix3D), e.sceneMatrix.copyFrom(o, !0), i.setProgramConstantsFromArray(te.VERTEX, e.vertexConstantData), i.setProgramConstantsFromArray(te.FRAGMENT, e.fragmentConstantData), this._indices ? this.getIndexBufferGL().draw( Jt.TRIANGLES, 3 * r, 3 * n || this.numIndices ) : this._stage.context.drawVertices( Jt.TRIANGLES, r, n || this.numVertices ), this._vao && this._vao.unbind(); }), (n.prototype._pGetOverflowElements = function () { return new n(this._lineElements, this._stage); }), n ); })(qi), To = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e.secondaryPositionIndex = -1), (e.thicknessIndex = -1), (e.uOffsets = { oMisc: 0 }), e ); } return ( e(n, t), (n.prototype._includeDependencies = function (t) {}), (n.prototype._getVertexCode = function (t, e, n) { var r = t.globalPosDependencies > 0 ? n.globalPositionVertex : n.animatedPosition, i = e.getFreeVertexAttribute(); this.secondaryPositionIndex = i.index; var o = e.getFreeVertexAttribute(); this.thicknessIndex = o.index; var a = e.getFreeVertexConstant(); e.getFreeVertexConstant(), e.getFreeVertexConstant(), e.getFreeVertexConstant(), (t.viewMatrixIndex = 4 * a.index); var s = e.getFreeVertexConstant(); this.uOffsets.oMisc = 4 * s.index; var u = e.getFreeVertexConstant(); e.getFreeVertexConstant(), e.getFreeVertexConstant(), e.getFreeVertexConstant(), (t.sceneMatrixIndex = 4 * u.index); var l = e.getFreeVertexVectorTemp(); e.addVertexTempUsages(l, 1); var c = e.getFreeVertexVectorTemp(); e.addVertexTempUsages(c, 1); var h = e.getFreeVertexVectorTemp(); e.addVertexTempUsages(h, 1); var p = e.getFreeVertexVectorTemp(); e.addVertexTempUsages(p, 1); var d = e.getFreeVertexVectorTemp(); e.addVertexTempUsages(d, 1); var f = e.getFreeVertexVectorTemp(); e.addVertexTempUsages(f, 1); var g = [ "m44 " + l + ", " + r + ", " + u, "m44 " + c + ", " + i + ", " + u, "sub " + h + ", " + c + ", " + l + " \t\t\t", "slt " + p + ".x, " + l + ".z, " + s + ".z", "sub " + p + ".y, #native( 1.0 )native#, " + p + ".x\t\t\t", "add " + f + ".x, " + l + ".z, " + s + ".z\t\t\t", "sub " + f + ".y, " + l + ".z, " + c + ".z\t\t\t", "seq " + f + ".z, " + f + ".y, #native( vec4(0.0) )native#", "add " + f + ".y, " + f + ".y, " + f + ".z", "div " + f + ".z, " + f + ".x, " + f + ".y", "mul " + f + ".xyz, " + f + ".zzz, " + h + ".xyz\t", "add " + d + ".xyz, " + l + ".xyz, " + f + ".xyz\t", "mov " + d + ".w, #native( 1.0 )native#\t\t\t", "mul " + l + ", " + l + ", " + p + ".yyyy\t\t\t", "mul " + d + ", " + d + ", " + p + ".xxxx\t\t\t", "add " + l + ", " + l + ", " + d + "\t\t\t\t", "nrm " + h + ".xyz, " + h + ".xyz\t\t\t", "nrm " + p + ".xyz, " + l + ".xyz\t\t\t", "mov " + p + ".w, #native( 1.0 )native#\t\t\t\t", "crs " + d + ".xyz, " + h + ", " + p + "\t\t\t", "nrm " + d + ".xyz, " + d + ".xyz\t\t\t", "mul " + d + ".xyz, " + d + ".xyz, " + o + ".xxx\t", "mov " + d + ".w, #native( 1.0 )native#\t\t\t", "mul " + f + ".x, " + l + ".z, #native( -1.0 )native#\t\t\t", "mul " + d + ".xyz, " + d + ".xyz, " + f + ".xxx\t", "mul " + d + ".xyz, " + d + ".xyz, " + s + ".xy\t", "add " + l + ".xyz, " + l + ".xyz, " + d + ".xyz\t", "m44 op, " + l + ", " + a, "", ]; return ( e.removeVertexTempUsage(l), e.removeVertexTempUsage(c), e.removeVertexTempUsage(h), e.removeVertexTempUsage(p), e.removeVertexTempUsage(d), e.removeVertexTempUsage(f), g.join("\n") ); }), (n.prototype._getFragmentCode = function (t, e, n) { return ""; }), n ); })(Ni); function Po(t, e) { if ((void 0 === e && (e = "assertion failed"), "" === t && (t = !0), !t)) throw "undefined" != typeof console && "assert" in console ? (console.assert(!1, e), new Error(e)) : new Error(e); } function Oo(t, e, n, r, i) { void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), r > 0 || (i > 0 && i < e.length) ? (i <= 0 && (i = e.length - r), t.set(e.subarray(r, r + i), n)) : t.set(e, n); } oo.registerElements(To, So), Jr.registerAbstraction(Do, So), console.debug("AwayJS - Renderer - 0.11.44"); var Bo, Mo = (function () { function t(t, e, n, r) { (this.xMin = 0 | t), (this.yMin = 0 | e), (this.xMax = 0 | n), (this.yMax = 0 | r); } return ( (t.FromUntyped = function (e) { return new t(e.xMin, e.yMin, e.xMax, e.yMax); }), (t.FromRectangle = function (e) { return new t( (20 * e.x) | 0, (20 * e.y) | 0, (20 * (e.x + e.width)) | 0, (20 * (e.y + e.height)) | 0 ); }), (t.prototype.setElements = function (t, e, n, r) { (this.xMin = t), (this.yMin = e), (this.xMax = n), (this.yMax = r); }), (t.prototype.copyFrom = function (t) { this.setElements(t.xMin, t.yMin, t.xMax, t.yMax); }), (t.prototype.contains = function (t, e) { return ( t < this.xMin != t < this.xMax && e < this.yMin != e < this.yMax ); }), (t.prototype.unionInPlace = function (t) { t.isEmpty() || (this.extendByPoint(t.xMin, t.yMin), this.extendByPoint(t.xMax, t.yMax)); }), (t.prototype.extendByPoint = function (t, e) { this.extendByX(t), this.extendByY(e); }), (t.prototype.extendByX = function (t) { 134217728 !== this.xMin ? ((this.xMin = Math.min(this.xMin, t)), (this.xMax = Math.max(this.xMax, t))) : (this.xMin = this.xMax = t); }), (t.prototype.extendByY = function (t) { 134217728 !== this.yMin ? ((this.yMin = Math.min(this.yMin, t)), (this.yMax = Math.max(this.yMax, t))) : (this.yMin = this.yMax = t); }), (t.prototype.intersects = function (t) { return this.contains(t.xMin, t.yMin) || this.contains(t.xMax, t.yMax); }), (t.prototype.isEmpty = function () { return this.xMax <= this.xMin || this.yMax <= this.yMin; }), Object.defineProperty(t.prototype, "width", { get: function () { return this.xMax - this.xMin; }, set: function (t) { this.xMax = this.xMin + t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "height", { get: function () { return this.yMax - this.yMin; }, set: function (t) { this.yMax = this.yMin + t; }, enumerable: !0, configurable: !0, }), (t.prototype.getBaseWidth = function (t) { var e = Math.abs(Math.cos(t)), n = Math.abs(Math.sin(t)); return e * (this.xMax - this.xMin) + n * (this.yMax - this.yMin); }), (t.prototype.getBaseHeight = function (t) { var e = Math.abs(Math.cos(t)); return ( Math.abs(Math.sin(t)) * (this.xMax - this.xMin) + e * (this.yMax - this.yMin) ); }), (t.prototype.setEmpty = function () { this.xMin = this.yMin = this.xMax = this.yMax = 0; }), (t.prototype.setToSentinels = function () { this.xMin = this.yMin = this.xMax = this.yMax = 134217728; }), (t.prototype.clone = function () { return new t(this.xMin, this.yMin, this.xMax, this.yMax); }), (t.prototype.toString = function () { return ( "{ xMin: " + this.xMin + ", xMin: " + this.yMin + ", xMax: " + this.xMax + ", xMax: " + this.yMax + " }" ); }), t ); })(); function Lo(t, e, n) { return Math.max(e, Math.min(n, t)); } function No(t) { return null == t; } function Ro(t) { for ( var e = new Uint8Array(4 * t.length), n = 0, r = 0, i = t.length; r < i; r++ ) { var o = t.charCodeAt(r); if (o <= 127) e[n++] = o; else { if (55296 <= o && o <= 56319) { var a = t.charCodeAt(r + 1); 56320 <= a && a <= 57343 && ((o = ((1023 & o) << 10) + (1023 & a) + 65536), ++r); } 0 != (4292870144 & o) ? ((e[n++] = 248 | ((o >>> 24) & 3)), (e[n++] = 128 | ((o >>> 18) & 63)), (e[n++] = 128 | ((o >>> 12) & 63)), (e[n++] = 128 | ((o >>> 6) & 63)), (e[n++] = 128 | (63 & o))) : 0 != (4294901760 & o) ? ((e[n++] = 240 | ((o >>> 18) & 7)), (e[n++] = 128 | ((o >>> 12) & 63)), (e[n++] = 128 | ((o >>> 6) & 63)), (e[n++] = 128 | (63 & o))) : 0 != (4294965248 & o) ? ((e[n++] = 224 | ((o >>> 12) & 15)), (e[n++] = 128 | ((o >>> 6) & 63)), (e[n++] = 128 | (63 & o))) : ((e[n++] = 192 | ((o >>> 6) & 31)), (e[n++] = 128 | (63 & o))); } } return e.subarray(0, n); } function Fo(t) { for (var e = 0, n = ""; e < t.length; ) { var r = 255 & t[e++]; if (r <= 127) n += String.fromCharCode(r); else { var i = 192, o = 5; do { if ((r & ((i >> 1) | 128)) === i) break; (i = (i >> 1) | 128), --o; } while (o >= 0); if (o <= 0) { n += String.fromCharCode(r); continue; } for (var a = r & ((1 << o) - 1), s = !1, u = 5; u >= o; --u) { var l = t[e++]; if (128 != (192 & l)) { s = !0; break; } a = (a << 6) | (63 & l); } if (s) { for (var c = e - (7 - u); c < e; ++c) n += String.fromCharCode(255 & t[c]); continue; } n += a >= 65536 ? String.fromCharCode( (((a - 65536) >> 10) & 1023) | 55296, (1023 & a) | 56320 ) : String.fromCharCode(a); } } return n; } !(function (t) { (t[(t.None = 0)] = "None"), (t[(t.PremultipliedAlphaARGB = 1)] = "PremultipliedAlphaARGB"), (t[(t.StraightAlphaARGB = 2)] = "StraightAlphaARGB"), (t[(t.StraightAlphaRGBA = 3)] = "StraightAlphaRGBA"), (t[(t.JPEG = 4)] = "JPEG"), (t[(t.PNG = 5)] = "PNG"), (t[(t.GIF = 6)] = "GIF"); })(Bo || (Bo = {})); var ko, Uo = (function () { function t(t) { void 0 === t && (t = 32), (this._list = []), (this._maxSize = t); } return ( (t.prototype.acquire = function (e) { if (t._enabled) for (var n = this._list, r = 0; r < n.length; r++) { var i = n[r]; if (i.byteLength >= e) return n.splice(r, 1), i; } return new ArrayBuffer(e); }), (t.prototype.release = function (e) { if (t._enabled) { var n = this._list; n.length === this._maxSize && n.shift(), n.push(e); } }), (t.prototype.ensureUint8ArrayLength = function (t, e) { if (t.length >= e) return t; var n = Math.max(t.length + e, 1 + ((3 * t.length) >> 1)), r = new Uint8Array(this.acquire(n), 0, n); return r.set(t), this.release(t.buffer), r; }), (t.prototype.ensureFloat64ArrayLength = function (t, e) { if (t.length >= e) return t; var n = Math.max(t.length + e, 1 + ((3 * t.length) >> 1)), r = new Float64Array( this.acquire(n * Float64Array.BYTES_PER_ELEMENT), 0, n ); return r.set(t), this.release(t.buffer), r; }), (t._enabled = !0), t ); })(); !(function (t) { var e = new ArrayBuffer(8); function n(t) { return ((256 * t) << 16) >> 16; } function r(t) { return t / 256; } (t.i8 = new Int8Array(e)), (t.u8 = new Uint8Array(e)), (t.i32 = new Int32Array(e)), (t.f32 = new Float32Array(e)), (t.f64 = new Float64Array(e)), (t.nativeLittleEndian = 1 === new Int8Array(new Int32Array([1]).buffer)[0]), (t.floatToInt32 = function (e) { return (t.f32[0] = e), t.i32[0]; }), (t.int32ToFloat = function (e) { return (t.i32[0] = e), t.f32[0]; }), (t.swap16 = function (t) { return ((255 & t) << 8) | ((t >> 8) & 255); }), (t.swap32 = function (t) { return ( ((255 & t) << 24) | ((65280 & t) << 8) | ((t >> 8) & 65280) | ((t >> 24) & 255) ); }), (t.toS8U8 = n), (t.fromS8U8 = r), (t.clampS8U8 = function (t) { return r(n(t)); }), (t.toS16 = function (t) { return (t << 16) >> 16; }), (t.bitCount = function (t) { return ( (16843009 * (((t = (858993459 & (t -= (t >> 1) & 1431655765)) + ((t >> 2) & 858993459)) + (t >> 4)) & 252645135)) >> 24 ); }), (t.ones = function (t) { return ( (16843009 * (((t = (858993459 & (t -= (t >> 1) & 1431655765)) + ((t >> 2) & 858993459)) + (t >> 4)) & 252645135)) >> 24 ); }), (t.trailingZeros = function (e) { return t.ones((e & -e) - 1); }), (t.getFlags = function (t, e) { var n = ""; for (t = 0; t < e.length; t++) t & (1 << t) && (n += e[t] + " "); return 0 === n.length ? "" : n.trim(); }), (t.isPowerOfTwo = function (t) { return t && 0 == (t & (t - 1)); }), (t.roundToMultipleOfFour = function (t) { return (t + 3) & -4; }), (t.nearestPowerOfTwo = function (t) { return ( t--, (t |= t >> 1), (t |= t >> 2), (t |= t >> 4), (t |= t >> 8), (t |= t >> 16), ++t ); }), (t.roundToMultipleOfPowerOfTwo = function (t, e) { var n = (1 << e) - 1; return (t + n) & ~n; }), (t.toHEX = function (t) { return ( "0x" + ( "00000000" + (t = t < 0 ? 4294967295 + t + 1 : t).toString(16) ).substr(-8) ); }); })(ko || (ko = {})); var jo = (function () { return function () {}; })(), Vo = (function () { return function (t, e) { (this.symbolId = t), (this.className = e); }; })(), Qo = (function () { return function (t, e, n) { (this.tagCode = t), (this.byteOffset = e), (this.byteLength = n); }; })(), Go = (function (t) { function n(e, n, r, i) { var o = t.call(this, n, r, i) || this; return (o.id = e), o; } return e(n, t), n; })(Qo), zo = (function (t) { function n(e, n, r, i) { var o = t.call(this, e, n.tagCode, n.byteOffset, n.byteLength) || this; return (o.type = r), (o.definition = i), (o.ready = !1), o; } return e(n, t), n; })(Go); function Ho(t) { return "string" == typeof t ? t : null == t ? null : t + ""; } var Xo, Yo = { code: 2006, message: "The supplied index is out of bounds." }, qo = { code: 2007, message: "Parameter %1 must be non-null." }, Ko = { code: 2030, message: "End of file was encountered.", fqn: "flash.errors.EOFError", }, Wo = { code: 2058, message: "There was an error decompressing the data.", fqn: "flash.errors.IOError", }, Jo = { FILLS: !1, STROKES: !1 }, $o = 10, Zo = !0, ta = 0.01, ea = 6, na = !0, ra = (function () { function t(e, n) { if ( ((this._verHeader = e), (this._size = n), (this.isDone = !1), (this._isRunned = !1), (this._blockPosition = 0), (this.onError = function (t) {}), e && (this._size -= 8), !t.isSupported) ) throw "DecompressionStream is not supported!"; var r = new self.DecompressionStream("deflate"); (this._writer = r.writable.getWriter()), (this._reader = r.readable.getReader()), (this._buffer = new Uint8Array(n)), (this._processBlocks = this._processBlocks.bind(this)); } return ( Object.defineProperty(t.prototype, "closed", { get: function () { return !this._isRunned && this.isDone; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t, "isSupported", { get: function () { return "DecompressionStream" in self; }, enumerable: !0, configurable: !0, }), (t.prototype._processBlocks = function (t) { var e = t.done, n = t.value, r = this._reader; return ( n && (n.length >= this._size ? ((this._buffer = n), (this._blockPosition = this._size)) : (this._buffer.set(n, this._blockPosition), (this._blockPosition += n.length))), e || this._blockPosition >= this._size ? ((this.isDone = !0), this.onData && this.onData(this._buffer), this._buffer) : r.read().then(this._processBlocks) ); }), (t.prototype.push = function (t) { 8 !== t.length ? (this._writer.write(t), this._isRunned || ((this._isRunned = !0), this._reader .read() .then(this._processBlocks) .catch(this.onError))) : this.onData && this.onData(t); }), (t.prototype.close = function () { this._isRunned && this.isDone && (this._writer.close(), (this._isRunned = !1)); }), t ); })(); !(function (t) { (t[(t.INIT = 0)] = "INIT"), (t[(t.BLOCK_0 = 1)] = "BLOCK_0"), (t[(t.BLOCK_1 = 2)] = "BLOCK_1"), (t[(t.BLOCK_2_PRE = 3)] = "BLOCK_2_PRE"), (t[(t.BLOCK_2 = 4)] = "BLOCK_2"), (t[(t.DONE = 5)] = "DONE"), (t[(t.ERROR = 6)] = "ERROR"), (t[(t.VERIFY_HEADER = 7)] = "VERIFY_HEADER"); })(Xo || (Xo = {})); var ia, oa, aa, sa, ua, la, ca, ha, pa = 32768, da = 65536, fa = (function () { function t(t) {} return ( (t.prototype.push = function (t) {}), (t.prototype.close = function () {}), (t.create = function (t, e, n) { if ( (void 0 === e && (e = 0), void 0 === n && (n = !0), n && !ra.isSupported && console.warn("[NativeDeflate] Is not supported!"), n && ra.isSupported && Zo) ) { if (e) return new ra(t, e); console.debug( "[NativeDeflate] size not presented, can`t use a native implementation" ); } return new ga(t); }), (t.prototype._processZLibHeader = function (t, e, n) { if (e + 2 > n) return 0; var r = (t[e] << 8) | t[e + 1], i = null; return ( 2048 != (3840 & r) ? (i = "inflate: unknown compression method") : r % 31 != 0 ? (i = "inflate: bad FCHECK") : 0 != (32 & r) && (i = "inflate: FDICT bit set"), i ? (this.onError && this.onError(i), -1) : 2 ); }), (t.inflate = function (e, n, r) { var i = 0, o = new Uint8Array(n), a = t.create(r, 0, !1); return ( (a.onData = function (t) { var e = Math.min(t.length, o.length - i); e && Oo(o, t, i, 0, e), (i += e); }), (a.onError = function (t) { throw new Error(t); }), a.push(e), a.close(), o ); }), t ); })(), ga = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n._buffer = null), (n._bufferSize = 0), (n._bufferPosition = 0), (n._bitBuffer = 0), (n._bitLength = 0), (n._window = new Uint8Array(65794)), (n._windowPosition = 0), (n._state = e ? Xo.VERIFY_HEADER : Xo.INIT), (n._isFinalBlock = !1), (n._literalTable = null), (n._distanceTable = null), (n._block0Read = 0), (n._block2State = null), (n._copyState = { state: 0, len: 0, lenBits: 0, dist: 0, distBits: 0, }), _a || (!(function () { (ia = new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, ])), (oa = new Uint16Array(30)), (aa = new Uint8Array(30)); for (var t = 0, e = 0, n = 1; t < 30; ++t) (oa[t] = n), (n += 1 << (aa[t] = ~~((e += t > 2 ? 1 : 0) / 2))); var r = new Uint8Array(288); for (t = 0; t < 32; ++t) r[t] = 5; (sa = ma(r.subarray(0, 32))), (ua = new Uint16Array(29)), (la = new Uint8Array(29)); for (t = 0, e = 0, n = 3; t < 29; ++t) (ua[t] = n - (28 == t ? 1 : 0)), (n += 1 << (la[t] = ~~(((e += t > 4 ? 1 : 0) / 4) % 6))); for (t = 0; t < 288; ++t) r[t] = t < 144 || t > 279 ? 8 : t < 256 ? 9 : 7; ca = ma(r); })(), (_a = !0)), n ); } return ( e(n, t), (n.prototype.push = function (t) { if ( !this._buffer || this._buffer.length < this._bufferSize + t.length ) { var e = new Uint8Array(this._bufferSize + t.length); this._buffer && e.set(this._buffer), (this._buffer = e); } this._buffer.set(t, this._bufferSize), (this._bufferSize += t.length), (this._bufferPosition = 0); var n = !1; do { var r = this._windowPosition; if (this._state === Xo.INIT && (n = this._decodeInitState())) break; switch (this._state) { case Xo.BLOCK_0: n = this._decodeBlock0(); break; case Xo.BLOCK_2_PRE: if ((n = this._decodeBlock2Pre())) break; case Xo.BLOCK_1: case Xo.BLOCK_2: n = this._decodeBlock(); break; case Xo.ERROR: case Xo.DONE: this._bufferPosition = this._bufferSize; break; case Xo.VERIFY_HEADER: var i = this._processZLibHeader( this._buffer, this._bufferPosition, this._bufferSize ); i > 0 ? ((this._bufferPosition += i), (this._state = Xo.INIT)) : 0 === i ? (n = !0) : (this._state = Xo.ERROR); } this._windowPosition - r > 0 && this.onData(this._window.subarray(r, this._windowPosition)), this._windowPosition >= da && ("copyWithin" in this._buffer ? this._window.copyWithin( 0, this._windowPosition - pa, this._windowPosition ) : this._window.set( this._window.subarray( this._windowPosition - pa, this._windowPosition ) ), (this._windowPosition = pa)); } while (!n && this._bufferPosition < this._bufferSize); this._bufferPosition < this._bufferSize ? ("copyWithin" in this._buffer ? this._buffer.copyWithin( 0, this._bufferPosition, this._bufferSize ) : this._buffer.set( this._buffer.subarray( this._bufferPosition, this._bufferSize ) ), (this._bufferSize -= this._bufferPosition)) : (this._bufferSize = 0); }), (n.prototype._decodeInitState = function () { if (this._isFinalBlock) return (this._state = Xo.DONE), !1; var t, e = this._buffer, n = this._bufferSize, r = this._bitBuffer, i = this._bitLength, o = this._bufferPosition; if (((n - o) << 3) + i < 3) return !0; i < 3 && ((r |= e[o++] << i), (i += 8)); var a = 7 & r; switch (((r >>= 3), (i -= 3), a >> 1)) { case 0: if (((r = 0), (i = 0), n - o < 4)) return !0; var s = e[o] | (e[o + 1] << 8), u = e[o + 2] | (e[o + 3] << 8); if (((o += 4), 65535 != (s ^ u))) { this._error("inflate: invalid block 0 length"), (t = Xo.ERROR); break; } 0 === s ? (t = Xo.INIT) : ((this._block0Read = s), (t = Xo.BLOCK_0)); break; case 1: (t = Xo.BLOCK_1), (this._literalTable = ca), (this._distanceTable = sa); break; case 2: if (((n - o) << 3) + i < 26) return !0; for (; i < 14; ) (r |= e[o++] << i), (i += 8); var l = 4 + ((r >> 10) & 15); if (((n - o) << 3) + i < 14 + 3 * l) return !0; var c = { numLiteralCodes: 257 + (31 & r), numDistanceCodes: 1 + ((r >> 5) & 31), codeLengthTable: void 0, bitLengths: void 0, codesRead: 0, dupBits: 0, }; (r >>= 14), (i -= 14); for (var h = new Uint8Array(19), p = 0; p < l; ++p) i < 3 && ((r |= e[o++] << i), (i += 8)), (h[ia[p]] = 7 & r), (r >>= 3), (i -= 3); for (; p < 19; p++) h[ia[p]] = 0; (c.bitLengths = new Uint8Array( c.numLiteralCodes + c.numDistanceCodes )), (c.codeLengthTable = ma(h)), (this._block2State = c), (t = Xo.BLOCK_2_PRE); break; default: return ( this._error("inflate: unsupported block type"), (t = Xo.ERROR), !1 ); } return ( (this._isFinalBlock = !!(1 & a)), (this._state = t), (this._bufferPosition = o), (this._bitBuffer = r), (this._bitLength = i), !1 ); }), (n.prototype._error = function (t) { this.onError && this.onError(t); }), (n.prototype._decodeBlock0 = function () { var t = this._bufferPosition, e = this._windowPosition, n = this._block0Read, r = 65794 - e, i = this._bufferSize - t, o = i < n, a = Math.min(r, i, n); return ( this._window.set(this._buffer.subarray(t, t + a), e), (this._windowPosition = e + a), (this._bufferPosition = t + a), (this._block0Read = n - a), n === a ? ((this._state = Xo.INIT), !1) : o && r < i ); }), (n.prototype._readBits = function (t) { var e = this._bitBuffer, n = this._bitLength; if (t > n) { var r = this._bufferPosition, i = this._bufferSize; do { if (r >= i) return ( (this._bufferPosition = r), (this._bitBuffer = e), (this._bitLength = n), -1 ); (e |= this._buffer[r++] << n), (n += 8); } while (t > n); this._bufferPosition = r; } return ( (this._bitBuffer = e >> t), (this._bitLength = n - t), e & ((1 << t) - 1) ); }), (n.prototype._readCode = function (t) { var e = this._bitBuffer, n = this._bitLength, r = t.maxBits; if (r > n) { var i = this._bufferPosition, o = this._bufferSize; do { if (i >= o) return ( (this._bufferPosition = i), (this._bitBuffer = e), (this._bitLength = n), -1 ); (e |= this._buffer[i++] << n), (n += 8); } while (r > n); this._bufferPosition = i; } var a = t.codes[e & ((1 << r) - 1)], s = a >> 16; return 32768 & a ? (this._error("inflate: invalid encoding"), (this._state = Xo.ERROR), -1) : ((this._bitBuffer = e >> s), (this._bitLength = n - s), 65535 & a); }), (n.prototype._decodeBlock2Pre = function () { var t = this._block2State, e = t.numLiteralCodes + t.numDistanceCodes, n = t.bitLengths, r = t.codesRead, i = r > 0 ? n[r - 1] : 0, o = t.codeLengthTable; if (t.dupBits > 0) { if ((s = this._readBits(t.dupBits)) < 0) return !0; for (; s--; ) n[r++] = i; t.dupBits = 0; } for (; r < e; ) { var a = this._readCode(o); if (a < 0) return (t.codesRead = r), !0; if (a < 16) n[r++] = i = a; else { var s, u; switch (a) { case 16: (u = 2), (s = 3), (a = i); break; case 17: (u = 3), (s = 3), (a = 0); break; case 18: (u = 7), (s = 11), (a = 0); } for (; s--; ) n[r++] = a; if ((s = this._readBits(u)) < 0) return (t.codesRead = r), (t.dupBits = u), !0; for (; s--; ) n[r++] = a; i = a; } } return ( (this._literalTable = ma(n.subarray(0, t.numLiteralCodes))), (this._distanceTable = ma(n.subarray(t.numLiteralCodes))), (this._state = Xo.BLOCK_2), (this._block2State = null), !1 ); }), (n.prototype._decodeBlock = function () { var t, e, n, r, i, o, a, s = this._literalTable, u = this._distanceTable, l = this._window, c = this._windowPosition, h = this._copyState; if (0 !== h.state) switch (h.state) { case 1: if (((e = 0), (e = this._readBits(h.lenBits)) < 0)) return !0; (h.len += e), (h.state = 2); case 2: if ((n = this._readCode(u)) < 0) return !0; (h.distBits = aa[n]), (h.dist = oa[n]), (h.state = 3); case 3: if ( ((e = 0), h.distBits > 0 && (e = this._readBits(h.distBits)) < 0) ) return !0; for (o = h.dist + e, r = h.len, t = c - o; r--; ) l[c++] = l[t++]; if (((h.state = 0), c >= da)) return (this._windowPosition = c), !1; } do { if ((n = this._readCode(s)) < 0) return (this._windowPosition = c), !0; if (n < 256) l[c++] = n; else { if (!(n > 256)) { this._state = Xo.INIT; break; } if ( ((this._windowPosition = c), (i = la[(n -= 257)]), (r = ua[n]), (e = 0 === i ? 0 : this._readBits(i)) < 0) ) return (h.state = 1), (h.len = r), (h.lenBits = i), !0; if (((r += e), (n = this._readCode(u)) < 0)) return (h.state = 2), (h.len = r), !0; if ( ((a = aa[n]), (o = oa[n]), (e = 0 === a ? 0 : this._readBits(a)) < 0) ) return ( (h.state = 3), (h.len = r), (h.dist = o), (h.distBits = a), !0 ); for (t = c - (o += e); r--; ) l[c++] = l[t++]; } } while (c < da); return (this._windowPosition = c), !1; }), n ); })(fa), _a = !1; function ma(t) { for ( var e = Math.max.apply(null, t), n = t.length, r = 1 << e, i = new Uint32Array(r), o = (e << 16) | 65535, a = 0; a < r; a++ ) i[a] = o; for (var s = 0, u = 1, l = 2; u <= e; s <<= 1, ++u, l <<= 1) for (var c = 0; c < n; ++c) if (t[c] === u) { for (var h = 0, p = 0; p < u; ++p) h = 2 * h + ((s >> p) & 1); for (p = h; p < r; p += l) i[p] = (u << 16) | c; ++s; } return { codes: i, maxBits: e }; } !(function (t) { (t[(t.WRITE = 0)] = "WRITE"), (t[(t.DONE = 1)] = "DONE"), (t[(t.ZLIB_HEADER = 2)] = "ZLIB_HEADER"); })(ha || (ha = {})); var ya = (function () { function t() { (this.a = 1), (this.b = 0); } return ( (t.prototype.update = function (t, e, n) { for (var r = this.a, i = this.b, o = e; o < n; ++o) i = (i + (r = (r + (255 & t[o])) % 65521)) % 65521; (this.a = r), (this.b = i); }), (t.prototype.getChecksum = function () { return (this.b << 16) | this.a; }), t ); })(), Aa = (function () { function t(t) { (this._writeZlibHeader = t), (this._state = t ? ha.ZLIB_HEADER : ha.WRITE), (this._adler32 = t ? new ya() : null); } return ( (t.prototype.push = function (t) { this._state === ha.ZLIB_HEADER && (this.onData(new Uint8Array([120, 156])), (this._state = ha.WRITE)); for ( var e = t.length, n = e + 5 * Math.ceil(e / 65535), r = new Uint8Array(n), i = 0, o = 0; e > 65535; ) r.set(new Uint8Array([0, 255, 255, 0, 0]), i), (i += 5), r.set(t.subarray(o, o + 65535), i), (o += 65535), (i += 65535), (e -= 65535); r.set( new Uint8Array([ 0, 255 & e, (e >> 8) & 255, 255 & ~e, (~e >> 8) & 255, ]), i ), (i += 5), r.set(t.subarray(o, e), i), this.onData(r), this._adler32 && this._adler32.update(t, 0, e); }), (t.prototype.close = function () { if ( ((this._state = ha.DONE), this.onData(new Uint8Array([1, 0, 0, 255, 255])), this._adler32) ) { var t = this._adler32.getChecksum(); this.onData( new Uint8Array([ 255 & t, (t >> 8) & 255, (t >> 16) & 255, (t >>> 24) & 255, ]) ); } }), t ); })(), va = (function () { function t() { (this.available = 0), (this.pos = 0), (this.buffer = new Uint8Array(2e3)); } return ( (t.prototype.append = function (t) { var e = this.pos + this.available, n = e + t.length; if (n > this.buffer.length) { for (var r = 2 * this.buffer.length; r < n; ) r *= 2; var i = new Uint8Array(r); i.set(this.buffer), (this.buffer = i); } this.buffer.set(t, e), (this.available += t.length); }), (t.prototype.compact = function () { 0 !== this.available && (this.buffer.set( this.buffer.subarray(this.pos, this.pos + this.available), 0 ), (this.pos = 0)); }), (t.prototype.readByte = function () { if (this.available <= 0) throw new Error("Unexpected end of file"); return this.available--, this.buffer[this.pos++]; }), t ); })(), ba = (function () { function t(t) { (this.onData = t), (this.processed = 0); } return ( (t.prototype.writeBytes = function (t) { this.onData.call(null, t), (this.processed += t.length); }), t ); })(), Ca = (function () { function t(t) { (this.outStream = t), (this.buf = null), (this.pos = 0), (this.size = 0), (this.isFull = !1), (this.writePos = 0), (this.totalPos = 0); } return ( (t.prototype.create = function (t) { (this.buf = new Uint8Array(t)), (this.pos = 0), (this.size = t), (this.isFull = !1), (this.writePos = 0), (this.totalPos = 0); }), (t.prototype.putByte = function (t) { this.totalPos++, (this.buf[this.pos++] = t), this.pos === this.size && (this.flush(), (this.pos = 0), (this.isFull = !0)); }), (t.prototype.getByte = function (t) { return this.buf[ t <= this.pos ? this.pos - t : this.size - t + this.pos ]; }), (t.prototype.flush = function () { this.writePos < this.pos && (this.outStream.writeBytes( this.buf.subarray(this.writePos, this.pos) ), (this.writePos = this.pos === this.size ? 0 : this.pos)); }), (t.prototype.copyMatch = function (t, e) { for ( var n = this.pos, r = this.size, i = this.buf, o = t <= n ? n - t : r - t + n, a = e; a > 0; ) { for ( var s = Math.min(Math.min(a, r - n), r - o), u = 0; u < s; u++ ) { var l = i[o++]; i[n++] = l; } n === r && ((this.pos = n), this.flush(), (n = 0), (this.isFull = !0)), o === r && (o = 0), (a -= s); } (this.pos = n), (this.totalPos += e); }), (t.prototype.checkDistance = function (t) { return t <= this.pos || this.isFull; }), (t.prototype.isEmpty = function () { return 0 === this.pos && !this.isFull; }), t ); })(); function Ia(t) { for (var e = new Uint16Array(t), n = 0; n < t; n++) e[n] = 1024; return e; } var Ea = 1 << 24, xa = (function () { function t(t) { (this.inStream = t), (this.range = 0), (this.code = 0), (this.corrupted = !1); } return ( (t.prototype.init = function () { 0 !== this.inStream.readByte() && (this.corrupted = !0), (this.range = -1); for (var t = 0, e = 0; e < 4; e++) t = (t << 8) | this.inStream.readByte(); t === this.range && (this.corrupted = !0), (this.code = t); }), (t.prototype.isFinishedOK = function () { return 0 === this.code; }), (t.prototype.decodeDirectBits = function (t) { var e = 0, n = this.range, r = this.code; do { var i = (r = (r - (n = (n >>> 1) | 0)) | 0) >> 31; (r = (r + (n & i)) | 0) === n && (this.corrupted = !0), n >= 0 && n < Ea && ((n <<= 8), (r = (r << 8) | this.inStream.readByte())), (e = ((e << 1) + i + 1) | 0); } while (--t); return (this.range = n), (this.code = r), e; }), (t.prototype.decodeBit = function (t, e) { var n, r = this.range, i = this.code, o = t[e], a = (r >>> 11) * o; return ( i >>> 0 < a ? ((o = (o + ((2048 - o) >> 5)) | 0), (r = 0 | a), (n = 0)) : ((o = (o - (o >> 5)) | 0), (i = (i - a) | 0), (r = (r - a) | 0), (n = 1)), (t[e] = 65535 & o), r >= 0 && r < Ea && ((r <<= 8), (i = (i << 8) | this.inStream.readByte())), (this.range = r), (this.code = i), n ); }), t ); })(); function wa(t, e, n, r) { for (var i = 1, o = 0, a = 0; a < n; a++) { var s = r.decodeBit(t, i + e); (i = (i << 1) + s), (o |= s << a); } return o; } var Sa = (function () { function t(t) { (this.numBits = t), (this.probs = Ia(1 << t)); } return ( (t.prototype.decode = function (t) { for (var e = 1, n = 0; n < this.numBits; n++) e = (e << 1) + t.decodeBit(this.probs, e); return e - (1 << this.numBits); }), (t.prototype.reverseDecode = function (t) { return wa(this.probs, 0, this.numBits, t); }), t ); })(); function Da(t, e) { var n = []; n.length = e; for (var r = 0; r < e; r++) n[r] = new Sa(t); return n; } var Ta = 12, Pa = (function () { function t() { (this.choice = Ia(2)), (this.lowCoder = Da(3, 16)), (this.midCoder = Da(3, 16)), (this.highCoder = new Sa(8)); } return ( (t.prototype.decode = function (t, e) { return 0 === t.decodeBit(this.choice, 0) ? this.lowCoder[e].decode(t) : 0 === t.decodeBit(this.choice, 1) ? 8 + this.midCoder[e].decode(t) : 16 + this.highCoder.decode(t); }), t ); })(); function Oa(t) { return t < 4 ? 0 : t < 10 ? t - 3 : t - 6; } function Ba(t) { return t < 7 ? 7 : 10; } function Ma(t) { return t < 7 ? 8 : 11; } function La(t) { return t < 7 ? 9 : 11; } var Na, Ra = (function () { function t(t, e) { (this.rangeDec = new xa(t)), (this.outWindow = new Ca(e)), (this.markerIsMandatory = !1), (this.lc = 0), (this.pb = 0), (this.lp = 0), (this.dictSize = 0), (this.dictSizeInProperties = 0), (this.unpackSize = void 0), (this.leftToUnpack = void 0), (this.reps = new Int32Array(4)), (this.state = 0); } return ( (t.prototype.decodeProperties = function (t) { var e = t[0]; if (e >= 225) throw new Error("Incorrect LZMA properties"); (this.lc = e % 9), (e = (e / 9) | 0), (this.pb = (e / 5) | 0), (this.lp = e % 5), (this.dictSizeInProperties = 0); for (var n = 0; n < 4; n++) this.dictSizeInProperties |= t[n + 1] << (8 * n); (this.dictSize = this.dictSizeInProperties), this.dictSize < 4096 && (this.dictSize = 4096); }), (t.prototype.create = function () { this.outWindow.create(this.dictSize), this.init(), this.rangeDec.init(), (this.reps[0] = 0), (this.reps[1] = 0), (this.reps[2] = 0), (this.reps[3] = 0), (this.state = 0), (this.leftToUnpack = this.unpackSize); }), (t.prototype.decodeLiteral = function (t, e) { var n = this.outWindow, r = this.rangeDec, i = 0; n.isEmpty() || (i = n.getByte(1)); var o = 1, a = 768 * (((n.totalPos & ((1 << this.lp) - 1)) << this.lc) + (i >> (8 - this.lc))); if (t >= 7) { var s = n.getByte(e + 1); do { var u = (s >> 7) & 1; s <<= 1; var l = r.decodeBit(this.litProbs, a + (((1 + u) << 8) + o)); if (((o = (o << 1) | l), u !== l)) break; } while (o < 256); } for (; o < 256; ) o = (o << 1) | r.decodeBit(this.litProbs, a + o); return (o - 256) & 255; }), (t.prototype.decodeDistance = function (t) { var e = t; e > 3 && (e = 3); var n = this.rangeDec, r = this.posSlotDecoder[e].decode(n); if (r < 4) return r; var i = (r >> 1) - 1, o = (2 | (1 & r)) << i; return (o = r < 14 ? (o + wa(this.posDecoders, o - r, i, n)) | 0 : ((o = (o + (n.decodeDirectBits(i - 4) << 4)) | 0) + this.alignDecoder.reverseDecode(n)) | 0); }), (t.prototype.init = function () { (this.litProbs = Ia(768 << (this.lc + this.lp))), (this.posSlotDecoder = Da(6, 4)), (this.alignDecoder = new Sa(4)), (this.posDecoders = Ia(115)), (this.isMatch = Ia(192)), (this.isRep = Ia(Ta)), (this.isRepG0 = Ia(Ta)), (this.isRepG1 = Ia(Ta)), (this.isRepG2 = Ia(Ta)), (this.isRep0Long = Ia(192)), (this.lenDecoder = new Pa()), (this.repLenDecoder = new Pa()); }), (t.prototype.decode = function (t) { for ( var e = this.rangeDec, n = this.outWindow, r = this.pb, i = this.dictSize, o = this.markerIsMandatory, a = this.leftToUnpack, s = this.isMatch, u = this.isRep, l = this.isRepG0, c = this.isRepG1, h = this.isRepG2, p = this.isRep0Long, d = this.lenDecoder, f = this.repLenDecoder, g = this.reps[0], _ = this.reps[1], m = this.reps[2], y = this.reps[3], A = this.state; ; ) { if (t && e.inStream.available < 48) { this.outWindow.flush(); break; } if (0 === a && !o && (this.outWindow.flush(), e.isFinishedOK())) return Ua; var v = n.totalPos & ((1 << r) - 1); if (0 !== e.decodeBit(s, (A << 4) + v)) { var b; if (0 !== e.decodeBit(u, A)) { if (0 === a) return Fa; if (n.isEmpty()) return Fa; var C; if (0 === e.decodeBit(l, A)) { if (0 === e.decodeBit(p, (A << 4) + v)) { (A = La(A)), n.putByte(n.getByte(g + 1)), a--; continue; } } else 0 === e.decodeBit(c, A) ? (C = _) : (0 === e.decodeBit(h, A) ? (C = m) : ((C = y), (y = m)), (m = _)), (_ = g), (g = C); (b = f.decode(e, v)), (A = Ma(A)); } else { if ( ((y = m), (m = _), (_ = g), (b = d.decode(e, v)), (A = Ba(A)), -1 === (g = this.decodeDistance(b))) ) return this.outWindow.flush(), e.isFinishedOK() ? ka : Fa; if (0 === a) return Fa; if (g >= i || !n.checkDistance(g)) return Fa; } b += 2; var I = !1; if ( (void 0 !== a && a < b && ((b = a), (I = !0)), n.copyMatch(g + 1, b), (a -= b), I) ) return Fa; } else { if (0 === a) return Fa; n.putByte(this.decodeLiteral(A, g)), (A = Oa(A)), a--; } } return ( (this.state = A), (this.reps[0] = g), (this.reps[1] = _), (this.reps[2] = m), (this.reps[3] = y), (this.leftToUnpack = a), ja ); }), (t.prototype.flushOutput = function () { this.outWindow.flush(); }), t ); })(), Fa = 0, ka = 1, Ua = 2, ja = 3; !(function (t) { (t[(t.WAIT_FOR_LZMA_HEADER = 0)] = "WAIT_FOR_LZMA_HEADER"), (t[(t.WAIT_FOR_SWF_HEADER = 1)] = "WAIT_FOR_SWF_HEADER"), (t[(t.PROCESS_DATA = 2)] = "PROCESS_DATA"), (t[(t.CLOSED = 3)] = "CLOSED"), (t[(t.ERROR = 4)] = "ERROR"); })(Na || (Na = {})); var Va = (function () { function t(t) { void 0 === t && (t = !1), (this._state = t ? Na.WAIT_FOR_SWF_HEADER : Na.WAIT_FOR_LZMA_HEADER), (this.buffer = null); } return ( (t.prototype.push = function (t) { if (this._state < Na.PROCESS_DATA) { var e = this.buffer ? this.buffer.length : 0, n = 5 + (this._state === Na.WAIT_FOR_SWF_HEADER ? 17 : 13); if (e + t.length < n) { var r = new Uint8Array(e + t.length); return ( e > 0 && r.set(this.buffer), r.set(t, e), void (this.buffer = r) ); } var i = new Uint8Array(n); if ( (e > 0 && i.set(this.buffer), i.set(t.subarray(0, n - e), e), (this._inStream = new va()), this._inStream.append(i.subarray(n - 5)), (this._outStream = new ba( function (t) { this.onData.call(null, t); }.bind(this) )), (this._decoder = new Ra(this._inStream, this._outStream)), this._state === Na.WAIT_FOR_SWF_HEADER) ) this._decoder.decodeProperties(i.subarray(12, 17)), (this._decoder.markerIsMandatory = !1), (this._decoder.unpackSize = ((i[4] | (i[5] << 8) | (i[6] << 16) | (i[7] << 24)) >>> 0) - 8); else { this._decoder.decodeProperties(i.subarray(0, 5)); for (var o = 0, a = !1, s = 0; s < 8; s++) { var u = i[5 + s]; 255 !== u && (a = !0), (o |= u << (8 * s)); } (this._decoder.markerIsMandatory = !a), (this._decoder.unpackSize = a ? o : void 0); } this._decoder.create(), (t = t.subarray(n)), (this._state = Na.PROCESS_DATA); } else if (this._state !== Na.PROCESS_DATA) return; try { this._inStream.append(t); var l = this._decoder.decode(!0); this._inStream.compact(), l !== ja && this._checkError(l); } catch (t) { this._decoder.flushOutput(), (this._decoder = null), this._error(t); } }), (t.prototype.close = function () { if (this._state === Na.PROCESS_DATA) { this._state = Na.CLOSED; try { var t = this._decoder.decode(!1); this._checkError(t); } catch (t) { this._decoder.flushOutput(), this._error(t); } this._decoder = null; } }), (t.prototype._error = function (t) { (this._state = Na.ERROR), this.onError && this.onError(t); }), (t.prototype._checkError = function (t) { var e; t === Fa ? (e = "LZMA decoding error") : t === ja ? (e = "Decoding is not complete") : t === ka ? void 0 !== this._decoder.unpackSize && this._decoder.unpackSize !== this._outStream.processed && (e = "Finished with end marker before than specified size") : (e = "Internal LZMA Error"), e && this._error(e); }), t ); })(); function Qa(t) { return "string" == typeof t ? t : null == t ? null : t + ""; } for ( var Ga, za = (function () { return function (t, e, n) { (this.buffer = t), (this.length = e), (this.littleEndian = n); }; })(), Ha = new Uint32Array(33), Xa = 1, Ya = 0; Xa <= 32; Xa++ ) Ha[Xa] = Ya = (Ya << 1) | 1; !(function (t) { (t[(t.U8 = 1)] = "U8"), (t[(t.I32 = 2)] = "I32"), (t[(t.F32 = 4)] = "F32"); })(Ga || (Ga = {})); var qa, Ka = (function () { function t(e) { void 0 === e && (e = t.INITIAL_SIZE), this._buffer || ((this._buffer = new ArrayBuffer(e)), (this._length = 0), (this._position = 0), this._resetViews(), (this._littleEndian = t._nativeLittleEndian), (this._bitBuffer = 0), (this._bitLength = 0)); } return ( (t.FromArrayBuffer = function (e, n) { void 0 === n && (n = -1); var r = Object.create(t.prototype); return ( (r._buffer = e), (r._length = -1 === n ? e.byteLength : n), (r._position = 0), r._resetViews(), (r._littleEndian = t._nativeLittleEndian), (r._bitBuffer = 0), (r._bitLength = 0), r ); }), (t.FromPlainObject = function (e) { var n = t.FromArrayBuffer(e.buffer, e.length); return (n._littleEndian = e.littleEndian), n; }), (t.prototype.toPlainObject = function () { return new za(this._buffer, this._length, this._littleEndian); }), (t.prototype.clone = function () { var e = t.FromArrayBuffer( new Uint8Array(this._u8).buffer, this._length ); return ( (e._position = this._position), (e._littleEndian = this._littleEndian), (e._bitBuffer = this._bitBuffer), (e._bitLength = this._bitLength), e ); }), (t.prototype._resetViews = function () { (this._u8 = new Uint8Array(this._buffer)), (this._i32 = null), (this._f32 = null); }), (t.prototype._requestViews = function (t) { 0 == (3 & this._buffer.byteLength) && (null === this._i32 && t & Ga.I32 && (this._i32 = new Int32Array(this._buffer)), null === this._f32 && t & Ga.F32 && (this._f32 = new Float32Array(this._buffer))); }), (t.prototype.getBytes = function () { return new Uint8Array(this._buffer, 0, this._length); }), (t.prototype._ensureCapacity = function (e) { var n = this._buffer; if (!(n.byteLength >= e)) { for (var r = Math.max(n.byteLength, 1); r < e; ) r *= 2; r > 4294967295 && (Po(this.sec), this.sec.throwError("RangeError", Yo)); var i = t._arrayBufferPool.acquire(r), o = this._u8; (this._buffer = i), this._resetViews(), this._u8.set(o); for (var a = this._u8, s = o.length; s < a.length; s++) a[s] = 0; t._arrayBufferPool.release(n); } }), (t.prototype.clear = function () { (this._length = 0), (this._position = 0); }), (t.prototype.readBoolean = function () { return 0 !== this.readUnsignedByte(); }), (t.prototype.readByte = function () { return (this.readUnsignedByte() << 24) >> 24; }), (t.prototype.readUnsignedByte = function () { return ( this._position + 1 > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)), this._u8[this._position++] ); }), (t.prototype.readBytes = function (t, e, n) { var r = this._position; (e >>>= 0), 0 === (n >>>= 0) && (n = this._length - r), r + n > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)), t.length < e + n && (t._ensureCapacity(e + n), (t.length = e + n)), t._u8.set(new Uint8Array(this._buffer, r, n), e), (this._position += n); }), (t.prototype.readShort = function () { return (this.readUnsignedShort() << 16) >> 16; }), (t.prototype.readUnsignedShort = function () { var t = this._u8, e = this._position; e + 2 > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)); var n = t[e + 0], r = t[e + 1]; return ( (this._position = e + 2), this._littleEndian ? (r << 8) | n : (n << 8) | r ); }), (t.prototype.readInt = function () { var t = this._u8, e = this._position; e + 4 > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)); var n = t[e + 0], r = t[e + 1], i = t[e + 2], o = t[e + 3]; return ( (this._position = e + 4), this._littleEndian ? (o << 24) | (i << 16) | (r << 8) | n : (n << 24) | (r << 16) | (i << 8) | o ); }), (t.prototype.readUnsignedInt = function () { return this.readInt() >>> 0; }), (t.prototype.readFloat = function () { var t = this._position; if ( (t + 4 > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)), (this._position = t + 4), this._requestViews(Ga.F32), this._littleEndian && 0 == (3 & t) && this._f32) ) return this._f32[t >> 2]; var e = this._u8, n = ko.u8; return ( this._littleEndian ? ((n[0] = e[t + 0]), (n[1] = e[t + 1]), (n[2] = e[t + 2]), (n[3] = e[t + 3])) : ((n[3] = e[t + 0]), (n[2] = e[t + 1]), (n[1] = e[t + 2]), (n[0] = e[t + 3])), ko.f32[0] ); }), (t.prototype.readDouble = function () { var t = this._u8, e = this._position; e + 8 > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)); var n = ko.u8; return ( this._littleEndian ? ((n[0] = t[e + 0]), (n[1] = t[e + 1]), (n[2] = t[e + 2]), (n[3] = t[e + 3]), (n[4] = t[e + 4]), (n[5] = t[e + 5]), (n[6] = t[e + 6]), (n[7] = t[e + 7])) : ((n[0] = t[e + 7]), (n[1] = t[e + 6]), (n[2] = t[e + 5]), (n[3] = t[e + 4]), (n[4] = t[e + 3]), (n[5] = t[e + 2]), (n[6] = t[e + 1]), (n[7] = t[e + 0])), (this._position = e + 8), ko.f64[0] ); }), (t.prototype.writeBoolean = function (t) { this.writeByte(t ? 1 : 0); }), (t.prototype.writeByte = function (t) { var e = this._position + 1; this._ensureCapacity(e), (this._u8[this._position++] = t), e > this._length && (this._length = e); }), (t.prototype.writeUnsignedByte = function (t) { var e = this._position + 1; this._ensureCapacity(e), (this._u8[this._position++] = t), e > this._length && (this._length = e); }), (t.prototype.writeRawBytes = function (t) { var e = this._position + t.length; this._ensureCapacity(e), this._u8.set(t, this._position), (this._position = e), e > this._length && (this._length = e); }), (t.prototype.writeBytes = function (t, e, n) { No(t) && (Po(this.sec), this.sec.throwError("TypeError", qo, "bytes")), (e >>>= 0), (n >>>= 0), arguments.length < 2 && (e = 0), arguments.length < 3 && (n = 0), (e === Lo(e, 0, t.length) && e + n === Lo(e + n, 0, t.length)) || (Po(this.sec), this.sec.throwError("RangeError", Yo)), 0 === n && (n = t.length - e), this.writeRawBytes(new Uint8Array(t._buffer, e, n)); }), (t.prototype.writeShort = function (t) { this.writeUnsignedShort(t); }), (t.prototype.writeUnsignedShort = function (t) { var e = this._position; this._ensureCapacity(e + 2); var n = this._u8; this._littleEndian ? ((n[e + 0] = t), (n[e + 1] = t >> 8)) : ((n[e + 0] = t >> 8), (n[e + 1] = t)), (e += 2), (this._position = e), e > this._length && (this._length = e); }), (t.prototype.writeInt = function (t) { this.writeUnsignedInt(t); }), (t.prototype.write2Ints = function (t, e) { this.write2UnsignedInts(t, e); }), (t.prototype.write4Ints = function (t, e, n, r) { this.write4UnsignedInts(t, e, n, r); }), (t.prototype.writeUnsignedInt = function (e) { var n = this._position; if ( (this._ensureCapacity(n + 4), this._requestViews(Ga.I32), this._littleEndian === t._nativeLittleEndian && 0 == (3 & n) && this._i32) ) this._i32[n >> 2] = e; else { var r = this._u8; this._littleEndian ? ((r[n + 0] = e), (r[n + 1] = e >> 8), (r[n + 2] = e >> 16), (r[n + 3] = e >> 24)) : ((r[n + 0] = e >> 24), (r[n + 1] = e >> 16), (r[n + 2] = e >> 8), (r[n + 3] = e)); } (n += 4), (this._position = n), n > this._length && (this._length = n); }), (t.prototype.write2UnsignedInts = function (e, n) { var r = this._position; this._ensureCapacity(r + 8), this._requestViews(Ga.I32), this._littleEndian === t._nativeLittleEndian && 0 == (3 & r) && this._i32 ? ((this._i32[0 + (r >> 2)] = e), (this._i32[1 + (r >> 2)] = n), (r += 8), (this._position = r), r > this._length && (this._length = r)) : (this.writeUnsignedInt(e), this.writeUnsignedInt(n)); }), (t.prototype.write4UnsignedInts = function (e, n, r, i) { var o = this._position; this._ensureCapacity(o + 16), this._requestViews(Ga.I32), this._littleEndian === t._nativeLittleEndian && 0 == (3 & o) && this._i32 ? ((this._i32[0 + (o >> 2)] = e), (this._i32[1 + (o >> 2)] = n), (this._i32[2 + (o >> 2)] = r), (this._i32[3 + (o >> 2)] = i), (o += 16), (this._position = o), o > this._length && (this._length = o)) : (this.writeUnsignedInt(e), this.writeUnsignedInt(n), this.writeUnsignedInt(r), this.writeUnsignedInt(i)); }), (t.prototype.writeFloat = function (e) { var n = this._position; if ( (this._ensureCapacity(n + 4), this._requestViews(Ga.F32), this._littleEndian === t._nativeLittleEndian && 0 == (3 & n) && this._f32) ) this._f32[n >> 2] = e; else { var r = this._u8; ko.f32[0] = e; var i = ko.u8; this._littleEndian ? ((r[n + 0] = i[0]), (r[n + 1] = i[1]), (r[n + 2] = i[2]), (r[n + 3] = i[3])) : ((r[n + 0] = i[3]), (r[n + 1] = i[2]), (r[n + 2] = i[1]), (r[n + 3] = i[0])); } (n += 4), (this._position = n), n > this._length && (this._length = n); }), (t.prototype.write2Floats = function (e, n) { var r = this._position; this._ensureCapacity(r + 8), this._requestViews(Ga.F32), this._littleEndian === t._nativeLittleEndian && 0 == (3 & r) && this._f32 ? ((this._f32[0 + (r >> 2)] = e), (this._f32[1 + (r >> 2)] = n), (r += 8), (this._position = r), r > this._length && (this._length = r)) : (this.writeFloat(e), this.writeFloat(n)); }), (t.prototype.write6Floats = function (e, n, r, i, o, a) { var s = this._position; this._ensureCapacity(s + 24), this._requestViews(Ga.F32), this._littleEndian === t._nativeLittleEndian && 0 == (3 & s) && this._f32 ? ((this._f32[0 + (s >> 2)] = e), (this._f32[1 + (s >> 2)] = n), (this._f32[2 + (s >> 2)] = r), (this._f32[3 + (s >> 2)] = i), (this._f32[4 + (s >> 2)] = o), (this._f32[5 + (s >> 2)] = a), (s += 24), (this._position = s), s > this._length && (this._length = s)) : (this.writeFloat(e), this.writeFloat(n), this.writeFloat(r), this.writeFloat(i), this.writeFloat(o), this.writeFloat(a)); }), (t.prototype.writeDouble = function (t) { var e = this._position; this._ensureCapacity(e + 8); var n = this._u8; ko.f64[0] = t; var r = ko.u8; this._littleEndian ? ((n[e + 0] = r[0]), (n[e + 1] = r[1]), (n[e + 2] = r[2]), (n[e + 3] = r[3]), (n[e + 4] = r[4]), (n[e + 5] = r[5]), (n[e + 6] = r[6]), (n[e + 7] = r[7])) : ((n[e + 0] = r[7]), (n[e + 1] = r[6]), (n[e + 2] = r[5]), (n[e + 3] = r[4]), (n[e + 4] = r[3]), (n[e + 5] = r[2]), (n[e + 6] = r[1]), (n[e + 7] = r[0])), (e += 8), (this._position = e), e > this._length && (this._length = e); }), (t.prototype.readRawBytes = function () { return new Int8Array(this._buffer, 0, this._length); }), (t.prototype.writeUTF = function (t) { var e = Ro((t = Qa(t))); this.writeShort(e.length), this.writeRawBytes(e); }), (t.prototype.writeUTFBytes = function (t) { var e = Ro((t = Qa(t))); this.writeRawBytes(e); }), (t.prototype.readUTF = function () { return this.readUTFBytes(this.readShort()); }), (t.prototype.readUTFBytes = function (t) { t >>>= 0; var e = this._position; return ( e + t > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)), (this._position += t), Fo(new Uint8Array(this._buffer, e, t)) ); }), Object.defineProperty(t.prototype, "length", { get: function () { return this._length; }, set: function (t) { (t >>>= 0) > this._buffer.byteLength && this._ensureCapacity(t), (this._length = t), (this._position = Lo(this._position, 0, this._length)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "bytesAvailable", { get: function () { return this._length - this._position; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "position", { get: function () { return this._position; }, set: function (t) { this._position = t >>> 0; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "buffer", { get: function () { return this._buffer; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "bytes", { get: function () { return this._u8; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "ints", { get: function () { return this._requestViews(Ga.I32), this._i32; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "objectEncoding", { get: function () { return this._objectEncoding; }, set: function (t) { (t >>>= 0), (this._objectEncoding = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "endian", { get: function () { return this._littleEndian ? "littleEndian" : "bigEndian"; }, set: function (e) { (e = Qa(e)), (this._littleEndian = "auto" === e ? t._nativeLittleEndian : "littleEndian" === e); }, enumerable: !0, configurable: !0, }), (t.prototype.toString = function () { return Fo(new Uint8Array(this._buffer, 0, this._length)); }), (t.prototype.toBlob = function (t) { return new Blob( [new Uint8Array(this._buffer, this._position, this._length)], { type: t } ); }), (t.prototype.writeMultiByte = function (t, e) { if (((t = Qa(t)), "UTF-8" == (e = Qa(e)))) { var n = Ro(t); this.writeRawBytes(n); } else console.log( "packageInternal flash.utils.ObjectOutput::writeMultiByte only encoding supported is UTF-8" ); }), (t.prototype.readMultiByte = function (t, e) { console.log("packageInternal flash.utils.ObjectInput::readMultiByte"); }), (t.prototype.getValue = function (t) { if (!((t |= 0) >= this._length)) return this._u8[t]; }), (t.prototype.setValue = function (t, e) { var n = (t |= 0) + 1; this._ensureCapacity(n), (this._u8[t] = e), n > this._length && (this._length = n); }), (t.prototype.readFixed = function () { return this.readInt() / 65536; }), (t.prototype.readFixed8 = function () { return this.readShort() / 256; }), (t.prototype.readFloat16 = function () { var t = this.readUnsignedShort(), e = t >> 15 ? -1 : 1, n = (31744 & t) >> 10, r = 1023 & t; return n ? 31 === n ? r ? NaN : e * (1 / 0) : e * Math.pow(2, n - 15) * (1 + r / 1024) : e * Math.pow(2, -14) * (r / 1024); }), (t.prototype.readEncodedU32 = function () { var t = this.readUnsignedByte(); return 128 & t && 16384 & (t = (127 & t) | (this.readUnsignedByte() << 7)) && 2097152 & (t = (16383 & t) | (this.readUnsignedByte() << 14)) && 268435456 & (t = (2097151 & t) | (this.readUnsignedByte() << 21)) ? (268435455 & t) | (this.readUnsignedByte() << 28) : t; }), (t.prototype.readBits = function (t) { return (this.readUnsignedBits(t) << (32 - t)) >> (32 - t); }), (t.prototype.readUnsignedBits = function (t) { for (var e = this._bitBuffer, n = this._bitLength; t > n; ) (e = (e << 8) | this.readUnsignedByte()), (n += 8); var r = (e >>> (n -= t)) & Ha[t]; return (this._bitBuffer = e), (this._bitLength = n), r; }), (t.prototype.readFixedBits = function (t) { return this.readBits(t) / 65536; }), (t.prototype.readString = function (t) { var e = this._position; if (t) e + t > this._length && (Po(this.sec), this.sec.throwError("flash.errors.EOFError", Ko)), (this._position += t); else { t = 0; for (var n = e; n < this._length && this._u8[n]; n++) t++; this._position += t + 1; } return Fo(new Uint8Array(this._buffer, e, t)); }), (t.prototype.align = function () { (this._bitBuffer = 0), (this._bitLength = 0); }), (t.prototype.deflate = function () { this.compress("deflate"); }), (t.prototype.inflate = function () { this.uncompress("deflate"); }), (t.prototype.compress = function (e) { var n; switch ((e = 0 === arguments.length ? "zlib" : Qa(e))) { case "zlib": n = new Aa(!0); break; case "deflate": n = new Aa(!1); break; default: return; } var r = new t(); (n.onData = r.writeRawBytes.bind(r)), n.push(this._u8.subarray(0, this._length)), n.close(), this._ensureCapacity(r._u8.length), this._u8.set(r._u8), (this.length = r.length), (this._position = 0); }), (t.prototype.uncompress = function (e) { var n; switch ((e = 0 === arguments.length ? "zlib" : Qa(e))) { case "zlib": n = fa.create(!0); break; case "deflate": n = fa.create(!1); break; case "lzma": n = new Va(!1); break; default: return; } var r, i = new t(); (n.onData = i.writeRawBytes.bind(i)), (n.onError = function (t) { return (r = t); }), n.push(this._u8.subarray(0, this._length)), r && (Po(this.sec), this.sec.throwError("IOError", Wo)), n.close(), this._ensureCapacity(i._u8.length), this._u8.set(i._u8), (this.length = i.length), (this._position = 0); }), (t._nativeLittleEndian = 1 === new Int8Array(new Int32Array([1]).buffer)[0]), (t.INITIAL_SIZE = 128), (t._arrayBufferPool = new Uo()), t ); })(); !(function (t) { (t[(t.Solid = 0)] = "Solid"), (t[(t.LinearGradient = 16)] = "LinearGradient"), (t[(t.RadialGradient = 18)] = "RadialGradient"), (t[(t.FocalRadialGradient = 19)] = "FocalRadialGradient"), (t[(t.RepeatingBitmap = 64)] = "RepeatingBitmap"), (t[(t.ClippedBitmap = 65)] = "ClippedBitmap"), (t[(t.NonsmoothedRepeatingBitmap = 66)] = "NonsmoothedRepeatingBitmap"), (t[(t.NonsmoothedClippedBitmap = 67)] = "NonsmoothedClippedBitmap"); })(qa || (qa = {})); var Wa, Ja = (function () { function t(e, n, r, i, o, a) { (this.commands = e), (this.data = n), (this.morphData = r), (this.prev = i), (this.next = o), (this.isReversed = a), (this.isValidFill = !0), (this.id = t._counter++); } return ( (t.FromDefaults = function (e) { var n = new Ka(), r = new Ka(); n.endian = r.endian = "auto"; var i = null; return ( e && ((i = new Ka()).endian = "auto"), new t(n, r, i, null, null, !1) ); }), (t.prototype.moveTo = function (t, e) { this.commands.writeUnsignedByte(9), this.data.write2Ints(t, e); }), (t.prototype.morphMoveTo = function (t, e, n, r) { this.moveTo(t, e), this.morphData.write2Ints(n, r); }), (t.prototype.lineTo = function (t, e) { this.commands.writeUnsignedByte(10), this.data.write2Ints(t, e); }), (t.prototype.morphLineTo = function (t, e, n, r) { this.lineTo(t, e), this.morphData.write2Ints(n, r); }), (t.prototype.curveTo = function (t, e, n, r) { this.commands.writeUnsignedByte(11), this.data.write4Ints(t, e, n, r); }), (t.prototype.morphCurveTo = function (t, e, n, r, i, o, a, s) { this.curveTo(t, e, n, r), this.morphData.write4Ints(i, o, a, s); }), (t.prototype.toReversed = function () { return ( Po(!this.isReversed), new t(this.commands, this.data, this.morphData, null, null, !0) ); }), (t.prototype.clone = function () { return new t( this.commands, this.data, this.morphData, null, null, this.isReversed ); }), (t.prototype.storeStartAndEnd = function () { var t = this.data.ints, e = t[0] + "," + t[1], n = (this.data.length >> 2) - 2, r = t[n] + "," + t[n + 1]; this.isReversed ? ((this.startPoint = r), (this.endPoint = e)) : ((this.startPoint = e), (this.endPoint = r)); }), (t.prototype.connectsTo = function (t) { return ( t !== this && (Po(this.endPoint), Po(t.startPoint), this.endPoint === t.startPoint) ); }), (t.prototype.startConnectsTo = function (t) { return t !== this && this.startPoint === t.startPoint; }), (t.prototype.flipDirection = function () { var t; (t = this.startPoint), (this.startPoint = this.endPoint), (this.endPoint = t), (this.isReversed = !this.isReversed); }), (t.prototype.serializeAJS = function (t, e, n) { if ((e && (e.morphSource = t.morphSource = !0), this.isReversed)) this._serializeReversedAJS(t, e, n); else { var r = this.commands.bytes, i = this.data.length >> 2, o = this.morphData ? this.morphData.ints : null, a = this.data.ints, s = 0; a[0] === n.x && a[1] === n.y && s++; for (var u = this.commands.length, l = 2 * s, c = s; c < u; c++) { switch (r[c]) { case 9: t.moveTo(a[l] / 20, a[l + 1] / 20), e && e.moveTo(o[l] / 20, o[l + 1] / 20); break; case 10: t.lineTo(a[l] / 20, a[l + 1] / 20), e && e.lineTo(o[l] / 20, o[l + 1] / 20); break; case 11: t.curveTo( a[l] / 20, a[l + 1] / 20, a[l + 2] / 20, a[l + 3] / 20 ), e && e.curveTo( o[l] / 20, o[l + 1] / 20, o[l + 2] / 20, o[l + 3] / 20 ), (l += 2); } l += 2; } (n.x = a[i - 2]), (n.y = a[i - 1]); } }), (t.prototype._serializeReversedAJS = function (t, e, n) { var r = this.commands.length, i = (this.data.length >> 2) - 2, o = this.commands.bytes; Po(9 === o[0]); var a = this.data.ints, s = this.morphData ? this.morphData.ints : null; if ( ((a[i] === n.x && a[i + 1] === n.y) || (t.moveTo(a[i] / 20, a[i + 1] / 20), e && e.moveTo(s[i] / 20, s[i + 1] / 20)), 1 === r) ) return (n.x = a[0]), void (n.y = a[1]); for (var u = r; u-- > 1; ) switch (((i -= 2), o[u])) { case 9: t.moveTo(a[i] / 20, a[i + 1] / 20), e && e.moveTo(s[i] / 20, s[i + 1] / 20); break; case 10: t.lineTo(a[i] / 20, a[i + 1] / 20), e && e.lineTo(s[i] / 20, s[i + 1] / 20); break; case 11: (i -= 2), t.curveTo( a[i + 2] / 20, a[i + 3] / 20, a[i] / 20, a[i + 1] / 20 ), e && e.curveTo( s[i + 2] / 20, s[i + 3] / 20, s[i] / 20, s[i + 1] / 20 ); } (n.x = a[0]), (n.y = a[1]); }), (t._counter = 0), t ); })(); !(function (t) { (t.LINEAR = "linear"), (t.RADIAL = "radial"); })(Wa || (Wa = {})); var $a, Za = (function () { function t(t) { this.fillStyle = t; } return ( Object.defineProperty(t.prototype, "data_type", { get: function () { return t.data_type; }, enumerable: !0, configurable: !0, }), (t.data_type = "[graphicsdata FillStyle]"), t ); })(), ts = (function () { function t(t, e, n, r, i, o, a, s) { if (e.length != n.length || e.length != r.length) throw "GradientFillStyle: Error - colors, alphas and ratios must be of same length"; (this.colors = e), (this.colors_r = []), (this.colors_g = []), (this.colors_b = []), (this.colors_r.length = this.colors_g.length = this.colors_g.length = this.colors.length), (this.alphas = n), (this.ratios = r), (this.matrix = i), (this.type = t), (this.uvRectangle = new K()), this.ratios.sort(function (t, e) { return t - e; }), (this.ratio_min = this.ratios[0]), (this.ratio_max = this.ratios[this.ratios.length - 1]); for (var u, l = e.length; l > 0; ) l--, (u = w.float32ColorToARGB(e[l])), (this.colors_r[l] = u[1]), (this.colors_g[l] = u[2]), (this.colors_b[l] = u[3]); } return ( (t.prototype.getUVMatrix = function () { if (this._uvMatrix) return this._uvMatrix; this.matrix || (this.matrix = new O()); var t, e = 1638.4, n = 819.2, r = this.matrix.a, i = this.matrix.b, o = this.matrix.c, a = this.matrix.d, s = this.matrix.tx, u = this.matrix.ty, l = a / (r * a - i * o), c = -i / (r * a - i * o), h = -o / (r * a - i * o), p = r / (r * a - i * o), d = (o * u - a * s) / (r * a - i * o), f = -(r * u - i * s) / (r * a - i * o); return ( this.type == Wa.LINEAR ? (t = new O( (l / e) * (1 - 1 / 256), 0, (h / e) * (1 - 1 / 256), 0, this.uvRectangle.x + ((d + n) / e) * (1 - 1 / 256), this.uvRectangle.y )) : this.type == Wa.RADIAL ? (t = new O( l / n, c / n, h / n, p / n, (d + n) / n - 1, (f + n) / n - 1 )) : (this._uvMatrix = this.matrix), (this._uvMatrix = t) ); }), (t.prototype.getColorAtPosition = function (t) { var e = -1, n = -1; if (t <= this.ratio_min) (e = 0), (n = 0); else if (t >= this.ratio_max) (e = this.ratios.length - 1), (n = this.ratios.length - 1); else for (var r = 0; r < this.ratios.length - 1; r++) { if (t == this.ratios[r]) { (e = r), (n = r); break; } if (t == this.ratios[r + 1]) { (e = r + 1), (n = r + 1); break; } if (t >= this.ratios[r] && t <= this.ratios[r + 1]) { (e = r), (n = r + 1); break; } } if (e == n) return [ this.alphas[e], this.colors_r[e], this.colors_g[e], this.colors_b[e], ]; var i = (t - this.ratios[e]) / (this.ratios[n] - this.ratios[e]), o = 1 - i; return [ this.alphas[n] * i + this.alphas[e] * o, this.colors_r[n] * i + this.colors_r[e] * o, this.colors_g[n] * i + this.colors_g[e] * o, this.colors_b[n] * i + this.colors_b[e] * o, ]; }), (t.prototype.toString = function () { for (var t = "", e = this.colors.length; e > 0; ) e--, (t += this.colors[e] + "#" + this.alphas[e] + "#" + this.ratios[e] + "#"); return t; }), Object.defineProperty(t.prototype, "data_type", { get: function () { return t.data_type; }, enumerable: !0, configurable: !0, }), (t.data_type = "[graphicsdata GradientFillStyle]"), t ); })(), es = (function () { function t(t, e, n, r) { (this.material = t), (this.matrix = e), (this.repeat = n), (this.smooth = r); } return ( Object.defineProperty(t.prototype, "data_type", { get: function () { return t.data_type; }, enumerable: !0, configurable: !0, }), (t.prototype.getUVMatrix = function () { this.matrix || (this.matrix = new O()), this._uvMatrix || (this._uvMatrix = new O()); var t, e, n = this.material.getTextureAt(0).getImageAt(0); n ? ((t = n.width), (e = n.height)) : (console.warn( "[BitmapFillStyle] - getUVMatrix - no texture found" ), (t = 512), (e = 512)); var r = this.matrix.a, i = this.matrix.b, o = this.matrix.c, a = this.matrix.d, s = this.matrix.tx, u = this.matrix.ty, l = a / (r * a - i * o), c = -i / (r * a - i * o), h = -o / (r * a - i * o), p = r / (r * a - i * o), d = (o * u - a * s) / (r * a - i * o), f = -(r * u - i * s) / (r * a - i * o); return ( (this._uvMatrix.a = l / t), (this._uvMatrix.b = c / e), (this._uvMatrix.c = h / t), (this._uvMatrix.d = p / e), (this._uvMatrix.tx = d / t), (this._uvMatrix.ty = f / e), this._uvMatrix ); }), (t.data_type = "[graphicsdata BitmapFillStyle]"), t ); })(), ns = (function () { function t(t, e) { void 0 === t && (t = 16777215), void 0 === e && (e = 1), (this.color = t), (this.alpha = e); } return ( (t.prototype.getUVMatrix = function () { return this.uvMatrix; }), Object.defineProperty(t.prototype, "data_type", { get: function () { return t.data_type; }, enumerable: !0, configurable: !0, }), (t.data_type = "[graphicsdata SolidFillStyle]"), t ); })(), rs = (function () { function t() {} return (t.ROUND = 1), (t.NONE = 0), (t.SQUARE = 2), t; })(), is = (function () { function t() {} return (t.BEVEL = 1), (t.MITER = 2), (t.ROUND = 0), t; })(), os = (function () { function t(t, e, n, r, i, o) { void 0 === e && (e = 10), void 0 === n && (n = is.ROUND), void 0 === r && (r = rs.SQUARE), void 0 === i && (i = 10), void 0 === o && (o = Eo.NORMAL), (this.fillStyle = t), (this.thickness = e), (this.jointstyle = n), (this.capstyle = r), (this.miterLimit = i), (this.scaleMode = o); } return ( Object.defineProperty(t.prototype, "half_thickness", { get: function () { return this.thickness / 2; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "data_type", { get: function () { return t.data_type; }, enumerable: !0, configurable: !0, }), (t.data_type = "[graphicsdata StrokeStyle]"), t ); })(), as = (function () { function t(t, e) { (this.fillStyle = t), (this.lineStyle = e), (this._head = null); } return ( (t.prototype.addSegment = function (t) { Po(t), Po(null === t.next), Po(null === t.prev); var e = this._head; e && (Po(t !== e), (e.next = t), (t.prev = e)), (this._head = t); }), (t.prototype.removeSegment = function (t) { t.prev && (t.prev.next = t.next), t.next && (t.next.prev = t.prev); }), (t.prototype.insertSegment = function (t, e) { var n = e.prev; (t.prev = n), (t.next = e), n && (n.next = t), (e.prev = t); }), (t.prototype.head = function () { return this._head; }), (t.prototype.rgbaToArgb = function (t) { return ( ((255 & t) << 24) | (((4278190080 & t) >>> 24) << 16) | (((16711680 & t) >>> 16) << 8) | ((65280 & t) >>> 8) ); }), (t.prototype.getAlpha = function (t) { return 255 & t; }), (t.prototype.rgbToArgb = function (t) { return ( (((4278190080 & t) >>> 24) << 24) | ((255 & t) << 16) | (((65280 & t) >>> 8) << 8) | ((16711680 & t) >>> 16) ); }), (t.prototype.applyStyle = function (t, e, n) { var r, i; switch ((void 0 === n && (n = !0), e.type)) { case qa.Solid: (e.alpha = (255 & e.color) / 255), (e.color = this.rgbaToArgb(e.color)), (i = new ns(e.color, e.alpha)); break; case qa.LinearGradient: case qa.RadialGradient: case qa.FocalRadialGradient: for ( var o = e.type === qa.LinearGradient ? Wa.LINEAR : Wa.RADIAL, a = [], s = 0; s < e.colors.length; s++ ) (a[s] = (255 & e.colors[s]) / 255), (e.colors[s] = this.rgbaToArgb(e.colors[s])); var u = new O( e.transform.a, e.transform.b, e.transform.c, e.transform.d, e.transform.tx, e.transform.ty ); i = new ts( o, e.colors, a, e.ratios, u, e.spreadMethod, e.interpolationMode, (e.focalPoint / 2) | 0 ); break; case qa.ClippedBitmap: case qa.RepeatingBitmap: case qa.NonsmoothedClippedBitmap: case qa.NonsmoothedRepeatingBitmap: u = new O( e.transform.a, e.transform.b, e.transform.c, e.transform.d, e.transform.tx, e.transform.ty ); i = new es(e.material, u, e.repeat, e.smooth); break; default: console.error("Unknown style type:", e.type); } if (n) r = new Za(i); else { var l = (0 | Lo(e.width, 0, 5100)) / 20, c = l <= 0.05 ? Eo.HAIRLINE : Eo.NORMAL; e.startCapsStyle != e.endCapsStyle && console.log("Warning: different end vs start capstyle"), (e.startCapsStyle = rs.ROUND), (e.jointStyle = 0), (r = new os( i, l, e.jointStyle, e.startCapsStyle, e.miterLimit, c )); } t.style = r; }), (t.prototype.serializeAJS = function (t, e) { var n = this.head(); if (n) { var r = !!this.fillStyle, i = r ? this.fillStyle : this.lineStyle, o = i.morph; for ( this.applyStyle(t, i, r), o && e && this.applyStyle(e, o, r); n; ) n.storeStartAndEnd(), (n = n.prev); for ( var a = this.head(), s = a, u = null, l = null, c = a.prev; a; ) { for (; c; ) c.startConnectsTo(a) && c.flipDirection(), c.connectsTo(a) ? (c.next !== a && (this.removeSegment(c), this.insertSegment(c, a)), (c = (a = c).prev)) : (c.startConnectsTo(s) && c.flipDirection(), s.connectsTo(c) ? (this.removeSegment(c), (s.next = c), (c = c.prev), (s.next.prev = s), (s.next.next = null), (s = s.next)) : (c = c.prev)); if ( ((c = a.prev), u ? ((l.next = a), (a.prev = l), ((l = s).next = null)) : ((u = a), (l = s)), !c) ) break; c = (a = s = c).prev; } var h = { x: 0, y: 0 }; for (c = u; c; ) c.isValidFill && c.serializeAJS(t, e, h), (c = c.next); return t; } }), t ); })(); !(function (t) { (t[(t.Commands = 32)] = "Commands"), (t[(t.Coordinates = 128)] = "Coordinates"), (t[(t.Styles = 16)] = "Styles"); })($a || ($a = {})); var ss = (function (t) { function n(e, n, r, i, o) { void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = 0), void 0 === o && (o = 0); var a = t.call(this) || this; return ( (a.usages = 0), (a.count = 0), (a.offset = 0), (a.particleCollection = null), (a.originalFillStyle = null), (a._isSimpleRect = !1), (a.deepHitCheck = !0), (a._onInvalidatePropertiesDelegate = function (t) { return a._onInvalidateProperties(t); }), (a._onInvalidateVerticesDelegate = function (t) { return a._onInvalidateVertices(t); }), (a._elements = e), a._elements.addEventListener( Xi.INVALIDATE_VERTICES, a._onInvalidateVerticesDelegate ), a._elements.usages++, (a._material = n), (a._style = r), a._style && a._style.addEventListener( Gi.INVALIDATE_PROPERTIES, a._onInvalidatePropertiesDelegate ), (a.count = i), (a.offset = o), a ); } return ( e(n, t), (n.getShape = function (t, e, r, i, o) { if ( (void 0 === e && (e = null), void 0 === r && (r = null), void 0 === i && (i = 0), void 0 === o && (o = 0), n._pool.length) ) { var a = n._pool.pop(); return ( (a.elements = t), (a.material = e), (a.style = r), (a.count = i), (a.offset = o), a ); } return new n(t, e, r, i, o); }), (n.clearPool = function () { n._pool = []; }), (n.quadElement = function (t, e, n) { void 0 === e && (e = 1), void 0 === n && (n = !1); for ( var r = [], i = [], o = t.width / e, a = t.height / e, s = t.x, u = t.y, l = 0; l < e; l++ ) for (var c = 0; c < e; c++) { var h = s + c * o, p = u + l * a, d = h + o, f = p + a; r.push(h, p, 0, d, f, 0, d, p, 0, h, p, 0, h, f, 0, d, f, 0), i && i.push( c / e, l / e, (c + 1) / e, (l + 1) / e, (c + 1) / e, l / e, c / e, l / e, c / e, (l + 1) / e, (c + 1) / e, (l + 1) / e ); } var g = new ao(); return g.setPositions(r), n && g.setUVs(i), g; }), (n.getElement = function (t) { var e = t.x, n = t.y, r = t.right, i = t.bottom, o = new ao(); return ( o.setPositions([ e, n, 0, r, n, 0, r, i, 0, e, n, 0, e, i, 0, r, i, 0, ]), o ); }), (n.getTriangleElement = function (t, e, r, i) { var o = this; void 0 === e && (e = !0), void 0 === r && (r = !1), void 0 === i && (i = 1); var a = t.toString(), s = e ? this._imageShapeElements[a] : null; return ( s || ((s = n.quadElement(t, i, r)), e && ((this._imageShapeElements[a] = s), s.addEventListener(c.CLEAR, function () { delete o._imageShapeElements[a], (s.usages = 0); }), s.usages++)), s ); }), Object.defineProperty(n.prototype, "isSimpleRect", { get: function () { var t; return ( this._isSimpleRect && (null === (t = this.originalFillStyle) || void 0 === t ? void 0 : t.data_type) === Za.data_type ); }, set: function (t) { this._isSimpleRect = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "elements", { get: function () { return this._elements; }, set: function (t) { this._elements != t && (this._elements && (this._elements.removeEventListener( Xi.INVALIDATE_VERTICES, this._onInvalidateVerticesDelegate ), this._elements.usages--, this._elements.usages || this._elements.dispose()), (this._elements = t), this._elements && (this._elements.addEventListener( Xi.INVALIDATE_VERTICES, this._onInvalidateVerticesDelegate ), this._elements.usages++), this.invalidateElements()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "material", { get: function () { return this._material; }, set: function (t) { this._material != t && ((this._material = t), this.invalidateMaterial()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "style", { get: function () { return this._style; }, set: function (t) { this._style != t && (this._style && this._style.removeEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidatePropertiesDelegate ), (this._style = t), this._style && this._style.addEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidatePropertiesDelegate ), this.invalidateStyle()); }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { t.prototype.clear.call(this), (this.usages = 0), (this.elements = null), (this.material = null), (this.style = null), (this.particleCollection = null), n._pool.push(this); }), (n.prototype.invalidateElements = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_ELEMENTS, this)); }), (n.prototype.invalidateMaterial = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_MATERIAL, this)); }), (n.prototype.invalidateStyle = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_STYLE, this)); }), (n.prototype._onInvalidateProperties = function (t) { this.invalidateStyle(); }), (n.prototype._onInvalidateVertices = function (t) { t.attributesView == t.target.positions && this.invalidate(); }), (n.prototype.applyTransformation = function (t) { this._elements.applyTransformation(t, this.count, this.offset); }), (n.prototype.scale = function (t) { this._elements.scale(t, this.count, this.offset); }), (n.prototype.scaleUV = function (t, e) { void 0 === t && (t = 1), void 0 === e && (e = 1), this._elements.scaleUV(t, e, this.count, this.offset); }), (n._pool = new Array()), (n.assetType = "[asset Shape]"), (n._imageShapeElements = {}), n ); })(f), us = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r.shape = e), r; } return ( e(n, t), Object.defineProperty(n.prototype, "isSimpleRect", { get: function () { var t, e = this.node.getMatrix3D().decompose()[1]; return ( !!(null === (t = this.shape) || void 0 === t ? void 0 : t.isSimpleRect) && Math.abs(e.z) < 1e-5 ); }, enumerable: !0, configurable: !0, }), (n.prototype.globalBounds = function () { return this.node .getMatrix3D() .transformBox( this.renderGroup.pickGroup .getBoundsPicker(this.node.partition) .getBoxBounds(this.node, !0, !0), this._globalBounds ); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this.shape = null); }), (n.prototype._getStageElements = function () { (this._offset = this.shape.offset), (this._count = this.shape.count); var t = this.node.getScale9Container(); if (t) return this.updateScale9( t.scale9Grid, t.transform.scale.x, t.transform.scale.y ).getAbstraction(this._stage); var e = this.node.container; return ( e.animator ? e.animator.getRenderableElements(this, this.shape.elements) : this.shape.elements ).getAbstraction(this._stage); }), (n.prototype._getRenderMaterial = function () { return ( this._asset.material || this.node.container.material || this.getDefaultMaterial() ).getAbstraction( this.renderGroup.getRenderElements(this.shape.elements) ); }), (n.prototype._getStyle = function () { return this._asset.style || this.node.container.style; }), (n.prototype.getDefaultMaterial = function () { return this.stageElements.elements instanceof So ? Fi.getDefaultColorMaterial() : Fi.getDefaultTextureMaterial(); }), (n.prototype.updateScale9 = function (t, e, n) { if (!this._scale9Elements) { var r = null, i = !1; this.shape.originalFillStyle instanceof es && (r = this.shape.originalFillStyle.getUVMatrix()), this.shape.elements instanceof ao && (i = !this.shape.elements.uvs && !!r), i && (this.shape.style.uvMatrix = null); var o = this.renderGroup.pickGroup .getBoundsPicker(this.node.partition) .getBoxBounds(this.node, !0, !0); this._scale9Elements = this.shape.elements.prepareScale9( o, t, !0, i, r ); } return ( (this._scaleX == e && this._scaleY == n) || ((this._scaleX = e), (this._scaleY = n), this._scale9Elements.updateScale9(e, n)), this._scale9Elements ); }), n ); })(Vi), ls = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._orientedBoxBoundsDirty = !0), (r._orientedSphereBoundsDirty = !0), (r._onInvalidateElementsDelegate = function (t) { return r._onInvalidateElements(t); }), r._asset.addEventListener( Ri.INVALIDATE_ELEMENTS, r._onInvalidateElementsDelegate ), r ); } return ( e(n, t), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), (this._orientedBoxBoundsDirty = !0), (this._orientedSphereBoundsDirty = !0); }), (n.prototype._onInvalidateElements = function (t) { (this._orientedBoxBoundsDirty = !0), (this._orientedSphereBoundsDirty = !0); }), (n.prototype.onClear = function (e) { this._asset.removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate ), t.prototype.onClear.call(this, e); }), (n.prototype.hitTestPoint = function (t, e, n) { var r = this.getBoxBounds(); return ( !(null == r || !r.contains(t, e, n)) && this._asset.elements.hitTestPoint( this._view, this._node, t, e, n, r, this._asset.count, this._asset.offset ) ); }), (n.prototype.getBoxBounds = function (t, e, n, r) { return ( void 0 === t && (t = null), void 0 === e && (e = !0), void 0 === n && (n = null), void 0 === r && (r = null), t ? this._asset.elements.getBoxBounds( this._view, this._node, e, t, n, r, this._asset.count, this._asset.offset ) : (this._orientedBoxBoundsDirty && ((this._orientedBoxBoundsDirty = !1), (this._orientedBoxBounds = this._asset.elements.getBoxBounds( this._view, this._node, e, null, this._orientedBoxBounds, null, this._asset.count, this._asset.offset ))), null != this._orientedBoxBounds && (r = this._orientedBoxBounds.union(r, r || n)), r) ); }), (n.prototype.getSphereBounds = function (t, e, n, r, i) { return ( void 0 === e && (e = null), void 0 === n && (n = !0), void 0 === r && (r = null), void 0 === i && (i = null), e ? this._asset.elements.getSphereBounds( this._view, t, e, n, r, i, this._asset.count, this._asset.offset ) : (this._orientedSphereBoundsDirty && ((this._orientedSphereBoundsDirty = !1), (this._orientedSphereBounds = this._asset.elements.getSphereBounds( this._view, t, null, n, this._orientedSphereBounds, null, this._asset.count, this._asset.offset ))), null != this._orientedSphereBounds && (i = this._orientedSphereBounds.union(i, i || r)), i) ); }), (n.prototype.testCollision = function (t, e) { var n = this.getBoxBounds(), r = this._asset; return ( !(null == n || !n.rayIntersection(t.rayPosition, t.rayDirection)) && (!r.deepHitCheck || r.elements.testCollision( this._view, t, n, e, this._asset.material || t.entityNode.entity.material, this._asset.count || this._asset.elements.numVertices, this._asset.offset )) ); }), n ); })(Ht); Qi.registerRenderable(us, ss), zt.registerPickable(ls, ss); var cs, hs, ps = (function () { function t() { (this.availableRows = 256), (this.gradientRow = -1), (this.colorRow = 256), (this.colorPosition = 0), (this.bitmap = new nn(256, 256, !0, null)), (this.availableRows = 256); } return ( (t.clearAllMaterials = function () { for (var e in t._allColors) t._allColors[e].material = null; for (var e in t._allGradients) t._allGradients[e].material = null; }), (t.getTextureForColor = function (e, n) { var r = (0 | e).toString(16) + "#" + ((255 * n) | 0).toString(16); if (r in this._allColors) return this._allColors[r]; for (var i, o = this._allTextureAtlas.length, a = 0; a < o; a++) if (this._allTextureAtlas[a].fitColor()) { i = this._allTextureAtlas[a]; break; } i || ((i = new t()), this._allTextureAtlas.push(i)); var s = { colorPos: i.addColor(e, n), bitmap: i.bitmap, material: null, uvRectangle: null, }; return (this._allColors[r] = s), s; }), (t.getTextureForGradient = function (e) { var n, r = e.toString(); if (r in this._allGradients) return ( (e.uvRectangle = this._allGradients[r].uvRectangle), this._allGradients[r] ); for (var i = this._allTextureAtlas.length, o = 0; o < i; o++) if (this._allTextureAtlas[o].fitGradient()) { n = this._allTextureAtlas[o]; break; } n || ((n = new t()), this._allTextureAtlas.push(n)), n.addGradient(e); var a = { colorPos: null, bitmap: n.bitmap, material: null, uvRectangle: e.uvRectangle.clone(), }; return (this._allGradients[r] = a), a; }), (t.prototype.fitGradient = function () { return this.availableRows > 0; }), (t.prototype.fitColor = function () { return this.availableRows > 0 || this.colorPosition > 0; }), (t.prototype.addGradient = function (t) { if (!(this.availableRows <= 0)) { this.gradientRow++, this.availableRows--; for (var e = 0; e < 256; e++) this.bitmap.setPixelFromArray( e, this.gradientRow, t.getColorAtPosition(e) ); return ( this.bitmap.invalidate(), (t.uvRectangle.x = 1 / 512), (t.uvRectangle.y = 1 / 512 + this.gradientRow / 256), (t.uvRectangle.width = 1 - 1 / 512), (t.uvRectangle.height = t.uvRectangle.y), this.availableRows ); } console.error( "[TextureAtlass] There are not free space for gradient:", t ); }), (t.prototype.addColor = function (t, e) { if ( (void 0 === e && (e = 1), this.colorPosition--, this.colorPosition < 0 && (this.colorRow--, this.availableRows--, (this.colorPosition = 255), this.availableRows < 0)) ) return ( (this.availableRows = 0), console.error( "[TextureAtlass] There are not free space for color:", t.toString(16) ), null ); var n = w.float32ColorToARGB(t); return ( (n[0] = e), this.bitmap.setPixelFromArray(this.colorPosition, this.colorRow, n), this.bitmap.invalidate(), new P( 1 / 512 + this.colorPosition / 256, 1 / 512 + this.colorRow / 256 ) ); }), (t._allTextureAtlas = []), (t._allGradients = {}), (t._allColors = {}), t ); })(), ds = (function () { function t() {} return ( (t.getMaterialForColor = function (e, n) { var r; if ( (void 0 === n && (n = 1), 0 == e && (e = 1), 16744704 == e && (n = 1), !t.materialClass) ) throw "no materialClass registered on MaterialManager!"; if (t._useTextureAtlasForColors) { if ( ((r = ps.getTextureForColor(e, n)), t._colorMaterials[r.bitmap.id]) ) return (r.material = t._colorMaterials[r.bitmap.id]), r; var i = new t.materialClass(r.bitmap); return ( (i.alphaBlending = !0), (i.useColorTransform = !0), (i.bothSides = !0), (t._colorMaterials[r.bitmap.id] = i), (r.material = i), r ); } r = {}; var o = e + "_" + Math.round(100 * n).toString(); if (t._colorMaterials[o]) return (r.material = t._colorMaterials[o]), r; var a = new t.materialClass(e, n); return ( (a.alphaBlending = !0), (a.useColorTransform = !0), (a.bothSides = !0), (r.material = a), (t._colorMaterials[o] = a), r ); }), (t.getMaterialForGradient = function (e) { if (!t.materialClass) throw "no materialClass registered on MaterialManager!"; var n = ps.getTextureForGradient(e), r = n.bitmap.id.toString() + e.type.toString(); if (t._textureMaterials[r]) return (n.material = t._textureMaterials[r]), n; var i = new t.materialClass(n.bitmap); return ( (i.useColorTransform = !0), (i.alphaBlending = !0), (i.bothSides = !0), (t._textureMaterials[r] = i), (n.material = i), n ); }), (t.getMaterialForBitmap = function (e, n) { void 0 === n && (n = !1); var r = new ( (n = n && !!this.specialBitmapMaterialClass) ? this.specialBitmapMaterialClass : this.materialClass )(e); return ( n || (r.ambientMethod.texture = new t.textureClass(e)), (r.alphaBlending = !0), (r.useColorTransform = !0), (r.bothSides = !0), r ); }), (t._colorMaterials = {}), (t._textureMaterials = {}), (t._useTextureAtlasForColors = !0), (t.get_material_for_color = t.getMaterialForColor), (t.get_material_for_gradient = t.getMaterialForGradient), (t.get_material_for_BitmapImage2D = t.getMaterialForBitmap), t ); })(), fs = (function () { function t() {} return ( (t.drawRectangles = function (t, e, n) { if (!(t.length % 4 > 0)) { var r = []; r.length = (t.length / 4) * 12; var i = 0, o = 0, a = t.length, s = 0, u = 0, l = 0, c = 0; for (i = 0; i < a; i += 4) (s = t[i]), (u = t[i + 1]), (l = t[i + 2]), (c = t[i + 3]), (r[o++] = s), (r[o++] = u), (r[o++] = s + l), (r[o++] = u), (r[o++] = s + l), (r[o++] = u + c), (r[o++] = s), (r[o++] = u), (r[o++] = s), (r[o++] = u + c), (r[o++] = s + l), (r[o++] = u + c); var h = ds.getMaterialForColor(e, n), p = h.material, d = new ui(Float32Array, p.curves ? 3 : 2); d.set(r); var f = d.attributesBuffer.cloneBufferView(); d.dispose(); var g = new ao(f); g.setPositions(new hi(f)); var _ = ss.getShape(g, p); if (h.colorPos) { _.style = new zi(); var m = new Le(); (p.animateUVs = !0), (_.style.color = e), _.style.addSamplerAt(m, p.getTextureAt(0)), (_.style.uvMatrix = new O( 0, 0, 0, 0, h.colorPos.x, h.colorPos.y )); } return _; } console.log( "GraphicsFactoryHelper.drawRectangles: inputRectangles.length is not a multiple of 4", t ); }), (t.updateRectanglesShape = function (t, e) { var n = []; n.length = (e.length / 4) * 12; var r = 0, i = 0, o = e.length, a = 0, s = 0, u = 0, l = 0; for (r = 0; r < o; r += 4) (a = e[r]), (s = e[r + 1]), (u = e[r + 2]), (l = e[r + 3]), (n[i++] = a), (n[i++] = s), (n[i++] = a + u), (n[i++] = s), (n[i++] = a + u), (n[i++] = s + l), (n[i++] = a), (n[i++] = s), (n[i++] = a), (n[i++] = s + l), (n[i++] = a + u), (n[i++] = s + l); var c = t.elements; (c.concatenatedBuffer.count = n.length / 2), c.setPositions(n), c.invalidate(); }), (t.isClockWiseXY = function (t, e, n, r, i, o) { return !((t - n) * (o - r) - (e - r) * (i - n) < 0); }), (t.getSign = function (t, e, n, r, i, o) { return (t - i) * (r - o) - (e - o) * (n - i); }), (t.pointInTri = function (t, e, n, r, i, o, a, s) { var u = this.getSign(t, e, a, s, n, r) > 0, l = this.getSign(n, r, a, s, i, o) > 0, c = this.getSign(i, o, a, s, t, e) > 0; return u == l && l == c; }), (t.getControlXForCurveX = function (t, e, n) { return e; }), (t.getControlYForCurveY = function (t, e, n) { return e; }), (t.drawPoint = function (t, e, n, r) { this.addTriangle(t - 2, e - 2, t + 2, e - 2, t + 2, e + 2, 0, n, r), this.addTriangle(t - 2, e - 2, t - 2, e + 2, t + 2, e + 2, 0, n, r); }), (t.drawElipse = function (t, e, n, r, i, o, a, s, u) { for ( var l = (a - o) / s, c = t + n * Math.cos(o * (Math.PI / 180)), h = e + r * Math.sin(o * (Math.PI / 180)), p = 1; p <= l; p++ ) { var d = t + n * Math.cos((o + p * s) * (Math.PI / 180)), f = e + r * Math.sin((o + p * s) * (Math.PI / 180)); this.addTriangle(t, e, d, f, c, h, 0, i, u), (c = d), (h = f); } }), (t.drawElipseStrokes = function (t, e, n, r, i, o, a, s) { var u = (a - o) / s, l = t + n * Math.cos(o * (Math.PI / 180)), c = e + r * Math.sin(o * (Math.PI / 180)); i.moveTo(l, c); for (var h = 1; h <= u; h++) { var p = t + n * Math.cos((o + h * s) * (Math.PI / 180)), d = e + r * Math.sin((o + h * s) * (Math.PI / 180)); i.lineTo(p, d); } }), (t.addTriangle = function (e, n, r, i, o, a, s, u, l) { var c = e, h = n, p = r, d = i, f = o, g = a; t.isClockWiseXY(c, h, p, d, f, g) && ((e = f), (n = g), (r = p), (i = d), (o = c), (a = h)); var _ = u.length; 0 == s ? ((u[_++] = e), (u[_++] = n), l && (u[_++] = 45736980577097704e-57), (u[_++] = r), (u[_++] = i), l && (u[_++] = 45736980577097704e-57), (u[_++] = o), (u[_++] = a), l && (u[_++] = 45736980577097704e-57)) : s < 0 ? ((u[_++] = e), (u[_++] = n), l && (u[_++] = 11708844992641982e-54), (u[_++] = r), (u[_++] = i), l && (u[_++] = 22778106537599901e-57), (u[_++] = o), (u[_++] = a), l && (u[_++] = 17796490496925177e-59)) : s > 0 && ((u[_++] = e), (u[_++] = n), l && (u[_++] = 11708846393940446e-54), (u[_++] = r), (u[_++] = i), l && (u[_++] = 22779507836064226e-57), (u[_++] = o), (u[_++] = a), l && (u[_++] = 1793662034335766e-58)); }), (t.createCap = function (t, e, n, r, i, o, a, s, u, l, c, h, p, d) { if (((a *= l), (s *= l), u == rs.ROUND)) { var f = t + a * c, g = e + s * h, _ = n + a * c, m = r + s * h, y = i + a * c, A = o + s * h; this.tesselateCurve(n, r, _, m, f, g, p, !0), this.tesselateCurve(f, g, y, A, i, o, p, !0), this.addTriangle(n, r, f, g, i, o, -1, p, d); } else if (u == rs.SQUARE) { (_ = n + a * c), (m = r + s * h), (y = i + a * c), (A = o + s * h); this.addTriangle(y, A, _, m, n, r, 0, p, d), this.addTriangle(y, A, n, r, i, o, 0, p, d); } }), (t.getLineFormularData = function (t, e) { var n = e.x - t.x, r = e.y - t.y, i = new P(); return ( 0 != n && 0 != r && (i.x = r / n), (i.y = -(i.x * t.x - t.y)), i ); }), (t.getQuadricBezierPosition = function (t, e, n, r) { var i = 1 - t; return i * i * e + 2 * i * t * n + t * t * r; }), (t.subdivideCurve = function ( e, n, r, i, o, a, s, u, l, c, h, p, d, f ) { var g = Math.atan2(i - n, r - e) * L.RADIANS_TO_DEGREES, _ = Math.atan2(a - i, o - r) * L.RADIANS_TO_DEGREES - g; if ( (_ > 180 && (_ -= 360), _ < -180 && (_ += 360), Math.abs(_) >= 175) ) return d.push(e, n, r, i, o, a), void f.push(s, u, l, c, h, p); var m = !1; if ( (_ < 0 ? ((m = t.getSign(e, n, l, c, o, a) > 0), (m = ((n - a) * (r - e) + (o - e) * (i - n)) * ((n - a) * (l - e) + (o - e) * (c - n)) < 0)) : ((m = t.getSign(s, u, l, c, h, p) > 0), (m = ((u - a) * (r - s) + (h - s) * (i - u)) * ((u - p) * (l - s) + (h - s) * (c - u)) < 0)), m) ) return d.push(e, n, r, i, o, a), void f.push(s, u, l, c, h, p); var y = e + 0.5 * (r - e), A = n + 0.5 * (i - n), v = r + 0.5 * (o - r), b = i + 0.5 * (a - i), C = y + 0.5 * (v - y), I = A + 0.5 * (b - A), E = s + 0.5 * (l - s), x = u + 0.5 * (c - u), w = l + 0.5 * (h - l), S = c + 0.5 * (p - c), D = E + 0.5 * (w - E), T = x + 0.5 * (S - x); this.subdivideCurve(e, n, y, A, C, I, s, u, E, x, D, T, d, f), this.subdivideCurve(C, I, v, b, o, a, D, T, w, S, h, p, d, f); }), (t.tesselateCurve = function (e, n, r, i, o, a, s, u, l) { void 0 === u && (u = !1), void 0 === l && (l = 0); if (l >= ea) return u ? void s.push(e, n, r, i, o, a) : void s.push(r, i, o, a); var c = o - e, h = a - n, p = e + 0.5 * (r - e), d = n + 0.5 * (i - n), f = r + 0.5 * (o - r), g = i + 0.5 * (a - i), _ = p + 0.5 * (f - p), m = d + 0.5 * (g - d); if (c * c + h * h < 1) u ? s.push(e, n, _, m, o, a) : s.push(o, a); else { for ( var y = Math.atan2(i - n, r - e) * L.RADIANS_TO_DEGREES, A = Math.atan2(a - i, o - r) * L.RADIANS_TO_DEGREES - y; A > 180; ) A -= 360; for (; A < -180; ) A += 360; (A = A < 0 ? -A : A) <= 1 ? u ? s.push(e, n, _, m, o, a) : s.push(o, a) : (u && s.push(e, n, _, m, o, a), l++, t.tesselateCurve(e, n, p, d, _, m, s, u, l), t.tesselateCurve(_, m, f, g, o, a, s, u, l)); } }), t ); })(); function gs(t, e) { if (!t) throw e || "Assertion Failed!"; } !(function (t) { (t[(t.ODD = 0)] = "ODD"), (t[(t.NONZERO = 1)] = "NONZERO"), (t[(t.POSITIVE = 2)] = "POSITIVE"), (t[(t.NEGATIVE = 3)] = "NEGATIVE"), (t[(t.ABS_GEQ_TWO = 4)] = "ABS_GEQ_TWO"); })(cs || (cs = {})), (function (t) { (t[(t.POLYGONS = 0)] = "POLYGONS"), (t[(t.CONNECTED_POLYGONS = 1)] = "CONNECTED_POLYGONS"), (t[(t.BOUNDARY_CONTOURS = 2)] = "BOUNDARY_CONTOURS"); })(hs || (hs = {})); var _s = (function () { function t() {} return ( (t.vertEq = function (t, e) { return t.s === e.s && t.t === e.t; }), (t.vertLeq = function (t, e) { return t.s < e.s || (t.s === e.s && t.t <= e.t); }), (t.transLeq = function (t, e) { return t.t < e.t || (t.t === e.t && t.s <= e.s); }), (t.edgeGoesLeft = function (e) { return t.vertLeq(e.Dst, e.Org); }), (t.edgeGoesRight = function (e) { return t.vertLeq(e.Org, e.Dst); }), (t.vertL1dist = function (t, e) { return Math.abs(t.s - e.s) + Math.abs(t.t - e.t); }), (t.edgeEval = function (e, n, r) { gs(t.vertLeq(e, n) && t.vertLeq(n, r)); var i = n.s - e.s, o = r.s - n.s; return i + o > 0 ? i < o ? n.t - e.t + (e.t - r.t) * (i / (i + o)) : n.t - r.t + (r.t - e.t) * (o / (i + o)) : 0; }), (t.edgeSign = function (e, n, r) { gs(t.vertLeq(e, n) && t.vertLeq(n, r)); var i = n.s - e.s, o = r.s - n.s; return i + o > 0 ? (n.t - r.t) * i + (n.t - e.t) * o : 0; }), (t.transEval = function (e, n, r) { gs(t.transLeq(e, n) && t.transLeq(n, r)); var i = n.t - e.t, o = r.t - n.t; return i + o > 0 ? i < o ? n.s - e.s + (e.s - r.s) * (i / (i + o)) : n.s - r.s + (r.s - e.s) * (o / (i + o)) : 0; }), (t.transSign = function (e, n, r) { gs(t.transLeq(e, n) && t.transLeq(n, r)); var i = n.t - e.t, o = r.t - n.t; return i + o > 0 ? (n.s - r.s) * i + (n.s - e.s) * o : 0; }), (t.vertCCW = function (t, e, n) { return t.s * (e.t - n.t) + e.s * (n.t - t.t) + n.s * (t.t - e.t) >= 0; }), (t.interpolate = function (t, e, n, r) { return (t = t < 0 ? 0 : t) <= (n = n < 0 ? 0 : n) ? 0 === n ? (e + r) / 2 : e + (t / (t + n)) * (r - e) : r + (n / (t + n)) * (e - r); }), (t.intersect = function (e, n, r, i, o) { var a, s, u; t.vertLeq(e, n) || ((u = e), (e = n), (n = u)), t.vertLeq(r, i) || ((u = r), (r = i), (i = u)), t.vertLeq(e, r) || ((u = e), (e = r), (r = u), (u = n), (n = i), (i = u)), t.vertLeq(r, n) ? t.vertLeq(n, i) ? ((a = t.edgeEval(e, r, n)) + (s = t.edgeEval(r, n, i)) < 0 && ((a = -a), (s = -s)), (o.s = t.interpolate(a, r.s, s, n.s))) : ((a = t.edgeSign(e, r, n)) + (s = -t.edgeSign(e, i, n)) < 0 && ((a = -a), (s = -s)), (o.s = t.interpolate(a, r.s, s, i.s))) : (o.s = (r.s + n.s) / 2), t.transLeq(e, n) || ((u = e), (e = n), (n = u)), t.transLeq(r, i) || ((u = r), (r = i), (i = u)), t.transLeq(e, r) || ((u = e), (e = r), (r = u), (u = n), (n = i), (i = u)), t.transLeq(r, n) ? t.transLeq(n, i) ? ((a = t.transEval(e, r, n)) + (s = t.transEval(r, n, i)) < 0 && ((a = -a), (s = -s)), (o.t = t.interpolate(a, r.t, s, n.t))) : ((a = t.transSign(e, r, n)) + (s = -t.transSign(e, i, n)) < 0 && ((a = -a), (s = -s)), (o.t = t.interpolate(a, r.t, s, i.t))) : (o.t = (r.t + n.t) / 2); }), t ); })(), ms = function () { (this.next = null), (this.prev = null), (this.anEdge = null), (this.trail = null), (this.n = 0), (this.marked = !1), (this.inside = !1); }, ys = (function () { function t(t) { (this.side = t), (this.next = null), (this.Org = null), (this.Sym = null), (this.Onext = null), (this.Lnext = null), (this.Lface = null), (this.activeRegion = null), (this.winding = 0); } return ( Object.defineProperty(t.prototype, "Rface", { get: function () { return this.Sym.Lface; }, set: function (t) { this.Sym.Lface = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Dst", { get: function () { return this.Sym.Org; }, set: function (t) { this.Sym.Org = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Oprev", { get: function () { return this.Sym.Lnext; }, set: function (t) { this.Sym.Lnext = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Lprev", { get: function () { return this.Onext.Sym; }, set: function (t) { this.Onext.Sym = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Dprev", { get: function () { return this.Lnext.Sym; }, set: function (t) { this.Lnext.Sym = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Rprev", { get: function () { return this.Sym.Onext; }, set: function (t) { this.Sym.Onext = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Dnext", { get: function () { return this.Sym.Onext.Sym; }, set: function (t) { this.Sym.Onext.Sym = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "Rnext", { get: function () { return this.Sym.Lnext.Sym; }, set: function (t) { this.Sym.Lnext.Sym = t; }, enumerable: !0, configurable: !0, }), t ); })(), As = function () { (this.next = null), (this.prev = null), (this.anEdge = null), (this.coords = [0, 0, 0]), (this.s = 0), (this.t = 0), (this.pqHandle = 0), (this.n = 0), (this.idx = 0); }, vs = (function () { function t() { var t = new As(), e = new ms(), n = new ys(0), r = new ys(1); (t.next = t.prev = t), (t.anEdge = null), (e.next = e.prev = e), (n.next = n), (n.Sym = r), (r.next = r), (r.Sym = n), (this.vHead = t), (this.fHead = e), (this.eHead = n), (this.eHeadSym = r); } return ( (t.prototype.makeEdge_ = function (t) { var e = new ys(0), n = new ys(1); t.Sym.side < t.side && (t = t.Sym); var r = t.Sym.next; return ( (n.next = r), (r.Sym.next = e), (e.next = t), (t.Sym.next = n), (e.Sym = n), (e.Onext = e), (e.Lnext = n), (e.Org = null), (e.Lface = null), (e.winding = 0), (e.activeRegion = null), (n.Sym = e), (n.Onext = n), (n.Lnext = e), (n.Org = null), (n.Lface = null), (n.winding = 0), (n.activeRegion = null), e ); }), (t.prototype.splice_ = function (t, e) { var n = t.Onext, r = e.Onext; (n.Sym.Lnext = e), (r.Sym.Lnext = t), (t.Onext = r), (e.Onext = n); }), (t.prototype.makeVertex_ = function (t, e, n) { var r = t; gs(r, "Vertex can't be null!"); var i = n.prev; (r.prev = i), (i.next = r), (r.next = n), (n.prev = r), (r.anEdge = e); var o = e; do { (o.Org = r), (o = o.Onext); } while (o !== e); }), (t.prototype.makeFace_ = function (t, e, n) { var r = t; gs(r, "Face can't be null"); var i = n.prev; (r.prev = i), (i.next = r), (r.next = n), (n.prev = r), (r.anEdge = e), (r.trail = null), (r.marked = !1), (r.inside = n.inside); var o = e; do { (o.Lface = r), (o = o.Lnext); } while (o !== e); }), (t.prototype.killEdge_ = function (t) { t.Sym.side < t.side && (t = t.Sym); var e = t.next, n = t.Sym.next; (e.Sym.next = n), (n.Sym.next = e); }), (t.prototype.killVertex_ = function (t, e) { var n = t.anEdge, r = n; do { (r.Org = e), (r = r.Onext); } while (r !== n); var i = t.prev, o = t.next; (o.prev = i), (i.next = o); }), (t.prototype.killFace_ = function (t, e) { var n = t.anEdge, r = n; do { (r.Lface = e), (r = r.Lnext); } while (r !== n); var i = t.prev, o = t.next; (o.prev = i), (i.next = o); }), (t.prototype.makeEdge = function () { var t = new As(), e = new As(), n = new ms(), r = this.makeEdge_(this.eHead); return ( this.makeVertex_(t, r, this.vHead), this.makeVertex_(e, r.Sym, this.vHead), this.makeFace_(n, r, this.fHead), r ); }), (t.prototype.splice = function (t, e) { var n = !1, r = !1; if (t !== e) { if ( (e.Org !== t.Org && ((r = !0), this.killVertex_(e.Org, t.Org)), e.Lface !== t.Lface && ((n = !0), this.killFace_(e.Lface, t.Lface)), this.splice_(e, t), !r) ) { var i = new As(); this.makeVertex_(i, e, t.Org), (t.Org.anEdge = t); } if (!n) { var o = new ms(); this.makeFace_(o, e, t.Lface), (t.Lface.anEdge = t); } } }), (t.prototype.delete = function (t) { var e = t.Sym, n = !1; if ( (t.Lface !== t.Rface && ((n = !0), this.killFace_(t.Lface, t.Rface)), t.Onext === t) ) this.killVertex_(t.Org, null); else if ( ((t.Rface.anEdge = t.Oprev), (t.Org.anEdge = t.Onext), this.splice_(t, t.Oprev), !n) ) { var r = new ms(); this.makeFace_(r, t, t.Lface); } e.Onext === e ? (this.killVertex_(e.Org, null), this.killFace_(e.Lface, null)) : ((t.Lface.anEdge = e.Oprev), (e.Org.anEdge = e.Onext), this.splice_(e, e.Oprev)), this.killEdge_(t); }), (t.prototype.addEdgeVertex = function (t) { var e = this.makeEdge_(t), n = e.Sym; this.splice_(e, t.Lnext), (e.Org = t.Dst); var r = new As(); return ( this.makeVertex_(r, n, e.Org), (e.Lface = n.Lface = t.Lface), e ); }), (t.prototype.splitEdge = function (t) { var e = this.addEdgeVertex(t).Sym; return ( this.splice_(t.Sym, t.Sym.Oprev), this.splice_(t.Sym, e), (t.Dst = e.Org), (e.Dst.anEdge = e.Sym), (e.Rface = t.Rface), (e.winding = t.winding), (e.Sym.winding = t.Sym.winding), e ); }), (t.prototype.connect = function (t, e) { var n = !1, r = this.makeEdge_(t), i = r.Sym; if ( (e.Lface !== t.Lface && ((n = !0), this.killFace_(e.Lface, t.Lface)), this.splice_(r, t.Lnext), this.splice_(i, e), (r.Org = t.Dst), (i.Org = e.Org), (r.Lface = i.Lface = t.Lface), (t.Lface.anEdge = i), !n) ) { var o = new ms(); this.makeFace_(o, r, t.Lface); } return r; }), (t.prototype.zapFace = function (t) { var e, n, r, i, o, a = t.anEdge; n = a.Lnext; do { (n = (e = n).Lnext), (e.Lface = null), null === e.Rface && (e.Onext === e ? this.killVertex_(e.Org, null) : ((e.Org.anEdge = e.Onext), this.splice_(e, e.Oprev)), (r = e.Sym).Onext === r ? this.killVertex_(r.Org, null) : ((r.Org.anEdge = r.Onext), this.splice_(r, r.Oprev)), this.killEdge_(e)); } while (e != a); (i = t.prev), ((o = t.next).prev = i), (i.next = o); }), (t.prototype.countFaceVerts_ = function (t) { var e = t.anEdge, n = 0; do { n++, (e = e.Lnext); } while (e !== t.anEdge); return n; }), (t.prototype.mergeConvexFaces = function (t) { var e, n, r, i, o; for (e = this.fHead.next; e !== this.fHead; e = e.next) if (e.inside) for ( o = (n = e.anEdge).Org; (r = n.Lnext), (i = n.Sym) && i.Lface && i.Lface.inside && this.countFaceVerts_(e) + this.countFaceVerts_(i.Lface) - 2 <= t && _s.vertCCW(n.Lprev.Org, n.Org, i.Lnext.Lnext.Org) && _s.vertCCW(i.Lprev.Org, i.Org, n.Lnext.Lnext.Org) && ((r = i.Lnext), this.delete(i), (n = null), (i = null)), !n || n.Lnext.Org !== o; ) n = r; return !0; }), (t.prototype.check = function () { var t, e, n, r, i, o, a = this.fHead, s = this.vHead, u = this.eHead; for (e = a, e = a; (t = e.next) !== a; e = t) { gs(t.prev === e), (i = t.anEdge); do { gs(i.Sym !== i), gs(i.Sym.Sym === i), gs(i.Lnext.Onext.Sym === i), gs(i.Onext.Sym.Lnext === i), gs(i.Lface === t), (i = i.Lnext); } while (i !== t.anEdge); } for ( gs(t.prev === e && null === t.anEdge), r = s, r = s; (n = r.next) !== s; r = n ) { gs(n.prev === r), (i = n.anEdge); do { gs(i.Sym !== i), gs(i.Sym.Sym === i), gs(i.Lnext.Onext.Sym === i), gs(i.Onext.Sym.Lnext === i), gs(i.Org === n), (i = i.Onext); } while (i !== n.anEdge); } for ( gs(n.prev === r && null === n.anEdge), o = u, o = u; (i = o.next) !== u; o = i ) gs(i.Sym.next === o.Sym), gs(i.Sym !== i), gs(i.Sym.Sym === i), gs(null !== i.Org), gs(null !== i.Dst), gs(i.Lnext.Onext.Sym === i), gs(i.Onext.Sym.Lnext === i); gs( i.Sym.next === o.Sym && i.Sym === this.eHeadSym && i.Sym.Sym === i && null === i.Org && null === i.Dst && null === i.Lface && null === i.Rface ); }), t ); })(), bs = function () { this.handle = null; }, Cs = function () { (this.key = null), (this.node = 0); }, Is = (function () { function t(t, e) { (this.leq = e), (this.max = 0), (this.nodes = []), (this.handles = []), (this.initialized = !1), (this.freeList = 0), (this.size = 0), (this.max = t), (this.nodes = []), (this.handles = []); for (var n = 0; n < t + 1; n++) (this.nodes[n] = new bs()), (this.handles[n] = new Cs()); (this.initialized = !1), (this.nodes[1].handle = 1), (this.handles[1].key = null); } return ( (t.prototype.floatDown_ = function (t) { var e, n, r, i = this.nodes, o = this.handles; for (e = i[t].handle; ; ) { if ( ((r = t << 1) < this.size && this.leq(o[i[r + 1].handle].key, o[i[r].handle].key) && ++r, gs(r <= this.max), (n = i[r].handle), r > this.size || this.leq(o[e].key, o[n].key)) ) { (i[t].handle = e), (o[e].node = t); break; } (i[t].handle = n), (o[n].node = t), (t = r); } }), (t.prototype.floatUp_ = function (t) { var e, n, r, i = this.nodes, o = this.handles; for (e = i[t].handle; ; ) { if ( ((n = i[(r = t >> 1)].handle), 0 === r || this.leq(o[n].key, o[e].key)) ) { (i[t].handle = e), (o[e].node = t); break; } (i[t].handle = n), (o[n].node = t), (t = r); } }), (t.prototype.init = function () { for (var t = this.size; t >= 1; --t) this.floatDown_(t); this.initialized = !0; }), (t.prototype.min = function () { return this.handles[this.nodes[1].handle].key; }), (t.prototype.insert = function (t) { var e, n; if (2 * (e = ++this.size) > this.max) { var r, i; for ( this.max *= 2, i = this.nodes.length, this.nodes.length = this.max + 1, r = i; r < this.nodes.length; r++ ) this.nodes[r] = new bs(); for ( i = this.handles.length, this.handles.length = this.max + 1, r = i; r < this.handles.length; r++ ) this.handles[r] = new Cs(); } return ( 0 === this.freeList ? (n = e) : ((n = this.freeList), (this.freeList = this.handles[n].node)), (this.nodes[e].handle = n), (this.handles[n].node = e), (this.handles[n].key = t), this.initialized && this.floatUp_(e), n ); }), (t.prototype.extractMin = function () { var t = this.nodes, e = this.handles, n = t[1].handle, r = e[n].key; return ( this.size > 0 && ((t[1].handle = t[this.size].handle), (e[t[1].handle].node = 1), (e[n].key = null), (e[n].node = this.freeList), (this.freeList = n), --this.size, this.size > 0 && this.floatDown_(1)), r ); }), (t.prototype.delete = function (t) { var e, n = this.nodes, r = this.handles; gs(t >= 1 && t <= this.max && null !== r[t].key), (n[(e = r[t].node)].handle = n[this.size].handle), (r[n[e].handle].node = e), --this.size, e <= this.size && (e <= 1 || this.leq(r[n[e >> 1].handle].key, r[n[e].handle].key) ? this.floatDown_(e) : this.floatUp_(e)), (r[t].key = null), (r[t].node = this.freeList), (this.freeList = t); }), t ); })(), Es = function () { (this.eUp = null), (this.nodeUp = null), (this.windingNumber = 0), (this.inside = !1), (this.sentinel = !1), (this.dirty = !1), (this.fixUpperEdge = !1); }, xs = function () { (this.key = null), (this.next = null), (this.prev = null); }, ws = (function () { function t(t, e) { (this.frame = t), (this.leq = e), (this.head = new xs()), (this.head.next = this.head), (this.head.prev = this.head); } return ( (t.prototype.min = function () { return this.head.next; }), (t.prototype.max = function () { return this.head.prev; }), (t.prototype.insert = function (t) { return this.insertBefore(this.head, t); }), (t.prototype.search = function (t) { var e = this.head; do { e = e.next; } while (null !== e.key && !this.leq(this.frame, t, e.key)); return e; }), (t.prototype.insertBefore = function (t, e) { do { t = t.prev; } while (null !== t.key && !this.leq(this.frame, t.key, e)); var n = new xs(); return ( (n.key = e), (n.next = t.next), (t.next.prev = n), (n.prev = t), (t.next = n), n ); }), (t.prototype.delete = function (t) { (t.next.prev = t.prev), (t.prev.next = t.next); }), t ); })(), Ss = (function () { function t() {} return ( (t.regionBelow = function (t) { return t.nodeUp.prev.key; }), (t.regionAbove = function (t) { return t.nodeUp.next.key; }), (t.debugEvent = function (t) {}), (t.addWinding = function (t, e) { (t.winding += e.winding), (t.Sym.winding += e.Sym.winding); }), (t.edgeLeq = function (t, e, n) { var r = t.event, i = e.eUp, o = n.eUp; return i.Dst === r ? o.Dst === r ? _s.vertLeq(i.Org, o.Org) ? _s.edgeSign(o.Dst, i.Org, o.Org) <= 0 : _s.edgeSign(i.Dst, o.Org, i.Org) >= 0 : _s.edgeSign(o.Dst, r, o.Org) <= 0 : o.Dst === r ? _s.edgeSign(i.Dst, r, i.Org) >= 0 : _s.edgeEval(i.Dst, r, i.Org) >= _s.edgeEval(o.Dst, r, o.Org); }), (t.deleteRegion = function (t, e) { e.fixUpperEdge && gs(0 === e.eUp.winding), (e.eUp.activeRegion = null), t.dict.delete(e.nodeUp); }), (t.fixUpperEdge = function (t, e, n) { gs(e.fixUpperEdge), t.mesh.delete(e.eUp), (e.fixUpperEdge = !1), (e.eUp = n), (n.activeRegion = e); }), (t.topLeftRegion = function (e, n) { var r, i = n.eUp.Org; do { n = t.regionAbove(n); } while (n.eUp.Org === i); if (n.fixUpperEdge) { if ( null === (r = e.mesh.connect(t.regionBelow(n).eUp.Sym, n.eUp.Lnext)) ) return null; t.fixUpperEdge(e, n, r), (n = t.regionAbove(n)); } return n; }), (t.topRightRegion = function (e) { var n = e.eUp.Dst; do { e = t.regionAbove(e); } while (e.eUp.Dst === n); return e; }), (t.addRegionBelow = function (t, e, n) { var r = new Es(); return ( (r.eUp = n), (r.nodeUp = t.dict.insertBefore(e.nodeUp, r)), (r.fixUpperEdge = !1), (r.sentinel = !1), (r.dirty = !1), (n.activeRegion = r), r ); }), (t.isWindingInside = function (t, e) { switch (t.windingRule) { case cs.ODD: return 0 != (1 & e); case cs.NONZERO: return 0 !== e; case cs.POSITIVE: return e > 0; case cs.NEGATIVE: return e < 0; case cs.ABS_GEQ_TWO: return e >= 2 || e <= -2; } throw new Error("Invalid winding rulle"); }), (t.computeWinding = function (e, n) { (n.windingNumber = t.regionAbove(n).windingNumber + n.eUp.winding), (n.inside = t.isWindingInside(e, n.windingNumber)); }), (t.finishRegion = function (e, n) { var r = n.eUp, i = r.Lface; (i.inside = n.inside), (i.anEdge = r), t.deleteRegion(e, n); }), (t.finishLeftRegions = function (e, n, r) { for (var i, o = null, a = n, s = n.eUp; a !== r; ) { if ( ((a.fixUpperEdge = !1), (i = (o = t.regionBelow(a)).eUp).Org != s.Org) ) { if (!o.fixUpperEdge) { t.finishRegion(e, a); break; } (i = e.mesh.connect(s.Lprev, i.Sym)), t.fixUpperEdge(e, o, i); } s.Onext !== i && (e.mesh.splice(i.Oprev, i), e.mesh.splice(s, i)), t.finishRegion(e, a), (s = o.eUp), (a = o); } return s; }), (t.addRightEdges = function (e, n, r, i, o, a) { var s, u, l, c, h = !0; l = r; do { gs(_s.vertLeq(l.Org, l.Dst)), t.addRegionBelow(e, n, l.Sym), (l = l.Onext); } while (l !== i); for ( null === o && (o = t.regionBelow(n).eUp.Rprev), u = n, c = o; (l = (s = t.regionBelow(u)).eUp.Sym).Org === c.Org; ) l.Onext !== c && (e.mesh.splice(l.Oprev, l), e.mesh.splice(c.Oprev, l)), (s.windingNumber = u.windingNumber - l.winding), (s.inside = t.isWindingInside(e, s.windingNumber)), (u.dirty = !0), !h && t.checkForRightSplice(e, u) && (t.addWinding(l, c), t.deleteRegion(e, u), e.mesh.delete(c)), (h = !1), (u = s), (c = l); (u.dirty = !0), gs(u.windingNumber - l.winding === s.windingNumber), a && t.walkDirtyRegions(e, u); }), (t.spliceMergeVertices = function (t, e, n) { t.mesh.splice(e, n); }), (t.vertexWeights = function (t, e, n) { var r = _s.vertL1dist(e, t), i = _s.vertL1dist(n, t), o = (0.5 * i) / (r + i), a = (0.5 * r) / (r + i); (t.coords[0] += o * e.coords[0] + a * n.coords[0]), (t.coords[1] += o * e.coords[1] + a * n.coords[1]), (t.coords[2] += o * e.coords[2] + a * n.coords[2]); }), (t.getIntersectData = function (e, n, r, i, o, a) { (n.coords[0] = n.coords[1] = n.coords[2] = 0), (n.idx = -1), t.vertexWeights(n, r, i), t.vertexWeights(n, o, a); }), (t.checkForRightSplice = function (e, n) { var r = t.regionBelow(n), i = n.eUp, o = r.eUp; if (_s.vertLeq(i.Org, o.Org)) { if (_s.edgeSign(o.Dst, i.Org, o.Org) > 0) return !1; _s.vertEq(i.Org, o.Org) ? i.Org !== o.Org && (e.pq.delete(i.Org.pqHandle), t.spliceMergeVertices(e, o.Oprev, i)) : (e.mesh.splitEdge(o.Sym), e.mesh.splice(i, o.Oprev), (n.dirty = r.dirty = !0)); } else { if (_s.edgeSign(i.Dst, o.Org, i.Org) < 0) return !1; (t.regionAbove(n).dirty = n.dirty = !0), e.mesh.splitEdge(i.Sym), e.mesh.splice(o.Oprev, i); } return !0; }), (t.checkForLeftSplice = function (e, n) { var r, i = t.regionBelow(n), o = n.eUp, a = i.eUp; if ((gs(!_s.vertEq(o.Dst, a.Dst)), _s.vertLeq(o.Dst, a.Dst))) { if (_s.edgeSign(o.Dst, a.Dst, o.Org) < 0) return !1; (t.regionAbove(n).dirty = n.dirty = !0), (r = e.mesh.splitEdge(o)), e.mesh.splice(a.Sym, r), (r.Lface.inside = n.inside); } else { if (_s.edgeSign(a.Dst, o.Dst, a.Org) > 0) return !1; (n.dirty = i.dirty = !0), (r = e.mesh.splitEdge(a)), e.mesh.splice(o.Lnext, a.Sym), (r.Rface.inside = n.inside); } return !0; }), (t.checkForIntersect = function (e, n) { var r, i, o = t.regionBelow(n), a = n.eUp, s = o.eUp, u = a.Org, l = s.Org, c = a.Dst, h = s.Dst, p = new As(); if ( (gs(!_s.vertEq(h, c)), gs(_s.edgeSign(c, e.event, u) <= 0), gs(_s.edgeSign(h, e.event, l) >= 0), gs(u !== e.event && l !== e.event), gs(!n.fixUpperEdge && !o.fixUpperEdge), u === l) ) return !1; if (Math.min(u.t, c.t) > Math.max(l.t, h.t)) return !1; if (_s.vertLeq(u, l)) { if (_s.edgeSign(h, u, l) > 0) return !1; } else if (_s.edgeSign(c, l, u) < 0) return !1; return ( t.debugEvent(e), _s.intersect(c, u, h, l, p), gs(Math.min(u.t, c.t) <= p.t), gs(p.t <= Math.max(l.t, h.t)), gs(Math.min(h.s, c.s) <= p.s), gs(p.s <= Math.max(l.s, u.s)), _s.vertLeq(p, e.event) && ((p.s = e.event.s), (p.t = e.event.t)), (r = _s.vertLeq(u, l) ? u : l), _s.vertLeq(r, p) && ((p.s = r.s), (p.t = r.t)), _s.vertEq(p, u) || _s.vertEq(p, l) ? (t.checkForRightSplice(e, n), !1) : (!_s.vertEq(c, e.event) && _s.edgeSign(c, e.event, p) >= 0) || (!_s.vertEq(h, e.event) && _s.edgeSign(h, e.event, p) <= 0) ? h === e.event ? (e.mesh.splitEdge(a.Sym), e.mesh.splice(s.Sym, a), (n = t.topLeftRegion(e, n)), (a = t.regionBelow(n).eUp), t.finishLeftRegions(e, t.regionBelow(n), o), t.addRightEdges(e, n, a.Oprev, a, a, !0), !0) : c === e.event ? (e.mesh.splitEdge(s.Sym), e.mesh.splice(a.Lnext, s.Oprev), (o = n), (n = t.topRightRegion(n)), (i = t.regionBelow(n).eUp.Rprev), (o.eUp = s.Oprev), (s = t.finishLeftRegions(e, o, null)), t.addRightEdges(e, n, s.Onext, a.Rprev, i, !0), !0) : (_s.edgeSign(c, e.event, p) >= 0 && ((t.regionAbove(n).dirty = n.dirty = !0), e.mesh.splitEdge(a.Sym), (a.Org.s = e.event.s), (a.Org.t = e.event.t)), _s.edgeSign(h, e.event, p) <= 0 && ((n.dirty = o.dirty = !0), e.mesh.splitEdge(s.Sym), (s.Org.s = e.event.s), (s.Org.t = e.event.t)), !1) : (e.mesh.splitEdge(a.Sym), e.mesh.splitEdge(s.Sym), e.mesh.splice(s.Oprev, a), (a.Org.s = p.s), (a.Org.t = p.t), (a.Org.pqHandle = e.pq.insert(a.Org)), t.getIntersectData(e, a.Org, u, c, l, h), (t.regionAbove(n).dirty = n.dirty = o.dirty = !0), !1) ); }), (t.walkDirtyRegions = function (e, n) { for (var r, i, o = t.regionBelow(n); ; ) { for (; o.dirty; ) (n = o), (o = t.regionBelow(o)); if ( !n.dirty && ((o = n), null === (n = t.regionAbove(n)) || !n.dirty) ) return; if ( ((n.dirty = !1), (r = n.eUp), (i = o.eUp), r.Dst !== i.Dst && t.checkForLeftSplice(e, n) && (o.fixUpperEdge ? (t.deleteRegion(e, o), e.mesh.delete(i), (i = (o = t.regionBelow(n)).eUp)) : n.fixUpperEdge && (t.deleteRegion(e, n), e.mesh.delete(r), (r = (n = t.regionAbove(o)).eUp))), r.Org !== i.Org) ) if ( r.Dst === i.Dst || n.fixUpperEdge || o.fixUpperEdge || (r.Dst !== e.event && i.Dst !== e.event) ) t.checkForRightSplice(e, n); else if (t.checkForIntersect(e, n)) return; r.Org === i.Org && r.Dst === i.Dst && (t.addWinding(i, r), t.deleteRegion(e, n), e.mesh.delete(r), (n = t.regionAbove(o))); } }), (t.connectRightVertex = function (e, n, r) { var i, o = r.Onext, a = t.regionBelow(n), s = n.eUp, u = a.eUp, l = !1; s.Dst !== u.Dst && t.checkForIntersect(e, n), _s.vertEq(s.Org, e.event) && (e.mesh.splice(o.Oprev, s), (n = t.topLeftRegion(e, n)), (o = t.regionBelow(n).eUp), t.finishLeftRegions(e, t.regionBelow(n), a), (l = !0)), _s.vertEq(u.Org, e.event) && (e.mesh.splice(r, u.Oprev), (r = t.finishLeftRegions(e, a, null)), (l = !0)), l ? t.addRightEdges(e, n, r.Onext, o, o, !0) : ((i = _s.vertLeq(u.Org, s.Org) ? u.Oprev : s), (i = e.mesh.connect(r.Lprev, i)), t.addRightEdges(e, n, i, i.Onext, i.Onext, !1), (i.Sym.activeRegion.fixUpperEdge = !0), t.walkDirtyRegions(e, n)); }), (t.connectLeftDegenerate = function (e, n, r) { var i, o, a, s, u; return ( (i = n.eUp), _s.vertEq(i.Org, r) ? (gs(!1), void t.spliceMergeVertices(e, i, r.anEdge)) : _s.vertEq(i.Dst, r) ? (gs(!1), (n = t.topRightRegion(n)), (o = s = (a = (u = t.regionBelow(n)).eUp.Sym).Onext), u.fixUpperEdge && (gs(o !== a), t.deleteRegion(e, u), e.mesh.delete(a), (a = o.Oprev)), e.mesh.splice(r.anEdge, a), _s.edgeGoesLeft(o) || (o = null), void t.addRightEdges(e, n, a.Onext, s, o, !0)) : (e.mesh.splitEdge(i.Sym), n.fixUpperEdge && (e.mesh.delete(i.Onext), (n.fixUpperEdge = !1)), e.mesh.splice(r.anEdge, i), void t.sweepEvent(e, r)) ); }), (t.connectLeftVertex = function (e, n) { var r, i, o, a, s, u, l = new Es(); if ( ((l.eUp = n.anEdge.Sym), (r = e.dict.search(l).key), (i = t.regionBelow(r))) ) if (((a = r.eUp), (s = i.eUp), 0 !== _s.edgeSign(a.Dst, n, a.Org))) if ( ((o = _s.vertLeq(s.Dst, a.Dst) ? r : i), r.inside || o.fixUpperEdge) ) { if (o === r) u = e.mesh.connect(n.anEdge.Sym, a.Lnext); else u = e.mesh.connect(s.Dnext, n.anEdge).Sym; o.fixUpperEdge ? t.fixUpperEdge(e, o, u) : t.computeWinding(e, t.addRegionBelow(e, r, u)), t.sweepEvent(e, n); } else t.addRightEdges(e, r, n.anEdge, n.anEdge, null, !0); else t.connectLeftDegenerate(e, r, n); }), (t.sweepEvent = function (e, n) { (e.event = n), t.debugEvent(e); for (var r = n.anEdge; null === r.activeRegion; ) if ((r = r.Onext) === n.anEdge) return void t.connectLeftVertex(e, n); var i = t.topLeftRegion(e, r.activeRegion); gs(null !== i); var o = t.regionBelow(i), a = o.eUp, s = t.finishLeftRegions(e, o, null); s.Onext === a ? t.connectRightVertex(e, i, s) : t.addRightEdges(e, i, s.Onext, a, a, !0); }), (t.addSentinel = function (t, e, n, r) { var i = new Es(), o = t.mesh.makeEdge(); (o.Org.s = n), (o.Org.t = r), (o.Dst.s = e), (o.Dst.t = r), (t.event = o.Dst), (i.eUp = o), (i.windingNumber = 0), (i.inside = !1), (i.fixUpperEdge = !1), (i.sentinel = !0), (i.dirty = !1), (i.nodeUp = t.dict.insert(i)); }), (t.initEdgeDict = function (e) { e.dict = new ws(e, t.edgeLeq); var n = e.bmax[0] - e.bmin[0], r = e.bmax[1] - e.bmin[1], i = e.bmin[0] - n, o = e.bmax[0] + n, a = e.bmin[1] - r, s = e.bmax[1] + r; t.addSentinel(e, i, o, a), t.addSentinel(e, i, o, s); }), (t.doneEdgeDict = function (e) { for (var n, r = 0; null !== (n = e.dict.min().key); ) n.sentinel || (gs(n.fixUpperEdge), gs(1 == ++r)), gs(0 === n.windingNumber), t.deleteRegion(e, n); }), (t.removeDegenerateEdges = function (e) { var n, r, i, o = e.mesh.eHead; for (n = o.next; n !== o; n = r) (r = n.next), (i = n.Lnext), _s.vertEq(n.Org, n.Dst) && n.Lnext.Lnext !== n && (t.spliceMergeVertices(e, i, n), e.mesh.delete(n), (i = (n = i).Lnext)), i.Lnext === n && (i !== n && ((i !== r && i !== r.Sym) || (r = r.next), e.mesh.delete(i)), (n !== r && n !== r.Sym) || (r = r.next), e.mesh.delete(n)); }), (t.initPriorityQ = function (t) { var e, n, r, i = 0; for (n = (r = t.mesh.vHead).next; n !== r; n = n.next) i++; for ( i += 8, e = t.pq = new Is(i, _s.vertLeq), n = (r = t.mesh.vHead).next; n !== r; n = n.next ) n.pqHandle = e.insert(n); return n === r && (e.init(), !0); }), (t.donePriorityQ = function (t) { t.pq = null; }), (t.removeDegenerateFaces = function (e, n) { var r, i, o; for (r = n.fHead.next; r !== n.fHead; r = i) (i = r.next), gs((o = r.anEdge).Lnext !== o), o.Lnext.Lnext === o && (t.addWinding(o.Onext, o), e.mesh.delete(o)); return !0; }), (t.computeInterior = function (e, n) { var r, i; if ( (void 0 === n && (n = !0), t.removeDegenerateEdges(e), !t.initPriorityQ(e)) ) return !1; for (t.initEdgeDict(e); null !== (r = e.pq.extractMin()); ) { for (; null !== (i = e.pq.min()) && _s.vertEq(i, r); ) (i = e.pq.extractMin()), t.spliceMergeVertices(e, r.anEdge, i.anEdge); t.sweepEvent(e, r); } return ( (e.event = e.dict.min().key.eUp.Org), t.debugEvent(e), t.doneEdgeDict(e), t.donePriorityQ(e), !!t.removeDegenerateFaces(e, e.mesh) && (n && e.mesh.check(), !0) ); }), t ); })(), Ds = (function () { function t() { (this.mesh = new vs()), (this.normal = [0, 0, 0]), (this.sUnit = [0, 0, 0]), (this.tUnit = [0, 0, 0]), (this.bmin = [0, 0]), (this.bmax = [0, 0]), (this.windingRule = cs.ODD), (this.dict = null), (this.pq = null), (this.event = null), (this.vertexIndexCounter = 0), (this.vertices = []), (this.vertexIndices = []), (this.vertexCount = 0), (this.elements = []), (this.elementCount = 0); } return ( (t.prototype.dot_ = function (t, e) { return t[0] * e[0] + t[1] * e[1] + t[2] * e[2]; }), (t.prototype.normalize_ = function (t) { var e = t[0] * t[0] + t[1] * t[1] + t[2] * t[2]; if (!e) throw "Zero-size vector!"; (e = Math.sqrt(e)), (t[0] /= e), (t[1] /= e), (t[2] /= e); }), (t.prototype.longAxis_ = function (t) { var e = 0; return ( Math.abs(t[1]) > Math.abs(t[0]) && (e = 1), Math.abs(t[2]) > Math.abs(t[e]) && (e = 2), e ); }), (t.prototype.computeNormal_ = function (t) { var e, n, r, i, o, a, s = [0, 0, 0], u = [0, 0, 0], l = [0, 0, 0], c = [0, 0, 0], h = [0, 0, 0], p = [null, null, null], d = [null, null, null], f = this.mesh.vHead; e = f.next; for (var g = 0; g < 3; ++g) (i = e.coords[g]), (u[g] = i), (d[g] = e), (s[g] = i), (p[g] = e); for (e = f.next; e !== f; e = e.next) for (var _ = 0; _ < 3; ++_) (i = e.coords[_]) < u[_] && ((u[_] = i), (d[_] = e)), i > s[_] && ((s[_] = i), (p[_] = e)); var m = 0; if ( (s[1] - u[1] > s[0] - u[0] && (m = 1), s[2] - u[2] > s[m] - u[m] && (m = 2), u[m] >= s[m]) ) return (t[0] = 0), (t[1] = 0), void (t[2] = 1); for ( a = 0, n = d[m], r = p[m], l[0] = n.coords[0] - r.coords[0], l[1] = n.coords[1] - r.coords[1], l[2] = n.coords[2] - r.coords[2], e = f.next; e !== f; e = e.next ) (c[0] = e.coords[0] - r.coords[0]), (c[1] = e.coords[1] - r.coords[1]), (c[2] = e.coords[2] - r.coords[2]), (h[0] = l[1] * c[2] - l[2] * c[1]), (h[1] = l[2] * c[0] - l[0] * c[2]), (h[2] = l[0] * c[1] - l[1] * c[0]), (o = h[0] * h[0] + h[1] * h[1] + h[2] * h[2]) > a && ((a = o), (t[0] = h[0]), (t[1] = h[1]), (t[2] = h[2])); a <= 0 && ((t[0] = t[1] = t[2] = 0), (t[this.longAxis_(l)] = 1)); }), (t.prototype.checkOrientation_ = function () { for ( var t, e, n = this.mesh.fHead, r = this.mesh.vHead, i = 0, o = n.next; o !== n; o = o.next ) if (!((e = o.anEdge).winding <= 0)) do { (i += (e.Org.s - e.Dst.s) * (e.Org.t + e.Dst.t)), (e = e.Lnext); } while (e !== o.anEdge); if (i < 0) { for (t = r.next; t !== r; t = t.next) t.t = -t.t; (this.tUnit[0] = -this.tUnit[0]), (this.tUnit[1] = -this.tUnit[1]), (this.tUnit[2] = -this.tUnit[2]); } }), (t.prototype.projectPolygon_ = function () { var t, e, n = this.mesh.vHead, r = [0, 0, 0], i = !1; (r[0] = this.normal[0]), (r[1] = this.normal[1]), (r[2] = this.normal[2]), r[0] || r[1] || r[2] || (this.computeNormal_(r), (i = !0)), (t = this.sUnit), (e = this.tUnit); var o = this.longAxis_(r); (t[o] = 0), (t[(o + 1) % 3] = 1), (t[(o + 2) % 3] = 0), (e[o] = 0), (e[(o + 1) % 3] = 0), (e[(o + 2) % 3] = r[o] > 0 ? 1 : -1); for (var a = n.next; a !== n; a = a.next) (a.s = this.dot_(a.coords, t)), (a.t = this.dot_(a.coords, e)); i && this.checkOrientation_(); for (var s = !0, u = n.next; u !== n; u = u.next) s ? ((this.bmin[0] = this.bmax[0] = u.s), (this.bmin[1] = this.bmax[1] = u.t), (s = !1)) : (u.s < this.bmin[0] && (this.bmin[0] = u.s), u.s > this.bmax[0] && (this.bmax[0] = u.s), u.t < this.bmin[1] && (this.bmin[1] = u.t), u.t > this.bmax[1] && (this.bmax[1] = u.t)); }), (t.prototype.addWinding_ = function (t, e) { (t.winding += e.winding), (t.Sym.winding += e.Sym.winding); }), (t.prototype.tessellateMonoRegion_ = function (t, e) { var n, r; if ((n = e.anEdge).Lnext === n || n.Lnext.Lnext === n) throw "Mono region invalid"; for (; _s.vertLeq(n.Dst, n.Org); n = n.Lprev); for (; _s.vertLeq(n.Org, n.Dst); n = n.Lnext); r = n.Lprev; for (; n.Lnext !== r; ) if (_s.vertLeq(n.Dst, r.Org)) { for ( ; r.Lnext !== n && (_s.edgeGoesLeft(r.Lnext) || _s.edgeSign(r.Org, r.Dst, r.Lnext.Dst) <= 0); ) r = t.connect(r.Lnext, r).Sym; r = r.Lprev; } else { for ( ; r.Lnext !== n && (_s.edgeGoesRight(n.Lprev) || _s.edgeSign(n.Dst, n.Org, n.Lprev.Org) >= 0); ) n = t.connect(n, n.Lprev).Sym; n = n.Lnext; } if (r.Lnext === n) throw "Mono region invalid"; for (; r.Lnext.Lnext !== n; ) r = t.connect(r.Lnext, r).Sym; return !0; }), (t.prototype.tessellateInterior_ = function (t) { for (var e, n = t.fHead.next; n !== t.fHead; n = e) if (((e = n.next), n.inside && !this.tessellateMonoRegion_(t, n))) return !1; return !0; }), (t.prototype.discardExterior_ = function (t) { for (var e, n = t.fHead.next; n !== t.fHead; n = e) (e = n.next), n.inside || t.zapFace(n); }), (t.prototype.setWindingNumber_ = function (t, e, n) { for (var r, i = t.eHead.next; i !== t.eHead; i = r) (r = i.next), i.Rface.inside !== i.Lface.inside ? (i.winding = i.Lface.inside ? e : -e) : n ? t.delete(i) : (i.winding = 0); }), (t.prototype.getNeighbourFace_ = function (t) { return t.Rface && t.Rface.inside ? t.Rface.n : -1; }), (t.prototype.outputPolymesh_ = function (t, e, n, r) { var i, o, a = 0, s = 0; n > 3 && t.mergeConvexFaces(n); for (var u = t.vHead.next; u !== t.vHead; u = u.next) u.n = -1; for (var l = t.fHead.next; l !== t.fHead; l = l.next) if (((l.n = -1), l.inside)) { (i = l.anEdge), (o = 0); do { -1 === (u = i.Org).n && ((u.n = s), s++), o++, (i = i.Lnext); } while (i !== l.anEdge); if (o > n) throw "Face vertex greater that support polygon"; (l.n = a), ++a; } (this.elementCount = a), e === hs.CONNECTED_POLYGONS && (a *= 2), (this.elements = []), (this.elements.length = a * n), (this.vertexCount = s), (this.vertices = []), (this.vertices.length = s * r), (this.vertexIndices = []), (this.vertexIndices.length = s); for (u = t.vHead.next; u !== t.vHead; u = u.next) if (-1 !== u.n) { var c = u.n * r; (this.vertices[c + 0] = u.coords[0]), (this.vertices[c + 1] = u.coords[1]), r > 2 && (this.vertices[c + 2] = u.coords[2]), (this.vertexIndices[u.n] = u.idx); } var h = 0; for (l = t.fHead.next; l !== t.fHead; l = l.next) if (l.inside) { (i = l.anEdge), (o = 0); do { u = i.Org; (this.elements[h++] = u.n), o++, (i = i.Lnext); } while (i !== l.anEdge); for (var p = o; p < n; ++p) this.elements[h++] = -1; if (e === hs.CONNECTED_POLYGONS) { i = l.anEdge; do { (this.elements[h++] = this.getNeighbourFace_(i)), (i = i.Lnext); } while (i !== l.anEdge); for (var d = o; d < n; ++d) this.elements[h++] = -1; } } }), (t.prototype.outputContours_ = function (t, e) { var n, r, i = 0, o = 0; (this.vertexCount = 0), (this.elementCount = 0); for (var a = t.fHead.next; a !== t.fHead; a = a.next) if (a.inside) { r = n = a.anEdge; do { this.vertexCount++, (n = n.Lnext); } while (n !== r); this.elementCount++; } (this.elements = []), (this.elements.length = 2 * this.elementCount), (this.vertices = []), (this.vertices.length = this.vertexCount * e), (this.vertexIndices = []), (this.vertexIndices.length = this.vertexCount); var s = 0, u = 0, l = 0; i = 0; for (a = t.fHead.next; a !== t.fHead; a = a.next) if (a.inside) { (o = 0), (r = n = a.anEdge); do { (this.vertices[s++] = n.Org.coords[0]), (this.vertices[s++] = n.Org.coords[1]), e > 2 && (this.vertices[s++] = n.Org.coords[2]), (this.vertexIndices[u++] = n.Org.idx), o++, (n = n.Lnext); } while (n !== r); (this.elements[l++] = i), (this.elements[l++] = o), (i += o); } }), (t.prototype.addContour = function (t, e) { null === this.mesh && (this.mesh = new vs()), t < 2 && (t = 2), t > 3 && (t = 3); for (var n = null, r = 0; r < e.length; r += t) null === n ? ((n = this.mesh.makeEdge()), this.mesh.splice(n, n.Sym)) : (this.mesh.splitEdge(n), (n = n.Lnext)), (n.Org.coords[0] = e[r + 0]), (n.Org.coords[1] = e[r + 1]), (n.Org.coords[2] = t > 2 ? e[r + 2] : 0), (n.Org.idx = this.vertexIndexCounter++), (n.winding = 1), (n.Sym.winding = -1); }), (t.prototype.tesselate = function (t, e, n, r, i, o) { if ( (void 0 === t && (t = cs.ODD), void 0 === e && (e = hs.POLYGONS), void 0 === o && (o = !0), (this.vertices = []), (this.elements = []), (this.vertexIndices = []), (this.vertexIndexCounter = 0), i && ((this.normal[0] = i[0]), (this.normal[1] = i[1]), (this.normal[2] = i[2])), (this.windingRule = t), r < 2 && (r = 2), r > 3 && (r = 3), !this.mesh) ) return !1; this.projectPolygon_(), Ss.computeInterior(this, o); var a = this.mesh; return ( e === hs.BOUNDARY_CONTOURS ? this.setWindingNumber_(a, 1, !0) : this.tessellateInterior_(a), o && a.check(), e === hs.BOUNDARY_CONTOURS ? this.outputContours_(a, r) : this.outputPolymesh_(a, e, n, r), !0 ); }), t ); })(); function Ts(t) { var e = t.windingRule, n = void 0 === e ? cs.ODD : e, r = t.elementType, i = void 0 === r ? hs.POLYGONS : r, o = t.polySize, a = void 0 === o ? 3 : o, s = t.vertexSize, u = void 0 === s ? 2 : s, l = t.normal, c = void 0 === l ? [0, 0, 1] : l, h = t.contours, p = void 0 === h ? [] : h, d = t.strict, f = void 0 === d || d, g = t.debug, _ = void 0 !== g && g; if (!p && f) throw new Error("Contours can't be empty"); if (p) { for (var m = new Ds(), y = 0; y < p.length; y++) m.addContour(u || 2, p[y]); return ( m.tesselate(n, i, a, u, c, f), { vertices: m.vertices, vertexIndices: m.vertexIndices, vertexCount: m.vertexCount, elements: m.elements, elementCount: m.elementCount, mesh: _ ? m.mesh : void 0, } ); } } cs.ODD, cs.NONZERO, cs.POSITIVE, cs.NEGATIVE, cs.ABS_GEQ_TWO, hs.POLYGONS, hs.CONNECTED_POLYGONS, hs.BOUNDARY_CONTOURS; var Ps, Os, Bs = ((Ps = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0), function (t) { var e, n, r; (t = t || {}), e || (e = void 0 !== t ? t : {}), (e.ready = new Promise(function (t, e) { (n = t), (r = e); })); var i, o, a, s, u, l, c, h, p, d = e; function f(t, e, n) { if (!e || 0 > e) throw "Size should be a greater 0"; if (!t) throw "Invalid pointer!"; return ( ((e = new (n = n || Uint8Array)(d.HEAP8.buffer, t, e)).F = t), (e.I = function () { d._free(t); }), e ); } var g = (d.Tess = function () { if (!i) { var t = d.cwrap; (i = t("tessNewTess", "number", ["number"])), (o = t("tessDeleteTess", null, ["number"])), (a = t("tessAddContour", "number", [ "number", "number", "number", "number", "number", ])), (s = t( "tessTesselate", "number", "number number number number number number".split(" ") )), (u = t("tessGetVertexCount", "number", ["number"])), (l = t("tessGetVertices", "number", ["number"])), (c = t("tessGetElementCount", "number", ["number"])), (h = t("tessGetElements", "number", ["number"])), (p = t("tessGetVertexIndices", "number", ["number"])); } if (((this.F = i(0)), (this.G = []), !this.F)) throw "Unknown error, tesselator wasn't init!"; }); Object.assign(g.prototype, { dispose: function () { this.F && (o(this.F), this.G.forEach(function (t) { t.I && t.I(); }), (this.G = []), (this.F = 0)); }, addContours: function (t, e) { if (!this.F) throw "Tessealtor wasn't be inited!"; e = e || 2; var n = (this.G = []); "number" == typeof t[0] && (t = [t]); for (var r = 0; r < t.length; r++) { var i = t[r], o = i.length, s = Float32Array, u = d._malloc(o * s.BYTES_PER_ELEMENT); if (!u) throw "Can't allocate a " + o; (o = f(u, o, s)).set(i, 0), n.push(o), a( this.F, e, o.F, e * Float32Array.BYTES_PER_ELEMENT, i.length / e ); } }, tesselate: function (t) { if (0 === this.G.length) throw "Contours data is required!"; if ( ((t = Object.assign( { windingRule: 0, elementType: 0, polySize: 3, vertexSize: 2, fillVertexIndices: !1, }, t || {} )), !s( this.F, 0 | t.windingRule || 0, 0 | t.elementType || 0, 0 | t.polySize || 3, 0 | t.vertexSize || 2, 0 )) ) return null; var e = u(this.F), n = c(this.F), r = { elementCount: n, vertexCount: e }; return e && n ? ((r.vertices = f(l(this.F), e * t.vertexSize, Float32Array)), (r.elements = f(h(this.F), n * t.polySize, Uint32Array)), t.fillVertexIndices && (r.vertexIndices = f(p(this.F), e, Uint32Array)), r) : null; }, }); var _, m = {}; for (_ in e) e.hasOwnProperty(_) && (m[_] = e[_]); var y = ""; "undefined" != typeof document && document.currentScript && (y = document.currentScript.src), Ps && (y = Ps), (y = 0 !== y.indexOf("blob:") ? y.substr(0, y.lastIndexOf("/") + 1) : ""); var A = e.printErr || console.warn.bind(console); for (_ in m) m.hasOwnProperty(_) && (e[_] = m[_]); m = null; var v, b = 0; e.wasmBinary && (v = e.wasmBinary), e.noExitRuntime && e.noExitRuntime, "object" != typeof WebAssembly && j("no native wasm support detected"); var C, I = !1; function E(t) { var n = e["_" + t]; return ( n || j( "Assertion failed: Cannot call unknown function " + t + ", make sure it is exported" ), n ); } function x(t, e, n, r) { var i, o = { string: function (t) { var e = 0; if (null != t && 0 !== t) { var n = 1 + (t.length << 2), r = (e = $(n)), i = D; if (0 < n) { n = r + n - 1; for (var o = 0; o < t.length; ++o) { var a = t.charCodeAt(o); if ( (55296 <= a && 57343 >= a && (a = (65536 + ((1023 & a) << 10)) | (1023 & t.charCodeAt(++o))), 127 >= a) ) { if (r >= n) break; i[r++] = a; } else { if (2047 >= a) { if (r + 1 >= n) break; i[r++] = 192 | (a >> 6); } else { if (65535 >= a) { if (r + 2 >= n) break; i[r++] = 224 | (a >> 12); } else { if (r + 3 >= n) break; (i[r++] = 240 | (a >> 18)), (i[r++] = 128 | ((a >> 12) & 63)); } i[r++] = 128 | ((a >> 6) & 63); } i[r++] = 128 | (63 & a); } } i[r] = 0; } } return e; }, array: function (t) { var e = $(t.length); return S.set(t, e), e; }, }, a = E(t), s = []; if (((t = 0), r)) for (var u = 0; u < r.length; u++) { var l = o[n[u]]; l ? (0 === t && (t = W()), (s[u] = l(r[u]))) : (s[u] = r[u]); } return ( (n = a.apply(null, s)), (i = n), (n = "string" === e ? P(i) : "boolean" === e ? !!i : i), 0 !== t && J(t), n ); } var w, S, D, T = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; function P(t) { if (t) { for (var e = D, n = t + NaN, r = t; e[r] && !(r >= n); ) ++r; if (16 < r - t && e.subarray && T) t = T.decode(e.subarray(t, r)); else { for (n = ""; t < r; ) { var i = e[t++]; if (128 & i) { var o = 63 & e[t++]; if (192 == (224 & i)) n += String.fromCharCode(((31 & i) << 6) | o); else { var a = 63 & e[t++]; 65536 > (i = 224 == (240 & i) ? ((15 & i) << 12) | (o << 6) | a : ((7 & i) << 18) | (o << 12) | (a << 6) | (63 & e[t++])) ? (n += String.fromCharCode(i)) : ((i -= 65536), (n += String.fromCharCode( 55296 | (i >> 10), 56320 | (1023 & i) ))); } } else n += String.fromCharCode(i); } t = n; } } else t = ""; return t; } function O() { var t = C.buffer; (w = t), (e.HEAP8 = S = new Int8Array(t)), (e.HEAP16 = new Int16Array(t)), (e.HEAP32 = new Int32Array(t)), (e.HEAPU8 = D = new Uint8Array(t)), (e.HEAPU16 = new Uint16Array(t)), (e.HEAPU32 = new Uint32Array(t)), (e.HEAPF32 = new Float32Array(t)), (e.HEAPF64 = new Float64Array(t)); } var B, M = [], L = [], N = [], R = []; function F() { var t = e.preRun.shift(); M.unshift(t); } var k = 0, U = null; function j(t) { throw ( (e.onAbort && e.onAbort(t), A(t), (I = !0), (t = new WebAssembly.RuntimeError( "abort(" + t + "). Build with -s ASSERTIONS=1 for more info." )), r(t), t) ); } function V(t) { return String.prototype.startsWith ? t.startsWith("data:application/octet-stream;base64,") : 0 === t.indexOf("data:application/octet-stream;base64,"); } (e.preloadedImages = {}), (e.preloadedAudios = {}); var Q = "data:application/octet-stream;base64,AGFzbQEAAAABYQ9gAn9/AX9gAn9/AGADf39/AX9gAX8Bf2ABfwBgA39/fwBgBX9/f39/AGAEf39/fwBgBn9/f39/fwBgAAF/YAR/f39/AX9gA39/fwF9YAAAYAR/fX19AGAGf39/f39/AX8CSQwBYQFhAAcBYQFiAAQBYQFjAAkBYQFkAAEBYQFlAAUBYQFmAAEBYQFnAAIBYQFoAAcBYQFpAAgBYQFqAAABYQFrAAIBYQFsAAMDSUgLAgADAgACAwgEAwIECgEBAAIAAwEDDAsBAAoEAQANAgQBAgMECQAFAAEAAwMDAwMOBgUGBAMBAgAAAAUCAwEDAAABAgADAAYEBQFwAQ8PBQcBAYACgIACBgkBfwFBwJrAAgsHSRIBbQIAAW4BAAFvACIBcAAWAXEAFQFyAEEBcwBAAXQAPQF1ADwBdgA7AXcAOgF4ADkBeQA4AXoANwFBADEBQgAwAUMALwFEADUJFAEAQQELDjJIJ0kDDkUsPz4tRENCCsqjAkihAQEEfQJAIAAqAhgiBCABKgIYIgNdRQRAIAMgBFwNASAAKgIcIAEqAhxfQQFzDQELIAMgAioCGCIFXUUEQCADIAVcDQEgASoCHCACKgIcX0UNAQsgAyAEkyIEIAUgA5MiA5JDAAAAAF5BAXMEfUMAAAAABSAEIAEqAhwiBCACKgIck5QgAyAEIAAqAhyTlJILDwtBhQhBqAhB0gBBvwgQAAAL6QMBBn8CQCABIAJGDQAgAigCECIEIAEoAhAiB0cEQCAEKAIIIgUhAwNAIAMgBzYCECADKAIIIgMgBUcNAAsgBCgCACIDIAQoAgQiBTYCBCAFIAM2AgAgBCAAKAKIASIDKAIANgIAIAMgBDYCAAsgAigCFCIFIAEoAhQiCEcEQCAFKAIIIgYhAwNAIAMgCDYCFCADKAIMIgMgBkcNAAsgBSgCACIDIAUoAgQiBjYCBCAGIAM2AgAgBSAAKAKMASIDKAIANgIAIAMgBTYCAAsgASgCCCEDIAIoAggiBigCBCABNgIMIAMoAgQgAjYCDCACIAM2AgggASAGNgIIIAQgB0YEQCAAKAKIARAPIgRFBEBBAA8LIAQgASgCECIDKAIEIgc2AgQgByAENgIAIAQgAzYCACADIAQ2AgQgBCACNgIIIAIhAwNAIAMgBDYCECADKAIIIgMgAkcNAAsgASgCECABNgIICyAFIAhHDQAgACgCjAEQDyIARQRAQQAPCyAAIAEoAhQiAygCBCIENgIEIAQgADYCACAAIAM2AgAgAyAANgIEIABBADoAFCAAQQA2AgwgACACNgIIIAAgAy0AFToAFSACIQMDQCADIAA2AhQgAygCDCIDIAJHDQALIAEoAhQgATYCCAtBAQvUBQEGfyABKAIUIgMgASgCBCIFKAIUIgZHBEAgAygCCCIEIQIDQCACIAY2AhQgAigCDCICIARHDQALIAMoAgAiAiADKAIEIgQ2AgQgBCACNgIAIAMgACgCjAEiAigCADYCACACIAM2AgALAkAgASABKAIIIgJGBEAgASgCECIDKAIIIgQhAgNAIAJBADYCECACKAIIIgIgBEcNAAsgAygCACICIAMoAgQiBDYCBCAEIAI2AgAgAyAAKAKIASICKAIANgIAIAIgAzYCAAwBCyABKAIEIgQoAhQgBCgCDCIENgIIIAEoAhAgAjYCCCAEKAIIIQcgAigCBCAENgIMIAcoAgQgATYCDCABIAc2AgggBCACNgIIIAMgBkcNACAAKAKMARAPIgNFBEBBAA8LIAMgASgCFCICKAIEIgQ2AgQgBCADNgIAIAMgAjYCACACIAM2AgQgA0EAOgAUIANBADYCDCADIAE2AgggAyACLQAVOgAVIAEhAgNAIAIgAzYCFCACKAIMIgIgAUcNAAsLAkAgBSAFKAIIIgJGBEAgBSgCECIDKAIIIgQhAgNAIAJBADYCECACKAIIIgIgBEcNAAsgAygCACICIAMoAgQiBDYCBCAEIAI2AgAgAyAAKAKIASICKAIANgIAIAIgAzYCACAFKAIUIgMoAggiBSECA0AgAkEANgIUIAIoAgwiAiAFRw0ACyADKAIAIgIgAygCBCIFNgIEIAUgAjYCACADIAAoAowBIgIoAgA2AgAgAiADNgIADAELIAEoAhQgBSgCBCgCDCIDNgIIIAUoAhAgAjYCCCADKAIIIQQgAigCBCADNgIMIAQoAgQgBTYCDCAFIAQ2AgggAyACNgIICyAAKAKEASECIAEoAgQiACABIAAgAUkbIgAoAgAiASgCBCAAKAIEKAIAIgM2AgAgAygCBCABNgIAIAAgAigCADYCACACIAA2AgBBAQujAQEFfwJAIAAoAgAiAQRAIAEoAgAiAg0BCyAAKAIUIgMoAgwgACgCDCAAKAIIbEEEaiADKAIAEQAAIgRFBEBBAA8LIAQgACgCBDYCACAAIAQ2AgQgACgCCCIFIAAoAgxsQQRqIQIgACgCACEDA0AgBCACIAVrIgJqIgEgAzYCACABIQMgAkEERw0ACyAAIAE2AgAgASgCACECCyAAIAI2AgAgAQtBAQJ/AkAgAkUNAANAIAEgA0EDdGooAgAiBEUNASAAIARGBEAgASADQQN0aigCBA8LIANBAWoiAyACRw0ACwtBAAu8AQEEfyAAIAEQUiIARQRAQQAPCyAAKAIEIQMgASgCBCIAKAIEKAIMIgIoAgghBCAAKAIIIgUoAgQgAjYCDCAEKAIEIAA2AgwgACAENgIIIAIgBTYCCCADKAIIIQIgACgCCCIEKAIEIAM2AgwgAigCBCAANgIMIAAgAjYCCCADIAQ2AgggACADKAIQNgIQIAMoAgQiAigCECACNgIIIAIgACgCFDYCFCADIAEoAhw2AhwgAiAAKAIcNgIcIAMLlwQBB38Cf0EAIAAoAoQBEA8iA0UNABogAyABKAIEIgQgASABIARLGyIJKAIEIgUoAgAiBDYCICAEKAIEIAM2AgAgAyAJNgIAIAUgA0EgaiIHNgIAIANCADcCECADIAc2AgwgAyAHNgIEIANCADcCGCADQgA3AjAgAyAHNgIoIANCADcCOCADIAM2AgggAyADNgIsIAMgAzYCJAJ/IAMgAigCFCIGIAEoAhQiCEciCUUNABogBigCCCIFIQQDQCAEIAg2AhQgBCgCDCIEIAVHDQALIAYoAgAiBSAGKAIEIgQ2AgQgBCAFNgIAIAYgACgCjAEiBCgCADYCACAEIAY2AgAgASgCFCEGIAMoAggLIQggASgCDCIFKAIIIQQgCCgCBCAFNgIMIAQoAgQgAzYCDCADIAQ2AgggBSAINgIIIAIoAgghBSADKAIoIgQoAgQgAjYCDCAFKAIEIAc2AgwgAyAFNgIoIAIgBDYCCCADIAEoAgQoAhA2AhAgAigCECECIAMgBjYCNCADIAI2AjAgAyAGNgIUIAEoAhQgBzYCCCADIAkNABpBACAAKAKMARAPIgJFDQAaIAIgASgCFCIBKAIEIgA2AgQgACACNgIAIAIgATYCACABIAI2AgQgAkEAOgAUIAJBADYCDCACIAM2AgggAiABLQAVOgAVIAMhBANAIAQgAjYCFCAEKAIMIgQgA0cNAAsgAwsLUgECf0GwFigCACIBIABBA2pBfHEiAmohAAJAIAJBAU5BACAAIAFNGw0APwBBEHQgAEkEQCAAEAtFDQELQbAWIAA2AgAgAQ8LQcAWQTA2AgBBfwvHBQIEfwJ9IAFBBGohCAJAAkACQAJAA0AgAigCECIGKgIYIgogAigCBCIHKAIQIgkqAhgiC11FBEAgCiALXA0CIAYqAhwgCSoCHF9FDQILIAAoAkwQDyIGRQ0EIAYgBzYCACAGIAAoAkAgASgCBCAGEB0iCTYCBCAJRQ0EIAZCADcCECAGQQA2AhggByAGNgIYIAIoAggiAiADRw0ACyABKAIEKAIIKAIAIgIoAgAoAgQiAygCEAJ/IARFBEAgAygCCCEECyAEKAIQC0YEQEEAIQcDQCABIQYgAiEBIAQiAiADIgQoAghHBEAgACgCACAEKAIEKAIMIAQQDUUNBiAAKAIAIAIoAgQoAgwgBBANRQ0GCyABIAYoAgggBCgCHGsiAzYCCCABAn8CQAJAAkACQAJAAkAgACgCPA4FBQABAgMECyADQQBHDAULIANBAEoMBAsgA0EfdgwDCyADQQFqQQJLDAILQd0PQZwPQfABQeMPEAAACyADQQFxCzYCDCAGQQE2AhQCQCAHRQ0AIAAgBhAeRQ0AIAQgBCgCHCACKAIcajYCHCAEKAIEIgMgAygCHCACKAIEKAIcajYCHCAGKAIAIQMgBigCGARAIAMoAhwNBQsgA0EANgIYIAAoAkAhByAIKAIAIgMoAgQiCCADKAIINgIIIAMoAgggCDYCBCADIAcoAhAiCCgCADYCACAIIAM2AgAgBiAAKAJMIgMoAgA2AgAgAyAGNgIAIAAoAgAgAhAORQ0GCyABQQRqIQhBASEHIAEoAgQoAggoAgAiAigCACgCBCIDKAIQIAQoAhBGDQALCyABQQE2AhQgAigCCCABKAIIIAMoAhxrRw0CIAUEQCAAIAEQKAsPC0G6E0GcD0HdAkHUExAAAAtB8w9BnA9BkgFBihAQAAALQeITQZwPQYcDQdQTEAAACyAAQZABakEBEAMAC/oMAQd/AkAgAEUNACAAQQhrIgMgAEEEaygCACIBQXhxIgBqIQUCQCABQQFxDQAgAUEDcUUNASADIAMoAgAiAmsiA0HUFigCACIESQ0BIAAgAmohACADQdgWKAIARwRAIAJB/wFNBEAgAygCCCIEIAJBA3YiAkEDdEHsFmpHGiAEIAMoAgwiAUYEQEHEFkHEFigCAEF+IAJ3cTYCAAwDCyAEIAE2AgwgASAENgIIDAILIAMoAhghBgJAIAMgAygCDCIBRwRAIAMoAggiAiAETwRAIAIoAgwaCyACIAE2AgwgASACNgIIDAELAkAgA0EUaiICKAIAIgQNACADQRBqIgIoAgAiBA0AQQAhAQwBCwNAIAIhByAEIgFBFGoiAigCACIEDQAgAUEQaiECIAEoAhAiBA0ACyAHQQA2AgALIAZFDQECQCADIAMoAhwiAkECdEH0GGoiBCgCAEYEQCAEIAE2AgAgAQ0BQcgWQcgWKAIAQX4gAndxNgIADAMLIAZBEEEUIAYoAhAgA0YbaiABNgIAIAFFDQILIAEgBjYCGCADKAIQIgIEQCABIAI2AhAgAiABNgIYCyADKAIUIgJFDQEgASACNgIUIAIgATYCGAwBCyAFKAIEIgFBA3FBA0cNAEHMFiAANgIAIAUgAUF+cTYCBCADIABBAXI2AgQgACADaiAANgIADwsgAyAFTw0AIAUoAgQiAUEBcUUNAAJAIAFBAnFFBEAgBUHcFigCAEYEQEHcFiADNgIAQdAWQdAWKAIAIABqIgA2AgAgAyAAQQFyNgIEIANB2BYoAgBHDQNBzBZBADYCAEHYFkEANgIADwsgBUHYFigCAEYEQEHYFiADNgIAQcwWQcwWKAIAIABqIgA2AgAgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAFBeHEgAGohAAJAIAFB/wFNBEAgBSgCDCECIAUoAggiBCABQQN2IgFBA3RB7BZqIgdHBEBB1BYoAgAaCyACIARGBEBBxBZBxBYoAgBBfiABd3E2AgAMAgsgAiAHRwRAQdQWKAIAGgsgBCACNgIMIAIgBDYCCAwBCyAFKAIYIQYCQCAFIAUoAgwiAUcEQCAFKAIIIgJB1BYoAgBPBEAgAigCDBoLIAIgATYCDCABIAI2AggMAQsCQCAFQRRqIgIoAgAiBA0AIAVBEGoiAigCACIEDQBBACEBDAELA0AgAiEHIAQiAUEUaiICKAIAIgQNACABQRBqIQIgASgCECIEDQALIAdBADYCAAsgBkUNAAJAIAUgBSgCHCICQQJ0QfQYaiIEKAIARgRAIAQgATYCACABDQFByBZByBYoAgBBfiACd3E2AgAMAgsgBkEQQRQgBigCECAFRhtqIAE2AgAgAUUNAQsgASAGNgIYIAUoAhAiAgRAIAEgAjYCECACIAE2AhgLIAUoAhQiAkUNACABIAI2AhQgAiABNgIYCyADIABBAXI2AgQgACADaiAANgIAIANB2BYoAgBHDQFBzBYgADYCAA8LIAUgAUF+cTYCBCADIABBAXI2AgQgACADaiAANgIACyAAQf8BTQRAIABBA3YiAUEDdEHsFmohAAJ/QcQWKAIAIgJBASABdCIBcUUEQEHEFiABIAJyNgIAIAAMAQsgACgCCAshAiAAIAM2AgggAiADNgIMIAMgADYCDCADIAI2AggPC0EfIQIgA0IANwIQIABB////B00EQCAAQQh2IgEgAUGA/j9qQRB2QQhxIgF0IgIgAkGA4B9qQRB2QQRxIgJ0IgQgBEGAgA9qQRB2QQJxIgR0QQ92IAEgAnIgBHJrIgFBAXQgACABQRVqdkEBcXJBHGohAgsgAyACNgIcIAJBAnRB9BhqIQECQAJAAkBByBYoAgAiBEEBIAJ0IgdxRQRAQcgWIAQgB3I2AgAgASADNgIAIAMgATYCGAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiABKAIAIQEDQCABIgQoAgRBeHEgAEYNAiACQR12IQEgAkEBdCECIAQgAUEEcWoiB0EQaigCACIBDQALIAcgAzYCECADIAQ2AhgLIAMgAzYCDCADIAM2AggMAQsgBCgCCCIAIAM2AgwgBCADNgIIIANBADYCGCADIAQ2AgwgAyAANgIIC0HkFkHkFigCAEEBayIANgIAIAANAEGMGiEDA0AgAygCACIAQQhqIQMgAA0AC0HkFkF/NgIACwvCLQEMfyMAQRBrIgwkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQfQBTQRAQcQWKAIAIgdBECAAQQtqQXhxIABBC0kbIgVBA3YiAHYiAUEDcQRAIAFBf3NBAXEgAGoiAkEDdCIFQfQWaigCACIBQQhqIQACQCABKAIIIgMgBUHsFmoiBUYEQEHEFiAHQX4gAndxNgIADAELQdQWKAIAGiADIAU2AgwgBSADNgIICyABIAJBA3QiAkEDcjYCBCABIAJqIgEgASgCBEEBcjYCBAwNCyAFQcwWKAIAIghNDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxIgBBACAAa3FBAWsiACAAQQx2QRBxIgB2IgFBBXZBCHEiAiAAciABIAJ2IgBBAnZBBHEiAXIgACABdiIAQQF2QQJxIgFyIAAgAXYiAEEBdkEBcSIBciAAIAF2aiICQQN0IgNB9BZqKAIAIgEoAggiACADQewWaiIDRgRAQcQWIAdBfiACd3EiBzYCAAwBC0HUFigCABogACADNgIMIAMgADYCCAsgAUEIaiEAIAEgBUEDcjYCBCABIAVqIgQgAkEDdCICIAVrIgNBAXI2AgQgASACaiADNgIAIAgEQCAIQQN2IgVBA3RB7BZqIQFB2BYoAgAhAgJ/IAdBASAFdCIFcUUEQEHEFiAFIAdyNgIAIAEMAQsgASgCCAshBSABIAI2AgggBSACNgIMIAIgATYCDCACIAU2AggLQdgWIAQ2AgBBzBYgAzYCAAwNC0HIFigCACIKRQ0BIApBACAKa3FBAWsiACAAQQx2QRBxIgB2IgFBBXZBCHEiAiAAciABIAJ2IgBBAnZBBHEiAXIgACABdiIAQQF2QQJxIgFyIAAgAXYiAEEBdkEBcSIBciAAIAF2akECdEH0GGooAgAiASgCBEF4cSAFayEEIAEhAgNAAkAgAigCECIARQRAIAIoAhQiAEUNAQsgACgCBEF4cSAFayICIAQgAiAESSICGyEEIAAgASACGyEBIAAhAgwBCwsgASAFaiILIAFNDQIgASgCGCEJIAEgASgCDCIDRwRAIAEoAggiAEHUFigCAE8EQCAAKAIMGgsgACADNgIMIAMgADYCCAwMCyABQRRqIgIoAgAiAEUEQCABKAIQIgBFDQQgAUEQaiECCwNAIAIhBiAAIgNBFGoiAigCACIADQAgA0EQaiECIAMoAhAiAA0ACyAGQQA2AgAMCwtBfyEFIABBv39LDQAgAEELaiIAQXhxIQVByBYoAgAiCEUNAEEfIQZBACAFayEEAkACQAJAAn8gBUH///8HTQRAIABBCHYiACAAQYD+P2pBEHZBCHEiAHQiASABQYDgH2pBEHZBBHEiAXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgACABciACcmsiAEEBdCAFIABBFWp2QQFxckEcaiEGCyAGQQJ0QfQYaigCACICRQsEQEEAIQAMAQtBACEAIAVBAEEZIAZBAXZrIAZBH0YbdCEBA0ACQCACKAIEQXhxIAVrIgcgBE8NACACIQMgByIEDQBBACEEIAIhAAwDCyAAIAIoAhQiByAHIAIgAUEddkEEcWooAhAiAkYbIAAgBxshACABQQF0IQEgAg0ACwsgACADckUEQEECIAZ0IgBBACAAa3IgCHEiAEUNAyAAQQAgAGtxQQFrIgAgAEEMdkEQcSIAdiIBQQV2QQhxIgIgAHIgASACdiIAQQJ2QQRxIgFyIAAgAXYiAEEBdkECcSIBciAAIAF2IgBBAXZBAXEiAXIgACABdmpBAnRB9BhqKAIAIQALIABFDQELA0AgACgCBEF4cSAFayICIARJIQEgAiAEIAEbIQQgACADIAEbIQMgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgA0UNACAEQcwWKAIAIAVrTw0AIAMgBWoiBiADTQ0BIAMoAhghCSADIAMoAgwiAUcEQCADKAIIIgBB1BYoAgBPBEAgACgCDBoLIAAgATYCDCABIAA2AggMCgsgA0EUaiICKAIAIgBFBEAgAygCECIARQ0EIANBEGohAgsDQCACIQcgACIBQRRqIgIoAgAiAA0AIAFBEGohAiABKAIQIgANAAsgB0EANgIADAkLIAVBzBYoAgAiAU0EQEHYFigCACEAAkAgASAFayICQRBPBEBBzBYgAjYCAEHYFiAAIAVqIgM2AgAgAyACQQFyNgIEIAAgAWogAjYCACAAIAVBA3I2AgQMAQtB2BZBADYCAEHMFkEANgIAIAAgAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAsgAEEIaiEADAsLIAVB0BYoAgAiAUkEQEHQFiABIAVrIgE2AgBB3BZB3BYoAgAiACAFaiICNgIAIAIgAUEBcjYCBCAAIAVBA3I2AgQgAEEIaiEADAsLQQAhACAFQS9qIgQCf0GcGigCAARAQaQaKAIADAELQagaQn83AgBBoBpCgKCAgICABDcCAEGcGiAMQQxqQXBxQdiq1aoFczYCAEGwGkEANgIAQYAaQQA2AgBBgCALIgJqIgdBACACayIGcSICIAVNDQpB/BkoAgAiAwRAQfQZKAIAIgggAmoiCSAITQ0LIAMgCUkNCwtBgBotAABBBHENBQJAAkBB3BYoAgAiAwRAQYQaIQADQCADIAAoAgAiCE8EQCAIIAAoAgRqIANLDQMLIAAoAggiAA0ACwtBABATIgFBf0YNBiACIQdBoBooAgAiAEEBayIDIAFxBEAgAiABayABIANqQQAgAGtxaiEHCyAFIAdPDQYgB0H+////B0sNBkH8GSgCACIABEBB9BkoAgAiAyAHaiIGIANNDQcgACAGSQ0HCyAHEBMiACABRw0BDAgLIAcgAWsgBnEiB0H+////B0sNBSAHEBMiASAAKAIAIAAoAgRqRg0EIAEhAAsCQCAFQTBqIAdNDQAgAEF/Rg0AQaQaKAIAIgEgBCAHa2pBACABa3EiAUH+////B0sEQCAAIQEMCAsgARATQX9HBEAgASAHaiEHIAAhAQwIC0EAIAdrEBMaDAULIAAiAUF/Rw0GDAQLAAtBACEDDAcLQQAhAQwFCyABQX9HDQILQYAaQYAaKAIAQQRyNgIACyACQf7///8HSw0BIAIQEyIBQQAQEyIATw0BIAFBf0YNASAAQX9GDQEgACABayIHIAVBKGpNDQELQfQZQfQZKAIAIAdqIgA2AgBB+BkoAgAgAEkEQEH4GSAANgIACwJAAkACQEHcFigCACIEBEBBhBohAANAIAEgACgCACICIAAoAgQiA2pGDQIgACgCCCIADQALDAILQdQWKAIAIgBBACAAIAFNG0UEQEHUFiABNgIAC0EAIQBBiBogBzYCAEGEGiABNgIAQeQWQX82AgBB6BZBnBooAgA2AgBBkBpBADYCAANAIABBA3QiAkH0FmogAkHsFmoiAzYCACACQfgWaiADNgIAIABBAWoiAEEgRw0AC0HQFiAHQShrIgBBeCABa0EHcUEAIAFBCGpBB3EbIgJrIgM2AgBB3BYgASACaiICNgIAIAIgA0EBcjYCBCAAIAFqQSg2AgRB4BZBrBooAgA2AgAMAgsgASAETQ0AIAIgBEsNACAAKAIMQQhxDQAgACADIAdqNgIEQdwWIARBeCAEa0EHcUEAIARBCGpBB3EbIgBqIgE2AgBB0BZB0BYoAgAgB2oiAiAAayIANgIAIAEgAEEBcjYCBCACIARqQSg2AgRB4BZBrBooAgA2AgAMAQtB1BYoAgAiAyABSwRAQdQWIAE2AgAgASEDCyABIAdqIQJBhBohAAJAAkACQAJAAkACQANAIAIgACgCAEcEQCAAKAIIIgANAQwCCwsgAC0ADEEIcUUNAQtBhBohAANAIAQgACgCACICTwRAIAIgACgCBGoiAyAESw0DCyAAKAIIIQAMAAsACyAAIAE2AgAgACAAKAIEIAdqNgIEIAFBeCABa0EHcUEAIAFBCGpBB3EbaiIJIAVBA3I2AgQgAkF4IAJrQQdxQQAgAkEIakEHcRtqIgEgCWsgBWshACAFIAlqIQYgASAERgRAQdwWIAY2AgBB0BZB0BYoAgAgAGoiADYCACAGIABBAXI2AgQMAwsgAUHYFigCAEYEQEHYFiAGNgIAQcwWQcwWKAIAIABqIgA2AgAgBiAAQQFyNgIEIAAgBmogADYCAAwDCyABKAIEIgJBA3FBAUYEQCACQXhxIQoCQCACQf8BTQRAIAEoAggiAyACQQN2IgVBA3RB7BZqRxogAyABKAIMIgJGBEBBxBZBxBYoAgBBfiAFd3E2AgAMAgsgAyACNgIMIAIgAzYCCAwBCyABKAIYIQgCQCABIAEoAgwiB0cEQCABKAIIIgIgA08EQCACKAIMGgsgAiAHNgIMIAcgAjYCCAwBCwJAIAFBFGoiBCgCACIFDQAgAUEQaiIEKAIAIgUNAEEAIQcMAQsDQCAEIQIgBSIHQRRqIgQoAgAiBQ0AIAdBEGohBCAHKAIQIgUNAAsgAkEANgIACyAIRQ0AAkAgASABKAIcIgJBAnRB9BhqIgMoAgBGBEAgAyAHNgIAIAcNAUHIFkHIFigCAEF+IAJ3cTYCAAwCCyAIQRBBFCAIKAIQIAFGG2ogBzYCACAHRQ0BCyAHIAg2AhggASgCECICBEAgByACNgIQIAIgBzYCGAsgASgCFCICRQ0AIAcgAjYCFCACIAc2AhgLIAEgCmohASAAIApqIQALIAEgASgCBEF+cTYCBCAGIABBAXI2AgQgACAGaiAANgIAIABB/wFNBEAgAEEDdiIBQQN0QewWaiEAAn9BxBYoAgAiAkEBIAF0IgFxRQRAQcQWIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgBjYCCCABIAY2AgwgBiAANgIMIAYgATYCCAwDC0EfIQQgAEH///8HTQRAIABBCHYiASABQYD+P2pBEHZBCHEiAXQiAiACQYDgH2pBEHZBBHEiAnQiAyADQYCAD2pBEHZBAnEiA3RBD3YgASACciADcmsiAUEBdCAAIAFBFWp2QQFxckEcaiEECyAGIAQ2AhwgBkIANwIQIARBAnRB9BhqIQECQEHIFigCACICQQEgBHQiA3FFBEBByBYgAiADcjYCACABIAY2AgAgBiABNgIYDAELIABBAEEZIARBAXZrIARBH0YbdCEEIAEoAgAhAQNAIAEiAigCBEF4cSAARg0DIARBHXYhASAEQQF0IQQgAiABQQRxaiIDKAIQIgENAAsgAyAGNgIQIAYgAjYCGAsgBiAGNgIMIAYgBjYCCAwCC0HQFiAHQShrIgBBeCABa0EHcUEAIAFBCGpBB3EbIgJrIgY2AgBB3BYgASACaiICNgIAIAIgBkEBcjYCBCAAIAFqQSg2AgRB4BZBrBooAgA2AgAgBCADQScgA2tBB3FBACADQSdrQQdxG2pBL2siACAAIARBEGpJGyICQRs2AgQgAkGMGikCADcCECACQYQaKQIANwIIQYwaIAJBCGo2AgBBiBogBzYCAEGEGiABNgIAQZAaQQA2AgAgAkEYaiEAA0AgAEEHNgIEIABBCGohASAAQQRqIQAgASADSQ0ACyACIARGDQMgAiACKAIEQX5xNgIEIAQgAiAEayIDQQFyNgIEIAIgAzYCACADQf8BTQRAIANBA3YiAUEDdEHsFmohAAJ/QcQWKAIAIgJBASABdCIBcUUEQEHEFiABIAJyNgIAIAAMAQsgACgCCAshASAAIAQ2AgggASAENgIMIAQgADYCDCAEIAE2AggMBAtBHyEAIARCADcCECADQf///wdNBEAgA0EIdiIAIABBgP4/akEQdkEIcSIAdCIBIAFBgOAfakEQdkEEcSIBdCICIAJBgIAPakEQdkECcSICdEEPdiAAIAFyIAJyayIAQQF0IAMgAEEVanZBAXFyQRxqIQALIAQgADYCHCAAQQJ0QfQYaiEBAkBByBYoAgAiAkEBIAB0IgdxRQRAQcgWIAIgB3I2AgAgASAENgIAIAQgATYCGAwBCyADQQBBGSAAQQF2ayAAQR9GG3QhACABKAIAIQEDQCABIgIoAgRBeHEgA0YNBCAAQR12IQEgAEEBdCEAIAIgAUEEcWoiBygCECIBDQALIAcgBDYCECAEIAI2AhgLIAQgBDYCDCAEIAQ2AggMAwsgAigCCCIAIAY2AgwgAiAGNgIIIAZBADYCGCAGIAI2AgwgBiAANgIICyAJQQhqIQAMBQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIIC0HQFigCACIAIAVNDQBB0BYgACAFayIBNgIAQdwWQdwWKAIAIgAgBWoiAjYCACACIAFBAXI2AgQgACAFQQNyNgIEIABBCGohAAwDC0HAFkEwNgIAQQAhAAwCCwJAIAlFDQACQCADKAIcIgBBAnRB9BhqIgIoAgAgA0YEQCACIAE2AgAgAQ0BQcgWIAhBfiAAd3EiCDYCAAwCCyAJQRBBFCAJKAIQIANGG2ogATYCACABRQ0BCyABIAk2AhggAygCECIABEAgASAANgIQIAAgATYCGAsgAygCFCIARQ0AIAEgADYCFCAAIAE2AhgLAkAgBEEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBUEDcjYCBCAGIARBAXI2AgQgBCAGaiAENgIAIARB/wFNBEAgBEEDdiIBQQN0QewWaiEAAn9BxBYoAgAiAkEBIAF0IgFxRQRAQcQWIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgBjYCCCABIAY2AgwgBiAANgIMIAYgATYCCAwBC0EfIQAgBEH///8HTQRAIARBCHYiACAAQYD+P2pBEHZBCHEiAHQiASABQYDgH2pBEHZBBHEiAXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgACABciACcmsiAEEBdCAEIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRB9BhqIQECQAJAIAhBASAAdCICcUUEQEHIFiACIAhyNgIAIAEgBjYCAAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACABKAIAIQUDQCAFIgEoAgRBeHEgBEYNAiAAQR12IQIgAEEBdCEAIAEgAkEEcWoiAigCECIFDQALIAIgBjYCEAsgBiABNgIYIAYgBjYCDCAGIAY2AggMAQsgASgCCCIAIAY2AgwgASAGNgIIIAZBADYCGCAGIAE2AgwgBiAANgIICyADQQhqIQAMAQsCQCAJRQ0AAkAgASgCHCIAQQJ0QfQYaiICKAIAIAFGBEAgAiADNgIAIAMNAUHIFiAKQX4gAHdxNgIADAILIAlBEEEUIAkoAhAgAUYbaiADNgIAIANFDQELIAMgCTYCGCABKAIQIgAEQCADIAA2AhAgACADNgIYCyABKAIUIgBFDQAgAyAANgIUIAAgAzYCGAsCQCAEQQ9NBEAgASAEIAVqIgBBA3I2AgQgACABaiIAIAAoAgRBAXI2AgQMAQsgASAFQQNyNgIEIAsgBEEBcjYCBCAEIAtqIAQ2AgAgCARAIAhBA3YiA0EDdEHsFmohAEHYFigCACECAn9BASADdCIDIAdxRQRAQcQWIAMgB3I2AgAgAAwBCyAAKAIICyEDIAAgAjYCCCADIAI2AgwgAiAANgIMIAIgAzYCCAtB2BYgCzYCAEHMFiAENgIACyABQQhqIQALIAxBEGokACAAC/MDAQR/IAEoAgAhAwJAAkACQCABIAJHBEADQCABQQA2AhggASgCBCIEKAIIKAIAIgUoAgAiBigCECADKAIQRwRAIAUoAhhFBEAgASgCDCEFIAMoAhQiAiADNgIIIAIgBToAFSADQQA2AhggACgCQCEFIAQoAgQiAiAEKAIINgIIIAQoAgggAjYCBCAEIAUoAhAiAigCADYCACACIAQ2AgAgASAAKAJMIgAoAgA2AgAgACABNgIAIAMPCyAAKAIAIAMoAggoAgQgBigCBBASIgZFDQUgBSgCGEUNAyAAKAIAIAUoAgAQDkUNBSAFIAY2AgAgBUEANgIYIAYgBTYCGAsgBiADKAIIRwRAIAAoAgAgBigCBCgCDCAGEA1FDQUgACgCACADIAYQDUUNBQsgASgCDCEGIAEoAgAiAygCFCIEIAM2AgggBCAGOgAVIAEoAhgEQCADKAIcDQQLIANBADYCGCAAKAJAIQYgASgCBCIDKAIEIgQgAygCCDYCCCADKAIIIAQ2AgQgAyAGKAIQIgQoAgA2AgAgBCADNgIAIAEgACgCTCIEKAIANgIAIAQgATYCACAFKAIAIQMgBSIBIAJHDQALCyADDwtBvg9BnA9BnwFB0A8QAAALQfMPQZwPQZIBQYoQEAAACyAAQZABakEBEAMAC0oBA38gACgCFCEBIAAoAgQiAgRAA0AgAigCACEDIAEoAgwgAiABKAIIEQEAIAMiAg0ACwsgAEIANwIAIAEoAgwgACABKAIIEQEAC74BAQJ/IAAoAgxBGCAAKAIAEQAAIgQgATYCECAEIAA2AhQgBCADNgIMIAQgAkEEIAJBBEsbIgE2AgggBEIANwIAIAAoAgwgASADbEEEaiAAKAIAEQAAIgMEQCADIAQoAgQ2AgAgBCADNgIEIAQoAggiBSAEKAIMbEEEaiEAIAQoAgAhAgNAIAMgACAFayIAaiIBIAI2AgAgASECIABBBEcNAAsgBCACNgIAIAQPCyAAKAIMIAQgACgCCBEBAEEAC6gKAgl/An0jAEEgayIKJAAgACABNgJIIAEoAggiAyEEAkACQAJAAkACQANAIAQoAhgiAg0BIAQoAggiBCADRw0ACyAKIAMoAgQ2AgAgACgCQCAKEDYoAgAiAigCBCgCCCgCACIERQ0BIAQoAgAhBiACKAIAIgUoAgQoAhAgASAFKAIQEAxDAAAAAFsEQCAAIAIgARBHDAILAn8gAiAGKAIEIgYoAhAiByoCGCILIAUoAgQoAhAiCCoCGCIMXQ0AGiALIAxbBEAgAiAHKgIcIAgqAhxfDQEaCyAECyEDAkAgAigCDEUEQCADKAIYRQ0BCyAAKAIAIQQCQCACIANGBEAgBCABKAIIKAIEIAUoAgwQEiIFDQEMBgsgBCAGKAIIKAIEIAEoAggQEiIERQ0FIAQoAgQhBQsgAygCGARAIAAoAgAgAygCABAOBEAgAyAFNgIAIANBADYCGCAFIAM2AhggACABEBoMBAsMBQsgACgCTBAPIgNFDQQgAyAFNgIAIAMgACgCQCACKAIEIAMQHSICNgIEIAJFDQQgA0IANwIQIANBADYCGCAFIAM2AhggACgCPCEEIAMgAygCACgCHCACKAIEKAIAKAIIaiICNgIIIAMCfwJAAkACQAJAAkACQCAEDgUFAAECAwQLIAJBAEcMBQsgAkEASgwECyACQR92DAMLIAJBAWpBAksMAgtB3Q9BnA9B8AFB4w8QAAALIAJBAXELNgIMIAAgARAaDAILIAAgAiABKAIIIgAgAEEAQQEQFAwBCyACKAIAKAIQIQEDQCACKAIEKAIEKAIAIgIoAgAiAygCECABRg0ACyACKAIYBEAgACgCACACKAIEKAIIKAIAKAIAKAIEIAMoAgwQEiIBRQ0DIAIoAhhFDQQgACgCACACKAIAEA5FDQMgAiABNgIAIAJBADYCGCABIAI2AhggAigCBCgCBCgCACICRQ0DCyACKAIEKAIIKAIAIgEoAgAiBCAAIAFBABAXIgEoAggiA0YEQCACKAIAIgMoAgQoAhAgAigCBCgCCCgCACIHKAIAIgYoAgQoAhBHBEAgACACECkaC0EBIQgCQCAAKAJIIgUqAhgiCyADKAIQIgkqAhhcDQAgCSoCHCAFKgIcXA0AIAAoAgAgBCgCBCgCDCADEA1FDQQgAigCACgCECEEA0AgAigCBCgCBCgCACICKAIAIgUoAhAgBEYNAAsgAigCGARAIAAoAgAgAigCBCgCCCgCACgCACgCBCAFKAIMEBIiBEUNBSACKAIYRQ0GIAAoAgAgAigCABAORQ0FIAIgBDYCACACQQA2AhggBCACNgIYIAIoAgQoAgQoAgAiAkUNBQsgAigCBCgCCCgCACIFKAIAIQQgACAFIAcQFxogACgCSCIFKgIYIQtBACEICwJAAkACQCALIAYoAhAiCSoCGCILXA0AIAkqAhwgBSoCHFwNACAAKAIAIAEgBigCBCgCDBANRQ0GIAAgB0EAEBchAQwBCyAIDQELIAAgAiABKAIIIAQgBEEBEBQMAgsCQCALIAMoAhAiBCoCGCIMXUUEQCALIAxcDQEgCSoCHCAEKgIcX0EBcw0BCyAGKAIEKAIMIQMLIAAoAgAgASgCCCgCBCADEBIiAUUNAyAAIAIgASABKAIIIgMgA0EAEBQgASgCBCgCGEEBNgIYIAAgAhAoDAELIAAgAiADIAQgBEEBEBQLIApBIGokAA8LAAsgAEGQAWpBARADAAtBvg9BnA9BnwFB0A8QAAALvAICCn8CfSAAKAIEIgMgACgCACICIAFBAnRqKAIAIgdBA3RqIQkgACgCDCEKIAAoAgghCAJAA0ACQCABQQF0IgAgCE4NACADIAIgAEEBciIEQQJ0aigCAEEDdGooAgAiBSoCGCIMIAMgAiAAQQJ0aigCAEEDdGooAgAiBioCGCINXUUEQCAMIA1cDQEgBSoCHCAGKgIcX0EBcw0BCyAEIQALIAAgCkwEQCAAIAhKDQIgCSgCACIEKgIYIgwgAyACIABBAnRqKAIAIgVBA3RqIgYoAgAiCyoCGCINXQ0CIAwgDVsEQCAEKgIcIAsqAhxfQQFzRQ0DCyACIAFBAnRqIAU2AgAgBiABNgIEIAAhAQwBCwtB7w5BiA1BjQFBgA8QAAALIAIgAUECdGogBzYCACADIAdBA3RqIAE2AgQL4AIBAn8CQCABRQ0AIAAgAWoiAkEBa0H/AToAACAAQf8BOgAAIAFBA0kNACACQQJrQf8BOgAAIABB/wE6AAEgAkEDa0H/AToAACAAQf8BOgACIAFBB0kNACACQQRrQf8BOgAAIABB/wE6AAMgAUEJSQ0AIABBACAAa0EDcSIDaiICQX82AgAgAiABIANrQXxxIgNqIgFBBGtBfzYCACADQQlJDQAgAkF/NgIIIAJBfzYCBCABQQhrQX82AgAgAUEMa0F/NgIAIANBGUkNACACQX82AhggAkF/NgIUIAJBfzYCECACQX82AgwgAUEQa0F/NgIAIAFBFGtBfzYCACABQRhrQX82AgAgAUEca0F/NgIAIAMgAkEEcUEYciIDayIBQSBJDQAgAiADaiECA0AgAkJ/NwMYIAJCfzcDECACQn83AwggAkJ/NwMAIAJBIGohAiABQSBrIgFBH0sNAAsLIAALZQEBfwNAIAEoAggiASgCACIDBEAgACgCDCADIAIgACgCFBECAEUNAQsLIAAoAhAQDyIARQRAQQAPCyAAIAI2AgAgACABKAIENgIEIAEoAgQgADYCCCAAIAE2AgggASAANgIEIAAL2AICBn8CfQJAAkACQCABKAIAIgMoAhAiAioCGCIIIAEoAgQoAggoAgAiBygCACIEKAIQIgUqAhgiCV1FBEAgCCAJXA0BIAIqAhwgBSoCHF9BAXMNAQsgBCgCBCgCECACIAUQDEMAAAAAXg0BAkAgAygCECICKgIYIAQoAhAiBSoCGFsEQCACKgIcIAUqAhxbDQELIAAoAgAgBCgCBBARRQ0DIAAoAgAgAyAEKAIEKAIMEA1FDQMgB0EBNgIUIAFBATYCFEEBDwtBASEGIAIgBUYNASAAKAJEIAIoAiAQSiAAKAIAIAQoAgQoAgwgAxANDQEMAgsgAygCBCgCECAFIAIQDEMAAAAAXQ0AQQEhBiABQQE2AhQgASgCBCgCBCgCAEEBNgIUIAAoAgAgAygCBBARRQ0BIAAoAgAgBCgCBCgCDCADEA1FDQELIAYPCyAAQZABakEBEAMAC7MDAgp/An0CQCAAKAIMIgNFBEAgACgCACIBKAIEIgcgASgCACIAKAIEIgVBA3RqIgQoAgAhAiABKAIIIghBAUgNASAAIAAgCEECdGooAgAiADYCBCAHIABBA3RqQQE2AgQgBEEANgIAIAQgASgCEDYCBCABIAhBAWs2AgggASAFNgIQIAhBAUYNASABQQEQGyACDwsgACgCCCIIIANBAnRqQQRrKAIAKAIAIQcCQCAAKAIAIgYoAggiCUUNACAGKAIEIgogBigCACIBKAIEIgRBA3RqIgUoAgAiAioCGCILIAcqAhgiDF1FBEAgCyAMXA0BIAIqAhwgByoCHF9BAXMNAQsgCUEBSA0BIAEgASAJQQJ0aigCACIANgIEIAogAEEDdGpBATYCBCAFQQA2AgAgCiAEQQN0aiAGKAIQNgIEIAYgCUEBazYCCCAGIAQ2AhAgCUEBRg0BIAZBARAbIAIPCyADQQEgA0EBSBtBAWshAgNAAkAgA0ECSARAIAIhBQwBCyADQQJ0IQQgA0EBayIFIQMgBCAIakEIaygCACgCAEUNAQsLIAAgBTYCDCAHIQILIAILlwEBAX8gAQRAIAEoAgAiAgRAIAAoAgwgAigCBCAAKAIIEQEAIAAoAgwgAigCACAAKAIIEQEAIAAoAgwgAiAAKAIIEQEACyABKAIIIgIEQCAAKAIMIAIgACgCCBEBAAsgASgCBCICBEAgACgCDCACIAAoAggRAQALIAAoAgwgASAAKAIIEQEADwtB6Q1BiA1BxwJB9A0QAAALgQQBB38gACgCiAEQDyEEIAAoAogBEA8hBSAAKAKMARAPIQMCQAJAAkAgBEUNACAFRQ0AIAMNAQsgBARAIAQgACgCiAEiAigCADYCACACIAQ2AgALIAUEQCAFIAAoAogBIgIoAgA2AgAgAiAFNgIACyADRQ0BIAMgACgCjAEiACgCADYCACAAIAM2AgBBAA8LIAAoAoQBEA8iAUUEQEEADwsgASAAKAJIIgIgAEHEAGoiBiACIAZJGyICKAIEIgYoAgAiBzYCICAHKAIEIAE2AgAgASACNgIAIAYgAUEgaiIGNgIAIAFCADcCECABIAY2AgwgASAGNgIEIAFCADcCGCABQgA3AjAgASAGNgIoIAFCADcCOCABIAE2AgggASABNgIsIAEgATYCJCAEIAAoAgQiAjYCBCACIAQ2AgAgBCABNgIIIAQgADYCACABIQIDQCACIAQ2AhAgAigCCCICIAFHDQALIAUgBDYCBCAEIAU2AgAgBSAANgIAIAAgBTYCBCAFIAY2AgggBiECA0AgAiAFNgIQIAIoAggiAiAGRw0ACyADIAAoAjAiAjYCBCACIAM2AgAgAyAAQSxqNgIAIAAgAzYCMCADQQA6ABQgA0EANgIMIAMgATYCCCADIAAtAEE6ABUgASECA0AgAiADNgIUIAIoAgwiAiABRw0ACwsgAQsDAAELtgEBBH0CQCAAKgIYIgQgASoCGCIDXUUEQCADIARcDQEgACoCHCABKgIcX0EBcw0BCyADIAIqAhgiBV1FBEAgAyAFXA0BIAEqAhwgAioCHF9FDQELIAMgBJMiBCAFIAOTIgOSIgVDAAAAAF5BAXMEfUMAAAAABSABKgIcIAAgAiADIAReIgEbKgIcIgaTIAQgAyABGyAFlSAGIAIgACABGyoCHJOUkgsPC0GFCEGoCEE6QbMIEAAAC4AMAQZ/IAAgAWohBQJAAkAgACgCBCICQQFxDQAgAkEDcUUNASAAKAIAIgMgAWohASAAIANrIgBB2BYoAgBHBEBB1BYoAgAhBCADQf8BTQRAIAAoAggiBCADQQN2IgNBA3RB7BZqRxogBCAAKAIMIgJGBEBBxBZBxBYoAgBBfiADd3E2AgAMAwsgBCACNgIMIAIgBDYCCAwCCyAAKAIYIQYCQCAAIAAoAgwiAkcEQCAAKAIIIgMgBE8EQCADKAIMGgsgAyACNgIMIAIgAzYCCAwBCwJAIABBFGoiAygCACIEDQAgAEEQaiIDKAIAIgQNAEEAIQIMAQsDQCADIQcgBCICQRRqIgMoAgAiBA0AIAJBEGohAyACKAIQIgQNAAsgB0EANgIACyAGRQ0BAkAgACAAKAIcIgNBAnRB9BhqIgQoAgBGBEAgBCACNgIAIAINAUHIFkHIFigCAEF+IAN3cTYCAAwDCyAGQRBBFCAGKAIQIABGG2ogAjYCACACRQ0CCyACIAY2AhggACgCECIDBEAgAiADNgIQIAMgAjYCGAsgACgCFCIDRQ0BIAIgAzYCFCADIAI2AhgMAQsgBSgCBCICQQNxQQNHDQBBzBYgATYCACAFIAJBfnE2AgQgACABQQFyNgIEIAUgATYCAA8LAkAgBSgCBCICQQJxRQRAIAVB3BYoAgBGBEBB3BYgADYCAEHQFkHQFigCACABaiIBNgIAIAAgAUEBcjYCBCAAQdgWKAIARw0DQcwWQQA2AgBB2BZBADYCAA8LIAVB2BYoAgBGBEBB2BYgADYCAEHMFkHMFigCACABaiIBNgIAIAAgAUEBcjYCBCAAIAFqIAE2AgAPC0HUFigCACEDIAJBeHEgAWohAQJAIAJB/wFNBEAgBSgCCCIEIAJBA3YiAkEDdEHsFmpHGiAEIAUoAgwiA0YEQEHEFkHEFigCAEF+IAJ3cTYCAAwCCyAEIAM2AgwgAyAENgIIDAELIAUoAhghBgJAIAUgBSgCDCICRwRAIAMgBSgCCCIDTQRAIAMoAgwaCyADIAI2AgwgAiADNgIIDAELAkAgBUEUaiIDKAIAIgQNACAFQRBqIgMoAgAiBA0AQQAhAgwBCwNAIAMhByAEIgJBFGoiAygCACIEDQAgAkEQaiEDIAIoAhAiBA0ACyAHQQA2AgALIAZFDQACQCAFIAUoAhwiA0ECdEH0GGoiBCgCAEYEQCAEIAI2AgAgAg0BQcgWQcgWKAIAQX4gA3dxNgIADAILIAZBEEEUIAYoAhAgBUYbaiACNgIAIAJFDQELIAIgBjYCGCAFKAIQIgMEQCACIAM2AhAgAyACNgIYCyAFKAIUIgNFDQAgAiADNgIUIAMgAjYCGAsgACABQQFyNgIEIAAgAWogATYCACAAQdgWKAIARw0BQcwWIAE2AgAPCyAFIAJBfnE2AgQgACABQQFyNgIEIAAgAWogATYCAAsgAUH/AU0EQCABQQN2IgJBA3RB7BZqIQECf0HEFigCACIDQQEgAnQiAnFFBEBBxBYgAiADcjYCACABDAELIAEoAggLIQMgASAANgIIIAMgADYCDCAAIAE2AgwgACADNgIIDwtBHyEDIABCADcCECABQf///wdNBEAgAUEIdiICIAJBgP4/akEQdkEIcSICdCIDIANBgOAfakEQdkEEcSIDdCIEIARBgIAPakEQdkECcSIEdEEPdiACIANyIARyayICQQF0IAEgAkEVanZBAXFyQRxqIQMLIAAgAzYCHCADQQJ0QfQYaiECAkACQEHIFigCACIEQQEgA3QiB3FFBEBByBYgBCAHcjYCACACIAA2AgAgACACNgIYDAELIAFBAEEZIANBAXZrIANBH0YbdCEDIAIoAgAhAgNAIAIiBCgCBEF4cSABRg0CIANBHXYhAiADQQF0IQMgBCACQQRxaiIHQRBqKAIAIgINAAsgByAANgIQIAAgBDYCGAsgACAANgIMIAAgADYCCA8LIAQoAggiASAANgIMIAQgADYCCCAAQQA2AhggACAENgIMIAAgATYCCAsLfwECfyAARQRAIAEQFg8LIAFBQE8EQEHAFkEwNgIAQQAPCyAAQQhrQRAgAUELakF4cSABQQtJGxA0IgIEQCACQQhqDwsgARAWIgJFBEBBAA8LIAIgAEF8QXggAEEEaygCACIDQQNxGyADQXhxaiIDIAEgASADSxsQMyAAEBUgAguIAQEDf0G0FkG0FigCAEEBaiIFNgIAIAAgBTYCAAJAIAMEQANAIAIgBEEDdGoiBigCAEUNAiAEQQFqIgQgA0cNAAsLIAAgASACIANBBHRBCHIQJSADQQF0IgAQJiEBIAAQASABDwsgBiAFNgIAIAIgBEEDdGoiACABNgIEIABBADYCCCADEAEgAgv0DQIQfw59IAAoAgAhBSMAQdAAayICIAAqAggiETgCACACIAAqAgwiFzgCBCACIAAqAhAiGDgCCAJAIBFDAAAAAFsgF0MAAAAAW3EgGEMAAAAAW3EiDEUEQCAFKAIAIQMMAQsgAiAFKAIAIgMiAUEUaigCADYCOCACIANBDGopAgA3AzAgAiABKAIUNgJIIAIgAykCDDcDQCACIAM2AgwgAiADNgIYIAIgAzYCECACIAM2AhwgAiADNgIUIAIgAzYCIAJAIAMgBUYEQCACKgI4IRogAioCSCEUIAIqAjAhFSACKgJAIRYgAioCNCEZIAIqAkQhEwwBCyACKgJIIRQgAioCOCEaIAIqAkQhEyACKgI0IRkgAioCQCEWIAIqAjAiGyEVIAMiBiIEIgciCCIJIgohAQNAIAEqAhQiEiAUIBIgFF4iDRshFCASIBogEiAaXSIOGyEaIAEqAhAiEiATIBIgE14iDxshEyASIBkgEiAZXSIQGyEZIAEqAgwiEiAWIBIgFl4iCxshFiABIAkgCxshCSASIBUgEiAVXSILGyEVIBIgGyALGyEbIAEgCiALGyEKIAEgBiANGyEGIAEgBCAOGyEEIAEgByAPGyEHIAEgCCAQGyEIIAEoAgAiASAFRw0ACyACIAo2AgwgAiAbOAIwIAIgFjgCQCACIAk2AhggAiAZOAI0IAIgCDYCECACIBM4AkQgAiAHNgIcIAIgGjgCOCACIAQ2AhQgAiAUOAJIIAIgBjYCIAtBAiATIBmTIBYgFZNeIgEgFCAakyABQQJ0IgEgAkFAa3IqAgAgAkEwaiABcioCAJNeG0ECdCIBIAJBMGpqKgIAIAJBQGsgAWoqAgBgQQFzRQRAIAJBgICA/AM2AgggAkIANwIAQwAAAAAhEUMAAIA/IRhDAAAAACEXDAELIAIgAkEMaiABaigCACIEKgIMIAJBGGogAWooAgAiASoCDCIckyITOAIkIAIgBCoCECABKgIQIh2TIhU4AiggAiAEKgIUIAEqAhQiHpMiEjgCLCADIAVHBEBDAAAAACEbIAMhAQNAIBMgASoCECAdkyIUlCAVIAEqAgwgHJMiFpSTIhogGpQgFSABKgIUIB6TIhmUIBIgFJSTIhQgFJQgEiAWlCATIBmUkyIWIBaUkpIiGSAbXkEBc0UEQCAaIRggFiEXIBkhGyAUIRELIAEoAgAiASAFRw0ACyACIBg4AgggAiAXOAIEIAIgETgCACAbQwAAAABfQQFzDQELIAJBADYCCCACQgA3AgAgAkECIBWMIBUgFUMAAAAAXRsgE4wgEyATQwAAAABdG14iASASjCASIBJDAAAAAF0bIAJBJGogAUECdGoqAgAiEYwgESARQwAAAABdG14bQQJ0akGAgID8AzYCACACKgIIIRggAioCACERIAIqAgQhFwsgAEEUaiIBQQIgF4wgFyAXQwAAAABdGyARjCARIBFDAAAAAF0bXiIEIBiMIBggGEMAAAAAXRsgAiAEQQJ0aioCACIRjCARIBFDAAAAAF0bXhsiBEECdCIGakEANgIAIAEgBEEBakEDcEECdCIHakGAgID8AzYCACABIARBAmpBA3BBAnQiBGpBADYCACAAQSBqIgEgBmpBADYCACABIAdqQwAAAIBDAAAAACACIAZqKgIAQwAAAABeIgYbOAIAIAEgBGpDAACAP0MAAIC/IAYbOAIAIAMgBUYiBkUEQCADIQEDQCABIAEqAgwiESAAKgIUlCABKgIQIhcgACoCGJSSIAEqAhQiGCAAKgIclJI4AhggASARIAAqAiCUIBcgACoCJJSSIBggACoCKJSSOAIcIAEoAgAiASAFRw0ACwsCQCAMRQ0AIAUoAiwiBCAFQSxqIghGDQBDAAAAACERA0AgBCgCCCIHIQEgBygCHEEBTgRAA0AgESABKAIQIgkqAhggASgCBCgCECIKKgIYkyAJKgIcIAoqAhySlJIhESABKAIMIgEgB0cNAAsLIAQoAgAiBCAIRw0ACyARQwAAAABdQQFzDQAgBkUEQCADIQEDQCABIAEqAhyMOAIcIAEoAgAiASAFRw0ACwsgACAAKgIgjDgCICAAIAAqAiSMOAIkIAAgACoCKIw4AigLAkAgBg0AIAAgAyoCGCIROAIsIAAgETgCNCAAIAMqAhwiETgCMCAAIBE4AjggAygCACIBIAVGDQADQCABKgIYIhEgACoCLF1BAXNFBEAgACAROAIsIAEqAhghEQsgESAAKgI0XkEBc0UEQCAAIBE4AjQLIAEqAhwiESAAKgIwXUEBc0UEQCAAIBE4AjAgASoCHCERCyARIAAqAjheQQFzRQRAIAAgETgCOAsgASgCACIBIAVHDQALCwumCAIHfwR9IAEoAgQoAggoAgAhBAJAA0ACQCAEKAIUBEADQCAEIgEoAgQoAggoAgAiBCgCFA0ACwsCQAJAAkACQAJAIAEoAhQEQCABIQIMAQsgASgCBCgCBCgCACICRQ0BIAEhBCACKAIURQ0BCyACQQA2AhQCQCACKAIAIgYoAgQoAhAiASAEKAIAIgUoAgQoAhBGBEAgAiEBDAELAkACQAJAAkAgASoCGCIJIAIoAgQoAggoAgAiCCgCACIDKAIEKAIQIgcqAhgiClsEQCABKgIcIgsgByoCHCIMWw0CIAkgCl0NASALIAxfQQFzRQ0BDAMLIAkgCl1BAXMNAgsgASAHIAYoAhAQDEMAAAAAXQRAIAIhAQwECyACQQE2AhQgAigCBCgCBCgCAEEBNgIUIAAoAgAgBhARIgFFDQggACgCACADKAIEIAEQDQ0CDAgLQYgTQZwPQZIEQacTEAAACyAHIAEgAygCEBAMQwAAAABeBEAgAiEBDAILIAhBATYCFCACQQE2AhQgACgCACADEBEiAUUNBSAAKAIAIAYoAgwgAygCBBANRQ0GIAEoAgQhAQsgASgCFCACKAIMOgAVIAQoAhgEQCAEKAIAIgEoAhwNCCABQQA2AhggACgCQCEDIAQoAgQiASgCBCIHIAEoAgg2AgggASgCCCAHNgIEIAEgAygCECIDKAIANgIAIAMgATYCACAEIAAoAkwiASgCADYCACABIAQ2AgAgACgCACAFEA5FDQYgAigCBCgCCCgCACIEKAIAIQUgAiEBDAELIAIoAhhFBEAgAiEBDAELIAIoAgAiASgCHA0HIAFBADYCGCAAKAJAIQMgAigCBCIBKAIEIgcgASgCCDYCCCABKAIIIAc2AgQgASADKAIQIgMoAgA2AgAgAyABNgIAIAIgACgCTCIBKAIANgIAIAEgAjYCACAAKAIAIAYQDkUNBSAEKAIEKAIEKAIAIgEoAgAhBgsgBigCECAFKAIQRg0CIAYoAgQoAhAiAiAFKAIEKAIQIgNGDQEgASgCGA0BIAQoAhgNASACIAAoAkgiB0dBACADIAdHGw0BIAAgARApRQ0CCw8LIAAgARAeGgsgBigCECAFKAIQRw0CIAYoAgQiAygCECAFKAIEIgIoAhBHDQIgBSAFKAIcIAYoAhxqNgIcIAIgAigCHCADKAIcajYCHCABKAIAIQIgASgCGARAIAIoAhwNBAsgAkEANgIYIAAoAkAhBSABKAIEIgIoAgQiAyACKAIINgIIIAIoAgggAzYCBCACIAUoAhAiBSgCADYCACAFIAI2AgAgASAAKAJMIgIoAgA2AgAgAiABNgIAIAAoAgAgBhAORQ0BIAQoAgQoAgQoAgAhAQwCCwsLIABBkAFqQQEQAwALQfMPQZwPQZIBQYoQEAAAC5IRAgt/Bn0jAEEwayIHJAAgASgCACIJKAIQIQMgASgCBCgCCCgCACILKAIAIggoAhAhBAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgCCgCBCgCECIFKgIYIAkoAgQoAhAiBioCGFsEQCAFKgIcIAYqAhxbDQELIAYgACgCSCADEAxDAAAAAF9FDQEgBSAAKAJIIAQQDEMAAAAAYEUNAiADIAAoAkgiAkYNAyACIARGDQMgASgCGA0EIAsoAhgNBAJAIAMgBEYNACADKgIcIg8gBioCHCIOIA4gD2AbIAQqAhwiDiAFKgIcIg0gDSAOXxteDQACQAJAIAMqAhgiDSAEKgIYIhBdRQRAIA4gD2BBAXMNASANIBBcDQELIAUgAyAEEAxDAAAAAF5FDQEMAgsgBiAEIAMQDEMAAAAAXQ0BCyAGIAMgBSAEIAcQUyAHKgIcIhEgAyoCHCIPIAYqAhwiDiAOIA9gG2BFDQYgESAEKgIcIg8gBSoCHCIOIA4gD18bX0UNByAHKgIYIg4gBSoCGCIPIAYqAhgiDSANIA9gG2BFDQggDiAEKgIYIg0gAyoCGCIQIA0gEGAbX0UNCQJAAkAgDiAAKAJIIgoqAhgiD11BAXNFBEAgCioCHCESDAELIA4gD1wNASARIAoqAhwiEl9BAXMNAQsgByASOAIcIAcgDzgCGCAEKgIYIQ0gAyoCGCEQIBIhESAPIQ4LIAMhAgJAAkACfSAQIg8gDSAPXg0AGiANIBBbBEAgECADKgIcIAQqAhxfDQEaCyAEIQIgDQsiDyAOXUEBc0UEQCACKgIcIQ0MAQsgDiAPXA0BIAIqAhwiDSARX0EBcw0BCyAHIA04AhwgByAPOAIYIAMqAhghECANIREgDyEOCwJAAkAgDiAQWwRAIBEgAyoCHFsNAQsgDiAEKgIYXA0BIBEgBCoCHFwNAQsgACABEB4aDAELAkACQAJAIAoqAhgiDiAGKgIYWwRAIAYqAhwgCioCHFsNAQsgBiAKIAcQDEMAAAAAYA0BIAAoAkgiCioCGCEOCyAOIAUqAhhbBEAgBSoCHCAKKgIcWw0CCyAFIAogBxAMQwAAAABfQQFzDQELIAAoAkgiAiAFRgRAIAAoAgAgCSgCBBARRQ0QIAAoAgAgCCgCBCAJEA1FDRAgASgCACgCECECA0AgASgCBCgCBCgCACIBKAIAIgMoAhAgAkYNAAsgASgCGARAIAAoAgAgASgCBCgCCCgCACgCACgCBCADKAIMEBIiAkUNESABKAIYRQ0OIAAoAgAgASgCABAORQ0RIAEgAjYCACABQQA2AhggAiABNgIYIAEoAgQoAgQoAgAiAUUNEQsgASgCBCgCCCgCACIDKAIAIQIgACADIAsQFxpBASEMIAAgASACKAIEKAIMIAIgAkEBEBQMAgsgAiAGRgRAIAAoAgAgCCgCBBARRQ0QIAAoAgAgCSgCDCAIKAIEKAIMEA1FDRAgASgCACgCBCgCECEDIAEhAgNAIAIoAgQoAgQoAgAiAigCACgCBCgCECADRg0ACyACKAIEKAIIKAIAKAIAKAIEKAIIIQMgASAIKAIEKAIMNgIAQQEhDCAAIAIgACABQQAQFygCCCAJKAIEKAIIIANBARAUDAILAkAgBiACIAcQDEMAAAAAYEUEQCAAKAJIIQIMAQsgAUEBNgIUIAEoAgQoAgQoAgBBATYCFCAAKAIAIAkoAgQQEUUNECAJKAIQIgMgACgCSCICKgIYOAIYIAMgAioCHDgCHAsgBSACIAcQDEMAAAAAX0EBcw0BIAtBATYCFCABQQE2AhQgACgCACAIKAIEEBFFDQ8gCCgCECIBIAAoAkgiACoCGDgCGCABIAAqAhw4AhwMAQsgACgCACAJKAIEEBFFDQ4gACgCACAIKAIEEBFFDQ4gACgCACAIKAIEKAIMIAkQDUUNDiAJKAIQIgIgByoCGDgCGCACIAcqAhw4AhwgAEHoAGoiCiAAKAJEIAIQKyEIIAkoAhAiAiAINgIgIAhB/////wBGDQ0gAkF/NgIoIAJCADcCDCACQQA2AhQgAiADKgIMIAYqAhggAioCGCIPkyIOjCAOIA5DAAAAAF0bIAYqAhwgAioCHCIOkyINjCANIA1DAAAAAF0bkiIQQwAAAD+UIAMqAhggD5MiDYwgDSANQwAAAABdGyADKgIcIA6TIg2MIA0gDUMAAAAAXRuSIhEgEJIiEJUiDZQgBioCDCARQwAAAD+UIBCVIhCUkkMAAAAAkiIROAIMIAIgAyoCECANlCAGKgIQIBCUkkMAAAAAkiISOAIQIAIgDSADKgIUlCAQIAYqAhSUkkMAAAAAkiIQOAIUIAIgESAEKgIMIAUqAhggD5MiDYwgDSANQwAAAABdGyAFKgIcIA6TIg2MIA0gDUMAAAAAXRuSIg1DAAAAP5QgBCoCGCAPkyIPjCAPIA9DAAAAAF0bIAQqAhwgDpMiD4wgDyAPQwAAAABdG5IiDiANkiINlSIPlCAFKgIMIA5DAAAAP5QgDZUiDpSSkjgCDCACIBIgBCoCECAPlCAFKgIQIA6UkpI4AhAgAiAQIA8gBCoCFJQgDiAFKgIUlJKSOAIUIAtBATYCFCABQQE2AhQgASgCBCgCBCgCAEEBNgIUCyAHQTBqJAAgDA8LQZcQQZwPQcEEQbAQEAAAC0HCEEGcD0HCBEGwEBAAAAtB7RBBnA9BwwRBsBAQAAALQZgRQZwPQcQEQbAQEAAAC0HFEUGcD0HFBEGwEBAAAAtB9BFBnA9B2ARBsBAQAAALQZkSQZwPQdkEQbAQEAAAC0G+EkGcD0HaBEGwEBAAAAtB4xJBnA9B2wRBsBAQAAALAAtBvg9BnA9BnwFB0A8QAAALAAsgCiAAKAJEECAgAEEANgJECyAAQZABakEBEAMAC5ABAQN/IAAoAkwQDyIEBEACQCAAKAIAECEiBUUNACAFKAIQIgYgAzgCHCAGIAI4AhggBSgCBCgCECIGIAM4AhwgBiABOAIYIAAgBjYCSCAEQQA2AhggBEIANwIIIAQgBTYCACAEQgE3AhAgBCAAKAJAIgUgBSAEEB0iBDYCBCAERQ0ADwsLIABBkAFqQQEQAwALuAEBA38gASgCFARAIAAgASgCACACEE8PCyABIAEoAgwiBEEBaiIFNgIMAkACfwJAIAUgASgCECIDSA0AQf////8AIAAoAgQiBUUNARogASADQQF0NgIQIAEgACgCDCABKAIEIgAgA0EDdCAFEQIAIgM2AgQgAw0AIAEgADYCBEH/////AA8LIARB/////wBGDQEgASgCBCAEQQJ0aiACNgIAIARBf3MLDwtBoQ5BiA1BwANBtA4QAAALmAcBBX8CQCAAKAIsIgEgAEEsaiIERgRAIAQhAgwBCyAEIQMDQAJAAkACQAJAAkACQCADIAEiAigCBEYEQCACKAIIIgUhAQNAIAEoAgQiAyABRg0CIAMoAgQgAUcNAyABKAIMIgMoAggoAgQgAUcNBCABKAIIKAIEKAIMIAFHDQUgASgCFCACRw0GIAMiASAFRw0ACwwGC0GuCUG/CUGeBkHKCRAAAAtB3AlBvwlBoQZBygkQAAALQegJQb8JQaIGQcoJEAAAC0H5CUG/CUGjBkHKCRAAAAtBkwpBvwlBpAZBygkQAAALQa0KQb8JQaUGQcoJEAAACyACIQMgAigCACIBIARHDQALCwJAAkACQCAAKAIwIAJHDQAgACgCNA0AIAAgACgCACIBRgRAIAAhAgwDCyAAIQMMAQtBuwpBvwlBqQZBygkQAAALA0ACQAJAAkACQAJAAkAgAyABIgIoAgRGBEAgAigCCCIFKAIEIQMgBSEBA0AgASADRg0CIAMoAgQgAUcNAyABKAIMKAIIKAIEIAFHDQQgASgCCCIEKAIEIgMoAgwgAUcNBSABKAIQIAJHDQYgBCIBIAVHDQALDAYLQeEKQb8JQa0GQcoJEAAAC0HcCUG/CUGwBkHKCRAAAAtB6AlBvwlBsQZBygkQAAALQfkJQb8JQbIGQcoJEAAAC0GTCkG/CUGzBkHKCRAAAAtB8gpBvwlBtAZBygkQAAALIAIhAyACKAIAIgEgAEcNAAsLAkACQAJAAkACQAJAAkACQAJAIAAoAgQgAkcNACAAKAIIDQAgAEHEAGoiAyECA0AgAigCACIBIANGDQIgASgCBCIEKAIAIAIoAgRHDQMgASAERg0EIAQoAgQgAUcNBSABKAIQRQ0GIAQoAhBFDQcgASgCDCgCCCgCBCABRw0IIAEiAiABKAIIKAIEKAIMRg0AC0GTCkG/CUHCBkHKCRAAAAtB/gpBvwlBuAZBygkQAAALIAAoAkgiASAAQeQAakcNBiABKAIAIAIoAgRHDQYgASgCBCADRw0GIAAoAlQNBiABKAIQDQYgACgCWA0GIAEoAhQNBg8LQaQLQb8JQbwGQcoJEAAAC0HcCUG/CUG9BkHKCRAAAAtB6AlBvwlBvgZBygkQAAALQb8LQb8JQb8GQcoJEAAAC0HOC0G/CUHABkHKCRAAAAtB+QlBvwlBwQZBygkQAAALQd0LQb8JQcgGQcoJEAAACykAIAEoAoQBEBggASgCiAEQGCABKAKMARAYIAAoAgwgASAAKAIIEQEACzwBAn0gAioCGCAAKgIcIgQgASoCHCIDk5QgACoCGCADIAIqAhwiA5OUIAEqAhggAyAEk5SSkkMAAAAAYAsQACMAIABrQXBxIgAkACAACwYAIAAkAAsEACMACzUCAX8CfUEBIQIgACoCGCIDIAEqAhgiBF0Ef0EBBSADIARcBEBBAA8LIAAqAhwgASoCHF8LC/4DAQJ/IAJBgARPBEAgACABIAIQChoPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIAQcAASQ0AIAIgAEFAaiIESw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBE0NAAsLIAAgAk0NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIABJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsLqwcBCX8gACgCBCIHQQNxIQIgACAHQXhxIgZqIQQCQEHUFigCACIFIABLDQAgAkEBRg0ACwJAIAJFBEBBACECIAFBgAJJDQEgAUEEaiAGTQRAIAAhAiAGIAFrQaQaKAIAQQF0TQ0CC0EADwsCQCABIAZNBEAgBiABayICQRBJDQEgACAHQQFxIAFyQQJyNgIEIAAgAWoiASACQQNyNgIEIAQgBCgCBEEBcjYCBCABIAIQJAwBC0EAIQIgBEHcFigCAEYEQEHQFigCACAGaiIFIAFNDQIgACAHQQFxIAFyQQJyNgIEIAAgAWoiAiAFIAFrIgFBAXI2AgRB0BYgATYCAEHcFiACNgIADAELIARB2BYoAgBGBEBBzBYoAgAgBmoiBSABSQ0CAkAgBSABayICQRBPBEAgACAHQQFxIAFyQQJyNgIEIAAgAWoiASACQQFyNgIEIAAgBWoiBSACNgIAIAUgBSgCBEF+cTYCBAwBCyAAIAdBAXEgBXJBAnI2AgQgACAFaiIBIAEoAgRBAXI2AgRBACECQQAhAQtB2BYgATYCAEHMFiACNgIADAELIAQoAgQiA0ECcQ0BIANBeHEgBmoiCSABSQ0BIAkgAWshCgJAIANB/wFNBEAgBCgCCCIGIANBA3YiBUEDdEHsFmpHGiAGIAQoAgwiCEYEQEHEFkHEFigCAEF+IAV3cTYCAAwCCyAGIAg2AgwgCCAGNgIIDAELIAQoAhghCAJAIAQgBCgCDCIDRwRAIAQoAggiAiAFTwRAIAIoAgwaCyACIAM2AgwgAyACNgIIDAELAkAgBEEUaiICKAIAIgYNACAEQRBqIgIoAgAiBg0AQQAhAwwBCwNAIAIhBSAGIgNBFGoiAigCACIGDQAgA0EQaiECIAMoAhAiBg0ACyAFQQA2AgALIAhFDQACQCAEIAQoAhwiBUECdEH0GGoiAigCAEYEQCACIAM2AgAgAw0BQcgWQcgWKAIAQX4gBXdxNgIADAILIAhBEEEUIAgoAhAgBEYbaiADNgIAIANFDQELIAMgCDYCGCAEKAIQIgIEQCADIAI2AhAgAiADNgIYCyAEKAIUIgJFDQAgAyACNgIUIAIgAzYCGAsgCkEPTQRAIAAgB0EBcSAJckECcjYCBCAAIAlqIgEgASgCBEEBcjYCBAwBCyAAIAdBAXEgAXJBAnI2AgQgACABaiICIApBA3I2AgQgACAJaiIBIAEoAgRBAXI2AgQgAiAKECQLIAAhAgsgAgscAEG4FigCAEUEQEG8FiABNgIAQbgWIAA2AgALCzABAn8gACECA0AgAigCBCICKAIAIgMEQCAAKAIMIAEgAyAAKAIUEQIARQ0BCwsgAgsHACAAKAJgCwcAIAAoAmQLBwAgACgCWAsHACAAKAJUCwcAIAAoAlwLzQ0BCH9BKBAWIghBADYCAEEEIQoCQAJAAkACQCAAKAJUIgYEQCAAKAJ0IQcgACgCcCEJQbgWQQA2AgAgCSAHIAYQBEG4FigCACEGQbgWQQA2AgBBfyEHAkAgBkUNAEG8FigCACIJRQ0AIAYoAgAgCEEEEBAiB0UEQAwECyAJEAELEAIhBiAHQQFGDQEgAEEANgJUCyAAKAJgIgYEQCAAKAJ0IQcgACgCcCEJQbgWQQA2AgAgCSAHIAYQBEG4FigCACEGQbgWQQA2AgBBfyEHAkAgBkUNAEG8FigCACIJRQ0AIAYoAgAgCEEEEBAiB0UEQAwECyAJEAELEAIhBiAHQQFGDQEgAEEANgJgCyAAKAJYIgYEQCAAKAJ0IQcgACgCcCEJQbgWQQA2AgAgCSAHIAYQBEG4FigCACEGQbgWQQA2AgBBfyEHAkAgBkUNAEG8FigCACIJRQ0AIAYoAgAgCEEEEBAiB0UEQAwECyAJEAELEAIhBiAHQQFGBEAMAgsgAEEANgJYC0EAIQYgAEEANgJQIAUEQCAAIAUqAgA4AgggACAFKgIEOAIMIAAgBSoCCDgCEAsgACABNgI8IARBAiAEQQJKGyIBQQMgAUEDSBshDCAAQZABaiINQQEgCEEEECYhCBACIQoLA0ACQAJAAkAgBg0AIAAoAgBFDQBBuBZBADYCACAAECdBuBYoAgAhAUG4FkEANgIAQX8hBSABRQ0CQbwWKAIAIgRFDQIgASgCACAIIAoQECIFDQEMBQsgCBAVQQAPCyAEEAELEAIhBiAFQQFGDQBBuBZBADYCAEEEIAAQCSEHQbgWKAIAIQFBuBZBADYCAEF/IQUCQCABRQ0AQbwWKAIAIgRFDQAgASgCACAIIAoQECIFRQRADAQLIAQQAQsQAiEGIAVBAUYNAAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAHRQRAQbgWQQA2AgBBBSANQQEQBEG4FigCACEBQbgWQQA2AgAgAUUNAkG8FigCACIERQ0CIAEoAgAgCCAKEBANAQwPCyAAKAIAIQQgAkECRw0CIAQoAkQiBiAEQcQAaiIJRg0JA0AgBigCACEBAkAgBigCFC0AFSIFIAYoAgQoAhQtABVHBEAgBkEBQX8gBRs2AhwMAQtBuBZBADYCAEEGIAQgBhAGIQtBuBYoAgAhBUG4FkEANgIAQX8hBwJAIAVFDQBBvBYoAgAiBkUNACAFKAIAIAggChAQIgdFBEAgBSAGEAMACyAGEAELEAIhBiAHQQFGDQ4gC0UNBgsgASIGIAlHDQALDAMLIAQQAQsQAiEGDAoLIAQoAiwiBiAEQSxqIglGDQQDQCAGKAIAIQEgBi0AFQRAQbgWQQA2AgBBByAEIAYQBiELQbgWKAIAIQVBuBZBADYCAEF/IQcCQCAFRQ0AQbwWKAIAIgZFDQAgBSgCACAIIAoQECIHRQRAIAUgBhADAAsgBhABCxACIQYgB0EBRg0LIAtFDQMLIAEiBiAJRw0ACwtBuBZBADYCAEEIIAQQBUG4FigCACEBQbgWQQA2AgBBfyEFIAFFDQJBvBYoAgAiBkUNAiABKAIAIAggChAQIgUNAQwLC0G4FkEANgIAQQUgDUEBEARBuBYoAgAhAUG4FkEANgIAAkAgAUUNAEG8FigCACIERQ0AIAEoAgAgCCAKEBBFBEAMCwsgBBABCxACIQYMBwsgBhABCxACIQYgBUEBRg0FIAJBAkcNAQwDC0G4FkEANgIAQQggBBAFQbgWKAIAIQFBuBZBADYCAEF/IQUCQCABRQ0AQbwWKAIAIgZFDQAgASgCACAIIAoQECIFRQRADAkLIAYQAQsQAiEGIAVBAUYNBAtBuBZBADYCAEEJIAAgBCACIAMgDBAIDAILQbgWQQA2AgBBCCAEEAVBuBYoAgAhAUG4FkEANgIAQX8hBQJAIAFFDQBBvBYoAgAiBkUNACABKAIAIAggChAQIgVFBEAMBwsgBhABCxACIQYgBUEBRg0CC0G4FkEANgIAQQogACAEIAwQBwtBuBYoAgAhAUG4FkEANgIAQX8hBQJAIAFFDQBBvBYoAgAiBkUNACABKAIAIAggChAQIgVFBEAMBQsgBhABCxACIQYgBUEBRg0AQbgWQQA2AgBBCyAAQegAaiAEEARBuBYoAgAhAUG4FkEANgIAQX8hBQJAIAFFDQBBvBYoAgAiBEUNACABKAIAIAggChAQIgVFBEAMBAsgBBABCxACIQYgBUEBRg0ACyAAQQA2AgAgACgCBCEAIAgQFSAARQ8LIAYgCRADAAsgASAEEAMACyABIAYQAwALlgMCA38BfQJAAkAgACgCAA0AIAAgAEHoAGoQUSIGNgIAIAYNAAwBCwJAAkACQCAEQQFIDQBBACEGIAFBA04EQEEAIQEDQCAAKAIAIQUCQCABBEAgBSABEBFFDQcgASgCDCEBDAELIAUQISIBRQ0FIAAoAgAgASABKAIEEA1FDQYLIAEoAhAiBSACKgIAOAIMIAUgAioCBDgCECAFIAIqAgg4AhQgACAAKAJQIgdBAWo2AlAgBSAHNgIoIAFBATYCHCABKAIEQX82AhwgAiADaiECIAZBAWoiBiAERw0ACwwBC0EAIQEDQCAAKAIAIQUCQCABRQRAIAUQISIBRQ0FIAAoAgAgASABKAIEEA0NAQwGCyAFIAEQEUUNBSABKAIMIQELIAEoAhAiBSACKgIAOAIMIAIqAgQhCCAFQQA2AhQgBSAIOAIQIAAgACgCUCIHQQFqNgJQIAUgBzYCKCABQQE2AhwgASgCBEF/NgIcIAIgA2ohAiAGQQFqIgYgBEcNAAsLDwsACyAAQQE2AgQPCyAAQQE2AgQLqAQBB38gAEEANgJkIABBADYCXCABKAIsIgUgAUEsaiIIRwRAQQAhAQNAIAUtABUEQCAFKAIIIgQhBgNAIAFBAWohASAGKAIMIgYgBEcNAAsgACABNgJcIAAgA0EBaiIDNgJkCyAFKAIAIgUgCEcNAAsLIAAgACgCdCADQQN0IAAoAmgRAAAiATYCYAJAIAFFBEAMAQsgACAAKAJ0IAIgACgCXGxBAnQgACgCaBEAACIBNgJUIAFFBEAMAQsgACAAKAJ0IAAoAlxBAnQgACgCaBEAACIGNgJYIAZFBEAMAQsCQCAIKAIAIgMgCEYNACAAKAJgIQQgACgCVCEBIAJBA04EQANAIAMtABUEQEEAIQAgAygCCCIJIQUDQCABIAUoAhAiAioCDDgCACABIAIqAhA4AgQgASACKgIUOAIIIAYgAigCKDYCACAAQQFqIQAgBkEEaiEGIAFBDGohASAFKAIMIgUgCUcNAAsgBCAANgIEIAQgBzYCACAAIAdqIQcgBEEIaiEECyADKAIAIgMgCEcNAAwCCwALA0AgAy0AFQRAQQAhACADKAIIIgkhAgNAIAEgAigCECIFKgIMOAIAIAEgBSoCEDgCBCAGIAUoAig2AgAgAEEBaiEAIAZBBGohBiABQQhqIQEgAigCDCICIAlHDQALIAQgADYCBCAEIAc2AgAgACAHaiEHIARBCGohBAsgAygCACIDIAhHDQALCw8LIABBATYCBAufBwEIfwJAAkAgA0EESA0AIAEgAxBQDQAMAQsgASABKAIAIgVHBEADQCAFQX82AiQgBSgCACIFIAFHDQALCwJAAkAgASgCLCIKIAFBLGoiC0YEQAwBCwNAIApBfzYCECAKLQAVBEBBACEGIAooAggiDCEFA0AgBiEIIAUoAhAiBigCJEF/RgRAIAYgBzYCJCAHQQFqIQcLIAhBAWohBiAFKAIMIgUgDEcNAAsgAyAITA0DIAogCTYCECAJQQFqIQkLIAooAgAiCiALRw0ACwsgACAJNgJkIAAgACgCdCADIAkgAkEBRnRsQQJ0IAAoAmgRAAAiBjYCYCAGRQRADAILIAAgBzYCXCAAIAAoAnQgBCAHbEECdCAAKAJoEQAAIgY2AlQgBkUEQAwCCyAAIAAoAnQgACgCXEECdCAAKAJoEQAAIgc2AlgCQAJAIAcEQCABKAIAIgUgAUYNAiAEQQNIDQEDQCAFKAIkIghBf0cEQCAAKAJUIAQgCGxBAnRqIgYgBSoCDDgCACAGIAUqAhA4AgQgBiAFKgIUOAIIIAcgCEECdGogBSgCKDYCAAsgBSgCACIFIAFHDQALDAILDAMLA0AgBSgCJCIIQX9HBEAgACgCVCAEIAhsQQJ0aiIGIAUqAgw4AgAgBiAFKgIQOAIEIAcgCEECdGogBSgCKDYCAAsgBSgCACIFIAFHDQALCwJAIAsoAgAiASALRg0AIAAoAmAhBSACQQFGBEADQAJAIAEtABVFDQBBACEHIAEoAggiAiEGA0AgBSAGKAIQKAIkNgIAIAciAEEBaiEHIAVBBGohBSAGKAIMIgYgAkcNAAsgAyAHSgRAIAUgAyAHa0ECdBAcIANBAnRqIABBf3NBAnRqIQULIAIhBgNAQX8hBAJAIAYoAgQoAhQiCEUNACAILQAVRQ0AIAgoAhAhBAsgBSAENgIAIAVBBGohBSAGKAIMIgYgAkcNAAsgAyAHTA0AIAUgAyAHa0ECdBAcIANBAnRqIABBf3NBAnRqIQULIAEoAgAiASALRw0ADAILAAsDQAJAIAEtABVFDQBBACEEIAEoAggiAiEGA0AgBSAGKAIQKAIkNgIAIAQiAEEBaiEEIAVBBGohBSAGKAIMIgYgAkcNAAsgAyAETA0AIAUgAyAEa0ECdBAcIANBAnRqIABBf3NBAnRqIQULIAEoAgAiASALRw0ACwsPC0HhFUGhFUHyBEH3FRAAAAsgAEEBNgIEC9gBAQJ/IwBBMGsiASQAIAEgACkCiAE3AyggASAAKQKAATcDICABIAApAng3AxggASAAKQJwNwMQIAEgACkCaDcDCCAAKAJMEBggACgCACICBEAgAUEIaiACEC0gAEEANgIACyAAKAJUIgIEQCABKAIUIAIgASgCEBEBACAAQQA2AlQLIAAoAlgiAgRAIAEoAhQgAiABKAIQEQEAIABBADYCWAsgACgCYCICBEAgASgCFCACIAEoAhARAQAgAEEANgJgCyABKAIUIAAgASgCEBEBACABQTBqJAAL/wICA38BfiAAQYgWIAAbIgIoAgAiAEUEQCACQYgWKAIAIgA2AgALIAIoAgRFBEAgAkGMFigCADYCBAsgAigCCEUEQCACQZAWKAIANgIICyACKAIMQawCIAARAAAiAUUEQEEADwsgASACKQIANwJoIAEgAikCIDcCiAEgASACKQIYNwKAASABIAIpAhAiBDcCeCABIAIpAgg3AnAgBKdFBEAgAUGABDYCeAsgASgCfEUEQCABQYAENgJ8CyABKAKAAUUEQCABQYACNgKAAQsgASgChAFFBEAgAUGABDYChAELIAEoAogBIgBFBEAgAUGAAjYCiAFBgAIhAAsgAUHoAGohAyABQgA3AiwgAUEANgIQIAFCADcCCCABQgA3AjQgAUEANgI8QRAhAgJAIABBEE4EQEGAICECIABBgSBIDQELIAEgAjYCiAEgAiEACyADQdkVQRwgABAZIQAgAUIANwJQIAFCADcCACABIAA2AkwgAUIANwJYIAFCADcCYCABCwYAIAEQFQsIACABIAIQJQsGACABEBYLvAUCBX8CfQJAAkAgASgCCCIBKAIMIgIgAUYNACACKAIMIAFGDQADQAJAIAEoAgQoAhAiAyoCGCIHIAEoAhAiAioCGCIIXUUEQCAHIAhcDQEgAyoCHCACKgIcX0UNAQsgASgCCCgCBCEBDAELCwNAAkAgByAIXkUEQCAHIAhcDQEgAioCHCADKgIcX0EBcw0BCyABKAIMIgEoAhAiAioCGCEIIAEoAgQoAhAiAyoCGCEHDAELCwJAIAEoAggoAgQiAiABKAIMRg0AA0ACQAJAIAcgAigCECIEKgIYIghdRQRAIAcgCFwNASADKgIcIAQqAhxfQQFzDQELAkAgAigCDCIDIAFGDQAgAkEMaiEEA0ACQCADKAIEKAIQIgUqAhgiByADKAIQIgYqAhgiCF0NACAHIAhbBEAgBSoCHCAGKgIcXw0BCyACKAIQIAIoAgQoAhAgBRAMQwAAAABfQQFzDQIgBCgCACEDCyAAIAMgAhASIgJFBEBBAA8LIAIoAgQiAkEMaiEEIAIoAgwiAyABRw0ACwsgAigCCCgCBCECDAELAkAgAigCDCABRg0AA0ACQCABKAIIKAIEIgMoAhAiBCoCGCIHIAMoAgQoAhAiBSoCGCIIXQ0AIAcgCFsEQCAEKgIcIAUqAhxfDQELIAEoAgQoAhAgASgCECAEEAxDAAAAAGBBAXMNAiABKAIIKAIEIQMLIAAgASADEBIiAUUEQEEADwsgASgCBCIBIAIoAgxHDQALCyABKAIMIQELIAEoAgwgAkYNASABKAIEKAIQIgMqAhghBwwACwALIAIoAgwiAyABRg0BIAEgAygCDEcEQANAIAAgAyACEBIiAkUEQEEADwsgAigCBCICKAIMIgMoAgwgAUcNAAsLQQEPC0H3FEGhFUHAAkGsFRAAAAtByRVBoRVB5AJBrBUQAAALfQECfyAAKAIMQRggACgCABEAACICRQRAQQAPCyACQQI2AhQgAiABNgIMIAJBADYCACACIAI2AgggAiACNgIEQRAhAwJAIAAoAhwiAUEQTgRAQYAgIQMgAUGBIEgNAQsgACADNgIcIAMhAQsgAiAAQYAIQQwgARAZNgIQIAILwwECA38BfQJAAkAgAioCGCIGIAEoAgAiAygCECIEKgIYWwRAIAQqAhwgAioCHFsNAQsCQCAGIAMoAgQiBCgCECIFKgIYWwRAIAUqAhwgAioCHFsNAQsgACgCACAEEBFFDQIgASgCGARAIAAoAgAgAygCCBAORQ0DIAFBADYCGAsgACgCACACKAIIIAMQDUUNAiAAIAIQGg8LQYoPQZwPQZ8HQagPEAAAC0GKD0GcD0GKB0GoDxAAAAsgAEGQAWpBARADAAvWAQICfwJ9IAIoAgAiAigCBCgCECEDIAEoAgAiASgCBCgCECIEIAAoAkgiAEYEQCAAIANGBEACQCABKAIQIgEqAhgiBSACKAIQIgIqAhgiBl1FBEAgBSAGXA0BIAEqAhwgAioCHF9BAXMNAQsgACABIAIQDEMAAAAAXw8LIAAgAiABEAxDAAAAAGAPCyADIAAgAigCEBAMQwAAAABfDwsgASgCECEBIAAgA0YEQCAEIAAgARAMQwAAAABgDwsgBCAAIAEQIyACKAIEKAIQIAAgAigCEBAjYAvcCAIGfwR9AkAgACgCACIDKAJEIgIgA0HEAGoiBUcEQANAIAIoAgwhASACKAIAIQMCQAJAIAIoAhAiBCoCGCACKAIEKAIQIgYqAhhcDQAgBCoCHCAGKgIcXA0AIAEoAgwgAkYNAAJAIAAoAgAgASACEA0EQCAAKAIAIAIQDkUNASABKAIMIQQMAwsMBQsMBAsgASEEIAIhAQsCQCABIAQoAgxHBEAgAyECDAELIAEgBEcEQAJAIAMgBEcEQCAEIAMoAgRHDQELIAMoAgAhAwsgACgCACAEEA5FDQQLAn8CQCABIANGDQAgASADKAIERg0AIAMMAQsgAygCAAshAiAAKAIAIAEQDkUNAwsgAiAFRw0ACyAAKAIAIQMLQQAhAiADIAMoAgAiAUcEQANAIAJBAWohAiABKAIAIgEgA0cNAAsLIAAgAEHoAGoiBSAAKAKMASIBQQggAUEIShsgAmoQTSIBNgJEAkACQAJAAkACQCABBH8CQAJAIAAoAgAiBCgCACICIARHBEADQCACIAUgASACECsiAzYCICADQf////8ARg0CIAIoAgAiAiAERw0ACwsgBSABEEwNAQsgBSAAKAJEECAgAEEANgJEQQAPCyAAIAUgABBGIgE2AkAgAUUNBiAAIAAqAiwiByAAKgI0IgggB5MiB5MiCSAIIAeSIgcgACoCMCIIIAAqAjgiCiAIkyIIkxAqIAAgCSAHIAogCJIQKiAAKAJEEB8iAgRAA0ACQCAAKAJEEEsiAUUNACABKgIYIAIqAhhcDQAgASoCHCACKgIcXA0AIAAoAkQQHyEBIAAoAgAgAigCCCABKAIIEA0NAQwJCyAAIAIQGiAAKAJEEB8iAg0ACwsgACAAKAJAIgMoAgQoAgAiAigCACgCEDYCSEEAIQEDQAJAIAIoAhAEQCABIQQMAQsgAigCGEUNA0EBIQQgAQ0ECyACKAIIDQQgAigCACEBIAIoAhgEQCABKAIcDQYLIAFBADYCGCACKAIEIgEoAgQiBiABKAIINgIIIAEoAgggBjYCBCABIAMoAhAiAygCADYCACADIAE2AgAgAiAAKAJMIgEoAgA2AgAgASACNgIAIAQhASAAKAJAIgMoAgQoAgAiAg0ACyADKAIQEBggBSgCDCADIAUoAggRAQAgBSAAKAJEECAgACgCACIEKAIsIgEgBEEsaiIDRwR/A0AgASgCCCIEKAIMIgIgBEYNByABKAIAIQECQCACKAIMIARHDQAgBCgCCCICIAIoAhwgBCgCHGo2AhwgAigCBCICIAIoAhwgBCgCBCgCHGo2AhwgACgCACAEEA4NAEEADwsgASADRw0ACyAAKAIABSAECxAsQQEFQQALDwtBvg9BnA9B+QhBnBQQAAALQakUQZwPQfoIQZwUEAAAC0G7FEGcD0H8CEGcFBAAAAtB8w9BnA9BkgFBihAQAAALQdMUQZwPQecJQeEUEAAACyAAQZABakEBEAMAC5YBAQN/IAFBAE4EQCAAKAIAIAEQTg8LAkAgAUF/cyIBIAAoAhBODQAgACgCBCABQQJ0aiIBKAIARQ0AIAFBADYCAAJAIAAoAgwiAUEBSA0AIAAoAgghAwNAIAMgAUEBayICQQJ0aigCACgCAA0BIAAgAjYCDCABQQFKIQQgAiEBIAQNAAsLDwtBvQ5BiA1B/ANB5g4QAAALkwECAX8CfSAAKAIMIgFFBEAgACgCACIAKAIEIAAoAgAoAgRBA3RqKAIADwsgACgCCCABQQJ0akEEaygCACgCACEBAkACQCAAKAIAIgAoAghFDQAgACgCBCAAKAIAKAIEQQN0aigCACIAKgIYIgIgASoCGCIDXQ0BIAIgA1wNACAAKgIcIAEqAhxfDQELIAEhAAsgAAvYBwIOfwJ9IwBBkANrIgskACABIAAoAgwgASgCDEECdEEEaiAAKAIAEQAAIgM2AggCQAJAIANFBEAMAQsgAyADIAEoAgwiD0ECdGpBBGsiBk0EQCABKAIEIQAgAyECA0AgAiAANgIAIABBBGohACACQQRqIgIgBk0NAAsLIAsgBjYCBCALIAM2AgBBw+HDwQchDEEBIQQDQCALIARBA3RqQQRrKAIAIgkgCyAIQQN0aigCACIFQShqSwRAA0AgBSAMQY2+ht4FbEEBaiIMIAkgBWtBAnVBAWpwQQJ0aiIAKAIAIQ0gACAFKAIANgIAIAUgDTYCACAJQQRqIQIgBUEEayEAA0AgAiEDIABBBGohAgJ/An8gACAAKAIEIgooAgAiByoCGCIQIA0oAgAiDioCGCIRXQ0AGgNAIAIhBAJAIBAgEVwNACAHKgIcIA4qAhxfRQ0AIAAhBiAEDAMLIARBBGohAiAEIgAoAgQiCigCACIHKgIYIhAgEV1BAXMNAAsgAAshBiACCyEAAkAgESADQQRrIgIoAgAiBCgCACIHKgIYIhBdDQADQAJAIBAgEVwNACAOKgIcIAcqAhxfRQ0ADAILIBEgAiIDQQRrIgIoAgAiBCgCACIHKgIYIhBdQQFzDQALCyAAIAQ2AgAgAiAKNgIAIAAgAkkNAAsgACgCACEEIAAgCjYCACACIAQ2AgACQCAAIAVrIAkgAmtIBEAgAyEAIAkhAiAGIQkMAQsgBSEAIAYhAiADIQULIAsgCEEDdGoiAyACNgIEIAMgADYCACAIQQFqIQggCSAFQShqSw0ACwsgCCEEIAkgBUEEaiIKTwRAA0AgCigCACEDAkAgCiICIgAgBU0NAANAIAMoAgAiBioCGCIQIAJBBGsiACgCACIHKAIAIggqAhgiEV0EQCACIQAMAgsCQCAQIBFcDQAgBioCHCAIKgIcX0UNACACIQAMAgsgAiAHNgIAIAUgACICSQ0ACwsgACADNgIAIApBBGoiCiAJTQ0ACwsgBEEBayEIIARBAU4NAAtBASECIAFBATYCFCABIA82AhAgASgCACIDKAIIIgBBAU4EQANAIAMgABAbIABBAUohBiAAQQFrIQAgBg0ACwsgA0EBNgIUIAEoAggiACAAIAEoAgxBAnRqQQRrIgNPDQAgACgCACgCACIHKgIYIRADQCAAKAIEKAIAIgEqAhgiESAQXUUEQCAQIBFcDQMgASoCHCAHKgIcX0UNAwsgESEQIAEhByAAQQRqIgAgA0kNAAsLIAtBkANqJAAgAg8LQYYOQYgNQZ0DQZoOEAAAC/ICAQR/IAAoAgxBHCAAKAIAEQAAIgNFBEBBAA8LAkACQAJAIAAoAgxBHCAAKAIAEQAAIgJFDQAgAiABNgIMIAJBADYCCCACIAAoAgwgAUEBaiIEQQJ0IAAoAgARAAAiBTYCACAFRQRAIAAoAgwgAiAAKAIIEQEADAELIAIgACgCDCAEQQN0IAAoAgARAAAiBDYCBCAEDQEgACgCDCACKAIAIAAoAggRAQAgACgCDCACIAAoAggRAQALIANBADYCAAwBCyACQQE2AhggAkIANwIQIAIoAgBBATYCBCAEQQA2AgggAyACNgIAIAMgACgCDCABQQJ0IAAoAgARAAAiAjYCBCACRQRAIAAoAgwgAygCACIBKAIEIAAoAggRAQAgACgCDCABKAIAIAAoAggRAQAgACgCDCABIAAoAggRAQAMAQsgA0EBNgIYIANBADYCFCADIAE2AhAgA0EANgIMIAMPCyAAKAIMIAMgACgCCBEBAEEAC6sDAgt/An0CQCABQQFIDQAgACgCDCABSA0AIAAoAgQiBCABQQN0aiIHKAIARQ0AIAAoAgAiBSAHKAIEIgNBAnRqIAUgACgCCCICQQJ0aigCACIINgIAIAQgCEEDdGoiDCADNgIEIAAgAkEBazYCCAJAIAIgA0wNAAJAAkAgA0ECSA0AIAQgBSADQQF2IglBAnRqKAIAIgZBA3RqKAIAIgIqAhgiDSAEIAhBA3RqKAIAIgoqAhgiDl0NACANIA5cDQEgAioCHCAKKgIcX0EBcw0BCyAAIAMQGwwBCwJAIA4gBCAGQQN0aigCACILKgIYIg1eBEAgAyECDAELA0AgCSECAkAgDSAOXA0AIAsqAhwgCioCHF9FDQAgAyECDAILIAUgA0ECdGogBjYCACAEIAZBA3RqIAM2AgQgAkEBdSIJRQ0BIAIhAyAEIAUgCUECdGooAgAiBkEDdGooAgAiCyoCGCINIA5dQQFzDQALCyAFIAJBAnRqIAg2AgAgDCACNgIECyAHQQA2AgAgByAAKAIQNgIEIAAgATYCEA8LQaUNQYgNQZICQdwNEAAAC8UDAgd/An0gASABKAIIQQFqIgM2AggCQAJAIAEoAgwiBCADQQF0Tg0AQf////8AIQUgACgCBCIGRQ0BIAEgBEEBdDYCDCABKAIEIQcgASAAKAIMIAEoAgAiCCAEQQN0QQRyIAYRAgAiBDYCACAERQRAIAEgCDYCAEH/////AA8LIAEgACgCDCABKAIEIAEoAgxBA3RBCGogACgCBBECACIANgIEIAANACABIAc2AgQMAQsgASgCBCEEIAMhBSABKAIQIgAEQCABIAQgAEEDdGooAgQ2AhAgACEFCyABKAIAIgYgA0ECdGogBTYCACAEIAVBA3RqIgcgAjYCACAHIAM2AgQgASgCFARAAkAgA0EBdSIARQRAIAMhAQwBCyACKgIYIQoDQCAKIAQgBiAAIgFBAnRqKAIAIgBBA3RqIggoAgAiCSoCGCILXgRAIAMhAQwCCwJAIAogC1wNACAJKgIcIAIqAhxfRQ0AIAMhAQwCCyAGIANBAnRqIAA2AgAgCCADNgIEIAEhAyABQQF1IgANAAsLIAYgAUECdGogBTYCACAHIAE2AgQLIAVB/////wBHDQBB9QxBiA1B8AFBmA0QAAALIAULogIBC38gACgCLCIEIABBLGoiCkcEQANAIAQtABUEQCAEQQhqKAIAIggoAhAhCwNAIAgiAigCDCEIAkAgAigCBCIDRQ0AIAMoAhQiB0UNACAHLQAVRQ0AQQAhBSAEKAIIIgkhBgNAIAUiDEEBaiEFIAYoAgwiBiAJRw0AC0EAIQUgBygCCCIHIQYDQCAFIglBAWohBSAGKAIMIgYgB0cNAAsgASAJIAxqTgRAIAIoAggoAgQoAhAgAigCECADKAIMKAIMKAIQEC5FDQEgAygCCCgCBCgCECADKAIQIAIoAgwoAgwoAhAQLkUNASADKAIMIQggACADEA4NAkEADwsgAkUNAQsgAigCDCgCECALRw0ACwsgBCgCACIEIApHDQALC0EBC90CAQR/IAAoAgxBkAEgACgCABEAACIBRQRAQQAPC0EQIQICQCAAKAIQIgNBEE4EQEGAICECIANBgSBIDQELIAAgAjYCECACIQMLQRAhAgJAIAAoAhQiBEEQTgRAQYAgIQIgBEGBIEgNAQsgACACNgIUC0EQIQICQCAAKAIYIgRBEE4EQEGAICECIARBgSBIDQELIAAgAjYCGAsgASAAQYoJQcAAIAMQGTYChAEgASAAQZUJQSwgACgCFBAZNgKIASABIABBowlBGCAAKAIYEBk2AowBIAEgAUEsaiIANgIwIAFBADYCCCABQgA3AkwgASABQeQAaiICNgJIIAEgAUHEAGoiAzYCRCABQQA7AUAgAUIANwI0IAEgADYCLCABQgA3AlQgAUIANwJcIAFCADcCbCABIAM2AmggASACNgJkIAFCADcCdCABQgA3AnwgASABNgIEIAEgATYCACABC7wCAQV/AkAgACgChAEQDyICRQ0AIAIgASgCBCIEIAEgASAESxsiBigCBCIDKAIAIgQ2AiAgBCgCBCACNgIAIAIgBjYCACADIAJBIGoiBDYCACACQgA3AhAgAiAENgIMIAIgBDYCBCACQgA3AhggAkIANwIwIAIgBDYCKCACQgA3AjggAiACNgIIIAIgAjYCLCACIAI2AiQgASgCDCIGKAIIIQMgAiAGNgIsIAMoAgQgAjYCDCACIAM2AgggBiACNgIIIAIgASgCBCgCEDYCECAAKAKIARAPIgNFDQAgAyACKAIQIgUoAgQiADYCBCAAIAM2AgAgAyAFNgIAIAUgAzYCBCADIAQ2AgggBCEAA0AgACADNgIQIAAoAggiACAERw0ACyACIAEoAhQiADYCFCACIAA2AjQgAiEFCyAFC6YRAgN/B30CQAJAIAAqAhgiCSABKgIYIghdDQAgCCAJWwRAIAAqAhwgASoCHF8NAQsgACEGDAELIAEhBiAAIQELAkACQCACKgIYIgkgAyoCGCIIXQ0AIAggCVsEQCACKgIcIAMqAhxfDQELIAIhAAwBCyAJIQggAyEAIAIhAwsCQAJAIAEqAhgiCSAIXQ0AIAggCVsEQCABKgIcIAMqAhxfDQELIAYhAiABIQUMAQsgCCEJIAAhAiADIQUgBiEAIAEhAwsCQAJAAkACQAJAAkACQAJAIAQCfQJAIAkgACoCGCIKXSIBDQAgCSAKWwRAIAUqAhwgACoCHF8NAQsgCSAKkkMAAAA/lAwBCwJAIAogAioCGCILXSIHRQRAIAogC1wiBg0BIAAqAhwgAioCHF9BAXMNAQsgAyoCGCIIIAldRQRAIAggCVwNBiADKgIcIAUqAhxfQQFzDQYLIAFFBEAgCSAKXA0GIAUqAhwgACoCHF9FDQYLIAogCZMiDSAJIAiTIgiSIg5DAAAAAF5BAXNFBEAgBSoCHCADIAAgCCANXSIGGyoCHCIMkyAIIA0gBhsgDpUgDCAAIAMgBhsqAhyTlJIhDAsgAUUEQCAJIApcDQYgBSoCHCAAKgIcX0EBcw0GCyAHRQRAIAogC1wNBiAAKgIcIAIqAhxfRQ0GC0MAAAAAIQggDIwgDAJ/IA0gCyAKkyILkiIOQwAAAABeQQFzRQRAIAAqAhwgBSACIAsgDV4iARsqAhwiCJMgDSALIAEbIA6VIAggAiAFIAEbKgIck5SSIQgLIAwgCJJDAAAAAF0iAQsbQwAAAACXIgsgCIwgCCABG0MAAAAAlyIIX0EBc0UEQCAJIAqSQwAAAD+UIAhDAAAAAFsNAhogCSANIAsgCyAIkpWUkgwCCyAKIAkgCpMgCCALIAiSlZSSDAELIAMqAhgiDSAJXUUEQCAJIA1cDQcgAyoCHCAFKgIcX0EBcw0HCyABRQRAIAkgClwNByAFKgIcIAAqAhxfRQ0HC0MAAAAAIQggCiAJkyIMIAkgDZMiDpJDAAAAAF5BAXNFBEAgDiAFKgIcIgggACoCHJOUIAwgCCADKgIck5SSIQgLIAsgDV5FBEAgCyANXA0HIAMqAhwgAioCHF9BAXMNBwsgCiALXkUEQCAGDQcgAioCHCAAKgIcX0UNBwtDAAAAACEMIAiMIAgCfyAKIAuTIgogCyANkyINkkMAAAAAXkEBc0UEQCANIAIqAhwiDCAAKgIck5QgCiAMIAMqAhyTlJIhDAsgCCAMk0MAAAAAXSIBCxtDAAAAAJciCiAMIAyMIAEbQwAAAACXIghfQQFzRQRAIAkgC5JDAAAAP5QgCEMAAAAAWw0BGiAJIAsgCZMgCiAKIAiSlZSSDAELIAsgCSALkyAIIAogCJKVlJILOAIYIAMqAhwiCSAAKgIcIghdDQEgCCAJWwRAIAMqAhggACoCGF8NAgsgAyEGDAILAAsgACEGIAMhAAsCQAJAIAUqAhwiCCACKgIcIgldDQAgCCAJWwRAIAUqAhggAioCGF8NAQsgBSEDDAELIAghCSACIQMgBSECCwJAAkAgACoCHCIIIAldDQAgCCAJWwRAIAAqAhggAioCGF8NAQsgBiEFIAAhAQwBCyADIQUgAiEBIAYhAyAAIQILAkAgASoCHCIJIAMqAhwiCl0iAA0AIAkgClsEQCABKgIYIAMqAhhfDQELDAILAkACQAJAIAogBSoCHCILXSIHRQRAIAogC1wiBg0BIAMqAhggBSoCGF9BAXMNAQsgAioCHCIIIAldRQRAIAggCVwNByACKgIYIAEqAhhfQQFzDQcLIABFBEAgCSAKXA0HIAEqAhggAyoCGF9FDQcLQwAAAAAhDCAKIAmTIg0gCSAIkyIIkiIOQwAAAABeQQFzRQRAIAEqAhggAiADIAggDV0iBhsqAhgiDJMgCCANIAYbIA6VIAwgAyACIAYbKgIYk5SSIQwLIABFBEAgCSAKXA0HIAEqAhggAyoCGF9BAXMNBwsgB0UEQCAKIAtcDQcgAyoCGCAFKgIYX0UNBwtDAAAAACEIIAyMIAwCfyANIAsgCpMiC5IiDkMAAAAAXkEBc0UEQCADKgIYIAEgBSALIA1eIgAbKgIYIgiTIA0gCyAAGyAOlSAIIAUgASAAGyoCGJOUkiEICyAMIAiSQwAAAABdIgALG0MAAAAAlyILIAiMIAggABtDAAAAAJciCF9BAXNFBEAgCEMAAAAAWwRADAYLIAQgCSANIAsgCyAIkpWUkjgCHA8LIAQgCiAJIAqTIAggCyAIkpWUkjgCHA8LIAIqAhwiDSAJXUUEQCAJIA1cDQcgAioCGCABKgIYX0EBcw0HCyAARQRAIAkgClwNByABKgIYIAMqAhhfRQ0HC0MAAAAAIQggCiAJkyIMIAkgDZMiDpJDAAAAAF5BAXNFBEAgDiABKgIYIgggAyoCGJOUIAwgCCACKgIYk5SSIQgLIAsgDV5FBEAgCyANXA0CIAIqAhggBSoCGF9BAXMNAgsgCiALXkUEQCAGDQIgBSoCGCADKgIYX0UNAgtDAAAAACEMIAiMIAgCfyAKIAuTIgogCyANkyINkkMAAAAAXkEBc0UEQCANIAUqAhgiDCADKgIYk5QgCiAMIAIqAhiTlJIhDAsgCCAMk0MAAAAAXSIACxtDAAAAAJciCiAMIAyMIAAbQwAAAACXIghfQQFzRQRAIAhDAAAAAFsEQCAEIAkgC5JDAAAAP5Q4AhwPCyAEIAkgCyAJkyAKIAogCJKVlJI4AhwPCyAEIAsgCSALkyAIIAogCJKVlJI4AhwPCwALDAQLQYUIQagIQTpBswgQAAALIAQgCSAKkkMAAAA/lDgCHA8LQYUIQagIQdIAQb8IEAAAC0HLCEGoCEHxAEHwCBAAAAtBywhBqAhBiQFB/QgQAAALC6UOAwBBgAgLhQ5EaWN0AFZlcnRMZXEoIHUsIHYgKSAmJiBWZXJ0TGVxKCB2LCB3ICkAc3JjL2dlb20uYwB0ZXNlZGdlRXZhbAB0ZXNlZGdlU2lnbgBUcmFuc0xlcSggdSwgdiApICYmIFRyYW5zTGVxKCB2LCB3ICkAdGVzdHJhbnNFdmFsAHRlc3RyYW5zU2lnbgBNZXNoIEVkZ2VzAE1lc2ggVmVydGljZXMATWVzaCBGYWNlcwBmLT5wcmV2ID09IGZQcmV2AHNyYy9tZXNoLmMAdGVzc01lc2hDaGVja01lc2gAZS0+U3ltICE9IGUAZS0+U3ltLT5TeW0gPT0gZQBlLT5MbmV4dC0+T25leHQtPlN5bSA9PSBlAGUtPk9uZXh0LT5TeW0tPkxuZXh0ID09IGUAZS0+TGZhY2UgPT0gZgBmLT5wcmV2ID09IGZQcmV2ICYmIGYtPmFuRWRnZSA9PSBOVUxMAHYtPnByZXYgPT0gdlByZXYAZS0+T3JnID09IHYAdi0+cHJldiA9PSB2UHJldiAmJiB2LT5hbkVkZ2UgPT0gTlVMTABlLT5TeW0tPm5leHQgPT0gZVByZXYtPlN5bQBlLT5PcmcgIT0gTlVMTABlLT5Ec3QgIT0gTlVMTABlLT5TeW0tPm5leHQgPT0gZVByZXYtPlN5bSAmJiBlLT5TeW0gPT0gJm1lc2gtPmVIZWFkU3ltICYmIGUtPlN5bS0+U3ltID09IGUgJiYgZS0+T3JnID09IE5VTEwgJiYgZS0+RHN0ID09IE5VTEwgJiYgZS0+TGZhY2UgPT0gTlVMTCAmJiBlLT5SZmFjZSA9PSBOVUxMAGZyZWUgIT0gSU5WX0hBTkRMRQBzcmMvcHJpb3JpdHlxLmMAcHFIZWFwSW5zZXJ0AGhDdXJyID49IDEgJiYgaEN1cnIgPD0gcHEtPm1heCAmJiBoW2hDdXJyXS5rZXkgIT0gTlVMTABwcUhlYXBEZWxldGUAcHEgIT0gTlVMTABwcURlbGV0ZVByaW9yaXR5UQBMRVEoICoqKGkrMSksICoqaSApAHBxSW5pdABjdXJyICE9IElOVl9IQU5ETEUAcHFJbnNlcnQAY3VyciA8IHBxLT5tYXggJiYgcHEtPmtleXNbY3Vycl0gIT0gTlVMTABwcURlbGV0ZQBjaGlsZCA8PSBwcS0+bWF4AEZsb2F0RG93bgBUT0xFUkFOQ0VfTk9OWkVSTwBzcmMvc3dlZXAuYwBDb25uZWN0TGVmdERlZ2VuZXJhdGUAcmVnLT5maXhVcHBlckVkZ2UARml4VXBwZXJFZGdlAEZBTFNFAElzV2luZGluZ0luc2lkZQByZWctPmVVcC0+d2luZGluZyA9PSAwAERlbGV0ZVJlZ2lvbgAhIFZlcnRFcSggZHN0TG8sIGRzdFVwICkAQ2hlY2tGb3JJbnRlcnNlY3QARWRnZVNpZ24oIGRzdFVwLCB0ZXNzLT5ldmVudCwgb3JnVXAgKSA8PSAwAEVkZ2VTaWduKCBkc3RMbywgdGVzcy0+ZXZlbnQsIG9yZ0xvICkgPj0gMABvcmdVcCAhPSB0ZXNzLT5ldmVudCAmJiBvcmdMbyAhPSB0ZXNzLT5ldmVudAAhIHJlZ1VwLT5maXhVcHBlckVkZ2UgJiYgISByZWdMby0+Zml4VXBwZXJFZGdlAE1JTiggb3JnVXAtPnQsIGRzdFVwLT50ICkgPD0gaXNlY3QudABpc2VjdC50IDw9IE1BWCggb3JnTG8tPnQsIGRzdExvLT50ICkATUlOKCBkc3RMby0+cywgZHN0VXAtPnMgKSA8PSBpc2VjdC5zAGlzZWN0LnMgPD0gTUFYKCBvcmdMby0+cywgb3JnVXAtPnMgKQAhIFZlcnRFcSggZVVwLT5Ec3QsIGVMby0+RHN0ICkAQ2hlY2tGb3JMZWZ0U3BsaWNlAFZlcnRMZXEoIGUtPk9yZywgZS0+RHN0ICkAQWRkUmlnaHRFZGdlcwByZWdQcmV2LT53aW5kaW5nTnVtYmVyIC0gZS0+d2luZGluZyA9PSByZWctPndpbmRpbmdOdW1iZXIARG9uZUVkZ2VEaWN0ACsrZml4ZWRFZGdlcyA9PSAxAHJlZy0+d2luZGluZ051bWJlciA9PSAwAGUtPkxuZXh0ICE9IGUAUmVtb3ZlRGVnZW5lcmF0ZUZhY2VzAHVwLT5MbmV4dCAhPSB1cCAmJiB1cC0+TG5leHQtPkxuZXh0ICE9IHVwAHNyYy90ZXNzLmMAdGVzc01lc2hUZXNzZWxsYXRlTW9ub1JlZ2lvbgBsby0+TG5leHQgIT0gdXAAUmVnaW9ucwBmYWNlVmVydHMgPD0gcG9seVNpemUAT3V0cHV0UG9seW1lc2gAQYgWCwkMAAAADQAAAA4AQbAWCwNADVA="; if (!V(Q)) { var G = Q; Q = e.locateFile ? e.locateFile(G, y) : y + G; } function z() { try { if (v) return new Uint8Array(v); var t = Q; if (V(t)) try { var e = X(t.slice(37)), n = new Uint8Array(e.length); for (t = 0; t < e.length; ++t) n[t] = e.charCodeAt(t); var r = n; } catch (t) { throw Error("Converting base64 string to bytes failed."); } else r = void 0; if (r) return r; throw "both async and sync fetching of the wasm failed"; } catch (t) { j(t); } } function H(t) { for (; 0 < t.length; ) { var n = t.shift(); if ("function" == typeof n) n(e); else { var r = n.J; "number" == typeof r ? void 0 === n.H ? B.get(r)() : B.get(r)(n.H) : r(void 0 === n.H ? null : n.H); } } } var X = "function" == typeof atob ? atob : function (t) { var e = "", n = 0; t = t.replace(/[^A-Za-z0-9\+\/=]/g, ""); do { var r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf( t.charAt(n++) ), i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf( t.charAt(n++) ), o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf( t.charAt(n++) ), a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf( t.charAt(n++) ); (r = (r << 2) | (i >> 4)), (i = ((15 & i) << 4) | (o >> 2)); var s = ((3 & o) << 6) | a; (e += String.fromCharCode(r)), 64 !== o && (e += String.fromCharCode(i)), 64 !== a && (e += String.fromCharCode(s)); } while (n < t.length); return e; }; L.push({ J: function () { q(); }, }); var Y = { a: function (t, e, n, r) { j( "Assertion failed: " + P(t) + ", at: " + [ e ? P(e) : "unknown filename", n, r ? P(r) : "unknown function", ] ); }, d: function (t, e) { throw (Z(t, e || 1), "longjmp"); }, k: function (t, e, n) { D.copyWithin(t, e, e + n); }, l: function (t) { t >>>= 0; var e = D.length; if (2147483648 < t) return !1; for (var n = 1; 4 >= n; n *= 2) { var r = e * (1 + 0.2 / n); (r = Math.min(r, t + 100663296)), 0 < (r = Math.max(16777216, t, r)) % 65536 && (r += 65536 - (r % 65536)); t: { try { C.grow( (Math.min(2147483648, r) - w.byteLength + 65535) >>> 16 ), O(); var i = 1; break t; } catch (t) {} i = void 0; } if (i) return !0; } return !1; }, c: function () { return 0 | b; }, j: function (t, e) { var n = W(); try { return B.get(t)(e); } catch (t) { if ((J(n), t !== t + 0 && "longjmp" !== t)) throw t; Z(1, 0); } }, g: function (t, e, n) { var r = W(); try { return B.get(t)(e, n); } catch (t) { if ((J(r), t !== t + 0 && "longjmp" !== t)) throw t; Z(1, 0); } }, f: function (t, e) { var n = W(); try { B.get(t)(e); } catch (t) { if ((J(n), t !== t + 0 && "longjmp" !== t)) throw t; Z(1, 0); } }, e: function (t, e, n) { var r = W(); try { B.get(t)(e, n); } catch (t) { if ((J(r), t !== t + 0 && "longjmp" !== t)) throw t; Z(1, 0); } }, h: function (t, e, n, r) { var i = W(); try { B.get(t)(e, n, r); } catch (t) { if ((J(i), t !== t + 0 && "longjmp" !== t)) throw t; Z(1, 0); } }, i: function (t, e, n, r, i, o) { var a = W(); try { B.get(t)(e, n, r, i, o); } catch (t) { if ((J(a), t !== t + 0 && "longjmp" !== t)) throw t; Z(1, 0); } }, b: function (t) { b = 0 | t; }, }; !(function () { function t(t) { (e.asm = t.exports), (C = e.asm.m), O(), (B = e.asm.n), k--, e.monitorRunDependencies && e.monitorRunDependencies(k), 0 == k && U && ((t = U), (U = null), t()); } function n(e) { t(e.instance); } function i(t) { return ( v || "function" != typeof fetch ? Promise.resolve().then(z) : fetch(Q, { credentials: "same-origin" }) .then(function (t) { if (!t.ok) throw "failed to load wasm binary file at '" + Q + "'"; return t.arrayBuffer(); }) .catch(function () { return z(); }) ) .then(function (t) { return WebAssembly.instantiate(t, o); }) .then(t, function (t) { A("failed to asynchronously prepare wasm: " + t), j(t); }); } var o = { a: Y }; if ( (k++, e.monitorRunDependencies && e.monitorRunDependencies(k), e.instantiateWasm) ) try { return e.instantiateWasm(o, t); } catch (t) { return ( A("Module.instantiateWasm callback failed with error: " + t), !1 ); } (v || "function" != typeof WebAssembly.instantiateStreaming || V(Q) || "function" != typeof fetch ? i(n) : fetch(Q, { credentials: "same-origin" }).then(function (t) { return WebAssembly.instantiateStreaming(t, o).then( n, function (t) { return ( A("wasm streaming compile failed: " + t), A("falling back to ArrayBuffer instantiation"), i(n) ); } ); }) ).catch(r); })(); var q = (e.___wasm_call_ctors = function () { return (q = e.___wasm_call_ctors = e.asm.o).apply(null, arguments); }); (e._malloc = function () { return (e._malloc = e.asm.p).apply(null, arguments); }), (e._free = function () { return (e._free = e.asm.q).apply(null, arguments); }), (e._tessNewTess = function () { return (e._tessNewTess = e.asm.r).apply(null, arguments); }), (e._tessDeleteTess = function () { return (e._tessDeleteTess = e.asm.s).apply(null, arguments); }), (e._tessAddContour = function () { return (e._tessAddContour = e.asm.t).apply(null, arguments); }), (e._tessTesselate = function () { return (e._tessTesselate = e.asm.u).apply(null, arguments); }), (e._tessGetVertexCount = function () { return (e._tessGetVertexCount = e.asm.v).apply(null, arguments); }), (e._tessGetVertices = function () { return (e._tessGetVertices = e.asm.w).apply(null, arguments); }), (e._tessGetVertexIndices = function () { return (e._tessGetVertexIndices = e.asm.x).apply(null, arguments); }), (e._tessGetElementCount = function () { return (e._tessGetElementCount = e.asm.y).apply(null, arguments); }), (e._tessGetElements = function () { return (e._tessGetElements = e.asm.z).apply(null, arguments); }); var K, W = (e.stackSave = function () { return (W = e.stackSave = e.asm.A).apply(null, arguments); }), J = (e.stackRestore = function () { return (J = e.stackRestore = e.asm.B).apply(null, arguments); }), $ = (e.stackAlloc = function () { return ($ = e.stackAlloc = e.asm.C).apply(null, arguments); }), Z = (e._setThrew = function () { return (Z = e._setThrew = e.asm.D).apply(null, arguments); }); function tt() { function t() { if (!K && ((K = !0), (e.calledRun = !0), !I)) { if ( (H(L), H(N), n(e), e.onRuntimeInitialized && e.onRuntimeInitialized(), e.postRun) ) for ( "function" == typeof e.postRun && (e.postRun = [e.postRun]); e.postRun.length; ) { var t = e.postRun.shift(); R.unshift(t); } H(R); } } if (!(0 < k)) { if (e.preRun) for ( "function" == typeof e.preRun && (e.preRun = [e.preRun]); e.preRun.length; ) F(); H(M), 0 < k || (e.setStatus ? (e.setStatus("Running..."), setTimeout(function () { setTimeout(function () { e.setStatus(""); }, 1), t(); }, 1)) : t()); } } if ( ((e.cwrap = function (t, e, n, r) { var i = (n = n || []).every(function (t) { return "number" === t; }); return "string" !== e && i && !r ? E(t) : function () { return x(t, e, n, arguments); }; }), (U = function t() { K || tt(), K || (U = t); }), (e.run = tt), e.preInit) ) for ( "function" == typeof e.preInit && (e.preInit = [e.preInit]); 0 < e.preInit.length; ) e.preInit.pop()(); return tt(), t.ready; }), Ms = (function () { function t() { (this.name = "tessWasm"), (this.status = "pending"), (this.module = null); } return ( Object.defineProperty(t, "instance", { get: function () { return this._instance || (this._instance = new t()); }, enumerable: !0, configurable: !0, }), (t.prototype.tesselate = function (t) { try { var e = (this._process = new this.module()); return e.addContours(t.contours), e.tesselate(t); } catch (t) { throw ((this.status = "error"), t); } }), (t.prototype.dispose = function () { this._process && (this._process.dispose(), (this._process = null)); }), (t.prototype.init = function () { var t = this; return this.module ? Promise.resolve() : self.WebAssembly ? Bs().then( function (e) { var n = e.Tess; (t.module = n), (t.status = "done"); }, function (e) { (t.status = "error"), console.warn("[Tess Wasm] Error while spawn TessWasm", e); } ) : (console.warn("[Tess Wasm] Wasm not supported"), Promise.reject("[Tess Wasm] Wasm not supported")); }), t ); })(), Ls = (function () { function t() {} return ( (t.tesselate = function (t) { if ("pending" === Ms.instance.status) return ( console.debug( "[GraphicsFactoryFills] WASM Tess not loaded, JS will used." ), Ts(t) ); try { return Ms.instance.tesselate(t); } catch (e) { return ( console.warn( "[GraphicsFactoryFills] Tess2Wasm crash, downgrade to JS", e.message, t ), Ts(t) ); } }), (t.dispose = function () { Ms.instance.dispose(); }), t ); })(), Ns = (window.SHAPE_INFO = { total_time: 0, tess_time: 0, multy_contours: 0, single_contours: 0, }), Rs = 1e3, Fs = (((Os = {})[ts.data_type] = function (t, e) { var n = ds.getMaterialForGradient(t), r = n.material; return ( (e.material = n.material), (e.material.animateUVs = !0), e.style.addSamplerAt(e.sampler, r.getTextureAt(0)), (e.style.uvMatrix = t.getUVMatrix()), t.type == Wa.LINEAR ? (r.getTextureAt(0).mappingMode = Ti.LINEAR) : t.type == Wa.RADIAL && ((e.sampler.imageRect = t.uvRectangle), (r.imageRect = !0), (r.getTextureAt(0).mappingMode = Ti.RADIAL)), e ); }), (Os[ns.data_type] = function (t, e) { var n = ds.getMaterialForColor(t.color, t.alpha), r = n.material; return ( (e.material = r), n.colorPos ? ((r.animateUVs = !0), e.style.addSamplerAt(e.sampler, r.getTextureAt(0)), (e.style.uvMatrix = new O( 0, 0, 0, 0, n.colorPos.x, n.colorPos.y )), (t.uvMatrix = e.style.uvMatrix)) : (e.style = e.sampler = null), e ); }), (Os[es.data_type] = function (t, e) { var n = t.material; return ( (e.material = n), (e.sampler.repeat = t.repeat), (e.sampler.smooth = t.smooth), (e.sampler.mipmap = t.smooth), (n.style.sampler = e.sampler), (n.animateUVs = !0), e.style.addSamplerAt(e.sampler, n.getTextureAt(0)), (e.style.uvMatrix = t.getUVMatrix()), e ); }), Os), ks = (function () { function t() {} return ( Object.defineProperty(t, "Tess2Wasm", { get: function () { return Ms.instance.module; }, enumerable: !0, configurable: !0, }), (t.prepareWasm = function () { "done" !== Ms.instance.status && Ms.instance.init(); }), (t.toFixed = function (t) { return ((t * Rs) | 0) / Rs; }), (t.nearest = function (t, e, n, r) { var i = t - n; i < 0 && (i = -i); var o = e - r; return o < 0 && (o = -o), i + o < this.EPS; }), (t.draw_pathes = function (t) { for (var e = t.queued_fill_pathes, n = e.length, r = 0; r < n; r++) { var i = e[r], o = i.style, a = t.popEmptyFillShape(), s = a ? a.elements : null, u = s ? s.concatenatedBuffer : null, l = this.pathToAttributesBuffer(i, !1, u); if (l && l.length) { s ? (s.invalidate(), (s._numVertices = l.count)) : (s = new ao()).setPositions(new hi(l)), (s.isDynamic = t._clearCount > 0); var c = { sampler: new Le(), style: new zi(), material: null }; o.fillStyle.data_type in Fs || console.error("Unknown style:", o.fillStyle.data_type), Fs[o.fillStyle.data_type](o.fillStyle, c), ((a = a || ss.getShape(s)).style = c.style), (a.material = c.material), (a.originalFillStyle = o.fillStyle), (a.isSimpleRect = i.isSimpleRect), t.addShapeInternal(a); } } }), (t.prepareContours = function (t, e) { void 0 === e && (e = !1), t.prepare(); for (var n = t._positions, r = [], i = 0; i < n.length; i++) { var o = n[i]; if ( (this.nearest(o[0], o[1], o[o.length - 2], o[o.length - 1]) && (o.pop(), o.pop()), o.length >= 6) ) if (e) { for ( var a = new Array(o.length), s = 0, u = o.length; s < u; s++ ) a[s] = this.toFixed(o[s] * this.TESS_SCALE); r.push(a); } else r.push(o); } return r; }), (t.runTesselator = function (t) { var e = this.prepareContours(t, this.USE_TESS_FIX); return ( e.length > 0 ? (Ns.multy_contours += 1) : (Ns.single_contours += 1), 0 === e.length ? null : Ls.tesselate({ contours: e, windingRule: 0, elementType: 0, polySize: 3, vertexSize: 2, }) ); }), (t.fillBuffer = function (t, e) { for ( var n = t.elements.length, r = this.USE_TESS_FIX ? 1 / this.TESS_SCALE : 1, i = 0, o = 0, a = 0, s = 0, u = 0, l = 0, c = 0, h = 0; h < n; h += 3 ) (o = r * t.vertices[2 * t.elements[h + 0] + 0]), (a = r * t.vertices[2 * t.elements[h + 0] + 1]), (s = r * t.vertices[2 * t.elements[h + 1] + 0]), (u = r * t.vertices[2 * t.elements[h + 1] + 1]), (l = r * t.vertices[2 * t.elements[h + 2] + 0]), (c = r * t.vertices[2 * t.elements[h + 2] + 1]), fs.isClockWiseXY(o, a, s, u, l, c) ? ((e[i++] = l), (e[i++] = c), (e[i++] = s), (e[i++] = u), (e[i++] = o), (e[i++] = a)) : ((e[i++] = o), (e[i++] = a), (e[i++] = s), (e[i++] = u), (e[i++] = l), (e[i++] = c)); return e; }), (t.pathToAttributesBuffer = function (t, e, n) { void 0 === n && (n = null); var r, i = performance.now(), o = t.verts ? t.verts.length : 0, a = 0, s = t.pretesselatedBuffer; s ? ((o = s.length), console.debug("[GraphicsFactoryFills] Use prebuild buffer:", t)) : (r = this.runTesselator(t)) && r.elements.length > 0 && ((a = 2 * r.elements.length), (o += 2 * r.elements.length)); n || (n = new oi(2 * Float32Array.BYTES_PER_ELEMENT, (o / 2) | 0)), (n.count = (o / 2) | 0); var u = new Float32Array(n.buffer); s ? u.set(s) : r && (this.fillBuffer(r, u), Ls.dispose()); for (var l = t.verts.length, c = 0; c < l; c++) u[a + c] = t.verts[c]; return (Ns.total_time += performance.now() - i), n; }), (t.TESS_SCALE = 20), (t.USE_TESS_FIX = !0), (t.EPS = 0.001), t ); })(), Us = (function () { function t() {} return ( (t.NO_OP = 0), (t.MOVE_TO = 1), (t.LINE_TO = 2), (t.CURVE_TO = 3), (t.BUILD_JOINT = 13), (t.BUILD_ROUND_JOINT = 14), (t.WIDE_LINE_TO = 4), (t.WIDE_MOVE_TO = 5), (t.CUBIC_CURVE = 6), t ); })(), js = (function () { function t() {} return ( (t.draw_pathes = function (t) { for ( var e, n = t.queued_stroke_pathes, r = n.length, i = 0; i < r; i++ ) { var o = n[i], a = o.style, s = t.popEmptyStrokeShape(); o.prepare(); var u = this.fillLineElements( [o], !1, a.scaleMode, null === (e = s) || void 0 === e ? void 0 : e.elements ); if (u) { (u.scaleMode = a.scaleMode), (u.half_thickness = a.half_thickness); var l = { style: new zi(), sampler: new Le(), material: null }; Fs[o.style.fillStyle.data_type](o.style.fillStyle, l), s ? ((s.material = l.material), (s.style = l.style)) : (s = ss.getShape(u, l.material, l.style)), t.addShapeInternal(s); } } }), (t.fillLineElements = function (t, e, n, r) { void 0 === n && (n = Eo.NORMAL), void 0 === r && (r = null); for ( var i, o = [], a = [], s = 0, u = 0, l = 0, c = 0, h = 0, p = 0, d = 0, f = t.length; d < f; d++ ) { var g = t[d]; g.prepare(); for ( var _ = g._positions, m = g.stroke, y = n != Eo.HAIRLINE ? m.half_thickness : 0.5, A = 0, v = _.length; A < v; A++ ) { (l = (i = _[A])[0]), (c = i[1]); for (var b = 2, C = i.length; b < C; b += 2) { (s = i[b + 0]), (u = i[b + 1]), ks.nearest(s, u, l, c) || ((o[h++] = l), (o[h++] = c), (o[h++] = 0), (o[h++] = s), (o[h++] = u), (o[h++] = 0), (a[p++] = y)), (l = s), (c = u); } } } if (0 == o.length) return null; var I = r || new So(new oi()); return I.setPositions(o), I.setThickness(a), I; }), (t.getTriangleElements = function (t, e, n) { void 0 === n && (n = Eo.NORMAL); var r, i, o, a, s, u = [], l = t.length, c = 0, h = 0, p = new P(), d = new P(), f = new P(), g = new P(), _ = new P(), m = 0, y = 0, A = 0, v = 0, b = 0, C = 0, I = 0, E = 0, x = 0, w = 0, S = 0, D = 0, T = 0, O = 0, B = 0, M = 0, N = 0, R = 0, F = 0, k = 0, U = 0, j = 0, V = 0, Q = 0, G = 0, z = 0, H = 0, X = 0, Y = !0, q = !1, K = !1, W = 0, J = 0, $ = 0, Z = 0, tt = 0, et = 0, nt = 0, rt = 0, it = [], ot = [], at = 0, st = 0, ut = 0; for (ut = 0; ut < l; ut++) for ( r = t[ut]._positions, nt = (i = t[ut].stroke).half_thickness, rt = i.half_thickness, Eo.NORMAL, h = 0; h < r.length; h++ ) { for ( K = !0, (o = r[h])[0] != o[o.length - 2] || o[1] != o[o.length - 1] ? (K = !1) : ((d.x = o[o.length - 2] - o[o.length - 4]), (d.y = o[o.length - 1] - o[o.length - 3]), d.normalize(), ($ = Math.atan2(d.y, d.x) * L.RADIANS_TO_DEGREES)), A = o[0], v = o[1], it = [], ot = [], at = 0, st = 0, a = -1 * d.y, s = d.x, c = 2; c < o.length; c += 2 ) (m = o[c]), (y = o[c + 1]), (m == A && y == v) || ((p.x = m - A), (p.y = y - v), p.normalize(), (J = (W = Math.atan2(p.y, p.x) * L.RADIANS_TO_DEGREES) - $) > 180 && (J -= 360), J < -180 && (J += 360), ($ = W), (f.x = -1 * p.y), (f.y = p.x), (b = A + f.x * nt), (C = v + f.y * rt), (I = A - f.x * nt), (E = v - f.y * rt), (q = !1), 2 != c || K ? ((Z = 180 - J), J < 0 && (Z = -180 - J), 0 == J || 180 == Math.abs(J) ? (q = 2 == c) : Math.abs(Z) < 5 ? (q = !0) : ((q = !0), (Z = -0.5 * Z * L.DEGREES_TO_RADIANS), (g.x = p.x * Math.cos(Z) + p.y * Math.sin(Z)), (g.y = p.y * Math.cos(Z) - p.x * Math.sin(Z)), g.normalize(), Math.abs(J) <= 1 || Math.abs(J) >= 359 || (Math.abs(J) >= 179 && Math.abs(J) <= 181) ? ((tt = J < 0 ? nt : -nt), (et = J < 0 ? rt : -rt)) : ((tt = nt / Math.sin(Z)), (et = rt / Math.sin(Z))), (x = A - g.x * tt), (w = v - g.y * et), (S = A + g.x * tt), (D = v + g.y * et), J > 0 ? ((B = A - a * nt), (M = v - s * rt), (b = x), (C = w), (I = T = A - f.x * nt), (E = O = v - f.y * rt)) : ((F = A + a * nt), (k = v + s * rt), (I = S), (E = D), (b = N = A + f.x * nt), (C = R = v + f.y * rt)), (Y = !0), i.jointstyle == is.MITER && (Math.sqrt( (tt * tt + et * et) / (nt * nt + rt * rt) - 1 ) <= i.miterLimit ? ((Y = !1), (I = S), (E = D), (b = x), (C = w)) : J > 0 ? ((T -= p.x * (i.miterLimit * nt)), (O -= p.y * (i.miterLimit * rt)), (_.x = -1 * s), (_.y = a), (B -= _.x * (i.miterLimit * nt)), (M -= _.y * (i.miterLimit * rt))) : ((N -= p.x * (i.miterLimit * nt)), (R -= p.y * (i.miterLimit * rt)), (_.x = -1 * s), (_.y = a), (F -= _.x * (i.miterLimit * nt)), (k -= _.y * (i.miterLimit * rt)))), Y && ((it[at++] = i.jointstyle != is.ROUND ? Us.BUILD_JOINT : Us.BUILD_ROUND_JOINT), J > 0 ? ((ot[st++] = x), (ot[st++] = w), (ot[st++] = B), (ot[st++] = M), (ot[st++] = T), (ot[st++] = O)) : ((ot[st++] = F), (ot[st++] = k), (ot[st++] = S), (ot[st++] = D), (ot[st++] = N), (ot[st++] = R)), i.jointstyle == is.ROUND && ((ot[st++] = A - g.x * Math.abs(nt)), (ot[st++] = v - g.y * Math.abs(rt)), J > 0 ? ((ot[st++] = B), (ot[st++] = M), (ot[st++] = T), (ot[st++] = O)) : ((ot[st++] = F), (ot[st++] = k), (ot[st++] = N), (ot[st++] = R)))))) : (q = !0), (a = f.x), (s = f.y), q && ((it[at++] = Us.LINE_TO), (ot[st++] = b), (ot[st++] = C), (ot[st++] = I), (ot[st++] = E)), (A = m), (v = y), c == o.length - 2 && ((it[at++] = Us.NO_OP), K ? ((ot[st++] = ot[0]), (ot[st++] = ot[1]), (ot[st++] = ot[2]), (ot[st++] = ot[3])) : ((ot[st++] = A + f.x * nt), (ot[st++] = v + f.y * rt), (ot[st++] = A - f.x * nt), (ot[st++] = v - f.y * rt)))); for (at = 0, st = 0, c = 0; c < it.length; c++) it[c] == Us.LINE_TO ? ((U = ot[st++]), (j = ot[st++]), (V = ot[st++]), (Q = ot[st++]), (G = ot[st]), (z = ot[st + 1]), (H = ot[st + 2]), (X = ot[st + 3]), fs.addTriangle(U, j, G, z, V, Q, 0, u, e), fs.addTriangle(V, Q, G, z, H, X, 0, u, e)) : it[c] >= Us.BUILD_JOINT && ((G = ot[st++]), (z = ot[st++]), (U = ot[st++]), (j = ot[st++]), (V = ot[st++]), (Q = ot[st++]), fs.addTriangle(U, j, V, Q, G, z, 0, u, e), it[c] == Us.BUILD_ROUND_JOINT && ((H = ot[st++]), (X = ot[st++]), (U = ot[st++]), (j = ot[st++]), (V = ot[st++]), (Q = ot[st++]), fs.tesselateCurve(U, j, H, X, V, Q, u, !0))); K || ((d.x = o[2] - o[0]), (d.y = o[3] - o[1]), d.normalize(), fs.createCap( o[0], o[1], ot[0], ot[1], ot[2], ot[3], d.x, d.y, i.capstyle, -1, nt, rt, u, e ), (d.x = o[o.length - 2] - o[o.length - 4]), (d.y = o[o.length - 1] - o[o.length - 3]), d.normalize(), fs.createCap( o[o.length - 2], o[o.length - 1], ot[ot.length - 4], ot[ot.length - 3], ot[ot.length - 2], ot[ot.length - 1], d.x, d.y, i.capstyle, 1, nt, rt, u, e )); } if (0 != u.length) { var lt = new ui(Float32Array, e ? 3 : 2); lt.set(u); var ct = lt.attributesBuffer.cloneBufferView(); lt.dispose(); var ht = new ao(ct); return ht.setPositions(new hi(ct)), ht; } }), t ); })(), Vs = (function () { function t() {} return (t.EVEN_ODD = "evenOdd"), (t.NON_ZERO = "nonZero"), t; })(), Qs = (function () { function t(t, e, n) { void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = Vs.EVEN_ODD), (this._orientedBoxBoundsDirty = !0), (this._isSimpleRect = !1), (this.morphSource = !1), (this._verts = []), (this._lastDirtyID = 0), (this._dirtyID = -1), (this._connectedIdx = []), (this._positionOffset = []), (this.forceClose = !1), (this._cache = {}), (this._cacheSharedSegments = {}), (this._data = []), (this._commands = []), (this._style = null), (this.verts = []), (this._positions = []), null != t && null != e ? ((this._data[0] = e), (this._commands[0] = t)) : ((this._data[0] = []), (this._commands[0] = [])), (this._startPoint = new P()), (this._cur_point = new P()), (this._winding_rule = n), (this._winding_directions = []); } return ( Object.defineProperty(t.prototype, "isSimpleRect", { get: function () { return this._isSimpleRect; }, set: function (t) { this._isSimpleRect = t && 1 === this.commands.length && 12 === this.verts.length; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "verts", { get: function () { return this._verts; }, set: function (t) { (this._verts = t), (this._isSimpleRect = !1); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "dirty", { get: function () { return this._lastDirtyID !== this._dirtyID; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "data_type", { get: function () { return t.data_type; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "style", { get: function () { return this._style; }, set: function (t) { (this._style = t), this._dirtyID++; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "fill", { get: function () { return null == this._style ? null : this._style.data_type == Za.data_type ? this._style : null; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "stroke", { get: function () { return null == this._style ? null : this._style.data_type == os.data_type ? this._style : null; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "commands", { get: function () { return this._commands; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "data", { get: function () { return this._data; }, enumerable: !0, configurable: !0, }), (t.prototype.cacheSegment = function (t, e, n, r, i, o, a, s, u) { void 0 === s && (s = null), void 0 === u && (u = null); var l = n.toString() + "#"; (l += r > o ? r.toString() + "#" + o.toString() : o.toString() + "#" + r.toString()), (l += i > a ? i.toString() + "#" + a.toString() : a.toString() + "#" + i.toString()), null != s && null != u && (l += s.toString() + "#" + u.toString()); var c = this._cache[l]; null == c && (this._cache[l] = c = []), c.push(t), c.push(e), c.length > 2 && (this._cacheSharedSegments[l] = c); }), (t.prototype.curveTo = function (t, e, n, r) { if (((this.isSimpleRect = !1), t != n || e != r)) { if ( this._cur_point.x == n && this._cur_point.y == r && (this._cur_point.x != t || this._cur_point.y != e) ) return this.lineTo(t, e), void this.moveTo(n, r); if ( (this._cur_point.x == n && this._cur_point.y == r) || this._cur_point.x != t || this._cur_point.y != e ) if ( this._cur_point.x != n || this._cur_point.y != r || this._cur_point.x != t || this._cur_point.y != e ) { if ( (0 == this._commands[this._commands.length - 1].length && (this._commands[this._commands.length - 1].push(Us.MOVE_TO), this._data[this._data.length - 1].push(this._cur_point.x), this._data[this._data.length - 1].push(this._cur_point.y)), !this.morphSource) ) { var i = n - this._cur_point.x, o = r - this._cur_point.y; if (Math.sqrt(i * i + o * o) <= ta) return ( (this.data[this.data.length - 1][ this.data[this.data.length - 1].length - 2 ] = n), void (this.data[this.data.length - 1][ this.data[this.data.length - 1].length - 1 ] = r) ); } this._commands[this._commands.length - 1].push(Us.CURVE_TO), this._data[this._data.length - 1].push(t), this._data[this._data.length - 1].push(e), this._data[this._data.length - 1].push(n), this._data[this._data.length - 1].push(r), (this._cur_point.x = n), (this._cur_point.y = r), this._dirtyID++; } else this.lineTo(n, r); else this.lineTo(n, r); } else this.lineTo(t, e); }), (t.prototype.cubicCurveTo = function (t, e, n, r, i, o) { if ( ((this.isSimpleRect = !1), console.log("cubicCurveTo not yet fully supported."), this._cur_point.x != i || this._cur_point.y != o) ) { if ( (0 == this._commands[this._commands.length - 1].length && (this._commands[this._commands.length - 1].push(Us.MOVE_TO), this._data[this._data.length - 1].push( this._cur_point.x, this._cur_point.y )), !this.morphSource) ) { var a = i - this._cur_point.x, s = o - this._cur_point.y; if (a * a + s * s <= ta * ta) return ( (this.data[this.data.length - 1][ this.data[this.data.length - 1].length - 2 ] = i), void (this.data[this.data.length - 1][ this.data[this.data.length - 1].length - 1 ] = o) ); } this._commands[this._commands.length - 1].push(Us.CURVE_TO), this._data[this._data.length - 1].push(t, e, i, o), (this._cur_point.x = i), (this._cur_point.y = o), this._dirtyID++; } }), (t.prototype.lineTo = function (t, e) { if ( (0 == this._commands[this._commands.length - 1].length && (this._commands[this._commands.length - 1].push(Us.MOVE_TO), this._data[this._data.length - 1].push(this._cur_point.x), this._data[this._data.length - 1].push(this._cur_point.y)), !this.morphSource) ) { var n = t - this._cur_point.x, r = e - this._cur_point.y; if (n * n + r * r <= ta * ta) return ( (this.data[this.data.length - 1][ this.data[this.data.length - 1].length - 2 ] = t), void (this.data[this.data.length - 1][ this.data[this.data.length - 1].length - 1 ] = e) ); } this._commands[this._commands.length - 1].push(Us.LINE_TO), this._data[this._data.length - 1].push(t, e), (this._cur_point.x = t), (this._cur_point.y = e), this._dirtyID++; }), (t.prototype.moveTo = function (t, e) { var n = Math.abs(this._cur_point.x - t), r = Math.abs(this._cur_point.y - e); (n < 0.01 && r < 0.01) || (this._commands[this._commands.length - 1].length > 0 && (this._commands.push([Us.MOVE_TO]), this._data.push([t, e])), (this._startPoint.x = t), (this._startPoint.y = e), (this._cur_point.x = t), (this._cur_point.y = e), this._dirtyID++); }), (t.prototype.wideLineTo = function (t, e) {}), (t.prototype.wideMoveTo = function (t, e) {}), (t.prototype.prepare = function () { if (this._dirtyID !== this._lastDirtyID) { this._lastDirtyID = this._dirtyID; var t, e, n, r, i, o, a, s = [], u = [], l = 0, c = 0, h = 0, p = this.commands.length; if (1 === p && !this.commands[0]) return !1; for (var d = 0; d < p; d++) { var f = this.commands[d], g = this.data[d]; (this._positions[d] = []), (this._connectedIdx[d] = []), (this._positionOffset[d] = []), (u[d] = !1), (s[d] = []), Math.abs(g[0] - g[g.length - 2]) + Math.abs(g[1] - g[g.length - 1]) > 0.01 && this.forceClose && ((f[f.length] = Us.LINE_TO), (g[g.length] = g[0]), (g[g.length] = g[1])); } p = this.commands.length; for (d = 0; d < p; d++) { f = this.commands[d]; (c = 0), (e = (g = this.data[d])[c++]), (n = g[c++]), (r = 0), (i = 0), (o = 0), (h = 0), this._positions[d].push(e), this._positions[d].push(n), (c = 0), (e = g[c++]), (n = g[c++]); for (var _ = 1; _ < f.length; _++) switch (f[_]) { case Us.MOVE_TO: console.log( "ERROR ! ONLY THE FIRST COMMAND FOR A CONTOUR IS ALLOWED TO BE A 'MOVE_TO' COMMAND" ); break; case Us.LINE_TO: (r = g[c++]), (i = g[c++]), this._positions[d].push(r), this._positions[d].push(i), (e = r), (n = i); break; case Us.CURVE_TO: for ( o = g[c++], h = g[c++], r = g[c++], i = g[c++], a = [], fs.tesselateCurve(e, n, o, h, r, i, a), l = a.length, t = 0; t < l; t += 2 ) this._positions[d].push(a[t]), this._positions[d].push(a[t + 1]); (e = r), (n = i); } } } }), (t.prototype.invalidate = function () { (this._orientedBoxBoundsDirty = !0), this._dirtyID++; }), (t.prototype.getBoxBounds = function (t, e, n) { return ( void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = null), t ? this._internalGetBoxBounds(t, e, n) : (this._orientedBoxBoundsDirty && ((this._orientedBoxBoundsDirty = !1), (this._orientedBoxBounds = this._internalGetBoxBounds( null, this._orientedBoxBounds, null ))), null != this._orientedBoxBounds && (n = this._orientedBoxBounds.union(n, n || e)), n) ); }), (t.prototype._internalGetBoxBounds = function (t, e, n) { void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = null); var r = 0, i = 0, o = 0, a = 0, s = this._positions.length; if (0 == s) return n; var u, l, c, h = 0, p = 0, d = this._positions[p++], f = d.length; for ( t && (c = t._rawData), null == n ? ((n = e || new M()), t ? ((u = d[h] * c[0] + d[h + 1] * c[4] + c[12]), (l = d[h] * c[1] + d[h + 1] * c[5] + c[13])) : ((u = d[h]), (l = d[h + 1])), (o = r = u), (a = i = l), (h += 2)) : ((o = (r = n.x) + n.width), (a = (i = n.y) + n.height)); h < f; h += 2 ) t ? ((u = d[h] * c[0] + d[h + 1] * c[4] + c[12]), (l = d[h] * c[1] + d[h + 1] * c[5] + c[13])) : ((u = d[h]), (l = d[h + 1])), u < r ? (r = u) : u > o && (o = u), l < i ? (i = l) : l > a && (a = l), h >= f - 2 && p < s && ((h = 0), (f = (d = this._positions[p++]).length)); return ( (n.width = o - (n.x = r)), (n.height = a - (n.y = i)), (n.depth = 0), n ); }), (t.data_type = "[graphicsdata path]"), t ); })(), Gs = (function () { function t(t, e, n) { void 0 === e && (e = 10), void 0 === n && (n = !0), (this.baseClass = t), (this._limit = e), (this.enabled = n), (this._store = []); } return ( (t.prototype.resize = function (t) { if (!(t >= this._store.length)) for ( var e = 0, n = this._store.splice(0, this._store.length - t); e < n.length; e++ ) { n[e].dispose(); } }), Object.defineProperty(t.prototype, "size", { get: function () { return this._store.length; }, set: function (t) { this.resize(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "limit", { get: function () { return this._limit; }, set: function (t) { this.resize(t), (this._limit = t); }, enumerable: !0, configurable: !0, }), (t.prototype.pop = function () { return this._store.length && this.enabled ? this._store.shift() : null; }), (t.prototype.store = function (t) { return ( !!this.enabled && t.assetType === this.baseClass.assetType && !(this._store.length >= this._limit) && (this._store.push(t), !0) ); }), (t.prototype.release = function (t) { var e = this._store.indexOf(t); return -1 !== e && (this._store.splice(e, 1), !0); }), (t.prototype.clear = function () { this.resize(0); }), (t.prototype.dispose = function () { for (var t = 0, e = this._store; t < e.length; t++) { e[t].dispose(); } (this._store = null), (this._limit = 0); }), (t.REDUCE_TIMEOUT = 5e3), t ); })(), zs = { a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0 }, Hs = (function () { function t() {} return ( (t.processStyle = function (t, e, n, r) { var i = t; if ((n && (i.morph = this.processMorphStyle(t, e)), e)) { if ( ((i.miterLimit = 2 * (t.miterLimitFactor || 1.5)), !t.color && t.hasFill) ) { var o = this.processStyle(t.fillStyle, !1, !1, r); return ( (i.type = o.type), (i.transform = o.transform), (i.colors = o.colors), (i.ratios = o.ratios), (i.focalPoint = o.focalPoint), (i.bitmapId = o.bitmapId), (i.material = o.material), (i.repeat = o.repeat), (t.fillStyle = null), i ); } return (i.type = qa.Solid), i; } if (void 0 === t.type || t.type === qa.Solid) return i; var a = 1; switch (t.type) { case qa.LinearGradient: case qa.RadialGradient: case qa.FocalRadialGradient: for ( var s = t.records, u = (i.colors = []), l = (i.ratios = []), c = 0; c < s.length; c++ ) { var h = s[c]; (0 != l.length && l[l.length - 1] == h.ratio) || (u.push(h.color), l.push(h.ratio)); } a = 1; break; case qa.RepeatingBitmap: case qa.ClippedBitmap: case qa.NonsmoothedRepeatingBitmap: case qa.NonsmoothedClippedBitmap: (i.smooth = t.type !== qa.NonsmoothedRepeatingBitmap && t.type !== qa.NonsmoothedClippedBitmap), (i.repeat = t.type !== qa.ClippedBitmap && t.type !== qa.NonsmoothedClippedBitmap), (i.material = r.getMaterial(t.bitmapId)), (a = 0.05); break; default: console.log( "shape parser encountered invalid fill style " + t.type ); } if (!t.matrix) return (i.transform = zs), i; var p = t.matrix; return ( (i.transform = { a: p.a * a, b: p.b * a, c: p.c * a, d: p.d * a, tx: p.tx / 20, ty: p.ty / 20, }), (t.matrix = null), i ); }), (t.processMorphStyle = function (t, e) { var n = Object.create(t); if (e) { if (((n.width = t.widthMorph), !t.color && t.hasFill)) { var r = this.processMorphStyle(t.fillStyle, !1); return ( (n.transform = r.transform), (n.colors = r.colors), (n.ratios = r.ratios), n ); } return (n.color = t.colorMorph), n; } if (void 0 === t.type) return n; if (t.type === qa.Solid) return (n.color = t.colorMorph), n; var i = 1; switch (t.type) { case qa.LinearGradient: case qa.RadialGradient: case qa.FocalRadialGradient: for ( var o = t.records, a = (n.colors = []), s = (n.ratios = []), u = 0; u < o.length; u++ ) { var l = o[u]; a.push(l.colorMorph), s.push(l.ratioMorph); } i = 1; break; case qa.RepeatingBitmap: case qa.ClippedBitmap: case qa.NonsmoothedRepeatingBitmap: case qa.NonsmoothedClippedBitmap: i = 0.05; break; default: console.log("shape parser encountered invalid fill style"); } if (!t.matrix) return (n.transform = zs), n; var c = t.matrixMorph; return ( (n.transform = { a: c.a * i, b: c.b * i, c: c.c * i, d: c.d * i, tx: c.tx / 20, ty: c.ty / 20, }), n ); }), (t.createPathsList = function (t, e, n, r) { for (var i = [], o = 0; o < t.length; o++) { var a = this.processStyle(t[o], e, n, r); i[o] = e ? new as(null, a) : new as(a, null); } return i; }), t ); })(); ks.prepareWasm(); var Xs = Array.prototype.push, Ys = function (t) { return Math.round(t / 20); }, qs = (function (t) { function n() { var e = t.call(this) || this; return ( (e._bitmapFillPool = {}), (e._queuedShapeTags = []), (e._shapes = []), (e._current_position = new P()), (e.tryOptimiseSigleImage = !1), (e._lastPrebuildedShapes = []), (e._drawingDirty = !1), (e.usages = 0), (e._clearCount = 0), (e._internalShapesId = []), (e._rFillPool = new Gs(ss, 100, !1)), (e._rStrokePool = new Gs(ss, 100, !1)), (e._poolingConfig = { fill: Jo.FILLS, stroke: Jo.STROKES, clearsCount: $o, }), (e._drawingDirty = !1), (e._current_position = new P()), (e._queued_fill_pathes = []), (e._queued_stroke_pathes = []), (e._active_fill_path = null), (e._active_stroke_path = null), (e._fillStyle = null), (e._lineStyle = null), (e._onInvalidateDelegate = function (t) { return e._onInvalidate(t); }), e ); } return ( e(n, t), (n.getShapeForBitmap = function (t, e) { var n = ds.getMaterialForBitmap(t, na), r = n.style; return ( (r.sampler = new Le(!1, !0, !1)), r.addSamplerAt(r.sampler, n.getTextureAt(0)), ss.getShape(ss.getTriangleElement(e, !1, !0), n, r) ); }), (n.getShapeForBitmapStyle = function (t, e) { var n = new zi(), r = new K( Ys(e.xMin), Ys(e.yMin), Ys(e.xMax - e.xMin), Ys(e.yMax - e.yMin) ), i = ss.getTriangleElement(r); i.usages++; var o = t.transform, a = o.a, s = o.b, u = o.c, l = o.d, c = o.tx, h = o.ty, p = t.material.getTextureAt(0), d = ds.getMaterialForBitmap(p.getImageAt(0), na), f = new es(d, new O(a, s, u, l, c, h), t.repeat, t.smooth), g = f.material, _ = new Le(f.repeat, f.smooth, t.smooth); return ( (g.style.sampler = _), (g.animateUVs = !0), n.addSamplerAt(_, p), (n.uvMatrix = f.getUVMatrix()), ss.getShape(i, g, n) ); }), (n.getGraphics = function () { return n._pool.length ? n._pool.pop() : new n(); }), (n.clearPool = function () { n._pool = []; }), Object.defineProperty(n.prototype, "start", { get: function () { return !this._start && this.sourceGraphics ? this.sourceGraphics.start : this._start; }, set: function (t) { this._start = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "end", { get: function () { return !this._end && this.sourceGraphics ? this.sourceGraphics.end : this._end; }, set: function (t) { this._end = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "count", { get: function () { return ( this._shapes.length + this._queued_stroke_pathes.length + this._queued_fill_pathes.length + this._queuedShapeTags.length ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "queued_stroke_pathes", { get: function () { return this._queued_stroke_pathes; }, set: function (t) { this._queued_stroke_pathes = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "queued_fill_pathes", { get: function () { return this._queued_fill_pathes; }, set: function (t) { this._queued_fill_pathes = t; }, enumerable: !0, configurable: !0, }), (n.prototype.add_queued_path = function (t, e) { (void 0 === e && (e = !1), t.style) && (t.style.data_type === os.data_type ? (this._queued_stroke_pathes.push(t), e || this.endFill()) : ((this._drawingDirty = !0), this._queued_fill_pathes.push(t))); }), Object.defineProperty(n.prototype, "internalPoolConfig", { get: function () { return this._poolingConfig; }, set: function (t) { (this._poolingConfig.fill = "boolean" == typeof t ? t : t.fill), (this._poolingConfig.stroke = "boolean" == typeof t ? t : t.stroke), t || (this._rFillPool.enabled && this._rFillPool.clear(), this._rStrokePool.enabled && this._rStrokePool.clear(), (this._rStrokePool.enabled = !1), (this._rStrokePool.enabled = !1)), (this._clearCount = 0); }, enumerable: !0, configurable: !0, }), (n.prototype.popEmptyFillShape = function () { return this._rFillPool.pop(); }), (n.prototype.popEmptyStrokeShape = function () { return this._rStrokePool.pop(); }), (n.prototype.addShapeInternal = function (t) { this.addShape(t), this._internalShapesId.push(t.id); }), (n.prototype.addShape = function (t) { t.usages++; var e = this.getShapeIndex(t); return ( -1 != e && this.removeShapeAt(e), this._shapes.push(t), t.addEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateDelegate ), t.addEventListener( Ri.INVALIDATE_MATERIAL, this._onInvalidateDelegate ), t.addEventListener(Ri.INVALIDATE_STYLE, this._onInvalidateDelegate), t.addEventListener(c.INVALIDATE, this._onInvalidateDelegate), this.invalidate(), t ); }), (n.prototype.removeShape = function (t) { var e = this.getShapeIndex(t); if (-1 == e) throw new T("Shape parameter is not a shape of the caller"); this.removeShapeAt(e); }), (n.prototype.removeShapeAt = function (t) { if (t < 0 || t >= this._shapes.length) throw new j("Index is out of range"); var e = this._shapes.splice(t, 1)[0]; e.removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateDelegate ), e.removeEventListener( Ri.INVALIDATE_MATERIAL, this._onInvalidateDelegate ), e.removeEventListener( Ri.INVALIDATE_STYLE, this._onInvalidateDelegate ), e.removeEventListener(c.INVALIDATE, this._onInvalidateDelegate), e.usages--, e.usages || this.tryPoolShape(e) || e.dispose(), this.invalidate(); }), (n.prototype.getShapeAt = function (t) { return this._shapes[t]; }), (n.prototype.getShapeIndex = function (t) { return this._shapes.indexOf(t); }), (n.prototype.applyTransformation = function (t) { for (var e = this._shapes.length, n = 0; n < e; ++n) this._shapes[n].applyTransformation(t); }), (n.prototype.copyTo = function (t, e) { void 0 === e && (e = !1), this._drawingDirty && this.endFill(), (t.sourceGraphics = this), t._addShapes(this._shapes, e); }), (n.prototype.scale = function (t) { for (var e = this._shapes.length, n = 0; n < e; ++n) this._shapes[n].scale(t); }), (n.prototype.tryPoolShape = function (t) { var e = t.elements.assetType === ao.assetType, n = t.elements.assetType === So.assetType; return ( !(!n && !e) && -1 !== this._internalShapesId.indexOf(t.id) && (e ? this._rFillPool.store(t) : !!n && this._rStrokePool.store(t)) ); }), (n.prototype.clear = function () { var t; this._clearCount++, (this._lastPrebuildedShapes.length = 0), !( this._internalShapesId.length > 0 && this._clearCount >= this._poolingConfig.clearsCount ) || (this._rStrokePool.enabled === this._poolingConfig.stroke && this._rFillPool.enabled === this._poolingConfig.fill) || (console.warn( "[Graphics] To many clears, pooling shapes internally!", this.id, this._internalShapesId.length ), (this._rFillPool.enabled = this._poolingConfig.fill), (this._rStrokePool.enabled = this._poolingConfig.stroke)); for (var e = this._shapes.length, n = 0; n < e; n++) (t = this._shapes[n]).removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateDelegate ), t.removeEventListener( Ri.INVALIDATE_MATERIAL, this._onInvalidateDelegate ), t.removeEventListener( Ri.INVALIDATE_STYLE, this._onInvalidateDelegate ), t.removeEventListener(c.INVALIDATE, this._onInvalidateDelegate), t.usages--, t.usages || this.tryPoolShape(t) || t.dispose(); (this._internalShapesId.length = 0), (this._shapes.length = 0), this.invalidate(), (this._active_fill_path = null), (this._active_stroke_path = null), (this._queued_fill_pathes.length = 0), (this._queued_stroke_pathes.length = 0), (this._current_position.x = 0), (this._current_position.y = 0), (this._drawingDirty = !1), (this._lineStyle = null), (this._fillStyle = null); }), (n.prototype.dispose = function () { if ((this.clear(), this._bitmapFillPool)) { for (var t in this._bitmapFillPool) this._bitmapFillPool[t].fillStyle.material.dispose(); this._bitmapFillPool = null; } (this._bitmapFillPool = null), this._rFillPool.clear(), this._rStrokePool.clear(), (this._internalShapesId.length = 0), (this._clearCount = 0), n._pool.push(this); }), (n.prototype.scaleUV = function (t, e) { void 0 === t && (t = 1), void 0 === e && (e = 1); for (var n = this._shapes.length, r = 0; r < n; ++r) this._shapes[r].scaleUV(t, e); }), (n.prototype._acceptTraverser = function (t) { if (this._drawingDirty) { for (var e = 0, n = this._lastPrebuildedShapes; e < n.length; e++) { var r = n[e]; this.removeShape(r); } t instanceof zt ? this._endFillInternal(!1) : this.endFill(); } for (var i = this._shapes.length - 1; i >= 0; i--) t.applyTraversable(this._shapes[i]); }), (n.prototype._onInvalidate = function (t) { this.invalidate(); }), (n.prototype.draw_fills = function (t) { void 0 === t && (t = !0), ks.draw_pathes(this), t && ((this._active_fill_path = null), (this._queued_fill_pathes.length = 0)); }), (n.prototype.draw_strokes = function (t) { void 0 === t && (t = !0), js.draw_pathes(this), t && ((this._active_stroke_path = null), (this._queued_stroke_pathes.length = 0)); }), (n.prototype.beginBitmapFill = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = !0), void 0 === r && (r = !1), this.draw_fills(), this._bitmapFillPool || (this._bitmapFillPool = {}); var i = this._bitmapFillPool[t.id]; i ? ((i.fillStyle.matrix = e), (i.fillStyle.repeat = n), (i.fillStyle.smooth = r)) : (i = this._bitmapFillPool[t.id] = new Za(new es(ds.getMaterialForBitmap(t), e, n, r))), (this._fillStyle = i); }), (n.prototype.beginFill = function (t, e) { void 0 === e && (e = 1), 0 == t && (t = 65793), this.draw_fills(), (this._fillStyle = new Za(new ns(t, e))); }), (n.prototype.beginGradientFill = function (t, e, n, r, i, o, a, s) { void 0 === i && (i = null), void 0 === o && (o = "pad"), void 0 === a && (a = "rgb"), void 0 === s && (s = 0), this.draw_fills(), (this._fillStyle = new Za(new ts(t, e, n, r, i, o, a, s))); }), (n.prototype.copyFrom = function (t) { t.copyTo(this); }), (n.prototype.cubicCurveTo = function (t, e, n, r, i, o) { throw new U("cubicCurveTo"); }), (n.prototype.curveTo = function (t, e, n, r) { (this._drawingDirty = !0), this._createGraphicPathes(), null != this._active_fill_path && this._active_fill_path.curveTo(t, e, n, r), null != this._active_stroke_path && this._active_stroke_path.curveTo(t, e, n, r), (this._current_position.x = n), (this._current_position.y = r), this.invalidate(); }), (n.prototype.drawCircle = function (t, e, n) { if ( ((this._drawingDirty = !0), this._createGraphicPathes(), null != this._active_fill_path) ) { this._active_fill_path.moveTo(t, e); var r = n; null != this._active_stroke_path && (r -= this._active_stroke_path.style.thickness / 2), fs.drawElipse( t, e, r, r, this._active_fill_path.verts, 0, 360, 5, !1 ); } null != this._active_stroke_path && fs.drawElipseStrokes( t, e, n, n, this._active_stroke_path, 0, 360, 2 ), this.invalidate(); }), (n.prototype.drawEllipse = function (t, e, n, r) { if ( ((this._drawingDirty = !0), this._createGraphicPathes(), (t += n /= 2), (e += r /= 2), null != this._active_fill_path) ) { this._active_fill_path.moveTo(t, e); var i = n, o = r; null != this._active_stroke_path && ((i -= this._active_stroke_path.style.thickness / 2), (o -= this._active_stroke_path.style.thickness / 2)), fs.drawElipse( t, e, i, o, this._active_fill_path.verts, 0, 360, 6, !1 ); } null != this._active_stroke_path && fs.drawElipseStrokes( t, e, n, r, this._active_stroke_path, 0, 360, 2 ), this.invalidate(); }), (n.prototype.drawGraphicsData = function (t) {}), (n.prototype.drawPath = function (t, e, n) {}), (n.prototype.drawRect = function (t, e, n, r) { if ( ((this._drawingDirty = !0), this._createGraphicPathes(), null != this._active_fill_path) ) { this._active_fill_path.moveTo(t, e); var i = n, o = r, a = 0; null != this._active_stroke_path && ((a = this._active_stroke_path.style.thickness / 2), (i -= this._active_stroke_path.style.thickness), (o -= this._active_stroke_path.style.thickness)), fs.addTriangle( t + a, e + o + a, t + a, e + a, t + i + a, e + a, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + a, e + o + a, t + a + i, e + a, t + i + a, e + o + a, 0, this._active_fill_path.verts, !1 ), (this._active_fill_path.isSimpleRect = !0); } null != this._active_stroke_path && (this._active_stroke_path.moveTo(t, e), this._active_stroke_path.lineTo(t + n, e), this._active_stroke_path.lineTo(t + n, e + r), this._active_stroke_path.lineTo(t, e + r), this._active_stroke_path.lineTo(t, e)), this.invalidate(); }), (n.prototype.drawRoundRect = function (t, e, n, r, i, o) { void 0 === o && (o = NaN), (this._drawingDirty = !0), this._createGraphicPathes(), isNaN(o) && (o = i); var a = n, s = r, u = i / 2, l = o / 2, c = 0; null != this._active_fill_path && (this._active_fill_path.moveTo(t, e), null != this._active_stroke_path && ((c = this._active_stroke_path.style.thickness / 2), (a -= this._active_stroke_path.style.thickness), (s -= this._active_stroke_path.style.thickness)), fs.addTriangle( t + c, e + s - l, t + c, e + l, t + a - c, e + l, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + c, e + s - l, t + a - c, e + l, t + a - c, e + s - l, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + u, e + c, t + a - u, e + l, t + u, e + l, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + u, e + c, t + a - u, e + c, t + a - u, e + l, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + u, e + s - l, t + a - u, e + s - c, t + u, e + s - c, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + u, e + s - l, t + a - u, e + s - l, t + a - u, e + s - c, 0, this._active_fill_path.verts, !1 ), fs.drawElipse( t + u, e + l, u - c, l - c, this._active_fill_path.verts, 180, 270, 5, !1 ), fs.drawElipse( t + a - u, e + l, u - c, l - c, this._active_fill_path.verts, 270, 360, 5, !1 ), fs.drawElipse( t + a - u, e + s - l, u - c, l - c, this._active_fill_path.verts, 0, 90, 5, !1 ), fs.drawElipse( t + u, e + s - l, u - c, l - c, this._active_fill_path.verts, 90, 180, 5, !1 )), null != this._active_stroke_path && (this._active_stroke_path.moveTo(t + u, e), this._active_stroke_path.lineTo(t + a - u, e), fs.drawElipseStrokes( t + a - u, e + l, u, l, this._active_stroke_path, 270, 360, 2 ), this._active_stroke_path.lineTo(t + a, e + s - l), fs.drawElipseStrokes( t + a - u, e + s - l, u, l, this._active_stroke_path, 0, 90, 2 ), this._active_stroke_path.lineTo(t + u, e + s), fs.drawElipseStrokes( t + u, e + s - l, u, l, this._active_stroke_path, 90, 180, 2 ), this._active_stroke_path.lineTo(t, e + l), fs.drawElipseStrokes( t + u, e + l, u, l, this._active_stroke_path, 180, 270, 2 )), this.invalidate(); }), (n.prototype.drawRoundRectComplex = function (t, e, n, r, i, o, a, s) { var u = n, l = r, c = i, h = o, p = a, d = s; (this._drawingDirty = !0), this._createGraphicPathes(); var f = 0; null != this._active_fill_path && (this._active_fill_path.moveTo(t, e), null != this._active_stroke_path && ((f = this._active_stroke_path.style.thickness / 2), (u -= this._active_stroke_path.style.thickness), (l -= this._active_stroke_path.style.thickness)), fs.addTriangle( t + c, e + c, t + u - h, e + h, t + u - d, e + l - d, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + c, e + c, t + u - d, e + l - d, t + p, e + l - p, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + f, e + c, t + c, e + c, t + f, e + l - p, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + c, e + c, t + f, e + l - p, t + p, e + l - p, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + c, e + f, t + c, e + c, t + u - h, e + f, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + c, e + c, t + u - h, e + h, t + u - h, e + f, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + u - f, e + h, t + u - h, e + h, t + u - f, e + l - d, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + u - h, e + h, t + u - d, e + l - d, t + u - f, e + l - d, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + p, e + l - f, t + u - d, e + l - f, t + p, e + l - p, 0, this._active_fill_path.verts, !1 ), fs.addTriangle( t + p, e + l - p, t + u - d, e + l - f, t + u - d, e + l - d, 0, this._active_fill_path.verts, !1 ), fs.drawElipse( t + c, e + c, c - f, c - f, this._active_fill_path.verts, 180, 270, 5, !1 ), fs.drawElipse( t + u - h, e + h, h - f, h - f, this._active_fill_path.verts, 270, 360, 5, !1 ), fs.drawElipse( t + u - d, e + l - d, d - f, d - f, this._active_fill_path.verts, 0, 90, 5, !1 ), fs.drawElipse( t + p, e + l - p, p - f, p - f, this._active_fill_path.verts, 90, 180, 5, !1 )), null != this._active_stroke_path && (this._active_stroke_path.moveTo(t, e), console.warn( "[Graphics] - drawRoundRectComplex for strokes currently disabled" )), this.invalidate(); }), (n.prototype.drawTriangles = function (t, e, n, r) { (this._drawingDirty = !0), this._active_fill_path, this._active_stroke_path; }), (n.prototype.endFill = function () { this._active_stroke_path && this._active_fill_path && (this._active_stroke_path.forceClose = !0), this._endFillInternal(!0), (this._active_fill_path = null), (this._active_stroke_path = null), (this._fillStyle = null); }), (n.prototype._endFillInternal = function (t) { if ((void 0 === t && (t = !1), this._queuedShapeTags.length)) { var e = this._queuedShapeTags, n = e.length; this._queuedShapeTags = []; for (var r = 0; r < n; r++) this.convertRecordsToShapeData(e[r]); e.length = 0; } var i = this._shapes.length; if ((this.draw_fills(t), this.draw_strokes(t), t)) this._lastPrebuildedShapes.length = 0; else { for (r = i; r < this._shapes.length; r++) this._lastPrebuildedShapes[r - i] = this._shapes[r]; this._lastPrebuildedShapes.length = this._shapes.length - i; } this._drawingDirty = !1; }), (n.prototype.lineBitmapStyle = function (t, e, n, r) {}), (n.prototype.lineGradientStyle = function (t, e, n, r, i, o, a, s) { (this._drawingDirty = !0), (this._lineStyle = new os(new ns(e[0], n[0]), 1)); }), (n.prototype.lineStyle = function (t, e, n, r, i, o, a, s) { if ( (void 0 === t && (t = NaN), void 0 === e && (e = 0), void 0 === n && (n = 1), void 0 === o && (o = rs.NONE), void 0 === a && (a = is.MITER), void 0 === s && (s = 100), isNaN(t)) ) this._lineStyle = null; else { 0 == t && ((t = 0.05), Eo.HAIRLINE); var u = t > 0 && n > 0; (this._drawingDirty = !0), (this._lineStyle = u ? new os(new ns(e, n), t, a, o, s) : null); } }), (n.prototype.lineTo = function (t, e) { (this._drawingDirty = !0), this._createGraphicPathes(), null != this._active_fill_path && this._active_fill_path.lineTo(t, e), null != this._active_stroke_path && this._active_stroke_path.lineTo(t, e), (this._current_position.x = t), (this._current_position.y = e), this.invalidate(); }), (n.prototype.moveTo = function (t, e) { (this._drawingDirty = !0), this._createGraphicPathes(), null != this._active_fill_path && this._active_fill_path.moveTo(t, e), null != this._active_stroke_path && this._active_stroke_path.moveTo(t, e), (this._current_position.x = t), (this._current_position.y = e), this.invalidate(); }), (n.prototype.processLazyTesselation = function (t) { if ( ((t.lazyTaskDone = null), (t.needParse = !1), t.parsingTime < 30) ) { var e = this._queuedShapeTags.indexOf(t); e > -1 && this._queuedShapeTags.splice(e, 1), this.convertRecordsToShapeData(t, t.parsingTime > 1); } else console.debug("[Graphics] Supress lazy shape convertion:", t); }), (n.prototype.queueShapeTag = function (t) { this._queuedShapeTags.push(t), (this._drawingDirty = !0); }), (n.prototype._createGraphicPathes = function () { null == this._fillStyle || (null != this._active_fill_path && this._active_fill_path.style == this._fillStyle) || ((this._active_fill_path = new Qs()), (this._active_fill_path.style = this._fillStyle), (0 == this._current_position.x && 0 == this._current_position.y) || this._active_fill_path.moveTo( this._current_position.x, this._current_position.y ), this._queued_fill_pathes.push(this._active_fill_path)), null == this._lineStyle || (null != this._active_stroke_path && this._active_stroke_path.style == this._lineStyle) || ((this._active_stroke_path = new Qs()), (this._active_stroke_path.style = this._lineStyle), (0 == this._current_position.x && 0 == this._current_position.y) || this._active_stroke_path.moveTo( this._current_position.x, this._current_position.y ), this._queued_stroke_pathes.push(this._active_stroke_path)); }), (n.prototype._addShapes = function (t, e) { var n; void 0 === e && (e = !1); for (var r = t.length, i = 0; i < r; i++) (n = t[i]), e && (n = ss.getShape( n.elements, n.material, n.style, n.count, n.offset )), (n.particleCollection = t[i].particleCollection), n.addEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateDelegate ), n.addEventListener( Ri.INVALIDATE_MATERIAL, this._onInvalidateDelegate ), n.addEventListener( Ri.INVALIDATE_STYLE, this._onInvalidateDelegate ), n.addEventListener(c.INVALIDATE, this._onInvalidateDelegate), this._shapes.push(n), n.usages++; this.invalidate(); }), (n.prototype._isShapeMaterial = function (t) { for (var e = this._shapes.length, n = 0; n < e; n++) if (t == this._shapes[n].material) return !0; return !1; }), (n.prototype.convertRecordsToShapeData = function (t, e) { void 0 === e && (e = !1), t.needParse && t.lazyParser(); var r = t.records, i = t.fillStyles, o = t.lineStyles, a = t.recordsMorph || null, s = null !== a, u = t.parser; if ( this.tryOptimiseSigleImage && 5 === r.length && 2 === i.length && i[0].type >= qa.ClippedBitmap ) { var l = Hs.processStyle(t.fillStyles[1], !1, !1, t.parser), c = t.fillBounds || t.lineBounds; this.addShapeInternal(n.getShapeForBitmapStyle(l, c)); } else { for ( var h, p = Hs.createPathsList(i, !1, !!a, u), d = Hs.createPathsList(o, !0, !!a, u), f = { fill0: 0, fill1: 0, line: 0 }, g = [], _ = [], m = r.length, y = 0, A = 0, v = 0, b = 0, C = 0, I = 0; C < m; C++ ) { var E = r[C]; if ((s && (h = a[I++]), 0 === E.type)) { for (var x = 0; x < 3; x++) g[x] = void 0; 16 & E.flags && (_ || (_ = []), Xs.apply(_, p), (p = Hs.createPathsList(E.fillStyles, !1, s, u)), Xs.apply(_, d), (d = Hs.createPathsList(E.lineStyles, !0, s, u)), (f = { fill0: 0, fill1: 0, line: 0 })), 2 & E.flags && (f.fill0 = E.fillStyle0), 4 & E.flags && (f.fill1 = E.fillStyle1), 8 & E.flags && (f.line = E.lineStyle), f.fill0 && (g[0] = { path: p[f.fill0 - 1] }), f.fill1 && (g[1] = { path: p[f.fill1 - 1] }), f.line && (g[2] = { path: d[f.line - 1] }), 1 & E.flags && ((y = 0 | E.moveX), (A = 0 | E.moveY)), f.fill1 && f.fill0 && f.fill0 == f.fill1 && (g[0] = g[1] = void 0), s && (0 === h.type ? ((v = 0 | h.moveX), (b = 0 | h.moveY)) : I--); for (var w = 0; w < 3; w++) { (D = g[w]) && ((D.segment = Ja.FromDefaults(s)), D.path.addSegment(D.segment), s ? D.segment.morphMoveTo(y, A, v, b) : D.segment.moveTo(y, A)); } } else { if ((Po(1 === E.type), s)) { for (; h && 0 === h.type; ) h = a[I++]; h || (h = E); } if (32 & E.flags && (!s || 32 & h.flags)) { (y += 0 | E.deltaX), (A += 0 | E.deltaY), s && ((v += 0 | h.deltaX), (b += 0 | h.deltaY)); for (var S = 0; S < 3; S++) { var D; (D = g[S]) && (s ? D.segment.morphLineTo(y, A, v, b) : D.segment.lineTo(y, A)); } } else { var T = this.transformCurve(E, y, A); (y = T.x), (A = T.y); var P = void 0; s && ((v = (P = this.transformCurve(h, v, b)).x), (b = P.y)); for (var O = 0; O < 3; O++) { var B = g[O]; if (B) { var M = B.segment; s ? M.morphCurveTo(T.cx, T.cy, y, A, P.cx, P.cy, v, b) : M.curveTo(T.cx, T.cy, y, A); } } } } } var L, N, R = [_, p, d], F = 0; if (s) { (this._start = []), (this._end = []); for (C = 0; F < R.length; C++) !R[F] || R[F].length <= C ? (F++, (C = -1)) : ((L = new Qs()), (N = new Qs()), (L.morphSource = N.morphSource = !0), R[F][C].serializeAJS(L, N), this._start.push(L), this._end.push(N)); } else for (C = 0; F < R.length; C++) !R[F] || R[F].length <= C ? (F++, (C = -1)) : ((L = new Qs()), R[F][C].serializeAJS(L, null), this.add_queued_path(L, e)); } }), (n.prototype.transformCurve = function (t, e, n) { var r, i; if (32 & t.flags) { var o = 0 | t.deltaX, a = 0 | t.deltaY; (r = e + (o >> 1)), (i = n + (a >> 1)), (e += o), (n += a); } else (r = (e + t.controlDeltaX) | 0), (i = (n + t.controlDeltaY) | 0), (e = (r + t.anchorDeltaX) | 0), (n = (i + t.anchorDeltaY) | 0); return { cx: r, cy: i, x: e, y: n }; }), (n._pool = new Array()), (n.assetType = "[asset Graphics]"), n ); })(f); console.debug("AwayJS - Graphics - 0.5.67"), St && St.register(Ms.instance); var Ks, Ws = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype.clone = function () { var t = new n(this.type); return (t.view = this.view), (t.entity = this.entity), t; }), (n.FOCUS_IN = "focusIn3d"), (n.FOCUS_OUT = "focusOut3d"), n ); })(l), Js = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = "triangle"); var r = t.call(this) || this; if ( ((r._primitiveDirty = !0), (r._uvDirty = !0), (r._scaleU = 1), (r._scaleV = 1), (r._material = e), (r._elementsType = n), r._elementsType == xo.TRIANGLE) ) { var i = new ao(new oi()); (i.autoDeriveNormals = !1), (i.autoDeriveTangents = !1), (r._elements = i); } else r._elementsType == xo.LINE && (r._elements = new So(new oi())); return r; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "elementsType", { get: function () { return this._elementsType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "material", { get: function () { return this._material; }, set: function (t) { if (t != this._material) { this._material = t; for (var e = this._pObjects.length, n = 0; n < e; n++) this._pObjects[n].material = this._material; } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scaleU", { get: function () { return this._scaleU; }, set: function (t) { this._scaleU != t && ((this._scaleU = t), this._pInvalidateUVs()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scaleV", { get: function () { return this._scaleV; }, set: function (t) { this._scaleV != t && ((this._scaleV = t), this._pInvalidateUVs()); }, enumerable: !0, configurable: !0, }), (n.prototype._pBuildGraphics = function (t, e) { throw new u(); }), (n.prototype._pBuildUVs = function (t, e) { throw new u(); }), (n.prototype._pInvalidatePrimitive = function () { this._primitiveDirty = !0; }), (n.prototype._pInvalidateUVs = function () { this._uvDirty = !0; }), (n.prototype.updateGraphics = function () { this._pBuildGraphics(this._elements, this._elementsType), (this._primitiveDirty = !1); }), (n.prototype.updateUVs = function () { this._pBuildUVs(this._elements, this._elementsType), (this._uvDirty = !1); }), (n.prototype._iValidate = function () { this._primitiveDirty && this.updateGraphics(), this._uvDirty && this.updateUVs(); }), (n.prototype._pCreateObject = function () { var t = new ru(null, this._material); return ( t.graphics.addShape(ss.getShape(this._elements)), (t._iSourcePrefab = this), t ); }), (n.assetType = "[asset PrimitivePrefab]"), n ); })( (function (t) { function n() { var e = t.call(this) || this; return (e._pObjects = new Array()), e; } return ( e(n, t), (n.prototype.getNewObject = function () { var t = this._pCreateObject(); return this._pObjects.push(t), t; }), (n.prototype._pCreateObject = function () { throw new u(); }), (n.prototype._iValidate = function () {}), n ); })(f) ), $s = (function (t) { function n(e, n, r, i, o, a, s, u, l) { void 0 === e && (e = null), void 0 === n && (n = "triangle"), void 0 === r && (r = 100), void 0 === i && (i = 100), void 0 === o && (o = 100), void 0 === a && (a = 1), void 0 === s && (s = 1), void 0 === u && (u = 1), void 0 === l && (l = !0); var c = t.call(this, e, n) || this; return ( (c._width = r), (c._height = i), (c._depth = o), (c._segmentsW = a), (c._segmentsH = s), (c._segmentsD = u), (c._tile6 = l), c ); } return ( e(n, t), Object.defineProperty(n.prototype, "width", { get: function () { return this._width; }, set: function (t) { (this._width = t), this._pInvalidatePrimitive(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return this._height; }, set: function (t) { (this._height = t), this._pInvalidatePrimitive(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depth", { get: function () { return this._depth; }, set: function (t) { (this._depth = t), this._pInvalidatePrimitive(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "tile6", { get: function () { return this._tile6; }, set: function (t) { (this._tile6 = t), this._pInvalidatePrimitive(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "segmentsW", { get: function () { return this._segmentsW; }, set: function (t) { (this._segmentsW = t), this._pInvalidatePrimitive(), this._pInvalidateUVs(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "segmentsH", { get: function () { return this._segmentsH; }, set: function (t) { (this._segmentsH = t), this._pInvalidatePrimitive(), this._pInvalidateUVs(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "segmentsD", { get: function () { return this._segmentsD; }, set: function (t) { (this._segmentsD = t), this._pInvalidatePrimitive(), this._pInvalidateUVs(); }, enumerable: !0, configurable: !0, }), (n.prototype._pBuildGraphics = function (t, e) { var n, r, i, o, a, s, u, l, c, h, p, d, f, g, _, m, y, A = 0, v = this._width / 2, b = this._height / 2, C = this._depth / 2; if (e == xo.TRIANGLE) { var I = t, E = 2 * ((this._segmentsW + 1) * (this._segmentsH + 1) + (this._segmentsW + 1) * (this._segmentsD + 1) + (this._segmentsH + 1) * (this._segmentsD + 1)), x = 12 * (this._segmentsW * this._segmentsH + this._segmentsW * this._segmentsD + this._segmentsH * this._segmentsD); for ( E == I.numVertices && null != I.indices ? (I.invalidateIndices(), I.invalidateVertices(I.positions), I.invalidateVertices(I.normals), I.invalidateVertices(I.tangents)) : (I.setIndices(new Uint16Array(x)), I.setPositions(new Float32Array(3 * E)), I.setNormals(new Float32Array(3 * E)), I.setTangents(new Float32Array(3 * E)), this._pInvalidateUVs()), n = I.indices.get(I.numElements), r = I.positions.get(E), i = I.normals.get(E), o = I.tangents.get(E), a = I.concatenatedBuffer.stride / 4, d = 0, f = 0, g = this._width / this._segmentsW, _ = this._height / this._segmentsH, m = this._depth / this._segmentsD, h = 0; h <= this._segmentsW; h++ ) for (y = h * g - v, p = 0; p <= this._segmentsH; p++) (r[d] = y), (r[d + 1] = p * _ - b), (r[d + 2] = -C), (i[d] = 0), (i[d + 1] = 0), (i[d + 2] = -1), (o[d] = 1), (o[d + 1] = 0), (o[d + 2] = 0), (r[(d += a)] = y), (r[d + 1] = p * _ - b), (r[d + 2] = C), (i[d] = 0), (i[d + 1] = 0), (i[d + 2] = 1), (o[d] = -1), (o[d + 1] = 0), (o[d + 2] = 0), (d += a), h && p && ((l = (s = 2 * ((h - 1) * (this._segmentsH + 1) + (p - 1))) + 2), (c = (u = 2 * (h * (this._segmentsH + 1) + (p - 1))) + 2), (n[f++] = s), (n[f++] = l), (n[f++] = c), (n[f++] = s), (n[f++] = c), (n[f++] = u), (n[f++] = u + 1), (n[f++] = c + 1), (n[f++] = l + 1), (n[f++] = u + 1), (n[f++] = l + 1), (n[f++] = s + 1)); for ( A += 2 * (this._segmentsW + 1) * (this._segmentsH + 1), h = 0; h <= this._segmentsW; h++ ) for (y = h * g - v, p = 0; p <= this._segmentsD; p++) (r[d] = y), (r[d + 1] = b), (r[d + 2] = p * m - C), (i[d] = 0), (i[d + 1] = 1), (i[d + 2] = 0), (o[d] = 1), (o[d + 1] = 0), (o[d + 2] = 0), (r[(d += a)] = y), (r[d + 1] = -b), (r[d + 2] = p * m - C), (i[d] = 0), (i[d + 1] = -1), (i[d + 2] = 0), (o[d] = 1), (o[d + 1] = 0), (o[d + 2] = 0), (d += a), h && p && ((l = (s = A + 2 * ((h - 1) * (this._segmentsD + 1) + (p - 1))) + 2), (c = (u = A + 2 * (h * (this._segmentsD + 1) + (p - 1))) + 2), (n[f++] = s), (n[f++] = l), (n[f++] = c), (n[f++] = s), (n[f++] = c), (n[f++] = u), (n[f++] = u + 1), (n[f++] = c + 1), (n[f++] = l + 1), (n[f++] = u + 1), (n[f++] = l + 1), (n[f++] = s + 1)); for ( A += 2 * (this._segmentsW + 1) * (this._segmentsD + 1), h = 0; h <= this._segmentsD; h++ ) for (y = C - h * m, p = 0; p <= this._segmentsH; p++) (r[d] = -v), (r[d + 1] = p * _ - b), (r[d + 2] = y), (i[d] = -1), (i[d + 1] = 0), (i[d + 2] = 0), (o[d] = 0), (o[d + 1] = 0), (o[d + 2] = -1), (r[(d += a)] = v), (r[d + 1] = p * _ - b), (r[d + 2] = y), (i[d] = 1), (i[d + 1] = 0), (i[d + 2] = 0), (o[d] = 0), (o[d + 1] = 0), (o[d + 2] = 1), (d += a), h && p && ((l = (s = A + 2 * ((h - 1) * (this._segmentsH + 1) + (p - 1))) + 2), (c = (u = A + 2 * (h * (this._segmentsH + 1) + (p - 1))) + 2), (n[f++] = s), (n[f++] = l), (n[f++] = c), (n[f++] = s), (n[f++] = c), (n[f++] = u), (n[f++] = u + 1), (n[f++] = c + 1), (n[f++] = l + 1), (n[f++] = u + 1), (n[f++] = l + 1), (n[f++] = s + 1)); } else if (e == xo.LINE) { var w = t, S = 4 * this._segmentsH + 4 * this._segmentsW + 4 * this._segmentsD; r = new Float32Array(6 * S); var D = new Float32Array(S); for (d = 0, f = 0, h = 0; h < this._segmentsH; ++h) (r[d++] = -v), (r[d++] = (h * this._height) / this._segmentsH - b), (r[d++] = -C), (r[d++] = v), (r[d++] = (h * this._height) / this._segmentsH - b), (r[d++] = -C), (D[f++] = 1), (r[d++] = -v), (r[d++] = b - (h * this._height) / this._segmentsH), (r[d++] = C), (r[d++] = v), (r[d++] = b - (h * this._height) / this._segmentsH), (r[d++] = C), (D[f++] = 1); for (h = 0; h < this._segmentsW; ++h) (r[d++] = (h * this._width) / this._segmentsW - v), (r[d++] = -b), (r[d++] = -C), (r[d++] = (h * this._width) / this._segmentsW - v), (r[d++] = b), (r[d++] = -C), (D[f++] = 1), (r[d++] = v - (h * this._width) / this._segmentsW), (r[d++] = -b), (r[d++] = C), (r[d++] = v - (h * this._width) / this._segmentsW), (r[d++] = b), (r[d++] = C), (D[f++] = 1); for (h = 0; h < this._segmentsH; ++h) (r[d++] = -v), (r[d++] = (h * this._height) / this._segmentsH - b), (r[d++] = -C), (r[d++] = -v), (r[d++] = (h * this._height) / this._segmentsH - b), (r[d++] = C), (D[f++] = 1), (r[d++] = v), (r[d++] = b - (h * this._height) / this._segmentsH), (r[d++] = -C), (r[d++] = v), (r[d++] = b - (h * this._height) / this._segmentsH), (r[d++] = C), (D[f++] = 1); for (h = 0; h < this._segmentsD; ++h) (r[d++] = v), (r[d++] = -b), (r[d++] = (h * this._depth) / this._segmentsD - C), (r[d++] = v), (r[d++] = b), (r[d++] = (h * this._depth) / this._segmentsD - C), (D[f++] = 1), (r[d++] = -v), (r[d++] = -b), (r[d++] = C - (h * this._depth) / this._segmentsD), (r[d++] = -v), (r[d++] = b), (r[d++] = C - (h * this._depth) / this._segmentsD), (D[f++] = 1); for (h = 0; h < this._segmentsD; ++h) (r[d++] = -v), (r[d++] = -b), (r[d++] = C - (h * this._depth) / this._segmentsD), (r[d++] = v), (r[d++] = -b), (r[d++] = C - (h * this._depth) / this._segmentsD), (D[f++] = 1), (r[d++] = -v), (r[d++] = b), (r[d++] = (h * this._depth) / this._segmentsD - C), (r[d++] = v), (r[d++] = b), (r[d++] = (h * this._depth) / this._segmentsD - C), (D[f++] = 1); for (h = 0; h < this._segmentsW; ++h) (r[d++] = v - (h * this._width) / this._segmentsW), (r[d++] = -b), (r[d++] = -C), (r[d++] = v - (h * this._width) / this._segmentsW), (r[d++] = -b), (r[d++] = C), (D[f++] = 1), (r[d++] = (h * this._width) / this._segmentsW - v), (r[d++] = b), (r[d++] = -C), (r[d++] = (h * this._width) / this._segmentsW - v), (r[d++] = b), (r[d++] = C), (D[f++] = 1); w.setPositions(r), w.setThickness(D); } }), (n.prototype._pBuildUVs = function (t, e) { var n, r, i, o, a, s, u, l, c, h, p, d, f, g, _, m; if (e == xo.TRIANGLE) { m = 2 * ((this._segmentsW + 1) * (this._segmentsH + 1) + (this._segmentsW + 1) * (this._segmentsD + 1) + (this._segmentsH + 1) * (this._segmentsD + 1)); var y = t; for ( y.uvs && m == y.numVertices ? y.invalidateVertices(y.uvs) : y.setUVs(new Float32Array(2 * m)), o = y.uvs.get(m), a = y.uvs.stride, this._tile6 ? ((s = l = 1 / 3), (u = c = 0.5)) : ((s = u = 1), (l = c = 0)), i = 0, h = 1 * l, p = 1 * c, d = 2 * l, f = 0 * c, g = s / this._segmentsW, _ = u / this._segmentsH, n = 0; n <= this._segmentsW; n++ ) for (r = 0; r <= this._segmentsH; r++) (o[i] = (h + n * g) * this._scaleU), (o[i + 1] = (p + (u - r * _)) * this._scaleV), (o[(i += a)] = (d + (s - n * g)) * this._scaleU), (o[i + 1] = (f + (u - r * _)) * this._scaleV), (i += a); for ( h = 1 * l, p = 0 * c, d = 0 * l, f = 0 * c, g = s / this._segmentsW, _ = u / this._segmentsD, n = 0; n <= this._segmentsW; n++ ) for (r = 0; r <= this._segmentsD; r++) (o[i] = (h + n * g) * this._scaleU), (o[i + 1] = (p + (u - r * _)) * this._scaleV), (o[(i += a)] = (d + n * g) * this._scaleU), (o[i + 1] = (f + r * _) * this._scaleV), (i += a); for ( h = 0 * l, p = 1 * c, d = 2 * l, f = 1 * c, g = s / this._segmentsD, _ = u / this._segmentsH, n = 0; n <= this._segmentsD; n++ ) for (r = 0; r <= this._segmentsH; r++) (o[i] = (h + n * g) * this._scaleU), (o[i + 1] = (p + (u - r * _)) * this._scaleV), (o[(i += a)] = (d + (s - n * g)) * this._scaleU), (o[i + 1] = (f + (u - r * _)) * this._scaleV), (i += a); } }), n ); })(Js), Zs = (function (t) { function n(e, n, r, i, o, a) { void 0 === e && (e = null), void 0 === n && (n = "triangle"), void 0 === r && (r = 50), void 0 === i && (i = 16), void 0 === o && (o = 12), void 0 === a && (a = !0); var s = t.call(this, e, n) || this; return ( (s._radius = r), (s._segmentsW = i), (s._segmentsH = o), (s._yUp = a), s ); } return ( e(n, t), Object.defineProperty(n.prototype, "radius", { get: function () { return this._radius; }, set: function (t) { (this._radius = t), this._pInvalidatePrimitive(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "segmentsW", { get: function () { return this._segmentsW; }, set: function (t) { (this._segmentsW = t), this._pInvalidatePrimitive(), this._pInvalidateUVs(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "segmentsH", { get: function () { return this._segmentsH; }, set: function (t) { (this._segmentsH = t), this._pInvalidatePrimitive(), this._pInvalidateUVs(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "yUp", { get: function () { return this._yUp; }, set: function (t) { (this._yUp = t), this._pInvalidatePrimitive(); }, enumerable: !0, configurable: !0, }), (n.prototype._pBuildGraphics = function (t, e) { var n, r, i, o, a, s, u, l, c, h, p, d; if (e == xo.TRIANGLE) { var f = t; (d = (this._segmentsH + 1) * (this._segmentsW + 1)) == f.numVertices && null != f.indices ? (f.invalidateIndices(), f.invalidateVertices(f.positions), f.invalidateVertices(f.normals), f.invalidateVertices(f.tangents)) : (f.setIndices( new Uint16Array((this._segmentsH - 1) * this._segmentsW * 6) ), f.setPositions(new Float32Array(3 * d)), f.setNormals(new Float32Array(3 * d)), f.setTangents(new Float32Array(3 * d)), this._pInvalidateUVs()), (n = f.indices.get(f.numElements)), (r = f.positions.get(d)), (i = f.normals.get(d)), (o = f.tangents.get(d)), (a = f.concatenatedBuffer.stride / 4), (l = 0), (c = 0); var g = void 0, _ = void 0, m = void 0; for (u = 0; u <= this._segmentsH; ++u) { g = l; var y = (Math.PI * u) / this._segmentsH, A = -this._radius * Math.cos(y), v = this._radius * Math.sin(y); for (s = 0; s <= this._segmentsW; ++s) { var b = (2 * Math.PI * s) / this._segmentsW, C = v * Math.cos(b), I = v * Math.sin(b), E = 1 / Math.sqrt(C * C + I * I + A * A), x = Math.sqrt(I * I + C * C); if ( (this._yUp ? ((_ = 0), (m = x > 0.007 ? C / x : 0), (h = -A), (p = I)) : ((_ = x > 0.007 ? C / x : 0), (m = 0), (h = I), (p = A)), s == this._segmentsW ? ((r[l] = r[g]), (r[l + 1] = r[g + 1]), (r[l + 2] = r[g + 2]), (i[l] = i[g] + C * E * 0.5), (i[l + 1] = i[g + 1] + h * E * 0.5), (i[l + 2] = i[g + 2] + p * E * 0.5), (o[l] = x > 0.007 ? -I / x : 1), (o[l + 1] = _), (o[l + 2] = m)) : ((r[l] = C), (r[l + 1] = h), (r[l + 2] = p), (i[l] = C * E), (i[l + 1] = h * E), (i[l + 2] = p * E), (o[l] = x > 0.007 ? -I / x : 1), (o[l + 1] = _), (o[l + 2] = m)), s > 0 && u > 0) ) { var w = (this._segmentsW + 1) * u + s, S = (this._segmentsW + 1) * u + s - 1, D = (this._segmentsW + 1) * (u - 1) + s - 1, T = (this._segmentsW + 1) * (u - 1) + s; u == this._segmentsH ? ((r[l] = r[g]), (r[l + 1] = r[g + 1]), (r[l + 2] = r[g + 2]), (n[c++] = w), (n[c++] = D), (n[c++] = T)) : 1 == u ? ((n[c++] = w), (n[c++] = S), (n[c++] = D)) : ((n[c++] = w), (n[c++] = S), (n[c++] = D), (n[c++] = w), (n[c++] = D), (n[c++] = T)); } l += a; } } } else if (e == xo.LINE) { var P = t, O = this._segmentsH * this._segmentsW * 2 + this._segmentsW, B = new Float32Array(6 * O), M = new Float32Array(O); for (l = 0, c = 0, u = 0; u <= this._segmentsH; ++u) { (y = (Math.PI * u) / this._segmentsH), (A = -this._radius * Math.cos(y)), (v = this._radius * Math.sin(y)); for (s = 0; s <= this._segmentsW; ++s) { (b = (2 * Math.PI * s) / this._segmentsW), (C = v * Math.cos(b)), (I = v * Math.sin(b)); if ( (this._yUp ? ((h = -A), (p = I)) : ((h = I), (p = A)), s > 0 && ((B[l++] = C), (B[l++] = h), (B[l++] = p), (M[c++] = 1), u > 0)) ) { var L = 1 == u ? 3 - (6 * (this._segmentsW - s) + 12 * s) : 3 - 12 * this._segmentsW; (B[l] = B[l++ + L]), (B[l] = B[l++ + L]), (B[l] = B[l++ + L]), (B[l++] = C), (B[l++] = h), (B[l++] = p), (M[c++] = 1); } s < this._segmentsW && ((B[l++] = C), (B[l++] = h), (B[l++] = p)); } } P.setPositions(B), P.setThickness(M); } }), (n.prototype._pBuildUVs = function (t, e) { var n, r, i, o, a = (this._segmentsH + 1) * (this._segmentsW + 1); if (e == xo.TRIANGLE) { a = (this._segmentsH + 1) * (this._segmentsW + 1); var s = t; s.uvs && a == s.numVertices ? s.invalidateVertices(s.uvs) : s.setUVs(new Float32Array(2 * a)), (i = s.uvs.get(a)), (o = s.uvs.stride); var u = 0; for (r = 0; r <= this._segmentsH; ++r) for (n = 0; n <= this._segmentsW; ++n) (i[u] = (n / this._segmentsW) * this._scaleU), (i[u + 1] = (r / this._segmentsH) * this._scaleV), (u += o); } }), n ); })(Js), tu = { ALLOW_FORCE_MSAA: 8, MSAA_MINIMAL_IMAGE_SIZE: 300, ALLOW_APPROXIMATION: 0, USE_UNSAFE_CACHE_AS_BITMAP: !1, USE_UNSAFE_SCALE_9_SLICE: !1, USE_UNSAFE_FILTERS: !1, USE_UNSAFE_BLENDS: !1, REMAP_BLEND_MODE: !0, BLEND_MODE_REMAP_TABLE: ((Ks = {}), (Ks[dn.DARKEN] = dn.MULTIPLY), Ks), CPU_COPY_PIXELS_COUNT: 4096, }, eu = (function (t) { function n() { var e = t.call(this) || this; return ( (e._sessionID = -1), (e._avmDepthID = -1), (e._alignmentMode = Rt.REGISTRATION_POINT), (e._visible = !0), (e._maskId = -1), (e._mouseEnabled = !0), (e._maskMode = !1), (e.isSlice9ScaledMC = !1), (e.isSlice9ScaledSprite = !1), (e.isAVMScene = !1), (e.placeObjectTag = null), (e._blendMode = ""), (e.castsShadows = !0), (e._filters = null), (e.orientationMode = Nt.DEFAULT), (e.zOffset = 0), (e.hasDispatchedAddedToStage = !1), (e.cursorType = ""), (e._isInFocus = !1), (e._tabEnabled = !1), (e._tabIndex = -1), (e._avmDepthID = -1), (e._onInvalidatePropertiesDelegate = function (t) { return e._onInvalidateProperties(t); }), (e._transform = new k(null)), e._transform.addEventListener(D.INVALIDATE_MATRIX3D, function (t) { return e._invalidateHierarchicalProperty(Lt.SCENE_TRANSFORM); }), e._transform.addEventListener( D.INVALIDATE_COLOR_TRANSFORM, function (t) { return e._invalidateHierarchicalProperty(Lt.COLOR_TRANSFORM); } ), (e._defaultBoundingVolume = e._getDefaultBoundingVolume()), e ); } return ( e(n, t), (n.prototype.getScriptPrecedence = function () { if (!this._parent) return []; var t = this._parent.getScriptPrecedence(); return ( this.placeObjectTag && t.push(this.placeObjectTag.actionBlocksPrecedence), t ); }), (n.prototype.dispatchFrameEvents = function (t) { this.dispatchEvent(t[0]), this.dispatchEvent(t[1]); }), (n.prototype.dispatchEnterFrame = function (t) { this.dispatchEvent(t); }), (n.prototype.dispatchExitFrame = function (t) { this.dispatchEvent(t); }), (n.prototype.getMouseCursor = function () { return "initial"; }), Object.defineProperty(n.prototype, "tabEnabled", { get: function () { return this._tabEnabled; }, set: function (t) { this._tabEnabled = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "tabIndex", { get: function () { return this._tabIndex; }, set: function (t) { this._tabIndex = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "isInFocus", { get: function () { return this._isInFocus; }, set: function (t) { this._isInFocus = t; }, enumerable: !0, configurable: !0, }), (n.prototype.setFocus = function (t, e, r) { this._isInFocus != t && ((this._isInFocus = t), this._isInFocus ? (n.focusEvent.type = Ws.FOCUS_IN) : (n.focusEvent.type = Ws.FOCUS_OUT), this.dispatchEnterFrame(n.focusEvent)); }), Object.defineProperty(n.prototype, "alignmentMode", { get: function () { return this._alignmentMode; }, set: function (t) { this._alignmentMode != t && ((this._alignmentMode = t), this._invalidateHierarchicalProperty(Lt.SCENE_TRANSFORM)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._transform.colorTransform.alphaMultiplier; }, set: function (t) { (this._transform.colorTransform.alphaMultiplier = t), this._transform.invalidateColorTransform(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blendMode", { get: function () { return tu.USE_UNSAFE_BLENDS ? tu.BLEND_MODE_REMAP_TABLE[this._blendMode] || this._blendMode : ""; }, set: function (t) { this._blendMode !== t && ((this._blendMode = t), t === dn.OVERLAY && this._transform.invalidateColorTransform()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "defaultBoundingVolume", { get: function () { return this._defaultBoundingVolume; }, set: function (t) { this._defaultBoundingVolume != t && ((this._defaultBoundingVolume = t), this._boundsPrimitive && (this._boundsPrimitive.dispose(), (this._boundsPrimitive = null)), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "cacheAsBitmap", { get: function () { return this._bitmapCache; }, set: function (t) { this._bitmapCache; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "eulers", { get: function () { return ( this._eulers || (this._eulers = new B()), (this._eulers.x = this.rotationX), (this._eulers.y = this.rotationY), (this._eulers.z = this.rotationZ), this._eulers ); }, set: function (t) { (this._transform.rotation.x = t.x), (this._transform.rotation.y = t.y), (this._transform.rotation.z = t.z), this._transform.invalidateMatrix3D(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "filters", { get: function () { return this._filters; }, set: function (t) { tu.USE_UNSAFE_FILTERS && ((this._filters = t), this._invalidateStyle()); }, enumerable: !0, configurable: !0, }), (n.prototype.updateFilters = function (t) { console.warn("[scene/DisplayObject] - updateFilters is just a stub"); }), Object.defineProperty(n.prototype, "index", { get: function () { return this._parent ? this._parent.getChildIndex(this) : 0; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "loader", { get: function () { return this._loader; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mask", { set: function (t) { this.scriptMask = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "maskMode", { get: function () { return this._maskMode; }, set: function (t) { this._maskMode != t && ((this._maskMode = t), (this._maskId = t ? this.id : -1), this._updateMaskMode()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pickObject", { get: function () { return this._pickObject; }, set: function (t) { this._pickObject != t && ((this._pickObject = t.pickObjectFromTimeline ? t.clone() : t), this._pickObject && ((this._pickObject.mouseChildren = !1), (this._pickObject.mouseEnabled = !1))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mouseEnabled", { get: function () { return this._mouseEnabled; }, set: function (t) { this._mouseEnabled != t && (this._mouseEnabled = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mouseX", { get: function () { return this._mouseX; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mouseY", { get: function () { return this._mouseY; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "name", { get: function () { return this._pName ? this._pName : ""; }, set: function (t) { this._pName = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "parent", { get: function () { return this._parent; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "registrationPoint", { get: function () { return this._registrationMatrix3D ? new B( -this._registrationMatrix3D._rawData[12] * this.scaleX, -this._registrationMatrix3D._rawData[13] * this.scaleY, -this._registrationMatrix3D._rawData[14] * this.scaleZ ) : null; }, set: function (t) { if (t) this._registrationMatrix3D || (this._registrationMatrix3D = new F()), (this._registrationMatrix3D._rawData[12] = -t.x / this._transform.scale.x), (this._registrationMatrix3D._rawData[13] = -t.y / this._transform.scale.y), (this._registrationMatrix3D._rawData[14] = -t.z / this._transform.scale.z); else { if (!this._registrationMatrix3D) return; (this._registrationMatrix3D._rawData[12] = 0), (this._registrationMatrix3D._rawData[13] = 0), (this._registrationMatrix3D._rawData[14] = 0), this._registrationMatrix3D.isIdentity() && (this._registrationMatrix3D = null); } this._registrationMatrix3D.invalidatePosition(), this._invalidateHierarchicalProperty(Lt.SCENE_TRANSFORM); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "registrationScale", { get: function () { return this._registrationMatrix3D ? new B( this._registrationMatrix3D._rawData[0], this._registrationMatrix3D._rawData[5], this._registrationMatrix3D._rawData[10] ) : null; }, set: function (t) { if (t) this._registrationMatrix3D || (this._registrationMatrix3D = new F()), (this._registrationMatrix3D._rawData[0] = t.x), (this._registrationMatrix3D._rawData[5] = t.y), (this._registrationMatrix3D._rawData[10] = t.z); else { if (!this._registrationMatrix3D) return; (this._registrationMatrix3D._rawData[0] = 1), (this._registrationMatrix3D._rawData[5] = 1), (this._registrationMatrix3D._rawData[10] = 1), this._registrationMatrix3D.isIdentity() && (this._registrationMatrix3D = null); } this._invalidateHierarchicalProperty(Lt.SCENE_TRANSFORM); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "root", { get: function () { return this._root; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rotationX", { get: function () { return this._transform.rotation.x * L.RADIANS_TO_DEGREES; }, set: function (t) { this.rotationX != t && ((this._transform.rotation.x = t * L.DEGREES_TO_RADIANS), this._transform.invalidateMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rotationY", { get: function () { return this._transform.rotation.y * L.RADIANS_TO_DEGREES; }, set: function (t) { this.rotationY != t && ((this._transform.rotation.y = t * L.DEGREES_TO_RADIANS), this._transform.invalidateMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rotationZ", { get: function () { return this._transform.rotation.z * L.RADIANS_TO_DEGREES; }, set: function (t) { this.rotationZ != t && ((this._transform.rotation.z = t * L.DEGREES_TO_RADIANS), this._transform.invalidateMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scale9Grid", { get: function () { return this._scale9Grid; }, set: function (t) { (this._scale9Grid = t), this._invalidateHierarchicalProperty(Lt.SCALE9); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scaleX", { get: function () { return this._transform.scale.x; }, set: function (t) { this._setScaleX(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scaleY", { get: function () { return this._transform.scale.y; }, set: function (t) { this._setScaleY(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scaleZ", { get: function () { return this._transform.scale.z; }, set: function (t) { this._setScaleZ(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "skewX", { get: function () { return this._transform.skew.x; }, set: function (t) { this.skewX != t && ((this._transform.skew.x = t), this._transform.invalidateMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "skewY", { get: function () { return this._transform.skew.y; }, set: function (t) { this.skewY != t && ((this._transform.skew.y = t), this._transform.invalidateMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "skewZ", { get: function () { return this._transform.skew.z; }, set: function (t) { this.skewZ != t && ((this._transform.skew.z = t), this._transform.invalidateMatrix3D()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scrollRect", { get: function () { return this._scrollRect; }, set: function (t) { if (((this._scrollRect = t), !t && this._scrollRectPrimitive)) { var e = this.masks.indexOf(this._scrollRectPrimitive); this.masks.splice(e, 1), (this._scrollRectPrimitive = null); } this._transform.invalidatePosition(), (this._scrollRectPrimitiveDirty = !0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "material", { get: function () { return this._material; }, set: function (t) { this._material != t && ((this._material = t), this._invalidateMaterial()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "style", { get: function () { return this._style; }, set: function (t) { this._style != t && (this._style && this._style.removeEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidatePropertiesDelegate ), (this._style = t), this._style && this._style.addEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidatePropertiesDelegate ), this._invalidateStyle()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "boundsVisible", { get: function () { return this._boundsVisible; }, set: function (t) { t != this._boundsVisible && ((this._boundsVisible = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), (n.prototype.getScrollRectPrimitive = function () { return ( this._scrollRectPrimitiveDirty && ((this._scrollRectPrimitiveDirty = !1), this._scrollRectPrimitive || ((this._scrollRectPrimitive = new ru()), (this._scrollRectPrimitive.maskMode = !0), this.masks || (this.masks = []), this.masks.push(this._scrollRectPrimitive)), this._scrollRectPrimitive.graphics.clear(), this._scrollRectPrimitive.graphics.beginFill(255, 1), this._scrollRectPrimitive.graphics.drawRect( 0, 0, this._scrollRect.width, this._scrollRect.height ), this._scrollRectPrimitive.graphics.endFill()), this._scrollRectPrimitive ); }), (n.prototype.getBoundsPrimitive = function (t) { if (null == this._boundsPrimitive) { switch (this._defaultBoundingVolume) { case Dt.BOX: case Dt.BOX_BOUNDS: case Dt.BOX_BOUNDS_FAST: case Dt.BOX_FAST: (this._boundsPrefab = new $s(null, xo.LINE)), (this._boundsPrimitive = this._boundsPrefab.getNewObject()); break; case Dt.SPHERE: case Dt.SPHERE_BOUNDS: case Dt.SPHERE_BOUNDS_FAST: case Dt.SPHERE_FAST: (this._boundsPrefab = new Zs(null, xo.LINE)), (this._boundsPrimitive = this._boundsPrefab.getNewObject()); } this._boundsPrefabDirty = !0; } return ( this._boundsPrefabDirty && this._updateBoundsPrefab(t), this._boundsPrimitive ); }), Object.defineProperty(n.prototype, "transform", { get: function () { return this._transform; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "visible", { get: function () { return this._visible; }, set: function (t) { this._visible != t && ((this._visible = t), this._invalidateHierarchicalProperty(Lt.VISIBLE)); }, enumerable: !0, configurable: !0, }), (n.prototype._mergeMasks = function (t, e) { if (!t && !e) return null; if (!t && e) return (e.maskMode = !0), [e]; e && !t.includes(e) && t.push(e); for (var n = t.length - 1; n >= 0; n--) { var r = t[n]; r ? (r.maskMode = !0) : (console.warn( "[DisplayObject] Timeline mask has null value, skipping it" ), t.splice(n, 1)); } return t; }), Object.defineProperty(n.prototype, "scriptMask", { get: function () { return this._scriptMask; }, set: function (t) { if (t !== this._scriptMask) { if (this._scriptMask) { var e = this._masks.indexOf(this._scriptMask); -1 !== e && this._masks.splice(e, 1); } (this._scriptMask = t), (this._masks = this._mergeMasks(this._masks, t)), this._invalidateHierarchicalProperty(Lt.MASKS); } }, enumerable: !0, configurable: !0, }), (n.prototype.updateTimelineMask = function (t) { (this._masks = this._mergeMasks(t, this._scriptMask)), this._invalidateHierarchicalProperty(Lt.MASKS); }), Object.defineProperty(n.prototype, "masks", { get: function () { return this._masks; }, set: function (t) { if (this._masks != t) { if (((this._masks = t), t && t.length)) { for (var e = t.length, n = !1, r = 0; r < e; r++) (t[r].maskMode = !0), (n = n || t[r] === this._scriptMask); this._scriptMask && !n && (this._scriptMask = null); } else this._scriptMask = null; this._invalidateHierarchicalProperty(Lt.MASKS); } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "x", { get: function () { return this._transform.position.x; }, set: function (t) { this._transform.position.x != t && ((this._transform.matrix3D._rawData[12] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "y", { get: function () { return this._transform.position.y; }, set: function (t) { this._transform.position.y != t && ((this._transform.matrix3D._rawData[13] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "z", { get: function () { return this._transform.position.z; }, set: function (t) { this._transform.position.z != t && ((this._transform.matrix3D._rawData[14] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), (n.prototype.advanceFrame = function () {}), (n.prototype.isEntity = function () { return !1; }), (n.prototype.clone = function () { var t = new n(); return this.copyTo(t), t; }), (n.prototype.copyTo = function (t) { var e; (t.defaultBoundingVolume = this._defaultBoundingVolume), this._registrationMatrix3D && (t._registrationMatrix3D = this._registrationMatrix3D.clone()), (t.material = this._material), (t.style = this._style), (t.pickObject = this._pickObject), (t.pickObjectFromTimeline = this.pickObjectFromTimeline), (t.boundsVisible = this._boundsVisible), (t.name = this._pName), (t.mouseEnabled = this._mouseEnabled), (t.extra = this.extra), (t.maskMode = this._maskMode), (t.castsShadows = this.castsShadows), (t.assetNamespace = this.assetNamespace), (t._symbol = this._symbol), (t.avm1Symbol = this.avm1Symbol), (t.isAVMScene = this.isAVMScene), (t.isSlice9ScaledMC = this.isSlice9ScaledMC), (t.scale9Grid = null === (e = this.scale9Grid) || void 0 === e ? void 0 : e.clone()), this._masks && ((t._masks = this._masks.slice()), (t._scriptMask = this._scriptMask), t._invalidateHierarchicalProperty(Lt.MASKS)), this._transform.copyRawDataTo(t._transform); }), (n.prototype.dispose = function () { this.disposeValues(); }), (n.prototype.disposeValues = function () { this._parent && this._parent.removeChild(this), (this.material = null), this._adapter && (this._adapter.dispose(), (this._adapter = null)), (this._pickObject = null), (this._masks = null), (this._scriptMask = null); }), (n.prototype.lookAt = function (t, e) { void 0 === e && (e = null), this.transform.lookAt(t, e); }), (n.prototype.movePivot = function (t, e, n) { (0 == t && 0 == e && 0 == n) || (this._registrationMatrix3D || (this._registrationMatrix3D = new F()), (this._registrationMatrix3D._rawData[12] -= t / this._transform.scale.x), (this._registrationMatrix3D._rawData[13] -= e / this._transform.scale.y), (this._registrationMatrix3D._rawData[14] -= n / this._transform.scale.z), this._invalidateHierarchicalProperty(Lt.SCENE_TRANSFORM)); }), (n.prototype.reset = function () { (this.visible = !0), this.noTimelineUpdate || this._transform.clearMatrix3D(), this._transform.clearColorTransform(), (this.masks = null), (this.maskMode = !1); }), (n.prototype.isOnDisplayList = function () { for (var t = this; t; ) { if (t.isAVMScene) return !0; t = t.parent; } return !1; }), (n.prototype._setParent = function (t) { this._parent = t; }), (n.prototype._invalidateHierarchicalProperty = function (t) { this.dispatchEvent(new ce(ce.INVALIDATE_PROPERTY, t)); }), (n.prototype._invalidateEntity = function () { this.dispatchEvent(new le(le.INVALIDATE_ENTITY, this)); }), (n.prototype._clearEntity = function () { this.dispatchEvent(new le(le.CLEAR_ENTITY, this)); }), (n.prototype._iInternalUpdate = function () { this._iController && this._iController.update(); }), Object.defineProperty(n.prototype, "maskId", { get: function () { return this._maskId; }, enumerable: !0, configurable: !0, }), (n.prototype._acceptTraverser = function (t) {}), (n.prototype._setScaleX = function (t) { this.scaleX != t && ((this._transform.scale.x = t), this._transform.invalidateMatrix3D()); }), (n.prototype._setScaleY = function (t) { this.scaleY != t && ((this._transform.scale.y = t), this._transform.invalidateMatrix3D()); }), (n.prototype._setScaleZ = function (t) { this.scaleZ != t && ((this._transform.scale.z = t), this._transform.invalidateMatrix3D()); }), (n.prototype._updateBoundsPrefab = function (t) { if (this._boundsPrefab instanceof $s) { var e = t .getBoundingVolume(null, this._defaultBoundingVolume) .getBox(); if (null == e) return; (this._boundsPrefab.width = e.width), (this._boundsPrefab.height = e.height), (this._boundsPrefab.depth = e.depth), (this._boundsPrimitive.registrationPoint = new B( -(e.x + e.width / 2) * this._boundsPrimitive.transform.scale.x, -(e.y + e.height / 2) * this._boundsPrimitive.transform.scale.y, -(e.z + e.depth / 2) * this._boundsPrimitive.transform.scale.z )); } else if (this._boundsPrefab instanceof Zs) { var n = t .getBoundingVolume(null, this._defaultBoundingVolume) .getSphere(); if (null == n) return; (this._boundsPrefab.radius = n.radius), (this._boundsPrimitive.registrationPoint = new B( -n.x * this._boundsPrimitive.transform.scale.x, -n.y * this._boundsPrimitive.transform.scale.y, -n.z * this._boundsPrimitive.transform.scale.z )); } }), (n.prototype._updateMaskMode = function () { this._maskMode && ((this._mouseEnabled = !1), (this.partitionClass = vi)), this._invalidateHierarchicalProperty(Lt.MASK_ID); }), (n.prototype._invalidateMaterial = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_MATERIAL, this)); }), (n.prototype._invalidateStyle = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_STYLE, this)); }), (n.prototype.invalidateElements = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_ELEMENTS, this)); }), (n.prototype._onInvalidateProperties = function (t) { this._invalidateStyle(); }), (n.prototype._getDefaultBoundingVolume = function () { return Dt.BOX_BOUNDS_FAST; }), (n.focusEvent = new Ws(Ws.FOCUS_IN)), n ); })(f), nu = (function (t) { function n() { var e = t.call(this) || this; return ( (e._mouseChildren = !0), (e._children = new Array()), (e.doingSwap = !1), (e.tabChildren = !1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.dispatchFrameEvents = function (t) { this.dispatchEvent(t[0]); for (var e = this._children.length; e > 0; ) e--, this._children[e].dispatchFrameEvents(t); this.dispatchEvent(t[1]); }), (n.prototype.dispatchEnterFrame = function (t) { for (var e = this._children.length; e > 0; ) --e < this._children.length && this._children[e].dispatchEnterFrame(t); this.dispatchEvent(t); }), (n.prototype.dispatchExitFrame = function (t) { for (var e = this._children.length; e > 0; ) --e < this._children.length && this._children[e].dispatchExitFrame(t); this.dispatchEvent(t); }), Object.defineProperty(n.prototype, "mouseChildren", { get: function () { return this._mouseChildren; }, set: function (t) { this._mouseChildren != t && ((this._mouseChildren = t), this._invalidateHierarchicalProperty(Lt.MOUSE_ENABLED)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "animator", { get: function () { return this._animator; }, set: function (t) { this._animator && this._animator.removeOwner(this), (this._animator = t), this._animator && this._animator.addOwner(this); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numChildren", { get: function () { return this._children.length; }, enumerable: !0, configurable: !0, }), (n.prototype.advanceFrame = function () { for (var t = 0; t < this._children.length; t++) this._children[t].advanceFrame(); }), (n.prototype.addChild = function (t) { return this.addChildAt(t, this._children.length); }), (n.prototype.addChildAt = function (t, e) { return ( t.parent && t.parent.removeChild(t), this._children.splice(e, 0, t), t._setParent(this), this.dispatchEvent(new le(le.ADD_CHILD_AT, t, e)), t ); }), (n.prototype.addChildren = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for (var n = t.length, r = 0; r < n; r++) this.addChild(t[r]); }), (n.prototype.clone = function () { var t = new n(); return this.copyTo(t), t; }), (n.prototype.copyTo = function (e) { t.prototype.copyTo.call(this, e), (e.mouseChildren = this._mouseChildren), this._animator && (e.animator = this._animator.clone()); for (var n = this._children.length, r = 0; r < n; ++r) { var i = this._children[r].adapter.clone().adaptee; e.addChild(i); } }), (n.prototype.contains = function (t) { return this._children.indexOf(t) >= 0; }), (n.prototype.disposeValues = function () { this._animator && this._animator.dispose(); for (var e = this._children.length - 1; e >= 0; e--) this.removeChild(this._children[e]); t.prototype.disposeValues.call(this); }), (n.prototype.getChildAt = function (t) { var e = this._children[t]; if (null == e) throw new j("Index does not exist in the child list of the caller"); return e; }), (n.prototype.getChildByName = function (t) { for (var e = this._children.length, n = 0; n < e; ++n) if (this._children[n].name == t) return this._children[n]; return null; }), (n.prototype.getChildIndex = function (t) { var e = this._children.indexOf(t); if (-1 == e) throw n.NO_CHILD_ERROR; return e; }), (n.prototype.getObjectsUnderPoint = function (t) { return new Array(); }), (n.prototype.removeChild = function (t) { if (null == t) throw new T("Parameter child cannot be null"); return this.removeChildAt(this.getChildIndex(t)), t; }), (n.prototype.removeChildAt = function (t) { return this.removeChildAtInternal(t); }), (n.prototype.removeChildren = function (t, e) { if ( (void 0 === t && (t = 0), void 0 === e && (e = 2147483647), t < 0) ) throw new j("beginIndex is out of range of the child list"); if (e > this._children.length) throw new j("endIndex is out of range of the child list"); for (var n = e - 1; n >= t; n--) this.removeChildAtInternal(n); }), (n.prototype.setChildIndex = function (t, e) { var n = this.getChildIndex(t); if (n < 0) throw new T("Parameter child must be child of this object"); if (e > this._children.length) throw new j("Parameter index is out of range of the child list"); n != e && (this.removeChildAt(n), this.addChildAt(t, n < e ? e - 1 : e), t._sessionID >= 0 && this._sessionID_childs && (delete this._sessionID_childs[t._sessionID], (t._sessionID = -1))); }), (n.prototype.swapChildren = function (t, e) { t.parent == this && e.parent == this && this.swapChildrenAt(this.getChildIndex(t), this.getChildIndex(e)); }), (n.prototype.swapChildrenAt = function (t, e) { if (t != e) { if (t >= this._children.length || e >= this._children.length) throw "[scene/DisplayobjectContainer] - swapChildrenAt - Range Error"; var n, r; t < e ? ((r = this.removeChildAt(e)), (n = this.removeChildAt(t)), this.addChildAt(r, t), this.addChildAt(n, e)) : ((n = this.removeChildAt(t)), (r = this.removeChildAt(e)), this.addChildAt(n, e), this.addChildAt(r, t)), this._sessionID_childs && (this._children[t]._sessionID >= 0 && (delete this._sessionID_childs[this._children[t]._sessionID], this._children[t]._sessionID, this._children[t]._avmDepthID), this._children[e]._sessionID >= 0 && (delete this._sessionID_childs[this._children[e]._sessionID], this._children[e]._sessionID, this._children[t]._avmDepthID)); } }), (n.prototype.removeChildAtInternal = function (t) { var e = this._children.splice(t, 1)[0]; return ( e._setParent(null), this.dispatchEvent(new le(le.REMOVE_CHILD_AT, e, t)), e ); }), (n.prototype._updateMaskMode = function () { this.maskMode && (this.mouseChildren = !1), t.prototype._updateMaskMode.call(this); }), (n.assetType = "[asset DisplayObjectContainer]"), (n.NO_CHILD_ERROR = new T( "Child parameter is not a child of the caller" )), n ); })(eu); Ai.registerAbstraction(bi, nu); var ru = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this) || this; return ( (r._isEntity = !1), (r._onGraphicsInvalidateDelegate = function (t) { return r._onGraphicsInvalidate(t); }), (r.graphics = e || qs.getGraphics()), (r.material = n), r ); } return ( e(n, t), (n.getNewSprite = function (t, e) { if ( (void 0 === t && (t = null), void 0 === e && (e = null), n._sprites.length) ) { var r = n._sprites.pop(); return (r.graphics = t || qs.getGraphics()), (r.material = e), r; } return new n(t, e); }), (n.clearPool = function () { n._sprites = []; }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "graphics", { get: function () { return ( this._iSourcePrefab && this._iSourcePrefab._iValidate(), this._graphics ); }, set: function (t) { if (null == t) throw new Error("Cannot have graphics set to null"); this._setGraphics(t); }, enumerable: !0, configurable: !0, }), (n.prototype._setGraphics = function (t) { this._graphics != t && (this._graphics && (this._graphics.removeEventListener( c.INVALIDATE, this._onGraphicsInvalidateDelegate ), this._graphics.usages--), (this._graphics = t), this._graphics.usages++, this._onGraphicsInvalidate(null)); }), (n.prototype._setParent = function (e) { t.prototype._setParent.call(this, e), e ? this._graphics.addEventListener( c.INVALIDATE, this._onGraphicsInvalidateDelegate ) : this._graphics.removeEventListener( c.INVALIDATE, this._onGraphicsInvalidateDelegate ); }), (n.prototype.isEntity = function () { return this._graphics && this._graphics.count > 0; }), (n.prototype.dispose = function () { this.disposeValues(), n._sprites.push(this); }), (n.prototype.disposeValues = function () { t.prototype.disposeValues.call(this); }), (n.prototype.clone = function () { var t = n.getNewSprite(); return this.copyTo(t), t; }), (n.prototype.copyTo = function (e, n) { void 0 === n && (n = !1), t.prototype.copyTo.call(this, e), (e._iSourcePrefab = this._iSourcePrefab), this._graphics.copyTo(e._graphics, n); }), (n.prototype._iInternalUpdate = function () { t.prototype._iInternalUpdate.call(this); }), (n.prototype._onGraphicsInvalidate = function (t) { var e = this.isEntity(); this._isEntity != e && (e || this._clearEntity(), (this._isEntity = e)), this.invalidate(); }), (n.prototype._acceptTraverser = function (e) { t.prototype._acceptTraverser.call(this, e), this.graphics._acceptTraverser(e); }), (n.prototype.bakeTransformations = function () { this._graphics.applyTransformation(this.transform.matrix3D), this.transform.clearMatrix3D(); }), (n._sprites = new Array()), (n.assetType = "[asset Sprite]"), n ); })(nu); Ai.registerAbstraction(bi, ru); var iu = Object.create(null); function ou(t, e) { void 0 === e && (e = ""); var n = iu[t._id + e]; return ( (iu[t._id + e] = !0), n || console.warn("[MorphSprite] - id", t.id, e, t), !n ); } var au, su = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return (e._frameCaches = {}), e; } return ( e(n, t), (n.getNewMorphSprite = function (t, e) { if ( (void 0 === t && (t = null), void 0 === e && (e = null), n._morphSprites.length) ) { var r = n._morphSprites.pop(); return (r.graphics = t || qs.getGraphics()), (r.material = e), r; } return new n(t, e); }), (n.prototype._setGraphics = function (t) { this._graphics != t && (this._graphics && (this._graphics.removeEventListener( c.INVALIDATE, this._onGraphicsInvalidateDelegate ), this._graphics.usages--), this._graphics || (this._graphics = qs.getGraphics()), this._graphics.copyFrom(t), this._onGraphicsInvalidate(null)); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.reset = function () { t.prototype.reset.call(this), this.setRatio(0); }), (n.prototype._blendStyle = function (t, e, n, r) { var i, o, a, s = 1 - r, u = r, l = t.style.fillStyle, c = e.style.fillStyle; if (t.style.data_type != e.style.data_type) throw "Error in morph data - different styles of pathes"; switch (l.data_type) { case ns.data_type: var h = c; (o = s * (v = l).alpha + u * h.alpha), (i = w.interpolateFloat32Color(v.color, h.color, r)), (a = new ns(i, o)); break; case ts.data_type: for ( var p = [], d = [], f = [], g = ((h = c), (v = l).colors.length), _ = 0; _ < g; _++ ) (p[p.length] = w.interpolateFloat32Color( v.colors[_], h.colors[_], r )), (f[f.length] = s * v.alphas[_] + u * h.alphas[_]), (d[d.length] = s * v.ratios[_] + u * h.ratios[_]); var m = v.matrix, y = h.matrix; ((A = new O()).a = m.a * s + y.a * u), (A.b = m.b * s + y.b * u), (A.c = m.c * s + y.c * u), (A.d = m.d * s + y.d * u), (A.tx = m.tx * s + y.tx * u), (A.ty = m.ty * s + y.ty * u), (a = new ts( v.type, p, f, d, A, v.spreadMethod, v.interpolationMethod, v.focalPointRatio )); break; case es.data_type: var A; (h = c), (m = (v = l).matrix), (y = h.matrix); ((A = new O()).a = m.a * s + y.a * u), (A.b = m.b * s + y.b * u), (A.c = m.c * s + y.c * u), (A.d = m.d * s + y.d * u), (A.tx = m.tx * s + y.tx * u), (A.ty = m.ty * s + y.ty * u), (a = new es(v.material, A, v.repeat, v.smooth)); } if (t.style.data_type === os.data_type) { var v = t.style, b = ((h = e.style), s * v.thickness + u * h.thickness); n.style = new os( a, b, v.jointstyle, v.capstyle, v.miterLimit, v.scaleMode ); } else n.style = new Za(a); }), (n.prototype._blendContours = function (t, e, n, r) { var i = 1 - r, o = r, a = t._commands.length; if (e._commands.length !== a) throw "Error in morph data - different number of contour"; for (var s = 0; s < a; s++) { var u = t._commands[s], l = t._data[s], c = e._commands[s], h = e._data[s], p = 0, d = 0, f = 0, g = 0, _ = 0, m = 0, y = u.length; if (c.length != y) return ( (y = Math.min(c.length, y)), void ou(this, "different number of commands in contour") ); for (var A = 0; A < y; A++) switch (u[A]) { case Us.MOVE_TO: if (c[A] != Us.MOVE_TO) throw "Error in morph data - both shapes must start with Move too command"; (f = l[p++]), (g = l[p++]), (_ = h[d++]), (m = h[d++]), n.moveTo(i * f + o * _, i * g + o * m); break; case Us.LINE_TO: if (c[A] == Us.LINE_TO) (f = l[p++]), (g = l[p++]), (_ = h[d++]), (m = h[d++]), n.lineTo(i * f + o * _, i * g + o * m); else if (c[A] == Us.CURVE_TO) { var v = f + (l[p++] - f) / 2, b = g + (l[p++] - g) / 2; n.curveTo( i * v + o * h[d++], i * b + o * h[d++], i * l[p - 2] + o * h[d++], i * l[p - 1] + o * h[d++] ), (f = l[p - 2]), (g = l[p - 1]), (_ = h[d - 2]), (m = h[d - 1]); } break; case Us.CURVE_TO: if (c[A] == Us.LINE_TO) { (v = _ + (h[d++] - _) / 2), (b = m + (h[d++] - m) / 2); n.curveTo( i * l[p++] + o * v, i * l[p++] + o * b, i * l[p++] + o * h[d - 2], i * l[p++] + o * h[d - 1] ), (f = l[p - 2]), (g = l[p - 1]), (_ = h[d - 2]), (m = h[d - 1]); } else c[A] == Us.CURVE_TO && (n.curveTo( i * l[p++] + o * h[d++], i * l[p++] + o * h[d++], i * l[p++] + o * h[d++], i * l[p++] + o * h[d++] ), (f = l[p - 2]), (g = l[p - 1]), (_ = h[d - 2]), (m = h[d - 1])); } } }), (n.prototype.setRatio = function (t) { var e = (65535 * t) | 0, n = this._graphics; if (this._ratio !== e) { if ( ((this._ratio = e), n.buildQueueTags ? n.buildQueueTags(!0) : (n.endFill(), n.clear()), n.start.length !== n.end.length) ) throw "Error in morph data - different number of pathes"; for (var r = n.start.length, i = 0; i < r; i++) { var o = new Qs(), a = n.start[i], s = n.end[i]; this._blendStyle(a, s, o, t), this._blendContours(a, s, o, t), n.add_queued_path(o); } n._endFillInternal(!0); } }), (n.prototype.dispose = function () { this.disposeValues(), (this._frameCaches = {}), n._morphSprites.push(this); }), (n.prototype.clone = function () { var t = n.getNewMorphSprite(); return this.copyTo(t), t; }), (n.assetType = "[asset MorphSprite]"), (n._morphSprites = new Array()), n ); })(ru); Ai.registerAbstraction(bi, su); var uu = [ "", dn.NORMAL, dn.LAYER, dn.MULTIPLY, dn.SCREEN, dn.LIGHTEN, dn.DARKEN, dn.DIFFERENCE, dn.ADD, dn.SUBTRACT, dn.INVERT, dn.ALPHA, dn.ERASE, dn.OVERLAY, dn.HARDLIGHT, ]; var lu = (function () { function t() { (this._update_indices = []), (this._update_frames = []), (this.isButton = !1), (this._initalMcID = -1), (this.numKeyFrames = 0), (this.keyframe_indices = []), (this.avm1Exports = {}), (this.avm1InitActions = {}), (this.avm1ButtonActions = []), (this.graphicsPool = {}), (this.audioPool = {}), (this.placeObjectTagsForSessionIDs = {}), (this._labels = {}), (this._framescripts = {}), (this._framescripts_translated = {}), (this.keyframe_to_frameidx = {}); } return ( Object.defineProperty(t.prototype, "symbolDecoder", { get: function () { return this._symbolDecoder; }, set: function (t) { this._symbolDecoder = t; }, enumerable: !0, configurable: !0, }), (t.prototype.resetScripts = function () { (this._framescripts = {}), (this._framescripts_translated = {}); }), (t.prototype.init = function () { if ( (this._symbolDecoder || console.warn("[Timeline] - init - no _symbolDecoder is set"), null != this.frame_command_indices && null != this.frame_recipe && null != this.keyframe_durations) ) { var t = 0, e = 0, n = 0, r = 0, i = 0, o = 0; (this.keyframe_firstframes = []), (this.keyframe_constructframes = []), (this.keyframe_indices = []), (this.keyframe_to_frameidx = {}), (this.keyframe_to_frameidx[0] = 0); var a = 0; for (e = 0; e < this.numKeyFrames; e++) for ( this.keyframe_to_frameidx[e] = a, a += r = this.keyframe_durations[e], 1 & this.frame_recipe[e] && (o = i), this.keyframe_firstframes[i] = t, this.keyframe_constructframes[i++] = o, n = 0; n < r; n++ ) this.keyframe_indices[t++] = e; } }), (t.prototype.get_framescript = function (t) { if (null == this._framescripts[t]) return ""; if ("string" == typeof this._framescripts[t]) return this._framescripts[t]; throw new Error("Framescript is already translated to Function!!!"); }), (t.prototype.add_framescript = function (t, e, n, r) { if ( (void 0 === r && (r = !1), !(this._initalMcID >= 0 && n.id != this._initalMcID)) ) { if ( ((this._initalMcID = n.id), this._framescripts[e] || (this._framescripts[e] = []), Array.isArray(t)) ) for (var i = 0; i < t.length; i++) this._framescripts[e][this._framescripts[e].length] = t[i]; else this._framescripts[e].push(t); this._framescripts_translated[e] = !r; } }), (t.prototype.get_script_for_frame = function (t, e, n) { if ((void 0 === n && (n = !1), e >= 0 && this._framescripts[e])) { if (n && !this._framescripts_translated[e]) { var r = t.className ? t.className : t.name; (this._framescripts[e] = this.symbolDecoder.prepareFrameScriptsForAVM1( this._framescripts[e], e, r, t.id )), (this._framescripts_translated[e] = !0); } return this._framescripts[e]; } return null; }), Object.defineProperty(t.prototype, "numFrames", { get: function () { return this.keyframe_indices.length; }, enumerable: !0, configurable: !0, }), (t.prototype.getKeyframeIndexForFrameIndex = function (t) { return this.keyframe_indices[t]; }), (t.prototype.getChildInstance = function (t, e) { return this.symbolDecoder.createChildInstanceForTimeline(this, t, e); }), (t.prototype.extractHitArea = function (t) { t.reset(!1), this.gotoFrame(t, this.numFrames - 1, !1); for (var e, n, r = t.numChildren, i = new nu(); r > 0; ) r--, ((e = (n = t.getChildAt(r)).clone()).x = n.x), (e.scaleX = n.scaleX), (e.y = n.y), (e.scaleY = n.scaleY), (e.rotationZ = n.rotationZ), i.addChild(e); return ( (i.pickObjectFromTimeline = !0), (t.pickObject = i), t.reset(!1), i ); }), (t.prototype.getCurrentFrameLabel = function (t) { var e = this.keyframe_to_frameidx[t.constructedKeyFrameIndex]; for (var n in this._labels) if ( this._labels[n].keyFrameIndex == t.constructedKeyFrameIndex && e == t.currentFrameIndex ) return this._labels[n].name; return null; }), (t.prototype.getCurrentLabel = function (t) { var e = null, n = -1; for (var r in this._labels) { var i = this._labels[r].keyFrameIndex; i > n && i <= t.constructedKeyFrameIndex && ((n = i), (e = this._labels[r].name)); } return e; }), (t.prototype.jumpToLabel = function (t, e, n) { if ((void 0 === n && (n = 0), this._labels[e])) { var r = this._labels[e].keyFrameIndex; r >= 0 && (t.currentFrameIndex = this.keyframe_firstframes[r] + n); } else console.warn( "[TIMELINE] - jumpToLabel with invalid label", t, e, n ); }), (t.prototype.getScriptForLabel = function (t, e, n) { void 0 === n && (n = !1); var r = this._labels[e.toLowerCase()].keyFrameIndex; if (r < 0) return null; var i = this.keyframe_firstframes[r]; return i >= 0 && this._framescripts[i] ? this.get_script_for_frame(t, i, n) : null; }), (t.prototype.gotoFrame = function (t, e, n, r, i) { void 0 === n && (n = !0), void 0 === r && (r = !1), void 0 === i && (i = !1); var o = t.constructedKeyFrameIndex, a = this.keyframe_indices[e]; if (o != a || i) if (o + 1 != a) { var s = this.keyframe_constructframes[a], u = s, l = a > o; l && o > s && (u = o + 1), t.adapter.constructFrame(this, u, a, l, e, r, n), this.applyCollectedUpdateCommands(t), (t.constructedKeyFrameIndex = a); } else this.constructNextFrame(t, n, !0); else t.adapter.queueFrameScripts(this, e, n); }), (t.prototype.applyCollectedUpdateCommands = function (t) { var e, n = this._update_indices.length; for (e = 0; e < n; e++) this.update_childs( t, this._update_indices[e], this._update_frames[e] ); }), (t.prototype.constructNextFrame = function (t, e, n) { void 0 === e && (e = !0), void 0 === n && (n = !1); var r = t.currentFrameIndex, i = this.keyframe_indices[r]; if ( (e && t.adapter.queueFrameScripts(this, r, n), t.constructedKeyFrameIndex != i) ) { t.constructedKeyFrameIndex = i; var o = this.frame_command_indices[i], a = this.frame_recipe[i]; 1 & a ? t.adapter.removeAllTimelineChilds() : 2 & a && this.remove_childs_continous(t, o++), 4 & a && this.add_childs_continous(t, o++), 8 & a && this.update_childs(t, o++), 16 & a && this.start_sounds(t, o++); } }), (t.prototype.remove_childs_continous = function (t, e) { for ( var n = this.command_index_stream[e], r = n + this.command_length_stream[e], i = n; i < r; i++ ) t.adapter.removeTimelineChildAt(this.remove_child_stream[i]); }), (t.prototype.add_childs_continous = function (t, e) { for ( var n, r = this.command_index_stream[e], i = r + this.command_length_stream[e], o = r; o < i; o++ ) if (((n = 3 * o), void 0 !== this.add_child_stream[n])) { var a = this._symbolDecoder.createChildInstanceForTimeline( this, this.add_child_stream[n + 2], this.add_child_stream[n] ); t.adapter.addTimelineChildAtDepth( a, this.add_child_stream[n + 1] ); } else console.warn( "[Timeline] - add_childs_continous - could not find child-id in child_stream for idx", n, this.add_child_stream ); }), (t.prototype.start_sounds = function (t, e) { for ( var n = this.command_index_stream[e], r = n + this.command_length_stream[e], i = n; i < r; i++ ) { var o = this.audioPool[this.add_sounds_stream[i]]; if (o) if (15 == o.cmd) { var a = o.sound; if (!a) return void console.warn( "[Timeline] Missed sound to start!", o ); t.startSound(o.id, a, o.props.loopCount || 0); } else 16 == o.cmd && t.stopSound(o.id); } }), (t.prototype.update_childs = function (e, n, r) { for ( var i = this.command_index_stream[n], o = i + this.command_length_stream[n], a = i; a < o; a++ ) { var s = e.getTimelineChildAtSessionID(this.update_child_stream[a]); if (s) { this._blocked = !(!s._adapter || !s.adapter.isBlockedByScript()); for ( var u = this.update_child_props_indices_stream[a], l = u + this.update_child_props_length_stream[a], c = u; c < l; c++ ) t.applyFunctionMap[this.property_type_stream[c]]( this, s, e, this.property_index_stream[c] ); } } }), (t.update_mtx_all = function (t, e, n, r) { if (!t._blocked && !e.noTimelineUpdate) { r *= 6; var i = e.transform.matrix3D, o = t.properties_stream_f32_mtx_all; (i._rawData[0] = o[r++]), (i._rawData[1] = o[r++]), (i._rawData[4] = o[r++]), (i._rawData[5] = o[r++]), (i._rawData[12] = o[r++]), (i._rawData[13] = o[r]), e.transform.invalidateComponents(); } }), (t.update_colortransform = function (t, e, n, r) { if (!e._adapter || !e.adapter.isColorTransformByScript()) { r *= 8; var i = t.properties_stream_f32_ct, o = e.transform.colorTransform || (e.transform.colorTransform = new S()); (o._rawData[0] = i[r++]), (o._rawData[1] = i[r++]), (o._rawData[2] = i[r++]), (o._rawData[3] = i[r++]), (o._rawData[4] = i[r++]), (o._rawData[5] = i[r++]), (o._rawData[6] = i[r++]), (o._rawData[7] = i[r]), e.transform.invalidateColorTransform(); } }), (t.update_masks = function (t, e, n, r) { var i = [], o = t.properties_stream_int[r++]; if (0 !== o) { for (var a = 0; a < o; a++) i.push( n.getTimelineChildAtSessionID(t.properties_stream_int[r + a]) ); e.updateTimelineMask(i); } else e.updateTimelineMask(null); }), (t.update_name = function (t, e, n, r) { 0 != t.properties_stream_strings[r].indexOf("instance") && (n.adapter.unregisterScriptObject(e), (e.name = t.properties_stream_strings[r]), n.adapter.registerScriptObject(e)); }), (t.update_button_name = function (t, e, n, r) { (e.name = t.properties_stream_strings[r]), e.addButtonListeners(), n.adapter.registerScriptObject(e); }), (t.update_visibility = function (t, e, n, r) { (e._adapter && e.adapter.isVisibilityByScript()) || (e.visible = !!r); }), (t.update_mtx_scale_rot = function (t, e, n, r) { if (!t._blocked && !e.noTimelineUpdate) { r *= 4; var i = e.transform.matrix3D, o = t.properties_stream_f32_mtx_scale_rot; (i._rawData[0] = o[r++]), (i._rawData[1] = o[r++]), (i._rawData[4] = o[r++]), (i._rawData[5] = o[r]), e.transform.invalidateComponents(), e._invalidateHierarchicalProperty(Lt.SCENE_TRANSFORM); } }), (t.update_mtx_pos = function (t, e, n, r) { if (!t._blocked && !e.noTimelineUpdate) { r *= 2; var i = e.transform.matrix3D; (i._rawData[12] = t.properties_stream_f32_mtx_pos[r++]), (i._rawData[13] = t.properties_stream_f32_mtx_pos[r]), e.transform.invalidatePosition(); } }), (t.enable_maskmode = function (t, e, n, r) { e.maskMode = !0; }), (t.remove_masks = function (t, e, n, r) { e.masks = null; }), (t.update_filters = function (t, e, n, r) { var i = t.properties_stream_int[r++], o = t.properties_stream_int[r++], a = e.adapter; 0 !== o ? a.updateFilters(t.properties_stream_filters.slice(i, i + o)) : a.updateFilters(null); }), (t.swap_graphics = function (t, e, n, r) { if (e.isAsset(ru)) { var i = e, o = t.graphicsPool[t.properties_stream_int[r]]; o.id !== i.graphics.id && (i.graphics = o); } else console.warn("[Timeline] - swap_graphics - child is not a Sprite"); }), (t.start_audio = function (t, e, n, r) {}), (t.set_ratio = function (t, e, n, r) { e.isAsset(su) ? e.setRatio(t.properties_stream_int[r] / 65535) : console.warn( "[Timeline] - set_ratio - child is not a MorphSprite" ); }), (t.update_blendmode = function (t, e, n, r) { e.blendMode = (function (t) { return void 0 === t && (t = 1), uu[t] || uu[1]; })(r); }), (t.update_rendermode = function (t, e, n, r) { console.log("update rendermode " + r); }), (t.prototype.dispose = function () { (this.keyframe_indices = []), (this.avm1Exports = {}), (this.avm1InitActions = {}), (this.avm1ButtonActions = []), (this.graphicsPool = {}), (this.audioPool = {}), (this.placeObjectTagsForSessionIDs = {}), (this._labels = {}), (this._framescripts = {}), (this._framescripts_translated = {}); }), (t.applyFunctionMap = (((au = {})[1] = t.update_mtx_all), (au[2] = t.update_colortransform), (au[3] = t.update_masks), (au[4] = t.update_name), (au[5] = t.update_button_name), (au[6] = t.update_visibility), (au[7] = t.update_blendmode), (au[8] = t.update_rendermode), (au[9] = t.update_filters), (au[11] = t.update_mtx_scale_rot), (au[12] = t.update_mtx_pos), (au[200] = t.enable_maskmode), (au[201] = t.remove_masks), (au[202] = t.swap_graphics), (au[203] = t.set_ratio), (au[204] = t.start_audio), au)), t ); })(), cu = (function (t) { function n(e, n, r) { void 0 === r && (r = !1); var i = t.call(this) || this; return ( (i.preserveDimensions = !1), (i._onInvalidateTextureDelegate = function (t) { return i._onInvalidateTexture(t); }), (i.material = e), i._updateDimensions(), i._sampler && (i._sampler.smooth = r), i ); } return ( e(n, t), (n.getNewBillboard = function (t, e, r) { if ( (void 0 === e && (e = "auto"), void 0 === r && (r = !1), n._billboards.length) ) { var i = n._billboards.pop(); return (i.material = t), i; } return new n(t, e, r); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "billboardRect", { get: function () { return this._billboardRect; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "billboardHeight", { get: function () { return this._billboardHeight; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "billboardWidth", { get: function () { return this._billboardWidth; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "material", { get: function () { return this._material; }, set: function (t) { t != this._material && (this._material && this._material.removeEventListener( Bi.INVALIDATE_TEXTURES, this._onInvalidateTextureDelegate ), (this._material = t), this._material && this._material.addEventListener( Bi.INVALIDATE_TEXTURES, this._onInvalidateTextureDelegate ), this._updateDimensions(), this._invalidateMaterial()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "sampler", { get: function () { return this._sampler; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "width", { get: function () { return this._width; }, set: function (t) { this._width != t && ((this._width = t), (this.scaleX = this._width / this._billboardRect.width)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return this._height; }, set: function (t) { this._height != t && ((this._height = t), (this.scaleY = this._height / this._billboardRect.height)); }, enumerable: !0, configurable: !0, }), (n.prototype.advanceFrame = function () {}), (n.prototype.isEntity = function () { return !0; }), (n.prototype.dispose = function () { this.disposeValues(), n._billboards.push(this); }), (n.prototype.clone = function () { var t = n.getNewBillboard(this._material); return this.copyTo(t), t; }), (n.prototype._acceptTraverser = function (t) { if (this.material && this.material.getTextureAt(0)) { var e = this.image; e && !e.isDisposed && t.applyTraversable(this); } }), Object.defineProperty(n.prototype, "image", { get: function () { var t, e; if (!this.material) return null; var n = this.material.getTextureAt(0); if (!n) return null; var r = null === (t = this._style) || void 0 === t ? void 0 : t.getImageAt(n); return ( r || (r = null === (e = this.material.style) || void 0 === e ? void 0 : e.getImageAt(n)) || n.getImageAt(0) ); }, enumerable: !0, configurable: !0, }), (n.prototype._updateDimensions = function () { var t, e, n = this.image; if (n && !n.isDisposed) { var r = this.material.getTextureAt(0); (this._sampler = (null === (t = this._style) || void 0 === t ? void 0 : t.getSamplerAt(r)) || (null === (e = this.material.style) || void 0 === e ? void 0 : e.getSamplerAt(r)) || r.getSamplerAt(0) || Ne.getDefaultSampler()), this._sampler.imageRect ? ((this._billboardWidth = this._sampler.imageRect.width * n.width), (this._billboardHeight = this._sampler.imageRect.height * n.height)) : ((this._billboardWidth = n.rect.width), (this._billboardHeight = n.rect.height)), (this._billboardRect = this._sampler.frameRect || new K(0, 0, this._billboardWidth, this._billboardHeight)); } else (this._billboardWidth = 1), (this._billboardHeight = 1), (this._billboardRect = new K(0, 0, 1, 1)); this.invalidate(), this.invalidateElements(), this.preserveDimensions ? ((this.scaleX = this._width / this._billboardRect.width), (this.scaleY = this._height / this._billboardRect.height)) : ((this._width = this._billboardRect.width * this.scaleX), (this._height = this._billboardRect.height * this.scaleY)); }), (n.prototype._onInvalidateProperties = function (e) { void 0 === e && (e = null), t.prototype._onInvalidateProperties.call(this, e), this._updateDimensions(); }), (n.prototype._onInvalidateTexture = function (t) { this._updateDimensions(); }), (n._billboards = new Array()), (n.assetType = "[asset Billboard]"), n ); })(nu), hu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getStageElements = function () { var t = this._asset, e = t.billboardWidth, r = t.billboardHeight, i = t.billboardRect, o = e.toString() + r.toString() + i.toString(); this._id = o; var a = n._samplerElements[o]; if (!a) { var s = -i.x, u = -i.y, l = e - i.x, c = r - i.y; ((a = n._samplerElements[o] = new ao(new oi(11, 4))).autoDeriveNormals = !1), (a.autoDeriveTangents = !1), a.setPositions([ s, u, 0, l, c, 0, l, u, 0, s, u, 0, s, c, 0, l, c, 0, ]), a.setUVs([0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]); } return a.getAbstraction(this._stage); }), (n.prototype.executeRender = function (e, n, r, i) { void 0 === e && (e = !0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), this._stage.context.setCulling(ie.NONE), t.prototype.executeRender.call(this, e, n, r, i); }), (n.prototype._getRenderMaterial = function () { return ( this._asset.material || Fi.getDefaultColorMaterial() ).getAbstraction( this.renderGroup.getRenderElements(this.stageElements.elements) ); }), (n.prototype._getStyle = function () { return this._asset.style; }), (n._samplerElements = new Object()), n ); })(Vi), pu = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._billboardBoxDirty = !0), (r._onInvalidateElementsDelegate = function (t) { return r._onInvalidateElements(t); }), r._asset.addEventListener( Ri.INVALIDATE_ELEMENTS, r._onInvalidateElementsDelegate ), r ); } return ( e(n, t), (n.prototype._onInvalidateElements = function (t) { this._billboardBoxDirty = !0; }), (n.prototype.onClear = function (e) { this._asset.removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate ), t.prototype.onClear.call(this, e); }), (n.prototype.hitTestPoint = function (t, e, n) { return !0; }), (n.prototype.getBoxBounds = function (t, e, n, r) { if ( (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === r && (r = null), this._billboardBoxDirty) ) { this._billboardBoxDirty = !1; var i = this._asset.billboardRect; this._billboardBox = new M(i.x, i.y, 0, i.width, i.height, 0); } return ( t ? t.transformBox(this._billboardBox) : this._billboardBox ).union(r, r || n); }), (n.prototype.getSphereBounds = function (t, e, n, r, i) { return void 0 === i && (i = null), i; }), (n.prototype.testCollision = function (t, e) { var n = -t.rayPosition.z / t.rayDirection.z, r = new B( t.rayPosition.x + n * t.rayDirection.x, t.rayPosition.y + n * t.rayDirection.y ); return ( (t.traversable = this._asset), (t.rayEntryDistance = n), (t.position = r), (t.normal = new B(0, 0, 1)), !0 ); }), n ); })(Ht); Qi.registerRenderable(hu, cu), zt.registerPickable(pu, cu), Ai.registerAbstraction(bi, cu); var du = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r._camera = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "camera", { get: function () { return this._camera; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._camera); }), (n.PROJECTION_CHANGED = "projectionChanged"), n ); })(l), fu = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._projection = e || new bt()), (n._projection.transform = n._transform), (n.z = -1e3), n ); } return ( e(n, t), (n.prototype.isEntity = function () { return !0; }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "projection", { get: function () { return this._projection; }, set: function (t) { if (this._projection != t) { if (!t) throw new Error("Projection cannot be null!"); (this._projection.transform = null), (this._projection = t), (this._projection.transform = this._transform), this.dispatchEvent(new du(du.PROJECTION_CHANGED, this)); } }, enumerable: !0, configurable: !0, }), (n.prototype.project = function (t, e) { return ( void 0 === e && (e = null), this._projection.project( this._transform.inverseMatrix3D.transformVector(t, e), e ) ); }), (n.prototype.unproject = function (t, e, n, r) { return ( void 0 === r && (r = null), this._transform.matrix3D.transformVector( this._projection.unproject(t, e, n, r) ) ); }), (n.prototype._getDefaultBoundingVolume = function () { return Dt.NULL; }), (n.assetType = "[asset Camera]"), n ); })(nu), gu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), (n.prototype.acceptTraverser = function (t) {}), n; })(bi); Ai.registerAbstraction(gu, fu); var _u = (function (t) { function n(e, n, r, i) { void 0 === i && (i = 1); var o = t.call(this) || this; return ( (o.material = e), (o._startPosition = n), (o._endPosition = r), (o._halfThickness = 0.5 * i), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "startPosition", { get: function () { return this._startPosition; }, set: function (t) { this._startPosition != t && ((this._startPosition = t), this.invalidateElements()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "endPosition", { get: function () { return this._endPosition; }, set: function (t) { this._endPosition != t && ((this._endPosition = t), this.invalidateElements()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "thickness", { get: function () { return 2 * this._halfThickness; }, set: function (t) { this._halfThickness != t && ((this._halfThickness = 0.5 * t), this.invalidateElements()); }, enumerable: !0, configurable: !0, }), (n.prototype.isEntity = function () { return !0; }), (n.prototype._acceptTraverser = function (t) { t.applyTraversable(this); }), (n.assetType = "[asset LineSegment]"), n ); })(eu), mu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getStageElements = function () { var t = n._lineGraphics[this._asset.id] || (n._lineGraphics[this._asset.id] = new So()), e = this._asset.startPosition, r = this._asset.endPosition, i = new Float32Array(6), o = new Float32Array(1); return ( (i[0] = e.x), (i[1] = e.y), (i[2] = e.z), (i[3] = r.x), (i[4] = r.y), (i[5] = r.z), (o[0] = this._asset.thickness), t.setPositions(i), t.setThickness(o), t.getAbstraction(this._stage) ); }), (n.prototype._getRenderMaterial = function () { return ( this._asset.material || Fi.getDefaultColorMaterial() ).getAbstraction( this.renderGroup.getRenderElements(this.stageElements.elements) ); }), (n.prototype._getStyle = function () { return this._asset.style; }), (n._lineGraphics = new Object()), n ); })(Vi), yu = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._lineSegmentBoxDirty = !0), (r._lineSegmentSphereDirty = !0), (r._onInvalidateElementsDelegate = function (t) { return r._onInvalidateElements(t); }), r._asset.addEventListener( Ri.INVALIDATE_ELEMENTS, r._onInvalidateElementsDelegate ), r ); } return ( e(n, t), (n.prototype._onInvalidateElements = function (t) { (this._lineSegmentBoxDirty = !0), (this._lineSegmentSphereDirty = !0); }), (n.prototype.onClear = function (e) { this._asset.removeEventListener( Ri.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate ), t.prototype.onClear.call(this, e); }), (n.prototype.hitTestPoint = function (t, e, n) { return !0; }), (n.prototype.getBoxBounds = function (t, e, n, r) { if ( (void 0 === t && (t = null), void 0 === n && (n = null), void 0 === r && (r = null), this._lineSegmentBoxDirty) ) { this._lineSegmentBoxDirty = !1; var i = this._asset.startPosition, o = this._asset.endPosition; this._lineSegmentBox = new M( Math.min(i.x, o.x), Math.min(i.y, o.y), Math.min(i.z, o.z), Math.abs(i.x - o.x), Math.abs(i.y - o.y), Math.abs(i.z - o.z) ); } return ( t ? t.transformBox(this._lineSegmentBox) : this._lineSegmentBox ).union(r, r || n); }), (n.prototype.getSphereBounds = function (t, e, n, r, i) { if ( (void 0 === e && (e = null), void 0 === r && (r = null), void 0 === i && (i = null), this._lineSegmentSphereDirty) ) { this._lineSegmentSphereDirty = !1; var o = this._asset.startPosition, a = this._asset.endPosition, s = (a.x - o.x) / 2, u = (a.y - o.y) / 2, l = (a.z - o.z) / 2; this._lineSegmentSphere = new R( o.x + s, o.y + u, o.z + l, Math.sqrt(s * s + u * u + l * l) ); } return ( e ? e.transformSphere(this._lineSegmentSphere) : this._lineSegmentSphere ).union(i, i || r); }), (n.prototype.testCollision = function (t, e) { return (t.traversable = null), !1; }), n ); })(Ht); Qi.registerRenderable(mu, _u), zt.registerPickable(yu, _u), Ai.registerAbstraction(bi, _u); var Au = (function (t) { function n(e, n) { var r; void 0 === e && (e = !0), void 0 === n && (n = null); var i = t.call(this) || this; return ( (i._useAssetLib = e), (i._assetLibId = n), (i._onLoaderStartDelegate = function (t) { return i._onLoaderStart(t); }), (i._onLoadProgressDelegate = function (t) { return i._onLoadProgress(t); }), (i._onLoadCompleteDelegate = function (t) { return i._onLoadComplete(t); }), (i._onAssetCompleteDelegate = function (t) { return i._onAssetComplete(t); }), (i._onLoaderCompleteDelegate = function (t) { return i._onLoaderComplete(t); }), (i._onLoadErrorDelegate = function (t) { return i._onLoadError(t); }), (i._onParseErrorDelegate = function (t) { return i._onParseError(t); }), (i._errorDelegateSelector = (((r = {})[H.LOAD_ERROR] = i._onLoadErrorDelegate), (r[Q.PARSE_ERROR] = i._onParseErrorDelegate), r)), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "content", { get: function () { return this._content; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "contentLoader", { get: function () { return this._contentLoader; }, enumerable: !0, configurable: !0, }), (n.prototype.addEventListener = function (e, n) { ((this._contentLoader && e == H.LOAD_ERROR) || e == Q.PARSE_ERROR) && this._contentLoader.addEventListener( e, this._errorDelegateSelector[e] ), t.prototype.addEventListener.call(this, e, n); }), (n.prototype.removeEventListener = function (e, n) { ((this._contentLoader && e == H.LOAD_ERROR) || e == Q.PARSE_ERROR) && this._contentLoader.removeEventListener( e, this._errorDelegateSelector[e] ), t.prototype.removeEventListener.call(this, e, n); }), (n.prototype.close = function () { this._contentLoader && (this._useAssetLib && ht.getInstance(this._assetLibId).stopLoader(this._contentLoader), this._disposeLoader()); }), (n.prototype.load = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), this._getLoader().load(t, e, n, r); }), (n.prototype.loadData = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), this._getLoader().loadData(t, "", e, n, r); }), (n.prototype._getLoader = function () { return ( this._contentLoader && this.close(), (this._contentLoader = this._useAssetLib ? ht.getInstance(this._assetLibId).getLoader() : new ct()), this._contentLoader.addEventListener( V.LOADER_START, this._onLoaderStartDelegate ), this._contentLoader.addEventListener( H.LOAD_PROGRESS, this._onLoadProgressDelegate ), this._contentLoader.addEventListener( H.LOAD_COMPLETE, this._onLoadCompleteDelegate ), this._contentLoader.addEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), this._contentLoader.addEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), this.hasEventListener(H.LOAD_ERROR) && this._contentLoader.addEventListener( H.LOAD_ERROR, this._onLoadErrorDelegate ), this.hasEventListener(Q.PARSE_ERROR) && this._contentLoader.addEventListener( Q.PARSE_ERROR, this._onParseErrorDelegate ), this._contentLoader ); }), (n.prototype._disposeLoader = function () { this._contentLoader.removeEventListener( V.LOADER_START, this._onLoaderStartDelegate ), this._contentLoader.removeEventListener( H.LOAD_PROGRESS, this._onLoadProgressDelegate ), this._contentLoader.removeEventListener( H.LOAD_COMPLETE, this._onLoadCompleteDelegate ), this._contentLoader.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), this._contentLoader.removeEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), this.hasEventListener(H.LOAD_ERROR) && this._contentLoader.removeEventListener( H.LOAD_ERROR, this._onLoadErrorDelegate ), this.hasEventListener(Q.PARSE_ERROR) && this._contentLoader.removeEventListener( Q.PARSE_ERROR, this._onParseErrorDelegate ), this._useAssetLib || this._contentLoader.stop(), (this._contentLoader = null); }), (n.prototype.unload = function () {}), (n.enableParser = function (t) { ct.enableParser(t); }), (n.enableParsers = function (t) { ct.enableParsers(t); }), (n.prototype._onLoaderStart = function (t) { this.dispatchEvent(t); }), (n.prototype._onLoadProgress = function (t) { this.dispatchEvent(t); }), (n.prototype._onLoadComplete = function (t) { this.dispatchEvent(t); }), (n.prototype._onAssetComplete = function (t) { this.dispatchEvent(t); }), (n.prototype._onLoadError = function (t) { return ( !!this.hasEventListener(H.LOAD_ERROR) && (this.dispatchEvent(t), !0) ); }), (n.prototype._onParseError = function (t) { return ( !!this.hasEventListener(Q.PARSE_ERROR) && (this.dispatchEvent(t), !0) ); }), (n.prototype._onLoaderComplete = function (t) { (this._content = t.content), this._content && this.addChild(this._content), this.dispatchEvent(t), this._disposeLoader(); }), n ); })(nu), vu = (function (t) { function n(e) { var n = t.call(this, e) || this; return (n.button = 0), n; } return ( e(n, t), Object.defineProperty(n.prototype, "bubbles", { get: function () { var t = this._iAllowedToPropagate && this._iAllowedToImmediatlyPropagate; return ( (this._iAllowedToPropagate = !0), (this._iAllowedToImmediatlyPropagate = !0), t ); }, enumerable: !0, configurable: !0, }), (n.prototype.stopPropagation = function () { (this._iAllowedToPropagate = !1), this._iParentEvent && this._iParentEvent.stopPropagation(); }), (n.prototype.stopImmediatePropagation = function () { (this._iAllowedToPropagate = !1), (this._iAllowedToImmediatlyPropagate = !1), this._iParentEvent && this._iParentEvent.stopImmediatePropagation(); }), (n.prototype.clone = function () { var t = new n(this.type); return ( (t.screenX = this.screenX), (t.screenY = this.screenY), (t.view = this.view), (t.entityNode = this.entityNode), (t.rootNode = this.rootNode), (t.traversable = this.traversable), (t.material = this.material), (t.uv = this.uv), (t.position = this.position), (t.normal = this.normal), (t.elementIndex = this.elementIndex), (t.delta = this.delta), (t.ctrlKey = this.ctrlKey), (t.shiftKey = this.shiftKey), (t._iParentEvent = this), (t._iAllowedToPropagate = this._iAllowedToPropagate), (t.button = this.button), t ); }), Object.defineProperty(n.prototype, "scenePosition", { get: function () { return this.entityNode.parent .getMatrix3D() .transformVector(this.position); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "sceneNormal", { get: function () { var t = this.entityNode.parent .getMatrix3D() .deltaTransformVector(this.normal); return t.normalize(), t; }, enumerable: !0, configurable: !0, }), (n.MOUSE_OVER = "mouseOver3d"), (n.MOUSE_OUT = "mouseOut3d"), (n.ROLL_OVER = "rollOver3d"), (n.ROLL_OUT = "rollOut3d"), (n.MOUSE_UP = "mouseUp3d"), (n.MOUSE_UP_OUTSIDE = "mouseUpOutside3d"), (n.MOUSE_DOWN = "mouseDown3d"), (n.MOUSE_MOVE = "mouseMove3d"), (n.DRAG_MOVE = "dragMove3d"), (n.DRAG_OUT = "dragOut3d"), (n.DRAG_OVER = "dragOver3d"), (n.DRAG_START = "dragStart3d"), (n.DRAG_STOP = "dragStop3d"), (n.FOCUS_IN = "focusIn3d"), (n.FOCUS_OUT = "focusOut3d"), (n.CLICK = "click3d"), (n.DOUBLE_CLICK = "doubleClick3d"), (n.MOUSE_WHEEL = "mouseWheel3d"), n ); })(l), bu = (function () { function t() {} return ( (t.setInterval = function (t, e) { return ( this._intervalID++, e < 4 && (e = 4), (this._active_intervals[this._intervalID] = { f: t, t: e, dt: 0, isTimeout: !1, }), this._intervalID ); }), (t.setTimeOut = function (t, e) { return ( this._intervalID++, e < 4 && (e = 4), (this._active_intervals[this._intervalID] = { f: t, t: e, dt: 0, isTimeout: !0, }), this._intervalID ); }), (t.clearInterval = function (t) { delete this._active_intervals[t]; }), (t.clearTimeout = function (t) { delete this._active_intervals[t]; }), (t.execute_intervals = function (t) { var e; for (var n in (void 0 === t && (t = 0), this._active_intervals)) for ( (e = this._active_intervals[n]).dt += t; this._active_intervals[n] && e.dt >= e.t; ) (e.dt -= e.t), e.f(), e.isTimeout && delete this._active_intervals[n]; }), (t.add_child_to_dispose = function (t) { this._queued_dispose.push(t); }), (t.get_queue = function () { return ( t._queue || (t._queue = { queued_mcs: [], queued_scripts: [], queued_mcs_pass2: [], queued_scripts_pass2: [], constructors: [], }), t._queue ); }), (t.add_script_to_queue = function (e, n) { var r = t.get_queue(), i = r.queued_mcs_pass2.length, o = 0; for (o = 0; o < i; o++) r.queued_mcs.push(r.queued_mcs_pass2[o]), r.queued_scripts.push(r.queued_scripts_pass2[o]); (r.queued_mcs_pass2.length = 0), (r.queued_scripts_pass2.length = 0), (e.adapter.allowScript = !0), r.queued_mcs.push(e), r.queued_scripts.push(n); }), (t.add_loaded_action_to_queue = function (e) { var n = t.get_queue(); n.queued_mcs.push(e), n.queued_scripts.push(null); }), (t.add_script_to_queue_pass2 = function (e, n) { var r = t.get_queue(); (e.adapter.allowScript = !0), r.queued_mcs_pass2.push(e), r.queued_scripts_pass2.push(n); }), (t.execute_as3_constructors_finish_scene = function (e) { for (var n = 0; n < e.numChildren; n++) { var r = e.getChildAt(n); r.parent && r.adapter.executeConstructor && t.execute_as3_constructors_recursiv(r); } }), (t.execute_as3_constructors_enterFrame = function (e) { t.invalidAS3Constructors && (t.execute_as3_constructors_recursiv(e), (t.invalidAS3Constructors = !1)); }), (t.execute_as3_constructors_recursiv = function (e) { var n = e.adapter, r = n.executeConstructor; if (r) (n.executeConstructor = null), r(); else for (var i = 0; i < e.numChildren; i++) { var o = e.getChildAt(i); o.parent && t.execute_as3_constructors_recursiv(o); } e.just_added_to_timeline && e._sessionID >= 0 && n && n.dispatchStaticEvent && (n.dispatchStaticEvent("added", n), (e.just_added_to_timeline = !1), (e.hasDispatchedAddedToStage = e.isOnDisplayList()), e.hasDispatchedAddedToStage && n.dispatchStaticEvent("addedToStage", n)); }), (t.isOnStage = function (t) { for (var e = t; e && !e.isAVMScene; ) e = e.parent; return !(!e || !e.isAVMScene); }), (t.execute_avm1_constructors = function () { var e = t.get_queue(); if (0 != e.queued_mcs.length || 0 != e.queued_mcs_pass2.length) { for (var n = e.queued_mcs_pass2.length; n > 0; ) n--, e.queued_mcs.push(e.queued_mcs_pass2[n]), e.queued_scripts.push(e.queued_scripts_pass2[n]); (e.queued_mcs_pass2.length = 0), (e.queued_scripts_pass2.length = 0); var r, i = e.queued_mcs; if (t.useAVM1) { for (n = i.length; n > 0; ) if (((r = i[--n]), t.isOnStage(r) && r.onInitialize)) { var o = r.onInitialize; (r.onInitialize = null), o(); } for (n = 0; n < i.length; n++) if (((r = i[n]), t.isOnStage(r))) { if (r.onConstruct) { o = r.onConstruct; (r.onConstruct = null), o(); } var a = r.adapter.executeConstructor; a && ((r.adapter.executeConstructor = null), a()); } } } }), (t.execute_queue = function () { var e = t.get_queue(); if (0 != e.queued_mcs.length || 0 != e.queued_mcs_pass2.length) { var n = e.queued_mcs.concat(), r = e.queued_scripts.concat(); (e.queued_mcs.length = 0), (e.queued_scripts.length = 0); var i, o = e.queued_mcs_pass2.length, a = 0; for (a = 0; a < o; a++) n.push(e.queued_mcs_pass2[a]), r.push(e.queued_scripts_pass2[a]); if ( ((e.queued_mcs_pass2.length = 0), (e.queued_scripts_pass2.length = 0), t.useAVM1) ) { for (a = 0; a < n.length; a++) if (((i = n[a]), t.isOnStage(i) && i.onInitialize)) { var s = i.onInitialize; (i.onInitialize = null), s(); } for (a = 0; a < n.length; a++) if (((i = n[a]), t.isOnStage(i))) { if (i.onConstruct) { s = i.onConstruct; (i.onConstruct = null), s(); } var u = i.adapter.executeConstructor; u && ((i.adapter.executeConstructor = null), u()); } } for (a = 0; a < n.length; a++) { if (((i = n[a]), t.useAVM1)) { if (!t.isOnStage(i)) continue; if (i.onLoaded) { s = i.onLoaded; (i.onLoaded = null), s(); } if (!i.adapter.hasOnLoadExecuted) { i.adapter.hasOnLoadExecuted = !0; var l = i.adapter.alGet("onLoad"); l && l.alCall(i.adapter); } } null != r[a] && ((i = n[a]) && i.adapter && !i.adapter.constructorHasRun ? (e.queued_mcs.push(i), e.queued_scripts.push(r[a])) : i && i.adapter && i.adapter.executeScript && i.adapter.executeScript(r[a])); } } }), (t.execute_dispose = function () { for (var t = this._queued_dispose.length, e = 0; e < t; e++) this._queued_dispose[e].dispose(); this._queued_dispose.length = 0; }), (t.invalidAS3Constructors = !1), (t.frameScriptDebug = void 0), (t.useAVM1 = !1), (t._queued_dispose = []), (t._active_intervals = new Object()), (t._intervalID = 0), t ); })(), Cu = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = !1); var r = t.call(this) || this; return ( (r.symbolID = 0), (r.preventScript = !1), (r._scenes = []), (r._buttonMode = !1), (r._isButton = !1), (r._time = 0), (r._currentFrameIndex = -1), (r._isPlaying = !0), (r._currentSceneIndex = 0), (r._sceneDirty = !1), (r._isInit = !0), (r._sessionID_childs = {}), (r._sounds = {}), (r._skipFramesForStream = 0), (r._isTimelinePass = !1), (r._isSprite = !1), (r.buttonEnabled = !0), (r.loop = !0), (r.constructedKeyFrameIndex = -1), (r._soundVolume = 1), (r._parentSoundVolume = 1), (r._isButton = !1), (r._buttonMode = !1), (r._useHandCursor = !0), (r.doingSwap = !1), (r.cursorType = "pointer"), (r._onMouseOver = function (t) { r.buttonEnabled ? (r.currentFrameIndex = 1) : (r.currentFrameIndex = 0); }), (r._onMouseOut = function (t) { r.currentFrameIndex = 0; }), (r._onMouseDown = function (t) { r.buttonEnabled ? (r.currentFrameIndex = 2) : (r.currentFrameIndex = 0); }), (r._onMouseUp = function (t) { r.currentFrameIndex = 0 == r.currentFrameIndex ? 0 : 1; }), (r._onDragOver = function (t) { r.buttonEnabled ? (r.currentFrameIndex = 2) : (r.currentFrameIndex = 0); }), (r._onDragOut = function (t) { r.currentFrameIndex = 1; }), (r._timeline = e || new lu()), n && r.transformToSprite(), r ); } return ( e(n, t), (n.stopAllSounds = function () { n._activeSoundsOwners.forEach(function (t) { return t && t.stopAllSounds(); }), n._activeSoundsOwners.clear(); }), (n.getNewMovieClip = function (t) { if ((void 0 === t && (t = null), n._movieClips.length)) { var e = n._movieClips.pop(); return ( (e.timeline = t || new lu()), (e.graphics = qs.getGraphics()), e ); } return new n(t); }), (n.clearPool = function () { n._movieClips = []; }), Object.defineProperty(n.prototype, "isSprite", { get: function () { return this._isSprite; }, enumerable: !0, configurable: !0, }), (n.prototype.initSoundStream = function (t, e) { this._soundStreams || (this._soundStreams = new n.movieClipSoundsManagerClass(this)), this._soundStreams.initSoundStream(t, e); }), (n.prototype.addSoundStreamBlock = function (t, e) { this._soundStreams || (this._soundStreams = new n.movieClipSoundsManagerClass(this)), this._soundStreams.addSoundStreamBlock(t, e); }), (n.prototype.stopCurrentStream = function (t) { if (this._soundStreams) return this._soundStreams.stopStream(t); }), (n.prototype.resetStreamStopped = function () { this._soundStreams && this._soundStreams.resetStreamStopped(); }), (n.prototype._syncSounds = function (t) { return this._soundStreams ? this._soundStreams.syncSounds(t, this._isPlaying, this.parent) : 0; }), (n.prototype.transformToSprite = function () { if (!this._isSprite) { this._isSprite = !0; var t = this._timeline; t.numFrames <= 1 || ((t.frame_command_indices = [t.frame_command_indices[0]]), (t.frame_recipe = [t.frame_recipe[0]]), (t.keyframe_constructframes = [t.keyframe_constructframes[0]]), (t.keyframe_durations = [t.keyframe_durations[0]]), (t.keyframe_firstframes = [t.keyframe_firstframes[0]]), (t.keyframe_indices = [t.keyframe_indices[0]])); } }), (n.prototype.startSound = function (t, e, r, i) { var o = e.play(0, r); (o.onSoundComplete = i), (this._sounds[t] = e), n._activeSounds[t] || (n._activeSounds[t] = []), n._activeSounds[t].push(o), n._activeSoundsOwners.add(this); }), (n.prototype.stopSounds = function (t) { if ((void 0 === t && (t = null), t)) { if (this._sounds[t]) { if ( (this._sounds[t].stop(), delete this._sounds[t], (o = n._activeSounds[t])) ) for (var e = 0, r = o; e < r.length; e++) { r[e].stop(); } delete n._activeSounds[t]; } } else { for (var i in this._sounds) { var o; if ((this._sounds[i].stop(), (o = n._activeSounds[t]))) for (var a = 0, s = o; a < s.length; a++) { s[a].stop(); } delete n._activeSounds[i]; } this._sounds = {}; } 0 === Object.getOwnPropertyNames(this._sounds).length && n._activeSoundsOwners.delete(this); for (var u, l = this._children.length, c = 0; c < l; ++c) (u = this._children[c]).isAsset(n) && u.stopSounds(t); this.stopCurrentStream(this._currentFrameIndex), (n._activeSounds = {}), this._soundStreams && this._soundStreams.syncSounds(0, !1, this.parent); }), (n.prototype.getSceneIndexByFrame = function (t) { var e = this.scenes; if (e.length <= 1) return 0; for (var n = 0; n < e.length; n++) if (e[n].offset > t) return n - 1; return e.length - 1; }), (n.prototype.getSceneIndex = function (t) { for (var e = this.scenes, n = 0; n < e.length && t; n++) if (e[n].name === t) return n; return 0; }), Object.defineProperty(n.prototype, "currentSceneName", { get: function () { return this.scenes[this._currentSceneIndex].name; }, set: function (t) { var e = this.getSceneIndex(t); (this._sceneDirty = this._currentSceneIndex !== e), (this._currentSceneIndex = e), (this._currentFrameIndex = this._scenes[e].offset); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "currentScene", { get: function () { var t = this.scenes[this._currentSceneIndex]; return ( -1 === t.numFrames && (t.numFrames = this.timeline.numFrames - t.offset), t ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scenes", { get: function () { return ( 0 === this._scenes.length && (this._scenes[0] = { name: "Scene1", offset: 0, labels: [], numFrames: this.timeline.numFrames, }), this._scenes ); }, set: function (t) { this._scenes = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "isPlaying", { get: function () { return this._isPlaying; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "soundVolume", { get: function () { return this._soundVolume; }, set: function (t) { if (this._soundVolume != t) { for (var e in ((this._soundVolume = t), this._sounds)) this._sounds[e].volume = t; for (var r, i = this._children.length, o = 0; o < i; ++o) (r = this._children[o]).isAsset(n) && (r.soundVolume = t); } }, enumerable: !0, configurable: !0, }), (n.prototype.stopSound = function (t) { if ( (this._sounds[t] && (this._sounds[t].stop(), delete this._sounds[t]), 0 === Object.getOwnPropertyNames(this._sounds).length && n._activeSoundsOwners.delete(this), n._activeSounds[t]) ) { for (var e = 0; e < n._activeSounds[t].length; e++) n._activeSounds[t][e].stop(); delete n._activeSounds[t]; } }), (n.prototype.stopAllSounds = function () { for (var t = 0, e = Object.keys(this._sounds); t < e.length; t++) { var n = e[t]; this.stopSounds(n); } }), (n.prototype.buttonReset = function () { this._isButton && !this.buttonEnabled && (this.currentFrameIndex = 0); }), (n.prototype.getMouseCursor = function () { return "scene" == this.name ? "initial" : this._useHandCursor && this.buttonMode ? this.cursorType : "initial"; }), (n.prototype.queueFrameScripts = function (t, e, n) { console.warn( "[MovieClip] - queueFrameScripts should only be called on AVM-Adapters" ); }), (n.prototype.registerScriptObject = function (t) { (this[t.name] = t), t.isAsset(n) && t.removeButtonListeners(); }), (n.prototype.unregisterScriptObject = function (t) { delete this[t.name], t.isAsset(n) && t.removeButtonListeners(); }), (n.prototype.dispose = function () { this.disposeValues(), n._movieClips.push(this); }), (n.prototype.disposeValues = function () { t.prototype.disposeValues.call(this), (this._sessionID_childs = {}), (this._timeline = null); }), Object.defineProperty(n.prototype, "useHandCursor", { get: function () { return this._useHandCursor; }, set: function (t) { this._useHandCursor = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "buttonMode", { get: function () { return this._buttonMode; }, set: function (t) { this._buttonMode = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "isButton", { get: function () { return this._isButton; }, set: function (t) { this._isButton = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "isInit", { get: function () { return this._isInit; }, set: function (t) { this._isInit = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "timeline", { get: function () { return this._timeline; }, set: function (t) { this._timeline != t && ((this._timeline = t), this.reset(!1, !1)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numFrames", { get: function () { return this._timeline.numFrames; }, enumerable: !0, configurable: !0, }), (n.prototype.jumpToLabel = function (t, e) { void 0 === e && (e = 0); var n = this._currentFrameIndex; return ( this._timeline.jumpToLabel(this, t, e), n !== this._currentFrameIndex ); }), (n.prototype.reset = function (e, n) { void 0 === e && (e = !0), void 0 === n && (n = !0), (this._isTimelinePass = !0), n && t.prototype.reset.call(this), 4115 == this.id && console.warn("reset", this.id), this.resetStreamStopped(), (this._time = 0), n && this._adapter && this.adapter.freeFromScript(), (this.constructedKeyFrameIndex = -1); for (var r = this.numChildren - 1; r >= 0; r--) this.removeChildAt(r); if ((this.graphics.clear(), e)) { var i = this._timeline.keyframe_indices.length; (this._isPlaying = Boolean(i > 1)), (this._currentSceneIndex = 0), i ? ((this._currentFrameIndex = 0), this._timeline.constructNextFrame( this, e && !this.doingSwap && !this.preventScript, !0 )) : (this._currentFrameIndex = -1); } (this._skipAdvance = !0), (this._isTimelinePass = !1); }), Object.defineProperty(n.prototype, "currentFrameIndex", { get: function () { return this._currentFrameIndex; }, set: function (t) { this.jumpToIndex(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "currentFrameIndexRelative", { get: function () { return this._currentFrameIndex - this.currentScene.offset; }, set: function (t) { this.jumpToIndex(t, this._currentSceneIndex); }, enumerable: !0, configurable: !0, }), (n.prototype.jumpToIndex = function (t, e) { var n = !0, r = 0, i = this._timeline.keyframe_indices.length; if ((this.resetStreamStopped(), !i)) return !1; var o = this.scenes; if (void 0 === e) e = this.getSceneIndexByFrame(t); else { var a = o[(e = "string" == typeof e ? this.getSceneIndex(e) : e)]; -1 === a.numFrames && (a.numFrames = i - a.offset), (r = a.offset), (i = a.numFrames); } return ( (this._currentSceneIndex = e), t < 0 ? (t = 0) : t >= i && ((t = i - 1), (n = !1)), (t += r), (this._skipAdvance = !1), !(this._currentFrameIndex === t && !this._sceneDirty) && ((this._sceneDirty = !1), (this._currentFrameIndex = t), this._timeline.gotoFrame(this, t, n, !1, !1), !0) ); }), (n.prototype.addButtonListeners = function () { (this._isButton = !0), this.stop(), this.addEventListener(vu.MOUSE_OVER, this._onMouseOver), this.addEventListener(vu.MOUSE_OUT, this._onMouseOut), this.addEventListener(vu.MOUSE_DOWN, this._onMouseDown), this.addEventListener(vu.MOUSE_UP, this._onMouseUp), this.addEventListener(vu.DRAG_OVER, this._onDragOver), this.addEventListener(vu.DRAG_OUT, this._onDragOut), (this.mouseChildren = !1); }), (n.prototype.removeButtonListeners = function () { this.removeEventListener(vu.MOUSE_OVER, this._onMouseOver), this.removeEventListener(vu.MOUSE_OUT, this._onMouseOut), this.removeEventListener(vu.MOUSE_DOWN, this._onMouseDown), this.removeEventListener(vu.MOUSE_UP, this._onMouseUp), this.removeEventListener(vu.DRAG_OVER, this._onDragOver), this.removeEventListener(vu.DRAG_OUT, this._onDragOut); }), (n.prototype.swapChildrenAt = function (t, e) { console.warn("[scene/MovieClip] - swapChildrenAt - not implemented"); }), (n.prototype.swapDepths = function (t, e) { console.warn("[scene/MovieClip] - swapDepths - not implemented"); }), (n.prototype.getTimelineChildAtSessionID = function (t) { return this._sessionID_childs[t]; }), (n.prototype.constructFrame = function (t, e, n, r, i, o, a) { console.warn("[scene/MovieClip] - constructFrame not implemented"); }), (n.prototype.addTimelineChildAtDepth = function (t, e, n) { return ( console.warn( "[scene/MovieClip] - addTimelineChildAtDepth not implemented" ), null ); }), (n.prototype.removeTimelineChildAtDepth = function (t) { console.warn( "[scene/MovieClip] - removeTimelineChildAtDepth not implemented" ); }), (n.prototype.removeChildAtInternal = function (e) { var n = this._children[e]; return ( n._adapter && n.adapter.freeFromScript(), this._isTimelinePass && this.adapter.unregisterScriptObject(n), delete this._sessionID_childs[n._sessionID], (n._sessionID = -1), n.adapter && n.adapter.dispatchStaticEvent && n.adapter.dispatchStaticEvent("removed", n.adapter), this.isOnDisplayList() && n.adapter.dispatch_REMOVED_FROM_STAGE && n.adapter.dispatch_REMOVED_FROM_STAGE(n), t.prototype.removeChildAtInternal.call(this, e) ); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.play = function () { this._timeline.keyframe_indices.length > 1 && (this._isPlaying = !0); }), (n.prototype.stop = function () { this.resetStreamStopped(), (this._isPlaying = !1); }), (n.prototype.clone = function () { var t = n.getNewMovieClip(this._timeline); return this.copyTo(t), t; }), (n.prototype.copyTo = function (e) { t.prototype.copyTo.call(this, e), (e.buttonMode = this.buttonMode), (e.symbolID = this.symbolID), (e.loop = this.loop), (e._soundStreams = this._soundStreams), (e._scenes = this._scenes), this._isSprite && e.transformToSprite(); }), (n.prototype.advanceFrameInternal = function () { this._timeline && this._timeline.numFrames > 0 && this._isPlaying && !this._skipAdvance && (this._currentFrameIndex === this._timeline.numFrames - 1 ? this.loop ? 0 !== this._currentFrameIndex && ((this._currentFrameIndex = 0), (this._currentSceneIndex = 0), this.resetStreamStopped(), this._timeline.gotoFrame(this, 0, !0, !0, !0)) : (this._isPlaying = !1) : (this._currentFrameIndex++, (this._currentSceneIndex = this.getSceneIndexByFrame( this._currentFrameIndex )), this._timeline.constructNextFrame(this))), t.prototype.advanceFrame.call(this), (this._skipAdvance = !1); }), (n.prototype.advanceFrame = function () { for ( this._isTimelinePass = !0, 0 == this._skipFramesForStream && this.advanceFrameInternal(), this._skipFramesForStream = this._syncSounds( this._currentFrameIndex ); this._skipFramesForStream > 0; ) bu.execute_queue(), this.advanceFrameInternal(), (this._skipFramesForStream = this._syncSounds( this._currentFrameIndex )); this._isTimelinePass = !1; }), (n.prototype.logHierarchy = function (t) { void 0 === t && (t = 0), this.printHierarchyName(t, this); for (var e, r = this._children.length, i = 0; i < r; i++) (e = this._children[i]).isAsset(n) ? e.logHierarchy(t + 1) : this.printHierarchyName(t + 1, e); }), (n.prototype.printHierarchyName = function (t, e) { for (var n = "", r = 0; r < t; ++r) n += "--"; (n += " " + e.name + " = " + e.id), console.log(n); }), (n.prototype.clear = function () { this.resetStreamStopped(), t.prototype.clear.call(this); }), (n.avm1ScriptQueue = []), (n.avm1ScriptQueueScripts = []), (n.avm1LoadedActions = []), (n.movieClipSoundsManagerClass = null), (n._movieClips = new Array()), (n._activeSounds = {}), (n._activeSoundsOwners = new Set()), (n.assetType = "[asset MovieClip]"), n ); })(ru); Ai.registerAbstraction(bi, Cu); var Iu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset SkyboxElements]"), n ); })(ao), Eu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._includeDependencies = function (t) {}), (n.prototype._getVertexCode = function (t, e, n) { var r = "", i = t.globalPosDependencies > 0 ? n.globalPositionVertex : n.animatedPosition, o = e.getFreeVertexConstant(); e.getFreeVertexConstant(), e.getFreeVertexConstant(), e.getFreeVertexConstant(), (t.viewMatrixIndex = 4 * o.index); var a = e.getFreeVertexConstant(); t.scenePositionIndex = 4 * a.index; var s = e.getFreeVertexConstant(), u = e.getFreeVertexVectorTemp(); return ( (r += "mul " + u + ", " + i + ", " + s + "\nadd " + u + ", " + u + ", " + a + "\n"), t.projectionDependencies > 0 ? ((n.projectionFragment = e.getFreeVarying()), (r += "m44 " + u + ", " + u + ", " + o + "\nmov " + n.projectionFragment + ", " + u + "\nmov op, " + u + "\n")) : (r += "m44 op, " + u + ", " + o + "\n"), r ); }), (n.prototype._getFragmentCode = function (t, e, n) { return ""; }), n ); })(Ni), xu = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return (e._skyboxProjection = new F()), e; } return ( e(n, t), (n.prototype.draw = function (t, e, n, r) { var i = e.scenePositionIndex, o = e.view.projection.transform.matrix3D.position; (e.vertexConstantData[i++] = 2 * o.x), (e.vertexConstantData[i++] = 2 * o.y), (e.vertexConstantData[i++] = 2 * o.z), (e.vertexConstantData[i++] = 1), (e.vertexConstantData[i++] = e.vertexConstantData[i++] = e.vertexConstantData[i++] = e.view.projection.far / Math.sqrt(3)), (e.vertexConstantData[i] = 1); var a = new B(); this._skyboxProjection.copyFrom(e.view.viewMatrix3D), this._skyboxProjection.copyRowTo(2, a); var s = a.x, u = a.y, l = a.z, c = -( a.x * o.x + a.y * o.y + a.z * o.z + Math.sqrt(s * s + u * u + l * l) ), h = new B(s >= 0 ? 1 : -1, u >= 0 ? 1 : -1, 1, 1), p = this._skyboxProjection.clone(); p.invert(); var d = p.transformVector(h); this._skyboxProjection.copyRowTo(3, h); var f = (d.x * h.x + d.y * h.y + d.z * h.z + d.w * h.w) / (s * d.x + u * d.y + l * d.z + c * d.w); this._skyboxProjection.copyRowFrom( 2, new B(s * f, u * f, l * f, c * f) ), e.sceneMatrixIndex >= 0 && e.sceneMatrix.copyFrom(t.renderSceneTransform, !0), e.viewMatrix.copyFrom(this._skyboxProjection, !0); var g = this._stage.context; g.setProgramConstantsFromArray(te.VERTEX, e.vertexConstantData), g.setProgramConstantsFromArray(te.FRAGMENT, e.fragmentConstantData), this._indices ? this.getIndexBufferGL().draw(Jt.TRIANGLES, 0, this.numIndices) : this._stage.context.drawVertices( Jt.TRIANGLES, r, n || this.numVertices ); }), n ); })(so); oo.registerElements(Eu, Iu), Jr.registerAbstraction(xu, Iu); var wu = (function (t) { function n(e, n) { void 0 === e && (e = 16777215); var r = t.call(this) || this; return ( (r._textures = new Array()), (r._blendMode = dn.NORMAL), (r.animateUVs = !1), (r.bothSides = !1), (r.curves = !1), (r.imageRect = !1), (r.useColorTransform = !1), (r.alphaThreshold = 0), (r._onTextureInvalidateDelegate = function (t) { return r.onTextureInvalidate(t); }), (r._owners = [r]), (r.style = new zi()), e instanceof sn ? ((r._style.image = e), (r.texture = new go())) : (r._style.color = Number(e)), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "animationSet", { get: function () { return this._animationSet; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blendMode", { get: function () { return this._blendMode; }, set: function (t) { this._blendMode != t && ((this._blendMode = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "iOwners", { get: function () { return this._owners; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.removeTexture(this._texture), (this._texture = t), this._texture && this.addTexture(this._texture), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), (n.prototype.getNumTextures = function () { return this._textures.length; }), (n.prototype.getTextureAt = function (t) { return this._textures[t]; }), (n.prototype.isEntity = function () { return !0; }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.invalidatePasses = function () { this.dispatchEvent(new Bi(Bi.INVALIDATE_PASSES, this)); }), (n.prototype.invalidateElements = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_ELEMENTS, this)); }), (n.prototype.invalidateMaterial = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_MATERIAL, this)); }), (n.prototype.invalidateStyle = function () { this.dispatchEvent(new Ri(Ri.INVALIDATE_STYLE, this)); }), (n.prototype.addTexture = function (t) { this._textures.push(t), t.addEventListener(c.INVALIDATE, this._onTextureInvalidateDelegate), this.onTextureInvalidate(); }), (n.prototype.removeTexture = function (t) { this._textures.splice(this._textures.indexOf(t), 1), t.removeEventListener( c.INVALIDATE, this._onTextureInvalidateDelegate ), this.onTextureInvalidate(); }), (n.prototype.onTextureInvalidate = function (t) { this.invalidate(); }), (n.prototype._onInvalidateProperties = function (t) { this.invalidateMaterial(), this.invalidatePasses(); }), (n.prototype._acceptTraverser = function (t) { t.applyTraversable(this); }), (n.prototype.iAddOwner = function (t) {}), (n.prototype.iRemoveOwner = function (t) {}), (n.prototype._getDefaultBoundingVolume = function () { return Dt.NULL; }), (n.prototype.testCollision = function (t, e) { return (t.traversable = null), !1; }), (n.assetType = "[asset Skybox]"), n ); })(nu), Su = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._skybox = e), (r._shader = new Pi(n, r, r, r._stage)), (r._texture = r._skybox.texture.getAbstraction(r._shader)), r._pAddPass(r), r ); } return ( e(n, t), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._texture.onClear(new c(c.CLEAR, this._skybox.texture)), (this._texture = null), (this._skybox = null); }), (n.prototype._pUpdateRender = function () { t.prototype._pUpdateRender.call(this), (this.requiresBlending = this._material.blendMode != dn.NORMAL), this.shader.setBlendMode( this._material.blendMode == dn.NORMAL && this.requiresBlending ? dn.LAYER : this._material.blendMode ); }), (n.prototype._includeDependencies = function (e) { t.prototype._includeDependencies.call(this, e), (e.usesPositionFragment = !0); }), (n.prototype._getFragmentCode = function (t, e) { return this._texture._getFragmentCode( e.shadedTarget, t, e, e.positionVarying ); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._texture._setRenderState(e); }), (n.prototype._activate = function () { t.prototype._activate.call(this), this._stage.context.setDepthTest(!1, Wt.LESS), this._texture.activate(); }), n ); })(Li), Du = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getStageElements = function () { var t = n._elements; return ( t || (((t = new Iu(new oi(11, 4))).autoDeriveNormals = !1), (t.autoDeriveTangents = !1), t.setIndices( Array( 0, 1, 2, 2, 3, 0, 6, 5, 4, 4, 7, 6, 2, 6, 7, 7, 3, 2, 4, 5, 1, 1, 0, 4, 4, 0, 3, 3, 7, 4, 2, 1, 5, 5, 6, 2 ) ), t.setPositions( Array( -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1 ) )), t.getAbstraction(this._stage) ); }), (n.prototype._getRenderMaterial = function () { return this._asset.getAbstraction( this.renderGroup.getRenderElements(this.stageElements.elements) ); }), (n.prototype._getStyle = function () { return this._asset.style; }), n ); })(Vi), Tu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.isInFrustum = function (t, e, n, r) { return !this.isInvisible(); }), (n.prototype.isCastingShadow = function () { return !1; }), n ); })(bi); Io.registerMaterial(Su, wu), Qi.registerRenderable(Du, wu), Ai.registerAbstraction(Tu, wu); var Pu, Ou = (function () { function t() {} return ( (t.CENTER = "center"), (t.LEFT = "left"), (t.NONE = "none"), (t.RIGHT = "right"), t ); })(), Bu = (function () { function t() {} return ( (t.DYNAMIC = "dynamic"), (t.INPUT = "input"), (t.STATIC = "input"), t ); })(); !(function (t) { (t.STANDART = "standart"), (t.BOLD = "bold"), (t.ITALIC = "italic"), (t.BOLDITALIC = "boldItalic"); })(Pu || (Pu = {})); var Mu = (function () { function t() {} return ( (t.CENTER = "center"), (t.JUSTIFY = "justify"), (t.LEFT = "left"), (t.RIGHT = "right"), t ); })(), Lu = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype.clone = function () { return new n(this.type); }), (n.CASTS_SHADOW_CHANGE = "castsShadowChange"), n ); })(l), Nu = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype.clone = function () { return new n(this.type); }), (n.TEXTURE_CHANGE = "textureChange"), n ); })(l), Ru = (function (t) { function n(e) { return t.call(this, e) || this; } return e(n, t), (n.SHADER_INVALIDATED = "shaderInvalidated"), n; })(l), Fu = (function (t) { function n(e) { return void 0 === e && (e = null), t.call(this, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture DepthTextureCube]"), n ); })(go), ku = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._initVO = function (t) { (this._decodeReg = null), (this._decodeIndex = -1); }), (n.prototype._initConstants = function () { var t = this._shader.fragmentConstantData, e = this._decodeIndex; (t[e] = 1), (t[e + 1] = 1 / 255), (t[e + 2] = 1 / 65025), (t[e + 3] = 1 / 16581375); }), (n.prototype._getFragmentCode = function (e, n, r, i) { -1 == this._decodeIndex && (this._decodeIndex = 4 * (this._decodeReg = n.getFreeFragmentConstant()).index); var o = n.getFreeFragmentVectorTemp(); return ( t.prototype._getFragmentCode.call(this, o, n, r, i) + "dp4 " + e + ".w, " + o + ", " + this._decodeReg + "\n" ); }), n ); })(_o); Pi.registerAbstraction(ku, Fu); var Uu = (function (t) { function n(e) { return void 0 === e && (e = null), t.call(this, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture ShadowTexture2D]"), n ); })(mo), ju = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getFragmentCode = function (e, n, r, i) { return ( t.prototype._getFragmentCode.call(this, e, n, r, i) + "slt " + e + ".w, " + i + ".z, " + e + ".w\n" ); }), n ); })(ku); Pi.registerAbstraction(ju, Uu); var Vu = (function (t) { function n() { var e = t.call(this) || this; return ( (e._textures = new Array()), (e._owners = new Array()), (e._counts = new Array()), e ); } return ( e(n, t), (n.prototype.dispose = function () {}), (n.prototype.iAddOwner = function (t) { var e = this._owners.indexOf(t); if (-1 != e) this._counts[e]++; else { this._owners.push(t), this._counts.push(1); for (var n = this._textures.length, r = 0; r < n; r++) t.addTexture(this._textures[r]); } }), (n.prototype.iRemoveOwner = function (t) { var e = this._owners.indexOf(t); if (1 != this._counts[e]) this._counts[e]--; else { this._owners.splice(e, 1), this._counts.splice(e, 1); for (var n = this._textures.length, r = 0; r < n; r++) t.removeTexture(this._textures[r]); } }), (n.prototype.iAddTexture = function (t) { this._textures.push(t); for (var e = this._owners.length, n = 0; n < e; n++) this._owners[n].addTexture(t); }), (n.prototype.iRemoveTexture = function (t) { this._textures.splice(this._textures.indexOf(t), 1); for (var e = this._owners.length, n = 0; n < e; n++) this._owners[n].removeTexture(t); }), (n.prototype.invalidateShaderProgram = function () { this.invalidate(), this.dispatchEvent(new Ru(Ru.SHADER_INVALIDATED)); }), (n.prototype.copyFrom = function (t) {}), n ); })(f), Qu = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r.chunkVO = new Ki()), r; } return ( e(n, t), (n.prototype._isUsed = function () { return !0; }), (n.prototype._usesTangentSpace = function () { return !0; }), (n.prototype._initVO = function (t) {}), (n.prototype._initConstants = function () {}), (n.prototype._reset = function (t) { (this._invalid = !0), (t.useChunk = !1), (t.needsProjection = !1), (t.needsView = !1), (t.needsNormals = !1), (t.needsTangents = !1), (t.needsGlobalVertexPos = !1), (t.needsGlobalFragmentPos = !1), this._cleanCompilationData(); }), (n.prototype._cleanCompilationData = function () {}), (n.prototype._getVertexCode = function (t, e) { return ""; }), (n.prototype._getFragmentCode = function (t, e, n) { return ""; }), (n.prototype._activate = function () {}), (n.prototype._setRenderState = function (t) {}), (n.prototype._deactivate = function () { this._invalid = !1; }), n ); })(W), Gu = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return (e._epsilon = 0.02), (e._alpha = 1), (e.autoUpdate = !0), e; } return ( e(n, t), Object.defineProperty(n.prototype, "textureMap", { get: function () { return this._textureMap; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._alpha; }, set: function (t) { this._alpha = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "light", { get: function () { return this._light; }, set: function (t) { this._light != t && (this._light = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "epsilon", { get: function () { return this._epsilon; }, set: function (t) { this._epsilon = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "size", { get: function () { return this._size; }, set: function (t) { this._size != t && ((this._size = t), this._updateSize()); }, enumerable: !0, configurable: !0, }), (n.prototype.update = function (t, e) { this._updateProjection(e.view.projection), this._renderMap(t, e); }), (n.prototype._updateProjection = function (t) { throw new u(); }), (n.prototype._renderMap = function (t, e) { throw new u(); }), (n.prototype._updateSize = function () { throw new u(); }), (n.prototype.dispose = function () { this._light = null; }), n ); })(Vu), zu = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.autoUpdate = !0), (r._mapper = e), (r._shader = n), r._shader.renderMaterial.renderGroup._addMapper(r._mapper), r ); } return ( e(n, t), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._depthMapCoordReg = null); }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depthMapCoordReg", { get: function () { return this._depthMapCoordReg; }, enumerable: !0, configurable: !0, }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), this._shader.renderMaterial.renderGroup._removeMapper(this._mapper); }), (n.prototype._initVO = function (t) { (this._texture = this._mapper.textureMap.getAbstraction( this._shader )), this._texture._initVO(t); }), (n.prototype._initConstants = function () { this._texture._initConstants(); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = e.getFreeFragmentConstant(); return ( (this._fragmentAlphaIndex = 4 * r.index), "add " + t + ".w, " + t + ".w, " + r + ".x\nsat " + t + ".w, " + t + ".w\n" ); }), (n.prototype._activate = function () { (this._shader.fragmentConstantData[this._fragmentAlphaIndex] = 1 - this._mapper.alpha), this._texture.activate(); }), (n.prototype._setRenderState = function (t) { this._texture._setRenderState(t); }), n ); })(Qu), Hu = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._lightOffset = 1e4), (n._snap = 64), (n._size = 2048), (n._image2D = e || new ke(n._size, n._size)), (n._textureMap = new Uu(n._image2D)), n.iAddTexture(n._textureMap), (n._cullPlanes = []), (n._overallDepthProjection = new vt()), (n._overallDepthProjection.transform = new k()), (n._localFrustum = []), (n._matrix = new F()), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { t.prototype.dispose.call(this), (this._textureMap.image = null), (this._textureMap = null), (this._image2D = null); }), Object.defineProperty(n.prototype, "snap", { get: function () { return this._snap; }, set: function (t) { this._snap = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightOffset", { get: function () { return this._lightOffset; }, set: function (t) { this._lightOffset = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depthProjection", { get: function () { return this._overallDepthProjection.viewMatrix3D; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depth", { get: function () { return this._maxZ - this._minZ; }, enumerable: !0, configurable: !0, }), (n.prototype._updateSize = function () { this._image2D._setSize(this._size, this._size); }), (n.prototype._updateProjection = function (t) { this._updateProjectionFromFrustumCorners( t, t.viewFrustumCorners, this._matrix ), (this._overallDepthProjection.frustumMatrix3D = this._matrix), this._updateCullPlanes(t); }), (n.prototype._renderMap = function (t, e) { var n = oo.getInstance(new yi(null, e.stage), bo).getRenderer(t); (n.cullPlanes = this._cullPlanes), (n.view.preservePixelRatio = !1), (n.view.target = this._image2D), (n.view.projection = this._overallDepthProjection), n.render(); }), (n.prototype._updateCullPlanes = function (t) { var e = this._overallDepthProjection.viewFrustumPlanes, n = t.viewFrustumPlanes; (this._cullPlanes.length = 4), (this._cullPlanes[0] = e[0]), (this._cullPlanes[1] = e[1]), (this._cullPlanes[2] = e[2]), (this._cullPlanes[3] = e[3]); for ( var r = this._light.sceneDirection, i = r.x, o = r.y, a = r.z, s = 4, u = 0; u < 6; ++u ) { var l = n[u]; l.a * i + l.b * o + l.c * a < 0 && (this._cullPlanes[s++] = l); } }), (n.prototype._updateProjectionFromFrustumCorners = function (t, e, n) { var r, i, o, a, s, u, l, c, h = t.transform.matrix3D.position, p = this._light.sceneDirection; for ( this._overallDepthProjection.transform.matrix3D = this._light.transform.matrix3D, r = Math.floor((h.x - p.x * this._lightOffset) / this._snap) * this._snap, i = Math.floor((h.y - p.y * this._lightOffset) / this._snap) * this._snap, o = Math.floor((h.z - p.z * this._lightOffset) / this._snap) * this._snap, this._overallDepthProjection.transform.moveTo(r, i, o), this._overallDepthProjection.transform.inverseMatrix3D.transformVectors( e, this._localFrustum ), a = u = this._localFrustum[0], s = l = this._localFrustum[1], this._maxZ = this._localFrustum[2], c = 3; c < 24; ) (r = this._localFrustum[c]) < a && (a = r), r > u && (u = r), (i = this._localFrustum[c + 1]) < s && (s = i), i > l && (l = i), (o = this._localFrustum[c + 2]) > this._maxZ && (this._maxZ = o), (c += 3); this._minZ = 1; var d = u - a, f = l - s, g = 1 / (this._maxZ - this._minZ); a < 0 && (a -= this._snap), s < 0 && (s -= this._snap), (a = Math.floor(a / this._snap) * this._snap), (s = Math.floor(s / this._snap) * this._snap); var _ = 2 * this._snap; (u = a + (d = Math.floor(d / _ + 2) * _)), (l = s + (f = Math.floor(f / _ + 2) * _)), (d = 1 / d), (f = 1 / f); var m = n._rawData; (m[0] = 2 * d), (m[5] = 2 * f), (m[10] = g), (m[12] = -(u + a) * d), (m[13] = -(l + s) * f), (m[14] = -this._minZ * g), (m[15] = 1), (m[1] = m[2] = m[3] = m[4] = m[6] = m[7] = m[8] = m[9] = m[11] = 0), n.invalidatePosition(); }), (n.assetType = "[asset DirectionalShadowMapper]"), n ); })(Gu), Xu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (e.needsView = !0), (e.needsGlobalVertexPos = !0); }), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._shader.vertexConstantData, n = this._vertexScalingIndex; (e[n] = 0.5), (e[n + 1] = 0.5), (e[n + 2] = 0), (e[n + 3] = 1), (this._depthProjectionMatrix = new F( new Float32Array( this._shader.vertexConstantData.buffer, 4 * (n + 4), 16 ) )); }), (n.prototype._getVertexCode = function (t, e) { var n = "", r = t.getFreeVertexVectorTemp(), i = t.getFreeVertexConstant(); this._vertexScalingIndex = 4 * i.index; var o = t.getFreeVertexConstant(); return ( t.getFreeVertexConstant(), t.getFreeVertexConstant(), t.getFreeVertexConstant(), (this._depthMapCoordReg = t.getFreeVarying()), (n += "m44 " + r + ", " + e.globalPositionVertex + ", " + o + "\ndiv " + r + ", " + r + ", " + r + ".w\nmul " + r + ".xy, " + r + ".xy, " + i + ".xy\nadd " + this._depthMapCoordReg + ", " + r + ", " + i + ".xxwz\n") ); }), (n.prototype._activate = function () { t.prototype._activate.call(this), (this._shader.vertexConstantData[this._vertexScalingIndex + 3] = -1 / (this._mapper.depth * this._mapper.epsilon)), this._depthProjectionMatrix.copyFrom( this._mapper.depthProjection, !0 ); }), n ); })(zu); Pi.registerAbstraction(Xu, Hu); var Yu = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._color = 16777215), (n._colorR = 1), (n._colorG = 1), (n._colorB = 1), (n._ambientColor = 16777215), (n._ambient = 0), (n._specular = 1), (n._diffuse = 1), (n._shadowsEnabled = !1), (n._ambientR = 0), (n._ambientG = 0), (n._ambientB = 0), (n._specularR = 1), (n._specularG = 1), (n._specularB = 1), (n._diffuseR = 1), (n._diffuseG = 1), (n._diffuseB = 1), (n._onInvalidateConcatenatedMatrix3DDelegate = function (t) { return n._onInvalidateConcatenatedMatrix3D(t); }), (n.transform = e || new k()), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "transform", { get: function () { return this._transform; }, set: function (t) { this._transform != t && (this._transform && this._transform.removeEventListener( D.INVALIDATE_MATRIX3D, this._onInvalidateConcatenatedMatrix3DDelegate ), (this._transform = t), this._transform && this._transform.addEventListener( D.INVALIDATE_MATRIX3D, this._onInvalidateConcatenatedMatrix3DDelegate )); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "shadowsEnabled", { get: function () { return this._shadowsEnabled; }, set: function (t) { this._shadowsEnabled != t && ((this._shadowsEnabled = t), t && null == this._shadowMapper ? ((this._shadowMapper = this._createShadowMapper()), (this._shadowMapper.light = this)) : t || (this._shadowMapper.dispose(), (this._shadowMapper = null)), this.dispatchEvent(new Lu(Lu.CASTS_SHADOW_CHANGE))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specular", { get: function () { return this._specular; }, set: function (t) { t < 0 && (t = 0), (this._specular = t), this._updateSpecular(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "diffuse", { get: function () { return this._diffuse; }, set: function (t) { t < 0 && (t = 0), (this._diffuse = t), this._updateDiffuse(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { (this._color = t), (this._colorR = ((this._color >> 16) & 255) / 255), (this._colorG = ((this._color >> 8) & 255) / 255), (this._colorB = (255 & this._color) / 255), this._updateDiffuse(), this._updateSpecular(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "ambient", { get: function () { return this._ambient; }, set: function (t) { t < 0 ? (t = 0) : t > 1 && (t = 1), (this._ambient = t), this._updateAmbient(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "ambientColor", { get: function () { return this._ambientColor; }, set: function (t) { this._ambientColor != t && ((this._ambientColor = t), this._updateAmbient()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "shadowMapper", { get: function () { return (this.shadowsEnabled = !0), this._shadowMapper; }, set: function (t) { this._shadowMapper != t && ((this._shadowMapper = t), (this._shadowMapper.light = this)); }, enumerable: !0, configurable: !0, }), (n.prototype._createShadowMapper = function () { throw new u(); }), (n.prototype._updateSpecular = function () { (this._specularR = this._colorR * this._specular), (this._specularG = this._colorG * this._specular), (this._specularB = this._colorB * this._specular); }), (n.prototype._updateDiffuse = function () { (this._diffuseR = this._colorR * this._diffuse), (this._diffuseG = this._colorG * this._diffuse), (this._diffuseB = this._colorB * this._diffuse); }), (n.prototype._updateAmbient = function () { (this._ambientR = (((this._ambientColor >> 16) & 255) / 255) * this._ambient), (this._ambientG = (((this._ambientColor >> 8) & 255) / 255) * this._ambient), (this._ambientB = ((255 & this._ambientColor) / 255) * this._ambient); }), (n.prototype._onInvalidateConcatenatedMatrix3D = function (t) {}), n ); })(f), qu = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this, n) || this; return ( (r._sceneDirectionDirty = !0), e && (r.direction = e), (r._sceneDirection = new B()), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "sceneDirection", { get: function () { return ( this._sceneDirectionDirty && this._updateSceneDirection(), this._sceneDirection ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "direction", { get: function () { return this._direction; }, set: function (t) { (this._direction = t), this._tmpLookAt || (this._tmpLookAt = new B()), (this._tmpLookAt.x = this.transform.position.x + this._direction.x), (this._tmpLookAt.y = this.transform.position.y + this._direction.y), (this._tmpLookAt.z = this.transform.position.z + this._direction.z), this.transform.lookAt(this._tmpLookAt); }, enumerable: !0, configurable: !0, }), (n.prototype._onInvalidateConcatenatedMatrix3D = function (t) { this._sceneDirectionDirty = !0; }), (n.prototype._updateSceneDirection = function () { (this._sceneDirectionDirty = !1), this.transform.matrix3D.copyColumnTo(2, this._sceneDirection), this._sceneDirection.normalize(); }), (n.prototype._createShadowMapper = function () { return new Hu(); }), (n.assetType = "[light DirectionalLight]"), n ); })(Yu), Ku = (function (t) { function n(e, n) { void 0 === n && (n = null); var r = t.call(this) || this; return ( (r.diffuseSampler = new Le()), (r.specularSampler = new Le()), (r.diffuseMap = e), (r.specularMap = n), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[light LightProbe]"), n ); })(Yu), Wu = (function (t) { function n(e, n) { void 0 === n && (n = null); var r = t.call(this, n) || this; return (r._mapper = e), r; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mapper", { get: function () { return this._mapper; }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture ShadowTextureCube]"), n ); })(go), Ju = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getFragmentCode = function (e, n, r, i) { var o = n.getFreeFragmentConstant(); this._positionIndex = 4 * o.index; var a = n.getFreeFragmentConstant(), s = "", u = n.getFreeFragmentVectorTemp(); return ( (s += "sub " + u + ", " + i + ", " + o + "\ndp3 " + u + ".w, " + u + ".xyz, " + u + ".xyz\nnrm " + u + ".xyz, " + u + ".xyz\n"), (s += t.prototype._getFragmentCode.call(this, e, n, r, u) + "add " + u + ".w, " + u + ".w, " + a + ".x\nmul " + u + ".w, " + u + ".w, " + o + ".w\nslt " + e + ".w, " + u + ".w, " + e + ".w\n") ); }), (n.prototype._activate = function () { t.prototype.activate.call(this); var e = this._shader.fragmentConstantData, n = this._positionIndex, r = this._texture.mapper.light.transform.matrix3D.position, i = this._texture.mapper.light.fallOff; (e[n] = r.x), (e[n + 1] = r.y), (e[n + 2] = r.z), (e[n + 3] = 1 / (2 * i * i)), (e[n + 4] = -Math.pow(1 / (i * this._texture.mapper.epsilon), 2)); }), n ); })(ku); Pi.registerAbstraction(Ju, Wu); var $u = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._needsRender = new Array()), (n._size = 512), (n._imageCube = e || new sn(n._size)), (n._textureMap = new Wu(n, n._imageCube)), n.iAddTexture(n._textureMap), n.initCameras(), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { t.prototype.dispose.call(this), (this._textureMap.image = null), (this._textureMap = null), (this._imageCube = null); }), (n.prototype.initCameras = function () { (this._depthProjections = new Array()), this.addProjection(0, 90, 0), this.addProjection(0, -90, 0), this.addProjection(-90, 0, 0), this.addProjection(90, 0, 0), this.addProjection(0, 0, 0), this.addProjection(0, 180, 0); }), (n.prototype.addProjection = function (t, e, n) { var r = new bt(); (r.transform = new k()), r.transform.rotateTo(t, e, n), (r.near = 0.01), (r.fieldOfView = 90), this._depthProjections.push(r); }), (n.prototype._updateSize = function () { this._imageCube._setSize(this._size); }), (n.prototype._updateProjection = function (t) { for ( var e = this._light.fallOff, n = this._light.transform.matrix3D.position, r = 0; r < 6; ++r ) (this._depthProjections[r].far = e), this._depthProjections[r].transform.moveTo(n.x, n.y, n.z), (this._needsRender[r] = !0); }), (n.prototype._renderMap = function (t, e) { for ( var n = oo.getInstance(new yi(null, e.stage), Co).getRenderer(t), r = 0; r < 6; ++r ) this._needsRender[r] && ((n.view.target = this._imageCube), (n.view.projection = this._depthProjections[r]), n.render(null, r)); }), (n.assetType = "[asset PointShadowMapper]"), n ); })(Gu), Zu = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (e.needsGlobalFragmentPos = !0); }), (n.prototype._getVertexCode = function (t, e) { return (this._depthMapCoordReg = e.globalPositionVarying), ""; }), n ); })(zu); Pi.registerAbstraction(Zu, $u); var tl = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this, n) || this; return ( (r._radius = 9e4), (r._fallOff = 1e5), e && ((r._transform.matrix3D._rawData[12] = e.x), (r._transform.matrix3D._rawData[13] = e.y), (r._transform.matrix3D._rawData[14] = e.z), r._transform.invalidatePosition()), (r._fallOffFactor = 1 / (r._fallOff * r._fallOff - r._radius * r._radius)), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "radius", { get: function () { return this._radius; }, set: function (t) { (this._radius = t), this._radius < 0 ? (this._radius = 0) : this._radius > this._fallOff && (this._fallOff = this._radius), (this._fallOffFactor = 1 / (this._fallOff * this._fallOff - this._radius * this._radius)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fallOff", { get: function () { return this._fallOff; }, set: function (t) { (this._fallOff = t), this._fallOff < 0 && (this._fallOff = 0), this._fallOff < this._radius && (this._radius = this._fallOff), (this._fallOffFactor = 1 / (this._fallOff * this._fallOff - this._radius * this._radius)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fallOffFactor", { get: function () { return this._fallOffFactor; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "x", { get: function () { return this._transform.position.x; }, set: function (t) { this._transform.position.x != t && ((this._transform.matrix3D._rawData[12] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "y", { get: function () { return this._transform.position.y; }, set: function (t) { this._transform.position.y != t && ((this._transform.matrix3D._rawData[13] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "z", { get: function () { return this._transform.position.z; }, set: function (t) { this._transform.position.z != t && ((this._transform.matrix3D._rawData[14] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scenePosition", { get: function () { return this._transform.matrix3D.position; }, enumerable: !0, configurable: !0, }), (n.prototype._createShadowMapper = function () { return new $u(); }), (n.assetType = "[light PointLight]"), n ); })(Yu), el = (function (t) { function n() { var e = t.call(this) || this; return (e._alpha = 1), (e._strength = 1), e; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "strength", { get: function () { return this._strength; }, set: function (t) { this._strength != t && ((this._strength = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._alpha; }, set: function (t) { this._alpha != t && ((this._alpha = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.iRemoveTexture(this._texture), (this._texture = t), this._texture && this.iAddTexture(this._texture), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.prototype.copyFrom = function (t) {}), (n.assetType = "[asset AmbientBasicMethod]"), n ); })(Vu), nl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._method = null), (this._shader = null), this._texture && (this._texture.onClear(new c(c.CLEAR, this._method.texture)), (this._texture = null)); }), (n.prototype._initVO = function (t) { this._method.texture ? ((this._texture = this._method.texture.getAbstraction( this._shader )), this._texture._initVO(t), this._method.texture instanceof fo ? (t.needsNormals = !0) : this._shader.uvDependencies++) : this._texture && (this._texture = null); }), (n.prototype._initConstants = function () { this._texture && this._texture._initConstants(); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = ""; if (this._texture) { if ( ((r += this._texture._getFragmentCode( t, e, n, this._method.texture instanceof fo ? n.normalFragment : n.uvVarying )), this._shader.alphaThreshold > 0) ) { var i = e.getFreeFragmentConstant(); (this._colorIndex = 4 * i.index), (r += "sub " + t + ".w, " + t + ".w, " + i + ".x\nkil " + t + ".w\nadd " + t + ".w, " + t + ".w, " + i + ".x\n"); } } else { var o = e.getFreeFragmentConstant(); (this._colorIndex = 4 * o.index), (r += "mov " + t + ", " + o + "\n"); } return r; }), (n.prototype._activate = function () { if (this._texture) this._texture.activate(), this._invalid && this._shader.alphaThreshold > 0 && (this._shader.fragmentConstantData[this._colorIndex] = this._shader.alphaThreshold); else if (this._invalid) { var t = this._colorIndex, e = this._shader.fragmentConstantData, n = this._shader.numLights ? 16777215 : this._shader.renderMaterial.style.color; (e[t] = (((n >> 16) & 255) / 255) * this._method.strength), (e[t + 1] = (((n >> 8) & 255) / 255) * this._method.strength), (e[t + 2] = ((255 & n) / 255) * this._method.strength), (e[t + 3] = this._method.alpha); } }), (n.prototype._setRenderState = function (t) { this._texture && this._texture._setRenderState(t); }), n ); })(Qu); Pi.registerAbstraction(nl, el); var rl = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n._castingLight = e), (e.shadowsEnabled = !0), (n._shadowMapper = e.shadowMapper), n.iAddTexture(e.shadowMapper.textureMap), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "castingLight", { get: function () { return this._castingLight; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset AmbientDepthMethod]"), n ); })(el), il = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this, i = e.castingLight.shadowMapper.textureMap; return (r._shadowTexture = i.getAbstraction(r._shader)), r; } return ( e(n, t), (n.prototype._initVO = function (t) { this._shadowTexture._initVO(t); }), (n.prototype._initConstants = function () { this._shadowTexture._initConstants(); var t = this._shader.fragmentConstantData, e = this._decRegIndex; (t[e] = 1), (t[e + 1] = 1 / 255), (t[e + 2] = 1 / 65025), (t[e + 3] = 1 / 16581375); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = "", i = e.getFreeFragmentConstant(); return ( (this._decRegIndex = 4 * i.index), (r += this._shadowTexture._getFragmentCode(t, e, n, n.uvVarying) + "dp4 " + t + ".x, " + t + ", " + i + "\nmov " + t + ".yz, " + t + ".xx\t\t\t\nmov " + t + ".w, " + i + ".x\nsub " + t + ".xyz, " + i + ".xxx, " + t + ".xyz\n") ); }), n ); })(nl); Pi.registerAbstraction(il, rl); var ol = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._onShaderInvalidatedDelegate = function (t) { return n.onShaderInvalidated(t); }), (n._baseMethod = e || n.createBaseMethod()), n._baseMethod.addEventListener( Ru.SHADER_INVALIDATED, n._onShaderInvalidatedDelegate ), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "baseMethod", { get: function () { return this._baseMethod; }, set: function (t) { this._baseMethod != t && (this._baseMethod.removeEventListener( Ru.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate ), (this._baseMethod = t), this._baseMethod.addEventListener( Ru.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate ), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.prototype.createBaseMethod = function () { throw new u(); }), (n.prototype.iAddOwner = function (e) { t.prototype.iAddOwner.call(this, e), this._baseMethod.iAddOwner(e); }), (n.prototype.iRemoveOwner = function (e) { t.prototype.iRemoveOwner.call(this, e), this._baseMethod.iRemoveOwner(e); }), (n.prototype.dispose = function () { this._baseMethod.removeEventListener( Ru.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate ); }), (n.prototype.onShaderInvalidated = function (t) { this.invalidateShaderProgram(); }), n ); })(Vu), al = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r.chunkVO = new Ki()), (r._baseChunk = e.baseMethod.getAbstraction(n)), r ); } return ( e(n, t), (n.prototype._isUsed = function () { return !0; }), (n.prototype._usesTangentSpace = function () { return this._baseChunk._usesTangentSpace(); }), (n.prototype._initVO = function (t) { this._baseChunk._initVO(t); }), (n.prototype._initConstants = function () { this._baseChunk._initConstants(); }), (n.prototype._activate = function () { this._baseChunk._activate(); }), (n.prototype._setRenderState = function (t) { this._baseChunk._setRenderState(t); }), (n.prototype._deactivate = function () { this._baseChunk._deactivate(), (this._invalid = !1); }), (n.prototype._getVertexCode = function (t, e) { return this._baseChunk._getVertexCode(t, e); }), (n.prototype._getFragmentCode = function (t, e, n) { return this._baseChunk._getFragmentCode(t, e, n); }), (n.prototype._reset = function (t) { this._baseChunk._reset(t), (this._invalid = !0), this._cleanCompilationData(); }), (n.prototype._cleanCompilationData = function () { this._baseChunk._cleanCompilationData(); }), n ); })(W), sl = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getFragmentPreLightingCode = function (t, e) { return this._baseChunk._getFragmentPreLightingCode(t, e); }), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i = this._baseChunk._getFragmentCodePerLight(t, e, n, r); return ( (this._totalLightColorReg = this._baseChunk._totalLightColorReg), i ); }), (n.prototype._getFragmentCodePerProbe = function (t, e, n, r) { var i = this._baseChunk._getFragmentCodePerProbe(t, e, n, r); return ( (this._totalLightColorReg = this._baseChunk._totalLightColorReg), i ); }), n ); })(al), ul = (function (t) { function n() { var e = t.call(this) || this; return ( (e._multiply = !0), (e._ambientColorR = 1), (e._ambientColorG = 1), (e._ambientColorB = 1), (e._color = 16777215), (e._colorR = 1), (e._colorG = 1), (e._colorB = 1), e ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "multiply", { get: function () { return this._multiply; }, set: function (t) { this._multiply != t && ((this._multiply = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { this._color != t && ((this._color = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.iRemoveTexture(this._texture), (this._texture = t), this._texture && this.iAddTexture(this._texture), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { this._texture = null; }), (n.prototype.copyFrom = function (t) { var e = t; (this.texture = e.texture), (this.multiply = e.multiply), (this.color = e.color); }), (n.assetType = "[asset DiffuseBasicMethod]"), n ); })(Vu), ll = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._ambientColorR = 1), (r._ambientColorG = 1), (r._ambientColorB = 1), (r._color = 16777215), (r._colorR = 1), (r._colorG = 1), (r._colorB = 1), (r._method = e), (r._shader = n), r ); } return ( e(n, t), (n.prototype.onInvalidate = function (e) { t.prototype.onInvalidate.call(this, e), this._updateProperties(); }), (n.prototype._isUsed = function () { return Boolean(this._shader.numLights); }), (n.prototype._initVO = function (t) { this._method.texture ? ((this._texture = this._method.texture.getAbstraction( this._shader )), this._texture._initVO(t), this._method.texture instanceof fo ? (t.needsNormals = !0) : this._shader.uvDependencies++) : this._texture && (this._texture = null), this._shader.numLights && ((this._shader.usesCommonData = !0), (t.needsNormals = !0)); }), (n.prototype._initConstants = function () { this._texture && this._texture._initConstants(), this._updateProperties(); }), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._totalLightColorReg = null); }), (n.prototype._getFragmentPreLightingCode = function (t, e) { return ( (this._pIsFirstLight = !0), t.addFragmentTempUsages( (this._totalLightColorReg = t.getFreeFragmentVectorTemp()), 1 ), "" ); }), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i, o = ""; return ( this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)), (o += "dp3 " + i + ".x, " + t + ", " + r.normalFragment + "\nmax " + i + ".w, " + i + ".x, " + r.commons + ".y\n"), this._shader.usesLightFallOff && (o += "mul " + i + ".w, " + i + ".w, " + t + ".w\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), (o += "mul " + i + ", " + i + ".w, " + e + "\n"), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + i + "\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), (n.prototype._getFragmentCodePerProbe = function (t, e, n, r) { var i, o = ""; return ( this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)), (o += "tex " + i + ", " + r.normalFragment + ", " + t + " \nmul " + i + ".xyz, " + i + ".xyz, " + e + "\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + i + "\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), (n.prototype._getFragmentCode = function (t, e, n) { var r, i = ""; n.shadowTarget && (i += this._applyShadow(e, n)), e.addFragmentTempUsages((r = e.getFreeFragmentVectorTemp()), 1); var o = e.getFreeFragmentConstant(); if (((this._ambientColorRegister = 4 * o.index), this._texture)) i += this._texture._getFragmentCode( r, e, n, this._method.texture instanceof fo ? n.normalFragment : n.uvVarying ); else { var a = e.getFreeFragmentConstant(); (this._diffuseColorRegister = 4 * a.index), (i += "mov " + r + ", " + a + "\n"); } return ( (i += "sat " + this._totalLightColorReg + ", " + this._totalLightColorReg + "\nmul " + r + ".xyz, " + r + ", " + this._totalLightColorReg + "\n"), this._method.multiply ? (i += "add " + r + ".xyz, " + r + ", " + o + "\nmul " + t + ".xyz, " + t + ", " + r + "\n") : this._texture ? (i += "mul " + t + ".xyz, " + t + ", " + o + "\nmul " + this._totalLightColorReg + ".xyz, " + t + ", " + this._totalLightColorReg + "\nsub " + t + ".xyz, " + t + ", " + this._totalLightColorReg + "\nadd " + t + ".xyz, " + t + ", " + r + "\n") : (i += "mul " + this._totalLightColorReg + ".xyz, " + o + ", " + this._totalLightColorReg + "\nsub " + this._totalLightColorReg + ".xyz, " + o + ", " + this._totalLightColorReg + "\nadd " + r + ".xyz, " + r + ", " + this._totalLightColorReg + "\nmul " + t + ".xyz, " + t + ", " + r + "\n"), e.removeFragmentTempUsage(this._totalLightColorReg), e.removeFragmentTempUsage(r), i ); }), (n.prototype._applyShadow = function (t, e) { return ( "mul " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + e.shadowTarget + ".w\n" ); }), (n.prototype._activate = function () { if (this._texture) this._texture.activate(); else { var t = this._diffuseColorRegister, e = this._shader.fragmentConstantData; this._method.multiply ? ((e[t] = this._colorR * this._ambientColorR), (e[t + 1] = this._colorG * this._ambientColorG), (e[t + 2] = this._colorB * this._ambientColorB)) : ((e[t] = this._colorR), (e[t + 1] = this._colorG), (e[t + 2] = this._colorB)), (e[t + 3] = 1); } }), (n.prototype._updateProperties = function () { (this._ambientColor = this._shader.renderMaterial.style.color), (this._ambientColorR = ((this._ambientColor >> 16) & 255) / 255), (this._ambientColorG = ((this._ambientColor >> 8) & 255) / 255), (this._ambientColorB = (255 & this._ambientColor) / 255), (this._color = this._method.color), (this._colorR = ((this._color >> 16) & 255) / 255), (this._colorG = ((this._color >> 8) & 255) / 255), (this._colorB = (255 & this._color) / 255); }), (n.prototype._setRenderState = function (t) { this._texture && this._texture._setRenderState(t); var e = this._ambientColorRegister, n = this._shader.fragmentConstantData; (n[e] = this._shader.ambientR * this._ambientColorR), (n[e + 1] = this._shader.ambientG * this._ambientColorG), (n[e + 2] = this._shader.ambientB * this._ambientColorB), (n[e + 3] = 1); }), n ); })(Qu); Pi.registerAbstraction(ll, ul); var cl = (function (t) { function n(e) { return void 0 === e && (e = null), t.call(this, e) || this; } return ( e(n, t), (n.prototype.createBaseMethod = function () { return new ul(); }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._baseMethod.texture; }, set: function (t) { this._baseMethod.texture = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._baseMethod.color; }, set: function (t) { this._baseMethod.color = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "multiply", { get: function () { return this._baseMethod.multiply; }, set: function (t) { this._baseMethod.multiply = t; }, enumerable: !0, configurable: !0, }), n ); })(ol), hl = (function (t) { function n(e, n, r) { void 0 === e && (e = 3), void 0 === n && (n = 0.1), void 0 === r && (r = null); var i = t.call(this, r) || this; return (i._levels = e), (i._smoothness = n), i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "levels", { get: function () { return this._levels; }, set: function (t) { this._levels = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "smoothness", { get: function () { return this._smoothness; }, set: function (t) { this._smoothness = t; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset DiffuseCelMethod]"), n ); })(cl), pl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._method = e), (r._shader = n), (r._baseChunk._modulateFunction = function (t, e, n) { return r.clampDiffuse(t, e, n); }), r ); } return ( e(n, t), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._shader.fragmentConstantData, n = this._clampDataIndex; (e[n + 1] = 1), (e[n + 2] = 0); }), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._clampDataRegister = null); }), (n.prototype._getFragmentPreLightingCode = function (e, n) { return ( (this._clampDataRegister = e.getFreeFragmentConstant()), (this._clampDataIndex = 4 * this._clampDataRegister.index), t.prototype._getFragmentPreLightingCode.call(this, e, n) ); }), (n.prototype._activate = function () { if ((t.prototype._activate.call(this), this._invalid)) { var e = this._shader.fragmentConstantData, n = this._clampDataIndex; (e[n] = this._method.levels), (e[n + 3] = this._method.smoothness); } }), (n.prototype.clampDiffuse = function (t, e, n) { return ( "mul " + t + ".w, " + t + ".w, " + this._clampDataRegister + ".x\nfrc " + t + ".z, " + t + ".w\nsub " + t + ".y, " + t + ".w, " + t + ".z\nmov " + t + ".x, " + this._clampDataRegister + ".x\nsub " + t + ".x, " + t + ".x, " + this._clampDataRegister + ".y\nrcp " + t + ".x," + t + ".x\nmul " + t + ".w, " + t + ".y, " + t + ".x\nsub " + t + ".y, " + t + ".w, " + t + ".x\ndiv " + t + ".z, " + t + ".z, " + this._clampDataRegister + ".w\nsat " + t + ".z, " + t + ".z\nmul " + t + ".w, " + t + ".w, " + t + ".z\nsub " + t + ".z, " + this._clampDataRegister + ".y, " + t + ".z\nmul " + t + ".y, " + t + ".y, " + t + ".z\nadd " + t + ".w, " + t + ".w, " + t + ".y\nsat " + t + ".w, " + t + ".w\n" ); }), n ); })(sl); Pi.registerAbstraction(pl, hl); var dl = (function (t) { function n(e) { var n = t.call(this) || this; return (n._gradient = e), n.iAddTexture(n._gradient), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "gradient", { get: function () { return this._gradient; }, set: function (t) { this._gradient != t && (this._gradient && this.iRemoveTexture(this._gradient), (this._gradient = t), this._gradient && this.iAddTexture(this._gradient), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset DiffuseGradientMethod]"), n ); })(ul), fl = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e); var n = this._method.gradient || new mo(); (this._gradient = n.getAbstraction(this._shader)), this._gradient._initVO(e); }), (n.prototype._initConstants = function () { this._gradient._initConstants(); }), (n.prototype._getFragmentPreLightingCode = function (e, n) { var r = t.prototype._getFragmentPreLightingCode.call(this, e, n); return (this._pIsFirstLight = !0), r; }), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i, o = ""; return ( this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)), (o += "dp3 " + i + ".w, " + t + ".xyz, " + r.normalFragment + ".xyz\nmul " + i + ".w, " + i + ".w, " + r.commons + ".x\nadd " + i + ".w, " + i + ".w, " + r.commons + ".x\nmul " + i + ".xyz, " + i + ".w, " + t + ".w\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), (o += this._gradient._getFragmentCode(i, n, r, i) + "mul " + i + ".xyz, " + i + ".xyz, " + e + ".xyz\n"), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ".xyz, " + i + ".xyz\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), (n.prototype._activate = function () { t.prototype._activate.call(this), this._gradient.activate(); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._gradient._setRenderState(e); }), n ); })(ll); Pi.registerAbstraction(fl, dl); var gl = (function (t) { function n(e, n, r, i) { void 0 === n && (n = "multiply"), void 0 === r && (r = !1), void 0 === i && (i = null); var o = t.call(this, i) || this; return ( (o._lightMap = e), (o.blendMode = n), (o._useSecondaryUV = r), o._lightMap && o.iAddTexture(o._lightMap), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blendMode", { get: function () { return this._blendMode; }, set: function (t) { if (t != n.ADD && t != n.MULTIPLY) throw new Error("Unknown blendmode!"); this._blendMode != t && ((this._blendMode = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightMap", { get: function () { return this._lightMap; }, set: function (t) { this._lightMap != t && (this._lightMap && this.iRemoveTexture(this._lightMap), (this._lightMap = t), this._lightMap && this.iAddTexture(this._lightMap), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "useSecondaryUV", { get: function () { return this._useSecondaryUV; }, set: function (t) { this._useSecondaryUV != t && ((this._useSecondaryUV = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.MULTIPLY = "multiply"), (n.ADD = "add"), (n.assetType = "[asset DiffuseLightMapMethod]"), n ); })(cl), _l = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { var e = this._method.lightMap || new mo(); (this._lightMap = e.getAbstraction(this._shader)), this._lightMap._initVO(t), this._method.useSecondaryUV ? this._shader.secondaryUVDependencies++ : this._shader.uvDependencies++; }), (n.prototype._initConstants = function () { this._lightMap._initConstants(); }), (n.prototype._getFragmentCode = function (e, n, r) { var i, o = n.getFreeFragmentVectorTemp(); switch ( ((i = this._lightMap._getFragmentCode( o, n, r, this._method.useSecondaryUV ? r.secondaryUVVarying : r.uvVarying )), this._method.blendMode) ) { case gl.MULTIPLY: i += "mul " + this._totalLightColorReg + ", " + this._totalLightColorReg + ", " + o + "\n"; break; case gl.ADD: i += "add " + this._totalLightColorReg + ", " + this._totalLightColorReg + ", " + o + "\n"; } return (i += t.prototype._getFragmentCode.call(this, e, n, r)); }), (n.prototype._activate = function () { t.prototype._activate.call(this), this._lightMap.activate(); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._lightMap._setRenderState(e); }), n ); })(sl); Pi.registerAbstraction(_l, gl); var ml = (function (t) { function n(e) { void 0 === e && (e = 0.5); var n = t.call(this) || this; return (n.wrapFactor = e), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "wrapFactor", { get: function () { return this._wrapFactor; }, set: function (t) { (this._wrapFactor = t), (this._wrapFactor = 1 / (t + 1)), this.invalidate(); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset DiffuseWrapMethod]"), n ); })(ul), yl = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._wrapDataRegister = null); }), (n.prototype._getFragmentPreLightingCode = function (e, n) { var r = t.prototype._getFragmentPreLightingCode.call(this, e, n); return ( (this._pIsFirstLight = !0), (this._wrapDataRegister = e.getFreeFragmentConstant()), (this._wrapDataIndex = 4 * this._wrapDataRegister.index), r ); }), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i, o = ""; return ( this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)), (o += "dp3 " + i + ".x, " + t + ".xyz, " + r.normalFragment + ".xyz\nadd " + i + ".y, " + i + ".x, " + this._wrapDataRegister + ".x\nmul " + i + ".y, " + i + ".y, " + this._wrapDataRegister + ".y\nsat " + i + ".w, " + i + ".y\nmul " + i + ".xz, " + i + ".w, " + t + ".wz\n"), null != this._modulateFunction && (o += this._modulateFunction(t, n, r)), (o += "mul " + i + ", " + i + ".x, " + e + "\n"), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ".xyz, " + i + ".xyz\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), (n.prototype._activate = function () { if ((t.prototype._activate.call(this), this._invalid)) { var e = this._wrapDataIndex, n = this._shader.fragmentConstantData; (n[e] = this._method.wrapFactor), (n[e + 1] = 1 / (this._method.wrapFactor + 1)); } }), n ); })(ll); Pi.registerAbstraction(yl, ml); var Al = (function (t) { function n(e, n) { void 0 === n && (n = !1); var r = t.call(this) || this; return ( (r._texture = e), (r._useSecondaryUV = n), r._texture && r.iAddTexture(r._texture), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.iRemoveTexture(this._texture), (this._texture = t), this._texture && this.iAddTexture(this._texture), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "useSecondaryUV", { get: function () { return this._useSecondaryUV; }, set: function (t) { this._useSecondaryUV != t && ((this._useSecondaryUV = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset EffectAlphaMaskMethod]"), n ); })(Vu), vl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { var e = this._method.texture || new mo(); (this._alphaMask = e.getAbstraction(this._shader)), this._alphaMask._initVO(t), this._method.useSecondaryUV ? this._shader.secondaryUVDependencies++ : this._shader.uvDependencies++; }), (n.prototype._initConstants = function () { this._alphaMask._initConstants(); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = e.getFreeFragmentVectorTemp(); return ( this._alphaMask._getFragmentCode( r, e, n, this._method.useSecondaryUV ? n.secondaryUVVarying : n.uvVarying ) + "mul " + t + ", " + t + ", " + r + ".x\n" ); }), (n.prototype._activate = function () { t.prototype._activate.call(this), this._alphaMask.activate(); }), (n.prototype._setRenderState = function (t) { this._alphaMask._setRenderState(t); }), n ); })(Qu); Pi.registerAbstraction(vl, Al); var bl = (function (t) { function n(e) { var n = t.call(this) || this; if (20 != e.length) throw new Error("Matrix length must be 20!"); return (n._matrix = e), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "matrix", { get: function () { return this._matrix; }, set: function (t) { if (20 != t.length) throw new Error("Matrix length must be 20!"); (this._matrix = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset EffectColorMatrixMethod]"), n ); })(Vu), Cl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._getFragmentCode = function (t, e, n) { var r = "", i = e.getFreeFragmentConstant(); e.getFreeFragmentConstant(), e.getFreeFragmentConstant(), e.getFreeFragmentConstant(); var o = e.getFreeFragmentConstant(); this._colorMatrixIndex = 4 * i.index; var a = e.getFreeFragmentVectorTemp(); return (r += "m44 " + a + ", " + t + ", " + i + "\nadd " + t + ", " + a + ", " + o + "\n"); }), (n.prototype._activate = function () { if (this._invalid) { var t = this._method.matrix, e = this._colorMatrixIndex, n = this._shader.fragmentConstantData; (n[e] = t[0]), (n[e + 1] = t[1]), (n[e + 2] = t[2]), (n[e + 3] = t[3]), (n[e + 4] = t[5]), (n[e + 5] = t[6]), (n[e + 6] = t[7]), (n[e + 7] = t[8]), (n[e + 8] = t[10]), (n[e + 9] = t[11]), (n[e + 10] = t[12]), (n[e + 11] = t[13]), (n[e + 12] = t[15]), (n[e + 13] = t[16]), (n[e + 14] = t[17]), (n[e + 15] = t[18]), (n[e + 16] = t[4]), (n[e + 17] = t[9]), (n[e + 18] = t[14]), (n[e + 19] = t[19]); } }), n ); })(Qu); Pi.registerAbstraction(Cl, bl); var Il = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return (n._colorTransform = e), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "colorTransform", { get: function () { return this._colorTransform; }, set: function (t) { (this._colorTransform = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset EffectColorTransformMethod]"), n ); })(Vu), El = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._getFragmentCode = function (t, e, n) { var r = "", i = e.getFreeFragmentConstant(), o = e.getFreeFragmentConstant(); return ( (this._colorTransformIndex = 4 * i.index), (r += "mul " + t + ", " + t + ", " + i + "\nadd " + t + ", " + t + ", " + o + "\n") ); }), (n.prototype._activate = function () { if (this._invalid) { var t = this._colorTransformIndex, e = this._shader.fragmentConstantData, n = this._method.colorTransform._rawData; (e[t] = n[0]), (e[t + 1] = n[1]), (e[t + 2] = n[2]), (e[t + 3] = n[3]), (e[t + 4] = n[4]), (e[t + 5] = n[5]), (e[t + 6] = n[6]), (e[t + 7] = n[7]); } }), n ); })(Qu); Pi.registerAbstraction(El, Il); var xl = (function (t) { function n(e, n) { void 0 === n && (n = 1); var r = t.call(this) || this; return (r._envMap = e), (r._alpha = n), r.iAddTexture(r._envMap), r; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "envMap", { get: function () { return this._envMap; }, set: function (t) { this._envMap != t && (this._envMap && this.iRemoveTexture(this._envMap), (this._envMap = t), this._envMap && this.iAddTexture(this._envMap), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mask", { get: function () { return this._mask; }, set: function (t) { t != this._mask && (this._mask && this.iRemoveTexture(this._mask), (this._mask = t), this._mask && this.iAddTexture(this._mask), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._alpha; }, set: function (t) { (this._alpha = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () {}), (n.assetType = "[asset EffectEnvMapMethod]"), n ); })(Vu), wl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { (t.needsNormals = !0), (t.needsView = !0), (this._envMap = this._method.envMap.getAbstraction(this._shader)), this._envMap._initVO(t), this._method.mask ? ((this._maskMap = this._method.mask.getAbstraction( this._shader )), this._shader.uvDependencies++) : this._maskMap && (this._maskMap = null); }), (n.prototype._initConstants = function () { this._envMap._initConstants(); }), (n.prototype.dispose = function () { (this._envMap = null), (this._maskMap = null); }), (n.prototype._activate = function () { this._envMap.activate(), this._maskMap && this._maskMap.activate(), this._invalid && this._updateProperties(); }), (n.prototype._setRenderState = function (t) { this._envMap._setRenderState(t), this._maskMap && this._maskMap._setRenderState(t); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = e.getFreeFragmentConstant(), i = ""; this._fragmentIndex = 4 * r.index; var o = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(o, 1); var a = e.getFreeFragmentVectorTemp(); return ( e.addFragmentTempUsages(a, 1), (i += "dp3 " + o + ".w, " + n.viewDirFragment + ".xyz, " + n.normalFragment + ".xyz\nadd " + o + ".w, " + o + ".w, " + o + ".w\nmul " + o + ".xyz, " + n.normalFragment + ".xyz, " + o + ".w\nsub " + o + ".xyz, " + o + ".xyz, " + n.viewDirFragment + ".xyz\n" + this._envMap._getFragmentCode(o, e, n, o) + "sub " + a + ".w, " + o + ".w, fc0.x\nkil " + a + ".w\nsub " + o + ", " + o + ", " + t + "\n"), this._maskMap && (i += this._maskMap._getFragmentCode(a, e, n, n.uvVarying) + "mul " + o + ", " + a + ", " + o + "\n"), (i += "mul " + o + ", " + o + ", " + r + ".x\nadd " + t + ", " + t + ", " + o + "\n"), e.removeFragmentTempUsage(o), e.removeFragmentTempUsage(a), i ); }), (n.prototype._updateProperties = function () { this._shader.fragmentConstantData[this._fragmentIndex] = this._method.alpha; }), n ); })(Qu); Pi.registerAbstraction(wl, xl); var Sl = (function (t) { function n(e, n, r) { void 0 === e && (e = 0), void 0 === n && (n = 1e3), void 0 === r && (r = 8421504); var i = t.call(this) || this; return (i._minDistance = e), (i._maxDistance = n), (i._fogColor = r), i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "minDistance", { get: function () { return this._minDistance; }, set: function (t) { (this._minDistance = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "maxDistance", { get: function () { return this._maxDistance; }, set: function (t) { (this._maxDistance = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fogColor", { get: function () { return this._fogColor; }, set: function (t) { (this._fogColor = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset EffectFogMethod]"), n ); })(Vu), Dl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { t.needsProjection = !0; }), (n.prototype._activate = function () { if (this._invalid) { var t = this._shader.fragmentConstantData, e = this._fogColorIndex, n = this._method.fogColor; (t[e] = ((n >> 16) & 255) / 255), (t[e + 1] = ((n >> 8) & 255) / 255), (t[e + 2] = (255 & n) / 255), (t[e + 3] = 1), (t[e + 4] = this._method.minDistance), (t[e + 5] = 1 / (this._method.maxDistance - this._method.minDistance)), (t[e + 6] = 0), (t[e + 7] = 0); } }), (n.prototype._getFragmentCode = function (t, e, n) { var r = e.getFreeFragmentConstant(), i = e.getFreeFragmentConstant(), o = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(o, 1); var a = e.getFreeFragmentVectorTemp(), s = ""; return ( (this._fogColorIndex = 4 * r.index), (s += "sub " + a + ".w, " + n.projectionFragment + ".z, " + i + ".x\nmul " + a + ".w, " + a + ".w, " + i + ".y\nsat " + a + ".w, " + a + ".w\nsub " + o + ", " + r + ", " + t + "\nmul " + o + ", " + o + ", " + a + ".w\nadd " + t + ", " + t + ", " + o + "\n"), e.removeFragmentTempUsage(o), s ); }), n ); })(Qu); Pi.registerAbstraction(Dl, Sl); var Tl = (function (t) { function n(e, n, r, i) { void 0 === n && (n = 1), void 0 === r && (r = 5), void 0 === i && (i = 0); var o = t.call(this, e, n) || this; return (o._fresnelPower = r), (o._normalReflectance = i), o; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fresnelPower", { get: function () { return this._fresnelPower; }, set: function (t) { this._fresnelPower = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "normalReflectance", { get: function () { return this._normalReflectance; }, set: function (t) { this._normalReflectance != t && ((this._normalReflectance = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset EffectFresnelEnvMapMethod]"), n ); })(xl), Pl = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getFragmentCode = function (t, e, n) { var r = e.getFreeFragmentConstant(), i = "", o = n.viewDirFragment, a = n.normalFragment; this._fragmentIndex = 4 * r.index; var s = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(s, 1); var u = e.getFreeFragmentVectorTemp(); return ( e.addFragmentTempUsages(u, 1), (i += "dp3 " + s + ".w, " + o + ".xyz, " + a + ".xyz\nadd " + s + ".w, " + s + ".w, " + s + ".w\nmul " + s + ".xyz, " + a + ".xyz, " + s + ".w\nsub " + s + ".xyz, " + s + ".xyz, " + o + ".xyz\n" + this._envMap._getFragmentCode(s, e, n, s) + "sub " + u + ".w, " + s + ".w, fc0.x\nkil " + u + ".w\nsub " + s + ", " + s + ", " + t + "\n"), (i += "dp3 " + o + ".w, " + o + ".xyz, " + a + ".xyz\nsub " + o + ".w, " + r + ".w, " + o + ".w\npow " + o + ".w, " + o + ".w, " + r + ".z\nsub " + a + ".w, " + r + ".w, " + o + ".w\nmul " + a + ".w, " + r + ".y, " + a + ".w\nadd " + o + ".w, " + o + ".w, " + a + ".w\nmul " + o + ".w, " + r + ".x, " + o + ".w\n"), this._maskMap && (i += this._maskMap._getFragmentCode(u, e, n, n.uvVarying) + "mul " + o + ".w, " + u + ".x, " + o + ".w\n"), (i += "mul " + s + ", " + s + ", " + o + ".w\nadd " + t + ", " + t + ", " + s + "\n"), e.removeFragmentTempUsage(s), e.removeFragmentTempUsage(u), i ); }), (n.prototype._updateProperties = function () { var t = this._fragmentIndex, e = this._shader.fragmentConstantData; (e[t] = this._method.alpha), (e[t + 1] = this._method.normalReflectance), (e[t + 2] = this._method.fresnelPower); }), n ); })(wl); Pi.registerAbstraction(Pl, Tl); var Ol = (function (t) { function n(e, r, i) { void 0 === r && (r = "multiply"), void 0 === i && (i = !1); var o = t.call(this) || this; if (r != n.ADD && r != n.MULTIPLY) throw new Error("Unknown blendmode!"); return ( (o._lightMap = e), (o._blendMode = r), (o._useSecondaryUV = i), o._lightMap && o.iAddTexture(o._lightMap), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blendMode", { get: function () { return this._blendMode; }, set: function (t) { if (this._blendMode != t) { if (t != n.ADD && t != n.MULTIPLY) throw new Error("Unknown blendmode!"); (this._blendMode = t), this.invalidateShaderProgram(); } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightMap", { get: function () { return this._lightMap; }, set: function (t) { this._lightMap != t && (this._lightMap && this.iRemoveTexture(this._lightMap), (this._lightMap = t), this._lightMap && this.iAddTexture(this._lightMap), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "useSecondaryUV", { get: function () { return this._useSecondaryUV; }, set: function (t) { this._useSecondaryUV != t && ((this._useSecondaryUV = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.MULTIPLY = "multiply"), (n.ADD = "add"), (n.assetType = "[asset EffectLightMapMethod]"), n ); })(Vu), Bl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { (this._lightMap = this._method.lightMap.getAbstraction(this._shader)), this._lightMap._initVO(t), this._method.useSecondaryUV ? this._shader.secondaryUVDependencies++ : this._shader.uvDependencies++; }), (n.prototype._initConstants = function () { this._lightMap._initConstants(); }), (n.prototype._getFragmentCode = function (t, e, n) { var r, i = e.getFreeFragmentVectorTemp(); switch ( ((r = this._lightMap._getFragmentCode( i, e, n, this._method.useSecondaryUV ? n.secondaryUVVarying : n.uvVarying )), this._method.blendMode) ) { case Ol.MULTIPLY: r += "mul " + t + ", " + t + ", " + i + "\n"; break; case Ol.ADD: r += "add " + t + ", " + t + ", " + i + "\n"; } return r; }), (n.prototype._activate = function () { this._lightMap.activate(); }), (n.prototype._setRenderState = function (t) { this._lightMap._setRenderState(t); }), n ); })(Qu); Pi.registerAbstraction(Bl, Ol); var Ml = (function (t) { function n(e, n, r) { void 0 === n && (n = "multiply"), void 0 === r && (r = 1); var i = t.call(this) || this; return ( (i._onTextureChangedDelegate = function (t) { return i._onTextureChanged(t); }), (i._projector = e), (i._exposure = r), (i._mode = n), i._projector.addEventListener( Nu.TEXTURE_CHANGE, i._onTextureChangedDelegate ), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "exposure", { get: function () { return this._exposure; }, set: function (t) { this._exposure != t && ((this._exposure = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mode", { get: function () { return this._mode; }, set: function (t) { this._mode != t && ((this._mode = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "projector", { get: function () { return this._projector; }, set: function (t) { this._projector != t && (this._projector && this._projector.removeEventListener( Nu.TEXTURE_CHANGE, this._onTextureChangedDelegate ), (this._projector = t), this._projector && this._projector.addEventListener( Nu.TEXTURE_CHANGE, this._onTextureChangedDelegate ), this.updateTexture()); }, enumerable: !0, configurable: !0, }), (n.prototype._onTextureChanged = function (t) { this.updateTexture(); }), (n.prototype.updateTexture = function () { this._texture && this.iRemoveTexture(this._texture), (this._texture = this._projector ? this._projector.texture : null), this._texture && this.iAddTexture(this._texture), this.invalidateShaderProgram(); }), (n.OVERLAY = "overlay"), (n.MULTIPLY = "multiply"), (n.ADD = "add"), (n.MIX = "mix"), (n.assetType = "[asset EffectProjectiveTextureMethod]"), n ); })(Vu), Ll = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { (this._texture = this._method.projector.texture.getAbstraction( this._shader )), this._texture._initVO(t); }), (n.prototype._initConstants = function () { this._texture._initConstants(); var t = this._exposureIndex, e = this._shader.fragmentConstantData; (e[t] = this._method.exposure), (e[t + 1] = 0.5), (e[t + 2] = 4), (e[t + 3] = -1), (this._projectionMatrix = new F( new Float32Array( this._shader.vertexConstantData.buffer, 4 * this._projectionIndex, 16 ) )); }), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._uvVarying = null), (this._projectionMatrix = null); }), (n.prototype._getVertexCode = function (t, e) { var n = "", r = t.getFreeVertexConstant(); return ( t.getFreeVertexConstant(), t.getFreeVertexConstant(), t.getFreeVertexConstant(), (this._projectionIndex = 4 * r.index), (this._uvVarying = t.getFreeVarying()), (n += "m44 " + this._uvVarying + ", " + e.animatedPosition + ", " + r + "\n") ); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = "", i = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(i, 1); var o = e.getFreeFragmentVectorTemp(), a = e.getFreeFragmentConstant(); if ( ((this._exposureIndex = 4 * a.index), (r += this._texture._getFragmentCode(i, e, n, this._uvVarying)), (r += "mul " + i + ", " + i + ", " + a + ".xxx\nadd " + i + ", " + i + ", " + a + ".xxx\n"), this._method.mode == Ml.MULTIPLY) ) r += "mul " + t + ".xyz, " + t + ".xyz, " + i + ".xyz\t\t\t\n"; else if (this._method.mode == Ml.ADD) r += "add " + t + ".xyz, " + t + ".xyz, " + i + ".xyz\t\t\t\n"; else if (this._method.mode == Ml.MIX) r += "sub " + i + ".xyz, " + i + ".xyz, " + t + ".xyz\t\t\t\t\nmul " + i + ".xyz, " + i + ".xyz, " + i + ".w\t\t\t\t\t\t\nadd " + t + ".xyz, " + t + ".xyz, " + i + ".xyz\t\t\t\n"; else { if (this._method.mode != Ml.OVERLAY) throw new s('Unknown mode "' + this._method.mode + '"'); (r += "sge " + o + ", " + t + ", " + a + ".yyy\n"), (r += "sub " + t + ", " + t + ", " + o + "\n"), (r += "sub " + i + ", " + i + ", " + o + "\n"), (r += "mul " + i + ", " + i + ", " + t + "\n"), (r += "sub " + t + ", " + a + ".yyy, " + o + "\n"), (r += "mul " + t + ", " + a + ".zzz, " + t + "\n"), (r += "mul " + i + ", " + i + ", " + t + "\n"), (r += "add " + t + ", " + i + ", " + o + "\n"); } return e.removeFragmentTempUsage(i), r; }), (n.prototype._setRenderState = function (t) { var e = F.CALCULATION_MATRIX; e.copyFrom(this._method.projector.projection.viewMatrix3D), e.prepend(t.renderSceneTransform), this._projectionMatrix.copyFrom(e, !0), this._texture._setRenderState(t); }), (n.prototype._activate = function () { this._texture.activate(), this._invalid && (this._shader.fragmentConstantData[this._exposureIndex] = this._method.exposure); }), n ); })(Qu); Pi.registerAbstraction(Ll, Ml); var Nl = (function (t) { function n(e, n, r, i, o, a) { void 0 === n && (n = 1), void 0 === r && (r = 0.1), void 0 === i && (i = 0), void 0 === o && (o = 0), void 0 === a && (a = 0); var s = t.call(this, e, n) || this; return ( (s._dispersionR = 0), (s._dispersionG = 0), (s._dispersionB = 0), (s._refractionIndex = r), (s._dispersionR = i), (s._dispersionG = o), (s._dispersionB = a), s ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "refractionIndex", { get: function () { return this._refractionIndex; }, set: function (t) { (this._refractionIndex = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "dispersionR", { get: function () { return this._dispersionR; }, set: function (t) { this._dispersionR != t && ((this._dispersionR = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "dispersionG", { get: function () { return this._dispersionG; }, set: function (t) { this._dispersionG != t && ((this._dispersionG = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "dispersionB", { get: function () { return this._dispersionB; }, set: function (t) { this._dispersionB != t && ((this._dispersionB = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset EffectRefractionEnvMapMethod]"), n ); })(xl), Rl = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (this._useDispersion = !( this._method.dispersionR == this._method.dispersionB && this._method.dispersionR == this._method.dispersionG )); }), (n.prototype._getFragmentCode = function (t, e, n) { var r, i, o, a = e.getFreeFragmentConstant(), s = e.getFreeFragmentConstant(), u = ""; (this._fragmentIndex = 4 * a.index), (r = e.getFreeFragmentVectorTemp()), e.addFragmentTempUsages(r, 1), (i = e.getFreeFragmentVectorTemp()), e.addFragmentTempUsages(i, 1), (o = e.getFreeFragmentVectorTemp()), e.addFragmentTempUsages(o, 1); var l = n.viewDirFragment, c = n.normalFragment; return ( (u += "neg " + l + ".xyz, " + l + ".xyz\n"), (u += "dp3 " + o + ".x, " + l + ".xyz, " + c + ".xyz\nmul " + o + ".w, " + o + ".x, " + o + ".x\nsub " + o + ".w, " + s + ".x, " + o + ".w\nmul " + o + ".w, " + a + ".x, " + o + ".w\nmul " + o + ".w, " + a + ".x, " + o + ".w\nsub " + o + ".w, " + s + ".x, " + o + ".w\nsqt " + o + ".y, " + o + ".w\nmul " + o + ".x, " + a + ".x, " + o + ".x\nadd " + o + ".x, " + o + ".x, " + o + ".y\nmul " + o + ".xyz, " + o + ".x, " + c + ".xyz\nmul " + r + ", " + a + ".x, " + l + "\nsub " + r + ".xyz, " + r + ".xyz, " + o + ".xyz\nnrm " + r + ".xyz, " + r + ".xyz\n" + this._envMap._getFragmentCode(i, e, n, r) + "sub " + i + ".w, " + i + ".w, fc0.x\t\nkil " + i + ".w\n"), this._useDispersion && ((u += "dp3 " + o + ".x, " + l + ".xyz, " + c + ".xyz\nmul " + o + ".w, " + o + ".x, " + o + ".x\nsub " + o + ".w, " + s + ".x, " + o + ".w\nmul " + o + ".w, " + a + ".y, " + o + ".w\nmul " + o + ".w, " + a + ".y, " + o + ".w\nsub " + o + ".w, " + s + ".x, " + o + ".w\nsqt " + o + ".y, " + o + ".w\nmul " + o + ".x, " + a + ".y, " + o + ".x\nadd " + o + ".x, " + o + ".x, " + o + ".y\nmul " + o + ".xyz, " + o + ".x, " + c + ".xyz\nmul " + r + ", " + a + ".y, " + l + "\nsub " + r + ".xyz, " + r + ".xyz, " + o + ".xyz\nnrm " + r + ".xyz, " + r + ".xyz\n" + this._envMap._getFragmentCode(o, e, n, r) + "mov " + i + ".y, " + o + ".y\n"), (u += "dp3 " + o + ".x, " + l + ".xyz, " + c + ".xyz\nmul " + o + ".w, " + o + ".x, " + o + ".x\nsub " + o + ".w, " + s + ".x, " + o + ".w\nmul " + o + ".w, " + a + ".z, " + o + ".w\nmul " + o + ".w, " + a + ".z, " + o + ".w\nsub " + o + ".w, " + s + ".x, " + o + ".w\nsqt " + o + ".y, " + o + ".w\nmul " + o + ".x, " + a + ".z, " + o + ".x\nadd " + o + ".x, " + o + ".x, " + o + ".y\nmul " + o + ".xyz, " + o + ".x, " + c + ".xyz\nmul " + r + ", " + a + ".z, " + l + "\nsub " + r + ".xyz, " + r + ".xyz, " + o + ".xyz\nnrm " + r + ".xyz, " + r + ".xyz\n" + this._envMap._getFragmentCode(o, e, n, r) + "mov " + i + ".z, " + o + ".z\n")), (u += "sub " + i + ".xyz, " + i + ".xyz, " + t + ".xyz\nmul " + i + ".xyz, " + i + ".xyz, " + a + ".w\nadd " + t + ".xyz, " + t + ".xyz, " + i + ".xyz\n"), e.removeFragmentTempUsage(o), e.removeFragmentTempUsage(r), e.removeFragmentTempUsage(i), (u += "neg " + l + ".xyz, " + l + ".xyz\n") ); }), (n.prototype._updateProperties = function () { var t = this._fragmentIndex, e = this._shader.fragmentConstantData, n = this._method.refractionIndex; (e[t] = this._method.dispersionR + n), this._useDispersion && ((e[t + 1] = this._method.dispersionG + n), (e[t + 2] = this._method.dispersionB + n)), (e[t + 3] = this._method.alpha); }), n ); })(wl); Pi.registerAbstraction(Rl, Nl); var Fl = (function (t) { function n(e, n, r, i) { void 0 === e && (e = 16777215), void 0 === n && (n = 0.4), void 0 === r && (r = 2), void 0 === i && (i = "mix"); var o = t.call(this) || this; return ( (o._blendMode = i), (o._strength = n), (o._power = r), (o._color = e), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { this._power != t && ((this._color = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "strength", { get: function () { return this._strength; }, set: function (t) { this._strength != t && ((this._strength = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "power", { get: function () { return this._power; }, set: function (t) { this._power != t && ((this._power = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blendMode", { get: function () { return this._blendMode; }, set: function (t) { this._blendMode != t && ((this._blendMode = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.ADD = "add"), (n.MULTIPLY = "multiply"), (n.MIX = "mix"), (n.assetType = "[asset EffectRimLightMethod]"), n ); })(Vu), kl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (t) { (t.needsNormals = !0), (t.needsView = !0); }), (n.prototype._activate = function () { if (this._invalid) { var t = this._rimColorIndex, e = this._shader.fragmentConstantData, n = this._method.color; (e[t] = ((n >> 16) & 255) / 255), (e[t + 1] = ((n >> 8) & 255) / 255), (e[t + 2] = (255 & n) / 255), (e[t + 3] = 1), (e[t + 4] = this._method.strength), (e[t + 5] = this._method.power); } }), (n.prototype._getFragmentCode = function (t, e, n) { var r = e.getFreeFragmentConstant(), i = e.getFreeFragmentConstant(), o = e.getFreeFragmentVectorTemp(), a = ""; return ( (this._rimColorIndex = 4 * r.index), (a += "dp3 " + o + ".x, " + n.viewDirFragment + ".xyz, " + n.normalFragment + ".xyz\nsat " + o + ".x, " + o + ".x\nsub " + o + ".x, " + r + ".w, " + o + ".x\npow " + o + ".x, " + o + ".x, " + i + ".y\nmul " + o + ".x, " + o + ".x, " + i + ".x\nsub " + o + ".x, " + r + ".w, " + o + ".x\nmul " + t + ".xyz, " + t + ".xyz, " + o + ".x\nsub " + o + ".w, " + r + ".w, " + o + ".x\n"), this._method.blendMode == Fl.ADD ? (a += "mul " + o + ".xyz, " + o + ".w, " + r + ".xyz\nadd " + t + ".xyz, " + t + ".xyz, " + o + ".xyz\n") : this._method.blendMode == Fl.MULTIPLY ? (a += "mul " + o + ".xyz, " + o + ".w, " + r + ".xyz\nmul " + t + ".xyz, " + t + ".xyz, " + o + ".xyz\n") : (a += "sub " + o + ".xyz, " + r + ".xyz, " + t + ".xyz\nmul " + o + ".xyz, " + o + ".xyz, " + o + ".w\nadd " + t + ".xyz, " + t + ".xyz, " + o + ".xyz\n"), a ); }), n ); })(Qu); Pi.registerAbstraction(kl, Fl); var Ul = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return (n._texture = e), n._texture && n.iAddTexture(n._texture), n; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.iRemoveTexture(this._texture), (this._texture = t), this._texture && this.iAddTexture(this._texture), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.prototype.copyFrom = function (t) { var e = t; null != e.texture && (this.texture = e.texture); }), (n.prototype.dispose = function () { this._texture && (this._texture = null); }), (n.assetType = "[asset NormalBasicMethod]"), n ); })(Vu), jl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._isUsed = function () { return !(!this._texture || !this._shader.normalDependencies); }), (n.prototype._initVO = function (t) { this._method.texture && ((this._texture = this._method.texture.getAbstraction( this._shader )), this._texture._initVO(t), this._shader.uvDependencies++); }), (n.prototype._initConstants = function () { this._method.texture && this._texture._initConstants(); }), (n.prototype._outputsTangentNormals = function () { return !0; }), (n.prototype._activate = function () { this._texture && this._texture.activate(); }), (n.prototype._setRenderState = function (t) { this._texture && this._texture._setRenderState(t); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = ""; return ( this._texture && (r += this._texture._getFragmentCode(t, e, n, n.uvVarying)), (r += "sub " + t + ".xyz, " + t + ".xyz, " + n.commons + ".xxx\nnrm " + t + ".xyz, " + t + "\n") ); }), n ); })(Qu); Pi.registerAbstraction(jl, Ul); var Vl = (function (t) { function n(e, n, r, i) { var o = t.call(this) || this; return ( (o.texture = e), (o._worldXYRatio = n / r), (o._worldXZRatio = i / r), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "worldXYRatio", { get: function () { return this._worldXYRatio; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "worldXZRatio", { get: function () { return this._worldXZRatio; }, enumerable: !0, configurable: !0, }), (n.prototype.copyFrom = function (e) { t.prototype.copyFrom.call(this, e), (this._worldXYRatio = e._worldXYRatio), (this._worldXZRatio = e._worldXZRatio); }), (n.assetType = "[asset NormalHeightMapMethod]"), n ); })(Ul), Ql = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._fragmentConstantsIndex, n = this._shader.fragmentConstantData, r = this._method.texture.image; (n[e] = 1 / r.width), (n[e + 1] = 1 / r.height), (n[e + 2] = 0), (n[e + 3] = 1), (n[e + 4] = this._method.worldXYRatio), (n[e + 5] = this._method.worldXZRatio); }), Object.defineProperty(n.prototype, "tangentSpace", { get: function () { return !1; }, enumerable: !0, configurable: !0, }), (n.prototype._getFragmentCode = function (t, e, n) { var r = "", i = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(i, 1); var o = e.getFreeFragmentConstant(), a = e.getFreeFragmentConstant(); return ( (this._fragmentConstantsIndex = 4 * o.index), (r += this._texture._getFragmentCode(t, e, n, n.uvVarying) + "add " + i + ", " + n.uvVarying + ", " + o + ".xzzz\n" + this._texture._getFragmentCode(i, e, n, i) + "sub " + t + ".x, " + t + ".x, " + i + ".x\nadd " + i + ", " + n.uvVarying + ", " + o + ".zyzz\n" + this._texture._getFragmentCode(i, e, n, i) + "sub " + t + ".z, " + t + ".z, " + i + ".x\nmov " + t + ".y, " + o + ".w\nmul " + t + ".xz, " + t + ".xz, " + a + ".xy\nnrm " + t + ".xyz, " + t + ".xyz\n"), e.removeFragmentTempUsage(i), r ); }), n ); })(jl); Pi.registerAbstraction(Ql, Vl); var Gl = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = null); var r = t.call(this, e) || this; return ( (r._water1OffsetX = 0), (r._water1OffsetY = 0), (r._water2OffsetX = 0), (r._water2OffsetY = 0), (r._secondaryNormalMap = n), r._secondaryNormalMap && r.iAddTexture(r._secondaryNormalMap), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "water1OffsetX", { get: function () { return this._water1OffsetX; }, set: function (t) { (this._water1OffsetX = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "water1OffsetY", { get: function () { return this._water1OffsetY; }, set: function (t) { (this._water1OffsetY = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "water2OffsetX", { get: function () { return this._water2OffsetX; }, set: function (t) { (this._water2OffsetX = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "water2OffsetY", { get: function () { return this._water2OffsetY; }, set: function (t) { (this._water2OffsetY = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "secondaryNormalMap", { get: function () { return this._secondaryNormalMap; }, set: function (t) { this._secondaryNormalMap != t && (this._secondaryNormalMap && this.iRemoveTexture(this._secondaryNormalMap), (this._secondaryNormalMap = t), this._secondaryNormalMap && this.iAddTexture(this._secondaryNormalMap), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { t.prototype.dispose.call(this), (this._secondaryNormalMap = null); }), (n.assetType = "[asset NormalSimpleWaterMethod]"), n ); })(Ul), zl = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._fragmentConstantsIndex, n = this._shader.fragmentConstantData; (n[e] = 0.5), (n[e + 1] = 0), (n[e + 2] = 0), (n[e + 3] = 1); }), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e); var n = this._method.secondaryNormalMap; n && ((this._secondaryNormalMap = n.getAbstraction(this._shader)), this._shader.uvDependencies++); }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._secondaryNormalMap = null); }), (n.prototype._activate = function () { if ((t.prototype._activate.call(this), this._invalid)) { var e = this._shader.fragmentConstantData, n = this._fragmentConstantsIndex; (e[n + 4] = this._method.water1OffsetX), (e[n + 5] = this._method.water1OffsetY), (e[n + 6] = this._method.water2OffsetX), (e[n + 7] = this._method.water2OffsetY); } this._secondaryNormalMap && this._secondaryNormalMap.activate(); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._secondaryNormalMap && this._secondaryNormalMap._setRenderState(e); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = "", i = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(i, 1); var o = e.getFreeFragmentConstant(), a = e.getFreeFragmentConstant(); return ( (this._fragmentConstantsIndex = 4 * o.index), (r += "add " + i + ", " + n.uvVarying + ", " + a + ".xyxy\n"), this._texture && (r += this._texture._getFragmentCode(t, e, n, i)), (r += "add " + i + ", " + n.uvVarying + ", " + a + ".zwzw\n"), this._secondaryNormalMap && (r += this._secondaryNormalMap._getFragmentCode(i, e, n, i)), (r += "add " + t + ", " + t + ", " + i + "\t\t\nmul " + t + ", " + t + ", " + o + ".x\t\nsub " + t + ".xyz, " + t + ".xyz, " + n.commons + ".xxx\t\nnrm " + t + ".xyz, " + t + ".xyz\t\t\t\t\t\t\t\n") ); }), n ); })(jl); Pi.registerAbstraction(zl, Gl); var Hl = (function (t) { function n(e) { var n = t.call(this, e.shadowMapper) || this; return (n._castingLight = e), n; } return ( e(n, t), Object.defineProperty(n.prototype, "castingLight", { get: function () { return this._castingLight; }, enumerable: !0, configurable: !0, }), n ); })(ol), Xl = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (this._baseTexture = this._baseChunk.texture); }), n ); })(al), Yl = (function (t) { function n(e, r, i) { void 0 === r && (r = 4), void 0 === i && (i = 1); var o = t.call(this, e) || this; return ( (o._depthMapSize = o._castingLight.shadowMapper.size), (o.numSamples = r), (o.range = i), ++n._grainUsages, n._grainTexture || o.initGrainTexture(), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numSamples", { get: function () { return this._numSamples; }, set: function (t) { t < 1 ? (t = 1) : t > 24 && (t = 24), this._numSamples != t && ((this._numSamples = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "range", { get: function () { return 2 * this._range; }, set: function (t) { this._range = t / 2; }, enumerable: !0, configurable: !0, }), (n.prototype.initGrainTexture = function () { n._grainBitmapImage2D = new nn(64, 64, !1); for ( var t, e, r = new Array(), i = 1 / (this._depthMapSize * this._range), o = 0; o < 4096; ++o ) (t = 2 * (Math.random() - 0.5)) < 0 ? (t -= i) : (t += i), (e = 2 * (Math.random() - 0.5)) < 0 ? (e -= i) : (e += i), t > 1 ? (t = 1) : t < -1 && (t = -1), e > 1 ? (e = 1) : e < -1 && (e = -1), (r[o] = (Math.floor(255 * (0.5 * t + 0.5)) << 16) | (Math.floor(255 * (0.5 * e + 0.5)) << 8)); n._grainBitmapImage2D.setArray(n._grainBitmapImage2D.rect, r), (n._grainTexture = new mo(n._grainBitmapImage2D)); }), (n.prototype.dispose = function () { 0 == --n._grainUsages && (n._grainTexture.dispose(), n._grainBitmapImage2D.dispose(), (n._grainTexture = null)); }), (n.assetType = "[asset ShadowDitheredMethod]"), n ); })(Hl), ql = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (e.needsProjection = !0), (this._grainMap = Yl._grainTexture.getAbstraction(this._shader)); }), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this), (this._shader.fragmentConstantData[this._fragmentConstantsIndex] = 1 / this._method.numSamples); }), (n.prototype._activate = function () { t.prototype._activate.call(this); var e = this._shader.fragmentConstantData, n = this._fragmentConstantsIndex; (e[n + 1] = (this._shader.renderMaterial.renderGroup.view.width - 1) / 63), (e[n + 2] = (this._shader.renderMaterial.renderGroup.view.height - 1) / 63), (e[n + 3] = (2 * this._method.range) / this._method.castingLight.shadowMapper.size), this._grainMap.activate(); }), (n.prototype._getFragmentCode = function (e, n, r) { var i = n.getFreeFragmentConstant(); this._fragmentConstantsIndex = 4 * i.index; var o = "", a = this._method.numSamples, s = n.getFreeFragmentVectorTemp(); n.addFragmentTempUsages(s, 1); var u = n.getFreeFragmentVectorTemp(); n.addFragmentTempUsages(u, 1); var l = r.projectionFragment; o += "div " + s + ", " + l + ", " + l + ".w\nmul " + s + ".xy, " + s + ".xy, " + i + ".yz\n"; for (var c = a; c > 0; ) (o += c == a ? this._grainMap._getFragmentCode(s, n, r, s) : "mov " + u + ", " + s + ".zwxy \n" + this._grainMap._getFragmentCode(s, n, r, u)), (o += "sub " + s + ".zw, " + s + ".xy, fc0.xx\nmul " + s + ".zw, " + s + ".zw, " + i + ".w\n"), (o += c == a ? "add " + s + ".xy, " + s + ".zw, " + this._baseChunk.depthMapCoordReg + ".xy\n" + this._baseTexture._getFragmentCode(e, n, r, s) : this._addSample(s, e, n, r)), c > 4 && (o += "add " + s + ".xy, " + s + ".xy, " + s + ".zw\n" + this._addSample(s, e, n, r)), c > 1 && (o += "sub " + s + ".xy, " + this._baseChunk.depthMapCoordReg + ".xy, " + s + ".zw\n" + this._addSample(s, e, n, r)), c > 5 && (o += "sub " + s + ".xy, " + s + ".xy, " + s + ".zw\n" + this._addSample(s, e, n, r)), c > 2 && (o += "neg " + s + ".w, " + s + ".w\nadd " + s + ".xy, " + s + ".wz, " + this._baseChunk.depthMapCoordReg + ".xy\n" + this._addSample(s, e, n, r)), c > 6 && (o += "add " + s + ".xy, " + s + ".xy, " + s + ".wz\n" + this._addSample(s, e, n, r)), c > 3 && (o += "sub " + s + ".xy, " + this._baseChunk.depthMapCoordReg + ".xy, " + s + ".wz\n" + this._addSample(s, e, n, r)), c > 7 && (o += "sub " + s + ".xy, " + s + ".xy, " + s + ".wz\n" + this._addSample(s, e, n, r)), (c -= 8); return ( n.removeFragmentTempUsage(u), n.removeFragmentTempUsage(s), (o += "mul " + e + ".w, " + e + ".w, " + i + ".x\n" + t.prototype._getFragmentCode.call(this, e, n, r)) ); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._grainMap._setRenderState(e); }), (n.prototype._addSample = function (t, e, n, r) { var i = n.getFreeFragmentVectorTemp(); n.addFragmentTempUsages(i, 1); var o = this._baseTexture._getFragmentCode(i, n, r, t) + "add " + e + ".w, " + e + ".w, " + i + ".w\n"; return n.removeFragmentTempUsage(i), o; }), n ); })(Xl); Pi.registerAbstraction(ql, Yl); var Kl = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset ShadowFilteredMethod]"), n ); })(Hl), Wl = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._shader.fragmentConstantData, n = this._fragmentConstantsIndex; e[n] = 0.5; var r = this._method.castingLight.shadowMapper.size; (e[n + 1] = r), (e[n + 2] = 1 / r); }), (n.prototype._getFragmentCode = function (e, n, r) { var i = n.getFreeFragmentConstant(); this._fragmentConstantsIndex = 4 * i.index; var o = "", a = n.getFreeFragmentVectorTemp(); n.addFragmentTempUsages(a, 1); var s = n.getFreeFragmentVectorTemp(); return ( n.addFragmentTempUsages(s, 1), (o += "mov " + a + ", " + this._baseChunk.depthMapCoordReg + "\n" + this._baseTexture._getFragmentCode(s, n, r, a) + "mov " + a + ".w, " + s + ".w\nadd " + a + ".x, " + this._baseChunk.depthMapCoordReg + ".x, " + i + ".z\n" + this._baseTexture._getFragmentCode(s, n, r, a) + "mul " + s + ".x, " + this._baseChunk.depthMapCoordReg + ".x, " + i + ".y\nfrc " + s + ".x, " + s + ".x\nsub " + s + ".w, " + s + ".w, " + a + ".w\nmul " + s + ".w, " + s + ".w, " + s + ".x\nadd " + e + ".w, " + a + ".w, " + s + ".w\nmov " + a + ".x, " + this._baseChunk.depthMapCoordReg + ".x\nadd " + a + ".y, " + this._baseChunk.depthMapCoordReg + ".y, " + i + ".z\n" + this._baseTexture._getFragmentCode(s, n, r, a) + "mov " + a + ".w, " + s + ".w\nadd " + a + ".x, " + this._baseChunk.depthMapCoordReg + ".x, " + i + ".z\n" + this._baseTexture._getFragmentCode(s, n, r, a) + "mul " + s + ".x, " + this._baseChunk.depthMapCoordReg + ".x, " + i + ".y\nfrc " + s + ".x, " + s + ".x\nsub " + s + ".w, " + s + ".w, " + a + ".w\nmul " + s + ".w, " + s + ".w, " + s + ".x\nadd " + a + ".w, " + a + ".w, " + s + ".w\nmul " + s + ".x, " + this._baseChunk.depthMapCoordReg + ".y, " + i + ".y\nfrc " + s + ".x, " + s + ".x\nsub " + a + ".w, " + a + ".w, " + e + ".w\nmul " + a + ".w, " + a + ".w, " + s + ".x\nadd " + e + ".w, " + e + ".w, " + a + ".w\n"), n.removeFragmentTempUsage(s), n.removeFragmentTempUsage(a), t.prototype._getFragmentCode.call(this, e, n, r), o ); }), n ); })(Xl); Pi.registerAbstraction(Wl, Kl); var Jl = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset ShadowHardMethod]"), n ); })(Hl), $l = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._getFragmentCode = function (e, n, r) { var i = this._baseTexture._getFragmentCode( e, n, r, this._baseChunk.depthMapCoordReg ); return (i += t.prototype._getFragmentCode.call(this, e, n, r)); }), n ); })(Xl); Pi.registerAbstraction($l, Jl); var Zl = (function (t) { function n(e, n, r) { void 0 === n && (n = 5), void 0 === r && (r = 1); var i = t.call(this, e) || this; return (i.numSamples = n), (i.range = r), i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "offsets", { get: function () { return this._offsets; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numSamples", { get: function () { return this._numSamples; }, set: function (t) { (this._numSamples = t), this._numSamples < 1 ? (this._numSamples = 1) : this._numSamples > 32 && (this._numSamples = 32), (this._offsets = q.getDistribution(this._numSamples)), this.invalidateShaderProgram(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "range", { get: function () { return this._range; }, set: function (t) { this._range = t; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset ShadowSoftMethod]"), n ); })(Hl), tc = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this), (this._shader.fragmentConstantData[this._fragmentConstantsIndex] = 1 / this._method.numSamples), (this._shader.fragmentConstantData[ this._fragmentConstantsIndex + 1 ] = 0); }), (n.prototype._activate = function () { t.prototype._activate.call(this); for ( var e = (0.5 * this._method.range) / this._method.castingLight.shadowMapper.size, n = this._shader.fragmentConstantData, r = this._fragmentConstantsIndex + 2, i = this._method.numSamples << 1, o = 0; o < i; ++o ) n[r + o] = this._method.offsets[o] * e; }), (n.prototype._getFragmentCode = function (e, n, r) { var i = n.getFreeFragmentConstant(); this._fragmentConstantsIndex = 4 * i.index; var o = "", a = n.getFreeFragmentVectorTemp(); n.addFragmentTempUsages(a, 1); for ( var s = new Array(i + ".zw"), u = this._method.numSamples >> 1, l = 0; l < u; ++l ) { var c = n.getFreeFragmentConstant(); s.push(c + ".xy"), s.push(c + ".zw"); } var h = n.getFreeFragmentVectorTemp(); for (l = 0; l < this._method.numSamples; ++l) o += 0 == l ? "add " + a + ", " + this._baseChunk.depthMapCoordReg + ", " + i + ".zwyy\n" + this._baseTexture._getFragmentCode(e, n, r, a) : "add " + a + ".xy, " + this._baseChunk.depthMapCoordReg + ".xy, " + s[l] + "\n" + this._baseTexture._getFragmentCode(h, n, r, a) + "add " + e + ".w, " + e + ".w, " + h + ".w\n"; return ( n.removeFragmentTempUsage(a), (o += "mul " + e + ".w, " + e + ".w, " + i + ".x\n" + t.prototype._getFragmentCode.call(this, e, n, r)) ); }), n ); })(Xl); Pi.registerAbstraction(tc, Zl); var ec = (function (t) { function n() { var e = t.call(this) || this; return (e._gloss = 50), (e._strength = 1), (e._color = 16777215), e; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "gloss", { get: function () { return this._gloss; }, set: function (t) { this._gloss != t && ((this._gloss = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "strength", { get: function () { return this._strength; }, set: function (t) { this._strength != t && ((this._strength = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._color; }, set: function (t) { this._color != t && ((this._color = t), 0 == this._color || 0 == t ? this.invalidateShaderProgram() : this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.iRemoveTexture(this._texture), (this._texture = t), this._texture && this.iAddTexture(this._texture), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { this._texture = null; }), (n.prototype.copyFrom = function (t) { var e = t; (this.texture = e.texture), (this.strength = e.strength), (this.color = e.color), (this.gloss = e.gloss); }), (n.assetType = "[asset SpecularBasicMethod]"), n ); })(Vu), nc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._method = e), (r._shader = n), r; } return ( e(n, t), (n.prototype._isUsed = function () { return !!this._shader.numLights; }), (n.prototype._initVO = function (t) { (t.needsNormals = this._shader.numLights > 0), (t.needsView = this._shader.numLights > 0), this._method.texture ? ((this._texture = this._method.texture.getAbstraction( this._shader )), this._texture._initVO(t), this._shader.uvDependencies++) : this._texture && (this._texture = null); }), (n.prototype._initConstants = function () { this._method.texture && this._texture._initConstants(); }), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._totalLightColorReg = null), (this._specularTexData = null), (this._specularDataRegister = null); }), (n.prototype._getFragmentPreLightingCode = function (t, e) { var n = ""; return ( (this._pIsFirstLight = !0), (this._specularDataRegister = t.getFreeFragmentConstant()), (this._specularDataIndex = 4 * this._specularDataRegister.index), this._texture && ((this._specularTexData = t.getFreeFragmentVectorTemp()), t.addFragmentTempUsages(this._specularTexData, 1), (n += this._texture._getFragmentCode( this._specularTexData, t, e, e.uvVarying ))), (this._totalLightColorReg = t.getFreeFragmentVectorTemp()), t.addFragmentTempUsages(this._totalLightColorReg, 1), n ); }), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i, o = ""; return ( this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)), (o += "add " + i + ", " + t + ", " + r.viewDirFragment + "\nnrm " + i + ".xyz, " + i + "\ndp3 " + i + ".w, " + r.normalFragment + ", " + i + "\nsat " + i + ".w, " + i + ".w\n"), this._texture ? (o += "mul " + this._specularTexData + ".w, " + this._specularTexData + ".y, " + this._specularDataRegister + ".w\npow " + i + ".w, " + i + ".w, " + this._specularTexData + ".w\n") : (o += "pow " + i + ".w, " + i + ".w, " + this._specularDataRegister + ".w\n"), this._shader.usesLightFallOff && (o += "mul " + i + ".w, " + i + ".w, " + t + ".w\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), (o += "mul " + i + ".xyz, " + e + ", " + i + ".w\n"), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + i + "\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), (n.prototype._getFragmentCodePerProbe = function (t, e, n, r) { var i, o = ""; this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)); var a = r.normalFragment, s = r.viewDirFragment; return ( (o += "dp3 " + i + ".w, " + a + ", " + s + "\nadd " + i + ".w, " + i + ".w, " + i + ".w\nmul " + i + ", " + i + ".w, " + a + "\nsub " + i + ", " + i + ", " + s + "\ntex " + i + ", " + i + ", " + t + " \nmul " + i + ".xyz, " + i + ", " + e + "\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + i + "\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), (n.prototype._getFragmentCode = function (t, e, n) { var r = ""; return ( n.shadowTarget && (r += "mul " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + n.shadowTarget + ".w\n"), this._texture && ((r += "mul " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + this._specularTexData + ".x\n"), e.removeFragmentTempUsage(this._specularTexData)), (r += "mul " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ", " + this._specularDataRegister + "\nadd " + t + ".xyz, " + t + ", " + this._totalLightColorReg + "\n"), e.removeFragmentTempUsage(this._totalLightColorReg), r ); }), (n.prototype._activate = function () { if ((this._texture && this._texture.activate(), this._invalid)) { var t = this._specularDataIndex, e = this._shader.fragmentConstantData; (e[t] = (((this._method.color >> 16) & 255) / 255) * this._method.strength), (e[t + 1] = (((this._method.color >> 8) & 255) / 255) * this._method.strength), (e[t + 2] = ((255 & this._method.color) / 255) * this._method.strength), (e[t + 3] = this._method.gloss); } }), (n.prototype._setRenderState = function (t) { this._texture && this._texture._setRenderState(t); }), n ); })(Qu); Pi.registerAbstraction(nc, ec); var rc = (function (t) { function n() { return t.call(this) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset SpecularAnisotropicMethod]"), n ); })(ec), ic = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (e.needsTangents = this._shader.numLights > 0); }), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i, o = ""; return ( this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)), (o += "nrm " + i + ".xyz, " + r.tangentVarying + ".xyz\ndp3 " + i + ".w, " + i + ".xyz, " + t + ".xyz\ndp3 " + i + ".z, " + i + ".xyz, " + r.viewDirFragment + ".xyz\n"), (o += "sin " + i + ".x, " + i + ".w\nsin " + i + ".y, " + i + ".z\nmul " + i + ".x, " + i + ".x, " + i + ".y\ncos " + i + ".z, " + i + ".z\ncos " + i + ".w, " + i + ".w\nmul " + i + ".w, " + i + ".w, " + i + ".z\nsub " + i + ".w, " + i + ".x, " + i + ".w\n"), this._texture ? (o += "mul " + this._specularTexData + ".w, " + this._specularTexData + ".y, " + this._specularDataRegister + ".w\npow " + i + ".w, " + i + ".w, " + this._specularTexData + ".w\n") : (o += "pow " + i + ".w, " + i + ".w, " + this._specularDataRegister + ".w\n"), (o += "mul " + i + ".w, " + i + ".w, " + t + ".w\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), (o += "mul " + i + ".xyz, " + e + ".xyz, " + i + ".w\n"), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ".xyz, " + i + ".xyz\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), n ); })(nc); Pi.registerAbstraction(ic, rc); var oc = (function (t) { function n(e) { return void 0 === e && (e = null), t.call(this, e) || this; } return ( e(n, t), (n.prototype.createBaseMethod = function () { return new ec(); }), Object.defineProperty(n.prototype, "gloss", { get: function () { return this._baseMethod.gloss; }, set: function (t) { this._baseMethod.gloss = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "strength", { get: function () { return this._baseMethod.strength; }, set: function (t) { this._baseMethod.strength = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._baseMethod.color; }, set: function (t) { this._baseMethod.color = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._baseMethod.texture; }, set: function (t) { this._baseMethod.texture = t; }, enumerable: !0, configurable: !0, }), n ); })(ol), ac = (function (t) { function n(e, n, r) { void 0 === e && (e = 0.5), void 0 === n && (n = 0.1), void 0 === r && (r = null); var i = t.call(this, r) || this; return (i._specularCutOff = e), (i._smoothness = n), i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "smoothness", { get: function () { return this._smoothness; }, set: function (t) { this._smoothness != t && ((this._smoothness = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specularCutOff", { get: function () { return this._specularCutOff; }, set: function (t) { this._specularCutOff != t && ((this._specularCutOff = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset SpecularCelMethod]"), n ); })(oc), sc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._method = e), (r._shader = n), (r._baseChunk._modulateFunction = function (t, e, n) { return r.clampSpecular(t, e, n); }), r ); } return ( e(n, t), (n.prototype._activate = function () { if ((t.prototype._activate.call(this), this._invalid)) { var e = this._cutoffDataIndex, n = this._shader.fragmentConstantData; (n[e] = this._method.smoothness), (n[e + 1] = this._method.specularCutOff); } }), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._cutoffDataRegister = null); }), (n.prototype.clampSpecular = function (t, e, n) { return ( "sub " + t + ".y, " + t + ".w, " + this._cutoffDataRegister + ".y\ndiv " + t + ".y, " + t + ".y, " + this._cutoffDataRegister + ".x\nsat " + t + ".y, " + t + ".y\nsge " + t + ".w, " + t + ".w, " + this._cutoffDataRegister + ".y\nmul " + t + ".w, " + t + ".w, " + t + ".y\n" ); }), (n.prototype._getFragmentPreLightingCode = function (e, n) { return ( (this._cutoffDataRegister = e.getFreeFragmentConstant()), (this._cutoffDataIndex = 4 * this._cutoffDataRegister.index), t.prototype._getFragmentPreLightingCode.call(this, e, n) ); }), n ); })(sl); Pi.registerAbstraction(sc, ac); var uc = (function (t) { function n(e, n, r, i) { void 0 === e && (e = !0), void 0 === n && (n = 5), void 0 === r && (r = 0.028), void 0 === i && (i = null); var o = t.call(this, i) || this; return ( (o._basedOnSurface = e), (o._fresnelPower = n), (o._normalReflectance = r), o ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "basedOnSurface", { get: function () { return this._basedOnSurface; }, set: function (t) { this._basedOnSurface != t && ((this._basedOnSurface = t), this.invalidateShaderProgram()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fresnelPower", { get: function () { return this._fresnelPower; }, set: function (t) { this._fresnelPower != t && ((this._fresnelPower = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "normalReflectance", { get: function () { return this._normalReflectance; }, set: function (t) { this._normalReflectance != t && ((this._normalReflectance = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset SpecularFresnelMethod]"), n ); })(oc), lc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._method = e), (r._shader = n), (r._baseChunk._modulateFunction = function (t, e, n) { return r.modulateSpecular(t, e, n); }), r ); } return ( e(n, t), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._fresnelDataRegister = null); }), (n.prototype._activate = function () { if ((t.prototype._activate.call(this), this._invalid)) { var e = this._shader.fragmentConstantData, n = this._fresnelDataIndex; (e[n] = this._method.normalReflectance), (e[n + 1] = this._method.fresnelPower), (e[n + 2] = 1), (e[n + 3] = 0); } }), (n.prototype._getFragmentPreLightingCode = function (e, n) { return ( (this._fresnelDataRegister = e.getFreeFragmentConstant()), (this._fresnelDataIndex = 4 * this._fresnelDataRegister.index), t.prototype._getFragmentPreLightingCode.call(this, e, n) ); }), (n.prototype.modulateSpecular = function (t, e, n) { return ( "dp3 " + t + ".y, " + n.viewDirFragment + ".xyz, " + (this._method.basedOnSurface ? n.normalFragment : t) + ".xyz\nsub " + t + ".y, " + this._fresnelDataRegister + ".z, " + t + ".y\npow " + t + ".x, " + t + ".y, " + this._fresnelDataRegister + ".y\nsub " + t + ".y, " + this._fresnelDataRegister + ".z, " + t + ".y\nmul " + t + ".y, " + this._fresnelDataRegister + ".x, " + t + ".y\nadd " + t + ".y, " + t + ".x, " + t + ".y\nmul " + t + ".w, " + t + ".w, " + t + ".y\n" ); }), n ); })(sl); Pi.registerAbstraction(lc, uc); var cc = (function (t) { function n() { return t.call(this) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset SpecularPhongMethod]"), n ); })(ec), hc = (function (t) { function n(e, n) { return t.call(this, e, n) || this; } return ( e(n, t), (n.prototype._getFragmentCodePerLight = function (t, e, n, r) { var i, o = ""; this._pIsFirstLight ? (i = this._totalLightColorReg) : ((i = n.getFreeFragmentVectorTemp()), n.addFragmentTempUsages(i, 1)); var a = r.viewDirFragment, s = r.normalFragment; return ( (o += "dp3 " + i + ".w, " + t + ", " + s + "\nadd " + i + ".w, " + i + ".w, " + i + ".w\nmul " + i + ".xyz, " + s + ", " + i + ".w\nsub " + i + ".xyz, " + i + ", " + t + "\nadd " + i + ".w, " + i + ".w, " + r.commons + ".w\nsat " + i + ".w, " + i + ".w\nmul " + i + ".xyz, " + i + ", " + i + ".w\ndp3 " + i + ".w, " + i + ", " + a + "\nsat " + i + ".w, " + i + ".w\n"), this._texture ? (o += "mul " + this._specularTexData + ".w, " + this._specularTexData + ".y, " + this._specularDataRegister + ".w\npow " + i + ".w, " + i + ".w, " + this._specularTexData + ".w\n") : (o += "pow " + i + ".w, " + i + ".w, " + this._specularDataRegister + ".w\n"), this._shader.usesLightFallOff && (o += "mul " + i + ".w, " + i + ".w, " + t + ".w\n"), null != this._modulateFunction && (o += this._modulateFunction(i, n, r)), (o += "mul " + i + ".xyz, " + e + ".xyz, " + i + ".w\n"), this._pIsFirstLight || ((o += "add " + this._totalLightColorReg + ".xyz, " + this._totalLightColorReg + ".xyz, " + i + ".xyz\n"), n.removeFragmentTempUsage(i)), (this._pIsFirstLight = !1), o ); }), n ); })(nc); Pi.registerAbstraction(hc, cc); var pc = (function () { function t() {} return (t.LIGHTS = 1), (t.PROBES = 2), (t.ALL = 3), t; })(), dc = (function (t) { function n(e, n) { var r = t.call(this) || this; return ( (r._preserveAlpha = !0), (r._forceSeparateMVP = !1), (r._renderMaterial = e), (r._renderElements = n), (r._stage = n.stage), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "shader", { get: function () { return this._shader; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "preserveAlpha", { get: function () { return this._preserveAlpha; }, set: function (t) { this._preserveAlpha != t && ((this._preserveAlpha = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "forceSeparateMVP", { get: function () { return this._forceSeparateMVP; }, set: function (t) { this._forceSeparateMVP != t && ((this._forceSeparateMVP = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), (n.prototype.invalidate = function () { this._shader.invalidateProgram(), this.dispatchEvent(new Oi(Oi.INVALIDATE, this)); }), (n.prototype.dispose = function () { (this._renderMaterial = null), (this._renderElements = null), (this._stage = null), this._shader && (this._shader.dispose(), (this._shader = null)); }), (n.prototype._setRenderState = function (t) { this._shader._setRenderState(t); }), (n.prototype._activate = function () { this._shader._activate(); }), (n.prototype._deactivate = function () { this._shader._deactivate(); }), (n.prototype._includeDependencies = function (t) { (t.alphaThreshold = this._renderMaterial.material.alphaThreshold), (t.useImageRect = this._renderMaterial.material.imageRect), (t.usesCurves = this._renderMaterial.material.curves), (t.useBothSides = this._renderMaterial.material.bothSides), (t.usesUVTransform = this._renderMaterial.material.animateUVs), (t.usesColorTransform = this._renderMaterial.material.useColorTransform), this._forceSeparateMVP && this._shader.globalPosDependencies++; }), (n.prototype._initConstantData = function () {}), (n.prototype._getVertexCode = function (t, e) { return ""; }), (n.prototype._getFragmentCode = function (t, e) { return ""; }), (n.prototype._getPostAnimationFragmentCode = function (t, e) { return ""; }), (n.prototype._getNormalVertexCode = function (t, e) { return ""; }), (n.prototype._getNormalFragmentCode = function (t, e) { return ""; }), n ); })(h), fc = (function (t) { function n(e, n, r, i) { var o = t.call(this, e, n, r, i) || this; return (o._includeCasters = !0), (o._lightingPass = r), o; } return ( e(n, t), (n.prototype._includeDependencies = function () { (this.numPointLights = this._lightingPass.numPointLights), (this.numDirectionalLights = this._lightingPass.numDirectionalLights), (this.numLightProbes = this._lightingPass.numLightProbes); var e = this._lightingPass.numPointLights + this._lightingPass.numDirectionalLights, n = this._lightingPass.numLightProbes, r = this._lightingPass._iUsesDiffuse(this) ? this._lightingPass.diffuseLightSources : 0, i = this._lightingPass._iUsesSpecular(this) ? this._lightingPass.specularLightSources : 0, o = r | i; (this.usesLightFallOff = this._lightingPass.enableLightFallOff && this.profile != Zt.BASELINE_CONSTRAINED), (this.usesCommonData = this.usesLightFallOff || this.usesCommonData), (this.numLights = e + n), (this.usesLights = e > 0 && 0 != (o & pc.LIGHTS)), (this.usesProbes = n > 0 && 0 != (o & pc.PROBES)), (this.usesLightsForSpecular = e > 0 && 0 != (i & pc.LIGHTS)), (this.usesProbesForSpecular = n > 0 && 0 != (i & pc.PROBES)), (this.usesLightsForDiffuse = e > 0 && 0 != (r & pc.LIGHTS)), (this.usesProbesForDiffuse = n > 0 && 0 != (r & pc.PROBES)), (this.usesShadows = this._lightingPass._iUsesShadows(this)), t.prototype._includeDependencies.call(this); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), this._lightingPass.lightPicker && this._lightingPass.lightPicker.collectLights(e.node), this.usesLights && this.updateLights(), this.usesProbes && this.updateProbes(); }), (n.prototype._initRegisterIndices = function () { if ( (t.prototype._initRegisterIndices.call(this), (this.lightVertexConstantIndex = -1), (this.lightFragmentConstantIndex = -1), (this.probeWeightsIndex = -1), (this._numProbeRegisters = Math.ceil(this.numLightProbes / 4)), this.usesTangentSpace || !this.usesGlobalPosFragment ? ((this._pointLightVertexConstants = new Array( this.numPointLights )), (this._pointLightFragmentConstants = new Array( 2 * this.numPointLights ))) : ((this._pointLightVertexConstants = null), (this._pointLightFragmentConstants = new Array( 3 * this.numPointLights ))), this.usesTangentSpace ? ((this._dirLightVertexConstants = new Array( this.numDirectionalLights )), (this._dirLightFragmentConstants = new Array( 2 * this.numDirectionalLights ))) : ((this._dirLightVertexConstants = null), (this._dirLightFragmentConstants = new Array( 3 * this.numDirectionalLights ))), this.usesLights) ) { var e = void 0, n = void 0; if (this._dirLightVertexConstants) for (n = this._dirLightVertexConstants.length, e = 0; e < n; ++e) (this._dirLightVertexConstants[e] = this._registerCache.getFreeVertexConstant()), -1 == this.lightVertexConstantIndex && (this.lightVertexConstantIndex = 4 * this._dirLightVertexConstants[e].index); if (this._pointLightVertexConstants) for ( n = this._pointLightVertexConstants.length, e = 0; e < n; ++e ) (this._pointLightVertexConstants[e] = this._registerCache.getFreeVertexConstant()), -1 == this.lightVertexConstantIndex && (this.lightVertexConstantIndex = 4 * this._pointLightVertexConstants[e].index); for (n = this._dirLightFragmentConstants.length, e = 0; e < n; ++e) (this._dirLightFragmentConstants[e] = this._registerCache.getFreeFragmentConstant()), -1 == this.lightFragmentConstantIndex && (this.lightFragmentConstantIndex = 4 * this._dirLightFragmentConstants[e].index); for ( n = this._pointLightFragmentConstants.length, e = 0; e < n; ++e ) (this._pointLightFragmentConstants[e] = this._registerCache.getFreeFragmentConstant()), -1 == this.lightFragmentConstantIndex && (this.lightFragmentConstantIndex = 4 * this._pointLightFragmentConstants[e].index); } }), (n.prototype._compileDependencies = function () { t.prototype._compileDependencies.call(this), (this._vertexCode += this._lightingPass._getPreLightingVertexCode( this._registerCache, this._sharedRegisters )), (this._postAnimationFragmentCode += this._lightingPass._getPreLightingFragmentCode( this._registerCache, this._sharedRegisters )), this.usesShadows && this._compileShadowCode(), this.usesLights && this._compileLightCode(), this.usesProbes && this._compileLightProbeCode(); }), (n.prototype._compileShadowCode = function () { this.normalDependencies > 0 ? (this._sharedRegisters.shadowTarget = this._sharedRegisters.normalFragment) : ((this._sharedRegisters.shadowTarget = this._registerCache.getFreeFragmentVectorTemp()), this._registerCache.addFragmentTempUsages( this._sharedRegisters.shadowTarget, 1 )); }), (n.prototype._compileLightCode = function () { for ( var t, e, n, r, i = 0, o = 0, a = this.usesLightsForSpecular, s = this.usesLightsForDiffuse, u = 0; u < this.numDirectionalLights; ++u ) { if (this.usesTangentSpace) { r = this._dirLightVertexConstants[i++]; var l = this._registerCache.getFreeVarying(); (this._vertexCode += "m33 " + l + ".xyz, " + r + ", " + this._sharedRegisters.animatedTangent + "\nmov " + l + ".w, " + r + ".w\n"), (r = this._registerCache.getFreeFragmentVectorTemp()), this._registerCache.addVertexTempUsages(r, 1), (this._postAnimationFragmentCode += "nrm " + r + ".xyz, " + l + "\nmov " + r + ".w, " + l + ".w\n"); } else r = this._dirLightFragmentConstants[o++]; (t = this._dirLightFragmentConstants[o++]), (e = this._dirLightFragmentConstants[o++]), s && (this._postAnimationFragmentCode += this._lightingPass._getPerLightDiffuseFragmentCode( r, t, this._registerCache, this._sharedRegisters )), a && (this._postAnimationFragmentCode += this._lightingPass._getPerLightSpecularFragmentCode( r, e, this._registerCache, this._sharedRegisters )), this.usesTangentSpace && this._registerCache.removeVertexTempUsage(r); } (i = 0), (o = 0); for (u = 0; u < this.numPointLights; ++u) { if ( ((n = this.usesTangentSpace || !this.usesGlobalPosFragment ? this._pointLightVertexConstants[i++] : this._pointLightFragmentConstants[o++]), (t = this._pointLightFragmentConstants[o++]), (e = this._pointLightFragmentConstants[o++]), (r = this._registerCache.getFreeFragmentVectorTemp()), this._registerCache.addFragmentTempUsages(r, 1), this.usesTangentSpace) ) { l = this._registerCache.getFreeVarying(); var c = this._registerCache.getFreeVertexVectorTemp(); this._vertexCode += "sub " + c + ", " + n + ", " + this._sharedRegisters.animatedPosition + "\nm33 " + l + ".xyz, " + c + ", " + this._sharedRegisters.animatedTangent + "\nmov " + l + ".w, " + this._sharedRegisters.animatedPosition + ".w\n"; } else this.usesGlobalPosFragment ? ((l = r), (this._postAnimationFragmentCode += "sub " + r + ", " + n + ", " + this._sharedRegisters.globalPositionVarying + "\n")) : ((l = this._registerCache.getFreeVarying()), (this._vertexCode += "sub " + l + ", " + n + ", " + this._sharedRegisters.globalPositionVertex + "\n")); this.usesLightFallOff ? (this._postAnimationFragmentCode += "dp3 " + r + ".w, " + l + ", " + l + "\nsub " + r + ".w, " + r + ".w, " + t + ".w\nmul " + r + ".w, " + r + ".w, " + e + ".w\nsat " + r + ".w, " + r + ".w\nsub " + r + ".w, " + this._sharedRegisters.commons + ".w, " + r + ".w\nnrm " + r + ".xyz, " + l + "\n") : (this._postAnimationFragmentCode += "nrm " + r + ".xyz, " + l + "\nmov " + r + ".w, " + l + ".w\n"), -1 == this.lightFragmentConstantIndex && (this.lightFragmentConstantIndex = 4 * n.index), s && (this._postAnimationFragmentCode += this._lightingPass._getPerLightDiffuseFragmentCode( r, t, this._registerCache, this._sharedRegisters )), a && (this._postAnimationFragmentCode += this._lightingPass._getPerLightSpecularFragmentCode( r, e, this._registerCache, this._sharedRegisters )), this._registerCache.removeFragmentTempUsage(r); } }), (n.prototype._compileLightProbeCode = function () { var t, e, n, r = [".x", ".y", ".z", ".w"], i = new Array(), o = this.usesProbesForSpecular, a = this.usesProbesForDiffuse; for ( a && (this.lightProbeDiffuseIndices = new Array()), o && (this.lightProbeSpecularIndices = new Array()), e = 0; e < this._numProbeRegisters; ++e ) (i[e] = this._registerCache.getFreeFragmentConstant()), 0 == e && (this.probeWeightsIndex = 4 * i[e].index); for (e = 0; e < this.numLightProbes; ++e) (t = i[Math.floor(e / 4)].toString() + r[e % 4]), a && ((n = this._registerCache.getFreeTextureReg()), (this.lightProbeDiffuseIndices[e] = n.index), (this._postAnimationFragmentCode += this._lightingPass._getPerProbeDiffuseFragmentCode( n, t, this._registerCache, this._sharedRegisters ))), o && ((n = this._registerCache.getFreeTextureReg()), (this.lightProbeSpecularIndices[e] = n.index), (this._postAnimationFragmentCode += this._lightingPass._getPerProbeSpecularFragmentCode( n, t, this._registerCache, this._sharedRegisters ))); }), (n.prototype.updateLights = function () { var t, e, n, r, i, o, a = 0, s = 0, u = 0, l = this.usesShadows ? 2 : 1; (this.ambientR = this.ambientG = this.ambientB = 0), (i = this.lightVertexConstantIndex), (s = this.lightFragmentConstantIndex); var c = 0, h = this._lightingPass.lightPicker.directionalLights; for ( (o = this._lightingPass.directionalLightsOffset) > (n = this._lightingPass.lightPicker.directionalLights.length) && ((c = 1), (o -= n)); c < l; ++c ) for ( c && (h = this._lightingPass.lightPicker.castingDirectionalLights), (n = h.length) > this.numDirectionalLights && (n = this.numDirectionalLights), a = 0; a < n; ++a ) { if ( ((r = (t = h[o + a]).sceneDirection), (this.ambientR += t._ambientR), (this.ambientG += t._ambientG), (this.ambientB += t._ambientB), this.usesTangentSpace) ) { var p = -r.x, d = -r.y, f = -r.z; (this.vertexConstantData[i++] = this._pInverseSceneMatrix[0] * p + this._pInverseSceneMatrix[4] * d + this._pInverseSceneMatrix[8] * f), (this.vertexConstantData[i++] = this._pInverseSceneMatrix[1] * p + this._pInverseSceneMatrix[5] * d + this._pInverseSceneMatrix[9] * f), (this.vertexConstantData[i++] = this._pInverseSceneMatrix[2] * p + this._pInverseSceneMatrix[6] * d + this._pInverseSceneMatrix[10] * f), (this.vertexConstantData[i++] = 1); } else (this.fragmentConstantData[s++] = -r.x), (this.fragmentConstantData[s++] = -r.y), (this.fragmentConstantData[s++] = -r.z), (this.fragmentConstantData[s++] = 1); (this.fragmentConstantData[s++] = t._diffuseR), (this.fragmentConstantData[s++] = t._diffuseG), (this.fragmentConstantData[s++] = t._diffuseB), (this.fragmentConstantData[s++] = 1), (this.fragmentConstantData[s++] = t._specularR), (this.fragmentConstantData[s++] = t._specularG), (this.fragmentConstantData[s++] = t._specularB), (this.fragmentConstantData[s++] = 1), ++u == this.numDirectionalLights && ((a = n), (c = l)); } if (this.numDirectionalLights > u) for (a = s + 12 * (this.numDirectionalLights - u); s < a; ) this.fragmentConstantData[s++] = 0; u = 0; var g = this._lightingPass.lightPicker.pointLights; for ( (o = this._lightingPass.pointLightsOffset) > (n = this._lightingPass.lightPicker.pointLights.length) ? ((c = 1), (o -= n)) : (c = 0); c < l; ++c ) for ( c && (g = this._lightingPass.lightPicker.castingPointLights), n = g.length, a = 0; a < n; ++a ) { (r = (e = g[o + a]).transform.matrix3D.position), (this.ambientR += e._ambientR), (this.ambientG += e._ambientG), (this.ambientB += e._ambientB), this.usesTangentSpace ? ((p = r.x), (d = r.y), (f = r.z), (this.vertexConstantData[i++] = this._pInverseSceneMatrix[0] * p + this._pInverseSceneMatrix[4] * d + this._pInverseSceneMatrix[8] * f + this._pInverseSceneMatrix[12]), (this.vertexConstantData[i++] = this._pInverseSceneMatrix[1] * p + this._pInverseSceneMatrix[5] * d + this._pInverseSceneMatrix[9] * f + this._pInverseSceneMatrix[13]), (this.vertexConstantData[i++] = this._pInverseSceneMatrix[2] * p + this._pInverseSceneMatrix[6] * d + this._pInverseSceneMatrix[10] * f + this._pInverseSceneMatrix[14]), (this.vertexConstantData[i++] = 1)) : this.usesGlobalPosFragment ? ((this.fragmentConstantData[s++] = r.x), (this.fragmentConstantData[s++] = r.y), (this.fragmentConstantData[s++] = r.z), (this.fragmentConstantData[s++] = 1)) : ((this.vertexConstantData[i++] = r.x), (this.vertexConstantData[i++] = r.y), (this.vertexConstantData[i++] = r.z), (this.vertexConstantData[i++] = 1)), (this.fragmentConstantData[s++] = e._diffuseR), (this.fragmentConstantData[s++] = e._diffuseG), (this.fragmentConstantData[s++] = e._diffuseB); var _ = e.radius; (this.fragmentConstantData[s++] = _ * _), (this.fragmentConstantData[s++] = e._specularR), (this.fragmentConstantData[s++] = e._specularG), (this.fragmentConstantData[s++] = e._specularB), (this.fragmentConstantData[s++] = e.fallOffFactor), ++u == this.numPointLights && ((a = n), (c = l)); } if (this.numPointLights > u) for (a = s + 12 * (u - this.numPointLights); s < a; ++s) this.fragmentConstantData[s] = 0; }), (n.prototype.updateProbes = function () { var t, e = this._lightingPass.lightPicker.lightProbes, n = this._lightingPass.lightPicker.lightProbeWeights, r = e.length - this._lightingPass.lightProbesOffset, i = this.usesProbesForDiffuse, o = this.usesProbesForSpecular; if (i || o) { r > this.numLightProbes && (r = this.numLightProbes); for (var a = 0; a < r; ++a) (t = e[this._lightingPass.lightProbesOffset + a]), i && t.diffuseMap .getAbstraction(this) .activate( this.lightProbeDiffuseIndices[a], t.diffuseSampler ), o && t.specularMap .getAbstraction(this) .activate( this.lightProbeSpecularIndices[a], t.diffuseSampler ); for (a = 0; a < r; ++a) this.fragmentConstantData[this.probeWeightsIndex + a] = n[this._lightingPass.lightProbesOffset + a]; } }), n ); })(Pi), gc = (function () { function t() {} return (t.EFFECTS = 1), (t.LIGHTING = 2), (t.SUPER_SHADER = 3), t; })(), _c = (function (t) { function n(e, n, r) { var i = t.call(this, n, r) || this; return ( (i._maxLights = 3), (i._mode = 3), (i._includeCasters = !0), (i._chunks = new Array()), (i._methods = new Array()), (i._numEffectDependencies = 0), (i.numDirectionalLights = 0), (i.numPointLights = 0), (i.numLightProbes = 0), (i.pointLightsOffset = 0), (i.directionalLightsOffset = 0), (i.lightProbesOffset = 0), (i._mode = e), (i._onLightsChangeDelegate = function (t) { return i.onLightsChange(t); }), (i._onMethodInvalidatedDelegate = function (t) { return i.onMethodInvalidated(t); }), (i.lightPicker = n.lightPicker), null == i._shader && i._updateShader(), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "mode", { get: function () { return this._mode; }, set: function (t) { this._mode != t && ((this._mode = t), this._updateLights()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "includeCasters", { get: function () { return this._includeCasters; }, set: function (t) { this._includeCasters != t && ((this._includeCasters = t), this._updateLights()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightPicker", { get: function () { return this._lightPicker; }, set: function (t) { this._lightPicker && this._lightPicker.removeEventListener( c.INVALIDATE, this._onLightsChangeDelegate ), (this._lightPicker = t), this._lightPicker && this._lightPicker.addEventListener( c.INVALIDATE, this._onLightsChangeDelegate ), this._updateLights(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "enableLightFallOff", { get: function () { return this._renderMaterial.enableLightFallOff; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "diffuseLightSources", { get: function () { return this._renderMaterial.diffuseLightSources; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specularLightSources", { get: function () { return this._renderMaterial.specularLightSources; }, enumerable: !0, configurable: !0, }), (n.prototype._updateShader = function () { !( this.numDirectionalLights || this.numPointLights || this.numLightProbes ) || this._shader instanceof fc ? null == this._shader && (null != this._shader && (this._shader.dispose(), (this._shader = null)), (this._shader = new Pi( this._renderElements, this._renderMaterial, this, this._stage ))) : (null != this._shader && (this._shader.dispose(), (this._shader = null)), (this._shader = new fc( this._renderElements, this._renderMaterial, this, this._stage ))); }), (n.prototype._initConstantData = function () { for (var t = this._chunks.length, e = 0; e < t; ++e) this._chunks[e]._initConstants(); }), Object.defineProperty(n.prototype, "colorTransform", { get: function () { return this.colorTransformMethod ? this.colorTransformMethod.colorTransform : null; }, set: function (t) { t ? (null == this.colorTransformMethod && (this.colorTransformMethod = new Il()), (this.colorTransformMethod.colorTransform = t)) : t || (this.colorTransformMethod && (this.colorTransformMethod = null)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "colorTransformMethod", { get: function () { return this._colorTransformMethod; }, set: function (t) { this._colorTransformMethod != t && (this._colorTransformMethod && (this._removeDependency(this._colorTransformMethod), (this._colorTransformChunk = null)), (this._colorTransformMethod = t), t && ((this._colorTransformChunk = t.getAbstraction(this._shader)), this._addDependency(t))); }, enumerable: !0, configurable: !0, }), (n.prototype._removeDependency = function (t, e) { void 0 === e && (e = !1); var n = this._methods.indexOf(t); -1 != n && (e || this._numEffectDependencies--, t.removeEventListener( Ru.SHADER_INVALIDATED, this._onMethodInvalidatedDelegate ), this._methods.splice(n, 1), this._chunks.splice(n, 1), this.invalidate()); }), (n.prototype._addDependency = function (t, e, n) { void 0 === e && (e = !1), void 0 === n && (n = -1), t.addEventListener( Ru.SHADER_INVALIDATED, this._onMethodInvalidatedDelegate ); var r = t.getAbstraction(this._shader); e ? (-1 != n ? (this._methods.splice( n + this._methods.length - this._numEffectDependencies, 0, t ), this._chunks.splice( n + this._chunks.length - this._numEffectDependencies, 0, r )) : (this._methods.push(t), this._chunks.push(r)), this._numEffectDependencies++) : (this._methods.splice( this._methods.length - this._numEffectDependencies, 0, t ), this._chunks.splice( this._chunks.length - this._numEffectDependencies, 0, r )), this.invalidate(); }), (n.prototype.addEffectMethod = function (t) { this._addDependency(t, !0); }), Object.defineProperty(n.prototype, "numEffectMethods", { get: function () { return this._numEffectDependencies; }, enumerable: !0, configurable: !0, }), (n.prototype.hasEffectMethod = function (t) { return -1 != this._methods.indexOf(t); }), (n.prototype.getEffectMethodAt = function (t) { return t < 0 || t > this._numEffectDependencies - 1 ? null : this._methods[ t + this._methods.length - this._numEffectDependencies ]; }), (n.prototype.addEffectMethodAt = function (t, e) { this._addDependency(t, !0, e); }), (n.prototype.removeEffectMethod = function (t) { this._removeDependency(t, !0); }), (n.prototype.removeEffectMethodAt = function (t) { var e = this.getEffectMethodAt(t); null != e && this._removeDependency(e, !0); }), Object.defineProperty(n.prototype, "normalMethod", { get: function () { return this._normalMethod; }, set: function (t) { this._normalMethod != t && (this._normalMethod && (this._removeDependency(this._normalMethod), (this._normalChunk = null)), (this._normalMethod = t), t && ((this._normalChunk = t.getAbstraction(this._shader)), this._addDependency(t))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "ambientMethod", { get: function () { return this._ambientMethod; }, set: function (t) { this._ambientMethod != t && (this._ambientMethod && (this._removeDependency(this._ambientMethod), (this._ambientChunk = null)), (this._ambientMethod = t), t && ((this._ambientChunk = t.getAbstraction(this._shader)), this._addDependency(t))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "shadowMethod", { get: function () { return this._shadowMethod; }, set: function (t) { this._shadowMethod != t && (this._shadowMethod && (this._removeDependency(this._shadowMethod), (this._shadowChunk = null)), (this._shadowMethod = t), t && ((this._shadowChunk = t.getAbstraction(this._shader)), this._addDependency(t))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "diffuseMethod", { get: function () { return this._diffuseMethod; }, set: function (t) { this._diffuseMethod != t && (this._diffuseMethod && (this._removeDependency(this._diffuseMethod), (this._diffuseChunk = null)), t && ((this._diffuseChunk = t.getAbstraction(this._shader)), this._addDependency(t))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specularMethod", { get: function () { return this._specularMethod; }, set: function (t) { this._specularMethod != t && (this._specularMethod && (this._removeDependency(this._specularMethod), (this._specularChunk = null)), t && ((this._specularChunk = t.getAbstraction(this._shader)), this._addDependency(t))); }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { for ( this._lightPicker && this._lightPicker.removeEventListener( c.INVALIDATE, this._onLightsChangeDelegate ); this._methods.length; ) this._removeDependency(this._methods[0]); t.prototype.dispose.call(this), (this._chunks = null), (this._methods = null); }), (n.prototype.onMethodInvalidated = function (t) { this.invalidate(); }), (n.prototype._activate = function () { var e; t.prototype._activate.call(this); for (var n = this._chunks.length, r = 0; r < n; ++r) (e = this._chunks[r]).chunkVO.useChunk && e._activate(); }), (n.prototype._setRenderState = function (e) { var n; t.prototype._setRenderState.call(this, e); for (var r = this._chunks.length, i = 0; i < r; ++i) (n = this._chunks[i]).chunkVO.useChunk && n._setRenderState(e); }), (n.prototype._deactivate = function () { var e; t.prototype._deactivate.call(this); for (var n = this._chunks.length, r = 0; r < n; ++r) (e = this._chunks[r]).chunkVO.useChunk && e._deactivate(); }), (n.prototype._includeDependencies = function (e) { var n; t.prototype._includeDependencies.call(this, e), (e.usesFragmentAnimation = Boolean(this._mode == gc.SUPER_SHADER)); var r = this._chunks.length; for (n = 0; n < r; ++n) this.setupAndCountDependencies(e, this._chunks[n]); var i, o = !0; for (n = 0; n < r; ++n) ((i = this._chunks[n]).chunkVO.useChunk = i._isUsed()) && !i._usesTangentSpace() && (o = !1); (e.outputsNormals = this._normalChunk && this._normalChunk.chunkVO.useChunk), (e.outputsTangentNormals = e.outputsNormals && this._normalChunk._outputsTangentNormals()), (e.usesTangentSpace = e.outputsTangentNormals && !e.usesProbes && o), e.usesTangentSpace || (e.viewDirDependencies > 0 ? e.globalPosDependencies++ : this.numPointLights > 0 && e.usesLights && (e.globalPosDependencies++, this._mode & gc.EFFECTS && (e.usesGlobalPosFragment = !0))); }), (n.prototype.setupAndCountDependencies = function (t, e) { var n = e.chunkVO; e._reset(n), e._initVO(n), n.needsProjection && t.projectionDependencies++, (n.needsGlobalVertexPos || n.needsGlobalFragmentPos) && (t.globalPosDependencies++, n.needsGlobalFragmentPos && (t.usesGlobalPosFragment = !0)), n.needsNormals && t.normalDependencies++, n.needsTangents && t.tangentDependencies++, n.needsView && t.viewDirDependencies++; }), (n.prototype._getPreLightingVertexCode = function (t, e) { return ""; }), (n.prototype._getPreLightingFragmentCode = function (t, e) { var n = ""; return ( this._diffuseChunk && this._diffuseChunk.chunkVO.useChunk && (n += this._diffuseChunk._getFragmentPreLightingCode(t, e)), this._specularChunk && this._specularChunk.chunkVO.useChunk && (n += this._specularChunk._getFragmentPreLightingCode(t, e)), n ); }), (n.prototype._getPerLightDiffuseFragmentCode = function (t, e, n, r) { return this._diffuseChunk._getFragmentCodePerLight(t, e, n, r); }), (n.prototype._getPerLightSpecularFragmentCode = function (t, e, n, r) { return this._specularChunk._getFragmentCodePerLight(t, e, n, r); }), (n.prototype._getPerProbeDiffuseFragmentCode = function (t, e, n, r) { return this._diffuseChunk._getFragmentCodePerProbe(t, e, n, r); }), (n.prototype._getPerProbeSpecularFragmentCode = function (t, e, n, r) { return this._specularChunk._getFragmentCodePerProbe(t, e, n, r); }), (n.prototype._getNormalVertexCode = function (t, e) { return this._normalChunk._getVertexCode(t, e); }), (n.prototype._getNormalFragmentCode = function (t, e) { var n = this._normalChunk._getFragmentCode(e.normalFragment, t, e); return ( this._normalChunk.chunkVO.needsView && t.removeFragmentTempUsage(e.viewDirFragment), (this._normalChunk.chunkVO.needsGlobalFragmentPos || this._normalChunk.chunkVO.needsGlobalVertexPos) && t.removeVertexTempUsage(e.globalPositionVertex), n ); }), (n.prototype._getVertexCode = function (t, e) { var n, r = ""; this._ambientChunk && this._ambientChunk.chunkVO.useChunk && (r += this._ambientChunk._getVertexCode(t, e)), this._shadowChunk && (r += this._shadowChunk._getVertexCode(t, e)), this._diffuseChunk && this._diffuseChunk.chunkVO.useChunk && (r += this._diffuseChunk._getVertexCode(t, e)), this._specularChunk && this._specularChunk.chunkVO.useChunk && (r += this._specularChunk._getVertexCode(t, e)); for ( var i = this._chunks.length, o = i - this._numEffectDependencies; o < i; o++ ) (n = this._chunks[o]).chunkVO.useChunk && ((r += n._getVertexCode(t, e)), (n.chunkVO.needsGlobalVertexPos || n.chunkVO.needsGlobalFragmentPos) && t.removeVertexTempUsage(e.globalPositionVertex)); return ( this._colorTransformChunk && this._colorTransformChunk.chunkVO.useChunk && (r += this._colorTransformChunk._getVertexCode(t, e)), r ); }), (n.prototype._getFragmentCode = function (t, e) { var n = ""; return ( this._ambientChunk && this._ambientChunk.chunkVO.useChunk && ((n += this._ambientChunk._getFragmentCode(e.shadedTarget, t, e)), this._ambientChunk.chunkVO.needsNormals && t.removeFragmentTempUsage(e.normalFragment), this._ambientChunk.chunkVO.needsView && t.removeFragmentTempUsage(e.viewDirFragment)), n ); }), (n.prototype._getPostAnimationFragmentCode = function (t, e) { var n, r, i = ""; this._shadowChunk && (i += this._shadowChunk._getFragmentCode(e.shadowTarget, t, e)), this._diffuseChunk && this._diffuseChunk.chunkVO.useChunk && ((i += this._diffuseChunk._getFragmentCode(e.shadedTarget, t, e)), this._diffuseChunk.chunkVO.needsNormals && t.removeFragmentTempUsage(e.normalFragment), this._diffuseChunk.chunkVO.needsView && t.removeFragmentTempUsage(e.viewDirFragment)), this._specularChunk && this._specularChunk.chunkVO.useChunk && ((i += this._specularChunk._getFragmentCode( e.shadedTarget, t, e )), this._specularChunk.chunkVO.needsNormals && t.removeFragmentTempUsage(e.normalFragment), this._specularChunk.chunkVO.needsView && t.removeFragmentTempUsage(e.viewDirFragment)), this._shadowChunk && !this._shader.normalDependencies && t.removeFragmentTempUsage(e.shadowTarget), this.preserveAlpha && this._numEffectDependencies > 0 && ((n = t.getFreeFragmentSingleTemp()), t.addFragmentTempUsages(n, 1), (i += "mov " + n + ", " + e.shadedTarget + ".w\n")); for ( var o = this._chunks.length, a = o - this._numEffectDependencies; a < o; a++ ) (r = this._chunks[a]).chunkVO.useChunk && ((i += r._getFragmentCode(e.shadedTarget, t, e)), r.chunkVO.needsNormals && t.removeFragmentTempUsage(e.normalFragment), r.chunkVO.needsView && t.removeFragmentTempUsage(e.viewDirFragment)); return ( this.preserveAlpha && this._numEffectDependencies > 0 && ((i += "mov " + e.shadedTarget + ".w, " + n + "\n"), t.removeFragmentTempUsage(n)), this._colorTransformChunk && this._colorTransformChunk.chunkVO.useChunk && (i += this._colorTransformChunk._getFragmentCode( e.shadedTarget, t, e )), i ); }), (n.prototype._iUsesShadows = function (t) { return Boolean( this._shadowChunk && (this._lightPicker.castingDirectionalLights.length > 0 || this._lightPicker.castingPointLights.length > 0) ); }), (n.prototype._iUsesSpecular = function (t) { return Boolean(this._specularChunk); }), (n.prototype._iUsesDiffuse = function (t) { return Boolean(this._diffuseChunk); }), (n.prototype.onLightsChange = function (t) { this._updateLights(); }), (n.prototype._updateLights = function () { var t = this.numDirectionalLights, e = this.numPointLights, n = this.numLightProbes; this._lightPicker && this._mode & gc.LIGHTING ? ((this.numDirectionalLights = this.calculateNumDirectionalLights( this._lightPicker.numDirectionalLights )), (this.numPointLights = this.calculateNumPointLights( this._lightPicker.numPointLights )), (this.numLightProbes = this.calculateNumProbes( this._lightPicker.numLightProbes )), this._includeCasters && ((this.numDirectionalLights += this._lightPicker.numCastingDirectionalLights), (this.numPointLights += this._lightPicker.numCastingPointLights))) : ((this.numDirectionalLights = 0), (this.numPointLights = 0), (this.numLightProbes = 0)), (t == this.numDirectionalLights && e == this.numPointLights && n == this.numLightProbes) || (this._updateShader(), this.invalidate()); }), (n.prototype.calculateNumDirectionalLights = function (t) { return Math.min(t - this.directionalLightsOffset, this._maxLights); }), (n.prototype.calculateNumPointLights = function (t) { var e = this._maxLights - this.numDirectionalLights; return Math.min(t - this.pointLightsOffset, e); }), (n.prototype.calculateNumProbes = function (t) { var e = 0; return ( 0 != (this._renderMaterial.specularLightSources & pc.PROBES) && ++e, 0 != (this._renderMaterial.diffuseLightSources & pc.PROBES) && ++e, Math.min(t - this.lightProbesOffset, (4 / e) | 0) ); }), n ); })(dc), mc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._diffuseR = 1), (r._diffuseG = 1), (r._diffuseB = 1), (r._diffuseA = 1), (r._shader = new Pi(n, e, r, r._stage)), r.invalidate(), r ); } return ( e(n, t), (n.prototype._includeDependencies = function (e) { t.prototype._includeDependencies.call(this, e), null != this._shaderTexture && e.uvDependencies++; }), (n.prototype.invalidate = function () { t.prototype.invalidate.call(this); var e = this._renderMaterial.material.getTextureAt(0); this._shaderTexture = e ? e.getAbstraction(this._shader) : null; }), (n.prototype.dispose = function () { this._shaderTexture && (this._shaderTexture.onClear( new c(c.CLEAR, this._renderMaterial.material.getTextureAt(0)) ), (this._shaderTexture = null)), t.prototype.dispose.call(this); }), (n.prototype._getFragmentCode = function (t, e) { var n, r = ""; this.preserveAlpha && ((n = t.getFreeFragmentSingleTemp()), t.addFragmentTempUsages(n, 1), (r += "mov " + n + ", " + e.shadedTarget + ".w\n")); var i = e.shadedTarget; if (null != this._shaderTexture) { if ( ((r += this._shaderTexture._getFragmentCode( i, t, e, e.uvVarying )), this._shader.alphaThreshold > 0) ) { var o = t.getFreeFragmentConstant(); (this._fragmentConstantsIndex = 4 * o.index), (r += "sub " + i + ".w, " + i + ".w, " + o + ".x\nkil " + i + ".w\nadd " + i + ".w, " + i + ".w, " + o + ".x\n"); } } else if (-1 != this._shader.colorBufferIndex) r += "mov " + i + ", " + e.colorVarying + "\n"; else { var a = t.getFreeFragmentConstant(); (this._fragmentConstantsIndex = 4 * a.index), (r += "mov " + i + ", " + a + "\n"); } return ( this.preserveAlpha && ((r += "mul " + e.shadedTarget + ".w, " + e.shadedTarget + ".w, " + n + "\n"), t.removeFragmentTempUsage(n)), r ); }), (n.prototype._setRenderState = function (e) { t.prototype._setRenderState.call(this, e), null != this._shaderTexture && this._shaderTexture._setRenderState(e); }), (n.prototype._activate = function () { if ((t.prototype._activate.call(this), null != this._shaderTexture)) this._shaderTexture.activate(), this._shader.alphaThreshold > 0 && (this._shader.fragmentConstantData[ this._fragmentConstantsIndex ] = this._shader.alphaThreshold); else if (-1 == this._shader.colorBufferIndex) { var e = this._fragmentConstantsIndex, n = this._shader.fragmentConstantData; (n[e] = this._diffuseR), (n[e + 1] = this._diffuseG), (n[e + 2] = this._diffuseB), (n[e + 3] = this._diffuseA); } }), n ); })(dc), yc = (function (t) { function n(e) { var n = t.call(this) || this; return ( (n._onCastShadowChangeDelegate = function (t) { return n.onCastShadowChange(t); }), (n.lights = e), n ); } return ( e(n, t), Object.defineProperty(n.prototype, "lights", { get: function () { return this._lights; }, set: function (t) { var e, n = 0, r = 0, i = 0, o = 0, a = 0; this._lights && this.clearListeners(), (this._lights = t), (this._allPickedLights = t), (this._pointLights = new Array()), (this._castingPointLights = new Array()), (this._directionalLights = new Array()), (this._castingDirectionalLights = new Array()), (this._lightProbes = new Array()); for (var s = t.length, u = 0; u < s; ++u) (e = t[u]).addEventListener( Lu.CASTS_SHADOW_CHANGE, this._onCastShadowChangeDelegate ), e instanceof tl ? e.shadowsEnabled ? (this._castingPointLights[i++] = e) : (this._pointLights[n++] = e) : e instanceof qu ? e.shadowsEnabled ? (this._castingDirectionalLights[o++] = e) : (this._directionalLights[r++] = e) : e instanceof Ku && (this._lightProbes[a++] = e); (this._numDirectionalLights == r && this._numPointLights == n && this._numLightProbes == a && this._numCastingPointLights == i && this._numCastingDirectionalLights == o) || ((this._numDirectionalLights = r), (this._numCastingDirectionalLights = o), (this._numPointLights = n), (this._numCastingPointLights = i), (this._numLightProbes = a), (this._lightProbeWeights = new Array(4 * Math.ceil(a / 4))), this.dispatchEvent(new c(c.INVALIDATE, this))); }, enumerable: !0, configurable: !0, }), (n.prototype.clearListeners = function () { for (var t = this._lights.length, e = 0; e < t; ++e) this._lights[e].removeEventListener( Lu.CASTS_SHADOW_CHANGE, this._onCastShadowChangeDelegate ); }), (n.prototype.onCastShadowChange = function (t) { var e = t.target; e instanceof tl ? this.updatePointCasting(e) : e instanceof qu && this.updateDirectionalCasting(e), this.dispatchEvent(new c(c.INVALIDATE, this)); }), (n.prototype.updateDirectionalCasting = function (t) { var e = t; t.shadowsEnabled ? (--this._numDirectionalLights, ++this._numCastingDirectionalLights, this._directionalLights.splice( this._directionalLights.indexOf(e), 1 ), this._castingDirectionalLights.push(t)) : (++this._numDirectionalLights, --this._numCastingDirectionalLights, this._castingDirectionalLights.splice( this._castingDirectionalLights.indexOf(e), 1 ), this._directionalLights.push(t)); }), (n.prototype.updatePointCasting = function (t) { var e = t; t.shadowsEnabled ? (--this._numPointLights, ++this._numCastingPointLights, this._pointLights.splice(this._pointLights.indexOf(e), 1), this._castingPointLights.push(t)) : (++this._numPointLights, --this._numCastingPointLights, this._castingPointLights.splice( this._castingPointLights.indexOf(e), 1 ), this._pointLights.push(t)); }), n ); })( (function (t) { function n() { var e = t.call(this) || this; return ( (e._numPointLights = 0), (e._numDirectionalLights = 0), (e._numCastingPointLights = 0), (e._numCastingDirectionalLights = 0), (e._numLightProbes = 0), e ); } return ( e(n, t), (n.prototype.dispose = function () {}), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numDirectionalLights", { get: function () { return this._numDirectionalLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numPointLights", { get: function () { return this._numPointLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numCastingDirectionalLights", { get: function () { return this._numCastingDirectionalLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numCastingPointLights", { get: function () { return this._numCastingPointLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numLightProbes", { get: function () { return this._numLightProbes; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pointLights", { get: function () { return this._pointLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "directionalLights", { get: function () { return this._directionalLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "castingPointLights", { get: function () { return this._castingPointLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "castingDirectionalLights", { get: function () { return this._castingDirectionalLights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightProbes", { get: function () { return this._lightProbes; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightProbeWeights", { get: function () { return this._lightProbeWeights; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "allPickedLights", { get: function () { return this._allPickedLights; }, enumerable: !0, configurable: !0, }), (n.prototype.collectLights = function (t) { this.updateProbeWeights(t); }), (n.prototype.updateProbeWeights = function (t) { var e, n, r, i, o, a, s = t.getPosition(), u = s.x, l = s.y, c = s.z, h = 0; for (a = 0; a < this._numLightProbes; ++a) (o = (o = (n = u - (e = this._lightProbes[a].transform.matrix3D.position).x) * n + (r = l - e.y) * r + (i = c - e.z) * i) > 1e-5 ? 1 / o : 5e7), (this._lightProbeWeights[a] = o), (h += o); for (h = 1 / h, a = 0; a < this._numLightProbes; ++a) this._lightProbeWeights[a] *= h; }), (n.assetType = "[asset LightPicker]"), n ); })(f) ), Ac = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = 3); var r = t.call(this, e) || this; if ( ((r._scissorRectsInvalid = !0), (r._onClearDelegate = function (t) { return r.onClear(t); }), e.addEventListener(c.CLEAR, r._onClearDelegate), n < 1 || n > 4) ) throw new Error("numCascades must be an integer between 1 and 4"); return (r._numCascades = n), r.init(), r; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { this._image2D.removeEventListener(c.CLEAR, this._onClearDelegate), t.prototype.dispose.call(this); }), (n.prototype.getSplitRatio = function (t) { return this._splitRatios[t]; }), (n.prototype.setSplitRatio = function (t, e) { if ((e < 0 ? (e = 0) : e > 1 && (e = 1), t >= this._numCascades)) throw new Error( "index must be smaller than the number of cascades!" ); this._splitRatios[t] = e; }), (n.prototype.getDepthProjections = function (t) { return this._depthProjections[t].viewMatrix3D; }), (n.prototype.init = function () { (this._splitRatios = new Array(this._numCascades)), (this._nearPlaneDistances = new Array(this._numCascades)); for (var t = 1, e = this._numCascades - 1; e >= 0; --e) (this._splitRatios[e] = t), (t *= 0.4); for ( this._texOffsetsX = Array(-1, 1, -1, 1), this._texOffsetsY = Array(1, 1, -1, -1), this._pScissorRects = new Array(4), this._depthProjections = new Array(), e = 0; e < this._numCascades; ++e ) this._depthProjections[e] = new bt(); }), (n.prototype.onClear = function (t) { this._scissorRectsInvalid = !0; }), Object.defineProperty(n.prototype, "numCascades", { get: function () { return this._numCascades; }, set: function (t) { if (t != this._numCascades) { if (t < 1 || t > 4) throw new Error( "numCascades must be an integer between 1 and 4" ); (this._numCascades = t), (this._scissorRectsInvalid = !0), this.init(), this.dispatchEvent(new c(c.INVALIDATE, this)); } }, enumerable: !0, configurable: !0, }), (n.prototype._renderMap = function (t, e) { this._scissorRectsInvalid && this.updateScissorRects(); }), (n.prototype.updateScissorRects = function () { var t = 0.5 * this._image2D.width; (this._pScissorRects[0] = new K(0, 0, t, t)), (this._pScissorRects[1] = new K(t, 0, t, t)), (this._pScissorRects[2] = new K(0, t, t, t)), (this._pScissorRects[3] = new K(t, t, t, t)), (this._scissorRectsInvalid = !1); }), (n.prototype._updateProjection = function (t) { var e, n = t.near, r = t.far - n; this._updateProjectionFromFrustumCorners( t, t.viewFrustumCorners, this._matrix ), this._matrix.appendScale(0.96, 0.96, 1), (this._overallDepthProjection.frustumMatrix3D = this._matrix), this._updateCullPlanes(t); for (var i = 0; i < this._numCascades; ++i) (e = this._depthProjections[i].frustumMatrix3D), (this._nearPlaneDistances[i] = n + this._splitRatios[i] * r), (this._depthProjections[i].transform.matrix3D = this._overallDepthProjection.transform.matrix3D), this.updateProjectionPartition( e, this._splitRatios[i], this._texOffsetsX[i], this._texOffsetsY[i] ), (this._depthProjections[i].frustumMatrix3D = e); }), (n.prototype.updateProjectionPartition = function (t, e, n, r) { for ( var i, o, a, s, u, l, c = Number.POSITIVE_INFINITY, h = Number.POSITIVE_INFINITY, p = Number.NEGATIVE_INFINITY, d = Number.NEGATIVE_INFINITY, f = Number.NEGATIVE_INFINITY, g = 0; g < 12; ) (i = this._localFrustum[g]) < c && (c = i), i > p && (p = i), (o = this._localFrustum[g + 1]) < h && (h = o), o > d && (d = o), (a = this._localFrustum[g + 2]) > f && (f = a), (s = i + (this._localFrustum[g + 12] - i) * e) < c && (c = s), s > p && (p = s), (u = o + (this._localFrustum[g + 13] - o) * e) < h && (h = u), u > d && (d = u), (l = a + (this._localFrustum[g + 14] - a) * e) > f && (f = l), (g += 3); var _ = p - c, m = d - h, y = 1 / (f - 1); c < 0 && (c -= this._snap), h < 0 && (h -= this._snap), (c = Math.floor(c / this._snap) * this._snap), (h = Math.floor(h / this._snap) * this._snap); var A = 2 * this._snap; (p = c + (_ = Math.floor(_ / A + 1) * A)), (d = h + (m = Math.floor(m / A + 1) * A)), (_ = 1 / _), (m = 1 / m); var v = t._rawData; (v[0] = 2 * _), (v[5] = 2 * m), (v[10] = y), (v[12] = -(p + c) * _), (v[13] = -(d + h) * m), (v[14] = -1 * y), (v[15] = 1), (v[1] = v[2] = v[3] = v[4] = v[6] = v[7] = v[8] = v[9] = v[11] = 0), t.appendScale(0.96, 0.96, 1), t.appendTranslation(n, r, 0), t.appendScale(0.5, 0.5, 1); }), Object.defineProperty(n.prototype, "_iNearPlaneDistances", { get: function () { return this._nearPlaneDistances; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset CascadeShadowMapper]"), n ); })(Hu), vc = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (e.needsProjection = !0); }), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._shader.fragmentConstantData, n = this._shader.vertexConstantData, r = this._fragmentConstantsIndex; (e[r] = 1), (e[r + 1] = 1 / 255), (e[r + 2] = 1 / 65025), (e[r + 3] = 1 / 16581375), (e[r + 6] = 0.5), (e[r + 7] = -0.5), (n[(r = this._vertexConstantsIndex)] = 0.5), (n[r + 1] = -0.5), (n[r + 2] = 0); var i = this._mapper.numCascades; this._projectionMatrices = new Array(i); for (var o = 0; o < i; ++o) this._projectionMatrices[o] = new F( new Float32Array( this._shader.vertexConstantData.buffer, 4 * (this._vertexConstantsIndex + 4 + 16 * o), 16 ) ); }), (n.prototype._cleanCompilationData = function () { t.prototype._cleanCompilationData.call(this), (this._cascadeProjections = null), (this._depthMapCoordVaryings = null), (this._projectionMatrices = null); }), (n.prototype._getVertexCode = function (t, e) { var n = "", r = t.getFreeVertexConstant(); (this._vertexConstantsIndex = 4 * r.index), (this._cascadeProjections = new Array(this._mapper.numCascades)), (this._depthMapCoordVaryings = new Array(this._mapper.numCascades)); for (var i = 0; i < this._mapper.numCascades; ++i) (this._depthMapCoordVaryings[i] = t.getFreeVarying()), (this._cascadeProjections[i] = t.getFreeVertexConstant()), t.getFreeVertexConstant(), t.getFreeVertexConstant(), t.getFreeVertexConstant(); var o = t.getFreeVertexVectorTemp(); for (i = 0; i < this._mapper.numCascades; ++i) n += "m44 " + o + ", " + e.globalPositionVertex + ", " + this._cascadeProjections[i] + "\nadd " + this._depthMapCoordVaryings[i] + ", " + o + ", " + r + ".zzwz\n"; return n; }), (n.prototype._getFragmentCode = function (t, e, n) { var r, i = this._mapper.numCascades, o = e.getFreeFragmentConstant(), a = e.getFreeFragmentConstant(), s = e.getFreeFragmentConstant(), u = Array(s + ".x", s + ".y", s + ".z", s + ".w"); this._fragmentConstantsIndex = 4 * o.index; var l = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(l, 1); var c = e.getFreeFragmentVectorTemp(); e.addFragmentTempUsages(c, 1), (r = "mov " + c + ", " + this._depthMapCoordVaryings[i - 1] + "\n"); for (var h = i - 2; h >= 0; --h) { var p = this._depthMapCoordVaryings[h]; r += "slt " + l + ".z, " + n.projectionFragment + ".z, " + u[h] + "\n"; var d = e.getFreeFragmentVectorTemp(); r += "sub " + d + ", " + p + ", " + c + "\nmul " + d + ", " + d + ", " + l + ".z\nadd " + c + ", " + c + ", " + d + "\n"; } return ( e.removeFragmentTempUsage(l), (r += "div " + c + ", " + c + ", " + c + ".w\nmul " + c + ".xy, " + c + ".xy, " + a + ".zw\nadd " + c + ".xy, " + c + ".xy, " + a + ".zz\n"), e.removeFragmentTempUsage(c), r ); }), (n.prototype._activate = function () { this._shader.vertexConstantData[this._vertexConstantsIndex + 3] = -1 / (this._mapper.depth * this._mapper.epsilon); for (var t = this._mapper.numCascades, e = 0; e < t; ++e) this._projectionMatrices[e].copyFrom( this._mapper.getDepthProjections(e), !0 ); var n = this._shader.fragmentConstantData, r = this._fragmentConstantsIndex; n[r + 5] = 1 - this._mapper.alpha; var i = this._mapper._iNearPlaneDistances; r += 8; for (var o = 0; o < t; ++o) n[r + o] = i[o]; }), (n.prototype._setRenderState = function (t) {}), n ); })(Xu); Pi.registerAbstraction(vc, Ac); var bc = (function (t) { function n(e, n, r) { void 0 === e && (e = null), void 0 === n && (n = 0.5), void 0 === r && (r = 0.1); var i = t.call(this, e) || this; return (i.coverageRatio = n), (i._fadeRatio = r), i; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "coverageRatio", { get: function () { return this._coverageRatio; }, set: function (t) { t > 1 ? (t = 1) : t < 0 && (t = 0), (this._coverageRatio = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fadeRatio", { get: function () { return this._fadeRatio; }, set: function (t) { this._fadeRatio = t; }, enumerable: !0, configurable: !0, }), (n.prototype._updateProjection = function (t) { for (var e = t.viewFrustumCorners, n = 0; n < 12; ++n) { var r = e[n]; (this._localFrustum[n] = r), (this._localFrustum[n + 12] = r + (e[n + 12] - r) * this._coverageRatio); } this._updateProjectionFromFrustumCorners( t, this._localFrustum, this._matrix ), (this._overallDepthProjection.frustumMatrix3D = this._matrix); }), (n.assetType = "[asset NearDirectionalShadowMapper]"), n ); })(Hu), Cc = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._initConstants = function () { t.prototype._initConstants.call(this); var e = this._shader.fragmentConstantData, n = this._fragmentDistanceIndex; (e[n + 2] = 0), (e[n + 3] = 1); }), (n.prototype._initVO = function (e) { t.prototype._initVO.call(this, e), (e.needsProjection = !0); }), (n.prototype._getFragmentCode = function (e, n, r) { var i = t.prototype._getFragmentCode.call(this, e, n, r), o = n.getFreeFragmentConstant(), a = n.getFreeFragmentSingleTemp(); return ( (this._fragmentDistanceIndex = 4 * o.index), (i += "abs " + a + ", " + r.projectionFragment + ".w\nsub " + a + ", " + a + ", " + o + ".x\nmul " + a + ", " + a + ", " + o + ".y\nsat " + a + ", " + a + "\nsub " + a + ", " + o + ".w," + a + "\nsub " + e + ".w, " + o + ".w," + e + ".w\nmul " + e + ".w, " + e + ".w, " + a + "\nsub " + e + ".w, " + o + ".w," + e + ".w\n") ); }), (n.prototype._setRenderState = function (e) { var n = this._shader.view.projection.near, r = this._shader.view.projection.far - n, i = this._mapper.coverageRatio, o = i * (1 - this._mapper.fadeRatio); (i = n + i * r), (o = n + o * r); var a = this._shader.fragmentConstantData, s = this._fragmentDistanceIndex; (a[s] = o), (a[s + 1] = 1 / (i - o)), t.prototype._setRenderState.call(this, e); }), n ); })(Xu); Pi.registerAbstraction(Cc, bc); var Ic = (function (t) { function n(e) { return void 0 === e && (e = null), t.call(this, e) || this; } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[texture DepthTexture2D]"), n ); })(mo); Pi.registerAbstraction(ku, Ic); var Ec = (function (t) { function n(e, n) { void 0 === e && (e = 16777215), void 0 === n && (n = 1); var r = t.call(this) || this; return ( (r._textures = new Array()), (r._pUseColorTransform = !1), (r._alphaBlending = !1), (r._alpha = 1), (r._pAlphaThreshold = 0), (r._pAnimateUVs = !1), (r._style = new zi()), (r._iBaseScreenPassIndex = 0), (r._bothSides = !1), (r._pBlendMode = dn.NORMAL), (r._imageRect = !1), (r._curves = !1), (r._onInvalidatePropertiesDelegate = function (t) { return r._onInvalidateProperties(t); }), r._style.addEventListener( Gi.INVALIDATE_PROPERTIES, r._onInvalidatePropertiesDelegate ), e instanceof Re ? (r._style.image = e) : (r._style.color = Number(e)), (r.alpha = n), (r._onTextureInvalidateDelegate = function (t) { return r.onTextureInvalidate(t); }), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "alpha", { get: function () { return this._alpha; }, set: function (t) { t > 1 ? (t = 1) : t < 0 && (t = 0), this._alpha != t && ((this._alpha = t), null == this._colorTransform && (this._colorTransform = new S()), (this._colorTransform.alphaMultiplier = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "colorTransform", { get: function () { return this._colorTransform; }, set: function (t) { (this._colorTransform = t), this.invalidate(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alphaBlending", { get: function () { return this._alphaBlending; }, set: function (t) { this._alphaBlending != t && ((this._alphaBlending = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "curves", { get: function () { return this._curves; }, set: function (t) { this._curves != t && ((this._curves = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "imageRect", { get: function () { return this._imageRect; }, set: function (t) { this._imageRect != t && ((this._imageRect = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "style", { get: function () { return this._style; }, set: function (t) { this._style != t && (this._style && this._style.removeEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidatePropertiesDelegate ), (this._style = t), this._style && this._style.addEventListener( Gi.INVALIDATE_PROPERTIES, this._onInvalidatePropertiesDelegate ), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "animateUVs", { get: function () { return this._pAnimateUVs; }, set: function (t) { this._pAnimateUVs != t && ((this._pAnimateUVs = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "useColorTransform", { get: function () { return this._pUseColorTransform; }, set: function (t) { this._pUseColorTransform != t && ((this._pUseColorTransform = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "bothSides", { get: function () { return this._bothSides; }, set: function (t) { this._bothSides != t && ((this._bothSides = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blendMode", { get: function () { return this._pBlendMode; }, set: function (t) { this._pBlendMode != t && ((this._pBlendMode = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alphaThreshold", { get: function () { return this._pAlphaThreshold; }, set: function (t) { t < 0 ? (t = 0) : t > 1 && (t = 1), this._pAlphaThreshold != t && ((this._pAlphaThreshold = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), (n.prototype.getNumTextures = function () { return this._textures.length; }), (n.prototype.getTextureAt = function (t) { return this._textures[t]; }), (n.prototype.dispose = function () { this.clear(); }), (n.prototype.invalidatePasses = function () { this.dispatchEvent(new Bi(Bi.INVALIDATE_PASSES, this)); }), (n.prototype.invalidateTextures = function () { this.dispatchEvent(new Bi(Bi.INVALIDATE_TEXTURES, this)); }), (n.prototype.addTextureAt = function (t, e) { var n = this._textures.indexOf(t); n != e && (-1 != n && this._textures.splice(n, 1), this._textures.splice(e, 0, t), t.addEventListener(c.INVALIDATE, this._onTextureInvalidateDelegate), this.onTextureInvalidate()); }), (n.prototype.addTexture = function (t) { -1 == this._textures.indexOf(t) && (this._textures.push(t), t.addEventListener(c.INVALIDATE, this._onTextureInvalidateDelegate), this.onTextureInvalidate()); }), (n.prototype.removeTexture = function (t) { this._textures.splice(this._textures.indexOf(t), 1), t.removeEventListener( c.INVALIDATE, this._onTextureInvalidateDelegate ), this.onTextureInvalidate(); }), (n.prototype.onTextureInvalidate = function (t) { this.invalidatePasses(), this.invalidateTextures(); }), (n.prototype._onInvalidateProperties = function (t) { this.invalidatePasses(), this.invalidateTextures(); }), n ); })(f), xc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._shader = new Pi(n, r, r, r._stage)), r._pAddPass(r), r.invalidate(), r ); } return ( e(n, t), (n.prototype.invalidate = function () { t.prototype.invalidate.call(this); var e = this._material.getTextureAt(0); this._shaderTexture = e ? e.getAbstraction(this._shader) : null; }), (n.prototype._includeDependencies = function (e) { t.prototype._includeDependencies.call(this, e), e.projectionDependencies++, e.alphaThreshold > 0 && e.uvDependencies++; }), (n.prototype._initConstantData = function () { var t = this._fragmentConstantsIndex, e = this._shader.fragmentConstantData; (e[t] = 1), (e[t + 1] = 255), (e[t + 2] = 65025), (e[t + 3] = 16581375), (e[t + 4] = 1 / 255), (e[t + 5] = 1 / 255), (e[t + 6] = 1 / 255), (e[t + 7] = 0); }), (n.prototype._getFragmentCode = function (t, e) { var n = "", r = e.shadedTarget, i = t.getFreeFragmentConstant(), o = t.getFreeFragmentConstant(); this._fragmentConstantsIndex = 4 * i.index; var a = t.getFreeFragmentVectorTemp(); t.addFragmentTempUsages(a, 1); var s = t.getFreeFragmentVectorTemp(); if ( (t.addFragmentTempUsages(s, 1), (n += "div " + a + ", " + e.projectionFragment + ", " + e.projectionFragment + ".w\nmul " + a + ", " + i + ", " + a + ".z\nfrc " + a + ", " + a + "\nmul " + s + ", " + a + ".yzww, " + o + "\n"), this._shaderTexture && this._shader.alphaThreshold > 0) ) { var u = t.getFreeFragmentVectorTemp(); (n += this._shaderTexture._getFragmentCode(u, t, e, e.uvVarying)), (n += "sub " + u + ".w, " + u + ".w, " + t.getFreeFragmentConstant() + ".x\nkil " + u + ".w\n"); } return ( (n += "sub " + r + ", " + a + ", " + s + "\n"), t.removeFragmentTempUsage(a), t.removeFragmentTempUsage(s), n ); }), (n.prototype._activate = function () { t.prototype._activate.call(this), this._shaderTexture && this._shader.alphaThreshold > 0 && (this._shaderTexture.activate(), (this._shader.fragmentConstantData[ this._fragmentConstantsIndex + 8 ] = this._shader.alphaThreshold)); }), n ); })(Li), wc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return ( (r._shader = new Pi(n, r, r, r._stage)), r._pAddPass(r), r.invalidate(), r ); } return ( e(n, t), (n.prototype.invalidate = function () { t.prototype.invalidate.call(this); var e = this._material.getTextureAt(0); this._shaderTexture = e ? e.getAbstraction(this._shader) : null; }), (n.prototype._initConstantData = function () { var t = this._fragmentConstantsIndex, e = this._shader.fragmentConstantData; (e[t + 4] = 1 / 255), (e[t + 5] = 1 / 255), (e[t + 6] = 1 / 255), (e[t + 7] = 0); }), (n.prototype._includeDependencies = function (e) { t.prototype._includeDependencies.call(this, e), e.projectionDependencies++, e.viewDirDependencies++, e.alphaThreshold > 0 && e.uvDependencies++, e.viewDirDependencies > 0 && e.globalPosDependencies++; }), (n.prototype._getFragmentCode = function (t, e) { var n, r = e.shadedTarget, i = t.getFreeFragmentConstant(), o = t.getFreeFragmentConstant(); this._fragmentConstantsIndex = 4 * i.index; var a = t.getFreeFragmentVectorTemp(); t.addFragmentTempUsages(a, 1); var s = t.getFreeFragmentVectorTemp(); if ( (t.addFragmentTempUsages(s, 1), (n = "dp3 " + a + ".z, " + e.viewDirVarying + ".xyz, " + e.viewDirVarying + ".xyz\nmul " + a + ", " + i + ", " + a + ".z\nfrc " + a + ", " + a + "\nmul " + s + ", " + a + ".yzww, " + o + "\n"), this._shaderTexture && this._shader.alphaThreshold > 0) ) { var u = t.getFreeFragmentVectorTemp(); (n += this._shaderTexture._getFragmentCode(u, t, e, e.uvVarying)), (n += "sub " + u + ".w, " + u + ".w, " + t.getFreeFragmentConstant() + ".x\nkil " + u + ".w\n"); } return (n += "sub " + r + ", " + a + ", " + s + "\n"); }), (n.prototype._activate = function () { t.prototype._activate.call(this); var e = this._shader.view.projection.far; e = 1 / (2 * e * e); var n = this._fragmentConstantsIndex, r = this._shader.fragmentConstantData; (r[n] = 1 * e), (r[n + 1] = 255 * e), (r[n + 2] = 65025 * e), (r[n + 3] = 16581375 * e), this._shaderTexture && this._shader.alphaThreshold > 0 && (this._shaderTexture.activate(), (r[n + 8] = this._shader.alphaThreshold)); }), n ); })(Li), Sc = (function (t) { function n(e, n) { void 0 === e && (e = null), void 0 === n && (n = 1); var r = t.call(this, e, n) || this; return ( (r._preserveAlpha = !1), e instanceof Re && (r.texture = new mo()), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "preserveAlpha", { get: function () { return this._preserveAlpha; }, set: function (t) { this._preserveAlpha != t && ((this._preserveAlpha = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture", { get: function () { return this._texture; }, set: function (t) { this._texture != t && (this._texture && this.removeTexture(this._texture), (this._texture = t), this._texture && this.addTexture(this._texture)); }, enumerable: !0, configurable: !0, }), (n.assetType = "[materials BasicMaterial]"), n ); })(Ec), Dc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._basicMaterial = e), r._pAddPass((r._pass = new mc(r, n))), r; } return ( e(n, t), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e), (this._basicMaterial = null); }), (n.prototype._pUpdateRender = function () { t.prototype._pUpdateRender.call(this), (this.requiresBlending = this._basicMaterial.blendMode != dn.NORMAL || this._basicMaterial.alphaBlending || (this._basicMaterial.colorTransform && this._basicMaterial.colorTransform.alphaMultiplier < 1)), (this._pass.preserveAlpha = this._basicMaterial.preserveAlpha), this._pass.shader.setBlendMode( this._basicMaterial.blendMode == dn.NORMAL && this.requiresBlending ? dn.LAYER : this._basicMaterial.blendMode ); }), n ); })(Mi); Ao.registerMaterial(Dc, Sc), Io.registerMaterial(Dc, Sc), bo.registerMaterial(xc, Sc), Co.registerMaterial(wc, Sc), Fi.setDefaultMaterialClass(Sc); var Tc = (function () { function t() {} return (t.SINGLE_PASS = "singlePass"), (t.MULTI_PASS = "multiPass"), t; })(), Pc = (function (t) { function n(e, n) { void 0 === e && (e = 16777215), void 0 === n && (n = 1); var r = t.call(this, e, n) || this; return ( (r._effectMethods = new Array()), (r._enableLightFallOff = !0), (r._specularLightSources = 1), (r._diffuseLightSources = 3), (r._ambientMethod = new el()), (r._diffuseMethod = new ul()), (r._normalMethod = new Ul()), (r._specularMethod = new ec()), (r._depthCompareMode = Wt.LESS_EQUAL), (r._mode = Tc.SINGLE_PASS), r._ambientMethod.iAddOwner(r), r._diffuseMethod.iAddOwner(r), r._normalMethod.iAddOwner(r), r._specularMethod.iAddOwner(r), (r._onLightChangeDelegate = function (t) { return r.onLightsChange(t); }), e instanceof Re && (r._ambientMethod.texture = new mo()), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightPicker", { get: function () { return this._pLightPicker; }, set: function (t) { this._pLightPicker != t && (this._pLightPicker && this._pLightPicker.removeEventListener( c.INVALIDATE, this._onLightChangeDelegate ), (this._pLightPicker = t), this._pLightPicker && this._pLightPicker.addEventListener( c.INVALIDATE, this._onLightChangeDelegate ), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "enableLightFallOff", { get: function () { return this._enableLightFallOff; }, set: function (t) { this._enableLightFallOff != t && ((this._enableLightFallOff = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "diffuseLightSources", { get: function () { return this._diffuseLightSources; }, set: function (t) { this._diffuseLightSources != t && ((this._diffuseLightSources = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specularLightSources", { get: function () { return this._specularLightSources; }, set: function (t) { this._specularLightSources != t && ((this._specularLightSources = t), this.invalidatePasses()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mode", { get: function () { return this._mode; }, set: function (t) { this._mode != t && ((this._mode = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "depthCompareMode", { get: function () { return this._depthCompareMode; }, set: function (t) { this._depthCompareMode != t && ((this._depthCompareMode = t), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "ambientMethod", { get: function () { return this._ambientMethod; }, set: function (t) { this._ambientMethod != t && (this._ambientMethod && this._ambientMethod.iRemoveOwner(this), (this._ambientMethod = t), this._ambientMethod && this._ambientMethod.iAddOwner(this), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "shadowMethod", { get: function () { return this._shadowMethod; }, set: function (t) { this._shadowMethod != t && (this._shadowMethod && this._shadowMethod.iRemoveOwner(this), (this._shadowMethod = t), this._shadowMethod && this._shadowMethod.iAddOwner(this), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "diffuseMethod", { get: function () { return this._diffuseMethod; }, set: function (t) { this._diffuseMethod != t && (this._diffuseMethod && this._diffuseMethod.iRemoveOwner(this), (this._diffuseMethod = t), this._diffuseMethod && this._diffuseMethod.iAddOwner(this), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specularMethod", { get: function () { return this._specularMethod; }, set: function (t) { this._specularMethod != t && (this._specularMethod && this._specularMethod.iRemoveOwner(this), (this._specularMethod = t), this._specularMethod && this._specularMethod.iAddOwner(this), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "normalMethod", { get: function () { return this._normalMethod; }, set: function (t) { this._normalMethod != t && (this._normalMethod && this._normalMethod.iRemoveOwner(this), (this._normalMethod = t), this._normalMethod && this._normalMethod.iAddOwner(this), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numEffectMethods", { get: function () { return this._effectMethods.length; }, enumerable: !0, configurable: !0, }), (n.prototype.addEffectMethod = function (t) { t.iAddOwner(this), this._effectMethods.push(t), this.invalidate(); }), (n.prototype.getEffectMethodAt = function (t) { return this._effectMethods[t]; }), (n.prototype.addEffectMethodAt = function (t, e) { t.iAddOwner(this), this._effectMethods.splice(e, 0, t), this.invalidate(); }), (n.prototype.removeEffectMethod = function (t) { t.iRemoveOwner(this), this._effectMethods.splice(this._effectMethods.indexOf(t), 1), this.invalidate(); }), (n.prototype.onLightsChange = function (t) { this.invalidate(); }), (n.assetType = "[materials MethodMaterial]"), n ); })(Ec), Oc = (function (t) { function n(e, n) { var r = t.call(this, e, n) || this; return (r._methodMaterial = e), (r._renderElements = n), r; } return ( e(n, t), Object.defineProperty(n.prototype, "numLights", { get: function () { return this._methodMaterial.lightPicker ? this._methodMaterial.lightPicker.numLightProbes + this._methodMaterial.lightPicker.numDirectionalLights + this._methodMaterial.lightPicker.numPointLights + this._methodMaterial.lightPicker.numCastingDirectionalLights + this._methodMaterial.lightPicker.numCastingPointLights : 0; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numNonCasters", { get: function () { return this._methodMaterial.lightPicker ? this._methodMaterial.lightPicker.numLightProbes + this._methodMaterial.lightPicker.numDirectionalLights + this._methodMaterial.lightPicker.numPointLights : 0; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "lightPicker", { get: function () { return this._methodMaterial.lightPicker; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "enableLightFallOff", { get: function () { return this._methodMaterial.enableLightFallOff; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "diffuseLightSources", { get: function () { return this._methodMaterial.diffuseLightSources; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "specularLightSources", { get: function () { return this._methodMaterial.specularLightSources; }, enumerable: !0, configurable: !0, }), (n.prototype._pUpdateRender = function () { if ( (t.prototype._pUpdateRender.call(this), this.initPasses(), this.setBlendAndCompareModes(), this._pClearPasses(), this._methodMaterial.mode == Tc.MULTI_PASS && (this._casterLightPass && this._pAddPass(this._casterLightPass), this._nonCasterLightPasses)) ) for (var e = 0; e < this._nonCasterLightPasses.length; ++e) this._pAddPass(this._nonCasterLightPasses[e]); this._pass && this._pAddPass(this._pass); }), (n.prototype.initPasses = function () { 0 == this.numLights || this._methodMaterial.numEffectMethods > 0 || this._methodMaterial.mode == Tc.SINGLE_PASS ? this.initEffectPass() : this._pass && this.removeEffectPass(), this._methodMaterial.shadowMethod && this._methodMaterial.mode == Tc.MULTI_PASS ? this.initCasterLightPass() : this._casterLightPass && this.removeCasterLightPass(), this.numNonCasters > 0 && this._methodMaterial.mode == Tc.MULTI_PASS ? this.initNonCasterLightPasses() : this._nonCasterLightPasses && this.removeNonCasterLightPasses(); }), (n.prototype.setBlendAndCompareModes = function () { var t = Boolean(this._casterLightPass || this._pass); if ( (this._casterLightPass && ((this._casterLightPass.forceSeparateMVP = t), this._casterLightPass.shader.setBlendMode(dn.NORMAL), (this._casterLightPass.shader.depthCompareMode = this._methodMaterial.depthCompareMode)), this._nonCasterLightPasses) ) { var e = 0; this._casterLightPass || ((this._nonCasterLightPasses[0].forceSeparateMVP = t), this._nonCasterLightPasses[0].shader.setBlendMode(dn.NORMAL), (this._nonCasterLightPasses[0].shader.depthCompareMode = this._methodMaterial.depthCompareMode), (e = 1)); for (var n = e; n < this._nonCasterLightPasses.length; ++n) (this._nonCasterLightPasses[n].forceSeparateMVP = t), this._nonCasterLightPasses[n].shader.setBlendMode(dn.ADD), (this._nonCasterLightPasses[n].shader.depthCompareMode = Wt.LESS_EQUAL); } this._casterLightPass || this._nonCasterLightPasses ? ((this.requiresBlending = !1), this._pass && ((this._pass.mode = gc.EFFECTS), (this._pass.forceSeparateMVP = t), (this._pass.shader.depthCompareMode = Wt.LESS_EQUAL), this._pass.shader.setBlendMode(dn.LAYER))) : this._pass && ((this.requiresBlending = this._methodMaterial.blendMode != dn.NORMAL || this._methodMaterial.alphaBlending || (this._methodMaterial.colorTransform && this._methodMaterial.colorTransform.alphaMultiplier < 1)), (this._pass.mode = gc.SUPER_SHADER), (this._pass.preserveAlpha = this.requiresBlending), (this._pass.forceSeparateMVP = !1), (this._pass.colorTransform = this._methodMaterial.colorTransform), this._pass.shader.setBlendMode( this._methodMaterial.blendMode == dn.NORMAL && this.requiresBlending ? dn.LAYER : this._methodMaterial.blendMode ), (this._pass.shader.depthCompareMode = this._methodMaterial.depthCompareMode)); }), (n.prototype.initCasterLightPass = function () { null == this._casterLightPass && (this._casterLightPass = new _c( gc.LIGHTING, this, this._renderElements )), (this._casterLightPass.lightPicker = new yc([ this._methodMaterial.shadowMethod.castingLight, ])), (this._casterLightPass.shadowMethod = this._methodMaterial.shadowMethod), (this._casterLightPass.diffuseMethod = this._methodMaterial.diffuseMethod), (this._casterLightPass.ambientMethod = this._methodMaterial.ambientMethod), (this._casterLightPass.normalMethod = this._methodMaterial.normalMethod), (this._casterLightPass.specularMethod = this._methodMaterial.specularMethod); }), (n.prototype.removeCasterLightPass = function () { this._casterLightPass.dispose(), this._pRemovePass(this._casterLightPass), (this._casterLightPass = null); }), (n.prototype.initNonCasterLightPasses = function () { var t; this.removeNonCasterLightPasses(); var e = this._methodMaterial.lightPicker.numDirectionalLights, n = this._methodMaterial.lightPicker.numPointLights, r = this._methodMaterial.lightPicker.numLightProbes, i = 0, o = 0, a = 0; for ( this._casterLightPass || ((e += this._methodMaterial.lightPicker.numCastingDirectionalLights), (n += this._methodMaterial.lightPicker.numCastingPointLights)), this._nonCasterLightPasses = new Array(); i < e || o < n || a < r; ) ((t = new _c( gc.LIGHTING, this, this._renderElements )).includeCasters = null == this._methodMaterial.shadowMethod), (t.directionalLightsOffset = i), (t.pointLightsOffset = o), (t.lightProbesOffset = a), (t.lightPicker = this._methodMaterial.lightPicker), (t.diffuseMethod = this._methodMaterial.diffuseMethod), (t.ambientMethod = this._methodMaterial.ambientMethod), (t.normalMethod = this._methodMaterial.normalMethod), (t.specularMethod = this._methodMaterial.specularMethod), this._nonCasterLightPasses.push(t), (i += t.numDirectionalLights), (o += t.numPointLights), (a += t.numLightProbes); }), (n.prototype.removeNonCasterLightPasses = function () { if (this._nonCasterLightPasses) { for (var t = 0; t < this._nonCasterLightPasses.length; ++t) this._pRemovePass(this._nonCasterLightPasses[t]); this._nonCasterLightPasses = null; } }), (n.prototype.removeEffectPass = function () { this._pass.ambientMethod != this._methodMaterial.ambientMethod && this._pass.ambientMethod.dispose(), this._pass.diffuseMethod != this._methodMaterial.diffuseMethod && this._pass.diffuseMethod.dispose(), this._pass.specularMethod != this._methodMaterial.specularMethod && this._pass.specularMethod.dispose(), this._pass.normalMethod != this._methodMaterial.normalMethod && this._pass.normalMethod.dispose(), this._pRemovePass(this._pass), (this._pass = null); }), (n.prototype.initEffectPass = function () { null == this._pass && (this._pass = new _c(gc.SUPER_SHADER, this, this._renderElements)), this._methodMaterial.mode == Tc.SINGLE_PASS ? ((this._pass.ambientMethod = this._methodMaterial.ambientMethod), (this._pass.diffuseMethod = this._methodMaterial.diffuseMethod), (this._pass.specularMethod = this._methodMaterial.specularMethod), (this._pass.normalMethod = this._methodMaterial.normalMethod), (this._pass.shadowMethod = this._methodMaterial.shadowMethod)) : this._methodMaterial.mode == Tc.MULTI_PASS && (0 == this.numLights ? (this._pass.ambientMethod = this._methodMaterial.ambientMethod) : (this._pass.ambientMethod = null), (this._pass.preserveAlpha = !1), (this._pass.normalMethod = this._methodMaterial.normalMethod)); for ( var t, e = 0, n = Math.max( this._methodMaterial.numEffectMethods, this._pass.numEffectMethods ); e < n; ) (t = this._methodMaterial.getEffectMethodAt(e)) != this._pass.getEffectMethodAt(e) && (this._pass.removeEffectMethodAt(e), null != t && (e < this._pass.numEffectMethods ? this._pass.addEffectMethodAt(t, e) : this._pass.addEffectMethod(t))), e++; }), (n.prototype.onClear = function (e) { t.prototype.onClear.call(this, e); }), n ); })(Mi); Ao.registerMaterial(Oc, Pc), Io.registerMaterial(Oc, Pc), bo.registerMaterial(xc, Pc), Co.registerMaterial(wc, Pc), console.debug("AwayJS - Materials - 0.6.8"); var Bc = (function () { function t(t, e, n) { void 0 === t && (t = null), void 0 === e && (e = null), void 0 === n && (n = null), (this.fnt_channel = 0), (this.kerningCharCodes = []), (this.kerningValues = []), (this.fill_data = t), (this.stroke_data = e), (this.fill_data_path = n); } return ( (t.prototype.dispose = function () { this.stroke_data && (this.stroke_data = null), this.fill_data && (this.fill_data = null), this.fill_data_path && (this.fill_data_path = null); }), t ); })(), Mc = Object.create(null); function Lc(t, e) { void 0 === e && (e = ""); var n = Mc[t._id + e]; return (Mc[t._id + e] = !0), !n; } var Nc = (function (t) { function n(e) { void 0 === e && (e = null); var n = t.call(this) || this; return ( (n._fntSizeLimit = -1), (n._font_chars = []), (n._font_chars_dic = Object.create(null)), (n._current_size = 0), (n._size_multiply = 0), (n._ascent = 0), (n._descent = 0), (n._usesCurves = !1), (n._glyphIdxToChar = {}), (n._fnt_channels = []), (n._font_em_size = 32), e ? ((n._opentype_font = e), (n._font_em_size = 72), (n._ascent = e.tables.hhea.ascender / (n._opentype_font.unitsPerEm / 72)), (n._descent = e.tables.hhea.descender / (n._opentype_font.unitsPerEm / 72) - 2), (n._current_size = 0), (n._size_multiply = 0), n._opentype_font.charToGlyph(String.fromCharCode(32)), n) : n ); } return ( e(n, t), (n.prototype.addFNTChannel = function (t) { this._fnt_channels.push(t); }), (n.prototype.getGlyphCount = function () { return this._font_chars.length; }), (n.prototype._drawDebugRect = function (t, e, n, r, i) { (t[t.length] = e), (t[t.length] = r), (t[t.length] = e + 1), (t[t.length] = i), (t[t.length] = e), (t[t.length] = i), (t[t.length] = e), (t[t.length] = r), (t[t.length] = e + 1), (t[t.length] = r), (t[t.length] = e + 1), (t[t.length] = i), (t[t.length] = n), (t[t.length] = r), (t[t.length] = n - 1), (t[t.length] = i), (t[t.length] = n), (t[t.length] = i), (t[t.length] = n), (t[t.length] = r), (t[t.length] = n - 1), (t[t.length] = r), (t[t.length] = n - 1), (t[t.length] = i), (t[t.length] = e + 1), (t[t.length] = r), (t[t.length] = e + 1), (t[t.length] = r + 1), (t[t.length] = n - 1), (t[t.length] = r), (t[t.length] = e + 1), (t[t.length] = r + 1), (t[t.length] = n - 1), (t[t.length] = r + 1), (t[t.length] = n - 1), (t[t.length] = r), (t[t.length] = e + 1), (t[t.length] = i), (t[t.length] = e + 1), (t[t.length] = i - 1), (t[t.length] = n - 1), (t[t.length] = i), (t[t.length] = e + 1), (t[t.length] = i - 1), (t[t.length] = n - 1), (t[t.length] = i - 1), (t[t.length] = n - 1), (t[t.length] = i); }), (n.prototype.generateFNTTextures = function (t, e, n) { if ( (console.log("generateFNTTextures"), e && ((this._fntSizeLimit = 0.5 * e), this.initFontSize(e)), this._opentype_font) ) for (var r = 0; r < this._opentype_font.glyphs.length; r++) { var i = this._opentype_font.charToGlyph( String.fromCharCode( this._opentype_font.glyphs.glyphs[r].unicode ) ); if (i) { var o = i.getPath(), a = new Qs(), s = 0, u = o.commands.length, l = 0, c = 0, h = this._ascent; for (s = 0; s < u; s++) { var p = o.commands[s]; "M" === p.type ? (a.moveTo(p.x, p.y + h), (l = p.x), (c = p.y + h)) : "L" === p.type ? a.lineTo(p.x, p.y + h) : "Q" === p.type ? a.curveTo(p.x1, p.y1 + h, p.x, p.y + h) : "C" === p.type ? a.cubicCurveTo( p.x1, p.y1 + h, p.x2, p.y2 + h, p.x, p.y + h ) : "Z" === p.type && a.lineTo(l, c); } var d = new Bc(null, null, a); (d.char_width = i.advanceWidth * ((1 / i.path.unitsPerEm) * 72)), (d.fill_data = ks.pathToAttributesBuffer(a, !0)), d.fill_data ? (this._font_chars.push(d), (this._font_chars_dic[ this._opentype_font.glyphs.glyphs[r].unicode ] = d)) : console.log( "error tesselating opentype glyph", this._opentype_font.glyphs.glyphs[r] ); } else console.log( "no char found for", this._opentype_font.glyphs.glyphs[r] ); } var f, g, _, m, y = 0, A = 0, v = [[]], b = 0, C = [], I = Number.MIN_VALUE, E = Number.MIN_VALUE, x = Number.MAX_VALUE, w = Number.MAX_VALUE, S = 0, D = 0, T = 0; for (s = 0; s < this._font_chars.length; s++) { for ( f = this._font_chars[s].fill_data, g = new Float32Array(f.buffer), I = Number.MIN_VALUE, E = Number.MIN_VALUE, x = Number.MAX_VALUE, w = Number.MAX_VALUE, S = 0, D = 0, _ = 0; _ < f.count; _++ ) (S = g[2 * _]) < w && (w = S), S > E && (E = S), (D = g[2 * _ + 1]) < x && (x = D), D > I && (I = D); (this._font_chars[s].fnt_rect = new K( w / this._font_chars[s].char_width, x / this._font_em_size, (E - w) / this._font_chars[s].char_width, (I - x) / this._font_em_size )), (T += (E - w + t + t) * (I - x + t + t)), (C[C.length] = { idx: s, minx: w, miny: x, width: E - w, height: I - x, }); } C.sort(function (t, e) { return t.height > e.height ? -1 : 1; }); var P = 0; m = n; var B, M = 1; if (e) this.initFontSize(e), (M = this._size_multiply); else { M = (m / Math.sqrt(T)) * 1.2; for (var L = !0, N = 0; L; ) { (L = !1), (y = 0), (A = t); for (s = 0; s < C.length; s++) { if ( ((N = C[s].height * M), (S = 0), (D = 0), (y += t) + C[s].width * M + t >= m && ((y = t), (A += P + 2 * t), (P = 0)), N > P && (P = N), A + N + 2 * t >= m) ) { (L = !0), (M *= 0.995); break; } y += C[s].width * M + t; } } } (this._fntSizeLimit = M * this._font_em_size * 0.5), (y = 0), (A = t); for (s = 0; s < C.length; s++) { for ( f = (B = this._font_chars[C[s].idx]).fill_data, g = new Float32Array(f.buffer), w = C[s].minx, E = Number.MIN_VALUE, x = C[s].miny, I = Number.MIN_VALUE, S = 0, D = 0, (y += t) + C[s].width * M + t >= m && ((y = t), (A += P + 2 * t), (P = 0)), C[s].height *= M, C[s].height > P && (P = C[s].height), A + P + 2 * t >= m && ((y = t), (A = t), (P = 0), (v[++b] = [])), B.fnt_channel = b, _ = 0; _ < f.count; _++ ) (S = (g[2 * _] - w) * M + y), (D = (g[2 * _ + 1] - x) * M + A), (v[b][v[b].length] = S), (v[b][v[b].length] = D), S > E && (E = S), D > I && (I = D); (B.fnt_uv = new K(y / m, 1 - A / m, (E - y) / m, (I - A) / m)), (y += C[s].width * M + t); } var R = []; for (s = 0; s < v.length; s++) { var F = new ui(Float32Array, 2); F.set(v[s]); var k = F.attributesBuffer.cloneBufferView(); F.dispose(); var U = new ao(k); U.setPositions(new hi(k)); var j = ss.getShape(U), V = new Le(); j.style = new zi(); var Q = ds.get_material_for_color(16777215, 1); (j.material = Q.material), Q.colorPos && (j.style.addSamplerAt(V, j.material.getTextureAt(0)), (j.material.animateUVs = !0), (j.style.uvMatrix = new O( 0, 0, 0, 0, Q.colorPos.x, Q.colorPos.y ))), (R[s] = j); } return R; }), (n.prototype.getRatio = function (t) { return this._size_multiply; }), (n.prototype.hasChar = function (t) { var e = !!this._font_chars_dic[t]; return ( !e && this._opentype_font && (e = !!this._opentype_font.charToGlyph( String.fromCharCode(parseInt(t)) )), e ); }), (n.prototype.changeOpenTypeFont = function (t, e) { void 0 === e && (e = !0), e && this._opentype_font, (this._opentype_font = t), (this._ascent = t.ascender), (this._descent = t.descender), (this._font_em_size = t.unitsPerEm); var n = this.getChar("32"); n && (this._whitespace_width = n.char_width); }), (n.prototype.initFontSize = function (t) { this._current_size !== t && ((this._current_size = t), (this._size_multiply = t / this._font_em_size), this._size_multiply); }), (n.prototype.getCharVertCnt = function (t) { var e = this._font_chars_dic[t]; return e ? e.fill_data.length : 0; }), (n.prototype.getCharWidth = function (t) { var e = this._whitespace_width * this._size_multiply || n.DEFAULT_SPACE; if ("32" == t) return ((20 * e) | 0) / 20; if ("9" == t) return (2 * e * 20) / 20; var r = this.getChar(t); return r ? Math.floor(r.char_width * this._size_multiply * 20) / 20 : "9679" == t ? ((r = this.createPointGlyph_9679()), Math.floor(r.char_width * this._size_multiply * 20) / 20) : 0; }), Object.defineProperty(n.prototype, "usesCurves", { get: function () { return this._usesCurves; }, enumerable: !0, configurable: !0, }), (n.prototype.getLineHeight = function () { return this._size_multiply * (this._ascent - this.descent); }), (n.prototype.getUnderLineHeight = function () { return this._size_multiply * (this._ascent - this.descent / 2); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { for (var t = 0; t < this._font_chars.length; t++) this._font_chars[t].dispose(); (this._font_chars.length = 0), (this._font_chars_dic = null); }), Object.defineProperty(n.prototype, "fntSizeLimit", { get: function () { return this._fntSizeLimit; }, set: function (t) { this._fntSizeLimit = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "ascent", { get: function () { return this._ascent; }, set: function (t) { this._ascent = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "descent", { get: function () { return this._descent; }, set: function (t) { this._descent = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "offset_x", { get: function () { return this._offset_x; }, set: function (t) { this._offset_x = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "offset_y", { get: function () { return this._offset_y; }, set: function (t) { this._offset_y = t; }, enumerable: !0, configurable: !0, }), (n.prototype.get_font_chars = function () { return this._font_chars; }), (n.prototype.get_font_em_size = function () { return this._font_em_size; }), (n.prototype.set_whitespace_width = function (t) { this._whitespace_width = t; }), (n.prototype.get_whitespace_width = function () { return this._whitespace_width; }), (n.prototype.set_font_em_size = function (t) { this._font_em_size = t; }), (n.prototype.buildTextLineFromIndices = function (t, e, n, r, i, o) { var a = t.getTextShapeForIdentifierAndFormat(e.color.toString(), e), s = n, u = i.length, l = [], c = 0; r -= this._ascent * this._size_multiply; for (var h = 0; h < u; h++) { var p = i[h], d = this._glyphIdxToChar[p]; if (d) { null === d.fill_data && (1 == d.fill_data_path.commands[0][0] && 0 == d.fill_data_path.data[0][0] && 0 == d.fill_data_path.data[0][1] && (d.fill_data_path.data[0].shift(), d.fill_data_path.data[0].shift(), d.fill_data_path.commands[0].shift(), (d.fill_data_path.commands[0][0] = 2)), (d.fill_data = ks.pathToAttributesBuffer( d.fill_data_path, !0 ))); var f = d.fill_data; f && (l.push({ char: d, x: n, y: r, selected: !1 }), (c += f.buffer.byteLength / 4)), (n += o[h]); } else n += o[h]; } var g = new Float32Array(c); return ( this._fillBuffer(g, l, !1), a.addChunk(g), new P(n - s, this.getLineHeight()) ); }), (n.prototype.fillTextRun = function (t, e, n, r) { var i, o, a, s, u = this._fntSizeLimit >= 0 && (0 == this._fntSizeLimit || this._fntSizeLimit >= e.size), l = t.getTextShapeForIdentifierAndFormat( e.color.toString() + u.toString() + "0", e ), c = {}, h = {}; u && ((i = w.float32ColorToARGB(e.color)), ((o = new Pc(this._fnt_channels[0])).colorTransform = new S( i[1] / 255, i[2] / 255, i[3] / 255 )), (o.bothSides = !0), (o.alphaBlending = !0), (o.useColorTransform = !0), (o.style.sampler = new Le(!1, !0, !0))), (l.fntMaterial = u ? o : null), (c[e.color.toString() + u.toString() + "0"] = l); var p = n + 5 * r, d = this._size_multiply, f = t.selectionBeginIndex, g = t.selectionEndIndex, _ = 0; t.selectable && (((s = e.clone()).color = 16777215), (a = t.getTextShapeForIdentifierAndFormat(u.toString() + "0", s)), (h[u.toString() + "0"] = a), ((o = new Pc(this._fnt_channels[0])).bothSides = !0), (o.alphaBlending = !0), (o.useColorTransform = !0), (o.style.sampler = new Le(!1, !0, !0)), (a.fntMaterial = u ? o : null), s.underline && n + 1 < t.words.length && (_ = t.words[n + 1]), t.selectionEndIndex < t.selectionBeginIndex && ((f = t.selectionEndIndex), (g = t.selectionBeginIndex))); for (var m = 0, y = 0, A = [], v = [], b = [], C = n; C < p; C += 5) { for ( var I = t.words[C + 1], E = t.words[C + 2], x = t.words[C], D = x + t.words[C + 4], T = x; T < D; T++ ) { var P = t.isInFocus && T >= f && T < g ? a : l; if (32 !== t.chars_codes[T] && 9 !== t.chars_codes[T]) { var O = this.getChar(t.chars_codes[T].toString()); if (!O) { Lc(this, "miss" + t.chars_codes[T]) && console.debug( "[TesselatedFontTable] Error: char not found in fontTable", t.chars_codes[T], String.fromCharCode(t.chars_codes[T]) ); continue; } if (u) { var B = P.format, M = t.isInFocus && T >= f && T < g ? h[u.toString() + O.fnt_channel] : c[B.color.toString() + u.toString() + O.fnt_channel]; if (!M) { var L = t.getTextShapeForIdentifierAndFormat( B.color.toString() + u.toString() + O.fnt_channel.toString(), B ), N = w.float32ColorToARGB(B.color), R = new Pc(this._fnt_channels[O.fnt_channel]); (R.colorTransform = new S( N[1] / 255, N[2] / 255, N[3] / 255 )), (R.bothSides = !0), (R.alphaBlending = !0), (R.useColorTransform = !0), (R.style.sampler = new Le(!1, !0, !0)), (L.fntMaterial = R), (c[B.color.toString() + u.toString() + O.fnt_channel] = L), (M = L); } O.char_width, O.fnt_rect.x; O.char_width, O.fnt_rect.width; this._font_em_size, O.fnt_rect.y; throw ( (this._font_em_size, O.fnt_rect.height, "Invalid implementation, verts not raw array") ); } P === a ? (v.push({ char: O, x: I, y: E, selected: !0 }), (m += O.fill_data.buffer.byteLength / 4)) : (A.push({ char: O, x: I, y: E, selected: !1 }), (y += O.fill_data.buffer.byteLength / 4)), (I += O.char_width * d); } } var F = 0.25 * t.internalScale.y, k = E + this.getUnderLineHeight() + F, U = E + this.getUnderLineHeight() - F; if (t.selectable && s.underline && n + 1 < t.words.length) { var j = new Float32Array(12); (j[0] = _), (j[1] = U), (j[2] = _), (j[3] = k), (j[4] = I), (j[5] = k), (j[6] = I), (j[7] = k), (j[8] = I), (j[9] = U), (j[10] = _), (j[11] = U), b.push(j); } } if (y > 0) { y += 12 * b.length; for ( var V = new Float32Array(y), Q = this._fillBuffer(V, A, !1), G = 0, z = b; G < z.length; G++ ) { var H = z[G]; V.set(H, Q), (Q += H.length); } l.addChunk(V); } if (m > 0) { V = new Float32Array(m); this._fillBuffer(V, v, !0), a.addChunk(V); } }), (n.prototype.createPointGlyph_9679 = function () { var t = []; fs.drawElipse( this._font_em_size / 2, this._font_em_size / 2, this._font_em_size / 8, this._font_em_size / 8, t, 0, 360, 5, !1 ); var e = new ui(Float32Array, 2); e.set(t); var n = e.attributesBuffer.cloneBufferView(); e.dispose(); var r = new Bc(n, null, null); return ( (r.char_width = this._font_em_size), this._font_chars.push(r), (this._font_chars_dic[9679] = r), r ); }), (n.prototype.getChar = function (t) { var e = this._font_chars_dic[t]; if (e) { if ( null == e.fill_data && null == e.stroke_data && null != e.fill_data_path && (1 == e.fill_data_path.commands[0][0] && 0 == e.fill_data_path.data[0][0] && 0 == e.fill_data_path.data[0][1] && (e.fill_data_path.data[0].shift(), e.fill_data_path.data[0].shift(), e.fill_data_path.commands[0].shift(), (e.fill_data_path.commands[0][0] = 2)), (e.fill_data = ks.pathToAttributesBuffer(e.fill_data_path, !0)), !e.fill_data) ) return ( Lc(this, "tess" + t) && console.debug( "[TesselatedFontTable] Error:tesselating glyph:", t.charCodeAt(0) ), null ); } else { if (this._opentype_font) { var n = this._opentype_font.charToGlyph( String.fromCharCode(parseInt(t)) ); if (n) { var r = n.getPath(), i = new Qs(), o = 0, a = r.commands.length, s = 0, u = 0, l = this._ascent, c = this._opentype_font.unitsPerEm / 72; for (o = 0; o < a; o++) { var h = r.commands[o]; if ("M" === h.type) i.moveTo(c * h.x, c * h.y + l), (s = c * h.x), (u = c * h.y + l); else if ("L" === h.type) i.lineTo(c * h.x, c * h.y + l); else if ("Q" === h.type) i.curveTo(c * h.x1, c * h.y1 + l, c * h.x, c * h.y + l); else if ("C" === h.type) { var p = h.x1 + (h.x2 - h.x1) / 2, d = h.y1 + (h.y2 - h.y1) / 2; i.curveTo(c * h.x1, c * h.y1 + l, c * p, c * d + l), i.curveTo(c * h.x2, c * h.y2 + l, c * h.x, c * h.y + l); } else "Z" === h.type && i.lineTo(s, u); } if ( (((e = new Bc(null, null, i)).char_width = n.advanceWidth), (e.fill_data = ks.pathToAttributesBuffer(i, !0)), !e.fill_data) ) return ( Lc(this, "tess" + t) && console.debug( "[TesselatedFontTable] Error:tesselating opentype glyph:", t.charCodeAt(0) ), null ); this._font_chars.push(e), (this._font_chars_dic[t] = e); } } "9679" == t && (e = this.createPointGlyph_9679()); } return e; }), (n.prototype.setChar = function (t, e, n, r, i, o, a) { if ( (void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = !1), void 0 === o && (o = 0), void 0 === a && (a = null), (e = Math.floor(20 * e) / 20), null == n && null == r && null == a) ) throw "TesselatedFontTable: trying to create a TesselatedFontChar with no data \n\t\t\t\t(fills_data, stroke_data and fill_data_path is null)"; if (this._font_chars.length > 0) { if (i != this._usesCurves) throw "TesselatedFontTable: Can not set different types of graphic-glyphs\n\t\t\t\t\t(curves vs non-cuves) on the same FontTable!"; } else this._usesCurves = i; var s = new Bc(n, r, a); (s.char_width = e), (s.glyph_idx = o), (s.name = t), (this._glyphIdxToChar[o] = s), this._font_chars.push(s), (this._font_chars_dic[t] = s); }), (n.prototype._fillBuffer = function (t, e, n) { void 0 === n && (n = !1); for ( var r = this._size_multiply, i = 0, o = 0, a = e; o < a.length; o++ ) { var s = a[o]; if (s.selected === n) { for ( var u = s.x, l = s.y, c = s.char, h = new Float32Array(c.fill_data.buffer), p = h.length, d = 0; d < p; d += 2 ) (t[i + d + 0] = h[d + 0] * r + u), (t[i + d + 1] = h[d + 1] * r + l); i += h.length; } } return i; }), (n.assetType = "[asset TesselatedFontTable]"), (n.DEFAULT_SPACE = 14), n ); })(f), Rc = (function () { return function (t, e, n, r, i, o, a, s, u, l) { (this.id = t), (this.x = e), (this.y = n), (this.width = r), (this.height = i), (this.x_offset = o), (this.y_offset = a), (this.x_advance = s), (this.page = u), (this.channel = l); }; })(), Fc = (function (t) { function n() { var e = t.call(this) || this; return ( (e._font_chars = []), (e._materials = []), (e._font_chars_dic = new Object()), (e._ascent = 0), (e._descent = 0), (e._current_size = 0), (e._size_multiply = 0), (e._init_size = 0), (e._texture_width = 0), (e._texture_height = 0), (e._adjust_size = 0), e ); } return ( e(n, t), (n.prototype.getGlyphCount = function () { return this._font_chars.length; }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.initFontSize = function (t) { this._adjust_size && (t *= this._adjust_size), this._current_size != t && ((this._current_size = t), (this._size_multiply = t / this._init_size)); }), (n.prototype.getCharDataCanvas = function (t) { var e = this._font_chars_dic[t]; return e ? [ e.x, e.y, e.width, e.height, e.x_offset * this._size_multiply, e.y_offset * this._size_multiply, ] : []; }), (n.prototype.getCharData = function (t) { var e = this._font_chars_dic[t]; if (e) { var n = (e.height / this._init_size) * this._current_size, r = (e.width / this._init_size) * this._current_size; return [ e.x / this._texture_width, e.y / this._texture_height, e.width / this._texture_width, e.height / this._texture_height, e.x_offset * this._size_multiply, e.y_offset * this._size_multiply, n, r, ]; } return []; }), (n.prototype.getCharVertCnt = function (t) { return 24; }), Object.defineProperty(n.prototype, "texture_width", { get: function () { return this._texture_width; }, set: function (t) { this._texture_width = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "texture_height", { get: function () { return this._texture_height; }, set: function (t) { this._texture_height = t; }, enumerable: !0, configurable: !0, }), (n.prototype.hasChar = function (t) { return null != this._font_chars_dic[t]; }), (n.prototype.getCharWidth = function (t) { var e = this._font_chars_dic[t]; return e ? this._size_multiply * e.x_advance : 0; }), (n.prototype.fillTextRun = function (t, e, n, r) {}), (n.prototype.getLineHeight = function () { return this._current_size; }), (n.prototype.dispose = function () { for (var t = this._materials.length, e = 0; e < t; ++e) this._materials[e].dispose(); (this._materials.length = 0), (this._font_chars.length = 0), (this._font_chars_dic = null); }), (n.prototype.addMaterial = function (t) { this._materials.push(t); }), (n.prototype.getMaterial = function (t) { return void 0 === t && (t = 0), this._materials[t]; }), Object.defineProperty(n.prototype, "ascent", { get: function () { return this._ascent; }, set: function (t) { this._ascent = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "descent", { get: function () { return this._descent; }, set: function (t) { this._descent = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "offset_x", { get: function () { return this._offset_x; }, set: function (t) { this._offset_x = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "offset_y", { get: function () { return this._offset_y; }, set: function (t) { this._offset_y = t; }, enumerable: !0, configurable: !0, }), (n.prototype.get_font_chars = function () { return this._font_chars; }), (n.prototype.get_font_em_size = function () { return this._font_em_size; }), (n.prototype.set_whitespace_width = function (t) { this._whitespace_width = t; }), (n.prototype.get_whitespace_width = function () { return this._whitespace_width; }), (n.prototype.set_font_em_size = function (t) { this._font_em_size = t; }), (n.prototype.getChar = function (t) { return this._font_chars_dic[t]; }), (n.prototype.setChar = function (t, e, n, r, i, o, a, s, u, l) { var c = new Rc(t, e, n, r, i, o, a, s, u, l); this._font_chars.push(c), (this._font_chars_dic[t] = c); }), (n.assetType = "[asset BitmapFontTable]"), n ); })(f), kc = (function (t) { function n() { var e = t.call(this) || this; return ( (e._font_styles = {}), (e.fontName = null), (e.regularFontStyle = null), e ); } return ( e(n, t), Object.defineProperty(n, "emptyFontTable", { get: function () { return ( this._emptyFontTable || (this._emptyFontTable = new Nc()), this._emptyFontTable ); }, enumerable: !0, configurable: !0, }), (n.registerFont = function (t) {}), Object.defineProperty(n.prototype, "font_styles", { get: function () { return this._font_styles; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.dispose = function () { for (var t in this._font_styles) this._font_styles[t].dispose(); this._font_styles = null; }), (n.prototype.replace_font_table = function (t, e) { this._font_styles[t] = e; }), (n.prototype.create_font_table = function (t, e, n) { void 0 === e && (e = Nc.assetType), void 0 === n && (n = null), this.get_font_table(t, e, n) && console.warn( "[Font] - create_font_table - " + t + " - already exists" ); var r = null; return ( e == Nc.assetType ? (r = new Nc(n)) : e == Fc.assetType && (r = new Fc()), (r.name = t), (r.font = this), (this._font_styles[t] = r), r ); }), (n.prototype.get_font_table = function (t, e, n, r) { void 0 === e && (e = Nc.assetType), void 0 === r && (r = !1); var i = this._font_styles[t]; if (i) { if (i.assetType != e) throw "[Font] - get_font_table - existing table has wrong assetType"; return i; } if (r && Object.keys(this._font_styles).length > 0) for (var o in this._font_styles) return ( console.log("font style not found return different", o), this._font_styles[o] ); return null; }), (n.assetType = "[asset Font]"), n ); })(f), Uc = (function () { function t() {} return ( (t.getDeviceFont = function (t) { if (((t = this.getDeviceFontName(t)), this._deviceFonts[t])) return this._deviceFonts[t]; var e = new kc(); return (e.name = t), (this._deviceFonts[t] = e), this._deviceFonts[t]; }), (t.getDeviceFontName = function (t) { if (!t) return "sans"; for (var e in this.deviceFontMap) { if (this.deviceFontMap[e].indexOf(t) >= 0) return e; } return ( console.warn( "[DeviceFontManager] - no mapping exists for " + t + "\n\t\t - falling back to sans" ), "sans" ); }), (t.deviceFontMap = {}), (t._deviceFonts = {}), t ); })(); (Uc.deviceFontMap.sans = ["_sans", "Arial"]), (Uc.deviceFontMap["Arial Narrow"] = ["Arial Narrow"]), (Uc.deviceFontMap["Arial Black"] = ["Arial Black"]), (Uc.deviceFontMap.serif = []), (Uc.deviceFontMap.typewriter = []); var jc, Vc = (function () { function t() {} return ( (t.defineFont_CFF = function (t, e) { void 0 === e && (e = f.DEFAULT_NAMESPACE), this._embbedCFF_fonts || (this._embbedCFF_fonts = {}), this._embbedCFF_fonts[e] || (this._embbedCFF_fonts[e] = {}); var n = this._embbedCFF_fonts[e][t]; return ( n || (((n = new kc()).name = t), (this._embbedCFF_fonts[e][t] = n), n) ); }), (t.getFont_CFF = function (t, e) { if ((void 0 === e && (e = f.DEFAULT_NAMESPACE), !t)) return Uc.getDeviceFont(t); var n = e || f.DEFAULT_NAMESPACE; this._embbedCFF_fonts || (this._embbedCFF_fonts = {}), this._embbedCFF_fonts[n] || (this._embbedCFF_fonts[n] = {}); var r = this._embbedCFF_fonts[n][t]; if (r) return r; for (var i in this._embbedCFF_fonts) if (this._embbedCFF_fonts[i][t]) return this._embbedCFF_fonts[i][t]; return Uc.getDeviceFont(t); }), (t.defineFont = function (t, e) { if ( (void 0 === e && (e = f.DEFAULT_NAMESPACE), this._registered_fonts || (this._registered_fonts = {}), this._registered_fonts[e] || (this._registered_fonts[e] = {}), this.deviceFontsLoading) ) return Uc.getDeviceFont(t); var n = this._registered_fonts[e][t]; return ( n || (((n = new kc()).name = t), -1 === this._namespaces.indexOf(e) && this._namespaces.push(e), (this._registered_fonts[e][t] = n), n) ); }), (t.registerFontForClassName = function (t, e) { this._registered_fonts_by_className[e] = t; }), (t.getFont = function (t, e) { if ((void 0 === e && (e = void 0), !t)) return Uc.getDeviceFont(t); if (this._registered_fonts_by_className[t]) return this._registered_fonts_by_className[t]; var n = e || f.DEFAULT_NAMESPACE; this._registered_fonts || (this._registered_fonts = {}), this._registered_fonts[n] || (this._registered_fonts[n] = {}); var r = this._registered_fonts[n][t]; if (r) return r; if (this._namespaces.length > 0 && !e) for (var i = 0, o = this._namespaces; i < o.length; i++) { var a = o[i]; if (this._registered_fonts[a][t]) return this._registered_fonts[a][t]; } return Uc.getDeviceFont(t); }), (t.clearAll = function () { (this.deviceFontsLoading = !1), (this._registered_fonts = {}); }), (t.deviceFontsLoading = !1), (t._registered_fonts = {}), (t._registered_fonts_by_className = {}), (t._namespaces = []), (t._embbedCFF_fonts = {}), t ); })(); !(function (t) { (t.DEFAULT = "DEFAULT"), (t.DEVICE = "device"), (t.EMBED_CFF = "embeddedCFF"); })(jc || (jc = {})); var Qc, Gc = [ "font", "align", "leftMargin", "rightMargin", "indent", "size", "color", "bold", "italic", "underline", "leading", "letterSpacing", "font_table", ], zc = (function (t) { function n(e, n, r, i, o, a, s, u, l, c, h, p, d) { void 0 === e && (e = null), void 0 === n && (n = null), void 0 === r && (r = null), void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null), void 0 === s && (s = null), void 0 === u && (u = null), void 0 === l && (l = null), void 0 === c && (c = null), void 0 === h && (h = null), void 0 === p && (p = null), void 0 === d && (d = null); var f = t.call(this) || this; return ( (f._updateID = 0), (f._textFormatDirty = !1), (f.tabStops = []), (f.fontLookUpMode = jc.DEFAULT), (f._size = n), (f._color = r), (f._bold = i), (f._italic = o), (f._underline = a), (f.url = s), (f.link_target = u), (f._align = l), (f._leftMargin = c), (f._rightMargin = h), (f._indent = p), (f._leading = d), (f._letterSpacing = null), (f._font_table = null), "string" == typeof e ? (f._setFontFromString(e), f) : (e && ((f._font = e), (f._textFormatDirty = !0)), f) ); } return ( e(n, t), Object.defineProperty(n.prototype, "updateID", { get: function () { return this._updateID; }, enumerable: !0, configurable: !0, }), (n.prototype.hasPropertySet = function (t) { return null !== this["_" + t]; }), Object.defineProperty(n.prototype, "align", { get: function () { return this._align ? this._align : Mu.LEFT; }, set: function (t) { this._align !== t && this._updateID++, (this._align = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "blockIndent", { get: function () { return this._blockIndent ? this._blockIndent : 0; }, set: function (t) { this._blockIndent !== t && this._updateID++, (this._blockIndent = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "leftMargin", { get: function () { return this._leftMargin ? this._leftMargin : 0; }, set: function (t) { t !== this._leftMargin && this._updateID++, (this._leftMargin = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rightMargin", { get: function () { return this._rightMargin ? this._rightMargin : 0; }, set: function (t) { t !== this._rightMargin && this._updateID++, (this._rightMargin = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "indent", { get: function () { return this._indent ? this._indent : 0; }, set: function (t) { t !== this._indent && this._updateID++, (this._indent = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return null !== this._color ? this._color : 0; }, set: function (t) { t !== this._color && this._updateID++, (this._color = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "kerning", { get: function () { return !!this._kerning && this._kerning; }, set: function (t) { t !== this._kerning && this._updateID++, (this._kerning = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "leading", { get: function () { return this._leading ? this._leading : 0; }, set: function (t) { t !== this._leading && this._updateID++, (this._leading = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "letterSpacing", { get: function () { return this._letterSpacing ? this._letterSpacing : 0; }, set: function (t) { t !== this._letterSpacing && this._updateID++, (this._letterSpacing = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "size", { get: function () { return this._size ? this._size : 12; }, set: function (t) { t !== this._size && this._updateID++, (this._size = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "bold", { get: function () { return !!this._bold && this._bold; }, set: function (t) { t !== this._bold && this._updateID++, (this._bold = t), (this._textFormatDirty = !0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "italic", { get: function () { return !!this._italic && this._italic; }, set: function (t) { t !== this._italic && this._updateID++, (this._italic = t), (this._textFormatDirty = !0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "underline", { get: function () { return !!this._underline && this._underline; }, set: function (t) { t !== this._underline && this._updateID++, (this._underline = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "font_table", { get: function () { return ( (this._font_table && !this._textFormatDirty) || (this.font, this.update_font_table()), this._font_table ); }, set: function (t) { (this._font_table = t), (this._textFormatDirty = !1); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "font_name", { get: function () { var t; return null === (t = this.font) || void 0 === t ? void 0 : t.name; }, enumerable: !0, configurable: !0, }), (n.prototype.update_font_table = function () { this._textFormatDirty = !1; var t = Pu.STANDART; if ( (this._italic && !this._bold ? (t = Pu.ITALIC) : !this._italic && this._bold ? (t = Pu.BOLD) : this._italic && this._bold && (t = Pu.BOLDITALIC), this._font) ) { var e = this.font.get_font_table(t, Nc.assetType, null, !0); if (this._font_table && !e) return; this._font_table = e || kc.emptyFontTable; } else; }), Object.defineProperty(n.prototype, "font", { get: function () { return ( this._font || (this.fontLookUpMode == jc.DEFAULT ? (this._font = Vc.getFont(null)) : this.fontLookUpMode == jc.DEVICE ? (this._font = Uc.getDeviceFont(null)) : this.fontLookUpMode == jc.EMBED_CFF ? (this._font = Vc.getFont_CFF(null)) : console.warn( "[TextFormat] - unsupported FontLookUpMode", this.fontLookUpMode ), (this._font_table = null), (this._textFormatDirty = !0)), this._font ); }, set: function (t) { (this._textFormatDirty = !0), "string" != typeof t ? (t !== this._font && this._updateID++, t ? (this._font = t) : ((this._font = null), (this._font_table = null))) : this._setFontFromString(t); }, enumerable: !0, configurable: !0, }), (n.prototype._setFontFromString = function (t) { var e; this.fontLookUpMode == jc.DEFAULT ? (e = Vc.getFont(t)) : this.fontLookUpMode == jc.DEVICE ? (e = Uc.getDeviceFont(t)) : this.fontLookUpMode == jc.EMBED_CFF && (e = Vc.getFont_CFF(t)), (this.font = e), (this._textFormatDirty = !0); }), (n.prototype.clone = function () { var t = new n( this._font, this._size, this._color, this._bold, this._italic, this._underline, this.url, this.link_target, this._align, this._leftMargin, this._rightMargin, this._indent, this._leading ); return (t.font_table = this._font_table), t; }), (n.prototype.equal = function (t) { for (var e = 0, n = Gc; e < n.length; e++) { var r = n[e]; if (this[r] !== t[r]) return !1; } return !0; }), (n.prototype.applyToFormat = function (t) { for (var e = 0, n = Gc; e < n.length; e++) { var r = n[e]; null !== this["_" + r] && (t[r] = this["_" + r]); } return t; }), (n.prototype.mergeFormat = function (t) { for (var e = 0, n = Gc; e < n.length; e++) { var r = n[e]; this["_" + r] !== t[r] && (this["_" + r] = null); } }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.assetType = "[asset TextFormat]"), n ); })(f), Hc = (function () { return function (t, e, n, r, i, o) { void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), void 0 === o && (o = 0), (this.x = t), (this.width = e), (this.height = n), (this.ascent = r), (this.descent = i), (this.leading = o); }; })(), Xc = (function (t) { function n(e, n, r) { void 0 === r && (r = 0); var i = t.call(this, e) || this; return ( (i._char = n), (i._charCode = r), (i.isShift = !1), (i.isCTRL = !1), (i.isAlt = !1), i ); } return ( e(n, t), Object.defineProperty(n.prototype, "char", { get: function () { return this._char; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "charCode", { get: function () { return this._charCode; }, enumerable: !0, configurable: !0, }), (n.prototype.clone = function () { return new n(this.type, this._char, this._charCode); }), (n.KEYDOWN = "keydown"), (n.KEYUP = "keyup"), n ); })(l), Yc = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype.clone = function () { return new n(this.type); }), (n.CHANGED = "onChanged"), n ); })(l), qc = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._acceptTraverser = function (t) { var e = this.parentTextField; !e._textFormat || e._textFormat.font_table.isAsset(Nc) || e._textFormat.material || ((this.transform.colorTransform.color = null != e.textColor ? e.textColor : e._textFormat.color), this._invalidateHierarchicalProperty(Lt.COLOR_TRANSFORM)), this._graphics._acceptTraverser(t); }), n ); })(ru), Kc = (function () { function t() { (this.verts = []), (this._length = 0), (this.verts = []); } return ( Object.defineProperty(t.prototype, "length", { get: function () { return this._length; }, set: function (t) { if (!(t > this._length)) { var e = this.verts; if (0 === t) return (this._length = 0), void (e.length = 0); for (var n = 0, r = t; n < e.length && r > 0; ) (r -= e[n].length), n++; r < 0 && (e[n - 1] = e[n - 1].subarray(0, r + e[n - 1].length)), (e.length = n), (this._length = t); } }, enumerable: !0, configurable: !0, }), (t.prototype.addChunk = function (t) { (this._length += t.length), this.verts.push(t); }), Object.defineProperty(t.prototype, "tall", { get: function () { return this.verts[this.verts.length - 1]; }, enumerable: !0, configurable: !0, }), t ); })(); class Wc { constructor() { this.childNodes = []; } get innerText() { return this.rawText; } } !(function (t) { (t[(t.ELEMENT_NODE = 1)] = "ELEMENT_NODE"), (t[(t.TEXT_NODE = 3)] = "TEXT_NODE"), (t[(t.COMMENT_NODE = 8)] = "COMMENT_NODE"); })(Qc || (Qc = {})); var Jc = Qc; class $c extends Wc { constructor(t) { super(), (this.rawText = t), (this.nodeType = Jc.COMMENT_NODE); } get text() { return this.rawText; } toString() { return `\x3c!--${this.rawText}--\x3e`; } } var Zc = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}; function th(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } function eh(t) { var e = { exports: {} }; return t(e, e.exports), e.exports; /*! https://mths.be/he v1.2.0 by @mathias | MIT license */ } var nh = eh(function (t, e) { !(function (n) { var r = e, i = t && t.exports == r && t, o = "object" == typeof Zc && Zc; (o.global !== o && o.window !== o) || (n = o); var a = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, s = /[\x01-\x7F]/g, u = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g, l = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g, c = { "­": "shy", "‌": "zwnj", "‍": "zwj", "‎": "lrm", "⁣": "ic", "⁢": "it", "⁡": "af", "‏": "rlm", "​": "ZeroWidthSpace", "⁠": "NoBreak", "̑": "DownBreve", "⃛": "tdot", "⃜": "DotDot", "\t": "Tab", "\n": "NewLine", " ": "puncsp", " ": "MediumSpace", " ": "thinsp", " ": "hairsp", " ": "emsp13", " ": "ensp", " ": "emsp14", " ": "emsp", " ": "numsp", " ": "nbsp", "  ": "ThickSpace", "‾": "oline", _: "lowbar", "‐": "dash", "–": "ndash", "—": "mdash", "―": "horbar", ",": "comma", ";": "semi", "⁏": "bsemi", ":": "colon", "⩴": "Colone", "!": "excl", "¡": "iexcl", "?": "quest", "¿": "iquest", ".": "period", "‥": "nldr", "…": "mldr", "·": "middot", "'": "apos", "‘": "lsquo", "’": "rsquo", "‚": "sbquo", "‹": "lsaquo", "›": "rsaquo", '"': "quot", "“": "ldquo", "”": "rdquo", "„": "bdquo", "«": "laquo", "»": "raquo", "(": "lpar", ")": "rpar", "[": "lsqb", "]": "rsqb", "{": "lcub", "}": "rcub", "⌈": "lceil", "⌉": "rceil", "⌊": "lfloor", "⌋": "rfloor", "⦅": "lopar", "⦆": "ropar", "⦋": "lbrke", "⦌": "rbrke", "⦍": "lbrkslu", "⦎": "rbrksld", "⦏": "lbrksld", "⦐": "rbrkslu", "⦑": "langd", "⦒": "rangd", "⦓": "lparlt", "⦔": "rpargt", "⦕": "gtlPar", "⦖": "ltrPar", "⟦": "lobrk", "⟧": "robrk", "⟨": "lang", "⟩": "rang", "⟪": "Lang", "⟫": "Rang", "⟬": "loang", "⟭": "roang", "❲": "lbbrk", "❳": "rbbrk", "‖": "Vert", "§": "sect", "¶": "para", "@": "commat", "*": "ast", "/": "sol", undefined: null, "&": "amp", "#": "num", "%": "percnt", "‰": "permil", "‱": "pertenk", "†": "dagger", "‡": "Dagger", "•": "bull", "⁃": "hybull", "′": "prime", "″": "Prime", "‴": "tprime", "⁗": "qprime", "‵": "bprime", "⁁": "caret", "`": "grave", "´": "acute", "˜": "tilde", "^": "Hat", "¯": "macr", "˘": "breve", "˙": "dot", "¨": "die", "˚": "ring", "˝": "dblac", "¸": "cedil", "˛": "ogon", ˆ: "circ", ˇ: "caron", "°": "deg", "©": "copy", "®": "reg", "℗": "copysr", "℘": "wp", "℞": "rx", "℧": "mho", "℩": "iiota", "←": "larr", "↚": "nlarr", "→": "rarr", "↛": "nrarr", "↑": "uarr", "↓": "darr", "↔": "harr", "↮": "nharr", "↕": "varr", "↖": "nwarr", "↗": "nearr", "↘": "searr", "↙": "swarr", "↝": "rarrw", "↝̸": "nrarrw", "↞": "Larr", "↟": "Uarr", "↠": "Rarr", "↡": "Darr", "↢": "larrtl", "↣": "rarrtl", "↤": "mapstoleft", "↥": "mapstoup", "↦": "map", "↧": "mapstodown", "↩": "larrhk", "↪": "rarrhk", "↫": "larrlp", "↬": "rarrlp", "↭": "harrw", "↰": "lsh", "↱": "rsh", "↲": "ldsh", "↳": "rdsh", "↵": "crarr", "↶": "cularr", "↷": "curarr", "↺": "olarr", "↻": "orarr", "↼": "lharu", "↽": "lhard", "↾": "uharr", "↿": "uharl", "⇀": "rharu", "⇁": "rhard", "⇂": "dharr", "⇃": "dharl", "⇄": "rlarr", "⇅": "udarr", "⇆": "lrarr", "⇇": "llarr", "⇈": "uuarr", "⇉": "rrarr", "⇊": "ddarr", "⇋": "lrhar", "⇌": "rlhar", "⇐": "lArr", "⇍": "nlArr", "⇑": "uArr", "⇒": "rArr", "⇏": "nrArr", "⇓": "dArr", "⇔": "iff", "⇎": "nhArr", "⇕": "vArr", "⇖": "nwArr", "⇗": "neArr", "⇘": "seArr", "⇙": "swArr", "⇚": "lAarr", "⇛": "rAarr", "⇝": "zigrarr", "⇤": "larrb", "⇥": "rarrb", "⇵": "duarr", "⇽": "loarr", "⇾": "roarr", "⇿": "hoarr", "∀": "forall", "∁": "comp", "∂": "part", "∂̸": "npart", "∃": "exist", "∄": "nexist", "∅": "empty", "∇": "Del", "∈": "in", "∉": "notin", "∋": "ni", "∌": "notni", "϶": "bepsi", "∏": "prod", "∐": "coprod", "∑": "sum", "+": "plus", "±": "pm", "÷": "div", "×": "times", "<": "lt", "≮": "nlt", "<⃒": "nvlt", "=": "equals", "≠": "ne", "=⃥": "bne", "⩵": "Equal", ">": "gt", "≯": "ngt", ">⃒": "nvgt", "¬": "not", "|": "vert", "¦": "brvbar", "−": "minus", "∓": "mp", "∔": "plusdo", "⁄": "frasl", "∖": "setmn", "∗": "lowast", "∘": "compfn", "√": "Sqrt", "∝": "prop", "∞": "infin", "∟": "angrt", "∠": "ang", "∠⃒": "nang", "∡": "angmsd", "∢": "angsph", "∣": "mid", "∤": "nmid", "∥": "par", "∦": "npar", "∧": "and", "∨": "or", "∩": "cap", "∩︀": "caps", "∪": "cup", "∪︀": "cups", "∫": "int", "∬": "Int", "∭": "tint", "⨌": "qint", "∮": "oint", "∯": "Conint", "∰": "Cconint", "∱": "cwint", "∲": "cwconint", "∳": "awconint", "∴": "there4", "∵": "becaus", "∶": "ratio", "∷": "Colon", "∸": "minusd", "∺": "mDDot", "∻": "homtht", "∼": "sim", "≁": "nsim", "∼⃒": "nvsim", "∽": "bsim", "∽̱": "race", "∾": "ac", "∾̳": "acE", "∿": "acd", "≀": "wr", "≂": "esim", "≂̸": "nesim", "≃": "sime", "≄": "nsime", "≅": "cong", "≇": "ncong", "≆": "simne", "≈": "ap", "≉": "nap", "≊": "ape", "≋": "apid", "≋̸": "napid", "≌": "bcong", "≍": "CupCap", "≭": "NotCupCap", "≍⃒": "nvap", "≎": "bump", "≎̸": "nbump", "≏": "bumpe", "≏̸": "nbumpe", "≐": "doteq", "≐̸": "nedot", "≑": "eDot", "≒": "efDot", "≓": "erDot", "≔": "colone", "≕": "ecolon", "≖": "ecir", "≗": "cire", "≙": "wedgeq", "≚": "veeeq", "≜": "trie", "≟": "equest", "≡": "equiv", "≢": "nequiv", "≡⃥": "bnequiv", "≤": "le", "≰": "nle", "≤⃒": "nvle", "≥": "ge", "≱": "nge", "≥⃒": "nvge", "≦": "lE", "≦̸": "nlE", "≧": "gE", "≧̸": "ngE", "≨︀": "lvnE", "≨": "lnE", "≩": "gnE", "≩︀": "gvnE", "≪": "ll", "≪̸": "nLtv", "≪⃒": "nLt", "≫": "gg", "≫̸": "nGtv", "≫⃒": "nGt", "≬": "twixt", "≲": "lsim", "≴": "nlsim", "≳": "gsim", "≵": "ngsim", "≶": "lg", "≸": "ntlg", "≷": "gl", "≹": "ntgl", "≺": "pr", "⊀": "npr", "≻": "sc", "⊁": "nsc", "≼": "prcue", "⋠": "nprcue", "≽": "sccue", "⋡": "nsccue", "≾": "prsim", "≿": "scsim", "≿̸": "NotSucceedsTilde", "⊂": "sub", "⊄": "nsub", "⊂⃒": "vnsub", "⊃": "sup", "⊅": "nsup", "⊃⃒": "vnsup", "⊆": "sube", "⊈": "nsube", "⊇": "supe", "⊉": "nsupe", "⊊︀": "vsubne", "⊊": "subne", "⊋︀": "vsupne", "⊋": "supne", "⊍": "cupdot", "⊎": "uplus", "⊏": "sqsub", "⊏̸": "NotSquareSubset", "⊐": "sqsup", "⊐̸": "NotSquareSuperset", "⊑": "sqsube", "⋢": "nsqsube", "⊒": "sqsupe", "⋣": "nsqsupe", "⊓": "sqcap", "⊓︀": "sqcaps", "⊔": "sqcup", "⊔︀": "sqcups", "⊕": "oplus", "⊖": "ominus", "⊗": "otimes", "⊘": "osol", "⊙": "odot", "⊚": "ocir", "⊛": "oast", "⊝": "odash", "⊞": "plusb", "⊟": "minusb", "⊠": "timesb", "⊡": "sdotb", "⊢": "vdash", "⊬": "nvdash", "⊣": "dashv", "⊤": "top", "⊥": "bot", "⊧": "models", "⊨": "vDash", "⊭": "nvDash", "⊩": "Vdash", "⊮": "nVdash", "⊪": "Vvdash", "⊫": "VDash", "⊯": "nVDash", "⊰": "prurel", "⊲": "vltri", "⋪": "nltri", "⊳": "vrtri", "⋫": "nrtri", "⊴": "ltrie", "⋬": "nltrie", "⊴⃒": "nvltrie", "⊵": "rtrie", "⋭": "nrtrie", "⊵⃒": "nvrtrie", "⊶": "origof", "⊷": "imof", "⊸": "mumap", "⊹": "hercon", "⊺": "intcal", "⊻": "veebar", "⊽": "barvee", "⊾": "angrtvb", "⊿": "lrtri", "⋀": "Wedge", "⋁": "Vee", "⋂": "xcap", "⋃": "xcup", "⋄": "diam", "⋅": "sdot", "⋆": "Star", "⋇": "divonx", "⋈": "bowtie", "⋉": "ltimes", "⋊": "rtimes", "⋋": "lthree", "⋌": "rthree", "⋍": "bsime", "⋎": "cuvee", "⋏": "cuwed", "⋐": "Sub", "⋑": "Sup", "⋒": "Cap", "⋓": "Cup", "⋔": "fork", "⋕": "epar", "⋖": "ltdot", "⋗": "gtdot", "⋘": "Ll", "⋘̸": "nLl", "⋙": "Gg", "⋙̸": "nGg", "⋚︀": "lesg", "⋚": "leg", "⋛": "gel", "⋛︀": "gesl", "⋞": "cuepr", "⋟": "cuesc", "⋦": "lnsim", "⋧": "gnsim", "⋨": "prnsim", "⋩": "scnsim", "⋮": "vellip", "⋯": "ctdot", "⋰": "utdot", "⋱": "dtdot", "⋲": "disin", "⋳": "isinsv", "⋴": "isins", "⋵": "isindot", "⋵̸": "notindot", "⋶": "notinvc", "⋷": "notinvb", "⋹": "isinE", "⋹̸": "notinE", "⋺": "nisd", "⋻": "xnis", "⋼": "nis", "⋽": "notnivc", "⋾": "notnivb", "⌅": "barwed", "⌆": "Barwed", "⌌": "drcrop", "⌍": "dlcrop", "⌎": "urcrop", "⌏": "ulcrop", "⌐": "bnot", "⌒": "profline", "⌓": "profsurf", "⌕": "telrec", "⌖": "target", "⌜": "ulcorn", "⌝": "urcorn", "⌞": "dlcorn", "⌟": "drcorn", "⌢": "frown", "⌣": "smile", "⌭": "cylcty", "⌮": "profalar", "⌶": "topbot", "⌽": "ovbar", "⌿": "solbar", "⍼": "angzarr", "⎰": "lmoust", "⎱": "rmoust", "⎴": "tbrk", "⎵": "bbrk", "⎶": "bbrktbrk", "⏜": "OverParenthesis", "⏝": "UnderParenthesis", "⏞": "OverBrace", "⏟": "UnderBrace", "⏢": "trpezium", "⏧": "elinters", "␣": "blank", "─": "boxh", "│": "boxv", "┌": "boxdr", "┐": "boxdl", "└": "boxur", "┘": "boxul", "├": "boxvr", "┤": "boxvl", "┬": "boxhd", "┴": "boxhu", "┼": "boxvh", "═": "boxH", "║": "boxV", "╒": "boxdR", "╓": "boxDr", "╔": "boxDR", "╕": "boxdL", "╖": "boxDl", "╗": "boxDL", "╘": "boxuR", "╙": "boxUr", "╚": "boxUR", "╛": "boxuL", "╜": "boxUl", "╝": "boxUL", "╞": "boxvR", "╟": "boxVr", "╠": "boxVR", "╡": "boxvL", "╢": "boxVl", "╣": "boxVL", "╤": "boxHd", "╥": "boxhD", "╦": "boxHD", "╧": "boxHu", "╨": "boxhU", "╩": "boxHU", "╪": "boxvH", "╫": "boxVh", "╬": "boxVH", "▀": "uhblk", "▄": "lhblk", "█": "block", "░": "blk14", "▒": "blk12", "▓": "blk34", "□": "squ", "▪": "squf", "▫": "EmptyVerySmallSquare", "▭": "rect", "▮": "marker", "▱": "fltns", "△": "xutri", "▴": "utrif", "▵": "utri", "▸": "rtrif", "▹": "rtri", "▽": "xdtri", "▾": "dtrif", "▿": "dtri", "◂": "ltrif", "◃": "ltri", "◊": "loz", "○": "cir", "◬": "tridot", "◯": "xcirc", "◸": "ultri", "◹": "urtri", "◺": "lltri", "◻": "EmptySmallSquare", "◼": "FilledSmallSquare", "★": "starf", "☆": "star", "☎": "phone", "♀": "female", "♂": "male", "♠": "spades", "♣": "clubs", "♥": "hearts", "♦": "diams", "♪": "sung", "✓": "check", "✗": "cross", "✠": "malt", "✶": "sext", "❘": "VerticalSeparator", "⟈": "bsolhsub", "⟉": "suphsol", "⟵": "xlarr", "⟶": "xrarr", "⟷": "xharr", "⟸": "xlArr", "⟹": "xrArr", "⟺": "xhArr", "⟼": "xmap", "⟿": "dzigrarr", "⤂": "nvlArr", "⤃": "nvrArr", "⤄": "nvHarr", "⤅": "Map", "⤌": "lbarr", "⤍": "rbarr", "⤎": "lBarr", "⤏": "rBarr", "⤐": "RBarr", "⤑": "DDotrahd", "⤒": "UpArrowBar", "⤓": "DownArrowBar", "⤖": "Rarrtl", "⤙": "latail", "⤚": "ratail", "⤛": "lAtail", "⤜": "rAtail", "⤝": "larrfs", "⤞": "rarrfs", "⤟": "larrbfs", "⤠": "rarrbfs", "⤣": "nwarhk", "⤤": "nearhk", "⤥": "searhk", "⤦": "swarhk", "⤧": "nwnear", "⤨": "toea", "⤩": "tosa", "⤪": "swnwar", "⤳": "rarrc", "⤳̸": "nrarrc", "⤵": "cudarrr", "⤶": "ldca", "⤷": "rdca", "⤸": "cudarrl", "⤹": "larrpl", "⤼": "curarrm", "⤽": "cularrp", "⥅": "rarrpl", "⥈": "harrcir", "⥉": "Uarrocir", "⥊": "lurdshar", "⥋": "ldrushar", "⥎": "LeftRightVector", "⥏": "RightUpDownVector", "⥐": "DownLeftRightVector", "⥑": "LeftUpDownVector", "⥒": "LeftVectorBar", "⥓": "RightVectorBar", "⥔": "RightUpVectorBar", "⥕": "RightDownVectorBar", "⥖": "DownLeftVectorBar", "⥗": "DownRightVectorBar", "⥘": "LeftUpVectorBar", "⥙": "LeftDownVectorBar", "⥚": "LeftTeeVector", "⥛": "RightTeeVector", "⥜": "RightUpTeeVector", "⥝": "RightDownTeeVector", "⥞": "DownLeftTeeVector", "⥟": "DownRightTeeVector", "⥠": "LeftUpTeeVector", "⥡": "LeftDownTeeVector", "⥢": "lHar", "⥣": "uHar", "⥤": "rHar", "⥥": "dHar", "⥦": "luruhar", "⥧": "ldrdhar", "⥨": "ruluhar", "⥩": "rdldhar", "⥪": "lharul", "⥫": "llhard", "⥬": "rharul", "⥭": "lrhard", "⥮": "udhar", "⥯": "duhar", "⥰": "RoundImplies", "⥱": "erarr", "⥲": "simrarr", "⥳": "larrsim", "⥴": "rarrsim", "⥵": "rarrap", "⥶": "ltlarr", "⥸": "gtrarr", "⥹": "subrarr", "⥻": "suplarr", "⥼": "lfisht", "⥽": "rfisht", "⥾": "ufisht", "⥿": "dfisht", "⦚": "vzigzag", "⦜": "vangrt", "⦝": "angrtvbd", "⦤": "ange", "⦥": "range", "⦦": "dwangle", "⦧": "uwangle", "⦨": "angmsdaa", "⦩": "angmsdab", "⦪": "angmsdac", "⦫": "angmsdad", "⦬": "angmsdae", "⦭": "angmsdaf", "⦮": "angmsdag", "⦯": "angmsdah", "⦰": "bemptyv", "⦱": "demptyv", "⦲": "cemptyv", "⦳": "raemptyv", "⦴": "laemptyv", "⦵": "ohbar", "⦶": "omid", "⦷": "opar", "⦹": "operp", "⦻": "olcross", "⦼": "odsold", "⦾": "olcir", "⦿": "ofcir", "⧀": "olt", "⧁": "ogt", "⧂": "cirscir", "⧃": "cirE", "⧄": "solb", "⧅": "bsolb", "⧉": "boxbox", "⧍": "trisb", "⧎": "rtriltri", "⧏": "LeftTriangleBar", "⧏̸": "NotLeftTriangleBar", "⧐": "RightTriangleBar", "⧐̸": "NotRightTriangleBar", "⧜": "iinfin", "⧝": "infintie", "⧞": "nvinfin", "⧣": "eparsl", "⧤": "smeparsl", "⧥": "eqvparsl", "⧫": "lozf", "⧴": "RuleDelayed", "⧶": "dsol", "⨀": "xodot", "⨁": "xoplus", "⨂": "xotime", "⨄": "xuplus", "⨆": "xsqcup", "⨍": "fpartint", "⨐": "cirfnint", "⨑": "awint", "⨒": "rppolint", "⨓": "scpolint", "⨔": "npolint", "⨕": "pointint", "⨖": "quatint", "⨗": "intlarhk", "⨢": "pluscir", "⨣": "plusacir", "⨤": "simplus", "⨥": "plusdu", "⨦": "plussim", "⨧": "plustwo", "⨩": "mcomma", "⨪": "minusdu", "⨭": "loplus", "⨮": "roplus", "⨯": "Cross", "⨰": "timesd", "⨱": "timesbar", "⨳": "smashp", "⨴": "lotimes", "⨵": "rotimes", "⨶": "otimesas", "⨷": "Otimes", "⨸": "odiv", "⨹": "triplus", "⨺": "triminus", "⨻": "tritime", "⨼": "iprod", "⨿": "amalg", "⩀": "capdot", "⩂": "ncup", "⩃": "ncap", "⩄": "capand", "⩅": "cupor", "⩆": "cupcap", "⩇": "capcup", "⩈": "cupbrcap", "⩉": "capbrcup", "⩊": "cupcup", "⩋": "capcap", "⩌": "ccups", "⩍": "ccaps", "⩐": "ccupssm", "⩓": "And", "⩔": "Or", "⩕": "andand", "⩖": "oror", "⩗": "orslope", "⩘": "andslope", "⩚": "andv", "⩛": "orv", "⩜": "andd", "⩝": "ord", "⩟": "wedbar", "⩦": "sdote", "⩪": "simdot", "⩭": "congdot", "⩭̸": "ncongdot", "⩮": "easter", "⩯": "apacir", "⩰": "apE", "⩰̸": "napE", "⩱": "eplus", "⩲": "pluse", "⩳": "Esim", "⩷": "eDDot", "⩸": "equivDD", "⩹": "ltcir", "⩺": "gtcir", "⩻": "ltquest", "⩼": "gtquest", "⩽": "les", "⩽̸": "nles", "⩾": "ges", "⩾̸": "nges", "⩿": "lesdot", "⪀": "gesdot", "⪁": "lesdoto", "⪂": "gesdoto", "⪃": "lesdotor", "⪄": "gesdotol", "⪅": "lap", "⪆": "gap", "⪇": "lne", "⪈": "gne", "⪉": "lnap", "⪊": "gnap", "⪋": "lEg", "⪌": "gEl", "⪍": "lsime", "⪎": "gsime", "⪏": "lsimg", "⪐": "gsiml", "⪑": "lgE", "⪒": "glE", "⪓": "lesges", "⪔": "gesles", "⪕": "els", "⪖": "egs", "⪗": "elsdot", "⪘": "egsdot", "⪙": "el", "⪚": "eg", "⪝": "siml", "⪞": "simg", "⪟": "simlE", "⪠": "simgE", "⪡": "LessLess", "⪡̸": "NotNestedLessLess", "⪢": "GreaterGreater", "⪢̸": "NotNestedGreaterGreater", "⪤": "glj", "⪥": "gla", "⪦": "ltcc", "⪧": "gtcc", "⪨": "lescc", "⪩": "gescc", "⪪": "smt", "⪫": "lat", "⪬": "smte", "⪬︀": "smtes", "⪭": "late", "⪭︀": "lates", "⪮": "bumpE", "⪯": "pre", "⪯̸": "npre", "⪰": "sce", "⪰̸": "nsce", "⪳": "prE", "⪴": "scE", "⪵": "prnE", "⪶": "scnE", "⪷": "prap", "⪸": "scap", "⪹": "prnap", "⪺": "scnap", "⪻": "Pr", "⪼": "Sc", "⪽": "subdot", "⪾": "supdot", "⪿": "subplus", "⫀": "supplus", "⫁": "submult", "⫂": "supmult", "⫃": "subedot", "⫄": "supedot", "⫅": "subE", "⫅̸": "nsubE", "⫆": "supE", "⫆̸": "nsupE", "⫇": "subsim", "⫈": "supsim", "⫋︀": "vsubnE", "⫋": "subnE", "⫌︀": "vsupnE", "⫌": "supnE", "⫏": "csub", "⫐": "csup", "⫑": "csube", "⫒": "csupe", "⫓": "subsup", "⫔": "supsub", "⫕": "subsub", "⫖": "supsup", "⫗": "suphsub", "⫘": "supdsub", "⫙": "forkv", "⫚": "topfork", "⫛": "mlcp", "⫤": "Dashv", "⫦": "Vdashl", "⫧": "Barv", "⫨": "vBar", "⫩": "vBarv", "⫫": "Vbar", "⫬": "Not", "⫭": "bNot", "⫮": "rnmid", "⫯": "cirmid", "⫰": "midcir", "⫱": "topcir", "⫲": "nhpar", "⫳": "parsim", "⫽": "parsl", "⫽⃥": "nparsl", "♭": "flat", "♮": "natur", "♯": "sharp", "¤": "curren", "¢": "cent", $: "dollar", "£": "pound", "¥": "yen", "€": "euro", "¹": "sup1", "½": "half", "⅓": "frac13", "¼": "frac14", "⅕": "frac15", "⅙": "frac16", "⅛": "frac18", "²": "sup2", "⅔": "frac23", "⅖": "frac25", "³": "sup3", "¾": "frac34", "⅗": "frac35", "⅜": "frac38", "⅘": "frac45", "⅚": "frac56", "⅝": "frac58", "⅞": "frac78", "𝒶": "ascr", "𝕒": "aopf", "𝔞": "afr", "𝔸": "Aopf", "𝔄": "Afr", "𝒜": "Ascr", ª: "ordf", á: "aacute", Á: "Aacute", à: "agrave", À: "Agrave", ă: "abreve", Ă: "Abreve", â: "acirc", Â: "Acirc", å: "aring", Å: "angst", ä: "auml", Ä: "Auml", ã: "atilde", Ã: "Atilde", ą: "aogon", Ą: "Aogon", ā: "amacr", Ā: "Amacr", æ: "aelig", Æ: "AElig", "𝒷": "bscr", "𝕓": "bopf", "𝔟": "bfr", "𝔹": "Bopf", ℬ: "Bscr", "𝔅": "Bfr", "𝔠": "cfr", "𝒸": "cscr", "𝕔": "copf", ℭ: "Cfr", "𝒞": "Cscr", ℂ: "Copf", ć: "cacute", Ć: "Cacute", ĉ: "ccirc", Ĉ: "Ccirc", č: "ccaron", Č: "Ccaron", ċ: "cdot", Ċ: "Cdot", ç: "ccedil", Ç: "Ccedil", "℅": "incare", "𝔡": "dfr", ⅆ: "dd", "𝕕": "dopf", "𝒹": "dscr", "𝒟": "Dscr", "𝔇": "Dfr", ⅅ: "DD", "𝔻": "Dopf", ď: "dcaron", Ď: "Dcaron", đ: "dstrok", Đ: "Dstrok", ð: "eth", Ð: "ETH", ⅇ: "ee", ℯ: "escr", "𝔢": "efr", "𝕖": "eopf", ℰ: "Escr", "𝔈": "Efr", "𝔼": "Eopf", é: "eacute", É: "Eacute", è: "egrave", È: "Egrave", ê: "ecirc", Ê: "Ecirc", ě: "ecaron", Ě: "Ecaron", ë: "euml", Ë: "Euml", ė: "edot", Ė: "Edot", ę: "eogon", Ę: "Eogon", ē: "emacr", Ē: "Emacr", "𝔣": "ffr", "𝕗": "fopf", "𝒻": "fscr", "𝔉": "Ffr", "𝔽": "Fopf", ℱ: "Fscr", ff: "fflig", ffi: "ffilig", ffl: "ffllig", fi: "filig", fj: "fjlig", fl: "fllig", ƒ: "fnof", ℊ: "gscr", "𝕘": "gopf", "𝔤": "gfr", "𝒢": "Gscr", "𝔾": "Gopf", "𝔊": "Gfr", ǵ: "gacute", ğ: "gbreve", Ğ: "Gbreve", ĝ: "gcirc", Ĝ: "Gcirc", ġ: "gdot", Ġ: "Gdot", Ģ: "Gcedil", "𝔥": "hfr", ℎ: "planckh", "𝒽": "hscr", "𝕙": "hopf", ℋ: "Hscr", ℌ: "Hfr", ℍ: "Hopf", ĥ: "hcirc", Ĥ: "Hcirc", ℏ: "hbar", ħ: "hstrok", Ħ: "Hstrok", "𝕚": "iopf", "𝔦": "ifr", "𝒾": "iscr", ⅈ: "ii", "𝕀": "Iopf", ℐ: "Iscr", ℑ: "Im", í: "iacute", Í: "Iacute", ì: "igrave", Ì: "Igrave", î: "icirc", Î: "Icirc", ï: "iuml", Ï: "Iuml", ĩ: "itilde", Ĩ: "Itilde", İ: "Idot", į: "iogon", Į: "Iogon", ī: "imacr", Ī: "Imacr", ij: "ijlig", IJ: "IJlig", ı: "imath", "𝒿": "jscr", "𝕛": "jopf", "𝔧": "jfr", "𝒥": "Jscr", "𝔍": "Jfr", "𝕁": "Jopf", ĵ: "jcirc", Ĵ: "Jcirc", ȷ: "jmath", "𝕜": "kopf", "𝓀": "kscr", "𝔨": "kfr", "𝒦": "Kscr", "𝕂": "Kopf", "𝔎": "Kfr", ķ: "kcedil", Ķ: "Kcedil", "𝔩": "lfr", "𝓁": "lscr", ℓ: "ell", "𝕝": "lopf", ℒ: "Lscr", "𝔏": "Lfr", "𝕃": "Lopf", ĺ: "lacute", Ĺ: "Lacute", ľ: "lcaron", Ľ: "Lcaron", ļ: "lcedil", Ļ: "Lcedil", ł: "lstrok", Ł: "Lstrok", ŀ: "lmidot", Ŀ: "Lmidot", "𝔪": "mfr", "𝕞": "mopf", "𝓂": "mscr", "𝔐": "Mfr", "𝕄": "Mopf", ℳ: "Mscr", "𝔫": "nfr", "𝕟": "nopf", "𝓃": "nscr", ℕ: "Nopf", "𝒩": "Nscr", "𝔑": "Nfr", ń: "nacute", Ń: "Nacute", ň: "ncaron", Ň: "Ncaron", ñ: "ntilde", Ñ: "Ntilde", ņ: "ncedil", Ņ: "Ncedil", "№": "numero", ŋ: "eng", Ŋ: "ENG", "𝕠": "oopf", "𝔬": "ofr", ℴ: "oscr", "𝒪": "Oscr", "𝔒": "Ofr", "𝕆": "Oopf", º: "ordm", ó: "oacute", Ó: "Oacute", ò: "ograve", Ò: "Ograve", ô: "ocirc", Ô: "Ocirc", ö: "ouml", Ö: "Ouml", ő: "odblac", Ő: "Odblac", õ: "otilde", Õ: "Otilde", ø: "oslash", Ø: "Oslash", ō: "omacr", Ō: "Omacr", œ: "oelig", Œ: "OElig", "𝔭": "pfr", "𝓅": "pscr", "𝕡": "popf", ℙ: "Popf", "𝔓": "Pfr", "𝒫": "Pscr", "𝕢": "qopf", "𝔮": "qfr", "𝓆": "qscr", "𝒬": "Qscr", "𝔔": "Qfr", ℚ: "Qopf", ĸ: "kgreen", "𝔯": "rfr", "𝕣": "ropf", "𝓇": "rscr", ℛ: "Rscr", ℜ: "Re", ℝ: "Ropf", ŕ: "racute", Ŕ: "Racute", ř: "rcaron", Ř: "Rcaron", ŗ: "rcedil", Ŗ: "Rcedil", "𝕤": "sopf", "𝓈": "sscr", "𝔰": "sfr", "𝕊": "Sopf", "𝔖": "Sfr", "𝒮": "Sscr", "Ⓢ": "oS", ś: "sacute", Ś: "Sacute", ŝ: "scirc", Ŝ: "Scirc", š: "scaron", Š: "Scaron", ş: "scedil", Ş: "Scedil", ß: "szlig", "𝔱": "tfr", "𝓉": "tscr", "𝕥": "topf", "𝒯": "Tscr", "𝔗": "Tfr", "𝕋": "Topf", ť: "tcaron", Ť: "Tcaron", ţ: "tcedil", Ţ: "Tcedil", "™": "trade", ŧ: "tstrok", Ŧ: "Tstrok", "𝓊": "uscr", "𝕦": "uopf", "𝔲": "ufr", "𝕌": "Uopf", "𝔘": "Ufr", "𝒰": "Uscr", ú: "uacute", Ú: "Uacute", ù: "ugrave", Ù: "Ugrave", ŭ: "ubreve", Ŭ: "Ubreve", û: "ucirc", Û: "Ucirc", ů: "uring", Ů: "Uring", ü: "uuml", Ü: "Uuml", ű: "udblac", Ű: "Udblac", ũ: "utilde", Ũ: "Utilde", ų: "uogon", Ų: "Uogon", ū: "umacr", Ū: "Umacr", "𝔳": "vfr", "𝕧": "vopf", "𝓋": "vscr", "𝔙": "Vfr", "𝕍": "Vopf", "𝒱": "Vscr", "𝕨": "wopf", "𝓌": "wscr", "𝔴": "wfr", "𝒲": "Wscr", "𝕎": "Wopf", "𝔚": "Wfr", ŵ: "wcirc", Ŵ: "Wcirc", "𝔵": "xfr", "𝓍": "xscr", "𝕩": "xopf", "𝕏": "Xopf", "𝔛": "Xfr", "𝒳": "Xscr", "𝔶": "yfr", "𝓎": "yscr", "𝕪": "yopf", "𝒴": "Yscr", "𝔜": "Yfr", "𝕐": "Yopf", ý: "yacute", Ý: "Yacute", ŷ: "ycirc", Ŷ: "Ycirc", ÿ: "yuml", Ÿ: "Yuml", "𝓏": "zscr", "𝔷": "zfr", "𝕫": "zopf", ℨ: "Zfr", ℤ: "Zopf", "𝒵": "Zscr", ź: "zacute", Ź: "Zacute", ž: "zcaron", Ž: "Zcaron", ż: "zdot", Ż: "Zdot", Ƶ: "imped", þ: "thorn", Þ: "THORN", ʼn: "napos", α: "alpha", Α: "Alpha", β: "beta", Β: "Beta", γ: "gamma", Γ: "Gamma", δ: "delta", Δ: "Delta", ε: "epsi", ϵ: "epsiv", Ε: "Epsilon", ϝ: "gammad", Ϝ: "Gammad", ζ: "zeta", Ζ: "Zeta", η: "eta", Η: "Eta", θ: "theta", ϑ: "thetav", Θ: "Theta", ι: "iota", Ι: "Iota", κ: "kappa", ϰ: "kappav", Κ: "Kappa", λ: "lambda", Λ: "Lambda", μ: "mu", µ: "micro", Μ: "Mu", ν: "nu", Ν: "Nu", ξ: "xi", Ξ: "Xi", ο: "omicron", Ο: "Omicron", π: "pi", ϖ: "piv", Π: "Pi", ρ: "rho", ϱ: "rhov", Ρ: "Rho", σ: "sigma", Σ: "Sigma", ς: "sigmaf", τ: "tau", Τ: "Tau", υ: "upsi", Υ: "Upsilon", ϒ: "Upsi", φ: "phi", ϕ: "phiv", Φ: "Phi", χ: "chi", Χ: "Chi", ψ: "psi", Ψ: "Psi", ω: "omega", Ω: "ohm", а: "acy", А: "Acy", б: "bcy", Б: "Bcy", в: "vcy", В: "Vcy", г: "gcy", Г: "Gcy", ѓ: "gjcy", Ѓ: "GJcy", д: "dcy", Д: "Dcy", ђ: "djcy", Ђ: "DJcy", е: "iecy", Е: "IEcy", ё: "iocy", Ё: "IOcy", є: "jukcy", Є: "Jukcy", ж: "zhcy", Ж: "ZHcy", з: "zcy", З: "Zcy", ѕ: "dscy", Ѕ: "DScy", и: "icy", И: "Icy", і: "iukcy", І: "Iukcy", ї: "yicy", Ї: "YIcy", й: "jcy", Й: "Jcy", ј: "jsercy", Ј: "Jsercy", к: "kcy", К: "Kcy", ќ: "kjcy", Ќ: "KJcy", л: "lcy", Л: "Lcy", љ: "ljcy", Љ: "LJcy", м: "mcy", М: "Mcy", н: "ncy", Н: "Ncy", њ: "njcy", Њ: "NJcy", о: "ocy", О: "Ocy", п: "pcy", П: "Pcy", р: "rcy", Р: "Rcy", с: "scy", С: "Scy", т: "tcy", Т: "Tcy", ћ: "tshcy", Ћ: "TSHcy", у: "ucy", У: "Ucy", ў: "ubrcy", Ў: "Ubrcy", ф: "fcy", Ф: "Fcy", х: "khcy", Х: "KHcy", ц: "tscy", Ц: "TScy", ч: "chcy", Ч: "CHcy", џ: "dzcy", Џ: "DZcy", ш: "shcy", Ш: "SHcy", щ: "shchcy", Щ: "SHCHcy", ъ: "hardcy", Ъ: "HARDcy", ы: "ycy", Ы: "Ycy", ь: "softcy", Ь: "SOFTcy", э: "ecy", Э: "Ecy", ю: "yucy", Ю: "YUcy", я: "yacy", Я: "YAcy", ℵ: "aleph", ℶ: "beth", ℷ: "gimel", ℸ: "daleth", }, h = /["&'<>`]/g, p = { '"': """, "&": "&", "'": "'", "<": "<", ">": ">", "`": "`", }, d = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/, f = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, g = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g, _ = { aacute: "á", Aacute: "Á", abreve: "ă", Abreve: "Ă", ac: "∾", acd: "∿", acE: "∾̳", acirc: "â", Acirc: "Â", acute: "´", acy: "а", Acy: "А", aelig: "æ", AElig: "Æ", af: "⁡", afr: "𝔞", Afr: "𝔄", agrave: "à", Agrave: "À", alefsym: "ℵ", aleph: "ℵ", alpha: "α", Alpha: "Α", amacr: "ā", Amacr: "Ā", amalg: "⨿", amp: "&", AMP: "&", and: "∧", And: "⩓", andand: "⩕", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsd: "∡", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", aogon: "ą", Aogon: "Ą", aopf: "𝕒", Aopf: "𝔸", ap: "≈", apacir: "⩯", ape: "≊", apE: "⩰", apid: "≋", apos: "'", ApplyFunction: "⁡", approx: "≈", approxeq: "≊", aring: "å", Aring: "Å", ascr: "𝒶", Ascr: "𝒜", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", atilde: "ã", Atilde: "Ã", auml: "ä", Auml: "Ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", bcy: "б", Bcy: "Б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", beta: "β", Beta: "Β", beth: "ℶ", between: "≬", bfr: "𝔟", Bfr: "𝔅", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bnot: "⌐", bNot: "⫭", bopf: "𝕓", Bopf: "𝔹", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxhD: "╥", boxHd: "╤", boxHD: "╦", boxhu: "┴", boxhU: "╨", boxHu: "╧", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsol: "\\", bsolb: "⧅", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpe: "≏", bumpE: "⪮", bumpeq: "≏", Bumpeq: "≎", cacute: "ć", Cacute: "Ć", cap: "∩", Cap: "⋒", capand: "⩄", capbrcup: "⩉", capcap: "⩋", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", ccaron: "č", Ccaron: "Č", ccedil: "ç", Ccedil: "Ç", ccirc: "ĉ", Ccirc: "Ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", cdot: "ċ", Cdot: "Ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", chcy: "ч", CHcy: "Ч", check: "✓", checkmark: "✓", chi: "χ", Chi: "Χ", cir: "○", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cire: "≗", cirE: "⧃", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", colone: "≔", Colone: "⩴", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", cscr: "𝒸", Cscr: "𝒞", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cup: "∪", Cup: "⋓", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", dArr: "⇓", Darr: "↡", dash: "‐", dashv: "⊣", Dashv: "⫤", dbkarow: "⤏", dblac: "˝", dcaron: "ď", Dcaron: "Ď", dcy: "д", Dcy: "Д", dd: "ⅆ", DD: "ⅅ", ddagger: "‡", ddarr: "⇊", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", delta: "δ", Delta: "Δ", demptyv: "⦱", dfisht: "⥿", dfr: "𝔡", Dfr: "𝔇", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", djcy: "ђ", DJcy: "Ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", dopf: "𝕕", Dopf: "𝔻", dot: "˙", Dot: "¨", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", downarrow: "↓", Downarrow: "⇓", DownArrow: "↓", DownArrowBar: "⤓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVector: "↽", DownLeftVectorBar: "⥖", DownRightTeeVector: "⥟", DownRightVector: "⇁", DownRightVectorBar: "⥗", DownTee: "⊤", DownTeeArrow: "↧", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", dscr: "𝒹", Dscr: "𝒟", dscy: "ѕ", DScy: "Ѕ", dsol: "⧶", dstrok: "đ", Dstrok: "Đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", dzcy: "џ", DZcy: "Џ", dzigrarr: "⟿", eacute: "é", Eacute: "É", easter: "⩮", ecaron: "ě", Ecaron: "Ě", ecir: "≖", ecirc: "ê", Ecirc: "Ê", ecolon: "≕", ecy: "э", Ecy: "Э", eDDot: "⩷", edot: "ė", eDot: "≑", Edot: "Ė", ee: "ⅇ", efDot: "≒", efr: "𝔢", Efr: "𝔈", eg: "⪚", egrave: "è", Egrave: "È", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", emacr: "ē", Emacr: "Ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp: " ", emsp13: " ", emsp14: " ", eng: "ŋ", ENG: "Ŋ", ensp: " ", eogon: "ę", Eogon: "Ę", eopf: "𝕖", Eopf: "𝔼", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", epsilon: "ε", Epsilon: "Ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", esim: "≂", Esim: "⩳", eta: "η", Eta: "Η", eth: "ð", ETH: "Ð", euml: "ë", Euml: "Ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", fcy: "ф", Fcy: "Ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", ffr: "𝔣", Ffr: "𝔉", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", fopf: "𝕗", Fopf: "𝔽", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", gamma: "γ", Gamma: "Γ", gammad: "ϝ", Gammad: "Ϝ", gap: "⪆", gbreve: "ğ", Gbreve: "Ğ", Gcedil: "Ģ", gcirc: "ĝ", Gcirc: "Ĝ", gcy: "г", Gcy: "Г", gdot: "ġ", Gdot: "Ġ", ge: "≥", gE: "≧", gel: "⋛", gEl: "⪌", geq: "≥", geqq: "≧", geqslant: "⩾", ges: "⩾", gescc: "⪩", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", gfr: "𝔤", Gfr: "𝔊", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", gjcy: "ѓ", GJcy: "Ѓ", gl: "≷", gla: "⪥", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", gopf: "𝕘", Gopf: "𝔾", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", gscr: "ℊ", Gscr: "𝒢", gsim: "≳", gsime: "⪎", gsiml: "⪐", gt: ">", Gt: "≫", GT: ">", gtcc: "⪧", gtcir: "⩺", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", hardcy: "ъ", HARDcy: "Ъ", harr: "↔", hArr: "⇔", harrcir: "⥈", harrw: "↭", Hat: "^", hbar: "ℏ", hcirc: "ĥ", Hcirc: "Ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", hstrok: "ħ", Hstrok: "Ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", iacute: "í", Iacute: "Í", ic: "⁣", icirc: "î", Icirc: "Î", icy: "и", Icy: "И", Idot: "İ", iecy: "е", IEcy: "Е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", igrave: "ì", Igrave: "Ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", ijlig: "ij", IJlig: "IJ", Im: "ℑ", imacr: "ī", Imacr: "Ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", imof: "⊷", imped: "Ƶ", Implies: "⇒", in: "∈", incare: "℅", infin: "∞", infintie: "⧝", inodot: "ı", int: "∫", Int: "∬", intcal: "⊺", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "⁣", InvisibleTimes: "⁢", iocy: "ё", IOcy: "Ё", iogon: "į", Iogon: "Į", iopf: "𝕚", Iopf: "𝕀", iota: "ι", Iota: "Ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "⁢", itilde: "ĩ", Itilde: "Ĩ", iukcy: "і", Iukcy: "І", iuml: "ï", Iuml: "Ï", jcirc: "ĵ", Jcirc: "Ĵ", jcy: "й", Jcy: "Й", jfr: "𝔧", Jfr: "𝔍", jmath: "ȷ", jopf: "𝕛", Jopf: "𝕁", jscr: "𝒿", Jscr: "𝒥", jsercy: "ј", Jsercy: "Ј", jukcy: "є", Jukcy: "Є", kappa: "κ", Kappa: "Κ", kappav: "ϰ", kcedil: "ķ", Kcedil: "Ķ", kcy: "к", Kcy: "К", kfr: "𝔨", Kfr: "𝔎", kgreen: "ĸ", khcy: "х", KHcy: "Х", kjcy: "ќ", KJcy: "Ќ", kopf: "𝕜", Kopf: "𝕂", kscr: "𝓀", Kscr: "𝒦", lAarr: "⇚", lacute: "ĺ", Lacute: "Ĺ", laemptyv: "⦴", lagran: "ℒ", lambda: "λ", Lambda: "Λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larr: "←", lArr: "⇐", Larr: "↞", larrb: "⇤", larrbfs: "⤟", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", lat: "⪫", latail: "⤙", lAtail: "⤛", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", lcaron: "ľ", Lcaron: "Ľ", lcedil: "ļ", Lcedil: "Ļ", lceil: "⌈", lcub: "{", lcy: "л", Lcy: "Л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", leftarrow: "←", Leftarrow: "⇐", LeftArrow: "←", LeftArrowBar: "⇤", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVector: "⇃", LeftDownVectorBar: "⥙", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", Leftrightarrow: "⇔", LeftRightArrow: "↔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTee: "⊣", LeftTeeArrow: "↤", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangle: "⊲", LeftTriangleBar: "⧏", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVector: "↿", LeftUpVectorBar: "⥘", LeftVector: "↼", LeftVectorBar: "⥒", leg: "⋚", lEg: "⪋", leq: "≤", leqq: "≦", leqslant: "⩽", les: "⩽", lescc: "⪨", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", lfr: "𝔩", Lfr: "𝔏", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", ljcy: "љ", LJcy: "Љ", ll: "≪", Ll: "⋘", llarr: "⇇", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", lmidot: "ŀ", Lmidot: "Ŀ", lmoust: "⎰", lmoustache: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", Longleftarrow: "⟸", LongLeftArrow: "⟵", longleftrightarrow: "⟷", Longleftrightarrow: "⟺", LongLeftRightArrow: "⟷", longmapsto: "⟼", longrightarrow: "⟶", Longrightarrow: "⟹", LongRightArrow: "⟶", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", lopf: "𝕝", Lopf: "𝕃", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "‎", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", lstrok: "ł", Lstrok: "Ł", lt: "<", Lt: "≪", LT: "<", ltcc: "⪦", ltcir: "⩹", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", map: "↦", Map: "⤅", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", mcy: "м", Mcy: "М", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", mfr: "𝔪", Mfr: "𝔐", mho: "℧", micro: "µ", mid: "∣", midast: "*", midcir: "⫰", middot: "·", minus: "−", minusb: "⊟", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", mopf: "𝕞", Mopf: "𝕄", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", mu: "μ", Mu: "Μ", multimap: "⊸", mumap: "⊸", nabla: "∇", nacute: "ń", Nacute: "Ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natur: "♮", natural: "♮", naturals: "ℕ", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", ncaron: "ň", Ncaron: "Ň", ncedil: "ņ", Ncedil: "Ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", ncy: "н", Ncy: "Н", ndash: "–", ne: "≠", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", nedot: "≐̸", NegativeMediumSpace: "​", NegativeThickSpace: "​", NegativeThinSpace: "​", NegativeVeryThinSpace: "​", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: "\n", nexist: "∄", nexists: "∄", nfr: "𝔫", Nfr: "𝔑", nge: "≱", ngE: "≧̸", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", ngt: "≯", nGt: "≫⃒", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", njcy: "њ", NJcy: "Њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nle: "≰", nlE: "≦̸", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nlt: "≮", nLt: "≪⃒", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "⁠", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", not: "¬", Not: "⫬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangle: "⋪", NotLeftTriangleBar: "⧏̸", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangle: "⋫", NotRightTriangleBar: "⧐̸", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", npar: "∦", nparallel: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", npre: "⪯̸", nprec: "⊀", npreceq: "⪯̸", nrarr: "↛", nrArr: "⇏", nrarrc: "⤳̸", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", nscr: "𝓃", Nscr: "𝒩", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsube: "⊈", nsubE: "⫅̸", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupe: "⊉", nsupE: "⫆̸", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", ntilde: "ñ", Ntilde: "Ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", nu: "ν", Nu: "Ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", oacute: "ó", Oacute: "Ó", oast: "⊛", ocir: "⊚", ocirc: "ô", Ocirc: "Ô", ocy: "о", Ocy: "О", odash: "⊝", odblac: "ő", Odblac: "Ő", odiv: "⨸", odot: "⊙", odsold: "⦼", oelig: "œ", OElig: "Œ", ofcir: "⦿", ofr: "𝔬", Ofr: "𝔒", ogon: "˛", ograve: "ò", Ograve: "Ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", omacr: "ō", Omacr: "Ō", omega: "ω", Omega: "Ω", omicron: "ο", Omicron: "Ο", omid: "⦶", ominus: "⊖", oopf: "𝕠", Oopf: "𝕆", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", or: "∨", Or: "⩔", orarr: "↻", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", oscr: "ℴ", Oscr: "𝒪", oslash: "ø", Oslash: "Ø", osol: "⊘", otilde: "õ", Otilde: "Õ", otimes: "⊗", Otimes: "⨷", otimesas: "⨶", ouml: "ö", Ouml: "Ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", par: "∥", para: "¶", parallel: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", pcy: "п", Pcy: "П", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", pfr: "𝔭", Pfr: "𝔓", phi: "φ", Phi: "Φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", pi: "π", Pi: "Π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plus: "+", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", pr: "≺", Pr: "⪻", prap: "⪷", prcue: "≼", pre: "⪯", prE: "⪳", prec: "≺", precapprox: "⪷", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportion: "∷", Proportional: "∝", propto: "∝", prsim: "≾", prurel: "⊰", pscr: "𝓅", Pscr: "𝒫", psi: "ψ", Psi: "Ψ", puncsp: " ", qfr: "𝔮", Qfr: "𝔔", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", qscr: "𝓆", Qscr: "𝒬", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: '"', QUOT: '"', rAarr: "⇛", race: "∽̱", racute: "ŕ", Racute: "Ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarr: "→", rArr: "⇒", Rarr: "↠", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", rarrtl: "↣", Rarrtl: "⤖", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", rcaron: "ř", Rcaron: "Ř", rcedil: "ŗ", Rcedil: "Ŗ", rceil: "⌉", rcub: "}", rcy: "р", Rcy: "Р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", Re: "ℜ", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", rho: "ρ", Rho: "Ρ", rhov: "ϱ", RightAngleBracket: "⟩", rightarrow: "→", Rightarrow: "⇒", RightArrow: "→", RightArrowBar: "⇥", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVector: "⇂", RightDownVectorBar: "⥕", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTee: "⊢", RightTeeArrow: "↦", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangle: "⊳", RightTriangleBar: "⧐", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVector: "↾", RightUpVectorBar: "⥔", RightVector: "⇀", RightVectorBar: "⥓", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "‏", rmoust: "⎱", rmoustache: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", sacute: "ś", Sacute: "Ś", sbquo: "‚", sc: "≻", Sc: "⪼", scap: "⪸", scaron: "š", Scaron: "Š", sccue: "≽", sce: "⪰", scE: "⪴", scedil: "ş", Scedil: "Ş", scirc: "ŝ", Scirc: "Ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", scy: "с", Scy: "С", sdot: "⋅", sdotb: "⊡", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", sfr: "𝔰", Sfr: "𝔖", sfrown: "⌢", sharp: "♯", shchcy: "щ", SHCHcy: "Щ", shcy: "ш", SHcy: "Ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "­", sigma: "σ", Sigma: "Σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", softcy: "ь", SOFTcy: "Ь", sol: "/", solb: "⧄", solbar: "⌿", sopf: "𝕤", Sopf: "𝕊", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", squ: "□", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squf: "▪", srarr: "→", sscr: "𝓈", Sscr: "𝒮", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", star: "☆", Star: "⋆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", sube: "⊆", subE: "⫅", subedot: "⫃", submult: "⫁", subne: "⊊", subnE: "⫋", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succ: "≻", succapprox: "⪸", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup: "⊃", Sup: "⋑", sup1: "¹", sup2: "²", sup3: "³", supdot: "⪾", supdsub: "⫘", supe: "⊇", supE: "⫆", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supne: "⊋", supnE: "⫌", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "\t", target: "⌖", tau: "τ", Tau: "Τ", tbrk: "⎴", tcaron: "ť", Tcaron: "Ť", tcedil: "ţ", Tcedil: "Ţ", tcy: "т", Tcy: "Т", tdot: "⃛", telrec: "⌕", tfr: "𝔱", Tfr: "𝔗", there4: "∴", therefore: "∴", Therefore: "∴", theta: "θ", Theta: "Θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: "  ", thinsp: " ", ThinSpace: " ", thkap: "≈", thksim: "∼", thorn: "þ", THORN: "Þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", times: "×", timesb: "⊠", timesbar: "⨱", timesd: "⨰", tint: "∭", toea: "⤨", top: "⊤", topbot: "⌶", topcir: "⫱", topf: "𝕥", Topf: "𝕋", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", tscr: "𝓉", Tscr: "𝒯", tscy: "ц", TScy: "Ц", tshcy: "ћ", TSHcy: "Ћ", tstrok: "ŧ", Tstrok: "Ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", uacute: "ú", Uacute: "Ú", uarr: "↑", uArr: "⇑", Uarr: "↟", Uarrocir: "⥉", ubrcy: "ў", Ubrcy: "Ў", ubreve: "ŭ", Ubreve: "Ŭ", ucirc: "û", Ucirc: "Û", ucy: "у", Ucy: "У", udarr: "⇅", udblac: "ű", Udblac: "Ű", udhar: "⥮", ufisht: "⥾", ufr: "𝔲", Ufr: "𝔘", ugrave: "ù", Ugrave: "Ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", umacr: "ū", Umacr: "Ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", uogon: "ų", Uogon: "Ų", uopf: "𝕦", Uopf: "𝕌", uparrow: "↑", Uparrow: "⇑", UpArrow: "↑", UpArrowBar: "⤒", UpArrowDownArrow: "⇅", updownarrow: "↕", Updownarrow: "⇕", UpDownArrow: "↕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", upsilon: "υ", Upsilon: "Υ", UpTee: "⊥", UpTeeArrow: "↥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", uring: "ů", Uring: "Ů", urtri: "◹", uscr: "𝓊", Uscr: "𝒰", utdot: "⋰", utilde: "ũ", Utilde: "Ũ", utri: "▵", utrif: "▴", uuarr: "⇈", uuml: "ü", Uuml: "Ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", vcy: "в", Vcy: "В", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", vee: "∨", Vee: "⋁", veebar: "⊻", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", vfr: "𝔳", Vfr: "𝔙", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", vopf: "𝕧", Vopf: "𝕍", vprop: "∝", vrtri: "⊳", vscr: "𝓋", Vscr: "𝒱", vsubne: "⊊︀", vsubnE: "⫋︀", vsupne: "⊋︀", vsupnE: "⫌︀", Vvdash: "⊪", vzigzag: "⦚", wcirc: "ŵ", Wcirc: "Ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", wfr: "𝔴", Wfr: "𝔚", wopf: "𝕨", Wopf: "𝕎", wp: "℘", wr: "≀", wreath: "≀", wscr: "𝓌", Wscr: "𝒲", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", xfr: "𝔵", Xfr: "𝔛", xharr: "⟷", xhArr: "⟺", xi: "ξ", Xi: "Ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", xopf: "𝕩", Xopf: "𝕏", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", xscr: "𝓍", Xscr: "𝒳", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", yacute: "ý", Yacute: "Ý", yacy: "я", YAcy: "Я", ycirc: "ŷ", Ycirc: "Ŷ", ycy: "ы", Ycy: "Ы", yen: "¥", yfr: "𝔶", Yfr: "𝔜", yicy: "ї", YIcy: "Ї", yopf: "𝕪", Yopf: "𝕐", yscr: "𝓎", Yscr: "𝒴", yucy: "ю", YUcy: "Ю", yuml: "ÿ", Yuml: "Ÿ", zacute: "ź", Zacute: "Ź", zcaron: "ž", Zcaron: "Ž", zcy: "з", Zcy: "З", zdot: "ż", Zdot: "Ż", zeetrf: "ℨ", ZeroWidthSpace: "​", zeta: "ζ", Zeta: "Ζ", zfr: "𝔷", Zfr: "ℨ", zhcy: "ж", ZHcy: "Ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", zscr: "𝓏", Zscr: "𝒵", zwj: "‍", zwnj: "‌", }, m = { aacute: "á", Aacute: "Á", acirc: "â", Acirc: "Â", acute: "´", aelig: "æ", AElig: "Æ", agrave: "à", Agrave: "À", amp: "&", AMP: "&", aring: "å", Aring: "Å", atilde: "ã", Atilde: "Ã", auml: "ä", Auml: "Ä", brvbar: "¦", ccedil: "ç", Ccedil: "Ç", cedil: "¸", cent: "¢", copy: "©", COPY: "©", curren: "¤", deg: "°", divide: "÷", eacute: "é", Eacute: "É", ecirc: "ê", Ecirc: "Ê", egrave: "è", Egrave: "È", eth: "ð", ETH: "Ð", euml: "ë", Euml: "Ë", frac12: "½", frac14: "¼", frac34: "¾", gt: ">", GT: ">", iacute: "í", Iacute: "Í", icirc: "î", Icirc: "Î", iexcl: "¡", igrave: "ì", Igrave: "Ì", iquest: "¿", iuml: "ï", Iuml: "Ï", laquo: "«", lt: "<", LT: "<", macr: "¯", micro: "µ", middot: "·", nbsp: " ", not: "¬", ntilde: "ñ", Ntilde: "Ñ", oacute: "ó", Oacute: "Ó", ocirc: "ô", Ocirc: "Ô", ograve: "ò", Ograve: "Ò", ordf: "ª", ordm: "º", oslash: "ø", Oslash: "Ø", otilde: "õ", Otilde: "Õ", ouml: "ö", Ouml: "Ö", para: "¶", plusmn: "±", pound: "£", quot: '"', QUOT: '"', raquo: "»", reg: "®", REG: "®", sect: "§", shy: "­", sup1: "¹", sup2: "²", sup3: "³", szlig: "ß", thorn: "þ", THORN: "Þ", times: "×", uacute: "ú", Uacute: "Ú", ucirc: "û", Ucirc: "Û", ugrave: "ù", Ugrave: "Ù", uml: "¨", uuml: "ü", Uuml: "Ü", yacute: "ý", Yacute: "Ý", yen: "¥", yuml: "ÿ", }, y = { 0: "�", 128: "€", 130: "‚", 131: "ƒ", 132: "„", 133: "…", 134: "†", 135: "‡", 136: "ˆ", 137: "‰", 138: "Š", 139: "‹", 140: "Œ", 142: "Ž", 145: "‘", 146: "’", 147: "“", 148: "”", 149: "•", 150: "–", 151: "—", 152: "˜", 153: "™", 154: "š", 155: "›", 156: "œ", 158: "ž", 159: "Ÿ", }, A = [ 1, 2, 3, 4, 5, 6, 7, 8, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 64976, 64977, 64978, 64979, 64980, 64981, 64982, 64983, 64984, 64985, 64986, 64987, 64988, 64989, 64990, 64991, 64992, 64993, 64994, 64995, 64996, 64997, 64998, 64999, 65e3, 65001, 65002, 65003, 65004, 65005, 65006, 65007, 65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, 1048575, 1114110, 1114111, ], v = String.fromCharCode, b = {}.hasOwnProperty, C = function (t, e) { return b.call(t, e); }, I = function (t, e) { if (!t) return e; var n, r = {}; for (n in e) r[n] = C(t, n) ? t[n] : e[n]; return r; }, E = function (t, e) { var n = ""; return (t >= 55296 && t <= 57343) || t > 1114111 ? (e && S("character reference outside the permissible Unicode range"), "�") : C(y, t) ? (e && S("disallowed character reference"), y[t]) : (e && (function (t, e) { for (var n = -1, r = t.length; ++n < r; ) if (t[n] == e) return !0; return !1; })(A, t) && S("disallowed character reference"), t > 65535 && ((n += v((((t -= 65536) >>> 10) & 1023) | 55296)), (t = 56320 | (1023 & t))), (n += v(t))); }, x = function (t) { return "&#x" + t.toString(16).toUpperCase() + ";"; }, w = function (t) { return "&#" + t + ";"; }, S = function (t) { throw Error("Parse error: " + t); }, D = function (t, e) { (e = I(e, D.options)).strict && f.test(t) && S("forbidden code point"); var n = e.encodeEverything, r = e.useNamedReferences, i = e.allowUnsafeSymbols, o = e.decimal ? w : x, p = function (t) { return o(t.charCodeAt(0)); }; return ( n ? ((t = t.replace(s, function (t) { return r && C(c, t) ? "&" + c[t] + ";" : p(t); })), r && (t = t .replace(/>\u20D2/g, ">⃒") .replace(/<\u20D2/g, "<⃒") .replace(/fj/g, "fj")), r && (t = t.replace(l, function (t) { return "&" + c[t] + ";"; }))) : r ? (i || (t = t.replace(h, function (t) { return "&" + c[t] + ";"; })), (t = (t = t .replace(/>\u20D2/g, ">⃒") .replace(/<\u20D2/g, "<⃒")).replace(l, function (t) { return "&" + c[t] + ";"; }))) : i || (t = t.replace(h, p)), t .replace(a, function (t) { var e = t.charCodeAt(0), n = t.charCodeAt(1); return o(1024 * (e - 55296) + n - 56320 + 65536); }) .replace(u, p) ); }; D.options = { allowUnsafeSymbols: !1, encodeEverything: !1, strict: !1, useNamedReferences: !1, decimal: !1, }; var T = function (t, e) { var n = (e = I(e, T.options)).strict; return ( n && d.test(t) && S("malformed character reference"), t.replace(g, function (t, r, i, o, a, s, u, l, c) { var h, p, d, f, g, y; return r ? _[(g = r)] : i ? ((g = i), (y = o) && e.isAttributeValue ? (n && "=" == y && S("`&` did not start a character reference"), t) : (n && S( "named character reference was not terminated by a semicolon" ), m[g] + (y || ""))) : a ? ((d = a), (p = s), n && !p && S("character reference was not terminated by a semicolon"), (h = parseInt(d, 10)), E(h, n)) : u ? ((f = u), (p = l), n && !p && S("character reference was not terminated by a semicolon"), (h = parseInt(f, 16)), E(h, n)) : (n && S( "named character reference was not terminated by a semicolon" ), t); }) ); }; T.options = { isAttributeValue: !1, strict: !1 }; var P = { version: "1.2.0", encode: D, decode: T, escape: function (t) { return t.replace(h, function (t) { return p[t]; }); }, unescape: T, }; if (r && !r.nodeType) if (i) i.exports = P; else for (var O in P) C(P, O) && (r[O] = P[O]); else n.he = P; })(Zc); }); class rh extends Wc { constructor(t) { super(), (this.rawText = t), (this.nodeType = Jc.TEXT_NODE); } get text() { return this.rawText; } get isWhitespace() { return /^(\s| )*$/.test(this.rawText); } toString() { return this.text; } } let ih = {}; function oh(t, e) { return t ? (e ? t.toLowerCase() === e.toLowerCase() : !t) : !e; } const ah = { f145(t, e, n) { if (((e = e || ""), (n = n || []), t.id !== e.substr(1))) return !1; for (let e = n, r = 0; r < e.length; r++) if (-1 === t.classNames.indexOf(e[r])) return !1; return !0; }, f45(t, e, n) { for (let e = (n = n || []), r = 0; r < e.length; r++) if (-1 === t.classNames.indexOf(e[r])) return !1; return !0; }, f15: (t, e) => ((e = e || ""), t.id === e.substr(1)), f1(t, e) { if (((e = e || ""), t.id !== e.substr(1))) return !1; }, f5: () => !0, f55(t, e, n, r) { r = r || ""; return t.attributes.hasOwnProperty(r); }, f245(t, e, n, r, i) { (r = (r || "").toLowerCase()), (i = i || ""); const o = t.attributes; return Object.keys(o).some((t) => { const e = o[t]; return t.toLowerCase() === r && e === i; }); }, f25(t, e, n, r, i) { (r = (r || "").toLowerCase()), (i = i || ""); const o = t.attributes; return Object.keys(o).some((t) => { const e = o[t]; return t.toLowerCase() === r && e === i; }); }, f2(t, e, n, r, i) { (r = (r || "").toLowerCase()), (i = i || ""); const o = t.attributes; return Object.keys(o).some((t) => { const e = o[t]; return t.toLowerCase() === r && e === i; }); }, f345(t, e, n) { if (((e = e || ""), (n = n || []), !oh(t.tagName, e))) return !1; for (let e = n, r = 0; r < e.length; r++) if (-1 === t.classNames.indexOf(e[r])) return !1; return !0; }, f35: (t, e) => ((e = e || ""), oh(t.tagName, e)), f3: (t, e) => ((e = e || ""), oh(t.tagName, e)), }; class sh { constructor(t) { (this.nextMatch = 0), (this.matchers = t.split(" ").map((t) => { if (ih[t]) return ih[t]; const e = t.split("."), n = e[0], r = e.slice(1).sort(); let i = "f", o = "", a = ""; if (n && "*" !== n) { let t; if (n.startsWith("#")) i += "1"; else if ( ((t = /^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/.exec( n )), t) ) { o = t[1]; let e = t[2]; if ("=" !== e && "!=" !== e) throw new Error( "Selector not supported, Expect [key${op}value].op must be =,!=" ); "=" === e && (e = "=="), (a = t[7] || t[8]), (i += "2"); } else (t = /^\[(.*?)\]/.exec(n)) ? ((o = t[1]), (i += "5")) : (i += "3"); } r.length > 0 && (i += "4"), (i += "5"); const s = { func: ah[i], tagName: n || "", classes: r || "", attr_key: o || "", value: a || "", }; return (ih[t] = s); })); } advance(t) { return ( !!( this.nextMatch < this.matchers.length && this.matchers[this.nextMatch].func( t, this.matchers[this.nextMatch].tagName, this.matchers[this.nextMatch].classes, this.matchers[this.nextMatch].attr_key, this.matchers[this.nextMatch].value ) ) && (this.nextMatch++, !0) ); } rewind() { this.nextMatch--; } get matched() { return this.nextMatch === this.matchers.length; } reset() { this.nextMatch = 0; } flushCache() { ih = {}; } } function uh(t) { return t[t.length - 1]; } const lh = new Map(); lh.set("DIV", !0), lh.set("div", !0), lh.set("P", !0), lh.set("p", !0), lh.set("LI", !0), lh.set("li", !0), lh.set("TD", !0), lh.set("td", !0), lh.set("SECTION", !0), lh.set("section", !0), lh.set("BR", !0), lh.set("br", !0); class ch extends Wc { constructor(t, e, n = "", r = null) { if ( (super(), (this.rawAttrs = n), (this.parentNode = r), (this.classNames = []), (this.nodeType = Jc.ELEMENT_NODE), (this.rawTagName = t), (this.rawAttrs = n || ""), (this.parentNode = r || null), (this.childNodes = []), e.id && ((this.id = e.id), n || (this.rawAttrs = `id="${e.id}"`)), e.class && ((this.classNames = e.class.split(/\s+/)), !n)) ) { const t = `class="${this.classNames.join(" ")}"`; this.rawAttrs ? (this.rawAttrs += ` ${t}`) : (this.rawAttrs = t); } } removeChild(t) { this.childNodes = this.childNodes.filter((e) => e !== t); } exchangeChild(t, e) { let n = -1; for (let e = 0; e < this.childNodes.length; e++) if (this.childNodes[e] === t) { n = e; break; } this.childNodes[n] = e; } get tagName() { return this.rawTagName ? this.rawTagName.toUpperCase() : this.rawTagName; } get rawText() { return this.childNodes.reduce((t, e) => t + e.rawText, ""); } get text() { return nh.decode(this.rawText); } get structuredText() { let t = []; const e = [t]; return ( (function n(r) { if (r.nodeType === Jc.ELEMENT_NODE) lh.get(r.rawTagName) ? (t.length > 0 && e.push((t = [])), r.childNodes.forEach(n), t.length > 0 && e.push((t = []))) : r.childNodes.forEach(n); else if (r.nodeType === Jc.TEXT_NODE) if (r.isWhitespace) t.prependWhitespace = !0; else { let e = r.text; t.prependWhitespace && ((e = ` ${e}`), (t.prependWhitespace = !1)), t.push(e); } })(this), e .map((t) => t .join("") .trim() .replace(/\s{2,}/g, " ") ) .join("\n") .replace(/\s+$/, "") ); } toString() { const t = this.rawTagName; if (t) { const e = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i.test( t ), n = this.rawAttrs ? ` ${this.rawAttrs}` : ""; return e ? `<${t}${n}>` : `<${t}${n}>${this.innerHTML}`; } return this.innerHTML; } get innerHTML() { return this.childNodes.map((t) => t.toString()).join(""); } set_content(t, e = {}) { if (t instanceof Wc) t = [t]; else if ("string" == typeof t) { const n = mh(t, e); t = n.childNodes.length ? n.childNodes : [new rh(t)]; } this.childNodes = t; } get outerHTML() { return this.toString(); } trimRight(t) { for (let e = 0; e < this.childNodes.length; e++) { const n = this.childNodes[e]; if (n.nodeType === Jc.ELEMENT_NODE) n.trimRight(t); else { const r = n.rawText.search(t); r > -1 && ((n.rawText = n.rawText.substr(0, r)), (this.childNodes.length = e + 1)); } } return this; } get structure() { const t = []; let e = 0; function n(n) { t.push(" ".repeat(e) + n); } return ( (function t(r) { const i = r.id ? `#${r.id}` : "", o = r.classNames.length ? `.${r.classNames.join(".")}` : ""; n(r.rawTagName + i + o), e++, r.childNodes.forEach((e) => { e.nodeType === Jc.ELEMENT_NODE ? t(e) : e.nodeType === Jc.TEXT_NODE && (e.isWhitespace || n("#text")); }), e--; })(this), t.join("\n") ); } removeWhitespace() { let t = 0; return ( this.childNodes.forEach((e) => { if (e.nodeType === Jc.TEXT_NODE) { if (e.isWhitespace) return; e.rawText = e.rawText.trim(); } else e.nodeType === Jc.ELEMENT_NODE && e.removeWhitespace(); this.childNodes[t++] = e; }), (this.childNodes.length = t), this ); } querySelectorAll(t) { let e; if (t instanceof sh) (e = t), e.reset(); else { if (t.includes(",")) { const e = t.split(","); return Array.from( e.reduce( (t, e) => this.querySelectorAll(e.trim()).reduce((t, e) => t.add(e), t), new Set() ) ); } e = new sh(t); } const n = []; return this.childNodes.reduce((r, i) => { for (n.push([i, 0, !1]); n.length; ) { const i = uh(n), o = i[0]; if (0 === i[1]) { if (o.nodeType !== Jc.ELEMENT_NODE) { n.pop(); continue; } const a = o; if (((i[2] = e.advance(a)), i[2] && e.matched)) { r.push(a), r.push(...a.querySelectorAll(t)), e.rewind(), n.pop(); continue; } } i[1] < o.childNodes.length ? n.push([o.childNodes[i[1]++], 0, !1]) : (i[2] && e.rewind(), n.pop()); } return r; }, []); } querySelector(t) { let e; t instanceof sh ? ((e = t), e.reset()) : (e = new sh(t)); const n = []; for (const t of this.childNodes) for (n.push([t, 0, !1]); n.length; ) { const t = uh(n), r = t[0]; if (0 === t[1]) { if (r.nodeType !== Jc.ELEMENT_NODE) { n.pop(); continue; } if (((t[2] = e.advance(r)), t[2] && e.matched)) return r; } t[1] < r.childNodes.length ? n.push([r.childNodes[t[1]++], 0, !1]) : (t[2] && e.rewind(), n.pop()); } return null; } appendChild(t) { return ( this.childNodes.push(t), t instanceof ch && (t.parentNode = this), t ); } get firstChild() { return this.childNodes[0]; } get lastChild() { return uh(this.childNodes); } get attributes() { if (this._attrs) return this._attrs; this._attrs = {}; const t = this.rawAttributes; for (const e in t) { const n = t[e] || ""; this._attrs[e] = nh.decode(n); } return this._attrs; } get rawAttributes() { if (this._rawAttrs) return this._rawAttrs; const t = {}; if (this.rawAttrs) { const e = /\b([a-z][a-z0-9-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|(\S+)))?/gi; let n; for (; (n = e.exec(this.rawAttrs)); ) t[n[1]] = n[2] || n[3] || n[4] || null; } return (this._rawAttrs = t), t; } removeAttribute(t) { const e = this.rawAttributes; delete e[t], this._attrs && delete this._attrs[t], (this.rawAttrs = Object.keys(e) .map((t) => { const n = JSON.stringify(e[t]); return void 0 === n || "null" === n ? t : `${t}=${n}`; }) .join(" ")); } hasAttribute(t) { return t in this.attributes; } getAttribute(t) { return this.attributes[t]; } setAttribute(t, e) { if (arguments.length < 2) throw new Error("Failed to execute 'setAttribute' on 'Element'"); const n = this.rawAttributes; (n[t] = String(e)), this._attrs && (this._attrs[t] = nh.decode(n[t])), (this.rawAttrs = Object.keys(n) .map((t) => { const e = JSON.stringify(n[t]); return "null" === e || '""' === e ? t : `${t}=${e}`; }) .join(" ")); } setAttributes(t) { this._attrs && delete this._attrs, this._rawAttrs && delete this._rawAttrs, (this.rawAttrs = Object.keys(t) .map((e) => { const n = t[e]; return "null" === n || '""' === n ? e : `${e}=${JSON.stringify(String(n))}`; }) .join(" ")); } insertAdjacentHTML(t, e) { if (arguments.length < 2) throw new Error("2 arguments required"); const n = mh(e); if ("afterend" === t) { const t = this.parentNode.childNodes.findIndex((t) => t === this); this.parentNode.childNodes.splice(t + 1, 0, ...n.childNodes), n.childNodes.forEach((t) => { t instanceof ch && (t.parentNode = this.parentNode); }); } else if ("afterbegin" === t) this.childNodes.unshift(...n.childNodes); else if ("beforeend" === t) n.childNodes.forEach((t) => { this.appendChild(t); }); else { if ("beforebegin" !== t) throw new Error( `The value provided ('${t}') is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'` ); { const t = this.parentNode.childNodes.findIndex((t) => t === this); this.parentNode.childNodes.splice(t, 0, ...n.childNodes), n.childNodes.forEach((t) => { t instanceof ch && (t.parentNode = this.parentNode); }); } } } } const hh = /)-->|<(\/?)([a-z][-.:0-9_a-z]*)\s*([^>]*?)(\/?)>/gi, ph = /(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/gi, dh = { area: !0, AREA: !0, base: !0, BASE: !0, br: !0, BR: !0, col: !0, COL: !0, hr: !0, HR: !0, img: !0, IMG: !0, input: !0, INPUT: !0, link: !0, LINK: !0, meta: !0, META: !0, source: !0, SOURCE: !0, embed: !0, EMBED: !0, param: !0, PARAM: !0, track: !0, TRACK: !0, wbr: !0, WBR: !0, }, fh = { li: { li: !0, LI: !0 }, LI: { li: !0, LI: !0 }, p: { p: !0, div: !0, P: !0, DIV: !0 }, P: { p: !0, div: !0, P: !0, DIV: !0 }, b: { div: !0, DIV: !0 }, B: { div: !0, DIV: !0 }, td: { td: !0, th: !0, TD: !0, TH: !0 }, TD: { td: !0, th: !0, TD: !0, TH: !0 }, th: { td: !0, th: !0, TD: !0, TH: !0 }, TH: { td: !0, th: !0, TD: !0, TH: !0 }, h1: { h1: !0, H1: !0 }, H1: { h1: !0, H1: !0 }, h2: { h2: !0, H2: !0 }, H2: { h2: !0, H2: !0 }, h3: { h3: !0, H3: !0 }, H3: { h3: !0, H3: !0 }, h4: { h4: !0, H4: !0 }, H4: { h4: !0, H4: !0 }, h5: { h5: !0, H5: !0 }, H5: { h5: !0, H5: !0 }, h6: { h6: !0, H6: !0 }, H6: { h6: !0, H6: !0 }, }, gh = { li: { ul: !0, ol: !0, UL: !0, OL: !0 }, LI: { ul: !0, ol: !0, UL: !0, OL: !0 }, a: { div: !0, DIV: !0 }, A: { div: !0, DIV: !0 }, b: { div: !0, DIV: !0 }, B: { div: !0, DIV: !0 }, i: { div: !0, DIV: !0 }, I: { div: !0, DIV: !0 }, p: { div: !0, DIV: !0 }, P: { div: !0, DIV: !0 }, td: { tr: !0, table: !0, TR: !0, TABLE: !0 }, TD: { tr: !0, table: !0, TR: !0, TABLE: !0 }, th: { tr: !0, table: !0, TR: !0, TABLE: !0 }, TH: { tr: !0, table: !0, TR: !0, TABLE: !0 }, }, _h = "documentfragmentcontainer"; function mh(t, e = { lowerCaseTagName: !1, comment: !1 }) { const n = e.blockTextElements || { script: !0, noscript: !0, style: !0, pre: !0, }, r = Object.keys(n), i = r.map((t) => new RegExp(t, "i")), o = r.filter((t) => n[t]).map((t) => new RegExp(t, "i")); function a(t) { return o.some((e) => e.test(t)); } function s(t) { return i.some((e) => e.test(t)); } const u = new ch(null, {}); let l = u; const c = [u]; let h, p = -1; for (t = `<${_h}>${t}`; (h = hh.exec(t)); ) { if (p > -1 && p + h[0].length < hh.lastIndex) { const e = t.substring(p, hh.lastIndex - h[0].length); l.appendChild(new rh(e)); } if (((p = hh.lastIndex), h[2] !== _h)) if ("!" !== h[0][1]) { if ((e.lowerCaseTagName && (h[2] = h[2].toLowerCase()), !h[1])) { const n = {}; for (let t; (t = ph.exec(h[3])); ) n[t[2].toLowerCase()] = t[4] || t[5] || t[6]; const r = l.rawTagName; if ( (!h[4] && fh[r] && fh[r][h[2]] && (c.pop(), (l = uh(c))), (l = l.appendChild(new ch(h[2], n, h[3]))), c.push(l), s(h[2])) ) { const n = ``, r = e.lowerCaseTagName ? t.toLocaleLowerCase().indexOf(n, hh.lastIndex) : t.indexOf(n, hh.lastIndex); if (a(h[2])) { let e; (e = -1 === r ? t.substr(hh.lastIndex) : t.substring(hh.lastIndex, r)), e.length > 0 && l.appendChild(new rh(e)); } -1 === r ? (p = hh.lastIndex = t.length + 1) : ((p = hh.lastIndex = r + n.length), (h[1] = "true")); } } if (h[1] || h[4] || dh[h[2]]) for (;;) { if (l.rawTagName === h[2]) { c.pop(), (l = uh(c)); break; } { const t = l.tagName; if (gh[t] && gh[t][h[2]]) { c.pop(), (l = uh(c)); continue; } break; } } } else if (e.comment) { const e = t.substring(p - 3, p - h[0].length + 4); l.appendChild(new $c(e)); } } const d = Boolean(1 === c.length); if (!e.noFix) { const t = u; for (t.valid = d; c.length > 1; ) { const t = c.pop(), e = uh(c); t.parentNode && t.parentNode.parentNode && (t.parentNode === e && t.tagName === e.tagName ? (e.removeChild(t), t.childNodes.forEach((t) => { e.parentNode.appendChild(t); }), c.pop()) : (e.removeChild(t), t.childNodes.forEach((t) => { e.appendChild(t); }))); } return ( t.childNodes.forEach((t) => { t instanceof ch && (t.parentNode = null); }), t ); } const f = new rh(t); return (f.valid = d), f; } var yh = [{ test: /\>/g, replace: ">" }], Ah = (function () { function t() {} return ( (t.get = function () { return t.instance || (t.instance = new t()), t.instance; }), (t.prototype.processHTML = function (t, e) { e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace( /'/g, "'" )).replace(new RegExp(" ", "g"), " ")).replace( new RegExp("√", "g"), String.fromCharCode(8730) )).replace(new RegExp("×", "g"), String.fromCharCode(215))).replace( new RegExp("<\\\\", "g"), "", "g"), "
")).replace( new RegExp("
", "g"), "
" )).replace(new RegExp("
", "g"), "
")).replace( new RegExp("", "g"), "")).replace( new RegExp("", "g"), "")).replace( new RegExp("", "g"), "

")).replace( new RegExp("", "g"), "")).replace( new RegExp("", "g"), "")).replace( new RegExp("", "g"), "")).replace( new RegExp("& ", "g"), "& " ); for (var n = 0, r = [], i = [], o = []; n < e.length; ) if ("<" == e[n]) { if ("p" == e[n + 1]) r[r.length] = "p"; else if ("b" == e[n + 1] && "r" != e[n + 2]) r[r.length] = "b"; else if ("i" == e[n + 1]) r[r.length] = "i"; else if ("u" == e[n + 1]) r[r.length] = "u"; else if ( "f" == e[n + 1] && "o" == e[n + 2] && "n" == e[n + 3] && "t" == e[n + 4] ) (r[r.length] = "font"), (n += 2); else if ("l" == e[n + 1] && "i" == e[n + 2]) (r[r.length] = "li"), n++; else if ("/" == e[n + 1] && "p" == e[n + 2]) { for (var a = r.length, s = -1; a > 0; ) if ("p" == r[--a]) { s = a; break; } if (s < 0) (i[i.length] = n), (o[o.length] = 4); else { for (a = r.length - 1; a > s; ) (i[i.length] = n), (o[o.length] = ""), r.pop(), a--; r.pop(); } } else if ("/" == e[n + 1] && "b" == e[n + 2]) { var u = r.length; for (s = -1; u > 0; ) if ("b" == r[--u]) { s = u; break; } if (s < 0) (i[i.length] = n), (o[o.length] = 4); else { for (u = r.length - 1; u > s; ) (i[i.length] = n), (o[o.length] = ""), r.pop(), u--; r.pop(); } } else if ("/" == e[n + 1] && "i" == e[n + 2]) { var l = r.length; for (s = -1; l > 0; ) if ("i" == r[--l]) { s = l; break; } if (s < 0) (i[i.length] = n), (o[o.length] = 4); else { for (l = r.length - 1; l > s; ) (i[i.length] = n), (o[o.length] = ""), r.pop(), l--; r.pop(); } } else if ("/" == e[n + 1] && "u" == e[n + 2]) { var c = r.length; for (s = -1; c > 0; ) if ("u" == r[--c]) { s = c; break; } if (s < 0) (i[i.length] = n), (o[o.length] = 4); else { for (c = r.length - 1; c > s; ) (i[i.length] = n), (o[o.length] = ""), r.pop(), c--; r.pop(); } } else if ( "/" == e[n + 1] && "l" == e[n + 2] && "i" == e[n + 3] ) { var h = r.length; for (s = -1; h > 0; ) if ("li" == r[--h]) { s = h; break; } if (s < 0) (i[i.length] = n), (o[o.length] = 7); else { for (h = r.length - 1; h > s; ) (i[i.length] = n), (o[o.length] = ""), r.pop(), h--; r.pop(); } } else if ( "/" == e[n + 1] && "f" == e[n + 2] && "o" == e[n + 3] && "n" == e[n + 4] && "t" == e[n + 5] ) { var p = r.length; for (s = -1; p > 0; ) if ("font" == r[--p]) { s = p; break; } if (s < 0) (i[i.length] = n), (o[o.length] = 7); else { for (p = r.length - 1; p > s; ) (i[i.length] = n), (o[o.length] = ""), r.pop(), p--; r.pop(); } } n++; } else n++; for (var d = r.length; d > 0; ) d--, (i[i.length] = n), (o[o.length] = ""); for (var f = 0, g = o.length, _ = 0; _ < g; _++) "number" == typeof o[_] ? ((e = e.slice(0, i[_] + f) + e.slice(i[_] + f + o[_])), (f -= o[_])) : ((e = e.slice(0, i[_] + f) + o[_] + e.slice(i[_] + f)), (f += o[_].length)); var m = { text: "" }; (t._textFormats = [t._textFormat]), (t._textFormatsIdx = [0]); var y = mh(e); return ( y && y.firstChild && ((m.multiline = y.firstChild.childNodes.length > 0), this.readHTMLTextPropertiesRecursive(t, y, m, t._textFormat)), "" == m.text || (13 != m.text.charCodeAt(m.text.length - 1) && 10 != m.text.charCodeAt(m.text.length - 1)) || (m.text = m.text.slice(0, m.text.length - 1)), "" != m.text && m.text.length >= 2 && "n" == m.text[m.text.length - 1] && "\\" == m.text[m.text.length - 2] && (m.text = m.text.slice(0, m.text.length - 2)), "" != m.text && m.text.length >= 2 && "n" == m.text[m.text.length - 1] && "\\" == m.text[m.text.length - 2] && (m.text = m.text.slice(0, m.text.length - 2)), (t._textFormatsIdx[t._textFormatsIdx.length - 1] = m.text.length), m.text ); }), (t.prototype.readHTMLTextPropertiesRecursive = function (t, e, n, r) { var i = [], o = []; if (e.attributes) { if (e.attributes.size || e.attributes.SIZE) (a = (a = e.attributes.size ? e.attributes.size : e.attributes.SIZE).replace(/[^0-9.]/g, "")), (i[i.length] = parseInt(a)), (o[o.length] = "size"); if (e.attributes.color || e.attributes.COLOR) (a = (a = e.attributes.color ? e.attributes.color : e.attributes.COLOR).replace("#", "0x")), (i[i.length] = parseInt(a)), (o[o.length] = "color"); if (e.attributes.indent || e.attributes.INDENT) (a = (a = e.attributes.indent ? e.attributes.indent : e.attributes.INDENT).replace(/[^0-9.]/g, "")), (i[i.length] = parseInt(a)), (o[o.length] = "indent"); if (e.attributes.leftMargin || e.attributes.LEFTMARGIN) (a = (a = e.attributes.leftMargin ? e.attributes.leftMargin : e.attributes.LEFTMARGIN).replace(/[^0-9.]/g, "")), (i[i.length] = parseInt(a)), (o[o.length] = "leftMargin"); if (e.attributes.rightMargin || e.attributes.RIGHTMARGIN) (a = (a = e.attributes.rightMargin ? e.attributes.rightMargin : e.attributes.RIGHTMARGIN).replace(/[^0-9.]/g, "")), (i[i.length] = parseInt(a)), (o[o.length] = "rightMargin"); if (e.attributes.align || e.attributes.ALIGN) { var a = e.attributes.align ? e.attributes.align : e.attributes.ALIGN; (i[i.length] = a), (o[o.length] = "align"); } if (e.attributes.face || e.attributes.FACE) { a = e.attributes.face ? e.attributes.face : e.attributes.FACE; (i[i.length] = a), (o[o.length] = "font"); } } "b" == e.tagName || "b" == e.rawTagName ? r.bold || ((i[i.length] = !0), (o[o.length] = "bold")) : "i" == e.tagName || "i" == e.rawTagName ? r.italic || ((i[i.length] = !0), (o[o.length] = "italic")) : "u" == e.tagName || "u" == e.rawTagName ? r.underline || ((i[i.length] = !0), (o[o.length] = "underline")) : "font" == e.tagName || "font" == e.rawTagName || ("li" == e.tagName || "li" == e.rawTagName ? (n.text += "\n ● ") : ((("br" != e.tagName && "br" != e.rawTagName) || !t.multiline) && (("sbr" != e.tagName && "sbr" != e.rawTagName) || !t.multiline)) || (n.text += "\n")); for (var s = !1, u = i.length; u > 0; ) if (r[o[--u]] != i[u]) { s = !0; break; } var l = r; if (s) { for (l = r.clone(), u = i.length; u > 0; ) l[o[--u]] = i[u]; t._textFormats.push(l), (t._textFormatsIdx[t._textFormatsIdx.length - 1] = n.text.length), t._textFormatsIdx.push(n.text.length); } if (e.childNodes && e.childNodes.length > 0) for (var c = 0; c < e.childNodes.length; c++) t._textFormats[t._textFormats.length - 1] != l && (t._textFormats.push(l), (t._textFormatsIdx[t._textFormatsIdx.length - 1] = n.text.length), t._textFormatsIdx.push(n.text.length)), this.readHTMLTextPropertiesRecursive(t, e.childNodes[c], n, l); else if ("" != e.text.replace(/[\s\r\n]/gi, "")) { for (var h = e.text, p = 0, d = yh; p < d.length; p++) { var f = d[p]; h = h.replace(f.test, f.replace); } n.text += h; } "ul" == e.tagName || "ul" == e.rawTagName || "li" == e.tagName || "li" == e.rawTagName || ("p" != e.tagName && "p" != e.rawTagName) || (n.text += "\n"); }), t ); })(), vh = [ { test: /'/g, replace: "'" }, { test: />/g, replace: ">" }, ], bh = (function (t) { function n() { var e = t.call(this) || this; return ( (e._isEntity = !1), (e.textOffsetX = 0), (e.textOffsetY = 0), (e._selectionBeginIndex = 0), (e._selectionEndIndex = 0), (e._biggestLine = 0), (e._iText = ""), (e._text = ""), (e._iTextWoLineBreaks = ""), (e.inMaskMode = !1), (e.cursorIntervalID = -1), (e.cursorBlinking = !1), (e.showSelection = !1), (e._textDirty = !1), (e._positionsDirty = !1), (e._glyphsDirty = !1), (e._shapesDirty = !1), (e._textShapesDirty = !1), (e.chars_codes = []), (e.chars_codes_prev = []), (e.chars_width = []), (e.tf_per_char = []), (e.tf_per_char_prev = []), (e.last_word_vertices_count = 0), (e.words = []), (e._textRuns_formats = []), (e._textRuns_words = []), (e._paragraph_textRuns_indices = []), (e._maxWidthLine = 0), (e._labelData = null), (e.lines_wordStartIndices = []), (e.lines_wordEndIndices = []), (e.lines_start_y = []), (e.lines_start_x = []), (e.lines_charIdx_start = []), (e.lines_charIdx_end = []), (e.lines_width = []), (e.lines_height = []), (e.lines_numSpacesPerline = []), (e.char_positions_x = []), (e.char_positions_y = []), (e.sourceTextField = null), (e._maskWidth = 0), (e._maskHeight = 0), (e._maskTextOffsetX = 0), (e._maskTextOffsetY = 0), (e.isStatic = !1), (e._internalScale = new B(1, 1, 1)), (e.onKeyDelegate = function (t) { return e.onKey(t); }), (e.startSelectionByMouseDelegate = function (t) { return e.startSelectionByMouse(t); }), (e.stopSelectionByMouseDelegate = function (t) { return e.stopSelectionByMouse(t); }), (e.updateSelectionByMouseDelegate = function (t) { return e.updateSelectionByMouse(t); }), (e._onGraphicsInvalidateDelegate = function (t) { return e._onGraphicsInvalidate(t); }), (e._onClipboardPasteDelegate = function (t) { return e.onClipboardPaste(t); }), (e.cursorIntervalID = -1), (e._tabEnabled = !0), (e.cursorType = ""), (e.textOffsetX = 0), (e.textOffsetY = 0), (e.textShapes = {}), (e._textColor = 0), (e._width = 100), (e._height = 100), (e._textWidth = 0), (e._textHeight = 0), (e._type = Bu.DYNAMIC), (e._selectable = !1), (e._numLines = 0), (e.multiline = !1), (e._autoSize = Ou.NONE), (e._wordWrap = !1), (e._background = !1), (e._backgroundColor = 16777215), (e._border = !1), (e._borderColor = 0), (e.html = !1), (e.maxChars = 0), (e._selectionBeginIndex = 0), (e._selectionEndIndex = 0), (e._scrollH = 0), (e._scrollV = 0), (e._textFormats = []), (e._graphics = qs.getGraphics()), e._graphics.addEventListener( c.INVALIDATE, e._onGraphicsInvalidateDelegate ), (e.mouseEnabled = e._selectable), e ); } return ( e(n, t), (n.getNewTextField = function () { return n._textFields.length ? n._textFields.pop() : new n(); }), (n.clearPool = function () { n._textFields = []; }), (n.prototype.updateMaskMode = function () { if ( (this.inMaskMode && ((this._maskWidth == this._width && this._maskHeight == this._height && this._maskTextOffsetX == this.textOffsetX && this._maskTextOffsetY == this.textOffsetY) || ((this._maskWidth = this._width), (this._maskHeight = this._height), (this._maskTextOffsetX = this.textOffsetX), (this._maskTextOffsetY = this.textOffsetY), this.maskChild.graphics.clear(), this.maskChild.graphics.beginFill(16777215), this.maskChild.graphics.drawRect( this.textOffsetX, this.textOffsetY, this._width, this._height ), this.maskChild.graphics.endFill()), this._graphics.clear()), !this.inMaskMode) ) return ( (this.inMaskMode = !0), this.maskChild || (this.maskChild = new ru()), this.textChild || (this.textChild = new qc()), (this.textChild.mouseEnabled = !1), (this.textChild.parentTextField = this), (this.maskChild.mouseEnabled = !1), this.maskChild.graphics.beginFill(16777215), this.maskChild.graphics.drawRect( this.textOffsetX, this.textOffsetY, this._width, this._height ), this.maskChild.graphics.endFill(), this.addChild(this.maskChild), this.addChild(this.textChild), (this.maskChild.maskMode = !0), this._graphics.clear(), void (this.targetGraphics = this.textChild.graphics) ); this._textWidth > this._width || this._textHeight > this._height ? (this.textChild.masks = [this.maskChild]) : (this.textChild.masks = null); }), (n.prototype.getMouseCursor = function () { return this.cursorType; }), Object.defineProperty(n.prototype, "isInFocus", { get: function () { return this._isInFocus; }, set: function (t) {}, enumerable: !0, configurable: !0, }), (n.prototype.setFocus = function (e, n, r) { void 0 === n && (n = !1), void 0 === r && (r = !0), this._isInFocus != e && (t.prototype.setFocus.call(this, e, n, r), this.enableInput(e), this._selectable && (this.setSelection(0, 0), (this._glyphsDirty = !0), this._invalidateEntity())); }), (n.prototype.enableInput = function (t) { if ( (void 0 === t && (t = !0), this.cursorIntervalID >= 0 && (window.clearInterval(this.cursorIntervalID), (this.cursorIntervalID = -1)), t && this._isInFocus && this.selectable) ) { this.drawSelectionGraphics(); var e = this; this.cursorIntervalID = window.setInterval(function () { (e.cursorBlinking = !e.cursorBlinking), e.selectable || (e.cursorBlinking = !0), (e._shapesDirty = !0), e.invalidate(); }, 500); } }), (n.prototype.findCharIdxForMouse = function (t) { var e = new P(t.position.x, t.position.y), n = this.getLineIndexAtPoint(e.x, e.y), r = this.getCharIndexAtPoint(e.x, e.y, n); return ( n >= this.lines_start_x.length && (n = this.lines_start_x.length - 1), n < 0 && (n = 0), n >= 0 && r < 0 && void 0 !== this.lines_start_x[n] && (r = e.x <= this.lines_start_x[n] ? this.lines_charIdx_start[n] : this.lines_charIdx_end[n]), (n < 0 || r < 0) && (r = 0), r ); }), (n.prototype.startSelectionByMouse = function (t) { (this._selectionBeginIndex = this.findCharIdxForMouse(t)), (this._selectionEndIndex = this._selectionBeginIndex), this.cursorShape && this.cursorShape.invalidate(), (this.cursorShape = void 0), this.bgShapeSelect && this.bgShapeSelect.invalidate(), (this.bgShapeSelect = void 0), (this._glyphsDirty = !0), (this._shapesDirty = !0), (this._textShapesDirty = !0), (this.cursorBlinking = !1), this.drawSelectionGraphics(); }), (n.prototype.stopSelectionByMouse = function (t) { (this._selectionEndIndex = this.findCharIdxForMouse(t)), (this._glyphsDirty = !0), this.reConstruct(), this.drawSelectionGraphics(); }), (n.prototype.updateSelectionByMouse = function (t) { (this._selectionEndIndex = this.findCharIdxForMouse(t)), this.bgShapeSelect && this.bgShapeSelect.invalidate(), (this.bgShapeSelect = void 0), (this._glyphsDirty = !0), this.reConstruct(), this.drawSelectionGraphics(); }), (n.prototype.drawSelectionGraphics = function () { this._selectionBeginIndex < 0 && (this._selectionBeginIndex = 0), this._selectionBeginIndex > this.char_positions_x.length && (this._selectionBeginIndex = this.char_positions_x.length), this._selectionEndIndex < 0 && (this._selectionEndIndex = 0), this._selectionEndIndex > this.char_positions_x.length && (this._selectionEndIndex = this.char_positions_x.length), this._selectionBeginIndex === this._selectionEndIndex ? ((this.showSelection = !1), this.drawCursor()) : ((this.showSelection = !0), (this.cursorBlinking = !0), this.drawSelectedBG()); }), (n.prototype.scrollToCursor = function (t, e) {}), (n.prototype.drawCursor = function () { if ( ((this._shapesDirty = !0), !this.cursorBlinking && this.selectable && this.selectionBeginIndex === this.selectionEndIndex) ) { var t = 0, e = 0, n = this.newTextFormat; 0 == this.char_positions_x.length ? ((t = this.textOffsetX + this._width / 2 + this._textWidth / 2), "justify" == n.align || "center" == n.align || ("right" == n.align ? (t = this.textOffsetX + this._width - 2) : "left" == n.align && (t = this.textOffsetX + 4 + this._textWidth))) : this._selectionBeginIndex == this.char_positions_x.length ? ((t = this.char_positions_x[this._selectionBeginIndex - 1] + this.chars_width[this._selectionBeginIndex - 1]), (e = this.char_positions_y[this._selectionBeginIndex - 1]), (n = this.tf_per_char[this._selectionBeginIndex - 1])) : ((t = this.char_positions_x[this._selectionBeginIndex]), (e = this.char_positions_y[this._selectionBeginIndex]), (n = this.tf_per_char[this._selectionBeginIndex])), n.font_table.initFontSize(n.size); var r = n.font_table.getLineHeight(), i = this.getTextColorForTextFormat(n), o = this.internalScale.x; o <= 0 && (o = 1); var a = [t - 0.5 * o, e, o, r]; if ( (this.cursorShape ? fs.updateRectanglesShape(this.cursorShape, a) : ((this.cursorShape = fs.drawRectangles(a, i, 1)), this.cursorShape.usages++), this.cursorShape.style.color !== i) ) { var s = w.float32ColorToARGB(i)[0], u = ds.get_material_for_color(i, s / 255 || 1); if (u.colorPos) { this.cursorShape.style = new zi(); var l = new Le(); (u.material.animateUVs = !0), (this.cursorShape.style.color = i), this.cursorShape.style.addSamplerAt( l, u.material.getTextureAt(0) ), (this.cursorShape.style.uvMatrix = new O( 0, 0, 0, 0, u.colorPos.x, u.colorPos.y )); } } this.scrollToCursor(t, e); } }), (n.prototype.drawSelectedBG = function () { (this._shapesDirty = !0), (this._textShapesDirty = !0), this._selectionBeginIndex < 0 && (this._selectionBeginIndex = 0), this._selectionBeginIndex > this.char_positions_x.length && (this._selectionBeginIndex = this.char_positions_x.length); var t = this._selectionBeginIndex, e = this._selectionEndIndex; this._selectionEndIndex < this._selectionBeginIndex && ((t = this._selectionEndIndex), (e = this._selectionBeginIndex)); var n = 0, r = 0, i = -1, o = null, a = -1, s = 0, u = 0, l = []; if ( 0 != this.char_positions_x.length && this._selectionEndIndex != this._selectionBeginIndex ) for ( var c = e > this.char_positions_x.length ? this.char_positions_x.length : e, h = t; h < c; h++ ) h == this.char_positions_x.length ? ((n = this.char_positions_x[h - 1] + this.chars_width[h - 1]), (r = this.char_positions_y[h - 1]), (o = this.tf_per_char[h - 1])) : ((n = this.char_positions_x[h]), (r = this.char_positions_y[h]), (o = this.tf_per_char[h])), a < 0 && (a = n), i >= 0 && i != r && (l.push(a, i, s, u), (s = 0), (a = n)), (s += this.chars_width[h]), (i = r), o.font_table.initFontSize(o.size), (u = Math.max(u, o.font_table.getLineHeight())); if (s > 0) return ( l.push(a, i, s, u), void (this.bgShapeSelect ? fs.updateRectanglesShape(this.bgShapeSelect, l) : ((this.bgShapeSelect = fs.drawRectangles(l, 0, 1)), this.bgShapeSelect.usages++)) ); this.scrollToCursor(a + s, i + u); }), (n.prototype.drawBG = function () { this._graphics.beginFill( this.backgroundColor, this._background ? 1 : 0 ), this._graphics.drawRect( this.textOffsetX, this.textOffsetY, this.width, this.height ), this._graphics.endFill(); }), (n.prototype.drawBorder = function () { var t = this.border ? 0.25 * this.internalScale.x : 0, e = this.border ? 0.25 * this.internalScale.y : 0; this._graphics.beginFill(this._borderColor, 1), this._graphics.drawRect( this.textOffsetX, this.textOffsetY, this._width, 2 * e ), this._graphics.drawRect( this.textOffsetX, this.textOffsetY + this._height - 2 * e, this._width, 2 * e ), this._graphics.drawRect( this.textOffsetX, this.textOffsetY + 2 * e, 2 * t, this._height - 2 * e ), this._graphics.drawRect( this.textOffsetX + this._width - 2 * t, this.textOffsetY + 2 * e, 2 * t, this._height - 2 * e ), this._graphics.endFill(); }), (n.prototype.getTextShapeForIdentifierAndFormat = function (t, e) { return ( this.textShapes.hasOwnProperty(t) || ((this.textShapes[t] = new Kc()), (this.textShapes[t].format = e)), this.textShapes[t] ); }), Object.defineProperty(n.prototype, "autoSize", { get: function () { return this._autoSize; }, set: function (t) { if (this._autoSize != t) { if ("string" == typeof t) { if ( t != Ou.CENTER && t != Ou.NONE && t != Ou.LEFT && t != Ou.RIGHT ) return; } else "boolean" == typeof t && (t = t ? Ou.LEFT : Ou.NONE), "number" == typeof t && (t = t > 0 ? Ou.LEFT : Ou.NONE); (this._autoSize = t), (this._positionsDirty = !0), this._autoSize != Ou.NONE && this.invalidate(); } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "internalScale", { get: function () { return this._internalScale; }, enumerable: !0, configurable: !0, }), (n.prototype._iInternalUpdate = function () { t.prototype._iInternalUpdate.call(this), this.reConstruct(!0); }), (n.prototype._onGraphicsInvalidate = function (t) { var e = this.isEntity(); this._isEntity != e && (e || this._clearEntity(), (this._isEntity = e)), this.invalidate(); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "background", { get: function () { return this._background; }, set: function (t) { this._background != t && ((this._background = t), (this._shapesDirty = !0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "backgroundColor", { get: function () { return this._backgroundColor; }, set: function (t) { (this._backgroundColor = t), (this._shapesDirty = !0); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "border", { get: function () { return this._border; }, set: function (t) { t != this._border && ((this._border = t), (this._shapesDirty = !0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "borderColor", { get: function () { return this._borderColor; }, set: function (t) { t != this.borderColor && ((this._borderColor = t), (this._shapesDirty = !0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "bottomScrollV", { get: function () { return this._bottomScrollV; }, set: function (t) { t != this._bottomScrollV && (this._bottomScrollV = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "caretIndex", { get: function () { return this._caretIndex; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "height", { get: function () { return ( this._autoSize != Ou.NONE && this.reConstruct(), this._height ); }, set: function (t) { this._height != t && this._autoSize == Ou.NONE && ((this._height = t), (this._positionsDirty = !0), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "htmlText", { get: function () { return this._htmlText; }, set: function (t) { if (t != this._htmlText) { this._htmlText = t; var e = Ah.get().processHTML(this, t); (this._labelData = null), (this._text = e), (this._iText = e), (this._iTextWoLineBreaks = e.replace(/(\r\n|\n|\\n|\r)/gm, "")), (this._textDirty = !0), this._autoSize != Ou.NONE ? this.invalidate() : this._invalidateEntity(), (this.newTextFormat = this._textFormats[this._textFormats.length - 1]); } }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "length", { get: function () { return this._iText.length; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "maxScrollH", { get: function () { return this.reConstruct(), this._maxScrollH; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "maxScrollV", { get: function () { return this.reConstruct(), this._maxScrollV; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "numLines", { get: function () { return this.reConstruct(), this._numLines; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "restrict", { get: function () { return this._restrict; }, set: function (t) { t != this._restrict && ((this._restrict = t), (this._restrictRegex = null), void 0 !== t && ((t = t.toString()).length >= 2 && "-" == t[0] && !isNaN(parseInt(t[1])) && (t = "0" + t), (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = t.replace( /\\/g, "" )).replace(/\^/g, "")).replace( /([^a-zA-Z0-9])\-/g, "$1\\-" )).replace(/\./g, "\\.")).replace(/\/g, "\\>" )).replace(/\+/g, "\\+")).replace(/\*/g, "\\*")).replace( /\?/g, "\\?" )).replace(/\[/g, "\\[")).replace(/\]/g, "\\]")).replace( /\$/g, "\\$" )).replace(/\(/g, "\\(")).replace(/\)/g, "\\)")).replace( /\{/g, "\\{" )).replace(/\}/g, "\\}")).replace(/\=/g, "\\=")).replace( /\!/g, "\\!" )).replace(/\:/g, "\\:")).replace(/\|/g, "\\|")).replace( /\//g, "\\/" )).replace(/\%/g, "\\%")), (this._restrictRegex = new RegExp("[^" + t + "]", "g")))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scrollH", { get: function () { return this._scrollH; }, set: function (t) { t != this._scrollH && (this._scrollH = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scrollV", { get: function () { return this._scrollV; }, set: function (t) { Math.floor(t) != this._scrollV && ((this._scrollV = Math.floor(t)), this._scrollV > this._maxScrollV && (this._scrollV = this._maxScrollV), this.textChild && (this.textChild.y = -this.lines_start_y[this._scrollV])); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "selectable", { get: function () { return this._selectable; }, set: function (t) { this.selectable != t && ((this._selectable = t), (this.mouseEnabled = t), (this.cursorType = t ? "text" : ""), t ? (this.addEventListener( vu.DRAG_START, this.startSelectionByMouseDelegate ), this.addEventListener( vu.DRAG_STOP, this.stopSelectionByMouseDelegate ), this.addEventListener( vu.DRAG_MOVE, this.updateSelectionByMouseDelegate )) : (this.removeEventListener( vu.DRAG_START, this.startSelectionByMouseDelegate ), this.removeEventListener( vu.DRAG_STOP, this.stopSelectionByMouseDelegate ), this.removeEventListener( vu.DRAG_MOVE, this.updateSelectionByMouseDelegate ))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "selectionBeginIndex", { get: function () { return this._selectionBeginIndex; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "selectionEndIndex", { get: function () { return this._selectionEndIndex; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "text", { get: function () { return this._text; }, set: function (t) { if ( ((t = (t = void 0 === t ? "" : t.toString()).replace( String.fromCharCode(160), " " )), this._text != t) ) { (this._labelData = null), (this._text = t), "" == t || (13 != t.charCodeAt(t.length - 1) && 10 != t.charCodeAt(t.length - 1)) || (t = t.slice(0, t.length - 1)), "" != t && t.length >= 3 && "n" == t[t.length - 1] && "\\" == t[t.length - 2] && "\\" == t[t.length - 3] && (t = t.slice(0, t.length - 3)), "" != t && t.length >= 3 && "n" == t[t.length - 1] && "\\" == t[t.length - 2] && (t = t.slice(0, t.length - 2)); for (var e = 0, n = vh; e < n.length; e++) { var r = n[e]; t = t.replace(r.test, r.replace); } (this._iText = t), (this._iTextWoLineBreaks = t.replace(/(\r\n|\n|\\n|\r)/gm, "")), (this._textFormats = [this.newTextFormat]), (this._textFormatsIdx = [this._iText.length]), (this._textDirty = !0), this._autoSize != Ou.NONE ? this.invalidate() : this._invalidateEntity(); } }, enumerable: !0, configurable: !0, }), (n.prototype.setLabelData = function (t) { (this._labelData = t), (this.isStatic = !0), (this._iText = ""), (this._iTextWoLineBreaks = ""), (this._textDirty = !1), (this._positionsDirty = !1), (this._glyphsDirty = !0), this._autoSize != Ou.NONE ? this.invalidate() : this._invalidateEntity(); }), Object.defineProperty(n.prototype, "newTextFormat", { get: function () { return this._newTextFormat ? this._newTextFormat : this._textFormat ? this._textFormat : new zc(); }, set: function (t) { this._newTextFormat = t ? t.applyToFormat(this._textFormat.clone()) : null; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "textFormat", { get: function () { return ( null == this._textFormat && (this._textFormat = new zc()), this._textFormat ); }, set: function (t) { if (!t) throw new Error("TextField::: set textFormat - no value!"); this._textFormat != t && ((this._textDirty = !0), (this._textFormat = t), (this._textShapesDirty = !0), (this._textDirty = !0), this._autoSize != Ou.NONE ? this.invalidate() : this._invalidateEntity()); }, enumerable: !0, configurable: !0, }), (n.prototype._acceptTraverser = function (t) { this.maskMode || this._graphics._acceptTraverser(t); }), Object.defineProperty(n.prototype, "scaleX", { get: function () { return this._transform.scale.x; }, set: function (t) { this._transform.scale.x != t && this._setScaleX(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "scaleY", { get: function () { return this._transform.scale.y; }, set: function (t) { this._transform.scale.y != t && this._setScaleY(t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "textColor", { get: function () { return this._textColor; }, set: function (t) { if (this._textColor != t) { if (((this._textColor = t), this._textFormats)) { for (var e = this._textFormats.length; e > 0; ) e--, this._textFormats[e] && (this._textFormats[e].color = t); this._textDirty = !0; } (this._glyphsDirty = !0), this._invalidateEntity(); } }, enumerable: !0, configurable: !0, }), (n.prototype.getTextColorForTextFormat = function (t) { return t.hasPropertySet("color") ? t.color : this._textColor; }), Object.defineProperty(n.prototype, "textInteractionMode", { get: function () { return this._textInteractionMode; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "textWidth", { get: function () { return this.reConstruct(), this._textWidth; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "textHeight", { get: function () { return ( this.reConstruct(), this.type == Bu.INPUT && "" == this._iText ? (this.textFormat.font_table.initFontSize( this.textFormat.size ), this.textFormat.font_table.getLineHeight()) : this._textHeight ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "type", { get: function () { return this._type; }, set: function (t) { this._type != t && ((this._type = t), (this._textDirty = !0), this._invalidateEntity(), t == Bu.INPUT ? (this.enableInput(!0), this.addEventListener(Xc.KEYDOWN, this.onKeyDelegate)) : (this.enableInput(!1), this.removeEventListener(Xc.KEYDOWN, this.onKeyDelegate))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "x", { get: function () { return ( this._autoSize == Ou.NONE || this._wordWrap || this.reConstruct(), this._transform.position.x ); }, set: function (t) { this._autoSize == Ou.NONE || this._wordWrap || this.reConstruct(), this._transform.position.x != t && ((this._transform.matrix3D._rawData[12] = t), this._transform.invalidatePosition()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "width", { get: function () { return ( this._autoSize == Ou.NONE || this._wordWrap || this.reConstruct(), this._width ); }, set: function (t) { this._width != t && ((this._width = t), (this._positionsDirty = !0), this.invalidate()); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "wordWrap", { get: function () { return this._wordWrap; }, set: function (t) { this._wordWrap != t && ((this._wordWrap = t), (this._positionsDirty = !0), t || this.invalidate()); }, enumerable: !0, configurable: !0, }), (n.prototype.advanceFrame = function () {}), (n.prototype.isEntity = function () { return !0; }), (n.prototype.clear = function () { t.prototype.clear.call(this); }), (n.prototype.dispose = function () { this.disposeValues(), n._textFields.push(this); }), (n.prototype.disposeValues = function () { t.prototype.disposeValues.call(this), this.maskChild && (this.maskChild.dispose(), (this.maskChild = null)), this.textChild && (this.textChild.dispose(), (this.textChild = null)), this.cursorShape && (this.cursorShape.dispose(), (this.cursorShape = null)), this.bgShapeSelect && (this.bgShapeSelect.dispose(), (this.bgShapeSelect = null)), this._labelData && (this._labelData = null), this._clearTextShapes(), (this._textFormat = null); }), (n.prototype.reConstruct = function (t) { void 0 === t && (t = !1), (this._textDirty || this._positionsDirty || this._glyphsDirty || this._shapesDirty) && (this._textDirty && ((this._positionsDirty = !0), (this.chars_codes_prev = Array.from(this.chars_codes)), (this.tf_per_char_prev = Array.from(this.tf_per_char)), (this._words_amount_prev = this.words.length), (this.chars_codes.length = 0), (this.chars_width.length = 0), (this.char_positions_x.length = 0), (this.char_positions_y.length = 0), (this.tf_per_char.length = 0), (this.words.length = 0), (this._textRuns_words.length = 0), (this._textRuns_formats.length = 0), (this._paragraph_textRuns_indices.length = 0), (this.lines_wordStartIndices.length = 0), (this.lines_wordEndIndices.length = 0), (this.lines_start_y.length = 0), (this.lines_start_x.length = 0), (this.lines_charIdx_start.length = 0), (this.lines_charIdx_end.length = 0), (this.lines_width.length = 0), (this.lines_height.length = 0), (this.lines_numSpacesPerline.length = 0), (this._maxScrollH = 0), (this._maxScrollV = 0), (this._maxWidthLine = 0), !this._textFormat && this._textFormats.length > 0 && (this._textFormat = this._textFormats[0]), "" != this._iText && null != this._textFormat && this.buildParagraphs()), this._positionsDirty && ((this._glyphsDirty = !0), "" != this._iText && null != this._textFormat ? this.getWordPositions() : ((this._textWidth = 0), (this._textHeight = 0), this._autoSize != Ou.NONE && (this.wordWrap || this.adjustPositionForAutoSize(0), (this._height = 4), this._type == Bu.INPUT && (this.newTextFormat.font_table.initFontSize( this.newTextFormat.size ), (this._height = this.newTextFormat.font_table.getLineHeight() + 4))), this._type == Bu.INPUT && this.drawSelectionGraphics()), this.updateMaskMode()), (this._textDirty = !1), (this._positionsDirty = !1), t && (this._textShapesDirty || 0 == this.chars_codes_prev.length || ((this.chars_codes_prev.length > this.chars_codes.length || this.chars_codes_prev[0] !== this.chars_codes[0]) && (this._textShapesDirty = !0)), this._glyphsDirty && (this._labelData ? this.buildGlyphsForLabelData() : this.buildGlyphs()), (this._glyphsDirty = !1), this._labelData || (this.buildShapes(), (this._shapesDirty = !1)))); }), (n.prototype.reset = function () { t.prototype.reset.call(this), this.sourceTextField && this.sourceTextField.copyTo(this); }), (n.prototype.onClipboardPaste = function (t) { var e = (t.clipboardData || self.clipboardData).getData("text"); e && (t.preventDefault(), this._selectionBeginIndex > 0 || this._selectionEndIndex > this.length ? this._insertNewText(e) : (this.text = e)); }), (n.prototype.buildParagraphs = function () { var t = this._iText.toString(), e = this._textFormatsIdx.length, n = 0, r = 0; this._paragraph_textRuns_indices[ this._paragraph_textRuns_indices.length ] = this._textRuns_formats.length; for (var i = 0; i < e; i++) { var o = 0, a = 0, s = !0, u = this._textFormats[i], l = this._width - (u.indent + u.leftMargin + u.rightMargin); u.font_table.initFontSize(u.size); var c = i === e - 1 ? t.length : this._textFormatsIdx[i]; if (c > r) { (this._textRuns_formats[this._textRuns_formats.length] = u), (this._textRuns_words[this._textRuns_words.length] = this.words.length); for (var h = r; h < c; h++) { var p = t.charCodeAt(h), d = t.charCodeAt(h + 1); if ((13 === p && (p = 10), 92 !== p || 114 !== d)) if ( (92 === p && 110 === d && ((h += 1), (p = 10), (d = t.charCodeAt(h + 1))), 10 === p) ) (this._textRuns_words[this._textRuns_words.length] = o), (this._textRuns_words[this._textRuns_words.length] = n), (this._textRuns_words[this._textRuns_words.length] = a), (this._paragraph_textRuns_indices[ this._paragraph_textRuns_indices.length ] = this._textRuns_formats.length), (this._textRuns_formats[this._textRuns_formats.length] = u), (this._textRuns_words[this._textRuns_words.length] = this.words.length), (s = !0), (a = 0), (o = 0), this._maxWidthLine < n && (this._maxWidthLine = n), (n = 0); else { (this.chars_codes[this.chars_codes.length] = p), (this.tf_per_char[this.tf_per_char.length] = u); var f = u.font_table.getCharWidth(p.toString()), g = 9 == p || 32 == p; !g && h < c - 1 && 9 != d && 32 != d && (f += u.letterSpacing), (n += f), (this.chars_width[this.chars_width.length] = f), g ? (a++, (this.words[this.words.length] = this.chars_codes.length - 1), (this.words[this.words.length] = 0), (this.words[this.words.length] = 0), (this.words[this.words.length] = f), (this.words[this.words.length] = 1), o++, (s = !0)) : (this._autoSize == Ou.NONE && this._wordWrap && this.words[this.words.length - 2] + f >= l && (s = !0), s ? ((this.words[this.words.length] = this.chars_codes.length - 1), (this.words[this.words.length] = 0), (this.words[this.words.length] = 0), (this.words[this.words.length] = f), (this.words[this.words.length] = 1), o++) : ((this.words[this.words.length - 2] += f), this.words[this.words.length - 1]++), (s = !1)); } else h += 1; } (this._textRuns_words[this._textRuns_words.length] = o), (this._textRuns_words[this._textRuns_words.length] = n), (this._textRuns_words[this._textRuns_words.length] = a), this._maxWidthLine < n && (this._maxWidthLine = n); } r = c; } if (0 != this.chars_codes_prev.length) if (this.chars_codes_prev[0] === this.chars_codes[0]) for (h = this.chars_codes.length - 1; h >= 0; h--) { (p = this.chars_codes[h]), (u = this.tf_per_char_prev[h]); if ( this.chars_codes_prev[h] && (this.chars_codes_prev[h] != p || this.tf_per_char_prev[h]._style_name != u._style_name) ) { this._textShapesDirty = !0; break; } } else this._textShapesDirty = !0; }), (n.prototype.adjustPositionForAutoSize = function (t) { var e = this._width; (this._width = 4 + t), this._autoSize == Ou.RIGHT ? ((this._transform.matrix3D._rawData[12] -= this._width - e), this._transform.invalidatePosition()) : this._autoSize == Ou.CENTER && ((this._transform.matrix3D._rawData[12] -= (this._width - e) / 2), this._transform.invalidatePosition()); }), (n.prototype.getWordPositions = function () { var t, e = 0, n = this._textRuns_formats.length, r = 0, i = 0, o = 0, a = 0, s = 0; this._numLines = 0; var u = 0, l = 0, c = 0, h = this.textOffsetY + 2; if (this._autoSize != Ou.NONE && !this._wordWrap && this._textDirty) { var p = this._maxWidthLine + this._textFormat.indent + this._textFormat.leftMargin + this._textFormat.rightMargin; this.adjustPositionForAutoSize(p); } var d = this._width - (this._textFormat.indent + this._textFormat.leftMargin + this._textFormat.rightMargin), f = 0, g = this._paragraph_textRuns_indices.length; (u = 0), (this.lines_wordStartIndices.length = 0), (this.lines_wordEndIndices.length = 0), (this.lines_start_y.length = 0), (this.lines_start_x.length = 0), (this.lines_width.length = 0), (this.lines_height.length = 0), (this.lines_numSpacesPerline.length = 0), (this.lines_charIdx_start.length = 0), (this.lines_charIdx_end.length = 0); var _ = [], m = []; for (f = 0; f < g; f++) { for ( n = f == g - 1 ? this._textRuns_formats.length : this._paragraph_textRuns_indices[f + 1], o = 0, _[_.length] = 0, e = this._paragraph_textRuns_indices[f]; e < n; e++ ) (t = this._textRuns_formats[e]).font_table.initFontSize(t.size), _[_.length - 1] < t.font_table.getLineHeight() + t.leading && (_[_.length - 1] = t.font_table.getLineHeight() + t.leading), (i = this._textRuns_words[4 * e] + 5 * this._textRuns_words[4 * e + 1]), (o += this._textRuns_words[4 * e + 2]); (this.lines_wordStartIndices[this.lines_wordStartIndices.length] = this._textRuns_words[4 * this._paragraph_textRuns_indices[f]]), (this.lines_wordEndIndices[this.lines_wordEndIndices.length] = i), (this.lines_width[this.lines_width.length] = 0), (this.lines_numSpacesPerline[ this.lines_numSpacesPerline.length ] = 0); var y = 0; for ( this.lines_height[this.lines_height.length] = _[y], m[u] = t, e = this._paragraph_textRuns_indices[f]; e < n; e++ ) if ( ((t = this._textRuns_formats[e]).font_table.initFontSize( t.size ), (s = t.indent), (i = this._textRuns_words[4 * e] + 5 * this._textRuns_words[4 * e + 1]), o <= d || !this.wordWrap) ) for (r = this._textRuns_words[4 * e]; r < i; r += 5) (l += c = this.words[r + 3]), (this.lines_wordEndIndices[u] = r + 5), (this.lines_width[u] += c), (m[u] = t), (32 != this.chars_codes[this.words[r]] && 9 != this.chars_codes[this.words[r]]) || (this.lines_numSpacesPerline[u] += 1); else for ( c = 0, s = 0, r = this._textRuns_words[4 * e]; r < i; r += 5 ) { c = this.words[r + 3]; var A = !1; (32 != this.chars_codes[this.words[r]] && 9 != this.chars_codes[this.words[r]]) || ((this.lines_numSpacesPerline[u] += 1), (A = !0)), A || this.lines_width[u] + c <= d - s - 1 * t.font_table.getCharWidth("32") || 0 == this.lines_width[u] ? ((this.lines_wordEndIndices[u] = r + 5), (this.lines_width[u] += c), (m[u] = t)) : (u++, (this.lines_wordStartIndices[u] = r), (this.lines_wordEndIndices[u] = r + 5), (this.lines_width[u] = c), (this.lines_numSpacesPerline[u] = 0), (this.lines_height[this.lines_height.length] = _[y]), (m[u] = t), (s = t.indent)); } y++, u++; } var v, b, C, I, E, x = this.textOffsetX, w = 0, S = this.lines_wordStartIndices.length, D = 0; for (this._biggestLine = 0, this._numLines = S, E = 0; E < S; E++) { (l = this.lines_width[E]), (b = this.lines_height[E]), (v = this.lines_wordStartIndices[E]), (C = this.lines_wordEndIndices[E]), this.lines_numSpacesPerline[E], (t = m[E]), (I = d - l), (x = this.textOffsetX + t.leftMargin + t.indent), t.align == Mu.JUSTIFY ? 0 != E && (x -= t.indent) : t.align == Mu.CENTER ? (x += I > 0 ? I / 2 : 2) : t.align == Mu.RIGHT ? (x += I > 0 ? I - 2 : 2) : t.align == Mu.LEFT && (x += 2); var T = 0, P = x; (this.lines_start_x[E] = x), (this.lines_start_y[E] = h), (this.lines_charIdx_start[E] = D); var O = 0; for (r = v; r < C; r += 5) { (this.words[r + 1] = x), (P = 0), (T = (v = this.words[r]) + this.words[r + 4]); var B = this.tf_per_char[v]; B.font_table.initFontSize(B.size); var M = b - (B.font_table.getLineHeight() + B.leading); for ( M = M > 0 ? M - 2 : 0, this.words[r + 2] = h + M, w = v; w < T; w++ ) (this.char_positions_x[this.char_positions_x.length] = x + P), (this.char_positions_y[this.char_positions_y.length] = h + M), (P += this.chars_width[w]), D++; (x += P), (O += P); } (this.lines_charIdx_end[E] = D), (h += b), O > a && ((this._biggestLine = E), (a = O)); } if ( ((this._textWidth = a), (this._textHeight = h), this.autoSize != Ou.NONE && (this._height = this._textHeight + 4), this._textWidth > this._width) ) { (v = this.lines_charIdx_start[this._biggestLine]), (w = this.lines_charIdx_end[this._biggestLine]); for (var L = 0; w > v; ) if ((w--, (L += this.chars_width[w]) > this._width)) { this._maxScrollH = w; break; } } if (this._textHeight > this._height) { var N = this.lines_height.length; for (L = 4; N > 0; ) if ((N--, (L += this.lines_height[N]) > this._height)) { this._maxScrollV = N + 1; break; } } this.updateMaskMode(); }), (n.prototype.buildGlyphsForLabelData = function () { this._clearTextShapes(); for ( var t, e, n = [], r = [], i = [], o = [], a = this.staticMatrix.tx / 20, s = this.staticMatrix.ty / 20, u = 0, l = 0; l < this._labelData.records.length; l++ ) { (n[l] = new zc()), (r[l] = []), (i[l] = []), (t = this._labelData.records[l]).font_table ? (n[l].font_table = t.font_table) : l > 0 ? (n[l].font_table = n[l - 1].font_table) : console.log("error - no font for label"), t.fontHeight ? (n[l].size = t.fontHeight / 20) : l > 0 && (n[l].size = n[l - 1].size), t.color ? (n[l].color = w.f32_RGBA_To_f32_ARGB(t.color)) : l > 0 && (n[l].color = n[l - 1].color), null != t.moveY && (u = s += t.moveY / 20 - u), null != t.moveX && (a = this.staticMatrix.tx / 20 + t.moveX / 20), o.push(a), o.push(s); for (var c = 0; c < t.entries.length; c++) (r[l][c] = t.entries[c].glyphIndex), (i[l][c] = t.entries[c].advance / 20), (a += i[l][c]); } var h, p = 0, d = n.length, f = 0, g = 0; for (p = 0; p < d; p++) n[p].font_table.initFontSize(n[p].size), (g += (h = n[p].font_table.buildTextLineFromIndices( this, n[p], o[2 * p], o[2 * p + 1], r[p], i[p] )).y), (f = h.x > f ? h.x : f); for (var _ in ((this._textWidth = f), (this._textHeight = g), (this.targetGraphics = this._graphics), this.targetGraphics.clear(), this.drawBG(), (this.border || (!this._background && this._type != Bu.INPUT)) && this.drawBorder(), this.textShapes)) { e = this.textShapes[_]; for ( var m = new hi(e.length / 2), y = new Float32Array(m.attributesBuffer.buffer), A = 0, v = 0, b = e.verts; v < b.length; v++ ) { var C = b[v]; y.set(C, A), (A += C.length); } (e.elements = new ao()), e.elements.setPositions(m), e.elements.invalidate(), (e.shape = this.targetGraphics.addShape(ss.getShape(e.elements))), (e.shape.deepHitCheck = !0), e.shape.usages++; var I = new Le(); if ( ((e.shape.style = new zi()), e.format.material && 0 == this._textColor) ) (e.shape.material = this._textFormat.material), e.shape.style.addSamplerAt(I, e.shape.material.getTextureAt(0)), (e.shape.material.animateUVs = !0), (e.shape.style.uvMatrix = new O( 0, 0, 0, 0, e.format.uv_values[0], e.format.uv_values[1] )); else { var E = this.getTextColorForTextFormat(e.format), x = w.float32ColorToARGB(E)[0]; 0 == x && (x = 255); var S = ds.get_material_for_color(E, x / 255); (e.shape.material = S.material), S.colorPos && (e.shape.style.addSamplerAt( I, e.shape.material.getTextureAt(0) ), (e.shape.material.animateUVs = !0), (e.shape.style.uvMatrix = new O( 0, 0, 0, 0, S.colorPos.x, S.colorPos.y ))); } } }), (n.prototype.buildGlyphs = function () { var t, e = this._textRuns_formats, n = this._textRuns_words, r = e.length; this._textShapesDirty && this._clearTextShapes(); for (var i = 0; i < r; i++) 0 != n[4 * i + 1] && (e[i].font_table.initFontSize(e[i].size), e[i].font_table.fillTextRun(this, e[i], n[4 * i], n[4 * i + 1])); for (var o in this.textShapes) if (0 !== (t = this.textShapes[o]).length) { for ( var a = new hi(t.length / 2), s = new Float32Array(a.attributesBuffer.buffer), u = 0, l = 0, c = t.verts; l < c.length; l++ ) { var h = c[l]; s.set(h, u), (u += h.length); } if (t.shape) { var p = t.shape.elements; p.setPositions(s), p.invalidate(), a.dispose(); } else { var d = this.getTextColorForTextFormat(t.format), f = w.float32ColorToARGB(d)[0]; 0 == f && (f = 255), (t.elements = new ao()), t.elements.setPositions(a), t.elements.invalidate(), (t.shape = ss.getShape(t.elements)), (t.shape.deepHitCheck = !0), t.shape.usages++; var g = new Le(!1, !0, !0); if (((t.shape.style = new zi()), t.fntMaterial)) (t.shape.material = t.fntMaterial), t.shape.style.addSamplerAt( g, t.shape.material.getTextureAt(0) ); else if (t.format.material && 0 == this._textColor) (t.shape.material = this._textFormat.material), t.shape.style.addSamplerAt( g, t.shape.material.getTextureAt(0) ), (t.shape.material.animateUVs = !0), (t.shape.style.uvMatrix = new O( 0, 0, 0, 0, t.format.uv_values[0], t.format.uv_values[1] )); else { var _ = ds.get_material_for_color(d, f / 255); (t.shape.material = _.material), _.colorPos && (t.shape.style.addSamplerAt( g, t.shape.material.getTextureAt(0) ), (t.shape.material.animateUVs = !0), (t.shape.style.uvMatrix = new O( 0, 0, 0, 0, _.colorPos.x, _.colorPos.y ))); } } } }), (n.prototype.buildShapes = function () { var t; for (var e in (this.targetGraphics ? this._graphics.clear() : (this.targetGraphics = this._graphics), this.targetGraphics.clear(), this.drawBG(), (!this._border && this._background) || this.drawBorder(), this.drawSelectionGraphics(), this.bgShapeSelect && this.isInFocus && this.showSelection && this.targetGraphics.addShape(this.bgShapeSelect), this.textShapes)) (t = this.textShapes[e]).shape && this.targetGraphics.addShape(t.shape); this.type === Bu.INPUT && this.isInFocus && this.cursorShape && !this.cursorBlinking && this.targetGraphics.addShape(this.cursorShape); }), (n.prototype.appendText = function (t) { t.length && ((this._iText += t), (this._textDirty = !0), this._autoSize != Ou.NONE ? this.invalidate() : this._invalidateEntity()); }), (n.prototype.closeParagraph = function () { (this._iText += "\n"), (this._textDirty = !0), this._autoSize != Ou.NONE ? this.invalidate() : this._invalidateEntity(); }), (n.prototype.getCharBoundaries = function (t) { var e = new K(); return ( t >= this.char_positions_x.length || ((e.x = this.char_positions_x[t]), (e.width = this.chars_width[t]), (e.y = this.char_positions_y[t]), (e.height = 10)), e ); }), (n.prototype.getCharIndexAtPoint = function (t, e, n) { void 0 === n && (n = -1), n < 0 && (n = this.getLineIndexAtPoint(t, e)); for ( var r = this.lines_charIdx_start[n], i = this.lines_charIdx_end[n], o = r; o < i; o++ ) if (t >= this.char_positions_x[o]) { if (t <= this.char_positions_x[o] + this.chars_width[o] / 2) return o; if (t <= this.char_positions_x[o] + this.chars_width[o]) return o + 1; } return -1; }), (n.prototype.getFirstCharInParagraph = function (t) { return ( console.log("Textfield.getFirstCharInParagraph() not implemented"), this._firstCharInParagraph ); }), (n.prototype.getImageReference = function (t) { return ( console.log("TextField.getImageReference() not implemented"), this._imageReference ); }), (n.prototype.getLineIndexAtPoint = function (t, e) { for (var n = this.lines_start_y.length, r = 0; r < n - 1; r++) if (e >= this.lines_start_y[r] && e <= this.lines_start_y[r + 1]) return r; return e >= this.lines_start_y[n - 1] ? n - 1 : 0; }), (n.prototype.getLineIndexOfChar = function (t) { this.buildParagraphs(); for ( var e = this.lines_charIdx_start.length - 1, n = void 0; n < e; n++ ) if ( t >= this.lines_charIdx_start[n] && t <= this.lines_charIdx_end[n + 1] ) return n; return e; }), (n.prototype.getLineLength = function (t) { return 0 == this.lines_width.length ? 0 : t >= this.lines_width.length ? this.lines_width[this.lines_width.length - 1] : this.lines_width[t]; }), (n.prototype.getLineMetrics = function (t) { var e = new Hc(); return this.lines_width.length ? (t >= this.lines_width.length && (t = this.lines_width.length - 1), (e.x = this.lines_start_x[t]), (e.width = this.lines_width[t]), (e.height = this.lines_height[t]), e) : e; }), (n.prototype.getLineOffset = function (t) { return 0 == this.lines_charIdx_start.length ? 0 : t >= this.lines_charIdx_start.length ? this.lines_charIdx_start[this.lines_charIdx_start.length - 1] : this.lines_charIdx_start[t]; }), (n.prototype.getLineText = function (t) { return 0 == this.lines_charIdx_start.length ? "" : (t >= this.lines_width.length && (t = this.lines_width.length - 1), this._iText.slice( this.lines_charIdx_start[t], this.lines_charIdx_end[t] )); }), (n.prototype.getParagraphLength = function (t) { return this._paragraphLength; }), (n.prototype.getTextFormat = function (t, e) { if ( (void 0 === t && (t = -1), void 0 === e && (e = -1), !this.tf_per_char || !this.tf_per_char.length) ) return this._textFormat ? this._textFormat.clone() : new zc(); t < 0 && (t = 0), e > this.tf_per_char.length && (e = this.tf_per_char.length); for ( var n = this.tf_per_char[t].clone(), r = this.tf_per_char[t], i = t + 1; i < e; i++ ) this.tf_per_char[i] != r && (n.mergeFormat(this.tf_per_char[i]), (r = this.tf_per_char[i])); return n; }), (n.prototype.replaceSelectedText = function (t) { return this._insertNewText(t); }), (n.prototype.replaceText = function (t, e, n) { var r = this._iTextWoLineBreaks.slice(0, t - 1), i = this._iTextWoLineBreaks.slice( e, this._iTextWoLineBreaks.length ); (this.text = r + n + i), (this._selectionEndIndex = this._selectionBeginIndex + n.length); }), (n.prototype.setSelection = function (t, e) { (this._selectionBeginIndex == t && this._selectionBeginIndex == e) || ((this._selectionBeginIndex = t), (this._selectionEndIndex = e), (this._glyphsDirty = !0), this.reConstruct(), this.drawSelectionGraphics()); }), (n.prototype.setTextFormat = function (t, e, n) { if ( (void 0 === e && (e = -1), void 0 === n && (n = -1), t && 0 != this._iTextWoLineBreaks.length) ) { if ( (-1 == e && -1 == n) || (0 == e && -1 == n) || ((-1 == e || 0 == e) && n >= this._iTextWoLineBreaks.length) ) { var r = this._textFormats.length; if ( 1 === this._textFormats.length && this._textFormats[0].equal(t) ) return; for (var i = 0; i < r; i++) (this._textFormats[i] = this._textFormats[i].clone()), t.applyToFormat(this._textFormats[i]); return (this._textDirty = !0), void (this._textShapesDirty = !0); } var o, a = 0, s = [], u = [], l = 0, c = -1, h = this._textFormats.length, p = this._iTextWoLineBreaks.length; if ((-1 == e && (e = 0), -1 == n && (n = p), n < e)) { var d = n; (n = e), (e = d); } n == e && n++; for (var f = 0; f < h; f++) if ( (f > 0 && (l = c), (c = this._textFormatsIdx[f]), (o = this._textFormats[f]), l <= e && c > e) ) { for (l < e && (s.push(o), u.push(e)); c < n; ) { var g = this._textFormats[f].clone(); t.applyToFormat(g), s.push(g), u.push(c), ++f < h ? ((c = this._textFormatsIdx[f]), (o = this._textFormats[f])) : (c = n + 1); } if (c == n) { g = o.clone(); t.applyToFormat(g), s.push(g), u.push(n); } if (c > n) { g = o.clone(); t.applyToFormat(g), s.push(g), u.push(n), s.push(o), u.push(c); } } else s.push(this._textFormats[f]), u.push(this._textFormatsIdx[f]); for ( this._textFormats.length = 0, this._textFormatsIdx.length = 0, a = 0; a < s.length; a++ ) (this._textFormats[a] = s[a]), (this._textFormatsIdx[a] = u[a]); (this._textDirty = !0), (this._textShapesDirty = !0); } }), (n.isFontCompatible = function (t, e) { return !1; }), (n.prototype.onKey = function (t) { var e = t; this.addChar(e.char, e.isShift, e.isCTRL, e.isAlt); }), (n.prototype.addCharCode = function (t) { this.addChar(String.fromCharCode(t)); }), (n.prototype.deleteSelectedText = function (t) { if ((void 0 === t && (t = "Backspace"), 0 != this.text.length)) { if (this._selectionBeginIndex != this._selectionEndIndex) { var e = 0 != this._selectionBeginIndex ? this._iText.slice(0, this._selectionBeginIndex) : "", n = this._selectionEndIndex < this._iText.length ? this._iText.slice( this._selectionEndIndex, this._iText.length ) : ""; return ( (this.text = e + n), void (this._selectionEndIndex = this._selectionBeginIndex) ); } if ("Backspace" == t) { if (0 == this._selectionBeginIndex) return; (e = this._iText.slice(0, this._selectionBeginIndex - 1)), (n = this._iText.slice( this._selectionEndIndex, this._iText.length )); (this.text = e + n), (this._selectionBeginIndex -= 1), (this._selectionEndIndex = this._selectionBeginIndex); } else if ("Delete" == t) { (e = this._iText.slice(0, this._selectionBeginIndex)), (n = this._iText.slice( this._selectionEndIndex + 1, this._iText.length )); (this.text = e + n), (this._selectionEndIndex = this._selectionBeginIndex); } } }), (n.prototype.addChar = function (t, e, r, i) { var o = this; void 0 === e && (e = !1), void 0 === r && (r = !1), void 0 === i && (i = !1); var a = !1, s = this._iText; if ( (this._selectionBeginIndex || (this._selectionBeginIndex = 0), this._selectionEndIndex || (this._selectionEndIndex = 0), this._selectionEndIndex < this._selectionBeginIndex) ) { var u = this._selectionEndIndex; (this._selectionEndIndex = this._selectionBeginIndex), (this._selectionBeginIndex = u); } if (i || r) r && !e && "v" === t && navigator.clipboard.readText && navigator.clipboard .readText() .then(function (t) { o._insertNewText(t); }) .catch(function (t) { console.warn("[TextField] Can't paste text:", t.message); }); else { if ("Backspace" == t || "Delete" == t) this.deleteSelectedText(t), (a = !0); else if ("ArrowRight" == t) e || this._selectionEndIndex == this._selectionBeginIndex ? this._selectionEndIndex > this._selectionBeginIndex ? ((this._selectionEndIndex += 1), e || (this._selectionBeginIndex = this._selectionEndIndex)) : ((this._selectionBeginIndex += 1), e || (this._selectionEndIndex = this._selectionBeginIndex)) : this._selectionEndIndex > this._selectionBeginIndex ? (this._selectionBeginIndex = this._selectionEndIndex) : (this._selectionEndIndex = this._selectionBeginIndex), (a = !0); else if ("ArrowLeft" == t) e || this._selectionEndIndex == this._selectionBeginIndex ? this._selectionEndIndex > this._selectionBeginIndex ? ((this._selectionBeginIndex -= 1), e || (this._selectionEndIndex = this._selectionBeginIndex)) : ((this._selectionEndIndex -= 1), e || (this._selectionBeginIndex = this._selectionEndIndex)) : this._selectionEndIndex > this._selectionBeginIndex ? (this._selectionEndIndex = this._selectionBeginIndex) : (this._selectionBeginIndex = this._selectionEndIndex), (a = !0); else if ("Enter" == t && this.multiline) this._insertNewText("\n"), (a = !0); else if (1 == t.length) { if (this._restrictRegex) { var l = t.replace(this._restrictRegex, ""); if (l.length < t.length) { var c = t.toUpperCase().replace(this._restrictRegex, ""), h = t.toLowerCase().replace(this._restrictRegex, ""); (t = c), c.length < h.length && (t = h), l.length > t.length && (t = l); } if ("" == t) return; } if (this.newTextFormat.font_table) { var p = this.newTextFormat.font_table, d = t.charCodeAt(0).toString(), f = !1; if ( !(f = (f = (f = f || p.hasChar(d)) || p.hasChar(d.toLowerCase())) || p.hasChar(d.toUpperCase())) ) return void console.log("Char not found", d); } this._insertNewText(t), (a = !0); } else t.length > 1 && console.log("invalid keyboard input: ", t); a && ((this._glyphsDirty = !0), this.invalidate(), s !== this._iText && this.dispatchEvent(n._onChangedEvent)); } if (t && t.length > 0 && this.adapter != this) { var g = void 0; switch (t) { case "Backspace": g = 8; break; case "Delete": g = 46; break; case "ArrowRight": g = 39; break; case "ArrowLeft": g = 37; break; case ".": g = 189; break; default: g = t.charCodeAt(0); } this.adapter.dispatchKeyEvent(g, e, r, i); } }), (n.prototype._insertNewText = function (t) { if (this._selectionBeginIndex != this._selectionEndIndex) { var e = this._iText.slice(0, this._selectionBeginIndex), n = this._iText.slice( this._selectionEndIndex, this._iText.length ); if ( this.maxChars > 0 && e.length + n.length + t.length > this.maxChars ) { var r = this.maxChars - e.length + n.length; r > 0 && (t = t.slice(0, r)); } (this.text = e + t + n), (this._textShapesDirty = !0), (this._selectionBeginIndex += 1), (this._selectionEndIndex = this._selectionBeginIndex); } else if (this.maxChars > 0 && this._iText.length >= this.maxChars); else { (e = this._iText.slice(0, this._selectionBeginIndex)), (n = this._iText.slice( this._selectionEndIndex, this._iText.length )); (this.text = e + t + n), (this._textShapesDirty = !0), (this._selectionBeginIndex += 1), (this._selectionEndIndex = this._selectionBeginIndex); } }), (n.prototype.clone = function () { var t = n.getNewTextField(); return this.copyTo(t), t; }), (n.prototype.copyTo = function (e) { t.prototype.copyTo.call(this, e), (e.autoSize = this.autoSize), (e.type = this._type), (e.html = this.html), (e.width = this._width), (e.height = this._height), this._textFormat && (e.textFormat = this._textFormat.clone()), (e.textColor = this._textColor), (e.border = this._border), (e.borderColor = this._borderColor), (e.background = this._background), (e.backgroundColor = this._backgroundColor), (e.textOffsetX = this.textOffsetX), (e.textOffsetY = this.textOffsetY), (e.staticMatrix = this.staticMatrix), (e.selectable = this._selectable), (e.multiline = this.multiline), (e.wordWrap = this.wordWrap), (e.maxChars = this.maxChars), (e.sourceTextField = this), e.html ? (e.htmlText = this.htmlText) : (e.text = this.text), this._labelData && e.setLabelData(this._labelData); }), (n.prototype._clearTextShapes = function () { var t; for (var e in ((this._textShapesDirty = !1), (this.last_word_vertices_count = 0), (this.tf_per_char_prev.length = 0), (this.chars_codes_prev.length = 0), (this._words_amount_prev = 0), this.targetGraphics && this.targetGraphics.clear(), this.textShapes)) (t = this.textShapes[e]).shape && t.shape.dispose(), (t.shape = null), (t.elements = null), (t.length = 0), delete this.textShapes[e]; }), (n._textFields = []), (n.assetType = "[asset TextField]"), (n._onChangedEvent = new Yc(Yc.CHANGED)), n ); })(nu); Ai.registerAbstraction(bi, bh); var Ch = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.createMovieClip = function (t, e) { return void 0 === t && (t = null), new Cu(t); }), (n.prototype.createSprite = function (t, e, n) { return void 0 === t && (t = null), t ? t.getNewObject() : new ru(); }), (n.prototype.createDisplayObjectContainer = function (t) { return new nu(); }), (n.prototype.createTextField = function (t) { return new bh(); }), (n.prototype.createBillboard = function (t, e) { return new cu(t); }), (n.prototype.createMaterial = function (t, e, n) { return new Pc(t, e); }), (n.prototype.createFrameScripts = function (t, e, n, r) { throw "[DefaultSceneGraphFactory] - createFrameScripts should be overwritten by AVM"; }), n ); })(Zr), Ih = new P(0, 0), Eh = (function (t) { function n(e, n, r, i, o, a) { void 0 === r && (r = !0), void 0 === i && (i = 4294967295), void 0 === o && (o = !0), void 0 === a && (a = null); var s = t.call(this, e, n, r, null, o, a) || this; return ( (s._initalFillColor = null), (s._lastUsedFill = null), (s._internalSync = !1), (s._msaaNeedDrop = !1), (s._enforceMSAASupport = !1), (s._antialiasQuality = tu.ALLOW_FORCE_MSAA), (s._clearFromDispose = !1), (s._initalFillColor = i), (s._lastUsedFill = i), s ); } return ( e(n, t), (n.getImage = function (t, e, r, i, o, a, s) { void 0 === r && (r = !0), void 0 === i && (i = 4294967295), void 0 === o && (o = !0), void 0 === a && (a = null), void 0 === s && (s = !1); var u = new n(t, e, r, i, o, a); return ( s ? (u._enforceMSAASupport = !0) : ((u._msaaNeedDrop = !0), (u._antialiasQuality = 0)), u ); }), (n.tryStoreImage = function (t, e) { e.filterManager.pushTemp(t); }), (n.getTemp = function (t, e, n, r) { void 0 === r && (r = !1); var i = n.filterManager.popTemp(t, e, r && tu.ALLOW_FORCE_MSAA > 1); return (i.antialiasQuality = r ? tu.ALLOW_FORCE_MSAA : 0), i; }), (n.prototype._dropMSAA = function () { !this._msaaNeedDrop && this.canUseMSAAInternaly && ((this._enforceMSAASupport = !1), (this._msaaNeedDrop = !0), this.wasUpload && t.prototype.unload.call(this), console.debug( "[SceneImage2D Experemental] Drop MSAA support because a setPixel* operation called after upload.", this.id )); }), Object.defineProperty(n.prototype, "canUseMSAAInternaly", { get: function () { if (this._enforceMSAASupport) return !0; var t = tu.MSAA_MINIMAL_IMAGE_SIZE, e = tu.MSAA_MINIMAL_IMAGE_SIZE; return ( this._stage && ((e = Math.min(this._stage.height, e)), (t = Math.min(this._stage.width, t))), this.width >= t && this.height >= e && !this._msaaNeedDrop ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "antialiasQuality", { get: function () { return this.canUseMSAAInternaly ? this._antialiasQuality : 0; }, enumerable: !0, configurable: !0, }), (n.prototype.syncData = function (t) { var e = this; if ((void 0 === t && (t = !1), t && this._asyncRead)) return this._asyncRead; if (!t && this._asyncRead) throw "[SceneImage2D] Synced read not allowed while async read is requested!"; if ((this.applySymbol(), !this._imageDataDirty)) return !!t && Promise.resolve(!1); var n = this._stage.context; return ( this._stage.setRenderTarget(this, !1), this._data || (this._data = new Uint8ClampedArray( this.width * this.height * 4 )), (this._internalSync = !0), (this._asyncRead = n.drawToBitmapImage2D(this, !1, t)), (this._internalSync = !1), this._stage.setRenderTarget(null), t ? this._asyncRead.then(function (t) { return ( (e._imageDataDirty = !1), (e._unpackPMA = !1), (e._asyncRead = null), !0 ); }) : ((this._imageDataDirty = !1), (this._unpackPMA = !1), !0) ); }), (n.prototype.getDataInternal = function (e, n) { if ( (void 0 === e && (e = !0), void 0 === n && (n = !1), !n && this._imageDataDirty && !this._internalSync) ) return this.syncData(!1), this._data; if (null === this._initalFillColor) return t.prototype.getDataInternal.call(this, e, !0); var r = t.prototype.getDataInternal.call(this, !1, !0); return ( r || (t.prototype.fillRect.call(this, this.rect, this._initalFillColor), (this._initalFillColor = null), this._data) ); }), Object.defineProperty(n.prototype, "assetType", { get: function () { return n.assetType; }, enumerable: !0, configurable: !0, }), (n.prototype.createRenderer = function () { var t = new bt(); (t.coordinateSystem = _t.RIGHT_HANDED), (t.originX = -1), (t.originY = 1), (n._root = new nu()), (n._rootNode = _i.getRootNode(n._root, vi)), (n._renderer = oo .getInstance(new yi(t, this._stage, null, null, null, !0), Io) .getRenderer(n._rootNode.partition)), (n._renderer.disableClear = !0), (n._renderer.view.backgroundAlpha = 0), (n._renderer.view.projection = t), (n._renderer.view.projection.transform = new k()), n._renderer.view.projection.transform.scaleTo(1, -1, 1), n._renderer.view.projection.transform.moveTo(0, 0, -1e3), (n._renderer.renderableSorter = null); }), (n.prototype.createBillboardRenderer = function () { var t = new bt(); (t.coordinateSystem = _t.RIGHT_HANDED), (t.originX = -1), (t.originY = 1), (n._billboardRoot = new nu()), (n._billboardRenderer = oo .getInstance(new yi(t, this._stage, null, null, null, !0), Io) .getRenderer(_i.getRootNode(n._billboardRoot, vi).partition)), (n._billboardRenderer.disableClear = !0), (n._billboardRenderer.view.backgroundAlpha = 0), (n._billboardRenderer.view.projection = t), (n._billboardRenderer.view.projection.transform = new k()), n._billboardRenderer.view.projection.transform.moveTo(0, 0, -1e3), n._billboardRenderer.view.projection.transform.lookAt(new B()), (n._billboardRenderer.renderableSorter = null); var e = new Pc(new nn(128, 128, !0, 0)); (e.bothSides = !0), (e.alphaBlending = !0), (n._billboard = new cu(e)), (n._billboard.style = new zi()), n._billboardRoot.addChild(n._billboard); }), (n.prototype.dispose = function () { (this._clearFromDispose = !0), this.dropAllReferences(), this.unmarkToUnload(), this.unuseWeakRef(), (this._data = null), (this._locked = !1), t.prototype.dispose.call(this), (this._clearFromDispose = !1); }), (n.prototype.unload = function () { var e = this, n = this.syncData(!0); "boolean" == typeof n ? t.prototype.unload.call(this) : n.then(function () { return t.prototype.unload.call(e); }); }), (n.prototype.deepClone = function (t) { this.copyPixels(t, this._rect, new P(0, 0)); }), (n.prototype.fillRect = function (t, e) { this.dropAllReferences(); var n = w.float32ColorToARGB(e), r = this._transparent ? n[0] / 255 : 1, i = t !== this._rect && !this._rect.equals(t); this._stage.setRenderTarget(this, !0, 0, 0, !0), this._stage.setScissor(t), (this._lastUsedFill = i ? null : e), this._stage.clear( (n[1] / 255) * r, (n[2] / 255) * r, (n[3] / 255) * r, r ), this._stage.setScissor(null), (this._imageDataDirty = !0); }), (n.prototype.copyPixels = function (t, e, n, r, i, o) { if ( ((this._lastUsedFill = null), this.dropAllReferences(), this.unmarkToUnload(), (o = this.transparent !== t.transparent || o), !t._imageDataDirty && e.equals(this._rect) && this._rect.equals(t.rect) && !o && (!this.wasUpload || !t.wasUpload)) ) { var a = t.getDataInternal(!0); return ( this._data ? this._data.set(a) : (this._data = a.slice()), (this._unpackPMA = t._unpackPMA), (this._initalFillColor = null), (this._imageDataDirty = !1), void this.invalidateGPU() ); } t.width, t.height, tu.CPU_COPY_PIXELS_COUNT, null !== this._initalFillColor && (this.fillRect(this._rect, this._initalFillColor), (this._initalFillColor = null)), this._stage.copyPixels(t, this, e, n, r, i, o), (this._imageDataDirty = !0); }), (n.prototype.threshold = function (t, e, n, r, i, o, a, s) { (this._lastUsedFill = null), this.dropAllReferences(), this.unmarkToUnload(), this._stage.threshold(t, this, e, n, r, i, o, a, s), (this._imageDataDirty = !0); }), (n.prototype.applyFilter = function (t, e, n, r) { if (!tu.USE_UNSAFE_FILTERS || !r || !r.filterName) return !1; this.dropAllReferences(!1); var i = this._stage.filterManager.applyFilter( t, this, e, n, r.filterName, r ); return (this._imageDataDirty = i), i; }), (n.prototype.colorTransform = function (t, e) { this.dropAllReferences(), this.unmarkToUnload(), (this._lastUsedFill = null), this._stage.colorTransform(this, this, t, e), (this._imageDataDirty = !0); }), (n.prototype.setPixel = function (e, n, r) { this.canUseMSAAInternaly && this._dropMSAA(), t.prototype.setPixel.call(this, e, n, r); }), (n.prototype.setPixel32 = function (e, n, r) { this.canUseMSAAInternaly && this._dropMSAA(), t.prototype.setPixel32.call(this, e, n, r); }), (n.prototype.setPixels = function (e, n) { this.wasUpload && this.canUseMSAAInternaly && this._dropMSAA(), t.prototype.setPixels.call(this, e, n); }), (n.prototype.clear = function () { var e = this; if (this._clearFromDispose) t.prototype.clear.call(this); else { var n = this.syncData(!0); if ( (this.unmarkToUnload(), (this.lastUsedTime = -1), "boolean" == typeof n) ) return (this.wasUpload = !1), void t.prototype.clear.call(this); n.then(function () { (e.wasUpload = !1), t.prototype.clear.call(e); }); } }), (n.prototype.getPixel32 = function (e, n) { return this.syncData(), t.prototype.getPixel32.call(this, e, n); }), (n.prototype.getPixel = function (t, e) { return 16777215 & this.getPixel32(t, e); }), (n.prototype.draw = function (t, e, n, r, i, o) { this.dropAllReferences(), this.unmarkToUnload(), t instanceof eu ? this._drawAsDisplay(t, e, n, r, i, o) : this._drawAsBitmap(t, e, n, r, i, o), (this._lastUsedFill = null), (this._imageDataDirty = !0); }), (n._mapSupportedBlendMode = function (t) { switch ((void 0 === t && (t = ""), t)) { case null: case "": case dn.NORMAL: case dn.LAYER: return dn.LAYER; case dn.MULTIPLY: case dn.ADD: case dn.ALPHA: return t; } return dn.LAYER; }), (n.prototype._drawAsBitmap = function (t, e, r, i, o, a) { n._billboardRenderer || this.createBillboardRenderer(), null !== this._initalFillColor && (this.fillRect(this._rect, this._initalFillColor), (this._initalFillColor = null)); var s = n._billboardRenderer, u = n._billboardRoot, l = n._billboard; if ( ((l.sampler.smooth = a), (s.disableClear = !0), (s.view.target = this), (s.view.projection.scale = 1e3 / this.rect.height), (l.material.style.image = t), (l.material.blendMode = n._mapSupportedBlendMode(i)), (l.material.useColorTransform = !!r), e) ) { var c = u.transform.matrix3D; c.identity(), (c._rawData[0] = e.a), (c._rawData[1] = -e.b), (c._rawData[4] = e.c), (c._rawData[5] = -e.d), (c._rawData[12] = e.tx), (c._rawData[13] = this.rect.height - e.ty), u.transform.invalidateComponents(); } else u.transform.rotateTo(0, 0, 0), u.transform.scaleTo(1, -1, 1), u.transform.moveTo(0, this.rect.height, 0); (u.transform.colorTransform = r), s.render(); }), (n.prototype._drawAsDisplay = function (t, e, r, i, o, a) { void 0 === i && (i = ""), (i = i || dn.LAYER), n._renderer || this.createRenderer(); var s = n._root, u = n._rootNode, l = n._renderer, c = this.canUseMSAAInternaly, h = !t.isAsset(cu) && 2 === this._stage.context.glVersion && tu.ALLOW_FORCE_MSAA > 1 && !c, p = this; h || null === this._initalFillColor || (this.fillRect(this._rect, this._initalFillColor), (this._initalFillColor = null)); var d = i !== dn.LAYER || null === this._lastUsedFill, f = d || h; f && ((p = n.getTemp(this.width, this.height, this._stage, h)), null !== this._lastUsedFill ? ((l.disableClear = !1), (l.view.backgroundColor = this._lastUsedFill), (l.view.backgroundAlpha = ((this._lastUsedFill >>> 24) & 255) / 255)) : ((l.disableClear = !1), (l.view.backgroundColor = 0), (l.view.backgroundAlpha = 0))); var g = l.view.projection.transform, _ = g.matrix3D; if ((_.identity(), e)) { var m = _._rawData; (m[0] = e.a), (m[1] = e.b), (m[4] = e.c), (m[5] = e.d), (m[10] = 1), (m[12] = e.tx), (m[13] = e.ty); } _.appendScale(1, -1, 1), _.appendTranslation(0, this._rect.height, 1e3), _.invert(), (g.matrix3D = _), (l.antiAlias = (c ? this.antialiasQuality : p.antialiasQuality) || 0), (l.view.target = p), (l.view.projection.scale = 1e3 / this._rect.height), (l.view.projection.ratio = this._rect.width / this._rect.height), (l.view.x = -(p.width - this.width)), (l.view.y = -(p.height - this.height)), (l.view.width = this.width), (l.view.height = this.height); var y = u.addChildAt(t, 0); (y.transformDisabled = !0), (y.colorTransformDisabled = !1), (s.transform.colorTransform = r), (s.blendMode = n._mapSupportedBlendMode(i)), l.render(), (l.antiAlias = 0), (l.disableClear = !0), u.removeChildAt(0), f && (this._stage.filterManager.copyPixels( p, this, this._rect, Ih, d, i ), n.tryStoreImage(p, this._stage)); }), (n.prototype.reset = function () {}), (n.assetType = "[image SceneImage2D]"), n ); })(nn); Jr.registerAbstraction(rn, Eh); var xh = (function () { function t(t) { (this._pickerLookup = new Array()), (this.allowKeyInput = !0), (this._collisionIsEnabledButton = !1), (this._eventBubbling = !0), (this._allowFocusOnUnfocusable = !0), (this._cursorType = "auto"), (this._nullVector = new B()), (this._queuedEvents = new Array()), (this._mouseUp = new vu(vu.MOUSE_UP)), (this._mouseUpOutside = new vu(vu.MOUSE_UP_OUTSIDE)), (this._mouseClick = new vu(vu.CLICK)), (this._mouseOut = new vu(vu.MOUSE_OUT)), (this._dragOut = new vu(vu.DRAG_OUT)), (this._dragOver = new vu(vu.DRAG_OVER)), (this._mouseDown = new vu(vu.MOUSE_DOWN)), (this._mouseMove = new vu(vu.MOUSE_MOVE)), (this._mouseOver = new vu(vu.MOUSE_OVER)), (this._mouseWheel = new vu(vu.MOUSE_WHEEL)), (this._mouseDoubleClick = new vu(vu.DOUBLE_CLICK)), (this._rollOver = new vu(vu.ROLL_OVER)), (this._rollOut = new vu(vu.ROLL_OUT)), (this._dragMove = new vu(vu.DRAG_MOVE)), (this._dragStart = new vu(vu.DRAG_START)), (this._dragStop = new vu(vu.DRAG_STOP)), (this._useSoftkeyboard = !1), (this._isAVM1Dragging = !1), (this._isDown = !1), (this._stage = t), (this.onClick = this.onClick.bind(this)), (this.onDoubleClick = this.onDoubleClick.bind(this)), (this.onMouseDown = this.onMouseDown.bind(this)), (this.onMouseMove = this.onMouseMove.bind(this)), (this.onMouseUp = this.onMouseUp.bind(this)), (this.onMouseWheel = this.onMouseWheel.bind(this)), (this.onMouseOver = this.onMouseOver.bind(this)), (this.onMouseOut = this.onMouseOut.bind(this)), (this.onKeyDown = this.onKeyDown.bind(this)), (this.onKeyUp = this.onKeyUp.bind(this)), (this.buttonEnabledDirty = !1), (this._isTouch = "ontouchstart" in self || navigator.msMaxTouchPoints > 0), (this._showCursor = !0), (this._mouseDragging = !1); var e = this._stage.container; e.addEventListener("click", this.onClick), e.addEventListener("dblclick", this.onClick), e.addEventListener("touchstart", this.onMouseDown), e.addEventListener("mousedown", this.onMouseDown), window.addEventListener("touchmove", this.onMouseMove), window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("mouseup", this.onMouseUp), e.addEventListener("touchend", this.onMouseUp), e.addEventListener("touchend", this.onClick), e.addEventListener("mousewheel", this.onMouseWheel), e.addEventListener("mouseover", this.onMouseOver), e.addEventListener("mouseout", this.onMouseOut), window.addEventListener("keydown", this.onKeyDown), window.addEventListener("keyup", this.onKeyUp), window.addEventListener("contextmenu", function (t) { return t.preventDefault(); }); } return ( (t.prototype.startDragObject = function (t) { (this._isAVM1Dragging = !0), t && (this._mouseDragCollision = t); }), (t.prototype.stopDragObject = function () { this._isAVM1Dragging = !1; }), Object.defineProperty(t.prototype, "showCursor", { get: function () { return this._showCursor; }, set: function (t) { (this._showCursor = t), (this.cursorType = this._cursorType); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "cursorType", { get: function () { return this._cursorType; }, set: function (t) { (this._cursorType = t), (this._stage.container.style.cursor = this._showCursor ? t : "none"); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "eventBubbling", { get: function () { return this._eventBubbling; }, set: function (t) { this._eventBubbling = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "useSoftkeyboard", { get: function () { return this._useSoftkeyboard; }, set: function (t) { (this._useSoftkeyboard = t), t ? t && (window.removeEventListener("keydown", this.onKeyDown), window.removeEventListener("keyup", this.onKeyUp)) : (window.addEventListener("keydown", this.onKeyDown), window.addEventListener("keyup", this.onKeyUp)); }, enumerable: !0, configurable: !0, }), (t.prototype.dispose = function () { var t = this._stage.container; t.removeEventListener("click", this.onClick), t.removeEventListener("dblclick", this.onDoubleClick), t.removeEventListener("touchstart", this.onMouseDown), t.removeEventListener("mousedown", this.onMouseDown), window.removeEventListener("touchmove", this.onMouseMove), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), t.removeEventListener("touchend", this.onMouseUp), t.removeEventListener("touchend", this.onClick), t.removeEventListener("wheel", this.onMouseWheel), t.removeEventListener("mouseover", this.onMouseOver), t.removeEventListener("mouseout", this.onMouseOut), window.removeEventListener("keydown", this.onKeyDown), window.removeEventListener("keyup", this.onKeyUp), (this._stage = null), (this._mouseMoveEvent = null), (this._mouseUp = null), (this._mouseUpOutside = null), (this._mouseClick = null), (this._mouseOut = null), (this._dragOut = null), (this._dragOver = null), (this._mouseDown = null), (this._mouseMove = null), (this._mouseOver = null), (this._mouseWheel = null), (this._mouseDoubleClick = null), (this._dragMove = null), (this._dragStart = null), (this._dragStop = null); }), (t.clearInstance = function (t) { this._instancePool[t.id] && (this._instancePool[t.id].dispose(), delete this._instancePool[t.id]); }), (t.getInstance = function (e) { return ( this._instancePool[e.id] || (this._instancePool[e.id] = new t(e)) ); }), (t.prototype.setFocus = function (t) { this._focusContainer != t && (this._focusContainer && this._focusContainer.setFocus(!1, !1), (this._focusContainer = t), this._focusContainer && this._focusContainer.setFocus(!0, !1)); }), (t.prototype.getFocus = function () { return this._focusContainer; }), (t.prototype.dispatchEvent = function (t, e) { if (this._eventBubbling) for (; e; ) { if (t.commonAncestor && e == t.commonAncestor) return; e.isMouseDisabled() || (e.container.dispatchEvent(t), bu.execute_queue()), (e = t._iAllowedToPropagate ? e.parent : null); } else e && (e.container.dispatchEvent(t), bu.execute_queue()); }), (t.prototype.setupAndDispatchEvent = function (t, e, n, r) { void 0 === r && (r = null), e && ((t.delta = e.wheelDelta), (t.ctrlKey = e.ctrlKey), (t.altKey = e.altKey), (t.shiftKey = e.shiftKey)), (t = this.setUpEvent(t, n, r)), this.dispatchEvent(t, t.rootNode); }), (t.prototype.fireMouseEvents = function (t) { var e, n, r, i, o, a, s; if ((void 0 === t && (t = null), t)) s = t.getViewCollision(this._stage.screenX, this._stage.screenY); else if (this._updateDirty) for (var u = 0; u < this._pickerLookup.length; u++) (s && !this._pickerLookup[u].layeredView) || (s = this._pickerLookup[u].getViewCollision( this._stage.screenX, this._stage.screenY, !1, s )); if (t || this._updateDirty) { var l, c, h = this._queuedEvents.length; for (u = 0; u < h; ++u) if ( ((l = this._queuedEvents[u]), (c = null === (e = s) || void 0 === e ? void 0 : e.rootNode), this.setUpEvent(l, s), l.type == vu.MOUSE_DOWN) ) (this._mouseDragging = !0), this._eventBubbling || this._stage.dispatchEvent(l), this._isTouch && this.setupAndDispatchEvent( this._mouseOver, this._mouseMoveEvent, s ), (this._mouseDragCollision = s), c ? this.dispatchEvent(l, c) : this._eventBubbling && this._stage.dispatchEvent(l), (this._allowFocusOnUnfocusable || (null === (n = this._mouseDragCollision) || void 0 === n ? void 0 : n.rootNode.container.tabEnabled)) && (this._focusContainer && this._focusContainer.setFocus(!1, !0), (this._focusContainer = null === (i = null === (r = this._mouseDragCollision) || void 0 === r ? void 0 : r.rootNode) || void 0 === i ? void 0 : i.container), this._focusContainer && this._focusContainer.setFocus(!0, !0)), this._mouseDragCollision && this.setupAndDispatchEvent( this._dragStart, l, this._mouseDragCollision ); else if (l.type == vu.MOUSE_UP) { this._eventBubbling || this._stage.dispatchEvent(l); var p = null, d = null; this._isAVM1Dragging && this._mouseDragCollision ? ((d = this._mouseDragCollision.rootNode), (p = this._mouseDragCollision.entityNode)) : this._mouseDragging && this._mouseDragCollision && this._mouseDragCollision.rootNode != c ? (this._mouseDragCollision.rootNode.buttonEnabled && this.setupAndDispatchEvent( this._mouseOut, l, this._mouseDragCollision ), this._eventBubbling || this.setupAndDispatchEvent( this._mouseUpOutside, l, this._mouseDragCollision )) : this._mouseDragging && this._mouseDragCollision && this._mouseDragCollision.rootNode == c && ((d = this._mouseDragCollision.rootNode), (p = this._mouseDragCollision.entityNode)), this._mouseDragging && c && this.setupAndDispatchEvent(this._mouseOver, l, s), this._isTouch && p && this.setupAndDispatchEvent( this._mouseOut, this._mouseMoveEvent, this._mouseDragCollision ), d ? this.dispatchEvent(l, d) : this._eventBubbling && c ? this.dispatchEvent(l, c) : this._eventBubbling && this._stage.dispatchEvent(l), p && this.setupAndDispatchEvent( this._dragStop, l, this._mouseDragCollision ), (this._mouseDragCollision = null), (this._mouseDragging = !1), (this._isAVM1Dragging = !1); } else l.type == vu.MOUSE_MOVE ? (this._eventBubbling || this._stage.dispatchEvent(l), l.rootNode && this.dispatchEvent(l, l.rootNode), this._mouseDragCollision && this.setupAndDispatchEvent( this._dragMove, l, this._mouseDragCollision ), this._eventBubbling && this._stage.dispatchEvent(l)) : this.dispatchEvent(l, c); (this._queuedEvents.length = 0), (this._rollOut.commonAncestor = null), (this._rollOver.commonAncestor = null); var f = null === (o = s) || void 0 === o ? void 0 : o.rootNode, g = null === (a = this._prevCollision) || void 0 === a ? void 0 : a.rootNode; if (f != g) { if ( (g && (this._isTouch || this._mouseDragging ? this._mouseDragging && this._mouseDragCollision && this._mouseDragCollision.rootNode == g && this.setupAndDispatchEvent( this._dragOut, this._mouseMoveEvent, this._prevCollision ) : this.setupAndDispatchEvent( this._mouseOut, this._mouseMoveEvent, this._prevCollision )), !g && f && (this.setupAndDispatchEvent( this._rollOut, this._mouseMoveEvent, this._prevCollision ), this.setupAndDispatchEvent( this._rollOver, this._mouseMoveEvent, s )), g && !f && (this.setupAndDispatchEvent( this._rollOut, this._mouseMoveEvent, this._prevCollision ), this.setupAndDispatchEvent( this._rollOver, this._mouseMoveEvent, s )), g && f) ) { for (var _ = [], m = g; m && !m.container.isAVMScene; ) _.push(m), (m = m.parent); var y = null; for (m = f; m && !m.container.isAVMScene; ) { -1 == _.indexOf(m) ? (m = m.parent) : ((y = m), (m = null)); } y != g && this.setupAndDispatchEvent( this._rollOut, this._mouseMoveEvent, this._prevCollision, y ), y != f && this.setupAndDispatchEvent( this._rollOver, this._mouseMoveEvent, s, y ); } (this._collisionIsEnabledButton = !!f && f.buttonEnabled), f && (this._isTouch || this._mouseDragging ? this._mouseDragging && this._mouseDragCollision && this._mouseDragCollision.rootNode == f && this.setupAndDispatchEvent( this._dragOver, this._mouseMoveEvent, s ) : this.setupAndDispatchEvent( this._mouseOver, this._mouseMoveEvent, s )), (this._prevCollision = s); } else { var A = !!f && f.buttonEnabled; this._collisionIsEnabledButton != A && A && (this._isTouch ? this._mouseDragCollision && this._mouseDragCollision.rootNode == f && this.setupAndDispatchEvent( this._dragOver, this._mouseMoveEvent, s ) : this.setupAndDispatchEvent( this._mouseOver, this._mouseMoveEvent, s )), (this._collisionIsEnabledButton = A); } this._mouseDragging || (this.cursorType = f ? f.container.getMouseCursor() : "auto"), (this._updateDirty = !1); } }), (t.prototype.registerPicker = function (t) { this._pickerLookup.push(t); }), (t.prototype.unregisterPicker = function (t) { this._pickerLookup.splice(this._pickerLookup.indexOf(t), 1); }), (t.prototype.addEventsForSceneBinary = function (t, e) { var n = { clientX: null, clientY: null, touches: [], changedTouches: [], preventDefault: function () {}, }, r = new Float32Array(t), i = 0, o = 0; o++; var a = r[o++], s = r[o++], u = r[o++]; if (1 != s && 6 != s && 12 != s && 262 != s && 518 != s) { for (i = 0; i < a; i++) { ((l = {}).identifier = r[o++]), (l.clientX = r[o++]), (l.clientY = r[o++]), (n.touches[i] = l); } n.changedTouches[0] = n.touches[u]; } else { if (1 == a) ((l = {}).identifier = r[o++]), (l.clientX = r[o++]), (l.clientY = r[o++]), (n.clientX = l.clientX), (n.clientY = l.clientY); else for (i = 0; i < a; i++) { var l; ((l = {}).identifier = r[o++]), (l.clientX = r[o++]), (l.clientY = r[o++]), i != u ? (n.touches[0] = l) : ((n.clientX = l.clientX), (n.clientY = l.clientY)); } } 0 == s || 5 == s || 11 == s || 261 == s || 517 == s ? this.onMouseDown(n) : 1 == s || 6 == s || 12 == s || 262 == s || 518 == s ? this.onMouseUp(n) : 2 == s ? this.onMouseMove(n) : console.log("recieved unknown touch event-type: " + s); }), (t.prototype.fireEventsForSceneFromString = function (t, e) { var n = { clientX: null, clientY: null, preventDefault: function () {}, }, r = t.split(","), i = 0, o = 0, a = parseInt(r[o++]), s = parseInt(r[o++]), u = parseInt(r[o++]); if (((n.touches = []), (n.changedTouches = []), 1 != s && 6 != s)) { for (i = 0; i < a; i++) { ((l = {}).identifier = r[o++]), (l.clientX = r[o++]), (l.clientY = r[o++]), (n.touches[i] = l), (n.changedTouches[i] = l); } n.changedTouches[i] = n.touches[u]; } else for (i = 0; i < a; i++) { var l; if (i != u) ((l = {}).identifier = r[o++]), (l.clientX = r[o++]), (l.clientY = r[o++]), (n.touches[i] = l), (n.changedTouches[i] = l); else (n.clientX = r[o++]), (n.clientY = r[o++]), o++; } 0 == s ? this.onMouseDown(n) : 1 == s ? this.onMouseUp(n) : 2 == s ? this.onMouseMove(n) : 261 == s ? this.onMouseDown(n) : 6 == s && this.onMouseUp(n); }), (t.prototype.setUpEvent = function (t, e, n) { var r, i; return ( void 0 === n && (n = null), (t._iAllowedToImmediatlyPropagate = !0), (t._iAllowedToPropagate = !0), (t.screenX = this._stage.screenX), (t.screenY = this._stage.screenY), e ? ((t.entityNode = e.entityNode), (t.rootNode = e.rootNode), (t.traversable = e.traversable), (t.uv = e.uv), (t.position = null === (r = e.position) || void 0 === r ? void 0 : r.clone()), (t.normal = null === (i = e.normal) || void 0 === i ? void 0 : i.clone()), (t.elementIndex = e.elementIndex)) : ((t.entityNode = null), (t.rootNode = null), (t.traversable = null), (t.uv = null), (t.position = this._nullVector), (t.normal = this._nullVector), (t.elementIndex = 0)), (t.commonAncestor = n), t ); }), (t.prototype.queueDispatch = function (t, e) { (t.delta = e instanceof WheelEvent ? (-3 * e.deltaY) / 100 : 0), (t.ctrlKey = e.ctrlKey), (t.altKey = e.altKey), (t.shiftKey = e.shiftKey), (t.button = e instanceof MouseEvent ? e.button : 0), this._queuedEvents.push(t); }), (t.prototype.onKeyDown = function (e) { if ( (!t.inputRecorder || t.inputRecorder.recordEvent(e), this.allowKeyInput && (this._focusContainer || this._stage)) ) { var n = new Xc(Xc.KEYDOWN, e.key, e.code); (n.isShift = e.shiftKey), (n.isCTRL = e.ctrlKey), (n.isAlt = e.altKey), (n.keyCode = e.keyCode), this._focusContainer && this._focusContainer.dispatchEvent(n), this._stage && this._stage.dispatchEvent(n); } }), (t.prototype.onKeyUp = function (e) { if ( (!t.inputRecorder || t.inputRecorder.recordEvent(e), this.allowKeyInput && (this._focusContainer || this._stage)) ) { var n = new Xc(Xc.KEYUP, e.key, e.code); (n.isShift = e.shiftKey), (n.isCTRL = e.ctrlKey), (n.isAlt = e.altKey), (n.keyCode = e.keyCode), this._focusContainer && this._focusContainer.dispatchEvent(n), this._stage && this._stage.dispatchEvent(n); } }), (t.prototype.onMouseMove = function (e) { !t.inputRecorder || t.inputRecorder.recordEvent(e), (this._isTouch = "mousemove" != e.type), this.updateColliders(e), this.queueDispatch(this._mouseMove, (this._mouseMoveEvent = e)); }), (t.prototype.onMouseOut = function (e) { !t.inputRecorder || t.inputRecorder.recordEvent(e), this.updateColliders(e), this.queueDispatch(this._mouseOut, e); }), (t.prototype.onMouseOver = function (e) { !t.inputRecorder || t.inputRecorder.recordEvent(e), this.updateColliders(e), this.queueDispatch(this._mouseOver, e); }), (t.prototype.onClick = function (e) { !t.inputRecorder || t.inputRecorder.recordEvent(e), this.updateColliders(e), this.queueDispatch(this._mouseClick, e); }), (t.prototype.onDoubleClick = function (e) { !t.inputRecorder || t.inputRecorder.recordEvent(e), this.updateColliders(e), e instanceof MouseEvent && 6 & e.buttons && e.preventDefault(), this.queueDispatch(this._mouseDoubleClick, e); }), (t.prototype.onMouseDown = function (e) { if (((this._isTouch = "mousedown" !== e.type), !this._isDown)) { !t.inputRecorder || t.inputRecorder.recordEvent(e), (this._isDown = !0), this.updateColliders(e); var n = this._isTouch; e instanceof MouseEvent && 6 & e.buttons && (n = !0), n && (e.preventDefault(), this._stage.container.focus()), this.queueDispatch(this._mouseDown, e); } }), (t.prototype.onMouseUp = function (e) { if (this._isDown) { !t.inputRecorder || t.inputRecorder.recordEvent(e), (this._isDown = !1), this.updateColliders(e); var n = this._isTouch; e instanceof MouseEvent && 1 === e.button && (n = !0), n && (e.preventDefault(), this._stage.container.focus()), this.queueDispatch(this._mouseUp, e); } }), (t.prototype.onMouseWheel = function (e) { !t.inputRecorder || t.inputRecorder.recordEvent(e), this.updateColliders(e), this.queueDispatch(this._mouseWheel, e); }), (t.prototype.updateColliders = function (t) { this._stage.interactionHandler(t), (this._updateDirty = !0); }), (t._instancePool = {}), t ); })(); (ds.materialClass = Pc), (ds.textureClass = mo), console.debug("AwayJS - Scene - 0.13.226"); var wh = Function("return this")(); var Sh = { pow2: function (t) { return t === (0 | t) ? (t < 0 ? 1 / (1 << -t) : 1 << t) : Math.pow(2, t); }, clamp: function (t, e, n) { return Math.max(e, Math.min(n, t)); }, roundHalfEven: function (t) { if (0.5 === Math.abs(t % 1)) { var e = Math.floor(t); return e % 2 == 0 ? e : Math.ceil(t); } return Math.round(t); }, altTieBreakRound: function (t, e) { return 0.5 !== Math.abs(t % 1) || e ? Math.round(t) : 0 | t; }, epsilonEquals: function (t, e) { return Math.abs(t - e) < 1e-7; }, }; function Dh(t) { return "string" == typeof t ? '"' + t + '"' : "number" == typeof t || "boolean" == typeof t ? String(t) : t instanceof Array ? "[] " + t.length : typeof t; } function Th(t) { for ( var e = new Uint8Array(4 * t.length), n = 0, r = 0, i = t.length; r < i; r++ ) { var o = t.charCodeAt(r); if (o <= 127) e[n++] = o; else { if (55296 <= o && o <= 56319) { var a = t.charCodeAt(r + 1); 56320 <= a && a <= 57343 && ((o = ((1023 & o) << 10) + (1023 & a) + 65536), ++r); } 0 != (4292870144 & o) ? ((e[n++] = 248 | ((o >>> 24) & 3)), (e[n++] = 128 | ((o >>> 18) & 63)), (e[n++] = 128 | ((o >>> 12) & 63)), (e[n++] = 128 | ((o >>> 6) & 63)), (e[n++] = 128 | (63 & o))) : 0 != (4294901760 & o) ? ((e[n++] = 240 | ((o >>> 18) & 7)), (e[n++] = 128 | ((o >>> 12) & 63)), (e[n++] = 128 | ((o >>> 6) & 63)), (e[n++] = 128 | (63 & o))) : 0 != (4294965248 & o) ? ((e[n++] = 224 | ((o >>> 12) & 15)), (e[n++] = 128 | ((o >>> 6) & 63)), (e[n++] = 128 | (63 & o))) : ((e[n++] = 192 | ((o >>> 6) & 31)), (e[n++] = 128 | (63 & o))); } } return e.slice(0, n); } function Ph(t) { for (var e = 0, n = ""; e < t.length; ) { var r = 255 & t[e++]; if (r <= 127) n += String.fromCharCode(r); else { var i = 192, o = 5; do { if ((r & ((i >> 1) | 128)) === i) break; (i = (i >> 1) | 128), --o; } while (o >= 0); if (o <= 0) { n += String.fromCharCode(r); continue; } for (var a = r & ((1 << o) - 1), s = !1, u = 5; u >= o; --u) { var l = t[e++]; if (128 != (192 & l)) { s = !0; break; } a = (a << 6) | (63 & l); } if (s) { for (var c = e - (7 - u); c < e; ++c) n += String.fromCharCode(255 & t[c]); continue; } n += a >= 65536 ? String.fromCharCode( (((a - 65536) >> 10) & 1023) | 55296, (1023 & a) | 56320 ) : String.fromCharCode(a); } } return n; } var Oh = self.TextEncoder ? new self.TextEncoder() : null, Bh = self.TextDecoder ? new self.TextDecoder() : null; function Mh(t) { for (var e = "", n = 0; n < t.length; n += 5120) { var r = Math.min(t.length - n, 5120); e += String.fromCharCode.apply(null, t.subarray(n, n + r)); } return e; } var Lh = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$_"; function Nh(t) { return t >= 65 && t <= 90 ? t - 65 : t >= 97 && t <= 122 ? t - 71 : t >= 48 && t <= 57 ? t + 4 : 36 === t ? 62 : 95 === t ? 63 : void 0; } var Rh = new Array(3), Fh = new Array(4), kh = new Array(9); var Uh = { repeatString: function (t, e) { for (var n = "", r = 0; r < e; r++) n += t; return n; }, memorySizeToString: function (t) { var e = 1024, n = e * e; return (t |= 0) < e ? t + " B" : t < n ? (t / e).toFixed(2) + "KB" : (t / n).toFixed(2) + "MB"; }, toSafeString: Dh, toSafeArrayString: function (t) { for (var e = [], n = 0; n < t.length; n++) e.push(Dh(t[n])); return e.join(", "); }, utf8decode: function (t) { if (!Oh) return Th(t); try { return Oh.encode(t); } catch (e) { return Th(t); } }, utf8encode: function (t) { if (!Bh) return Ph(t); try { return Bh.decode(t); } catch (e) { return Ph(t); } }, base64EncodeBytes: function (t) { return self.btoa(Mh(t)); }, base64DecodeMap: [ 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, ], base64DecodeMapOffset: 43, base64EOF: 61, decodeRestrictedBase64ToBytes: function (t) { for ( var e = window.atob(t), n = e.length, r = new Uint8Array(n), i = 0; i < n; i++ ) r[i] = e.charCodeAt(i); return r; }, escapeString: function (t) { return ( void 0 !== t && ((t = t.replace(/[^\w$]/gi, "$")), /^\d/.test(t) && (t = "$" + t)), t ); }, fromCharCodeArray: Mh, variableLengthEncodeInt32: function (t) { for ( var e = Lh, n = 32 - Math.clz32(t), r = Math.ceil(n / 6), i = e[r], o = r - 1; o >= 0; o-- ) { i += e[(t >> (6 * o)) & 63]; } return i; }, toEncoding: function (t) { return Lh[t]; }, fromEncoding: Nh, variableLengthDecodeInt32: function (t) { for (var e = Nh(t.charCodeAt(0)), n = 0, r = 0; r < e; r++) { var i = 6 * (e - r - 1); n |= Nh(t.charCodeAt(1 + r)) << i; } return n; }, trimMiddle: function (t, e) { if (t.length <= e) return t; var n = e >> 1, r = e - n - 1; return t.substr(0, n) + "…" + t.substr(t.length - r, r); }, multiple: function (t, e) { for (var n = "", r = 0; r < e; r++) n += t; return n; }, indexOfAny: function (t, e, n) { for (var r = t.length, i = 0; i < e.length; i++) { var o = t.indexOf(e[i], n); o >= 0 && (r = Math.min(r, o)); } return r === t.length ? -1 : r; }, _concat3array: Rh, _concat4array: Fh, _concat9array: kh, concat3: function (t, e, n) { return (Rh[0] = t), (Rh[1] = e), (Rh[2] = n), Rh.join(""); }, concat4: function (t, e, n, r) { return (Fh[0] = t), (Fh[1] = e), (Fh[2] = n), (Fh[3] = r), Fh.join(""); }, concat9: function (t, e, n, r, i, o, a, s, u) { return ( (kh[0] = t), (kh[1] = e), (kh[2] = n), (kh[3] = r), (kh[4] = i), (kh[5] = o), (kh[6] = a), (kh[7] = s), (kh[8] = u), kh.join("") ); }, }; function jh(t) { return (function (t) { return t / 256; })( (function (t) { return ((256 * t) << 16) >> 16; })(t) ); } function Vh(t) { return (t << 16) >> 16; } Math.imul || (Math.imul = function (t, e) { var n = 65535 & t, r = 65535 & e; return ( (n * r + (((((t >>> 16) & 65535) * r + n * ((e >>> 16) & 65535)) << 16) >>> 0)) | 0 ); }), Math.clz32 || (Math.clz32 = function (t) { return ( (t |= t >> 1), (t |= t >> 2), (t |= t >> 4), (t |= t >> 8), 32 - (function (t) { return ( (16843009 * (((t = (858993459 & (t -= (t >> 1) & 1431655765)) + ((t >> 2) & 858993459)) + (t >> 4)) & 252645135)) >> 24 ); })((t |= t >> 16)) ); }); var Qh = "undefined" != typeof window && "document" in window && "plugins" in window.document; "undefined" != typeof navigator && navigator.userAgent.indexOf("Firefox"), wh.performance || (wh.performance = {}), wh.performance.now || (wh.performance.now = function () { return Date.now(); }), performance.now(); var Gh = 429496729; function zh(t) { return "string" == typeof t; } function Hh(t) { return "number" == typeof t; } function Xh(t) { return "object" == typeof t || "function" == typeof t; } function Yh(t) { return +t; } function qh(t) { if ("number" == typeof t) return !0; if ("string" == typeof t) { var e = t.charCodeAt(0); return ( !( (65 <= e && e <= 90) || (97 <= e && e <= 122) || 36 === e || 95 === e ) && (Kh(t) || (function (t) { return String(Number(t)) === t; })(t)) ); } return !1; } function Kh(t) { var e = 0; if ("number" == typeof t) return (t === (e = 0 | t) && e >= 0) || t >>> 0 === t; if ("string" != typeof t) return !1; var n = t.length; if (0 === n) return !1; if ("0" === t) return !0; if (n > 10) return !1; var r = 0; if ((e = t.charCodeAt(r++) - 48) < 1 || e > 9) return !1; for (var i = 0, o = 0; r < n; ) { if ((o = t.charCodeAt(r++) - 48) < 0 || o > 9) return !1; (i = e), (e = 10 * e + o); } return i < Gh || (i === Gh && o <= 5); } function Wh(t) { return null == t; } !(function () { if ("function" != typeof wh.WeakMap) { var t = 0; (e.prototype = { has: function (t) { return t.hasOwnProperty(this.id); }, get: function (t, e) { return t.hasOwnProperty(this.id) ? t[this.id] : e; }, set: function (t, e) { Object.defineProperty(t, this.id, { value: e, enumerable: !1, configurable: !0, }); }, delete: function (t) { delete t[this.id]; }, }), (wh.WeakMap = e); } function e() { this.id = "$weakmap" + t++; } })(); var Jh, $h = (function () { function t(e, n) { void 0 === e && (e = !1), (this._tab = " "), (this._padding = ""), (this._suppressOutput = e), (this._out = n || t._consoleOut), (this._outNoNewline = n || t._consoleOutNoNewline); } return ( Object.defineProperty(t.prototype, "suppressOutput", { get: function () { return this._suppressOutput; }, set: function (t) { this._suppressOutput = t; }, enumerable: !0, configurable: !0, }), (t.prototype.write = function (t, e) { void 0 === t && (t = ""), void 0 === e && (e = !1), this._suppressOutput || this._outNoNewline((e ? this._padding : "") + t); }), (t.prototype.writeLn = function (t) { void 0 === t && (t = ""), this._suppressOutput || this._out(this._padding + t); }), (t.prototype.writeObject = function (t, e) { void 0 === t && (t = ""), this._suppressOutput || this._out(this._padding + t, e); }), (t.prototype.writeTimeLn = function (t) { void 0 === t && (t = ""), this._suppressOutput || this._out(this._padding + performance.now().toFixed(2) + " " + t); }), (t.prototype.writeComment = function (t) { var e = (t || "").split("\n"); if (1 === e.length) this.writeLn("// " + e[0]); else { this.writeLn("/**"); for (var n = 0; n < e.length; n++) this.writeLn(" * " + e[n]); this.writeLn(" */"); } }), (t.prototype.writeLns = function (t) { for (var e = (t || "").split("\n"), n = 0; n < e.length; n++) this.writeLn(e[n]); }), (t.prototype.errorLn = function (e) { 1 & t.logLevel && this.boldRedLn(e); }), (t.prototype.warnLn = function (e) { 2 & t.logLevel && this.yellowLn(e); }), (t.prototype.debugLn = function (e) { 4 & t.logLevel && this.purpleLn(e); }), (t.prototype.logLn = function (e) { 8 & t.logLevel && this.writeLn(e); }), (t.prototype.infoLn = function (e) { 16 & t.logLevel && this.writeLn(e); }), (t.prototype.yellowLn = function (e) { this.colorLn(t.YELLOW, e); }), (t.prototype.greenLn = function (e) { this.colorLn(t.GREEN, e); }), (t.prototype.boldRedLn = function (e) { this.colorLn(t.BOLD_RED, e); }), (t.prototype.redLn = function (e) { this.colorLn(t.RED, e); }), (t.prototype.purpleLn = function (e) { this.colorLn(t.PURPLE, e); }), (t.prototype.colorLn = function (e, n) { this._suppressOutput || (Qh ? this._out(this._padding + n) : this._out(this._padding + e + n + t.ENDC)); }), (t.prototype.redLns = function (e) { this.colorLns(t.RED, e); }), (t.prototype.colorLns = function (t, e) { for (var n = (e || "").split("\n"), r = 0; r < n.length; r++) this.colorLn(t, n[r]); }), (t.prototype.enter = function (t) { this._suppressOutput || this._out(this._padding + t), this.indent(); }), (t.prototype.leaveAndEnter = function (t) { this.leave(t), this.indent(); }), (t.prototype.leave = function (t) { this.outdent(), !this._suppressOutput && t && this._out(this._padding + t); }), (t.prototype.indent = function () { this._padding += this._tab; }), (t.prototype.outdent = function () { this._padding.length > 0 && (this._padding = this._padding.substring( 0, this._padding.length - this._tab.length )); }), (t.prototype.writeArray = function (t, e, n) { void 0 === e && (e = !1), void 0 === n && (n = !1), (e = e || !1); for (var r = 0, i = t.length; r < i; r++) { var o = ""; e && ((o = null === t[r] ? "null" : void 0 === t[r] ? "undefined" : t[r].constructor.name), (o += " ")); var a = n ? "" : ("" + r).padRight(" ", 4); this.writeLn(a + o + t[r]); } }), (t.PURPLE = "33[94m"), (t.YELLOW = "33[93m"), (t.GREEN = "33[92m"), (t.RED = "33[91m"), (t.BOLD_RED = "33[1;91m"), (t.ENDC = "33[0m"), (t.logLevel = 31), (t._consoleOut = console.log.bind(console)), (t._consoleOutNoNewline = console.log.bind(console)), t ); })(); !(function (t) { (t[(t.None = 0)] = "None"), (t[(t.PremultipliedAlphaARGB = 1)] = "PremultipliedAlphaARGB"), (t[(t.StraightAlphaARGB = 2)] = "StraightAlphaARGB"), (t[(t.StraightAlphaRGBA = 3)] = "StraightAlphaRGBA"), (t[(t.JPEG = 4)] = "JPEG"), (t[(t.PNG = 5)] = "PNG"), (t[(t.GIF = 6)] = "GIF"); })(Jh || (Jh = {})); var Zh = (function () { function t() { this.promise = new Promise( function (t, e) { (this.resolve = t), (this.reject = e); }.bind(this) ); } return ( (t.prototype.then = function (t, e) { return this.promise.then(t, e); }), t ); })(); "undefined" != typeof exports && (exports.Shumway = { version: "", build: "" }), (function () { function t(t, e, n) { t[e] || Object.defineProperty(t, e, { value: n, writable: !0, configurable: !0, enumerable: !1, }); } t(String.prototype, "padRight", function (t, e) { var n, r = this, i = ((n = r), n.replace(/\033\[[0-9]*m/g, "")).length; if (!t || i >= e) return r; for (var o = (e - i) / t.length, a = 0; a < o; a++) r += t; return r; }), t(String.prototype, "padLeft", function (t, e) { var n = this, r = n.length; if (!t || r >= e) return n; for (var i = (e - r) / t.length, o = 0; o < i; o++) n = t + n; return n; }), t(String.prototype, "trim", function () { return this.replace(/^\s+|\s+$/g, ""); }), t(String.prototype, "endsWith", function (t) { return -1 !== this.indexOf(t, this.length - t.length); }), t(Array.prototype, "replace", function (t, e) { if (t === e) return 0; for (var n = 0, r = 0; r < this.length; r++) this[r] === t && ((this[r] = e), n++); return n; }); })(); var tp = (function () { function t(t, e) { void 0 === e && (e = null), (this.open = !1), (this.name = t), (this.settings = e || {}), (this.options = []); } return ( (t.isOptionSet = function (e) { return ( e instanceof t || (!("object" != typeof e || null === e || e instanceof ep) && "options" in e && "name" in e && "settings" in e) ); }), (t.prototype.register = function (e) { if (t.isOptionSet(e)) for (var n = 0; n < this.options.length; n++) { var r = this.options[n]; if (t.isOptionSet(r) && r.name === e.name) return r; } if ((this.options.push(e), this.settings)) if (t.isOptionSet(e)) { var i = this.settings[e.name]; Xh(i) && ((e.settings = i.settings), (e.open = i.open)); } else if (void 0 !== this.settings[e.longName]) switch (e.type) { case "boolean": e.value = !!this.settings[e.longName]; break; case "number": e.value = +this.settings[e.longName]; break; default: e.value = this.settings[e.longName]; } return e; }), (t.prototype.trace = function (t) { t.enter(this.name + " {"), this.options.forEach(function (e) { e.trace(t); }), t.leave("}"); }), (t.prototype.getSettings = function () { var e = {}; return ( this.options.forEach(function (n) { t.isOptionSet(n) ? (e[n.name] = { settings: n.getSettings(), open: n.open }) : (e[n.longName] = n.value); }), e ); }), (t.prototype.setSettings = function (e) { e && this.options.forEach(function (n) { t.isOptionSet(n) ? n.name in e && n.setSettings(e[n.name].settings) : n.longName in e && (n.value = e[n.longName]); }); }), t ); })(), ep = (function () { function t(t, e, n, r, i, o) { void 0 === o && (o = null), (this.longName = e), (this.shortName = t), (this.type = n), (this.defaultValue = r), (this.value = r), (this.description = i), (this.config = o); } return ( (t.prototype.parse = function (t) { this.value = t; }), (t.prototype.trace = function (t) { t.writeLn( ("-" + this.shortName + "|--" + this.longName).padRight(" ", 30) + " = " + this.type + " " + this.value + " [" + this.defaultValue + "] (" + this.description + ")" ); }), t ); })(), np = new tp("Shumway Options"); np.register(new tp("Logging Options")).register( new ep("wo", "warnOnce", "boolean", !0, "Omit Repeated Warnings") ); var rp = !0, ip = (function () { function t() {} return ( (t.release = rp), (t.assert = up), (t.error = sp), (t.assertUnreachable = lp), (t.assertNotImplemented = cp), (t.warning = pp), (t.notImplemented = op), (t.dummyConstructor = fp), (t.warnCounts = dp), (t.abstractMethod = gp), (t.somewhatImplemented = ap), (t.unexpected = _p), (t.unexpectedCase = mp), t ); })(); function op(t) {} function ap(t) {} function sp(t) { throw (console.error(t), new Error(t)); } function up(t, e) { if ((void 0 === e && (e = "assertion failed"), "" === t && (t = !0), !t)) { if ("undefined" != typeof console && "assert" in console) throw (console.assert(!1, e), new Error(e)); sp(e.toString()); } } function lp(t) { var e = new Error().stack.split("\n")[1]; throw new Error("Reached unreachable location " + e + t); } function cp(t, e) { t || sp("notImplemented: " + e); } var hp = Object.create(null); function pp(t, e, n) {} function dp() { var t = []; for (var e in hp) t.push({ key: e, count: hp[e] }); return ( t.sort(function (t, e) { return e.count - t.count; }), t.reduce(function (t, e) { return t + "\n" + e.count + "\t" + e.key; }, "") ); } function fp(t) {} function gp(t) {} function _p(t) { up(!1, "Unexpected: " + t); } function mp(t) { up(!1, "Unexpected Case: " + t); } function yp(t, e) { var n = e.name; if ((delete e.name, !e || !n)) throw new Error("Method name should not be empty"); var r = (window._AWAY_DEBUG_ = window._AWAY_DEBUG_ || {}); r.hasOwnProperty(n) && console.warn("Overrides existed debug method definition: " + n), Object.assign(t, e), (r[n] = t); } var Ap = [5512, 11025, 22050, 44100], vp = new Uint8Array([ 82, 73, 70, 70, 0, 0, 0, 0, 87, 65, 86, 69, 102, 109, 116, 32, 16, 0, 0, 0, 1, 0, 2, 0, 68, 172, 0, 0, 16, 177, 2, 0, 4, 0, 16, 0, 100, 97, 116, 97, 0, 0, 0, 0, ]); function bp(t, e, n, r, i) { var o = r >> 3, a = n * e * o, s = n * o, u = t.length + (1 & t.length), l = new ArrayBuffer(vp.length + u), c = new Uint8Array(l); if ((c.set(vp), i)) for (var h = 0, p = vp.length; h < t.length; h += 2, p += 2) (c[p] = t[h + 1]), (c[p + 1] = t[h]); else c.set(t, vp.length); var d = new DataView(l); return ( d.setUint32(4, u + 36, !0), d.setUint16(22, n, !0), d.setUint32(24, e, !0), d.setUint32(28, a, !0), d.setUint16(32, s, !0), d.setUint16(34, r, !0), d.setUint32(40, u, !0), { data: c, mimeType: "audio/wav" } ); } function Cp(t) { var e, n, r = 1 == t.soundType ? 2 : 1, i = t.samplesCount, o = Ap[t.soundRate], a = t.soundData; switch (t.soundFormat) { case 0: if (((e = new Float32Array(i * r)), 1 == t.soundSize)) { for (var s = 0, u = 0; s < e.length; s++, u += 2) e[s] = ((a[u] << 24) | (a[u + 1] << 16)) / 2147483648; n = bp(a, o, r, 16, !0); } else { for (s = 0; s < e.length; s++) e[s] = (a[s] - 128) / 128; n = bp(a, o, r, 8, !1); } break; case 3: if (((e = new Float32Array(i * r)), 1 == t.soundSize)) { for (s = 0, u = 0; s < e.length; s++, u += 2) e[s] = ((a[u + 1] << 24) | (a[u] << 16)) / 2147483648; n = bp(a, o, r, 16, !1); } else { for (s = 0; s < e.length; s++) e[s] = (a[s] - 128) / 128; n = bp(a, o, r, 8, !1); } break; case 2: n = { seek: a[0] | (a[1] << 8), data: new Uint8Array(a.subarray(2)), mimeType: "audio/mpeg", }; break; case 1: var l = new Int16Array(i * r); !(function (t, e, n) { function r(e) { for (; a < e; ) (o = (o << 8) | t[i++]), (a += 8); return (o >>> (a -= e)) & ((1 << e) - 1); } var i = 0, o = 0, a = 0, s = 0, u = r(2), l = Ip[u]; for (; s < e.length; ) { var c, h, p = (e[s++] = (r(16) << 16) >> 16), d = r(6); n > 1 && ((c = e[s++] = (r(16) << 16) >> 16), (h = r(6))); for (var f = 1 << (u + 1), g = 0; g < 4095; g++) { for ( var _ = r(u + 2), m = Ep[d], y = 0, A = f >> 1; A; A >>= 1, m >>= 1 ) _ & A && (y += m); if ( ((p += (_ & f ? -1 : 1) * (y + m)), (e[s++] = p = p < -32768 ? -32768 : p > 32767 ? 32767 : p), (d = (d += l[_ & ~f]) < 0 ? 0 : d > 88 ? 88 : d), n > 1) ) { (_ = r(u + 2)), (m = Ep[h]), (y = 0); for (A = f >> 1; A; A >>= 1, m >>= 1) _ & A && (y += m); (c += (_ & f ? -1 : 1) * (y + m)), (e[s++] = c = c < -32768 ? -32768 : c > 32767 ? 32767 : c), (h = (h += l[_ & ~f]) < 0 ? 0 : h > 88 ? 88 : h); } } } })(a, l, r), (e = new Float32Array(i * r)); for (s = 0; s < e.length; s++) e[s] = l[s] / 32768; n = bp( new Uint8Array(l.buffer), o, r, 16, !new Uint8Array(new Uint16Array([1]).buffer)[0] ); } var c = { type: "sound", id: t.id, sampleRate: o, samplesCount: i, channels: r, pcm: e, packaged: null, }; return n && (c.packaged = n), c; } var Ip = [ [-1, 2], [-1, -1, 2, 4], [-1, -1, -1, -1, 2, 4, 6, 8], [-1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16], ], Ep = [ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767, ]; var xp = 0, wp = (function () { function t(t, e, n, r) { (this.streamId = xp++), (this.samplesCount = t), (this.sampleRate = e), (this.channels = n), (this.streamSize = r), (this.format = null), (this.currentSample = 0), (this.allChunks = []); } return ( (t.FromTag = function (e) { var n = 1 == e.streamType ? 2 : 1, r = new t(e.samplesCount, Ap[e.streamRate], n, e.streamSize); switch (e.streamCompression) { case 0: case 3: (r.format = "wave"), 1 == e.soundSize ? (r.decode = 0 === e.streamCompression ? Dp : Tp) : (r.decode = Sp); break; case 2: (r.format = "mp3"), (r.decode = Pp); break; default: return null; } return r; }), t ); })(); function Sp(t) { for (var e = new Float32Array(t.length), n = 0; n < e.length; n++) e[n] = (t[n] - 128) / 128; return ( (this.currentSample += e.length / this.channels), { streamId: this.streamId, samplesCount: e.length / this.channels, pcm: e, data: t, seek: 0, } ); } function Dp(t) { for ( var e = new Float32Array(t.length / 2), n = 0, r = 0; n < e.length; n++, r += 2 ) e[n] = ((t[r] << 24) | (t[r + 1] << 16)) / 2147483648; return ( (this.currentSample += e.length / this.channels), { streamId: this.streamId, samplesCount: e.length / this.channels, pcm: e, data: t, seek: 0, } ); } function Tp(t) { for ( var e = new Float32Array(t.length / 2), n = 0, r = 0; n < e.length; n++, r += 2 ) e[n] = ((t[r + 1] << 24) | (t[r] << 16)) / 2147483648; return ( (this.currentSample += e.length / this.channels), { streamId: this.streamId, samplesCount: e.length / this.channels, pcm: e, data: t, seek: 0, } ); } function Pp(t) { var e = (t[1] << 8) | t[0], n = (t[3] << 8) | t[2]; return ( (this.currentSample += e), { streamId: this.streamId, samplesCount: e, data: new Uint8Array(t.subarray(4)), seek: n, } ); } var Op, Bp = (function () { function t(t) { (this._byteLength = 0), (this._sound = null), (this._frameData = []), (this._data = t), (this._position = 0); } return ( Object.defineProperty(t.prototype, "byteLength", { get: function () { return this._byteLength; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "isComplete", { get: function () { return this._byteLength > 0; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "currentTime", { get: function () { return this._sound.currentTime; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "sound", { get: function () { return this._sound; }, enumerable: !0, configurable: !0, }), (t.prototype.playFrom = function (t) { this.stop(), this._sound.play(t); }), (t.prototype.stop = function () { this._sound && this._sound.stop(); }), Object.defineProperty(t.prototype, "paused", { get: function () { return !1; }, set: function (t) {}, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "isPlaying", { get: function () { return this._sound.isPlaying; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "isReady", { get: function () { return !!this._sound; }, enumerable: !0, configurable: !0, }), (t.prototype.queueData = function (t) { t.pcm && (this._frameData.push(t), (this._byteLength += t.data.length)); }), (t.prototype.finish = function () { for ( var t = new Int8Array(this._byteLength), e = 0; e < this._frameData.length; e++ ) t.set(this._frameData[e].data, this._position), (this._position += this._frameData[e].data.length); var n = bp( t, this._data.sampleRate, this._data.channels, this._data.streamSize, !1 ), r = new E(new x(n.data.buffer)); this._sound = r; }), t ); })(), Mp = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.queueData = function (t) { t.data && (this._frameData.push(t), (this._byteLength += t.data.length)); }), (n.prototype.finish = function () { if (!this._byteLength) throw "Can't finish empty stream!"; for ( var t = new Uint8Array(this._byteLength), e = 0; e < this._frameData.length; e++ ) t.set(this._frameData[e].data, this._position), (this._position += this._frameData[e].data.length); var n = new E(new x(t.buffer)); this._sound = n; }), n ); })(Bp), Lp = (function () { function t(t) { (this._stopped = !1), (this.decode = t.decode.bind(t)), (this.data = { sampleRate: t.sampleRate, channels: t.channels, streamSize: t.streamSize, }), (this.seekIndex = []), (this.position = 0), (this.isMP3 = "mp3" === t.format), (this.soundStreamAdapter = this.isMP3 ? new Mp(this.data) : new Bp(this.data)); } return ( (t.prototype.appendBlock = function (t, e) { var n = this.decode(e), r = this.position; (this.seekIndex[t] = r + n.seek), (this.position = r + n.samplesCount), this.soundStreamAdapter.queueData(n); }), Object.defineProperty(t.prototype, "stopped", { get: function () { return this._stopped; }, set: function (t) { this._stopped = t; }, enumerable: !0, configurable: !0, }), (t.prototype.stop = function () { this.soundStreamAdapter.stop(); }), (t.prototype.playFrame = function (e) { if (this._stopped || isNaN(this.seekIndex[e])) return 0; if (!this.soundStreamAdapter.isComplete) return 0; this.finalized || ((this.finalized = !0), this.soundStreamAdapter.finish()), (this.isPlaying = !0); var n = this.data, r = this.seekIndex[e] / n.channels / n.sampleRate, i = this.soundStreamAdapter.currentTime; this.isMP3 && (r *= n.channels), Np.addActiveSound(this.soundStreamAdapter.sound), this.soundStreamAdapter.isPlaying || this.soundStreamAdapter.playFrom(r); var o = (1e3 * (i - r)) / (1e3 / t.frameRate); return (o = i - r < 0 ? Math.ceil(o) : Math.floor(o)); }), (t.frameRate = 25), t ); })(), Np = (function () { function t() { (this.lastFrameNum = -2), (this._soundStreams = []), (this._frameToSoundStream = {}); } return ( (t.addActiveSound = function (e) { t.activeSounds[e.id] || (t.activeSounds[e.id] = {}), (t.activeSounds[e.id].active = !0), (t.activeSounds[e.id].sound = e); }), (t.enterFrame = function () { for (var e in t.activeSounds) { t.activeSounds[e].active = !1; } }), (t.exitFrame = function () { for (var e in t.activeSounds) { var n = t.activeSounds[e]; n.active || (n.sound.stop(), delete t.activeSounds[e]); } }), (t.prototype.initSoundStream = function (t) { this.soundStreamHead = t; }), (t.prototype.addSoundStreamBlock = function (t, e) { this.soundStreamHead && ((0 == this._soundStreams.length || t - this.lastFrameNum > 1) && this._soundStreams.push(new Lp(this.soundStreamHead)), (this.lastFrameNum = t), this._soundStreams[this._soundStreams.length - 1].appendBlock(t, e), (this._frameToSoundStream[t] = this._soundStreams[this._soundStreams.length - 1])); }), (t.prototype.stopStream = function (t) { this._frameToSoundStream[t] && (this._frameToSoundStream[t].stopped = !0); }), (t.prototype.resetStreamStopped = function () { for (var t = 0; t < this._soundStreams.length; t++) this._soundStreams[t].stopped = !1; }), (t.prototype.syncSounds = function (t, e, n) { return e && n && this._frameToSoundStream[t] && !this._frameToSoundStream[t].stopped ? this._frameToSoundStream[t].playFrame(t) : 0; }), (t.activeSounds = {}), t ); })(), Rp = (function () { function t() {} return ( (t.EXACT_FIT = "EXACT_FIT"), (t.NO_BORDER = "noBorder"), (t.NO_SCALE = "noScale"), (t.SHOW_ALL = "showAll"), t ); })(), Fp = (function () { function t() {} return ( (t.BOTTOM = "B"), (t.BOTTOM_LEFT = "BL"), (t.BOTTOM_RIGHT = "BR"), (t.LEFT = "L"), (t.RIGHT = "R"), (t.TOP = "T"), (t.TOP_LEFT = "TL"), (t.TOP_RIGHT = "TR"), t ); })(), kp = !1; function Up(t) { kp || ((kp = !0), alert("Can not connect to Server. Is Server.js running ?")); } !(function (t) { (t.TESTING = "TESTING"), (t.RECORDING = "RECORDING"); })(Op || (Op = {})); for ( var jp = (function () { function t(t, e) { var n = this; (this.frameIdx = 0), (this.snapshotCnt = 0), (this.snapShotsUploaded = 0), (this.config = t), (this._avmStage = e), (this.frameIdx = 0), (this.events = {}), (this.reportedSWFInfos = !1), (this.frames = [{ messages: [], frameIdx: this.frameIdx }]), (this._finished = !1), (this.snapshotCnt = 0), this.config.recordtest && (xh.inputRecorder = this), window.addEventListener("keydown", function (t) { t.ctrlKey && 69 == t.keyCode && n.finishTest(); }); } return ( (t.prototype.addMessage = function (t) { this._finished || (this.frames[this.frames.length - 1].messages.push(t), this.checkIfFinished()); }), (t.prototype.setSWF = function (t) { this.swfInfo = { frameRate: t.frameRate, swfVersion: t.swfVersion, asVersion: t.useAVM1 ? 2 : 3, width: t.bounds.width / 20, height: t.bounds.height / 20, }; }), (t.prototype.recordEvent = function (t) { if ( (this.config.settings.snapShotOnMouseDown && "mousedown" == t.type && this.takeSnapshot(), this.config.settings.snapShotOnMouseUP && "mouseup" == t.type && this.takeSnapshot(), this.config.recordtest && this.config.settings.recordInput) ) { this.events[this.frameIdx] || (this.events[this.frameIdx] = []); var e = { type: t.type, screenX: t.screenX, screenY: t.screenY, clientX: t.clientX, clientY: t.clientY, ctrlKey: t.ctrlKey, altKey: t.altKey, shiftKey: t.shiftKey, }; this.events[this.frameIdx].push(e); } }), (t.prototype.dispatchEvents = function () { if ( !this.config.recordtest && this.config.events && this.config.events[this.frameIdx] ) for ( var t = 0; t < this.config.events[this.frameIdx].length; t++ ) { var e = this.config.events[this.frameIdx][t]; switch (((e.preventDefault = function () {}), e.type)) { case "click": xh.getInstance(null).onClick(e); break; case "dblclick": xh.getInstance(null).onDoubleClick(e); break; case "touchstart": xh.getInstance(null).onMouseDown(e); break; case "mousedown": this.config.settings.snapShotOnMouseDown && this.takeSnapshot(), xh.getInstance(null).onMouseDown(e); break; case "touchmove": case "mousemove": xh.getInstance(null).onMouseMove(e); break; case "mouseup": this.config.settings.snapShotOnMouseUP && this.takeSnapshot(), xh.getInstance(null).onMouseUp(e); break; case "touchend": xh.getInstance(null).onMouseUp(e); break; case "touchend": xh.getInstance(null).onClick(e); break; case "mousewheel": xh.getInstance(null).onMouseWheel(e); break; case "mouseover": xh.getInstance(null).onMouseOver(e); break; case "mouseout": xh.getInstance(null).onMouseOut(e); break; case "keydown": xh.getInstance(null).onKeyDown(e); break; case "keyup": xh.getInstance(null).onKeyUp(e); } } }), (t.prototype.closeBrowserTab = function () { this._finished && ((0 == this.snapShotsUploaded && 0 == this.snapshotCnt) || this.snapShotsUploaded == this.snapshotCnt) && this.finishAndUploadTest(); }), (t.prototype.takeSnapshot = function () { if (!this._finished) { var t = this, e = this.snapshotCnt++; this.addMessage("AWAYFLTEST SNAPSHOT " + e), this._avmStage.snapshot(function (n) { n.toBlob(function (n) { return (function (n) { console.log("snapshot done"); var r = new FormData(), i = "snapshot_" + e + ".png"; r.append("file", n, i); var o = new XMLHttpRequest(); (o.onreadystatechange = function (e) { 4 == o.readyState && (200 == o.status || 0 == o.status ? (t.snapShotsUploaded++, t.closeBrowserTab()) : Up()); }), (o.onerror = function (t) { Up(); }); try { o.open( "POST", "http://localhost:" + t.config.port + "/uploadImage", !0 ), o.send(r); } catch (t) { Up(); } })(n); }); }); } }), (t.prototype.nextFrame = function () { this.frameIdx++, this.config.settings.stopRecAfterFrame > 0 && this.frameIdx > this.config.settings.stopRecAfterFrame && this.finishTest(), this._finished || (0 != this.config.settings.snapShotFrames && this.frameIdx % this.config.settings.snapShotFrames == 0 && this.takeSnapshot(), this.config.settings.onlyTraces || (this.frames[this.frames.length - 1].messages.length > 0 ? this.frames.push({ messages: [], frameIdx: this.frameIdx, }) : (this.frames[this.frames.length - 1].frameIdx = this.frameIdx))); }), (t.prototype.checkIfFinished = function () { if (this.config.frames) { if (this.config.frames.length < this.frames.length) return void this.finishTest(); for (var t = -1, e = 0; e < this.config.frames.length; e++) this.config.frames[e].frameIdx == this.frames[this.frames.length - 1].frameIdx && (t = e); if (-1 == t) return void this.finishTest(); if (t == this.config.frames.length - 1) { var n = this.config.frames[t].messages.length; this.frames[this.frames.length - 1].messages.length >= n && this.finishTest(); } } }), (t.prototype.finishTest = function () { this._finished || ((this._finished = !0), this.closeBrowserTab()); }), (t.prototype.finishAndUploadTest = function () { 0 == this.frames[this.frames.length - 1].messages.length && this.frames.pop(); var t = window.location.pathname .split("/") .pop() .replace(".html", ""), e = { player: "awayflplayer", duration: Date.now() - this.config.startRecTime, date: new Date().toLocaleString(), url: t, swf: this.config.swfPath, swfInfos: this.swfInfo, settings: this.config.settings, frames: this.frames, events: this.events, seed: this.config.seed, }, n = JSON.stringify(e), r = new FormData(), i = new Blob([n], { type: "text/xml" }); if (this.config.recordtest) { var o = this.config.swfPath.replace(/\\/g, "/"); r.append("file", i, o), r.append("record", "true"); } else { o = this.config.swfPath.replace(/\\/g, "/") + "/" + this.config.testPath; r.append("file", i, o); } var a = new XMLHttpRequest(); (a.onreadystatechange = function (t) { 4 == a.readyState && (200 == a.status || 0 == a.status ? console.log("AWAYFLTEST END") : Up()); }), (a.onerror = function (t) { Up(); }); try { a.open( "POST", "http://localhost:" + this.config.port + "/upload", !0 ), a.send(r); } catch (t) { Up(); } }), t ); })(), Vp = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._pProceedParsing = function () { var t = this.data.definition, e = { sampleRate: t.sampleRate, samplesCount: t.samplesCount, startOffset: t.packaged.seek, }; return ( (this._pContent = new E(new x(t.packaged.data.buffer, e))), this._pFinalizeAsset(this._pContent, this._iFileName), mt.PARSING_DONE ); }), n ); })(yt), Qp = {}, Gp = new Uint32Array(33), zp = 1, Hp = 0; zp <= 32; ++zp ) Gp[zp] = Hp = (Hp << 1) | 1; var Xp, Yp, qp, Kp, Wp, Jp = (function () { function t(t, e, n, r) { void 0 === e && (e = 0), t.buffer instanceof ArrayBuffer && ((e += t.byteOffset), (t = t.buffer)), void 0 === n && (n = t.byteLength - e), void 0 === r && (r = n), (this.bytes = new Uint8Array(t, e, r)), (this.view = new DataView(t, e, r)), (this.pos = 0), (this.end = n), (this.bitBuffer = 0), (this.bitLength = 0); } return ( (t.prototype.align = function () { this.bitBuffer = this.bitLength = 0; }), (t.prototype.ensure = function (t) { if (this.pos + t > this.end) throw Qp; }), (t.prototype.remaining = function () { return this.end - this.pos; }), (t.prototype.substream = function (e, n) { var r = new t(this.bytes); return (r.pos = e), (r.end = n), r; }), (t.prototype.push = function (t) { var e = this.bytes, n = this.end + t.length; if (n > e.length) throw "stream buffer overfow"; e.set(t, this.end), (this.end = n); }), (t.prototype.readSi8 = function () { return this.view.getInt8(this.pos++); }), (t.prototype.readSi16 = function () { var t = this.view.getInt16(this.pos, !0); return (this.pos += 2), t; }), (t.prototype.readSi32 = function () { var t = this.view.getInt32(this.pos, !0); return (this.pos += 4), t; }), (t.prototype.readUi8 = function () { return this.bytes[this.pos++]; }), (t.prototype.readUi16 = function () { var t = this.view.getUint16(this.pos, !0); return (this.pos += 2), t; }), (t.prototype.readUi32 = function () { var t = this.view.getUint32(this.pos, !0); return (this.pos += 4), t; }), (t.prototype.readFixed = function () { var t = this.view.getInt32(this.pos, !0) / 65536; return (this.pos += 4), t; }), (t.prototype.readFixed8 = function () { var t = this.view.getInt16(this.pos, !0) / 256; return (this.pos += 2), t; }), (t.prototype.readFloat16 = function () { var t = this.view.getUint16(this.pos, !1); this.pos += 2; var e = t >> 15 ? -1 : 1, n = (31744 & t) >> 10, r = 1023 & t; return n ? 31 === n ? r ? NaN : e * (1 / 0) : e * Math.pow(2, n - 15) * (1 + r / 1024) : e * Math.pow(2, -14) * (r / 1024); }), (t.prototype.readFloat = function () { var t = this.view.getFloat32(this.pos, !0); return (this.pos += 4), t; }), (t.prototype.readDouble = function () { var t = this.view.getFloat64(this.pos, !0); return (this.pos += 8), t; }), (t.prototype.readEncodedU32 = function () { var t = this.bytes, e = t[this.pos++]; return 128 & e && 16384 & (e = (127 & e) | (t[this.pos++] << 7)) && 2097152 & (e = (16383 & e) | (t[this.pos++] << 14)) && 268435456 & (e = (2097151 & e) | (t[this.pos++] << 21)) ? (268435455 & e) | (t[this.pos++] << 28) : e; }), (t.prototype.readBool = function () { return !!this.bytes[this.pos++]; }), (t.prototype.readSb = function (t) { return (this.readUb(t) << (32 - t)) >> (32 - t); }), (t.prototype.readUb = function (t) { for (var e = this.bitBuffer, n = this.bitLength, r = 0; t > n; ) n > 24 && ((r = e << (t -= n)), (n = 0)), (e = (e << 8) | this.bytes[this.pos++]), (n += 8); return ( (r |= (e >>> (n -= t)) & Gp[t]), (this.bitBuffer = e), (this.bitLength = n), r ); }), (t.prototype.readFb = function (t) { return this.readSb(t) / 65536; }), (t.prototype.readString = function (t) { var e, n = this.bytes, r = this.pos; if (t > -1) e = n.subarray(r, (r += t)); else { t = 0; for (var i = r; n[i]; i++) t++; (e = n.subarray(r, (r += t))), r++; } this.pos = r; var o = Fo(e); return o.indexOf("\0") >= 0 && (o = o.split("\0").join("")), o; }), t ); })(); function $p(t) { t.align(); var e = t.readUb(5), n = t.readSb(e), r = t.readSb(e), i = t.readSb(e), o = t.readSb(e); return t.align(), { xMin: n, xMax: r, yMin: i, yMax: o }; } function Zp(t) { return ( ((t.readUi8() << 24) | (t.readUi8() << 16) | (t.readUi8() << 8) | 255) >>> 0 ); } function td(t) { return ( (t.readUi8() << 24) | (t.readUi8() << 16) | (t.readUi8() << 8) | t.readUi8() ); } function ed(t) { var e = { a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0 }; if ((t.align(), t.readUb(1))) { var n = t.readUb(5); (e.a = t.readFb(n)), (e.d = t.readFb(n)); } if (t.readUb(1)) { n = t.readUb(5); (e.b = t.readFb(n)), (e.c = t.readFb(n)); } n = t.readUb(5); return (e.tx = t.readSb(n)), (e.ty = t.readSb(n)), t.align(), e; } function nd(t, e) { var n = { redMultiplier: 255, greenMultiplier: 255, blueMultiplier: 255, alphaMultiplier: 255, redOffset: 0, greenOffset: 0, blueOffset: 0, alphaOffset: 0, }; t.align(); var r = t.readUb(1), i = t.readUb(1), o = t.readUb(4); return ( i && ((n.redMultiplier = t.readSb(o)), (n.greenMultiplier = t.readSb(o)), (n.blueMultiplier = t.readSb(o)), e && (n.alphaMultiplier = t.readSb(o))), r && ((n.redOffset = t.readSb(o)), (n.greenOffset = t.readSb(o)), (n.blueOffset = t.readSb(o)), e && (n.alphaOffset = t.readSb(o))), t.align(), n ); } function rd(t, e, n, r) { var i = { code: n }; if (((i.actionBlocksPrecedence = t.pos), 4 === n)) return ( (i.symbolId = t.readUi16()), (i.depth = t.readUi16()), (i.flags |= 4), (i.matrix = ed(t)), t.pos < r && ((i.flags |= 8), (i.cxform = nd(t, !1))), i ); var o = (i.flags = n > 26 ? t.readUi16() : t.readUi8()); if ( ((i.depth = t.readUi16()), 2048 & o && (i.className = t.readString(-1)), 2 & o && (i.symbolId = t.readUi16()), 4 & o && (i.matrix = ed(t)), 8 & o && (i.cxform = nd(t, !0)), 16 & o && (i.ratio = t.readUi16()), 32 & o && (i.name = t.readString(-1)), 64 & o && (i.clipDepth = t.readUi16()), 256 & o) ) for (var a = t.readUi8(), s = (i.filters = []); a--; ) s.push(od(t)); if ( (512 & o && (i.blendMode = t.readUi8()), 1024 & o && (i.bmpCache = t.readUi8()), 8192 & o && (i.visibility = t.readBool()), 16384 & o && (i.backgroundColor = (function (t) { return ( t.readUi8() | (t.readUi8() << 24) | (t.readUi8() << 16) | (t.readUi8() << 8) ); })(t)), 128 & o) ) { t.readUi16(), e >= 6 ? t.readUi32() : t.readUi16(); for (var u = (i.events = []), l = void 0; (l = id(t, e)); ) { if (t.pos > r) { console.log( "PlaceObject handler attempted to read clip events beyond tag end" ), (t.pos = r); break; } u.push(l); } } return i; } function id(t, e) { var n = e >= 6 ? t.readUi32() : t.readUi16(); if (!n) return null; var r = {}; 6 === e && (n &= -262145), (r.flags = n); var i = t.readUi32(); 131072 & n && ((r.keyCode = t.readUi8()), i--); var o = t.pos + i; return (r.actionsBlock = t.bytes.subarray(t.pos, o)), (t.pos = o), r; } function od(t) { var e = {}, n = (e.type = t.readUi8()); switch (n) { case Xp.DROPSHADOW: case Xp.GLOW: case Xp.BEVEL: case Xp.GRADIENTGLOW: case Xp.GRADIENTBEVEL: var r, i = e; r = n === Xp.GRADIENTGLOW || n === Xp.GRADIENTBEVEL ? t.readUi8() : n === Xp.BEVEL ? 2 : 1; for (var o = (i.colors = []), a = r; a--; ) o.push(td(t)); if (n === Xp.GRADIENTGLOW || n === Xp.GRADIENTBEVEL) { var s = (i.ratios = []); for (a = r; a--; ) s.push(t.readUi8()); } return ( (i.blurX = t.readFixed()), (i.blurY = t.readFixed()), n !== Xp.GLOW && ((i.angle = t.readFixed()), (i.distance = t.readFixed())), (i.strength = t.readFixed8()), (i.inner = !!t.readUb(1)), (i.knockout = !!t.readUb(1)), (i.compositeSource = !!t.readUb(1)), n === Xp.BEVEL || n === Xp.GRADIENTGLOW || n === Xp.GRADIENTBEVEL ? ((i.onTop = !!t.readUb(1)), (i.quality = t.readUb(4))) : (i.quality = t.readUb(5)), i ); case Xp.BLUR: var u = e; return ( (u.blurX = t.readFixed()), (u.blurY = t.readFixed()), (u.quality = t.readUb(5)), t.readUb(3), u ); case Xp.CONVOLUTION: var l = e, c = (l.matrixX = t.readUi8()), h = (l.matrixY = t.readUi8()); (l.divisor = t.readFloat()), (l.bias = t.readFloat()); var p = (l.matrix = []); for (a = c * h; a--; ) p.push(t.readFloat()); return ( (l.color = td(t)), t.readUb(6), (l.clamp = !!t.readUb(1)), (l.preserveAlpha = !!t.readUb(1)), l ); case Xp.COLORMATRIX: var d = e; for (p = d.matrix = [], a = 20; a--; ) p.push(t.readFloat()); return d; } return e; } function ad(t, e, n) { var r = { code: n }; return ( 5 === n ? ((r.depth = t.readUi16()), (r.symbolId = t.readUi16())) : (r.depth = t.readUi16()), r ); } function sd(t, e, n, r, i) { var o, a = { code: n }; if (((a.id = t.readUi16()), n > 21)) { var s = t.readUi32(); 90 === n && (a.deblock = t.readFixed8()), (s += t.pos), (o = a.imgData = t.bytes.subarray(t.pos, s)), (a.alphaData = t.bytes.subarray(s, r)), (t.pos = r); } else (o = a.imgData = t.bytes.subarray(t.pos, r)), (t.pos = r); switch ((o[0] << 8) | o[1]) { case 65496: case 65497: a.mimeType = "image/jpeg"; break; case 35152: a.mimeType = "image/png"; break; case 18249: a.mimeType = "image/gif"; break; default: a.mimeType = "application/octet-stream"; } return 6 === n && (a.jpegTables = { data: i }), a; } function ud(t, e, n, r) { var i = { code: n }; i.id = t.readUi16(); var o, a = (i.characters = []); if (7 == n) { for (; (o = ld(t, e, n)); ) a.push(o); (i.actionsData = t.bytes.subarray(t.pos, r)), (t.pos = r); } else { var s = t.readUi8(); i.trackAsMenu = !!((s >> 7) & 1); for (var u = t.readUi16(); (o = ld(t, e, n)); ) a.push(o); if (u) { for (var l = (i.buttonActions = []); t.pos < r; ) { var c = cd(t, r); if (t.pos > r) break; l.push(c); } t.pos = r; } } return i; } function ld(t, e, n) { var r = t.readUi8(); if (!r) return null; var i = {}; if ( (e < 8 && (r &= -769), (i.flags = r), (i.symbolId = t.readUi16()), (i.depth = t.readUi16()), (i.matrix = ed(t)), 34 === n && (i.cxform = nd(t, !0)), 16 & i.flags) ) for (var o = t.readUi8(), a = (i.filters = []), s = o; s--; ) a.push(od(t)); return 32 & i.flags && (i.blendMode = t.readUi8()), i; } function cd(t, e) { var n = t.pos, r = t.readUi16(), i = r ? n + r : e, o = t.readUi16(); return ( (t.pos = i), { keyCode: (65024 & o) >> 9, stateTransitionFlags: 511 & o, actionsData: t.bytes.subarray(n + 4, i), } ); } function hd(t, e, n) { t.align(); var r = t.readUb(4), i = t.readUb(4); return Cd(t, e, n, !1, r, i, !1); } function pd(t, e, n) { var r = { code: n }; (r.id = t.readUi16()), (r.bbox = $p(t)), (r.matrix = ed(t)); for ( var i, o = t.readUi8(), a = t.readUi8(), s = (r.records = []); (i = dd(t, e, n, o, a)); ) s.push(i); return r; } function dd(t, e, n, r, i) { t.align(); var o = t.readUb(8); if (!o) return null; var a = {}; (a.flags = o), 8 & o && (a.fontId = t.readUi16()), 4 & o && (a.color = 33 === n ? td(t) : Zp(t)), 1 & o && (a.moveX = t.readSi16()), 2 & o && (a.moveY = t.readSi16()), 8 & o && (a.fontHeight = t.readUi16()); for (var s = t.readUi8(), u = (a.entries = []), l = s; l--; ) u.push({ glyphIndex: t.readUb(r), advance: t.readSb(i) }); return a; } function fd(t, e, n) { var r = { code: n }; return ( 15 == n && (r.soundId = t.readUi16()), 89 == n && (r.soundClassName = t.readString(-1)), (r.soundInfo = gd(t)), r ); } function gd(t) { var e = {}, n = (e.flags = t.readUi8()); if ( (1 & n && (e.inPoint = t.readUi32()), 2 & n && (e.outPoint = t.readUi32()), 4 & n && (e.loopCount = t.readUi16()), 8 & n) ) for (var r = t.readUi8(), i = (e.envelopes = []), o = r; o--; ) i.push({ pos44: t.readUi32(), volumeLeft: t.readUi16(), volumeRight: t.readUi16(), }); return e; } function _d(t, e) { var n = {}, r = t.readUi8(); (n.playbackRate = (r >> 2) & 3), (n.playbackSize = (r >> 1) & 1), (n.playbackType = 1 & r); var i = t.readUi8(), o = (n.streamCompression = (i >> 4) & 15); return ( (n.streamRate = (i >> 2) & 3), (n.streamSize = 0 == ((i >> 1) & 1) ? 8 : 16), (n.streamType = 1 & i), (n.samplesCount = t.readUi16()), 2 == o && e - t.pos >= 2 && (n.latencySeek = t.readSi16()), n ); } function md(t, e, n, r) { var i = { code: n }; i.id = t.readUi16(); var o = (i.format = t.readUi8()); return ( (i.width = t.readUi16()), (i.height = t.readUi16()), (i.hasAlpha = 36 === n), 3 === o && (i.colorTableSize = t.readUi8()), (i.bmpData = t.bytes.subarray(t.pos, r)), (t.pos = r), i ); } function yd(t, e, n, r) { var i = { code: n }; i.id = t.readUi16(); var o = (i.flags = t.readUi8()), a = !!(4 & o); e > 5 ? (i.language = t.readUi8()) : ((o = i.flags = -65 & o), (t.pos += 1), (i.language = 0)); var s = t.readUi8(); (i.name = t.readString(s)), 75 === n && (i.resolution = 20); var u = t.readUi16(); if (0 === u) return i; var l = t.pos, c = (i.offsets = []), h = u; if (8 & o) { for (; h--; ) c.push(t.readUi32()); i.mapOffset = t.readUi32(); } else { for (; h--; ) c.push(t.readUi16()); i.mapOffset = t.readUi16(); } var p = (i.glyphs = []); for (h = u; h--; ) { 1 !== i.offsets[u - h] + l - t.pos ? p.push(hd(t, e, n)) : ((t.pos += 1), p.push([])); } var d = (i.codes = []); for (h = u; h--; ) d.push(a ? t.readUi16() : t.readUi8()); if (128 & o) { (i.ascent = t.readUi16()), (i.descent = t.readUi16()), (i.leading = t.readSi16()); var f = (i.advance = []); for (h = u; h--; ) f.push(t.readSi16()); var g = (i.bbox = []); for (h = u; h--; ) g.push($p(t)); var _ = t.readUi16(), m = (i.kerning = []); for (h = _; h-- && r - t.pos >= 2 + (a ? 4 : 2); ) m.push(Ad(t, a)); } return i; } function Ad(t, e) { var n = {}; return ( e ? ((n.code1 = t.readUi16()), (n.code2 = t.readUi16())) : ((n.code1 = t.readUi8()), (n.code2 = t.readUi8())), (n.adjustment = t.readUi16()), n ); } function vd(t, e) { for ( var n = { code: e }, r = t.readEncodedU32(), i = (n.scenes = []), o = r; o--; ) i.push({ offset: t.readEncodedU32(), name: t.readString(-1), labels: [], numFrames: -1, }), i.length > 1 && (i[i.length - 2].numFrames = i[i.length - 1].offset - i[i.length - 2].offset); var a = t.readEncodedU32(), s = (n.labels = []); for (o = a; o--; ) { var u = { frame: t.readEncodedU32(), name: t.readString(-1) }; s.push(u); for (var l = i[0], c = 1; c < i.length; c++) { var h = i[c]; if (h.offset > u.frame) break; l = h; } l.labels.push(u); } return n; } function bd(t, e, n, r) { var i = { code: n, needParse: !0 }, o = 0; (i.id = t.readUi16()), (i.lineBounds = $p(t)); var a = 46 === n || 84 === n; a && ((o |= 8), (i.lineBoundsMorph = $p(t))), (83 === n || 84 === n) && ((i.fillBounds = $p(t)), a && (i.fillBoundsMorph = $p(t)), (o |= 7 & t.readUi8())), (i.flags = o), a && (t.pos += 4); var s = t.substream(t.pos, t.end); return ( (i.lazyParser = function () { (i.needParse = !1), (i.lazyParser = function () { return i; }); var t = performance.now(); return ( (function (t, e, n) { var r = 83 === e.code || 84 === e.code, i = !!(8 & e.flags); (e.fillStyles = Id(t, n, e.code, i)), (e.lineStyles = wd(t, n, e.code, i, r)), t.align(); var o = t.readUb(4), a = t.readUb(4); (e.records = Cd(t, n, e.code, i, o, a, r)), i && (t.align(), (o = t.readUb(4)), (a = t.readUb(4)), (e.recordsMorph = Cd(t, n, e.code, i, o, a, r))); })(s, i, e), (i.parsingTime = performance.now() - t), i ); }), (t.pos = r), i ); } function Cd(t, e, n, r, i, o, a) { for (var s, u, l = new Array(10), c = 0; ; ) { var h = {}, p = (h.type = t.readUb(1)); if (((u = t.readUb(5)), !p && !u)) break; if (p) if (((s = 2 + (15 & u)), 32 & (u = (240 & u) << 1))) if ((h.isGeneral = t.readUb(1))) (u |= 64), (h.deltaX = t.readSb(s)), (h.deltaY = t.readSb(s)); else (h.isVertical = t.readUb(1)) ? ((u |= 128), (h.deltaY = t.readSb(s))) : (h.deltaX = t.readSb(s)); else (h.controlDeltaX = t.readSb(s)), (h.controlDeltaY = t.readSb(s)), (h.anchorDeltaX = t.readSb(s)), (h.anchorDeltaY = t.readSb(s)); else n <= 2 && (u &= -17), 1 & u && ((s = t.readUb(5)), (h.moveX = t.readSb(s)), (h.moveY = t.readSb(s))), 2 & u && (h.fillStyle0 = t.readUb(i)), 4 & u && (h.fillStyle1 = t.readUb(i)), 8 & u && (h.lineStyle = t.readUb(o)), 16 & u && ((h.fillStyles = Id(t, e, n, r)), (h.lineStyles = wd(t, e, n, r, a)), t.align(), (i = t.readUb(4)), (o = t.readUb(4))); (h.flags = u), (l[c++] = h); } return l.length > c && (l.length = c), l; } function Id(t, e, n, r) { var i = t.readUi8(); n > 2 && 255 === i && (i = t.readUi16()); for (var o = [], a = i; a--; ) o.push(Ed(t, e, n, r)); return o; } function Ed(t, e, n, r) { var i = {}, o = (i.type = t.readUi8()); switch (o) { case 0: var a = i; return ( (a.color = n > 22 || r ? td(t) : Zp(t)), r && (a.colorMorph = td(t)), a ); case 16: case 18: case 19: var s = i; (s.matrix = ed(t)), r && (s.matrixMorph = ed(t)), 83 === n ? ((s.spreadMode = t.readUb(2)), (s.interpolationMode = t.readUb(2))) : t.readUb(4); for (var u = t.readUb(4), l = (s.records = []), c = u; c--; ) l.push(xd(t, n, r)); return ( 19 === o && ((s.focalPoint = t.readSi16()), r && (s.focalPointMorph = t.readSi16())), s ); case 64: case 65: case 66: case 67: var h = i; return ( (h.bitmapId = t.readUi16()), (h.condition = 64 === o || 67 === o), (h.matrix = ed(t)), r && (h.matrixMorph = ed(t)), h ); } return i; } function xd(t, e, n) { var r = {}; return ( (r.ratio = t.readUi8()), (r.color = e > 22 ? td(t) : Zp(t)), n && ((r.ratioMorph = t.readUi8()), (r.colorMorph = td(t))), r ); } function wd(t, e, n, r, i) { var o = t.readUi8(); n > 2 && 255 === o && (o = t.readUi16()); for (var a = [], s = o; s--; ) { var u = {}; if (((u.width = t.readUi16()), r && (u.widthMorph = t.readUi16()), i)) { t.align(), (u.startCapsStyle = t.readUb(2)); var l = (u.jointStyle = t.readUb(2)), c = (u.hasFill = t.readUb(1)); (u.noHscale = !!t.readUb(1)), (u.noVscale = !!t.readUb(1)), (u.pixelHinting = !!t.readUb(1)), t.readUb(5), (u.noClose = !!t.readUb(1)), (u.endCapsStyle = t.readUb(2)), 2 === l && (u.miterLimitFactor = t.readFixed8()), c ? (u.fillStyle = Ed(t, 0, n, r)) : ((u.color = td(t)), r && (u.colorMorph = td(t))); } else (u.color = n > 22 ? td(t) : Zp(t)), r && (u.colorMorph = td(t)); a.push(u); } return a; } !(function (t) { (t[(t.DROPSHADOW = 0)] = "DROPSHADOW"), (t[(t.BLUR = 1)] = "BLUR"), (t[(t.GLOW = 2)] = "GLOW"), (t[(t.BEVEL = 3)] = "BEVEL"), (t[(t.GRADIENTGLOW = 4)] = "GRADIENTGLOW"), (t[(t.CONVOLUTION = 5)] = "CONVOLUTION"), (t[(t.COLORMATRIX = 6)] = "COLORMATRIX"), (t[(t.GRADIENTBEVEL = 7)] = "GRADIENTBEVEL"); })(Xp || (Xp = {})), (function (t) { (t[(t.CODE_DEFINE_SHAPE = 2)] = "CODE_DEFINE_SHAPE"), (t[(t.CODE_DEFINE_BITS = 6)] = "CODE_DEFINE_BITS"), (t[(t.CODE_DEFINE_BUTTON = 7)] = "CODE_DEFINE_BUTTON"), (t[(t.CODE_DEFINE_FONT = 10)] = "CODE_DEFINE_FONT"), (t[(t.CODE_DEFINE_TEXT = 11)] = "CODE_DEFINE_TEXT"), (t[(t.CODE_DEFINE_SOUND = 14)] = "CODE_DEFINE_SOUND"), (t[(t.CODE_DEFINE_BITS_LOSSLESS = 20)] = "CODE_DEFINE_BITS_LOSSLESS"), (t[(t.CODE_DEFINE_BITS_JPEG2 = 21)] = "CODE_DEFINE_BITS_JPEG2"), (t[(t.CODE_DEFINE_SHAPE2 = 22)] = "CODE_DEFINE_SHAPE2"), (t[(t.CODE_DEFINE_SHAPE3 = 32)] = "CODE_DEFINE_SHAPE3"), (t[(t.CODE_DEFINE_TEXT2 = 33)] = "CODE_DEFINE_TEXT2"), (t[(t.CODE_DEFINE_BUTTON2 = 34)] = "CODE_DEFINE_BUTTON2"), (t[(t.CODE_DEFINE_BITS_JPEG3 = 35)] = "CODE_DEFINE_BITS_JPEG3"), (t[(t.CODE_DEFINE_BITS_LOSSLESS2 = 36)] = "CODE_DEFINE_BITS_LOSSLESS2"), (t[(t.CODE_DEFINE_EDIT_TEXT = 37)] = "CODE_DEFINE_EDIT_TEXT"), (t[(t.CODE_DEFINE_SPRITE = 39)] = "CODE_DEFINE_SPRITE"), (t[(t.CODE_DEFINE_MORPH_SHAPE = 46)] = "CODE_DEFINE_MORPH_SHAPE"), (t[(t.CODE_DEFINE_FONT2 = 48)] = "CODE_DEFINE_FONT2"), (t[(t.CODE_DEFINE_VIDEO_STREAM = 60)] = "CODE_DEFINE_VIDEO_STREAM"), (t[(t.CODE_DEFINE_FONT3 = 75)] = "CODE_DEFINE_FONT3"), (t[(t.CODE_DEFINE_SHAPE4 = 83)] = "CODE_DEFINE_SHAPE4"), (t[(t.CODE_DEFINE_MORPH_SHAPE2 = 84)] = "CODE_DEFINE_MORPH_SHAPE2"), (t[(t.CODE_DEFINE_BINARY_DATA = 87)] = "CODE_DEFINE_BINARY_DATA"), (t[(t.CODE_DEFINE_BITS_JPEG4 = 90)] = "CODE_DEFINE_BITS_JPEG4"), (t[(t.CODE_DEFINE_FONT4 = 91)] = "CODE_DEFINE_FONT4"); })(Yp || (Yp = {})), (function (t) { (t[(t.CODE_DEFINE_BITS = 6)] = "CODE_DEFINE_BITS"), (t[(t.CODE_DEFINE_BITS_JPEG2 = 21)] = "CODE_DEFINE_BITS_JPEG2"), (t[(t.CODE_DEFINE_BITS_JPEG3 = 35)] = "CODE_DEFINE_BITS_JPEG3"), (t[(t.CODE_DEFINE_BITS_JPEG4 = 90)] = "CODE_DEFINE_BITS_JPEG4"); })(qp || (qp = {})), (function (t) { (t[(t.CODE_DEFINE_FONT = 10)] = "CODE_DEFINE_FONT"), (t[(t.CODE_DEFINE_FONT2 = 48)] = "CODE_DEFINE_FONT2"), (t[(t.CODE_DEFINE_FONT3 = 75)] = "CODE_DEFINE_FONT3"), (t[(t.CODE_DEFINE_FONT4 = 91)] = "CODE_DEFINE_FONT4"); })(Kp || (Kp = {})), (function (t) { (t[(t.CODE_PLACE_OBJECT = 4)] = "CODE_PLACE_OBJECT"), (t[(t.CODE_PLACE_OBJECT2 = 26)] = "CODE_PLACE_OBJECT2"), (t[(t.CODE_PLACE_OBJECT3 = 70)] = "CODE_PLACE_OBJECT3"), (t[(t.CODE_REMOVE_OBJECT = 5)] = "CODE_REMOVE_OBJECT"), (t[(t.CODE_REMOVE_OBJECT2 = 28)] = "CODE_REMOVE_OBJECT2"), (t[(t.CODE_START_SOUND = 15)] = "CODE_START_SOUND"), (t[(t.CODE_START_SOUND2 = 89)] = "CODE_START_SOUND2"), (t[(t.CODE_VIDEO_FRAME = 61)] = "CODE_VIDEO_FRAME"); })(Wp || (Wp = {})); var Sd = { 0: void 0, 1: void 0, 2: bd, 4: rd, 5: ad, 6: sd, 7: ud, 8: void 0, 9: void 0, 10: function (t, e, n) { var r = { code: n }; r.id = t.readUi16(); for (var i = t.readUi16(), o = i / 2, a = [], s = o - 1; s--; ) a.push(t.readUi16()); r.offsets = [i].concat(a); var u = (r.glyphs = []); for (s = o; s--; ) u.push(hd(t, e, n)); return r; }, 11: pd, 12: void 0, 13: void 0, 14: function (t, e, n, r) { var i = { code: n }; i.id = t.readUi16(); var o = t.readUi8(); return ( (i.soundFormat = (o >> 4) & 15), (i.soundRate = (o >> 2) & 3), (i.soundSize = (o >> 1) & 1), (i.soundType = 1 & o), (i.samplesCount = t.readUi32()), (i.soundData = t.bytes.subarray(t.pos, r)), (t.pos = r), i ); }, 15: fd, 17: void 0, 18: void 0, 19: void 0, 20: md, 21: sd, 22: bd, 23: void 0, 24: void 0, 26: rd, 28: ad, 32: bd, 33: pd, 34: ud, 35: sd, 36: md, 37: function (t, e, n) { var r = { code: n }; (r.id = t.readUi16()), (r.bbox = $p(t)); var i = (r.flags = t.readUi16()); return ( 1 & i && (r.fontId = t.readUi16()), 32768 & i && (r.fontClass = t.readString(-1)), 1 & i && (r.fontHeight = t.readUi16()), 4 & i && (r.color = td(t)), 2 & i && (r.maxLength = t.readUi16()), 8192 & i && ((r.align = t.readUi8()), (r.leftMargin = t.readUi16()), (r.rightMargin = t.readUi16()), (r.indent = t.readSi16()), (r.leading = t.readSi16())), (r.variableName = t.readString(-1)), 128 & i && (r.initialText = t.readString(-1)), r ); }, 39: void 0, 43: void 0, 45: void 0, 46: bd, 48: yd, 56: void 0, 57: void 0, 58: void 0, 59: void 0, 60: function (t, e, n) { var r = { code: n }; return ( (r.id = t.readUi16()), (r.numFrames = t.readUi16()), (r.width = t.readUi16()), (r.height = t.readUi16()), t.readUb(4), (r.deblocking = t.readUb(3)), (r.smoothing = !!t.readUb(1)), (r.codecId = t.readUi8()), r ); }, 61: function (t, e, n, r) { var i = { code: n }; return ( (i.streamId = t.readUi16()), (i.frameNum = t.readUi16()), (i.videoData = t.bytes.subarray(t.pos, r)), (t.pos = r), i ); }, 62: void 0, 64: void 0, 65: void 0, 66: void 0, 69: void 0, 70: rd, 71: void 0, 72: void 0, 73: void 0, 74: void 0, 75: yd, 76: void 0, 77: void 0, 78: function (t, e, n) { var r = { code: n }; return (r.symbolId = t.readUi16()), (r.splitter = $p(t)), r; }, 82: void 0, 83: bd, 84: bd, 86: vd, 87: function (t, e, n, r) { var i = { code: n }; return ( (i.id = t.readUi16()), (t.pos += 4), (i.data = t.bytes.subarray(t.pos, r)), (t.pos = r), i ); }, 88: void 0, 89: fd, 90: sd, 91: function (t, e, n, r) { var i = { code: n }; i.id = t.readUi16(); var o = (i.flags = t.readUi8()); return ( (i.name = t.readString(-1)), 4 & o && ((i.data = t.bytes.slice(t.pos, r)), (t.pos = r)), i ); }, }; var Dd = (function () { function t() {} return ( (t.parseData = function (e) { var n = t.openType; return ( n || console.error("[OpenTypeParser] - opentype.js is not registered"), n.parse(e.data.buffer) ); }), t ); })(), Td = Math.pow, Pd = Math.log, Od = String.fromCharCode; function Bd(t) { for (var e = 0, n = t; n >= 2; ) (n /= 2), ++e; return Td(2, e); } function Md(t) { return Od((t >> 8) & 255, 255 & t); } function Ld(t, e) { var n, r = "swf-font-" + t.id, i = t.name || r; "Helvetica" == i && (i = "arial"), 91 == t.code && (n = Dd.parseData(t)); var o, a = t.glyphs, s = a ? a.length : 0, u = { type: "font", id: t.id, name: i, bold: !!(1 & t.flags), italic: !!(2 & t.flags), codes: t.codes, metrics: null, data: t.data, originalSize: !1, away: null, fontStyleName: Pu.STANDART, }, l = Pu.STANDART; if ( (u.bold && !u.italic ? (l = Pu.BOLD) : !u.bold && u.italic ? (l = Pu.ITALIC) : u.bold && u.italic && (l = Pu.BOLDITALIC), (u.fontStyleName = l), !s && !n) ) return (u.away = Uc.getDeviceFont(i)), u; (o = n ? Vc.defineFont_CFF(i, e) : Vc.defineFont(i, e)), (u.away = o), (o.name = i); var c = o.create_font_table(l, Nc.assetType); if (n) return c.changeOpenTypeFont(n), u; var h = [], p = {}, d = [], f = !("advance" in t), g = 48 === t.code, _ = 75 === t.code; f && (t.advance = []); var m = Math.max.apply(null, t.codes) || 35; if (t.codes) { for (var y = 0; y < t.codes.length; y++) { ((D = t.codes[y]) < 32 || D in p) && (8232 == ++m && (m = 8240), (D = m)), h.push(D), (p[D] = y); } h.sort(function (t, e) { return t - e; }); var A; for (y = 0; void 0 !== (D = h[y++]); ) { var v = (S = D); for (A = [y - 1]; void 0 !== (D = h[y]) && v + 1 === D; ) ++v, A.push(y), ++y; d.push([S, v, A]); } } else { A = []; var b = 57344; for (y = 0; y < s; y++) (D = b + y), h.push(D), (p[D] = y), A.push(y); d.push([b, b + s - 1, A]); } var C = t.resolution || 1; g && (function (t) { for (var e = 0, n = 0, r = 0, i = 0, o = 0; o < t.length; o++) { var a = t[o]; if (a) for (var s, u = 0, l = 0, c = 0; c < a.length; c++) (s = a[c]).type ? 32 & s.flags ? ((u += s.deltaX || 0), (l += -(s.deltaY || 0))) : ((u += s.controlDeltaX), (l += -s.controlDeltaY), (u += s.anchorDeltaX), (l += -s.anchorDeltaY)) : 1 & s.flags && ((u = s.moveX), (l = -s.moveY)), e > u && (e = u), n > l && (n = l), r < u && (r = u), i < l && (i = l); } return Math.max(r - e, i - n) > 5e3; })(a) && ((C = 20), (u.originalSize = !0)); var I = Math.ceil(t.ascent / C) || 1024, E = -Math.ceil(t.descent / C) || 0; 0 != c.ascent || ((c.ascent = I), (c.descent = E)); var x = c.ascent; t.leading; var w; for (y = 0; (w = d[y++]); ) var S = w[0], D = ((v = w[1]), w[2][0]); for ( var T = 2 * Bd(d.length + 1), P = [], O = ((y = 0), {}); void 0 !== (D = h[y++]); ) { for ( var B = a[p[D]], M = 0, L = 0, N = [], R = -1, F = 0; F < B.length; F++ ) { if ((nt = B[F]).type) if ( (R < 0 && (N[(R = 0)] = { data: [], commands: [], xMin: 0, xMax: 0, yMin: 0, yMax: 0, }), 32 & nt.flags) ) N[R].commands.push(2), (M += (nt.deltaX || 0) / C), (L += -(nt.deltaY || 0) / C), N[R].data.push(M, L); else N[R].commands.push(3), (M += $ = nt.controlDeltaX / C), (L += Z = -nt.controlDeltaY / C), N[R].data.push(M, L), (M += nt.anchorDeltaX / C), (L += -nt.anchorDeltaY / C), N[R].data.push(M, L); else if (1 & nt.flags) { (N[++R] = { data: [], commands: [], xMin: 0, xMax: 0, yMin: 0, yMax: 0, }), N[R].commands.push(1); var k = nt.moveX / C, U = -nt.moveY / C; (M = k), (L = U), N[R].data.push(M, L); } R > -1 && (N[R].xMin > M && (N[R].xMin = M), N[R].yMin > L && (N[R].yMin = L), N[R].xMax < M && (N[R].xMax = M), N[R].yMax < L && (N[R].yMax = L)); } _ || N.sort(function (t, e) { return ( (e.xMax - e.xMin) * (e.yMax - e.yMin) - (t.xMax - t.xMin) * (t.yMax - t.yMin) ); }), (O[D] = N); } var j = 0; for (y = 0; void 0 !== (D = h[y++]); ) { var V = new Qs(), Q = p[D]; B = a[Q]; N = O[D]; (M = 0), (L = 0); var G = 0, z = -1024, H = 0, X = ((R = -1), []), Y = []; for (F = 0; F < N.length; F++) (X = X.concat(N[F].data)), (Y = Y.concat(N[F].commands)); (M = 0), (L = 0); var q = 0, K = 0, W = 0; for (F = 0; F < Y.length; F++) { var J = Y[F]; if (1 === J) { (q = X[W++]), (K = X[W++]); V.moveTo(q, -1 * K + x), (M = q), (L = K); } else if (2 === J) { (q = X[W++]), (K = X[W++]); (M = q), (L = K), V.lineTo(q, -1 * K + x); } else if (3 === J) { var $ = (q = X[W++]) - M, Z = (K = X[W++]) - L; (M = q), (L = K); ($ = q), (Z = K), (q = X[W++]), (K = X[W++]); (M = q), (L = K), V.curveTo($, -1 * Z + x, q, -1 * K + x); } G > M && (G = M), H > L && (H = L), z < M && (z = M); } F || (G = z = H = 0), P.push(H); var tt = 0; f ? (t.advance.push((z - G) * C * 1.3), (tt = z - G)) : (tt = t.advance[Q] / C) < 0 && (tt = Math.abs(tt)), 32 == D && (j = t.advance[Q] / C) < 0 && (j = Math.abs(j)), c.setChar(D.toString(), tt, null, null, !1, Q, V); } if (!_) { var et = Math.min.apply(null, P); et < 0 && (E = E || et); } if (t.kerning && t.kerning.length) { var nt, rt = t.kerning, it = rt.length; for ( T = 2 * Bd(it), Md(14 + 6 * it), Md(it), Md(T), Md(Pd(it) / Pd(2)), Md(2 * it - T), y = 0; (nt = rt[y++]); ) Md(p[nt.code1]) + Md(p[nt.code2]) + Md(nt.adjustment); } return c.set_font_em_size(1024), j && c.set_whitespace_width(j), u; } function Nd(t) { var e = t.width, n = t.height, r = t.hasAlpha, i = (function (t) { return (t + 3) & -4; })(e) - e, o = r ? 4 : 3, a = (t.colorTableSize + 1) * o, s = a + (e + i) * n, u = fa.inflate(t.bmpData, s, !0), l = new Uint32Array(e * n), c = a, h = 0, p = 0; if (r) for (var d = 0; d < n; d++) { for (var f = 0; f < e; f++) { var g = u[(p = u[c++] << 2) + 3], _ = g / 255; l[h++] = ((g << 24) | (((u[p + 2] * _) | 0) << 16) | (((u[p + 1] * _) | 0) << 8) | (u[p + 0] * _) | 0) >>> 0; } c += i; } else for (d = 0; d < n; d++) { for (f = 0; f < e; f++) (p = u[c++] * o), (l[h++] = ((255 << 24) | (u[p + 2] << 16) | (u[p + 1] << 8) | u[p + 0]) >>> 0); c += i; } return new Uint8ClampedArray(l.buffer); } function Rd(t) { for ( var e = t.width, n = t.height * e * 4, r = fa.inflate(t.bmpData, n, !0), i = new Uint32Array(r.buffer), o = 0, a = i.length; o < a; o++ ) { var s = i[o], u = 255 & s, l = (s >> 24) & 255, c = (s >> 16) & 255, h = (s >> 8) & 255; i[o] = ((u << 24) | (l << 16) | (c << 8) | h) >>> 0; } return new Uint8ClampedArray(r.buffer); } function Fd(t) { return console.log("parse15BPP"), null; } function kd(t, e) { return (t[e] << 8) | t[e + 1]; } function Ud(t, e) { return (t[e] << 24) | (t[e + 1] << 16) | (t[e + 2] << 8) | t[e + 3]; } function jd(t, e) { for ( var n = 0, r = t.length; n < r && (255 !== t[n] || (n + 1 < r && (0 === t[n + 1] || 255 === t[n + 1]))); ) ++n; if (!(n >= r)) do { var i = n++, o = t[n++]; if ( (o >= 192 && o <= 199) || (o >= 201 && o <= 207) || (o >= 218 && o <= 239) || 254 === o ) n += kd(t, n); for ( ; n < r && (255 !== t[n] || (n + 1 < r && (0 === t[n + 1] || 255 === t[n + 1]))); ) ++n; 216 !== o && 217 !== o && e.push(t.subarray(i, n)); } while (n < r); } var Vd = new Uint8Array([255, 216]), Qd = new Uint8Array([255, 217]); function Gd(t) { var e = { type: "image", id: t.id, mimeType: t.mimeType }, n = t.imgData; if ("image/jpeg" === t.mimeType) { var r = []; r.push(Vd), jd(n, r), t.jpegTables && (function (t, e) { if (!e.parsedChunks) { var n = []; jd(e.data, n), (e.parsedChunks = n); } for ( var r = 0; r < t.length && !(t[r][1] >= 192 && t[r][1] <= 192); ) r++; Array.prototype.splice.apply( t, Array.prototype.concat.call([r, 0], e.parsedChunks) ); })(r, t.jpegTables), r.push(Qd), r.forEach(function (t) { var n = t[1]; n >= 192 && n <= 195 && ((e.height = kd(t, 5)), (e.width = kd(t, 7))); }), (e.data = (function (t) { for (var e = 0, n = 0; n < t.length; n++) e += t[n].length; var r = new Uint8Array(e), i = 0; for (n = 0; n < t.length; n++) { var o = t[n]; r.set(o, i), (i += o.length); } return r; })(r)), (e.dataType = Bo.JPEG); var i = t.alphaData; if (i) { var o = e.width * e.height; try { e.alphaData = fa.inflate(i, o, !0); } catch (t) { e.alphaData = new Uint8Array(o); } } } else !(function (t, e) { if (73 === e[12] && 72 === e[13] && 68 === e[14] && 82 === e[15]) { (t.width = Ud(e, 16)), (t.height = Ud(e, 20)); var n = e[26]; t.hasAlpha = 4 === n || 6 === n; } })(e, n), (e.data = n), (e.dataType = Bo.PNG); return e; } var zd = (function () { return function (t, e, n, r, i, o, a) { t && Object.freeze(t), (this.controlTags = t), (this.labelNames = e), i && Object.freeze(i), (this.soundStreamHead = n), (this.soundStreamBlock = r), (this.actionBlocks = i), o && Object.freeze(o), (this.initActionBlocks = o), (this.buttonStateName = ""), a && Object.freeze(a), (this.exports = a); }; })(), Hd = ["up", "over", "down", "hitTest"]; function Xd(t, e, n) { return ( (t[e++] = n.a), (t[e++] = n.b), (t[e++] = n.c), (t[e++] = n.d), (t[e++] = n.tx / 20), (t[e++] = n.ty / 20), e ); } var Yd = [Mu.LEFT, Mu.RIGHT, Mu.CENTER, Mu.JUSTIFY], qd = (function () { function t(t) { (this.parser = t), (this._awaySymbols = {}), (this._buttonIds = {}), (this._mcIds = {}), (this.reqursive = !0); } return ( Object.defineProperty(t.prototype, "factory", { get: function () { return this.parser.factory; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "awaySymbols", { get: function () { return this._awaySymbols; }, enumerable: !0, configurable: !0, }), (t.prototype.prepareFrameScriptsForAVM1 = function (t, e, n, r) { return this.parser.swfFile.useAVM1 ? this.parser.factory.createFrameScripts(t, e, n, r) : t; }), (t.prototype.createChildInstanceForTimeline = function (t, e, n) { bu.invalidAS3Constructors = !0; var r, i = this.awaySymbols[e]; if (i.isAsset(qs)) (r = ru.getNewSprite(i)).mouseEnabled = !1; else if (i.isAsset(ru)) (r = ru.getNewSprite(i.graphics)).mouseEnabled = !1; else if (i.isAsset(su)) (r = su.getNewMorphSprite(i.graphics)).mouseEnabled = !1; else if (i.isAsset(nn)) { var o = new Pc(i); (o.alphaBlending = i.transparent), (r = cu.getNewBillboard(o)); } else r = i.adapter.clone(!1).adaptee; if (this.parser.swfFile.useAVM1) { var a = t.placeObjectTagsForSessionIDs[n]; a && (a.variableName || (a.events && a.events.length > 0)) && ((r.adapter.placeObjectTag = a), (r.adapter.initEvents = a)); } return (r.partitionClass = vi), (r._sessionID = n), r; }), (t.prototype._createShape = function (t, e, n) { var r = new qs(); return ( r.queueShapeTag(t), (r.name = n || "AwayJS_shape_" + t.id.toString()), (r.className = t.className), "morphshape" === t.type ? new su(r) : r ); }), (t.prototype._createFont = function (t, e, n) { return ( (t.away.className = t.className), t.className && Vc.registerFontForClassName(t.away, t.className), t ); }), (t.prototype._createSprite = function (t, e, n) { var r = this.framesToTimeline(e, t, t.frames, null, null); if (t.scalingGrid) { var i = t.scalingGrid, o = i.xMin, a = i.xMax, s = i.yMin, u = i.yMax; r.scale9Grid = new K(o / 20, s / 20, (a - o) / 20, (u - s) / 20); } return ( (r.className = t.className), (r.name = n || "AwayJS_mc_" + t.id.toString()), r.buttonMode ? (this._buttonIds[t.id] = !0) : (this._mcIds[t.id] = !0), r ); }), (t.prototype._createText = function (t, e, n) { ((e = e || this.factory.createTextField(t))._symbol = t), (e.textFormat = new zc()), (e.className = t.className); var r = this.reqursive ? this.createAwaySymbol(t.tag.fontId) : this._awaySymbols[t.tag.fontId]; r && ((e.textFormat.font = r.away), (e.textFormat.font_table = r.away.get_font_table( r.fontStyleName, Nc.assetType ))); var i = t.tag; return ( (e.textFormat.size = i.fontHeight / 20), (e.textColor = 4 & i.flags ? w.f32_RGBA_To_f32_ARGB(i.color) : 16777215), (e.textFormat.leftMargin = i.leftMargin / 20), (e.textFormat.rightMargin = i.rightMargin / 20), (e.textFormat.letterSpacing = i.letterSpacing / 20), (e.textFormat.leading = i.leading / 20), (e.textFormat.align = Yd[i.align]), (e.textOffsetX = t.fillBounds.xMin / 20), (e.textOffsetY = t.fillBounds.yMin / 20), (e.width = (t.fillBounds.xMax - t.fillBounds.xMin) / 20), (e.height = (t.fillBounds.yMax - t.fillBounds.yMin) / 20), (e.border = !!(2048 & i.flags)), (e.background = e.border), (e.multiline = !!(32 & i.flags)), (e.wordWrap = !!(64 & i.flags)), (e.selectable = !!i.flags && !(4096 & i.flags)), i.maxLength && i.maxLength > 0 && (e.maxChars = i.maxLength), 8 & i.flags ? (e.type = "dynamic") : (e.type = "input"), 512 & i.flags ? ((e.html = !0), i.initialText && "" != i.initialText && (e.htmlText = i.initialText)) : ((e.html = !1), i.initialText && "" != i.initialText && (e.text = i.initialText)), (e.name = n || "tf_" + t.id.toString()), e ); }), (t.prototype._createSound = function (t, e, n) { var r = this.parser.awayUnresolvedSymbols[t.id]; return ( r ? ((r.className = this.parser.symbolClassesMap[t.id] || null), (r.name = r.className)) : console.warn("SWF-parser: no sound loaded for sound-id:", t.id), r ); }), (t.prototype._createButton = function (t, e, n) { return ( ((e = this.framesToTimeline( e, t, null, t.states, t.buttonActions, t.buttonSounds )).name = n || "AwayJS_button_" + t.id.toString()), (e.className = t.className), (this._buttonIds[t.id] = !0), e ); }), (t.prototype._createLabel = function (t, e, n) { var r = null, i = !1; (e = e || this.factory.createTextField(t)).className = t.className; for (var o = 0; o < t.records.length; o++) { var a = t.records[o]; a.fontId && (r = this.reqursive ? this.createAwaySymbol(a.fontId) : this._awaySymbols[a.fontId]) && ((a.font = r), (a.font_table = r.away.get_font_table( r.fontStyleName, Nc.assetType )), a.font_table || ((i = !0), console.log("no font_table set"))); } return ( (e.staticMatrix = t.matrix), (e.textOffsetX = t.fillBounds.xMin / 20), (e.textOffsetY = t.fillBounds.yMin / 20), (e.width = t.fillBounds.xMax / 20 - t.fillBounds.xMin / 20 - 1), (e.height = t.fillBounds.yMax / 20 - t.fillBounds.yMin / 20 - 1), i || e.setLabelData(t), (e.name = n || "AwayJS_label_" + t.id.toString()), (e.selectable = t.tag.flags && !(4096 & t.tag.flags)), e ); }), (t.prototype._createImage = function (t, e, n) { if ( !(e = e || this.parser.awayUnresolvedSymbols[t.id]) && t.definition ) { var r = t.definition; (e = new nn(r.width, r.height, !0, null, !1)).addLazySymbol(t); } return ( e && ((e.className = this.parser.symbolClassesMap[t.id] ? this.parser.symbolClassesMap[t.id] : t.className), (e.name = e.className)), e ); }), (t.prototype._createBinary = function (t, e, n) { return ( this.factory.createBinarySymbol && this.factory.createBinarySymbol(t), null ); }), (t.prototype._createVideo = function (t, e, n) { var r = new nn(t.width, t.height, !1, 65280, !1); return ( (r._symbol = t), (r.className = this.parser.symbolClassesMap[t.id] ? this.parser.symbolClassesMap[t.id] : t.className), (r.name = r.className), r ); }), (t.prototype.createAwaySymbol = function (t, e, n) { if ("number" == typeof t) { if (!e && this._awaySymbols[t]) return this._awaySymbols[t]; t = this.parser.getSymbol(t); } if (!t) throw new Error("Symbol can't be null"); if (!e && this._awaySymbols[t.id]) return this._awaySymbols[t.id]; var r; switch (t.type) { case "morphshape": r = this._createShape( t, e, n || "AwayJS_morphshape_" + t.id.toString() ); break; case "shape": r = this._createShape(t, e, n); break; case "font": r = this._createFont(t, e, n); break; case "sprite": r = this._createSprite(t, e, n); break; case "text": r = this._createText(t, e, n); break; case "sound": r = this._createSound(t, e, n); break; case "button": r = this._createButton(t, e, n); break; case "label": r = this._createLabel(t, e, n); break; case "image": r = this._createImage(t, e, n); break; case "binary": r = this._createBinary(t, e, n); break; case "video": r = this._createVideo(t, e, n); break; default: throw Error("Unknown symbol type:" + t.type); } return ( (this._awaySymbols[t.id] = r), this.parser.registerAwayAsset(r, t), r ); }), (t.prototype.framesToTimeline = function (t, e, n, r, i, o) { var a = this; if ((void 0 === o && (o = null), !r && !n)) throw "error when creating timeline - neither movieclip frames nor button-states present"; var s, u = this.reqursive ? function (t) { return a._awaySymbols[t] || a.createAwaySymbol(t); } : function (t) { return a._awaySymbols[t]; }, l = !1; if (((e.isButton = !1), r && !n)) { (l = !0), (e.isButton = !0), (n = []); for (var c = 0; c < 4; c++) { var h = new zd(), p = Hd[c]; (h.controlTags = r[p]), h.controlTags || console.warn( "[SymbolDecoder - parsing Button: no state provided for ", p ), (h.buttonStateName = p), (n[n.length] = h); } } (t = t || this.factory.createMovieClip(null, e)).symbolID = e.id; var d = 0, f = t.timeline; t.timeline.symbolDecoder = this; var g, _, m, y, A, v, b, C, I, E, x, w, S, D, T = [], P = [], O = [], B = [], M = [], L = [], N = [], R = [], F = [], k = [], U = [], j = [], V = [], Q = [], G = [], z = [], H = [], X = [], Y = {}, q = 0, K = [], W = [], J = [], $ = [], Z = [], tt = [], et = {}, nt = 0, rt = n.length, it = 0, ot = 0, at = null, st = -1, ut = -1, lt = -1, ct = !0; Cu.movieClipSoundsManagerClass = Np; var ht, pt, dt, ft = 1 === rt; for (_ = 0; _ < rt; _++) { if ( ((K.length = 0), (W.length = 0), (J.length = 0), ($.length = 0), (Z.length = 0), (tt.length = 0), n[_].soundStreamHead && t.initSoundStream(n[_].soundStreamHead, rt), n[_].soundStreamBlock && t.addSoundStreamBlock(_, n[_].soundStreamBlock), n[_].initActionBlocks && (f.avm1InitActions[_] = n[_].initActionBlocks), n[_].exports) ) for (s in ((f.avm1Exports[_] = n[_].exports), n[_].exports)) { var gt = n[_].exports[s], _t = u(gt.symbolId); _t ? _t.isAsset && (_t.name = gt.className.toLowerCase()) : console.log( "\n\nerror: no away-asset for export\n\n", n[_].exports[s] ); } if ( ((v = !( (n[_].controlTags && 0 != n[_].controlTags.length) || (n[_].labelNames && 0 != n[_].labelNames.length) || (n[_].actionBlocks && 0 != n[_].actionBlocks.length) )), 0 != T.length && v) ) if (l) { for (s in ((it = 0), (it |= 1), P.push(M.length), (T[T.length] = 1), O.push(it), Y)) g = Y[s]; (Y = {}), q++; } else T[T.length - 1] += 1; else { if (((it = 0), l)) { for (s in ((it |= 1), Y)) g = Y[s]; Y = {}; } if ( (P.push(M.length), (T[T.length] = 1), !v && n[_].labelNames && n[_].labelNames.length > 0) ) for (A = n[_].labelNames.length, y = 0; y < A; y++) { var mt = (m = n[_].labelNames[y]); this.parser.swfFile.useAVM1 && (m = m.toLowerCase()), f._labels[m] || (f._labels[m] = { keyFrameIndex: q, name: mt }); } if ( (!v && n[_].actionBlocks && n[_].actionBlocks.length > 0 && f.add_framescript(n[_].actionBlocks, _, t, !0), o && o[q] && 0 != o[q].id && (at = u(o[q].id)) && ((f.audioPool[ot] = { cmd: 15, id: o[q].id, sound: at, props: o[q].info, }), $.push(ot++)), q++, !v && n[_].controlTags && n[_].controlTags.length > 0) ) { for (b = n[_].controlTags.length, C = 0; C < b; C++) switch ( ((D = void 0 === (I = n[_].controlTags[C]).tagCode ? I : this.parser.getParsedTag(I)), (ft = ft && (4 === D.code || 26 === D.code || 70 === D.code)), D.code) ) { case 15: (at = u(D.soundId)), D.soundInfo && 32 & D.soundInfo.flags ? (f.audioPool[ot] = { cmd: 16, id: D.soundId, sound: u(D.soundId), props: D.soundInfo, }) : (f.audioPool[ot] = { cmd: 15, id: D.soundId, sound: u(D.soundId), props: D.soundInfo, }), $.push(ot++); break; case 16: (f.audioPool[ot] = { cmd: 16, id: D.soundId, sound: u(D.soundId), props: D.soundInfo, }), $.push(ot++); break; case 5: case 28: (g = Y[D.depth]) || console.log( "Error in timeline. remove cant find the object to remove" ), this.parser.swfFile.useAVM1 ? (K[K.length] = { depth: 0 | D.depth }) : (K[K.length] = { depth: 0 | g.sessionID }), (Y[D.depth] = null), (et[D.depth.toString()] = null), delete Y[D.depth]; break; case 4: case 26: case 70: if ( ((E = D), (g = Y[D.depth]), (x = E.symbolId > -1), 1 & E.flags && !g) ) break; if (((at = null), (st = -1), (ut = -1), (lt = -1), x)) { if (!(at = u(E.symbolId))) { console.warn("Symbol missed:", E.symbolId); break; } (w = this.parser.dictionary[E.symbolId]), at.isAsset(qs) ? ((at.tryOptimiseSigleImage = ft), (ut = E.symbolId), f.graphicsPool[E.symbolId] || (f.graphicsPool[E.symbolId] = at), ((S = this.factory.createSprite( null, at, w )).mouseEnabled = !1), g && g.awayChild.isAsset(ru) ? (st = g.sessionID) : (null != E && ((E.name && "" != E.name) || this._mcIds[E.symbolId] || this._buttonIds[E.symbolId]) && ((E.name && "" != E.name) || (E.name = "instance" + E.symbolId + "_" + nt++)), g && (this.parser.swfFile.useAVM1 ? (K[K.length] = { depth: 0 | D.depth }) : (K[K.length] = { depth: 0 | g.sessionID, }), (Y[D.depth] = null), (et[D.depth.toString()] = null), delete Y[D.depth]), (st = d++), (E.name || E.variableName || (E.events && E.events.length > 0)) && (f.placeObjectTagsForSessionIDs[st] = E), (g = Y[D.depth] = { sessionID: st, id: E.symbolId, masks: [], isMask: !1, clipDepth: 0, depth: 0, awayChild: S, name: E.name ? E.name : "noname", }), (W[W.length] = { sessionID: st, depth: D.depth, id: E.symbolId, name: E.name, }))) : ((E.name && "" != E.name) || (E.name = "instance" + E.symbolId + "_" + nt++), (st = d++), (E.name || E.variableName || (E.events && E.events.length > 0)) && (f.placeObjectTagsForSessionIDs[st] = E), (ct = !0), Y[D.depth] && Y[D.depth].id == E.symbolId ? (ct = !1) : Y[D.depth] && (this.parser.swfFile.useAVM1 ? (K[K.length] = { depth: 0 | D.depth }) : (K[K.length] = { depth: 0 | Y[D.depth].sessionID, })), (g = Y[D.depth] = { sessionID: st, id: E.symbolId, masks: [], isMask: !1, clipDepth: 0, depth: 0, awayChild: at, name: E.name ? E.name : "noname", }), ct && (W[W.length] = { sessionID: st, depth: D.depth, id: E.symbolId, name: E.name, })); } if ( (16 & E.flags && (at || (at = u(g.id)), at.isAsset(su) && (lt = E.ratio)), !g) ) throw "error in add command"; J[J.length] = { child: g, placeObjectTag: E, swapGraphicsID: ut, ratio: lt, depth: D.depth, }; break; default: console.log("unknown timeline command tag", D); } var yt = R.length, At = K.length; if (At) { yt = R.length; for (var vt = 0; vt < At; vt++) R.push(K[vt].depth); (it |= 2), B.push(R.length - yt), M.push(yt); } if ((At = W.length)) { yt = L.length; for (vt = 0; vt < At; vt++) L.push(W[vt].sessionID), L.push(W[vt].depth), L.push(W[vt].id); (it |= 4), B.push(At), M.push(yt / 3); } for (s in ((At = J.length), Y)) (Y[s].oldMasks = Y[s].masks), (Y[s].masks = []), (Y[s].maskingChanged = !1); if (At) for (vt = 0; vt < At; vt++) (E = J[vt].placeObjectTag), ((g = J[vt].child).maskingChanged = !0), 64 & E.flags && ((Y[E.depth].isMask = !0), (Y[E.depth].clipDepth = E.clipDepth - 1), (Y[E.depth].depth = E.depth)); for (s in Y) if (Y[s].isMask) for (var bt = Y[s].clipDepth; bt > Y[s].depth; ) Y[bt] && Y[bt].masks.push(Y[s].sessionID), bt--; var Ct = 0, It = 0, Et = []; for (s in Y) { var xt = Y[s]; if ( (xt.masks.sort(), xt.oldMasks.sort(), xt.masks.length != xt.oldMasks.length) ) Et.push(xt), (xt.maskingChanged = !0); else for (Ct = 0, It = xt.masks.length, Ct = 0; Ct < It; Ct++) if (xt.masks[Ct] != xt.oldMasks[Ct]) { Et.push(xt), (xt.maskingChanged = !0); break; } } for (It = Et.length, Ct = 0; Ct < It; Ct++) { var wt = !1; if (At) for (vt = 0; vt < At; vt++) J[vt].child == Et[Ct] && (wt = !0); wt || (J[J.length] = { child: Et[Ct], placeObjectTag: null, swapGraphicsID: null, ratio: null, depth: null, }); } if ((At = J.length)) { yt = F.length; var St = 0; for (vt = 0; vt < At; vt++) { var Dt = J[vt]; (E = Dt.placeObjectTag), (g = Dt.child); var Tt = j.length, Pt = 0; null != Dt.swapGraphicsID && Dt.swapGraphicsID >= 0 && (Pt++, j.push(202), V.push(Q.length), Q.push(Dt.swapGraphicsID)); var Ot = E && (this._buttonIds[E.symbolId] || this._mcIds[E.symbolId]); if ( (E && ((E.name && "" != E.name) || Ot) && (Pt++, this._buttonIds[E.symbolId] ? j.push(5) : j.push(4), V.push(X.length), X.push(E.name)), null != E && 4 & E.flags) ) Pt++, j.push(1), V.push(z.length / 6), 0 == E.matrix.a && 0 == E.matrix.b && 0 == E.matrix.c && 0 != E.matrix.d ? (E.matrix.a = 1) : 0 == E.matrix.d && 0 == E.matrix.b && 0 == E.matrix.c && 0 != E.matrix.a && (E.matrix.d = 1), Xd(z, z.length, E.matrix), (et[Dt.depth.toString()] = E.matrix); else if (null != Dt.depth) { var Bt = et[Dt.depth.toString()]; Bt && (Pt++, j.push(1), V.push(z.length / 6), Xd(z, z.length, Bt)); } if ( (null != E && 8 & E.flags && (j.push(2), V.push(H.length / 8), Pt++, (ht = H), (pt = H.length), (dt = E.cxform), (ht[pt++] = dt.redMultiplier / 256), (ht[pt++] = dt.greenMultiplier / 256), (ht[pt++] = dt.blueMultiplier / 256), (ht[pt++] = dt.alphaMultiplier / 256), (ht[pt++] = dt.redOffset), (ht[pt++] = dt.greenOffset), (ht[pt++] = dt.blueOffset), (ht[pt++] = dt.alphaOffset)), null != Dt.ratio && Dt.ratio >= 0 && (Pt++, j.push(203), V.push(Q.length), Q.push(0 | Dt.ratio)), g.maskingChanged) ) { Pt++, j.push(3), V.push(Q.length), Q.push(g.masks.length); for (var Mt = 0, Lt = g.masks; Mt < Lt.length; Mt++) { var Nt = Lt[Mt]; Q.push(Nt); } } if ( (null != E && 64 & E.flags && (Pt++, j.push(200), V.push(0)), null != E && 256 & E.flags) ) { Pt++, j.push(9), V.push(Q.length), Q.push(G.length), Q.push(E.filters.length); for (var Rt = 0; Rt < E.filters.length; Rt++) G.push(E.filters[Rt]); } null != E && 8192 & E.flags && (Pt++, j.push(6), V.push(E.visibility ? 1 : 0)), null != E && 512 & E.flags && (Pt++, j.push(7), V.push(E.blendMode)), Pt > 0 && (St++, F.push(g.sessionID), k.push(Tt), U.push(Pt)); } St > 0 && ((it |= 8), B.push(At), M.push(yt)); } if ((At = $.length)) { (it |= 16), (yt = N.length); for (vt = 0; vt < At; vt++) N.push($[vt]); B.push(At), M.push(yt); } } 0 == O.length && (it |= 1), O.push(it); } } var Ft = ["_up", "_over", "_down", "_hit"]; if (4 == rt) { var kt = 0; for (_ = 0; _ < rt; _++) n[_].labelNames && n[_].labelNames.length > 0 && n[_].labelNames[0] == Ft[_] && kt++; 4 == kt && (l = !0); } return ( (f.numKeyFrames = q), (f.keyframe_durations = new Uint32Array(T)), (f.frame_command_indices = new Uint32Array(P)), (f.frame_recipe = new Uint32Array(O)), (f.command_length_stream = new Uint32Array(B)), (f.command_index_stream = new Uint32Array(M)), (f.add_child_stream = new Uint32Array(L)), (f.add_sounds_stream = new Uint32Array(N)), (f.remove_child_stream = new Uint32Array(R)), (f.update_child_stream = new Uint32Array(F)), (f.update_child_props_indices_stream = new Uint32Array(k)), (f.update_child_props_length_stream = new Uint32Array(U)), (f.property_type_stream = new Uint32Array(j)), (f.property_index_stream = new Uint32Array(V)), (f.properties_stream_int = new Uint32Array(Q)), (f.properties_stream_f32_mtx_scale_rot = new Float32Array([])), (f.properties_stream_f32_mtx_pos = new Float32Array([])), (f.properties_stream_f32_mtx_all = new Float32Array(z)), (f.properties_stream_f32_ct = new Float32Array(H)), (f.properties_stream_strings = X), (f.properties_stream_filters = G), f.init(), l ? ((t.buttonMode = !0), (f.isButton = !0), i && (f.avm1ButtonActions = i), f.extractHitArea(t)) : (t.mouseEnabled = !1), t ); }), t ); })(), Kd = (function (t) { function n() { var e = t.call(this, "ROOT") || this; return (window.AWAY_ROOT_STAT = e), e; } return ( e(n, t), (n.rec = function (t) { return ( this._instance || (this._instance = new n()), this._instance.rec(t) ); }), n ); })( (function () { function t(t, e) { void 0 === e && (e = !1), (this.name = t), (this._subrecord = e), (this._records = {}), (this._startTime = 0), (this._endTime = 0), (this._subs = []), (this._state = 0); } return ( (t.prototype.rec = function (e, n) { if ((void 0 === n && (n = !1), this._subrecord)) throw "Suprecord can't support nested records!"; var r = this._subs[this._subs.length - 1]; return ( (r && 1 === r._state) || (r = this), r._records[e] || (r._records[e] = new t(e, n)) ); }), (t.prototype.begin = function () { if (0 === this._state) { if (!this._subrecord) { this._subs[this._subs.length - 1] && this._subs[this._subs.length - 1].end(); var t = this.rec(this.name + "_" + this._subs.length, !0); return this._subs.push(t), t.begin(); } return (this._state = 1), (this._startTime = performance.now()); } }), (t.prototype.end = function () { for (var t in this._records) this._records[t].end(); if (1 === this._state) return this._subrecord ? ((this._state = 2), (this._endTime = performance.now()), this._endTime - this._startTime) : this._subs[this._subs.length - 1].end(); }), (t.prototype.drop = function () { if ((this.end(), !this._subrecord)) return this._subs[this._subs.length - 1].drop(); (this._state = 3), (this._startTime = this._endTime = 0); }), Object.defineProperty(t.prototype, "startTime", { get: function () { if (3 == this._state) return 0; var t = this._startTime || Number.MAX_VALUE; for (var e in this._records) { var n = this._records[e]; t = Math.min(t, n.startTime); } return t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "endTime", { get: function () { if (3 == this._state) return 0; var t = this._endTime || -Number.MAX_VALUE; for (var e in this._records) { var n = this._records[e]; t = Math.max(t, n.endTime); } return t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "duration", { get: function () { if (3 == this._state) return 0; if (!Object.keys(this._records).length) return this._endTime - this._startTime; var t = 0; for (var e in this._records) t += this._records[e].duration; return t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "selfDuration", { get: function () { return Object.keys(this._records).length ? this.endTime - this.startTime : this._endTime - this._startTime; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "density", { get: function () { return 3 == this._state ? 0 : this.duration / this.selfDuration; }, enumerable: !0, configurable: !0, }), (t.prototype.toString = function () { var t = this.selfDuration; return ( "Name: " + this.name + ", duration: " + this.duration.toFixed(2) + "ms, self: " + t.toFixed(2) + "ms, density:" + (100 * this.density).toFixed(0) + "%" ); }), (t.prototype.toTable = function (t, e) { void 0 === t && (t = 0); var n = " ".repeat(t) + this.toString() + "\n"; if ( 1 === this._subs.length && 1 === Object.keys(this._records).length ) return n; for (var r in this._records) { var i = this._records[r]; 3 !== i._state && ((e && e(i)) || (n += i.toTable(t + 1, e))); } return n; }), t ); })() ), Wd = (function (t) { function r(e) { void 0 === e && (e = null); var n = t.call(this, it.ARRAY_BUFFER) || this; return ( (n._awayUnresolvedSymbols = {}), (n._isEncrypted = !1), (n._currentEncrActionBlocks = []), (n.soundExports = {}), (n.id = 0), (n.externalDependenciesCount = 0), (n._lockFinalize = !1), (n.textFormatAlignMap = [Mu.LEFT, Mu.RIGHT, Mu.CENTER, Mu.JUSTIFY]), (n._buttonSounds = {}), (n.id = r.ID++), (n._swfFile = new a()), (n._factory = e), (n._progressState = 0), (n._symbolDecoder = new qd(n)), n ); } return ( e(r, t), Object.defineProperty(r.prototype, "awayUnresolvedSymbols", { get: function () { return this._awayUnresolvedSymbols; }, enumerable: !0, configurable: !0, }), Object.defineProperty(r.prototype, "awaySymbols", { get: function () { return this._symbolDecoder.awaySymbols; }, enumerable: !0, configurable: !0, }), Object.defineProperty(r.prototype, "swfFile", { get: function () { return this._swfFile; }, enumerable: !0, configurable: !0, }), Object.defineProperty(r.prototype, "factory", { get: function () { return this._factory; }, set: function (t) { (this._factory = t), (r.factory = t), (this._progressState = 5); }, enumerable: !0, configurable: !0, }), (r.prototype.onFactoryRequest = function (t) { this.factory = r.factory || new Ch(); }), (r.supportsType = function (t) { return ( (t = t.toLowerCase()), console.log( "SWFParser supportsType extension: ", t, "result: ", "swf" == t ), "swf" == t ); }), (r.supportsData = function (t) { return ( (67 === t[0] || 70 === t[0] || 90 === t[0]) && 87 === t[1] && 83 === t[2] ); }), (r.prototype._iResolveDependency = function (t) { if (1 != t.assets.length) throw "SWFParser: error when resolving dependency"; var e = this.eagerlyParsedSymbolsMap[t.id]; if (e) switch (e.type) { case "image": var n = t.assets[0]; this._awayUnresolvedSymbols[t.id] = n; break; case "font": break; case "sound": var r = t.assets[0]; this._awayUnresolvedSymbols[t.id] = r; break; default: console.log("finished unknown parsing", t); } else console.log("no eagerlyParsedSymbolsMap for id", t.id); this.externalDependenciesCount--, 0 == this.externalDependenciesCount && (this.parseSymbolsToAwayJS(), (this._progressState = 6)); }), (r.prototype._iResolveDependencyFailure = function (t) { this.externalDependenciesCount--, 0 == this.externalDependenciesCount && (this.parseSymbolsToAwayJS(), (this._progressState = 6)); }), (r.prototype._iResolveDependencyName = function (t, e) { var n = e.name, r = e.name; return (e.name = n), r; }), (r.prototype._pProceedParsing = function () { if (0 === this._progressState) { var t = this._pGetByteData(), e = new Uint8Array(t.arraybytes, 0, t.length); if (!r.supportsData(e)) { var n = e.slice(0, 3).reduce(function (t, e) { return t + String.fromCharCode(e); }, ""); return ( console.error("[SWF Parser] unknow file type:", n), (this.parsingFailure = !0), !1 ); } Kd.rec("parser").begin(), (this._progressState = 1), (this._swfFile.url = this._iFileName), this.initSWFLoading(e, e.length); } else if (2 === this._progressState) if (((this._progressState = 4), this._factory)) this.parseSymbols(); else { if (!this.onFactoryRequest) throw "Error in SWFParser. no factory and noFactoryRequest method exists."; this.onFactoryRequest(this._swfFile), this._factory && this.parseSymbols(); } else if (5 === this._progressState) { if (!this.onFactoryRequest) throw "Error in SWFParser. no factory and noFactoryRequest method exists."; this._factory && this.parseSymbols(), Kd.rec("parser").end(); } return 6 !== this._progressState ? mt.MORE_TO_PARSE : mt.PARSING_DONE; }), (r.prototype.parseSymbols = function () { if ( (Kd.rec("parser").rec("symbols").begin(), (this._factory.url = this._iFileName), (this._pContent = this._factory.createDisplayObjectContainer()), (this._awayUnresolvedSymbols = {}), (this._mapMatsForBitmaps = {}), this.abcBlocks.length && this._factory.executeABCBytes && this._factory.executeABCBytes(this.abcBlocks), (this.externalDependenciesCount = 0), this.eagerlyParsedSymbolsList.length > 0) ) for (var t = 0; t < this.eagerlyParsedSymbolsList.length; t++) { var e = this.eagerlyParsedSymbolsList[t]; if (e) switch (e.type) { case "image": this._pAddDependency( e.id.toString(), null, new ti(this._factory, e.definition.alphaData), new Blob([e.definition.data], { type: e.definition.mimeType, }), !1, !0 ), this.externalDependenciesCount++; break; case "sound": var n = e; if (!n.definition.packaged) { console.warn( "SWF-parser: Missed packaged data for sound-id:", n.id.toString() ); break; } this._pAddDependency( n.id.toString(), null, new Vp(), n, !1, !0 ), this.externalDependenciesCount++; break; case "font": break; default: console.log("encountered eagerly parsed unknown type: ", e); } } this.externalDependenciesCount > 0 ? ((this._progressState = 3), this._pPauseAndRetrieveDependencies()) : (this.parseSymbolsToAwayJS(), (this._progressState = 6), Kd.rec("parser").rec("symbols").end()); }), (r.prototype.getMaterial = function (t) { var e = this._mapMatsForBitmaps[t]; if (!e) { e = new Pc(); var n = this.awaySymbols[t]; (n && (n.isAsset(nn) || n.isAsset(Eh))) || (n = new nn(512, 512, !0, 4278190335, !0)), (e.ambientMethod.texture = new mo(n)), (e.alphaBlending = !0), (e.useColorTransform = !0), (e.bothSides = !0), (this._mapMatsForBitmaps[t] = e); } return e; }), (r.prototype.registerAwayAsset = function (t, e) { this._lockFinalize || ("font" !== e.type ? this._pFinalizeAsset(t) : this._pFinalizeAsset(e.away)); }), (r.prototype.parseSymbolsToAwayJS = function () { Kd.rec("parser").rec("symbols").rec("away").begin(); var t = 0, e = Object.keys(this.dictionary).length, n = (e / 100) | 0, r = {}; (this._symbolDecoder.reqursive = !1), (this._lockFinalize = !0), console.debug("[Away Symbols] Start"); for (var i = 0, o = this.dictionary; i < o.length; i++) { var a = o[i]; if (a) { t++, !n || t % 100 || console.debug( "[Away Symbols] Decoded (" + t + "/" + e + "), " + (((100 * t) / e) | 0) ); var s = this.getSymbol(a.id), u = this._symbolDecoder.createAwaySymbol(s, null, null); u && ("font" !== s.type ? (r[a.id] = u) : (r[s.name] = s.away)); } } var l = this.dictionary[0] || { id: 0, className: this.symbolClassesMap[0], }, c = this._symbolDecoder.framesToTimeline( null, l, this._swfFile.frames, null, null ); for (var h in ((c.isAVMScene = !0), r)) this._pFinalizeAsset(r[h]); this._swfFile.sceneAndFrameLabelData && (c.scenes = this._swfFile.sceneAndFrameLabelData.scenes), this._pFinalizeAsset(c, "scene"), (this._lockFinalize = !1), (this._symbolDecoder.reqursive = !0), Kd.rec("parser").rec("symbols").rec("away").end(); }), (r.prototype._pStartParsing = function (e) { t.prototype._pStartParsing.call(this, e); }), (r.prototype.dispose = function () { (this.swfData = null), (this._dataStream = null); }), (r.prototype.updateTimers = function (t) {}), (r.prototype.initSWFLoading = function (t, e) { Po( 67 === t[0] || 70 === t[0] || 90 === t[0], "Unsupported compression format: " + t[0] ), Po(87 === t[1]), Po(83 === t[2]), Po(t.length >= 30, "At least the header must be complete here."), (this._swfFile.bytesTotal = e), (this._swfFile.frames = []), (this.abcBlocks = []), (this.dictionary = []), (this.fonts = []), (this.symbolClassesMap = []), (this.symbolClassesList = []), (this.eagerlyParsedSymbolsMap = []), (this.eagerlyParsedSymbolsList = []), (this._jpegTables = null), (this._currentFrameLabels = []), (this._currentSoundStreamHead = null), (this._currentSoundStreamBlock = null), (this._currentControlTags = null), (this._currentActionBlocks = null), (this._currentInitActionBlocks = null), (this._currentExports = null), (this._endTagEncountered = !1), (this._isEncrypted = !1), (this._currentEncrActionBlocks = null), this.readHeaderAndInitialize(t); }), (r.prototype.finishLoading = function () { this._decompressor && (this._decompressor.close(), (this._decompressor = null)), (this._progressState = 2), this.scanLoadedData(); }), (r.prototype.getSymbol = function (t) { if (this.eagerlyParsedSymbolsMap[t]) return this.eagerlyParsedSymbolsMap[t]; var e, n = this.dictionary[t]; return n ? (((e = 39 === n.tagCode ? this.parseSpriteTimeline(n) : this.getParsedTag(n)).className = this.symbolClassesMap[t] || null), (e.env = this.env), this._buttonSounds[e.id] && (e.buttonSounds = this._buttonSounds[e.id]), n.scalingGrid && (e.scalingGrid = n.scalingGrid), e) : null; }), (r.prototype.getParsedTag = function (t) { this._dataStream.align(), (this._dataStream.pos = t.byteOffset); var e = Sd[t.tagCode], n = Math.min(t.byteOffset + t.byteLength, this._dataStream.end), r = e( this._dataStream, this._swfFile.swfVersion, t.tagCode, n, this._jpegTables ); return ( this._dataStream.pos !== n && this.emitTagSlopWarning(t, n), (function (t, e, n) { var r; switch (t.code) { case 6: case 21: case 35: case 90: r = Gd(t); break; case 20: case 36: r = (function (t) { var e, n = Bo.None; switch (t.format) { case 3: (e = Nd), (n = Bo.PremultipliedAlphaARGB); break; case 5: (e = Rd), (n = Bo.PremultipliedAlphaARGB); break; case 4: (e = Fd), (n = Bo.PremultipliedAlphaARGB); break; default: console.log("invalid bitmap format"); } var r = { definition: { type: "image", id: t.id, width: t.width, height: t.height, mimeType: "application/octet-stream", data: null, dataType: n, isPMA: n === Bo.PremultipliedAlphaARGB, image: null, }, needParse: !0, lazyParser: function () { var n = this; return ( (this.needParse = !1), (this.definition.data = e(t)), (this.lazyParser = function () { return n; }), r ); }, type: "image", id: t.id, }; return r; })(t); break; case 7: case 34: r = (function (t, e) { for ( var n, r = t.characters, i = { up: [], over: [], down: [], hitTest: [] }, o = 0; (n = r[o++]); ) { var a = e[n.symbolId]; if (a) { var s = { symbolId: a.id, code: 4, depth: n.depth, flags: 0, matrix: null, cxform: null, blendMode: null, filters: null, }; n.filters && ((s.flags |= 256), (s.filters = n.filters)), n.blendMode && ((s.flags |= 512), (s.blendMode = n.blendMode)), n.matrix && ((s.flags |= 4), (s.matrix = n.matrix)), n.cxform && ((s.flags |= 8), (s.cxform = n.cxform)), 1 & n.flags && i.up.push(s), 2 & n.flags && i.over.push(s), 4 & n.flags && i.down.push(s), 8 & n.flags && i.hitTest.push(s); } else console.log("undefined character in button " + t.id); } return { type: "button", id: t.id, buttonActions: t.buttonActions, states: i, }; })(t, e); break; case 37: r = (function (t) { return { type: "text", id: t.id, fillBounds: t.bbox, variableName: t.variableName, tag: t, bold: !1, italic: !1, }; })(t); break; case 10: case 48: case 75: case 91: r = Ld(t, n._iFileName); break; case 46: case 84: case 2: case 22: case 32: case 83: r = (function (t, e) { var n = 8 & t.flags; return ( (t.parser = e), (t.type = n ? "morphshape" : "shape"), t ); })(t, n); break; case 14: r = Cp(t); break; case 60: return { type: "video", id: t.id, width: t.width, height: t.height, deblocking: t.deblocking, smoothing: t.smoothing, codec: t.codecId, }; case 39: return t; case 87: return { type: "binary", id: t.id, data: t.data }; case 11: case 33: r = (function (t) { return { type: "label", id: t.id, fillBounds: t.bbox, matrix: t.matrix, tag: { hasText: !0, initialText: "", html: !0, readonly: !0, }, records: t.records, coords: null, static: !0, require: null, }; })(t); break; default: return t; } return r; })(r, this.dictionary, this) ); }), (r.prototype.readHeaderAndInitialize = function (t) { var e, r = this._swfFile; if ( ((r.swfVersion = t[3]), r.mapSWFVersionToFPVersion(), (this._loadStarted = Date.now()), (this._uncompressedLength = ((e = t)[4] | (e[5] << 8) | (e[6] << 16) | (e[7] << 24)) >>> 0), 67 === t[0] ? ((this._decompressor = fa.create( !0, this._uncompressedLength, !0 )), (r.compression = n.Deflate)) : 90 === t[0] && ((this._decompressor = new Va(!0)), (r.compression = n.LZMA)), (r.bytesLoaded = t.length), (this.swfData = new Uint8Array( r.compression === n.None ? r.bytesTotal : this._uncompressedLength )), (this._dataStream = new Jp(this.swfData.buffer)), (this._dataStream.pos = 8), (this._dataView = this._dataStream.view), this._decompressor) ) { this.swfData.set(t.subarray(0, 8)), (this._uncompressedLoadedLength = 8), (this._decompressor.onData = this.processFirstBatchOfDecompressedData.bind(this)), (this._decompressor.onError = function (t) { throw new Error(t + " from:" + this.id); }.bind(this)); var i = t.subarray(8); this._decompressor.push(i); } else this.swfData.set(t), (this._uncompressedLoadedLength = t.length), (this._decompressor = null), this.parseHeaderContents(), this.finishLoading(); }), (r.prototype.parseHeaderContents = function () { var t = (function (t) { var e = t.readUb(5), n = t.readSb(e), r = t.readSb(e), i = t.readSb(e), o = t.readSb(e); t.align(); var a = t.readUi8(); return { frameRate: t.readUi8() + a / 256, frameCount: t.readUi16(), bounds: new Mo(n, i, r, o), }; })(this._dataStream); (this._swfFile.bounds = this._swfFile.bounds = t.bounds), (this._swfFile.frameRate = this._swfFile.frameRate = t.frameRate), (this._swfFile.frameCount = this._swfFile.frameCount = t.frameCount), (this._lastScanPosition = this._dataStream.pos); }), (r.prototype.processFirstBatchOfDecompressedData = function (t) { Kd.rec("parser").rec("unzip").begin(), this.processDecompressedData(t), this._decompressor && (this._decompressor.onData = this.processDecompressedData.bind(this)); }), (r.prototype.processDecompressedData = function (t) { Kd.rec("parser").rec("unzip").end(); var e = Math.min( t.length, this._uncompressedLength - this._uncompressedLoadedLength ); Oo(this.swfData, t, this._uncompressedLoadedLength, 0, e), (this._uncompressedLoadedLength += e), this._uncompressedLoadedLength === this._uncompressedLength && (this._decompressor && (this._decompressor.onData = null), this.parseHeaderContents(), this.finishLoading()); }), (r.prototype.scanLoadedData = function () { (this._dataStream.pos = this._lastScanPosition), Kd.rec("parser").rec("scanTags").begin(), this.scanTagsToOffset(this._uncompressedLoadedLength, !0), Kd.rec("parser").rec("scanTags").end(), (this._lastScanPosition = this._dataStream.pos); }), (r.prototype.scanTagsToOffset = function (t, e) { for ( var n, r = new Qo(0, 0, 0); (n = this._dataStream.pos) < t - 1 && this.parseNextTagHeader(r); ) { if (0 === r.tagCode) return void (e && (this._endTagEncountered = !0)); var i = r.byteOffset + r.byteLength; if (i > t) return void (this._dataStream.pos = n); this.scanTag(r, e), this._dataStream.pos !== i && this.emitTagSlopWarning(r, i); } }), (r.prototype.parseNextTagHeader = function (t) { var e = this._dataStream.pos, n = this._dataView.getUint16(e, !0); (e += 2), (t.tagCode = n >> 6); var r = 63 & n; if (63 === r) { if (e + 4 > this._uncompressedLoadedLength) return !1; (r = this._dataView.getUint32(e, !0)), (e += 4); } return ( (this._dataStream.pos = e), (t.byteOffset = e), (t.byteLength = r), !0 ); }), (r.prototype.Utf8ArrayToStr = function (t) { var e, n, r, i, o; e = ""; var a = t.length; for (n = 0; n < a; ) switch ((r = t[n++]) >> 4) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: e += String.fromCharCode(r); break; case 12: case 13: (i = t[n++]), (e += String.fromCharCode(((31 & r) << 6) | (63 & i))); break; case 14: (i = t[n++]), (o = t[n++]), (e += String.fromCharCode( ((15 & r) << 12) | ((63 & i) << 6) | ((63 & o) << 0) )); } return e; }), (r.prototype.scanTag = function (t, e) { var n, r, i = this._dataStream, o = i.pos; Po(o === t.byteOffset); var a = t.tagCode, s = t.byteLength; if (39 === a) { this.addLazySymbol(a, o, s); var u = o + s; return ( (i.pos += 4), this.scanTagsToOffset(u, !1), void (this._dataStream.pos !== u && this.emitTagSlopWarning(t, u)) ); } if (qp[a]) { var l = this.addLazySymbol(a, o, s); this.decodeEmbeddedImage(l); } else { if (14 === a) { l = this.addLazySymbol(a, o, s); var c = this.getParsedTag(l), h = new zo(c.id, l, "sound", c); return ( (this.eagerlyParsedSymbolsMap[h.id] = h), void this.eagerlyParsedSymbolsList.push(h) ); } if (Kp[a]) { l = this.addLazySymbol(a, o, s); this.registerEmbeddedFont(l); } else { if (Yp[a]) return this.addLazySymbol(a, o, s), void this.jumpToNextTag(s); if (e || 76 === a || 56 === a) if (Wp[a]) this.addControlTag(a, o, s); else switch (a) { case 69: this.setFileAttributes(s); break; case 86: this.setSceneAndFrameLabelData(s); break; case 9: this._swfFile.backgroundColor = this._swfFile.backgroundColor = Zp(this._dataStream); break; case 8: this._jpegTables || (this._jpegTables = 0 === s ? new Uint8Array(0) : this.swfData.subarray(i.pos, i.pos + s - 2)), this.jumpToNextTag(s); break; case 82: case 72: if (this._swfFile.useAVM1) this.jumpToNextTag(s); else { var p = o + s, d = new jo(); 82 === a ? ((d.flags = i.readUi32()), (d.name = i.readString(-1))) : ((d.flags = 0), (d.name = "")), (d.data = this.swfData.subarray(i.pos, p)), this.abcBlocks.push(d), (i.pos = p); } break; case 76: for (var f = o + s, g = i.readUi16(); g--; ) { var _ = i.readUi16(), m = i.readString(-1); (this.symbolClassesMap[_] = m), this.symbolClassesList.push({ id: _, className: m }); } i.pos = f; break; case 59: if (this._swfFile.useAVM1) { var y = this._currentInitActionBlocks || (this._currentInitActionBlocks = []), A = this._dataView.getUint16(i.pos, !0), v = this.swfData.subarray(o + 2, o + s), b = this._isEncrypted ? null === (n = this._currentEncrActionBlocks) || void 0 === n ? void 0 : n.pop() : void 0; y.push({ spriteId: A, actionsData: v, encryptedData: b, }); } this.jumpToNextTag(s); break; case 12: if (this._swfFile.useAVM1) { var C = this._currentActionBlocks || (this._currentActionBlocks = []); (v = this.swfData.subarray(i.pos, i.pos + s)), (b = this._isEncrypted ? null === (r = this._currentEncrActionBlocks) || void 0 === r ? void 0 : r.pop() : void 0); C.push({ actionsData: v, precedence: i.pos, encryptedData: b, }); } this.jumpToNextTag(s); break; case 18: case 45: var I = _d(this._dataStream, o + s); this._currentSoundStreamHead = wp.FromTag(I); break; case 19: this._currentSoundStreamBlock = this.swfData.subarray( i.pos, (i.pos += s) ); break; case 43: f = i.pos + s; (this._currentFrameLabels[ this._currentFrameLabels.length ] = i.readString(-1)), (i.pos = f); break; case 1: this.finishFrame(); break; case 0: return; case 56: f = i.pos + s; for ( var E = i.readUi16(), x = this._currentExports || (this._currentExports = []); E--; ) { _ = i.readUi16(); var w = i.readString(-1); if (i.pos > f) { i.pos = f; break; } x.push(new Vo(_, w)); } i.pos = f; break; case 17: f = i.pos + s; var S = i.readUi16(); this._buttonSounds[S] = {}; for (var D = 0; D < 4; D++) (this._buttonSounds[S][D] = {}), (this._buttonSounds[S][D].id = i.readUi16()), 0 != this._buttonSounds[S][D].id && (this._buttonSounds[S][D].info = gd(i)); i.pos = f; break; case 78: var T = this.getParsedTag(t); this.dictionary[T.symbolId].scalingGrid = T.splitter; break; case 23: case 13: case 62: case 57: case 71: this.jumpToNextTag(s); break; case 77: this.parseMetaData(s); break; case 74: case 73: case 65: case 66: this.jumpToNextTag(s); break; case 58: case 64: case 63: case 88: case 40: case 41: case 24: case 25: case 93: this.jumpToNextTag(s); break; case 55: case 49: this.jumpToNextTag(s); break; case 51: case 44: case 50: case 53: case 42: case 38: case 52: case 3: case 31: case 47: case 16: case 29: this.jumpToNextTag(s); break; case 255: console.log("Tag 255 present. SWF is encrypted"), (this._isEncrypted = !0), this.jumpToNextTag(s); break; case 253: if (this._isEncrypted) { var P = this._currentEncrActionBlocks || (this._currentEncrActionBlocks = []), O = this.swfData.subarray(o + 2, o + s); P.push({ data: O, bytePos: o + 2, size: s, rawTagId: a, }); } this.jumpToNextTag(s); break; default: a > 100 ? console.log( "Encountered undefined tag " + a + ", probably used for AVM1 obfuscation. See http://ijs.mtasa.com/files/swfdecrypt.cpp." ) : console.log( "Tag not handled by the parser: " + a + ": " + (function (t) { return "SwfTagCode: " + t; })(a) ), this.jumpToNextTag(s); } else this.jumpToNextTag(s); } } }), (r.prototype.parseSpriteTimeline = function (t) { var e = this.swfData, n = this._dataStream, r = this._dataView, i = { id: t.id, type: "sprite", frames: [] }, o = t.byteOffset + t.byteLength, a = i.frames, s = [], u = [], l = null, c = null, h = null, p = null; (n.pos = t.byteOffset + 2), (i.frameCount = r.getUint16(n.pos, !0)), (n.pos += 2); for (var d = new Qo(0, 0, 0); n.pos < o; ) { this.parseNextTagHeader(d); var f = d.byteLength, g = d.tagCode; if (n.pos + f > o) { console.log( "DefineSprite child tags exceed DefineSprite tag length and are dropped" ); break; } if (Wp[g]) u.push(new Qo(g, n.pos, f)), (n.pos += f); else { switch (g) { case 12: if (this._swfFile.useAVM1) { h || (h = []); var _ = e.subarray(n.pos, n.pos + f); h.push({ actionsData: _, precedence: n.pos }); } break; case 59: if (this._swfFile.useAVM1) { p || (p = []); var m = r.getUint16(n.pos, !0); n.pos += 2; _ = e.subarray(n.pos, n.pos + f); p.push({ spriteId: m, actionsData: _ }); } break; case 43: var y = n.pos + f; (s[s.length] = n.readString(-1)), (n.pos = y), (f = 0); break; case 1: a.push(new zd(u, s.concat(), l, c, h, p, null)), (s.length = 0), (u = []), (l = null), (c = null), (h = null), (p = null); break; case 0: (n.pos = o), (f = 0); break; case 18: case 45: var A = n.pos, v = _d(n, (y = n.pos + f)); (l = wp.FromTag(v)), (n.pos = A); break; case 19: (A = n.pos), (y = n.pos + f); (c = this.swfData.subarray(n.pos, y)), (n.pos = A); } (n.pos += f), Po(n.pos <= o); } } return i; }), (r.prototype.parseMetaData = function (t) { this._dataStream.pos += t; }), (r.prototype.jumpToNextTag = function (t) { this._dataStream.pos += t; }), (r.prototype.emitTagSlopWarning = function (t, e) { this._dataStream.pos = e; }), (r.prototype.finishFrame = function () { 0 === this.pendingUpdateDelays && this._swfFile.framesLoaded++, this._swfFile.frames.push( new zd( this._currentControlTags, this._currentFrameLabels.concat(), this._currentSoundStreamHead, this._currentSoundStreamBlock, this._currentActionBlocks, this._currentInitActionBlocks, this._currentExports ) ), (this._currentFrameLabels.length = 0), (this._currentControlTags = null), (this._currentSoundStreamHead = null), (this._currentSoundStreamBlock = null), (this._currentActionBlocks = null), (this._currentInitActionBlocks = null), (this._currentExports = null); }), (r.prototype.setFileAttributes = function (t) { this._swfFile.attributes && this.jumpToNextTag(t); var e = this.swfData[this._dataStream.pos]; (this._dataStream.pos += 4), (this._swfFile.attributes = { network: 1 & e, relativeUrls: 2 & e, noCrossDomainCaching: 4 & e, doAbc: 8 & e, hasMetadata: 16 & e, useGpu: 32 & e, useDirectBlit: 64 & e, }), (this._swfFile.useAVM1 = !this._swfFile.attributes.doAbc); }), (r.prototype.setSceneAndFrameLabelData = function (t) { this._swfFile.sceneAndFrameLabelData ? this.jumpToNextTag(t) : (this._swfFile.sceneAndFrameLabelData = this._swfFile.sceneAndFrameLabelData = vd(this._dataStream, 86)); }), (r.prototype.addControlTag = function (t, e, n) { (this._currentControlTags || (this._currentControlTags = [])).push( new Qo(t, e, n) ), this.jumpToNextTag(n); }), (r.prototype.addLazySymbol = function (t, e, n) { var r = this._dataView.getUint16(this._dataStream.pos, !0), i = new Go(r, t, e, n); return (this.dictionary[r] = i), i; }), (r.prototype.decodeEmbeddedFont = function (t) { var e = this.getParsedTag(t), n = new zo(e.id, t, "font", e); (this.eagerlyParsedSymbolsMap[n.id] = n), this.eagerlyParsedSymbolsList.push(n); var r = Jd(e.bold, e.italic); this.fonts.push({ name: e.name, id: e.id, style: r }); }), (r.prototype.registerEmbeddedFont = function (t) { var e, n, r = this._dataStream, i = this._dataView.getUint16(r.pos, !0); if (10 === t.tagCode) (n = "__autofont__" + t.byteOffset), (e = "regular"); else { var o = this.swfData[r.pos + 2]; e = Jd(!!(1 & o), !!(2 & o)); var a = this.swfData[r.pos + 4]; (r.pos += 5), (n = r.readString(a)); } this.fonts.push({ name: n, id: i, style: e }), (r.pos = t.byteOffset + t.byteLength); }), (r.prototype.decodeEmbeddedImage = function (t) { var e = this.getParsedTag(t), n = new zo(e.id, t, "image", e); (this.eagerlyParsedSymbolsMap[n.id] = n), this.eagerlyParsedSymbolsList.push(n); }), (r.factory = null), (r.ID = 0), r ); })(mt); function Jd(t, e) { return t && e ? "boldItalic" : t ? "bold" : e ? "italic" : "regular"; } var $d = []; function Zd(t, e) { var n = void 0; return ( (e ? $d.concat(e) : $d).forEach(function (e) { var r = e.test, i = e.resolve, o = e.supressErrors, a = void 0 !== o && o, s = e.supressLoad, u = void 0 !== s && s, l = !1; "function" == typeof r ? (l = r(t)) : r instanceof RegExp ? (l = r.test(t)) : "string" == typeof r && (l = r === t), l && (n && console.warn( "[LOADER] Duplicate redirect rules, latest rule would be used!" ), (n = { url: t, supressErrors: a, supressLoad: u }), "function" == typeof i ? (n.url = i(t)) : i instanceof RegExp ? (n.url = t.match(i)[0]) : "string" == typeof i ? (n.url = i) : "string" == typeof l && (n.url = l), void 0 === n.url && (console.warn( "[LOADER] Redirect url is null, would be used original url!" ), (n.url = t))); }), n ); } function tf(t, e) { return "string" == typeof t && t.includes("%") ? (e * parseFloat(t)) / 100 : +t; } var ef = (function (t) { function n(e) { var r = t.call(this) || this; return ( (r._trapResize = !1), (r._volume = 1), (r._gameConfig = null), (r._curFile = null), (n._instance = r), ct.enableParsers([yt, Wd, ti]), (r._time = 0), (r._currentFps = 0), (r._avmHandlers = {}), (r._baseStageWidth = r._stageWidth = 550), (r._baseStageHeight = r._stageHeight = 400), (r._scaleMode = Rp.SHOW_ALL), (r._align = Fp.TOP_LEFT), (r._scaleModeAllowUpdate = !0), (r._alignAllowUpdate = !0), e.stageScaleMode && ((r._scaleMode = e.stageScaleMode), (r._scaleModeAllowUpdate = !1)), e.stageAlign && ((r._align = e.stageAlign), (r._alignAllowUpdate = !1)), e.forceINT && (n.forceINT = e.forceINT), (r.showFrameRate = e.showFPS), (r._frameRate = 30), (r._showFrameRateIntervalID = -1), (r._x = e.x ? e.x : 0), (r._y = e.y ? e.y : 0), (r._w = e.w ? e.w : "100%"), (r._h = e.h ? e.h : "100%"), (r._isPaused = !1), (r._gameConfig = e), r.initAwayEninge(), (r._renderer.view.backgroundColor = 16777215), I.setVolume(1), (r._resizeCallbackDelegate = function (t) { return r.resizeCallback(t); }), window.addEventListener("resize", r._resizeCallbackDelegate), (r._onLoaderStartDelegate = function (t) { return r.onLoaderStart(t); }), (r._onLoaderCompleteDelegate = function (t) { return r.onLoaderComplete(t); }), (r._onAssetCompleteDelegate = function (t) { return r._onAssetComplete(t); }), (r._onLoadErrorDelegate = function (t) { return r._onLoadError(t); }), r._gameConfig.testConfig && (r.avmTestHandler = new jp(r._gameConfig.testConfig, r)), document.addEventListener( "fullscreenchange", r.onFullscreenChanged.bind(r) ), r ); } return ( e(n, t), (n.instance = function () { if (!n._instance) throw "AVMStage._instance should exists but does not"; return n._instance; }), (n.prototype.dispose = function () { console.log("dispose"), this._timer.stop(), (this._timer = null), this._avmHandler.dispose(); }), Object.defineProperty(n.prototype, "root", { get: function () { return this._root; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "rootNode", { get: function () { return this._rootNode; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pool", { get: function () { return this._pool; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "view", { get: function () { return this._view; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "pickGroup", { get: function () { return this._pickGroup; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mousePicker", { get: function () { return this._mousePicker; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "mouseManager", { get: function () { return this._mouseManager; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "config", { get: function () { return this._gameConfig; }, enumerable: !0, configurable: !0, }), (n.prototype.registerAVMStageHandler = function (t) { this._avmHandlers[t.avmVersion] = t; }), Object.defineProperty(n.prototype, "displayState", { get: function () { return this._displayState; }, set: function (t) { var e = this; if (document.fullscreenEnabled) switch (t) { case "fullScreenInteractive": case "fullScreen": Element.prototype.requestFullscreen && document.body.requestFullscreen().then(function () { e._displayState = t; }); break; default: (this._displayState = t), document.fullscreenElement && document.exitFullscreen(); } else this._displayState = "normal"; }, enumerable: !0, configurable: !0, }), (n.prototype.onFullscreenChanged = function (t) { document.fullscreenElement || (this._displayState = "normal"); }), (n.prototype.initAwayEninge = function () { (this._root = new nu()), (this._rootNode = _i.getRootNode(this._root, vi)), (this._partition = this._rootNode.partition), (this._pool = this._partition.rootNode.pool), (this._view = new yi()), this._view.projection.transform.moveTo(0, 0, -1e3), (this._pickGroup = xi.getInstance(this._view)), (this._mousePicker = this._pickGroup.getRaycastPicker( this._partition )), (this._mousePicker.shapeFlag = !0), (this._mouseManager = xh.getInstance(this._view.stage)), (this._renderer = oo .getInstance(this._view, Io) .getRenderer(this._partition)), (this._rendererStage = this._view.stage), (this._rendererStage.container.style.visibility = "hidden"), (this._rendererStage.antiAlias = 0), (this._renderer.renderableSorter = null), (this._projection = this._view.projection), (this._projection.coordinateSystem = _t.RIGHT_HANDED), (this._projection.originX = -1), (this._projection.originY = 1), (this._projection.fieldOfView = (360 * Math.atan(window.innerHeight / 1e3 / 2)) / Math.PI); }), (n.prototype.playSWF = function (t, e) { var n = this; (this._gameConfig = { files: [{ data: t, path: e, resourceType: "GAME" }], }), this.addEventListener(V.LOADER_COMPLETE, function (t) { return n.play(); }), this.loadNextResource(); }), (n.prototype.snapshot = function (t) { var e = new nn( this._stageWidth, this._stageHeight, !0, 4294967295, !1 ); this._renderer.queueSnapshot(e), (this._renderer.view.target = e), this._renderer.render(), (this._renderer.view.target = null), e.invalidate(); for ( var n = e.data, r = new nn( this._stageWidth, this._stageHeight, !0, 4278255615, !1 ), i = 0, o = 0, a = 0; a < this._stageHeight; a++ ) for (var s = 0; s < this._stageWidth; s++) (i = 4 * ((this._stageHeight - 1 - a) * this._stageWidth + s)), (o = w.ARGBtoFloat32(n[i + 3], n[i], n[i + 1], n[i + 2])), r.setPixel32(s, a, o); r.invalidate(); var u = document.createElement("canvas"); (u.width = r.width), (u.height = r.height); var l = u.getContext("2d"), c = l.getImageData(0, 0, r.width, r.height); c.data.set(r.data), l.putImageData(c, 0, 0), t && t(u); }), (n.prototype.loadNextResource = function (t) { var e = this; if ( (void 0 === t && (t = null), (this._curFile = this._gameConfig.files.shift()), this._curFile) ) { var n = new Wd(); if ( ((n._iFileName = this._curFile.path), "GAME" != this._curFile.resourceType) ) Vc.deviceFontsLoading = !0; else { if (((Vc.deviceFontsLoading = !1), this._swfFile)) throw "Only playing of 1 SWF file is supported at the moment"; n.onFactoryRequest = function (t) { (e._swfFile = t), (e.frameRate = e._swfFile.frameRate), (e.color = w.f32_RGBA_To_f32_ARGB(t.backgroundColor)), (e._stageWidth = e._swfFile.bounds.width / 20), (e._stageHeight = e._swfFile.bounds.height / 20), (e._baseStageHeight = e._stageHeight), (e._baseStageWidth = e._stageWidth), e.resizeCallback(); var r = e._swfFile.useAVM1 ? "AVM1" : "AVM2"; if ( ((e._avmHandler = e._avmHandlers[r]), e.avmTestHandler && !e.avmTestHandler.config.settings.onlyTraces && e.avmTestHandler.setSWF(e._swfFile), !e._avmHandler) ) throw "no avm-handler installed for " + r; e._avmHandler.init(e, e._swfFile, function (t) { (n.factory = e._avmHandler.factory), (Wd.factory = e._avmHandler.factory), t && e.dispatchEvent(new Tt(Tt.AVM_COMPLETE, r)); }); }; } pt.addEventListener(V.LOADER_START, this._onLoaderStartDelegate), pt.addEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), pt.addEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), pt.addEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), this._curFile.data ? pt.loadData(this._curFile.data, null, this._curFile.path, n) : pt.load( new dt(this._curFile.path), null, this._curFile.path, n ); } else { if (!this._swfFile) throw "no valid SWFFile was loaded!"; t && this.dispatchEvent(t); } }), (n.prototype.load = function () { if (!this._gameConfig.files || !this._gameConfig.files.length) throw "AVMStage: gameConfig.files must have positive length"; $d.push.apply($d, this._gameConfig.redirects), this.loadNextResource(new V(V.LOADER_COMPLETE)); }), (n.prototype.onLoaderStart = function (t) { this.dispatchEvent(t); }), (n.prototype._onAssetComplete = function (t) { "GAME" == this._curFile.resourceType && (0 == n.runtimeStartTime && (n.runtimeStartTime = Date.now()), this._avmHandler.addAsset(t.asset, !0)), this.dispatchEvent(t); }), (n.prototype.onLoaderComplete = function (t) { this._root && this._root.dispatchEvent(t), pt.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), pt.removeEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), pt.removeEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), this.loadNextResource(t); }), (n.prototype._onLoadError = function (t) { pt.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), pt.removeEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), pt.removeEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), console.log("error loading swf"), this.dispatchEvent(t); }), (n.prototype.play = function (t) { void 0 === t && (t = 0), this.resizeCallback(null), (this._timer = new xt(this.main_loop, this)), this._timer.start(); var e = this._root.getChildAt(0); e ? (t && (e.currentFrameIndex = t), this.showNextFrame(0), (this._rendererStage.container.style.visibility = "visible")) : console.warn( "warning: AVMPlayer.play called, but no scene is loaded" ); }), (n.prototype.updateFPS = function () { (this._fpsTextField.style.visibility = this._currentFps && this._frameRate ? "visible" : "hidden"), (this._fpsTextField.innerText = this._currentFps.toFixed(2) + "/" + this._frameRate + " fps"), (this._currentFps = 0); }), (n.prototype.setStageDimensions = function (t, e, n, r) { (this._x = t), (this._y = e), (this._w = n), (this._h = r), this.resizeStageInternal(); }), (n.prototype.resizeStageInternal = function (t) { void 0 === t && (t = !1); var e = tf(this._x, window.innerWidth), n = tf(this._y, window.innerHeight), r = tf(this._w, window.innerWidth), i = tf(this._h, window.innerHeight), o = !!this._gameConfig.maxStageScale, a = +this._gameConfig.maxStageScale || 10, s = a * this._baseStageWidth, u = a * this._baseStageHeight, l = this._baseStageWidth / this._baseStageHeight, c = this._rendererStage.container, h = o ? self.devicePixelRatio : 1, p = e, d = n, f = r, g = i, _ = r, m = i; switch (this._scaleMode) { case Rp.NO_SCALE: (this._projection.fieldOfView = (360 * Math.atan(i / 1e3 / 2)) / Math.PI), (this._stageWidth = r), (this._stageHeight = i); break; case Rp.SHOW_ALL: (m = i), (_ = l * i), (f = l * (g = Math.min(u, m * h))), (_ > r || f > s) && ((_ = r), (m = r / l), (g = (f = Math.min(s, _ * h)) / l)), (p += (r - _) / 2), (d += (i - m) / 2), o && (this._rendererStage.pixelRatio = 1), (this._projection.fieldOfView = (360 * Math.atan(this._stageHeight / 1e3 / 2)) / Math.PI); break; case Rp.EXACT_FIT: case Rp.NO_BORDER: this._projection.fieldOfView = (360 * Math.atan(i / 1e3 / 2)) / Math.PI; break; default: console.log( "Stage: only implemented StageScaleMode are NO_SCALE, SHOW_ALL" ); } switch (this._align) { case Fp.TOP_LEFT: (this._view.x = p), (this._view.y = d); break; default: (this._view.x = p), (this._view.y = d), console.log("Stage: only implemented StageAlign is TOP_LEFT"); } (this._view.width = f), (this._view.height = g), (c.style.width = _ + "px"), (c.style.height = m + "px"), this._fpsTextField && (this._fpsTextField.style.left = 0.5 * window.innerWidth - 50 + "px"), this._avmHandler && !t && (this._trapResize = !0); }), (n.prototype.resizeCallback = function (t) { this.resizeStageInternal(); }), (n.prototype.pause = function () { (this._volume = I.getVolume()), (this._isPaused = !0), I.setVolume(0); }), (n.prototype.unPause = function () { I.setVolume(this._volume), (this._isPaused = !1); }), Object.defineProperty(n.prototype, "isPaused", { get: function () { return this._isPaused; }, set: function (t) { this._isPaused = t; }, enumerable: !0, configurable: !0, }), (n.prototype.main_loop = function (t) { if (!this._isPaused) { if ( (this._trapResize && (this._avmHandler && this._avmHandler.resizeStage(), (this._trapResize = !1)), !this._avmHandler) ) throw "error - can not render when no avm-stage is available"; var e = Math.floor(1e3 / this._frameRate); (this._time += Math.min(t, e)), this._time >= e && (this._currentFps++, this.showNextFrame(this._time), (this._time -= e)); } }), (n.prototype.requestRender = function () { bu.execute_queue(), this._renderer.render(); }), (n.prototype.showNextFrame = function (t) { if (this._isPaused) return Np.enterFrame(), void Np.exitFrame(); Np.enterFrame(), this.avmTestHandler && this.avmTestHandler.dispatchEvents(), this._mouseManager.fireMouseEvents(this._mousePicker), this._avmHandler.enterFrame(t), this.avmTestHandler && this.avmTestHandler.nextFrame(), this._renderer.render(), Np.exitFrame(); }), Object.defineProperty(n.prototype, "align", { get: function () { return this._align; }, set: function (t) { this._alignAllowUpdate && ((this._align = t), this.resizeStageInternal(!0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "accessibilityImplementation", { get: function () { return ( console.log( "AVMStage: get accessibilityImplementation not implemented" ), this._align ); }, set: function (t) { console.log( "AVMStage: accessibilityImplementation not implemented" ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "color", { get: function () { return this._renderer.view.backgroundColor; }, set: function (t) { this._renderer.view.backgroundColor = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "frameRate", { get: function () { return this._frameRate; }, set: function (t) { this._frameRate = t; }, enumerable: !0, configurable: !0, }), (n.prototype.getLocalMouseX = function (t) { return t .getInverseMatrix3D() .transformVector( this._renderer.view.unproject( this._view.stage.screenX, this._view.stage.screenY, 1e3 ) ).x; }), (n.prototype.getLocalMouseY = function (t) { return t .getInverseMatrix3D() .transformVector( this._renderer.view.unproject( this._view.stage.screenX, this._view.stage.screenY, 1e3 ) ).y; }), (n.prototype.getLocalTouchPoints = function (t) { for ( var e, n = new Array(), r = this._view.stage.touchPoints.length, i = 0; i < r; i++ ) (e = t .getInverseMatrix3D() .transformVector( this._renderer.view.unproject( this._view.stage.touchPoints[i].x, this._view.stage.touchPoints[i].y, 1e3 ) )), n.push(new Oe(e.x, e.y, this._view.stage.touchPoints[i].id)); return n; }), Object.defineProperty(n.prototype, "scaleMode", { get: function () { return this._scaleMode; }, set: function (t) { this._scaleModeAllowUpdate && ((this._scaleMode = t), this.resizeStageInternal(!0)); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "showFrameRate", { get: function () { return this._showFrameRate; }, set: function (t) { var e = this; t != this._showFrameRate && ((this._showFrameRate = t), t ? ((this._fpsTextField = document.createElement("div")), (this._fpsTextField.style.cssFloat = "none"), (this._fpsTextField.style.backgroundColor = "#000"), (this._fpsTextField.style.position = "fixed"), (this._fpsTextField.style.top = "5px"), (this._fpsTextField.style.width = "100px"), (this._fpsTextField.style.height = "20px"), (this._fpsTextField.style.right = "5px"), (this._fpsTextField.style.textAlign = "center"), (this._fpsTextField.style.color = "#ffffff"), (this._fpsTextField.style.fontSize = "16"), (this._fpsTextField.style.visibility = "hidden"), (this._fpsTextField.innerHTML = ""), document.body.appendChild(this._fpsTextField), (this._showFrameRateIntervalID = window.setInterval( function () { return e.updateFPS(); }, 1e3 ))) : this._showFrameRateIntervalID && (clearInterval(this._showFrameRateIntervalID), (this._showFrameRateIntervalID = -1), document.body.removeChild(this._fpsTextField), (this._fpsTextField = null))); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "stageHeight", { get: function () { return this._stageHeight; }, set: function (t) { (this._stageHeight = t), this.resizeCallback(); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "stageWidth", { get: function () { return this._stageWidth; }, set: function (t) { (this._stageWidth = t), this.resizeCallback(); }, enumerable: !0, configurable: !0, }), (n.runtimeStartTime = 0), (n._instance = null), (n.forceINT = !1), n ); })(h), nf = { instance: undefined }; function rf(t) { var e = Object.prototype.hasOwnProperty, n = []; for (var r in t) e.call(t, r) && n.push([r, t[r]]); return n; } function of(t, e) { return Object.prototype.hasOwnProperty.call(t, e); } function af(t, e) { do { var n = Object.getOwnPropertyDescriptor(t, e); if (n) return n; t = Object.getPrototypeOf(t); } while (t); return null; } function sf(t, e, n) { Object.defineProperty(t, e, { value: n, writable: !1, configurable: !0, enumerable: !1, }); } function uf(t, e, n, r, i) { for (var o in (void 0 === n && (n = null), void 0 === r && (r = !0), void 0 === i && (i = !1), e)) if (of(e, o) && (!n || n(o))) { var a = Object.getOwnPropertyDescriptor(e, o); if (!r && of(t, o)) continue; try { i && !1 === a.writable && (a.writable = !0), Object.defineProperty(t, o, a); } catch (t) { up("Can't define: " + o); } } } function lf(t, e, n) { for (var r = 0; r < n.length; r++) { var i = n[r]; t[i] = e[i]; } } function cf(t, e, n) { Object.defineProperty(t, e, { value: n, writable: !0, configurable: !0, enumerable: !1, }); } var hf = { boxValue: function (t) { return Wh(t) || Xh(t) ? t : Object(t); }, toKeyValueArray: rf, isPrototypeWriteable: function (t) { return Object.getOwnPropertyDescriptor(t, "prototype").writable; }, hasOwnProperty: of, propertyIsEnumerable: function (t, e) { return Object.prototype.propertyIsEnumerable.call(t, e); }, getPropertyDescriptor: af, hasOwnGetter: function (t, e) { var n = Object.getOwnPropertyDescriptor(t, e); return !(!n || !n.get); }, getOwnGetter: function (t, e) { var n = Object.getOwnPropertyDescriptor(t, e); return n ? n.get : null; }, hasOwnSetter: function (t, e) { var n = Object.getOwnPropertyDescriptor(t, e); return !(!n || !n.set); }, createArrayMap: function () { return []; }, createMap: function () { return Object.create(null); }, defineReadOnlyProperty: sf, copyProperties: function (t, e) { for (var n in e) t[n] = e[n]; }, copyOwnProperties: function (t, e) { for (var n in e) of(e, n) && (t[n] = e[n]); }, copyOwnPropertyDescriptors: uf, copyPropertiesByList: lf, defineNonEnumerableGetter: function (t, e, n) { Object.defineProperty(t, e, { get: n, configurable: !0, enumerable: !1 }); }, defineNonEnumerableProperty: cf, }; function pf(t, e, n) { for (var r = e - 1; r >= 0; r--) n[r] = t.pop(); n.length = e; } function df(t, e) { for (var n = 0; n < e.length; n++) t.push(e[n]); } var ff = new Uint8Array([ 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, ]), gf = new Int32Array([ -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551, ]); var _f = { _md5R: ff, _md5K: gf, hashBytesTo32BitsMD5: function (t, e, n) { var r, i, o, a = ff, s = gf, u = 1732584193, l = -271733879, c = -1732584194, h = 271733878, p = (n + 72) & -64, d = new Uint8Array(p); for (r = 0; r < n; ++r) d[r] = t[e++]; for (d[r++] = 128, o = p - 8; r < o; ) d[r++] = 0; (d[r++] = (n << 3) & 255), (d[r++] = (n >> 5) & 255), (d[r++] = (n >> 13) & 255), (d[r++] = (n >> 21) & 255), (d[r++] = (n >>> 29) & 255), (d[r++] = 0), (d[r++] = 0), (d[r++] = 0); var f = new Int32Array(16); for (r = 0; r < p; ) { for (i = 0; i < 16; ++i, r += 4) f[i] = d[r] | (d[r + 1] << 8) | (d[r + 2] << 16) | (d[r + 3] << 24); var g, _, m = u, y = l, A = c, v = h; for (i = 0; i < 64; ++i) { i < 16 ? ((g = (y & A) | (~y & v)), (_ = i)) : i < 32 ? ((g = (v & y) | (~v & A)), (_ = (5 * i + 1) & 15)) : i < 48 ? ((g = y ^ A ^ v), (_ = (3 * i + 5) & 15)) : ((g = A ^ (y | ~v)), (_ = (7 * i) & 15)); var b = v, C = (m + g + s[i] + f[_]) | 0, I = a[i]; (v = A), (A = y), (y = (y + ((C << I) | (C >>> (32 - I)))) | 0), (m = b); } (u = (u + m) | 0), (l = (l + y) | 0), (c = (c + A) | 0), (h = (h + v) | 0); } return u; }, mixHash: function (t, e) { return (((31 * t) | 0) + e) | 0; }, }, mf = function t(e) { var n; switch (typeof e) { case "boolean": return e ? "" : ""; case "number": return "" + e + ""; case "object": if (null === e) return ""; if ("hasOwnProperty" in e && e.hasOwnProperty("length")) { n = ""; for (var r = 0; r < e.length; r++) n += '' + t(e[r]) + ""; return n + ""; } for (var i in ((n = ""), e)) n += '' + t(e[i]) + ""; return n + ""; case "string": return ( "" + e .replace(/&/g, "&") .replace(//g, ">") + "" ); case "undefined": return ""; } }, yf = (function () { function t() {} return ( Object.defineProperty(t, "interfaceID", { get: function () { return t._interfaceID; }, set: function (e) { t._interfaceID = e; }, enumerable: !0, configurable: !0, }), (t.ensureInit = function () { window[t._interfaceID] || (window[t._interfaceID] = {}), (window[t._interfaceID].__flash__toXML = mf); }), (t.initJS = function (e) { t.callback = e; }), (t.registerCallback = function (e) { t.ensureInit(), (window[t._interfaceID][e] = function () { for (var n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; return t.callback(e, n); }); }), (t.unregisterCallback = function (e) { t.ensureInit(), delete window[t._interfaceID][e]; }), (t.eval = function (e) { t.ensureInit(); try { return window.eval(e); } catch (t) { console.warn( "[ExternalInterfaceService] Eval crashed:\n", e, "\n" + t.message ); } }), (t.call = function (t) {}), (t.getId = function () { return null; }), (t.enabled = !0), (t._interfaceID = "flash"), t ); })(); console.debug("AwayFL - SWF-Loader - 0.4.105"); var Af = (function () { return function (t, e, n, r, i) { (this.flags = t), (this.value = e), (this.get = n), (this.set = r), (this.watcher = i); }; })(), vf = (function (t) { function n(e) { var n = t.call(this) || this; (n.initialDepth = 0), (n.scriptRefsToChilds = {}), (n._isGhost = !1), (n._avm1Context = e), (n._ownProperties = Object.create(null)), (n.scriptRefsToChilds = {}), (n._prototype = null), (n._blockedByScript = !1), (n._ctBlockedByScript = !1), (n._visibilityByScript = !1); var r = n, i = new Af( 131, null, { alCall: function (t, e) { return r.alPrototype; }, }, { alCall: function (t, e) { r.alPrototype = e[0]; }, } ); return n.alSetOwnProperty("__proto__", i), n; } return ( e(n, t), Object.defineProperty(n.prototype, "isGhost", { get: function () { return this._isGhost; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "eventObserver", { get: function () { return this._eventObserver; }, set: function (t) { this._eventObserver = t; }, enumerable: !0, configurable: !0, }), (n.prototype.makeGhost = function () { this.deleteOwnProperties(), this.alPut("__proto__", null), (this._isGhost = !0); }), (n.prototype.dispose = function () {}), (n.prototype.updateFilters = function (t) {}), (n.prototype.isBlockedByScript = function () { return this._blockedByScript; }), (n.prototype.isColorTransformByScript = function () { return this._ctBlockedByScript; }), (n.prototype.isVisibilityByScript = function () { return this._visibilityByScript; }), (n.prototype.initAdapter = function () {}), (n.prototype.freeFromScript = function () { (this.protoTypeChanged = !1), (this._blockedByScript = !1), (this._ctBlockedByScript = !1), (this._visibilityByScript = !1); }), (n.prototype.clone = function () { return new n(this._avm1Context); }), Object.defineProperty(n.prototype, "context", { get: function () { return this._avm1Context; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "alPrototype", { get: function () { return this._prototype; }, set: function (t) { for (var e = t; e; ) { if (e === this) return; e = e.alPrototype; } this._prototype = t; }, enumerable: !0, configurable: !0, }), (n.prototype.alGetPrototypeProperty = function () { return this.alGet("prototype"); }), (n.prototype.alSetOwnPrototypeProperty = function (t) { this.alSetOwnProperty("prototype", new Af(65, t)); }), (n.prototype.alGetConstructorProperty = function () { return this.alGet("__constructor__"); }), (n.prototype.alSetOwnConstructorProperty = function (t) { this.alSetOwnProperty("__constructor__", new Af(65, t)); }), (n.prototype._debugEscapeProperty = function (t) { var e = this.context, n = om(e, t); return e.isPropertyCaseSensitive || (n = n.toLowerCase()), "$Bg" + n; }), (n.prototype.alGetOwnProperty = function (t) { return this._isGhost ? null : ("string" != typeof t || this.context.isPropertyCaseSensitive || (t = t.toLowerCase()), this._ownProperties[t]); }), (n.prototype.alSetOwnProperty = function (t, e) { if (!this._isGhost) { var n = this.context.normalizeName(t); e.originalName || this.context.isPropertyCaseSensitive || (e.originalName = t), (this._ownProperties[n] = e); } }), (n.prototype.alHasOwnProperty = function (t) { if (this._isGhost) return !1; var e = this.context.normalizeName(t); return !!this._ownProperties[e]; }), (n.prototype.alDeleteOwnProperty = function (t) { var e = this.context.normalizeName(t); delete this._ownProperties[e]; }), (n.prototype.deleteOwnProperties = function () { for (var t = this.alGetOwnPropertiesKeys(), e = 0; e < t.length; e++) this.alDeleteOwnProperty(t[e]); }), (n.prototype.alGetOwnPropertiesKeys = function () { var t, e = []; if (this._isGhost) return e; if (this.context.isPropertyCaseSensitive) for (var n in this._ownProperties) 1 & (t = this._ownProperties[n]).flags || e.push(n); else for (var r in this._ownProperties) 1 & (t = this._ownProperties[r]).flags || e.push(t.originalName); return e; }), (n.prototype.alGetProperty = function (t) { if (this._isGhost) return null; var e = this.alGetOwnProperty(t); return ( e || (this._prototype ? this._prototype.alGetProperty(t) : void 0) ); }), (n.prototype.alGet = function (t) { if (!this._isGhost) { var e = this.context.normalizeName(t), n = this.alGetProperty(e); if (n) { if (64 & n.flags) return n.value; var r = n.get; return r ? r.alCall(this) : void 0; } } }), (n.prototype.alCanPut = function (t) { if (this._isGhost) return !1; var e = this.alGetOwnProperty(t); if (e) return 128 & e.flags ? !!e.set : !(4 & e.flags); var n = this._prototype; return !n || n.alCanPut(t); }), (n.prototype.alPut = function (t, e) { if (!this._isGhost) { var n = t; if ( ((t = this.context.normalizeName(t)), e && "object" == typeof e && "symbol" === e.avmType && "this" != t && "_parent" != t && !e.dynamicallyCreated && e.adaptee && e.adaptee.parent && e.adaptee.parent.adapter && e.adaptee.parent.adapter.scriptRefsToChilds && (e.adaptee.parent.adapter.scriptRefsToChilds[e.adaptee.name] = { obj: this, name: t, }), this.alCanPut(t)) ) { var r = this.alGetOwnProperty(t); if (r && 64 & r.flags) return ( r.watcher && (e = r.watcher.callback.alCall(this, [ r.watcher.name, r.value, e, r.watcher.userData, ])), void (t in this._ownProperties ? (r.value = e) : this.alSetOwnProperty(n, new Af(r.flags, e))) ); if ( void 0 !== e || ("_x" != t && "_y" != t && "_xscale" != t && "_yscale" != t && "_width" != t && "_height" != t) ) { var i = this.alGetProperty(t); if (i && 128 & i.flags) { if (i.watcher) { var o = i.get ? i.get.alCall(this) : void 0; e = i.watcher.callback.alCall(this, [ i.watcher.name, o, e, i.watcher.userData, ]); } i.set.alCall(this, [e]); } else if ( (i && i.watcher && (e = i.watcher.callback.alCall(this, [ i.watcher.name, i.value, e, i.watcher.userData, ])), e && e.isTextVar) ) { (e = e.value), ((a = new Af(i ? i.flags : 64, e)).isTextVar = !0), this.alSetOwnProperty(n, a); } else { var a = new Af(i ? i.flags : 64, e); this.alSetOwnProperty(n, a); } } } } }), (n.prototype.alHasProperty = function (t) { return !this._isGhost && !!this.alGetProperty(t); }), (n.prototype.alDeleteProperty = function (t) { var e = this.alGetOwnProperty(t); return !e || (!(2 & e.flags) && (this.alDeleteOwnProperty(t), !0)); }), (n.prototype.alAddPropertyWatcher = function (t, e, n) { if (this._isGhost) return !1; var r = this.alGetProperty(t); return ( !!r && ((r.watcher = { name: t, callback: e, userData: n }), !0) ); }), (n.prototype.alRemotePropertyWatcher = function (t) { var e = this.alGetProperty(t); return !(!e || !e.watcher) && ((e.watcher = void 0), !0); }), (n.prototype.alDefaultValue = function (t) { if ((void 0 === t && (t = 0), 1 === t)) { var e = this.alGet(this.context.normalizeName("toString")); if (dm(e)) return e.alCall(this); if (dm((n = this.alGet(this.context.normalizeName("valueOf"))))) return n.alCall(this); } else { var n; if (dm((n = this.alGet(this.context.normalizeName("valueOf"))))) return n.alCall(this); var r = this.alGet(this.context.normalizeName("toString")); if (dm(r)) return r.alCall(this); } return this; }), (n.prototype.alGetKeys = function () { if (this._isGhost) return []; var t = this.alGetOwnPropertiesKeys(), e = this._prototype; if (!e) return t; var n = e.alGetKeys(); if (0 === t.length) return n; var r, i = this.context; if (i.isPropertyCaseSensitive) { var o = Object.create(null), a = t.length; for (r = 0; r < a; r++) o[t[r]] = !0; var s = n.length; for (r = 0; r < s; r++) o[n[r]] = !0; return Object.getOwnPropertyNames(o); } var u = [t, n], l = Object.create(null), c = [], h = void 0, p = void 0, d = void 0; for (r = 0; r < u.length; r++) { h = u[r]; for (var f = 0; f < h.length; f++) (p = h[f]), l[(d = i.normalizeName(p))] || ((l[d] = !0), c.push(p)); } return c; }), n ); })( (function () { return function () {}; })() ), bf = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), (n.isOnEnter = !1), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { throw new Error("not implemented AVM1Function.alConstruct"); }), (n.prototype.alCall = function (t, e) { throw new Error("not implemented AVM1Function.alCall"); }), (n.prototype.toJSFunction = function (t) { void 0 === t && (t = null); var e = this, n = this.context; return function () { var r = Array.prototype.slice.call(arguments, 0); return n.executeFunction(e, t, r); }; }), n ); })(vf); function Cf(t) { if (!t) return new P(0, 0); var e, n, r = t.context; return ( t instanceof vf && ((e = cm(r, t.alGet("x"))), (n = cm(r, t.alGet("y")))), new P(e, n) ); } function If(t, e) { e.alPut("x", t.x), e.alPut("y", t.y); } var Ef = (function (t) { function n(e, n, r) { var i = t.call(this, e) || this; return ( (i.alPrototype = e.globals.Point.alGetPrototypeProperty()), i.alPut("x", n), i.alPut("y", r), i ); } return ( e(n, t), (n.fromAS3Point = function (t, e) { return new n(t, e.x, e.y); }), n ); })(vf), xf = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( Am(n, { prototype: { value: new wf(e, n) }, distance: { value: n.distance, writable: !0 }, interpolate: { value: n.interpolate, writable: !0 }, polar: { value: n.polar, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype.alCall = function (t, e) { return this.alConstruct(e); }), (n.prototype.alConstruct = function (t) { return t && t.length > 0 ? new Ef(this.context, t[0], t[1]) : new Ef(this.context, 0, 0); }), (n.prototype.distance = function (t, e) { return P.distance(Cf(t), Cf(e)); }), (n.prototype.interpolate = function (t, e, n) { n = nm(this.context, n); var r = P.interpolate(Cf(t), Cf(e), n); return Ef.fromAS3Point(this.context, r); }), (n.prototype.polar = function (t, e) { return ( (t = nm(this.context, t)), (e = nm(this.context, e)), Ef.fromAS3Point(this.context, P.polar(t, e)) ); }), n ); })(bf), wf = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(r, { constructor: { value: n, writable: !0 }, length: { get: r.getLength }, add: { value: r.add, writable: !0 }, clone: { value: r.clone, writable: !0 }, equals: { value: r.equals, writable: !0 }, normalize: { value: r.normalize, writable: !0 }, offset: { value: r.offset, writable: !0 }, subtract: { value: r.subtract, writable: !0 }, toString: { value: r._toString, writable: !0 }, }), r ); } return ( e(n, t), (n.prototype.getLength = function () { return Cf(this).length; }), (n.prototype.add = function (t) { return Ef.fromAS3Point(this.context, Cf(this).add(Cf(t))); }), (n.prototype.clone = function () { var t = new Ef(this.context); return ( this instanceof vf && (t.alPut("x", this.alGet("x")), t.alPut("y", this.alGet("y"))), t ); }), (n.prototype.equals = function (t) { return Cf(this).equals(Cf(t)); }), (n.prototype.normalize = function (t) { t = nm(this.context, t); var e = Cf(this); e.normalize(t), If(e, this); }), (n.prototype.offset = function (t, e) { (t = nm(this.context, t)), (e = nm(this.context, e)); var n = Cf(this); n.offset(t, e), If(n, this); }), (n.prototype.subtract = function (t) { return Ef.fromAS3Point(this.context, Cf(this).subtract(Cf(t))); }), (n.prototype._toString = function () { return "(x=" + this.alGet("x") + ", y=" + this.alGet("y") + ")"; }), n ); })(vf); function Sf(t) { var e, n, r, i, o = t.context; return ( t instanceof vf && ((e = cm(o, t.alGet("x"))), (n = cm(o, t.alGet("y"))), (r = cm(o, t.alGet("width"))), (i = cm(o, t.alGet("height")))), new K(e, n, r, i) ); } function Df(t, e) { e.alPut("x", t.x), e.alPut("y", t.y), e.alPut("width", t.width), e.alPut("height", t.height); } var Tf = (function (t) { function n(e, n, r, i, o) { var a = t.call(this, e) || this; return ( (a.alPrototype = e.globals.Rectangle.alGetPrototypeProperty()), a.alPut("x", n), a.alPut("y", r), a.alPut("width", i), a.alPut("height", o), a ); } return ( e(n, t), (n.fromAS3Rectangle = function (t, e) { return new n(t, e.x, e.y, e.width, e.height); }), n ); })(vf), Pf = (function (t) { function n(e) { var n = t.call(this, e) || this; return Am(n, { prototype: { value: new Of(e, n) } }), n; } return ( e(n, t), (n.prototype.alConstruct = function (t) { return t && t.length > 0 ? new Tf(this.context, t[0], t[1], t[2], t[3]) : new Tf(this.context, 0, 0, 0, 0); }), n ); })(bf), Of = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(r, { constructor: { value: n, writable: !0 }, bottom: { get: r.getBottom, set: r.setBottom }, bottomRight: { get: r.getBottomRight, set: r.setBottomRight }, left: { get: r.getLeft, set: r.setLeft }, right: { get: r.getRight, set: r.setRight }, size: { get: r.getSize, set: r.setSize }, top: { get: r.getTop, set: r.setTop }, topLeft: { get: r.getTopLeft, set: r.setTopLeft }, clone: { value: r.clone, writable: !0 }, contains: { value: r.contains, writable: !0 }, containsPoint: { value: r.containsPoint, writable: !0 }, containsRectangle: { value: r.containsRectangle, writable: !0 }, equals: { value: r.equals, writable: !0 }, inflate: { value: r.inflate, writable: !0 }, inflatePoint: { value: r.inflatePoint, writable: !0 }, intersection: { value: r.intersection, writable: !0 }, intersects: { value: r.intersects, writable: !0 }, isEmpty: { value: r.isEmpty, writable: !0 }, offset: { value: r.offset, writable: !0 }, offsetPoint: { value: r.offsetPoint, writable: !0 }, setEmpty: { value: r.setEmpty, writable: !0 }, toString: { value: r._toString, writable: !0 }, union: { value: r.union, writable: !0 }, }), r ); } return ( e(n, t), (n.prototype.getBottom = function () { return ( nm(this.context, this.alGet("y")) + nm(this.context, this.alGet("height")) ); }), (n.prototype.setBottom = function (t) { this.alPut( "height", nm(this.context, t) - nm(this.context, this.alGet("y")) ); }), (n.prototype.getBottomRight = function () { return new Ef( this.context, n.prototype.getRight.call(this), n.prototype.getBottom.call(this) ); }), (n.prototype.setBottomRight = function (t) { n.prototype.setRight.call(this, t.alGet("x")), n.prototype.setBottom.call(this, t.alGet("y")); }), (n.prototype.getLeft = function () { return nm(this.context, this.alGet("x")); }), (n.prototype.setLeft = function (t) { this.alPut("x", nm(this.context, t)); }), (n.prototype.getSize = function () { return new Ef( this.context, this.alGet("width"), this.alGet("height") ); }), (n.prototype.setSize = function (t) { this.alPut("width", t.alGet("x")), this.alPut("height", t.alGet("y")); }), (n.prototype.getRight = function () { return ( nm(this.context, this.alGet("x")) + nm(this.context, this.alGet("width")) ); }), (n.prototype.setRight = function (t) { this.alPut( "width", nm(this.context, t) - nm(this.context, this.alGet("x")) ); }), (n.prototype.getTop = function () { return nm(this.context, this.alGet("y")); }), (n.prototype.setTop = function (t) { this.alPut("y", nm(this.context, t)); }), (n.prototype.getTopLeft = function () { return new Ef( this.context, n.prototype.getLeft.call(this), n.prototype.getTop.call(this) ); }), (n.prototype.setTopLeft = function (t) { n.prototype.setLeft.call(this, t.alGet("x")), n.prototype.setTop.call(this, t.alGet("y")); }), (n.prototype.clone = function () { var t = new Tf(this.context); return ( this instanceof vf && (t.alPut("x", this.alGet("x")), t.alPut("y", this.alGet("y")), t.alPut("width", this.alGet("width")), t.alPut("height", this.alGet("height"))), t ); }), (n.prototype.contains = function (t, e) { return ( (t = nm(this.context, t)), (e = nm(this.context, e)), Sf(this).contains(t, e) ); }), (n.prototype.containsPoint = function (t) { var e = Sf(this), n = Cf(t); return e.containsPoint(n); }), (n.prototype.containsRectangle = function (t) { var e = Sf(this), n = Sf(t); return e.containsRect(n); }), (n.prototype.equals = function (t) { var e = Sf(this), n = Sf(t); return e.equals(n); }), (n.prototype.inflate = function (t, e) { (t = nm(this.context, t)), (e = nm(this.context, e)); var n = Sf(this); n.inflate(t, e), Df(n, this); }), (n.prototype.inflatePoint = function (t) { var e = Sf(this), n = Cf(t); e.inflatePoint(n), Df(e, this); }), (n.prototype.intersection = function (t) { var e = Sf(this), n = Sf(t); return Tf.fromAS3Rectangle(this.context, e.intersection(n)); }), (n.prototype.intersects = function (t) { var e = Sf(this), n = Sf(t); return e.intersects(n); }), (n.prototype.isEmpty = function () { return Sf(this).isEmpty(); }), (n.prototype.offset = function (t, e) { (t = nm(this.context, t)), (e = nm(this.context, e)); var n = Sf(this); n.offset(t, e), Df(n, this); }), (n.prototype.offsetPoint = function (t) { var e = Sf(this), n = Cf(t); e.offsetPoint(n), Df(e, this); }), (n.prototype.setEmpty = function () { this.alPut("x", 0), this.alPut("y", 0), this.alPut("width", 0), this.alPut("height", 0); }), (n.prototype._toString = function () { return ( "(x=" + this.alGet("x") + ", y=" + this.alGet("y") + ", w=" + this.alGet("width") + ", h=" + this.alGet("height") + ")" ); }), (n.prototype.union = function (t) { var e = Sf(this), n = Sf(t); return Tf.fromAS3Rectangle(this.context, e.union(n)); }), n ); })(vf); function Bf(t, e) { return void 0 === t ? e : t; } function Mf(t) { var e = t.context; return t instanceof Lf ? new S( cm(e, Bf(t._rawData[0], 1)), cm(e, Bf(t._rawData[1], 1)), cm(e, Bf(t._rawData[2], 1)), cm(e, Bf(t._rawData[3], 1)), cm(e, Bf(t._rawData[4], 0)), cm(e, Bf(t._rawData[5], 0)), cm(e, Bf(t._rawData[6], 0)), cm(e, Bf(t._rawData[7], 0)) ) : new S(1, 1, 1, 1, 0, 0, 0, 0); } var Lf = (function (t) { function n(e, n, r, i, o, a, s, u, l) { void 0 === n && (n = 1), void 0 === r && (r = 1), void 0 === i && (i = 1), void 0 === o && (o = 1), void 0 === a && (a = 0), void 0 === s && (s = 0), void 0 === u && (u = 0), void 0 === l && (l = 0); var c = t.call(this, e) || this; return ( (c._rawData = [n, r, i, o, a, s, u, l]), (c.alPrototype = e.globals.ColorTransform.alGetPrototypeProperty()), Am(c, { rgb: { get: c.getRgb, set: c.setRgb }, ra: { get: c.getRM, set: c.setRM }, ga: { get: c.getGM, set: c.setGM }, ba: { get: c.getBM, set: c.setBM }, aa: { get: c.getAM, set: c.setAM }, rb: { get: c.getRO, set: c.setRO }, gb: { get: c.getGO, set: c.setGO }, bb: { get: c.getBO, set: c.setBO }, ab: { get: c.getAO, set: c.setAO }, redMultiplier: { get: c.getRedMultiplier, set: c.setRedMultiplier }, greenMultiplier: { get: c.getGreenMultiplier, set: c.setGreenMultiplier, }, blueMultiplier: { get: c.getBlueMultiplier, set: c.setBlueMultiplier, }, alphaMultiplier: { get: c.getAlphaMultiplier, set: c.setAlphaMultiplier, }, redOffset: { get: c.getRedOffset, set: c.setRedOffset }, greenOffset: { get: c.getGreenOffset, set: c.setGreenOffset }, blueOffset: { get: c.getBlueOffset, set: c.setBlueOffset }, alphaOffset: { get: c.getAlphaOffset, set: c.setAlphaOffset }, concat: { value: c.concat, writable: !0 }, toString: { value: c._toString, writable: !0 }, }), c ); } return ( e(n, t), (n.prototype.getRedMultiplier = function () { return this._rawData[0]; }), (n.prototype.setRedMultiplier = function (t) { this._rawData[0] = t; }), (n.prototype.getGreenMultiplier = function () { return this._rawData[1]; }), (n.prototype.setGreenMultiplier = function (t) { this._rawData[1] = t; }), (n.prototype.getBlueMultiplier = function () { return this._rawData[2]; }), (n.prototype.setBlueMultiplier = function (t) { this._rawData[2] = t; }), (n.prototype.getAlphaMultiplier = function () { return this._rawData[3]; }), (n.prototype.setAlphaMultiplier = function (t) { this._rawData[3] = t; }), (n.prototype.getRedOffset = function () { return this._rawData[4]; }), (n.prototype.setRedOffset = function (t) { this._rawData[4] = t; }), (n.prototype.getGreenOffset = function () { return this._rawData[5]; }), (n.prototype.setGreenOffset = function (t) { this._rawData[5] = t; }), (n.prototype.getBlueOffset = function () { return this._rawData[6]; }), (n.prototype.setBlueOffset = function (t) { this._rawData[6] = t; }), (n.prototype.getAlphaOffset = function () { return this._rawData[7]; }), (n.prototype.setAlphaOffset = function (t) { this._rawData[7] = t; }), (n.prototype.getRM = function () { return 100 * this._rawData[0]; }), (n.prototype.setRM = function (t) { this._rawData[0] = t / 100; }), (n.prototype.getGM = function () { return 100 * this._rawData[1]; }), (n.prototype.setGM = function (t) { this._rawData[1] = t / 100; }), (n.prototype.getBM = function () { return 100 * this._rawData[2]; }), (n.prototype.setBM = function (t) { this._rawData[2] = t / 100; }), (n.prototype.getAM = function () { return 100 * this._rawData[3]; }), (n.prototype.setAM = function (t) { this._rawData[3] = t / 100; }), (n.prototype.getRO = function () { return this._rawData[4]; }), (n.prototype.setRO = function (t) { this._rawData[4] = t; }), (n.prototype.getGO = function () { return this._rawData[5]; }), (n.prototype.setGO = function (t) { this._rawData[5] = t; }), (n.prototype.getBO = function () { return this._rawData[6]; }), (n.prototype.setBO = function (t) { this._rawData[6] = t; }), (n.prototype.getAO = function () { return this._rawData[7]; }), (n.prototype.setAO = function (t) { this._rawData[7] = t; }), (n.prototype.getRgb = function () { return ( (this._rawData[4] << 16) | (this._rawData[5] << 8) | this._rawData[6] ); }), (n.prototype.setRgb = function (t) { var e = w.float32ColorToARGB(t); (this._rawData[4] = e[1]), (this._rawData[5] = e[2]), (this._rawData[6] = e[3]), (this._rawData[0] = 0), (this._rawData[1] = 0), (this._rawData[2] = 0); }), (n.prototype.concat = function (t) { console.warn("AVM1ColorTransform concat is not implemented"); }), (n.prototype._toString = function () { return "[object Object]"; }), (n.fromAwayColorTransform = function (t, e) { return new n( t, e.redMultiplier, e.greenMultiplier, e.blueMultiplier, e.alphaMultiplier, e.redOffset, e.greenOffset, e.blueOffset, e.alphaOffset ); }), n ); })(vf), Nf = (function (t) { function n(e) { var n = t.call(this, e) || this; return Am(n, { prototype: { value: new Rf(e, n) } }), n; } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = Object.create(Lf.prototype); return (t = t || []), Lf.apply(e, [this.context].concat(t)), e; }), n ); })(bf), Rf = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(r, { constructor: { value: n, writable: !0 } }), r ); } return e(n, t), n; })(vf); function Ff(t) { var e, n, r, i, o, a, s = t.context; return ( t instanceof vf && ((e = cm(s, t.alGet("a"))), (n = cm(s, t.alGet("b"))), (r = cm(s, t.alGet("c"))), (i = cm(s, t.alGet("d"))), (o = cm(s, t.alGet("tx"))), (a = cm(s, t.alGet("ty")))), new O(e, n, r, i, o, a) ); } function kf(t, e) { e.alPut("a", t.a), e.alPut("b", t.b), e.alPut("c", t.c), e.alPut("d", t.d), e.alPut("tx", t.tx), e.alPut("ty", t.ty); } var Uf = (function (t) { function n(e, n, r, i, o, a, s) { void 0 === n && (n = 1), void 0 === r && (r = 0), void 0 === i && (i = 0), void 0 === o && (o = 1), void 0 === a && (a = 0), void 0 === s && (s = 0); var u = t.call(this, e) || this; return ( (u.alPrototype = e.globals.Matrix.alGetPrototypeProperty()), u.alPut("a", n), u.alPut("b", r), u.alPut("c", i), u.alPut("d", o), u.alPut("tx", a), u.alPut("ty", s), u ); } return ( e(n, t), (n.fromAS3Matrix = function (t, e) { return new n(t, e.a, e.b, e.c, e.d, e.tx, e.ty); }), n ); })(vf), jf = (function (t) { function n(e) { var n = t.call(this, e) || this; return Am(n, { prototype: { value: new Vf(e, n) } }), n; } return ( e(n, t), (n.prototype.alConstruct = function (t) { return t && t.length > 0 ? new Uf(this.context, t[0], t[1], t[2], t[3], t[4], t[5]) : new Uf(this.context); }), n ); })(bf), Vf = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(r, { constructor: { value: n, writable: !0 }, clone: { value: r.clone, writable: !0 }, concat: { value: r.concat, writable: !0 }, createBox: { value: r.createBox, writable: !0 }, createGradientBox: { value: r.createGradientBox, writable: !0 }, deltaTransformPoint: { value: r.deltaTransformPoint, writable: !0 }, identity: { value: r.identity, writable: !0 }, invert: { value: r.invert, writable: !0 }, rotate: { value: r.rotate, writable: !0 }, scale: { value: r.scale, writable: !0 }, toString: { value: r._toString, writable: !0 }, transformPoint: { value: r.transformPoint, writable: !0 }, translate: { value: r.translate, writable: !0 }, }), r ); } return ( e(n, t), (n.prototype.clone = function () { var t = new Uf(this.context); return ( this instanceof vf && (t.alPut("a", this.alGet("a")), t.alPut("b", this.alGet("b")), t.alPut("c", this.alGet("c")), t.alPut("d", this.alGet("d")), t.alPut("tx", this.alGet("tx")), t.alPut("ty", this.alGet("ty"))), t ); }), (n.prototype.concat = function (t) { var e = Ff(this), n = Ff(t); e.concat(n), kf(e, this); }), (n.prototype.createBox = function (t, e, n, r, i) { void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), (t = cm(this.context, t)), (e = cm(this.context, e)), (n = cm(this.context, n)), (r = cm(this.context, r)), (i = cm(this.context, i)); var o = Ff(this); o.createBox(t, e, n, r, i), kf(o, this); }), (n.prototype.createGradientBox = function (t, e, n, r, i) { void 0 === n && (n = 0), void 0 === r && (r = 0), void 0 === i && (i = 0), (t = cm(this.context, t)), (e = cm(this.context, e)), (n = cm(this.context, n)), (r = cm(this.context, r)), (i = cm(this.context, i)); var o = Ff(this); o.createGradientBox(t, e, n, r, i), kf(o, this); }), (n.prototype.deltaTransformPoint = function (t) { var e = Cf(t), n = Ff(this); return Ef.fromAS3Point(this.context, n.deltaTransformPoint(e)); }), (n.prototype.identity = function () { this.alPut("a", 1), this.alPut("b", 0), this.alPut("c", 0), this.alPut("d", 1), this.alPut("tx", 0), this.alPut("ty", 0); }), (n.prototype.invert = function () { var t = Ff(this); t.invert(), kf(t, this); }), (n.prototype.rotate = function (t) { t = cm(this.context, t); var e = Ff(this); e.rotate(t), kf(e, this); }), (n.prototype.scale = function (t, e) { (t = cm(this.context, t)), (e = cm(this.context, e)); var n = Ff(this); n.scale(t, e), kf(n, this); }), (n.prototype._toString = function () { return Ff(this).toString(); }), (n.prototype.transformPoint = function (t) { var e = Cf(t), n = Ff(this); return Ef.fromAS3Point(this.context, n.transformPoint(e)); }), (n.prototype.translate = function (t, e) { (t = cm(this.context, t)), (e = cm(this.context, e)); var n = Ff(this); n.translate(t, e), kf(n, this); }), n ); })(vf), Qf = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { var e = new n(t); return ( Dm( t, e, n.prototype, [ "align#", "displayState#", "fullScreenSourceRect#", "height#", "scaleMode#", "showMenu#", "width#", ], !1 ), e ); }), (n.bindStage = function (t, e, r, i, o) { (e.avmStage = r), (e.avm1Handler = i), (n.avmStage = r); }), (n.prototype.getAlign = function () { return this.avmStage.align; }), (n.prototype.setAlign = function (t) { this.avmStage.align = t; }), (n.prototype.getDisplayState = function () { return this.avmStage.displayState; }), (n.prototype.setDisplayState = function (t) { this.avmStage.displayState = t; }), (n.prototype.getFullScreenSourceRect = function () { return null; }), (n.prototype.setFullScreenSourceRect = function (t) {}), (n.prototype.getHeight = function () { return this.avmStage.stageHeight; }), (n.prototype.getScaleMode = function () { return this.avmStage.scaleMode; }), (n.prototype.setScaleMode = function (t) { this.avmStage.scaleMode = t; }), (n.prototype.getShowMenu = function () { return null; }), (n.prototype.setShowMenu = function (t) {}), (n.prototype.getWidth = function () { return this.avmStage.stageWidth; }), n ); })(vf); function Gf(t) { return t instanceof Hf ? t.as3BitmapData : null; } var zf, Hf = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return (e._linkedBillboards = []), (e._isSymbolSource = !1), e; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, ["loadBitmap"], [ "height#", "rectangle#", "transparent#", "width#", "applyFilter", "clone", "colorTransform", "compare", "copyChannel", "copyPixels", "dispose", "draw", "fillRect", "floodFill", "generateFilterRect", "getColorBoundsRect", "getPixel", "getPixel32", "hitTest", "merge", "noise", "paletteMap", "perlinNoise", "pixelDissolve", "scroll", "setPixel", "setPixel32", "threshold", ], null, n.prototype.avm1Constructor ); }), (n.prototype.getBillboard = function (t, e) { var n = ds.getMaterialForBitmap(this.adaptee, !0), r = new cu(n, t, e); return this._linkedBillboards.push(r), r; }), Object.defineProperty(n.prototype, "as3BitmapData", { get: function () { return this.adaptee; }, enumerable: !0, configurable: !0, }), (n.prototype.avm1Constructor = function (t, e, n, r) { if ( ((t = nm(this.context, t)), (e = nm(this.context, e)), (n = arguments.length < 3 || em(this.context, n)), (r = arguments.length < 4 ? 4294967295 : im(this.context, r)), 0 != t && 0 != e) ) { var i = Eh.getImage(t, e, n, r, !1, Qf.avmStage.view.stage); console.log("Construct:", i.id), (this.adaptee = i); } }), (n.fromAS3BitmapData = function (t, e) { var r = new n(t); return ( (r.alPrototype = t.globals.BitmapData.alGetPrototypeProperty()), (r.adaptee = e), r ); }), (n.loadBitmap = function (t, e) { e = om(t, e); for ( var r, i = pt.getBundle(), o = 0, a = Object.keys(i._assetDictionary); o < a.length; o++ ) { var s = a[o]; if ((r = i.getAsset(e, s))) break; } if (!r || !r.isAsset(nn)) return console.warn("[AVM1 BitmapData] Missing bitmap:", e), null; var u = new n(t); return ( (u.alPrototype = t.globals.BitmapData.alGetPrototypeProperty()), (u.adaptee = r), (u._isSymbolSource = !0), u ); }), (n.prototype.getHeight = function () { return this.adaptee ? this.adaptee.height : 0; }), (n.prototype.getRectangle = function () { var t = this.adaptee; return t ? new Tf(this.context, 0, 0, t.width, t.height) : new Tf(this.context, 0, 0, 0, 0); }), (n.prototype.getTransparent = function () { return !this.adaptee || this.adaptee.transparent; }), (n.prototype.getWidth = function () { return this.adaptee ? this.adaptee.width : 0; }), (n.prototype.applyFilter = function (t, e, n, r) { return ( console.warn("[avm1/AVM1BitmapData] - applyFilter not implemented"), 0 ); }), (n.prototype.clone = function () { var t = new n(this.context); return ( (t.alPrototype = this.context.globals.BitmapData.alGetPrototypeProperty()), (t.adaptee = this.adaptee ? this.adaptee.clone() : null), (t._isSymbolSource = this._isSymbolSource), t ); }), (n.prototype.colorTransform = function (t, e) { var n = Sf(t), r = Mf(e); this.adaptee.colorTransform(n, r); }), (n.prototype.compare = function (t) { return ( t instanceof n && (console.warn("[avm1/AVM1BitmapData] - compare not implemented"), !0) ); }), (n.prototype.copyChannel = function (t, e, n, r, i) { var o = t.as3BitmapData; if (this.adaptee && o) { var a = Sf(e), s = Cf(n); (r = cm(this.context, r)), (i = cm(this.context, i)), this.adaptee.copyChannel(o, a, s, r, i); } }), (n.prototype.copyPixels = function (t, e, n, r, i, o) { if (t) { var a = this.adaptee, s = t.as3BitmapData; if (this.adaptee && s) { var u = Sf(e), l = Cf(n), c = r ? r.as3BitmapData : null, h = i ? Cf(i) : null; (o = em(this.context, o)), a.copyPixels(s, u, l, c, h, o); } } else console.warn("[AVM1BitmapData::copyPixels] Empty source!"); }), (n.prototype.dispose = function () { if (this.adaptee) { for (var t = 0, e = this._linkedBillboards; t < e.length; t++) { var n = e[t]; n.parent.removeChild(n), n.dispose(); } (this._linkedBillboards = []), this._isSymbolSource || this.adaptee.dispose(), (this.adaptee = null); } }), (n.prototype.draw = function (t, e, n, r, i, o) { if (this.adaptee) if (t) { var a = t; if ("string" != typeof t || (a = this.context.resolveTarget(t))) { var s = a.adaptee, u = e ? Ff(e) : null, l = n ? Mf(n) : null, c = i ? Sf(i) : null; (r = (r = "number" == typeof r ? Im[r] : lm(this.context, r)) || null), (o = em(this.context, o)), (a._locked = !0), this.as3BitmapData.draw(s, u, l, r, c, o), (a._locked = !1); } else console.warn( "[AVM1BitmapData::draw] Source " + t + " not resolved!" ); } else console.warn("[AVM1BitmapData::draw] Empty source!"); }), (n.prototype.fillRect = function (t, e) { if (this.adaptee) { var n = Sf(t); (e = im(this.context, e)), this.as3BitmapData.fillRect(n, e); } }), (n.prototype.floodFill = function (t, e, n) { (t = cm(this.context, t)), (e = cm(this.context, e)), (n = im(this.context, n)), console.warn("[avm1/AVM1BitmapData] - floodFill not implemented"); }), (n.prototype.generateFilterRect = function (t, e) { console.warn( "[avm1/AVM1BitmapData] - generateFilterRect not implemented" ); }), (n.prototype.getColorBoundsRect = function (t, e, n) { var r; if (this.adaptee) { (t = im(this.context, t) >>> 0), (e = im(this.context, e) >>> 0), (n = em(this.context, n)); var i = null === (r = this.as3BitmapData) || void 0 === r ? void 0 : r.getColorBoundsRect(t, e, n); return i ? new Tf(this.context, i.x, i.y, i.width, i.height) : null; } }), (n.prototype.getPixel = function (t, e) { return this.adaptee ? this.adaptee.getPixel(t, e) : 0; }), (n.prototype.getPixel32 = function (t, e) { return this.adaptee ? this.adaptee.getPixel32(t, e) : 0; }), (n.prototype.hitTest = function (t, e, n, r, i) { return ( console.warn("[avm1/AVM1BitmapData] - hitTest not implemented"), !1 ); }), (n.prototype.merge = function (t, e, n, r, i, o, a) { var s = t.as3BitmapData; if (this.adaptee && s) { var u = Sf(e), l = Cf(n); (r = im(this.context, r)), (i = im(this.context, i)), (o = im(this.context, o)), (a = im(this.context, a)), this.as3BitmapData.merge(s, u, l, r, i, o, a); } }), (n.prototype.noise = function (t, e, n, r, i) { (t = im(this.context, t)), (e = arguments.length < 2 ? 0 : im(this.context, e)), (n = arguments.length < 3 ? 255 : im(this.context, n)), (r = arguments.length < 4 ? 7 : im(this.context, r)), (i = !(arguments.length < 5) && em(this.context, i)), console.warn("[avm1/AVM1BitmapData] - noise not implemented"); }), (n.prototype.paletteMap = function (t, e, n, r, i, o, a) { console.warn("[avm1/AVM1BitmapData] - paletteMap not implemented"); }), (n.prototype.perlinNoise = function (t, e, n, r, i, o, a, s, u) { (t = cm(this.context, t)), (e = cm(this.context, e)), (n = cm(this.context, n)), (r = cm(this.context, r)), (i = em(this.context, i)), (o = em(this.context, o)), (a = void 0 === a ? 7 : cm(this.context, a)), (s = em(this.context, s)), console.warn("[avm1/AVM1BitmapData] - perlinNoise not implemented"); }), (n.prototype.pixelDissolve = function (t, e, n, r, i, o) { var a = Sf(e); return ( (r = arguments.length < 4 ? 0 : im(this.context, r)), (i = arguments.length < 5 ? (a.width * a.height) / 30 : im(this.context, i)), (o = arguments.length < 6 ? 0 : im(this.context, o)), console.warn( "[avm1/AVM1BitmapData] - pixelDissolve not implemented" ), 0 ); }), (n.prototype.scroll = function (t, e) { if ( ((t = 0 | cm(this.context, t)), (e = 0 | cm(this.context, e)), (t || e) && this.adaptee) ) { var n = this.as3BitmapData; n.copyPixels(n, n.rect, new P(t, e), null, null, !1); } }), (n.prototype.setPixel = function (t, e, n) { this.adaptee && ((t = cm(this.context, t)), (e = cm(this.context, e)), (n = im(this.context, n)), this.adaptee.setPixel(t, e, n)); }), (n.prototype.setPixel32 = function (t, e, n) { this.adaptee && ((t = cm(this.context, t)), (e = cm(this.context, e)), (n = im(this.context, n)), this.adaptee.setPixel32(t, e, n)); }), (n.prototype.threshold = function (t, e, n, r, i, o, a, s) { var u = this.as3BitmapData, l = t.as3BitmapData; if (this.adaptee && l) { var c = Sf(e), h = Cf(n); return ( (r = lm(this.context, r)), (i = im(this.context, i) >>> 0), (o = arguments.length < 6 ? 0 : im(this.context, o)), (a = arguments.length < 7 ? 4294967295 : im(this.context, a)), (s = !(arguments.length < 8) && em(this.context, s)), (o = 0 === o ? 65793 : o), u.threshold(l, c, h, r, i, 16711935, a, s), 0 ); } }), n ); })(vf); !(function (t) { (t[(t._x = 0)] = "_x"), (t[(t._y = 1)] = "_y"), (t[(t._xscale = 2)] = "_xscale"), (t[(t._yscale = 3)] = "_yscale"), (t[(t._currentframe = 4)] = "_currentframe"), (t[(t._totalframes = 5)] = "_totalframes"), (t[(t._alpha = 6)] = "_alpha"), (t[(t._visible = 7)] = "_visible"), (t[(t._width = 8)] = "_width"), (t[(t._height = 9)] = "_height"), (t[(t._rotation = 10)] = "_rotation"), (t[(t._target = 11)] = "_target"), (t[(t._framesloaded = 12)] = "_framesloaded"), (t[(t._name = 13)] = "_name"), (t[(t._droptarget = 14)] = "_droptarget"), (t[(t._url = 15)] = "_url"), (t[(t._highquality = 16)] = "_highquality"), (t[(t._focusrect = 17)] = "_focusrect"), (t[(t._soundbuftime = 18)] = "_soundbuftime"), (t[(t._quality = 19)] = "_quality"), (t[(t._xmouse = 20)] = "_xmouse"), (t[(t._ymouse = 21)] = "_ymouse"); })(zf || (zf = {})); var Xf, Yf, qf, Kf, Wf = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { var e = [ "align#", "blockIndent#", "bold#", "bullet#", "color#", "font#", "getTextExtent", "indent#", "italic#", "kerning#", "leading#", "leftMargin#", "letterSpacing#", "rightMargin#", "size#", "tabStops#", "target#", "adaptee#", "underline#", "url#", ], r = Tm(t, !0, n, [], e, null, n.prototype.avm1Constructor), i = r.alGetPrototypeProperty(), o = null; return ( e.forEach(function (t) { "#" === t[t.length - 1] && (t = t.slice(0, -1)), ((o = i.alGetOwnProperty(t)).flags &= -2), i.alSetOwnProperty(t, o); }), r ); }), (n.createFromNative = function (t, e) { var r = t.globals.TextFormat, i = new n(t); return ( (i.alPrototype = r.alGetPrototypeProperty()), (i.adaptee = e), i ); }), (n.prototype.alPut = function (e, n) { "font" == e && this.setFont(n), t.prototype.alPut.call(this, e, n); }), (n.prototype.avm1Constructor = function ( t, e, n, r, i, o, a, s, u, l, c, h, p ) { var d = this.context; (t = null == t ? null : om(d, t)), (e = null == e ? null : nm(d, e)), (n = null == n ? null : nm(d, n)), (r = null == r ? null : em(d, r)), (i = null == i ? null : em(d, i)), (o = null == o ? null : em(d, o)), (a = null == a ? null : om(d, a)), (s = null == s ? null : om(d, s)), (u = null == u ? null : om(d, u)), (l = null == l ? null : nm(d, l)), (c = null == c ? null : nm(d, c)), (h = null == h ? null : nm(d, h)), (p = null == p ? null : nm(d, p)); var f = new zc(t, e, n, r, i, o, a, s, u, l, c, h, p); this.adaptee = f; }), (n.alInitStatic = function (t) { var e = new bh(); (e.multiline = !0), (this._measureTextField = e); }), (n.prototype.getAdaptee = function () { return this.adaptee.id; }), (n.prototype.setAdaptee = function (t) {}), (n.prototype.getAlign = function () { return this.adaptee.align; }), (n.prototype.setAlign = function (t) { var e = om(this.context, t); "" == e && (e = "center"), (this.adaptee.align = e); }), (n.prototype.getBlockIndent = function () { return this.adaptee.blockIndent; }), (n.prototype.setBlockIndent = function (t) { this.adaptee.blockIndent = nm(this.context, t); }), (n.prototype.getBold = function () { return this.adaptee.bold; }), (n.prototype.setBold = function (t) { this.adaptee.bold = em(this.context, t); }), (n.prototype.getBullet = function () { return this.adaptee.bullet; }), (n.prototype.setBullet = function (t) { this.adaptee.bullet = em(this.context, t); }), (n.prototype.getColor = function () { return this.adaptee.color; }), (n.prototype.setColor = function (t) { this.adaptee.color = nm(this.context, t); }), (n.prototype.getFont = function () { return this.adaptee.font_name; }), (n.prototype.setFont = function (t) { this.adaptee.font = om(this.context, t); }), (n.prototype.getIndent = function () { return this.adaptee.indent; }), (n.prototype.setIndent = function (t) { this.adaptee.indent = nm(this.context, t); }), (n.prototype.getItalic = function () { return this.adaptee.italic; }), (n.prototype.setItalic = function (t) { this.adaptee.italic = em(this.context, t); }), (n.prototype.getKerning = function () { return this.adaptee.kerning; }), (n.prototype.setKerning = function (t) { this.adaptee.kerning = em(this.context, t); }), (n.prototype.getLeading = function () { return this.adaptee.leading; }), (n.prototype.setLeading = function (t) { this.adaptee.leading = nm(this.context, t); }), (n.prototype.getLeftMargin = function () { return this.adaptee.leftMargin; }), (n.prototype.setLeftMargin = function (t) { this.adaptee.leftMargin = nm(this.context, t); }), (n.prototype.getLetterSpacing = function () { return this.adaptee.letterSpacing; }), (n.prototype.setLetterSpacing = function (t) { this.adaptee.letterSpacing = nm(this.context, t); }), (n.prototype.getRightMargin = function () { return this.adaptee.rightMargin; }), (n.prototype.setRightMargin = function (t) { this.adaptee.rightMargin = nm(this.context, t); }), (n.prototype.getSize = function () { return this.adaptee.size; }), (n.prototype.setSize = function (t) { this.adaptee.size = nm(this.context, t); }), (n.prototype.getTabStops = function () { return new U_(this.context, this.adaptee.tabStops); }), (n.prototype.setTabStops = function (t) { var e = this; this.adaptee.tabStops = U_.mapToJSArray(t, function (t) { return nm(e.context, t); }); }), (n.prototype.getTarget = function () { return ""; }), (n.prototype.setTarget = function (t) {}), (n.prototype.getTextExtent = function (t, e) { (t = lm(this.context, t)), (e = +e); var r = this.context.getStaticState(n)._measureTextField; !isNaN(e) && e > 0 ? ((r.width = e + 4), (r.wordWrap = !0)) : (r.wordWrap = !1), (r.textFormat = this.adaptee), (r.text = t); var i = sm(this.context), o = r.textWidth, a = r.textHeight; return ( i.alPut("width", o), i.alPut("height", a), i.alPut("textFieldWidth", o + 4), i.alPut("textFieldHeight", a + 4), i ); }), (n.prototype.getUnderline = function () { return this.adaptee.underline; }), (n.prototype.setUnderline = function (t) { this.adaptee.underline = em(this.context, t); }), (n.prototype.getUrl = function () { return this.adaptee.url; }), (n.prototype.setUrl = function (t) { this.adaptee.url = om(this.context, t); }), n ); })(vf), Jf = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !1, n, [ "BACKSPACE", "CAPSLOCK", "CONTROL", "DELETEKEY", "DOWN", "END", "ENTER", "ESCAPE", "HOME", "INSERT", "LEFT", "PGDN", "PGUP", "RIGHT", "SHIFT", "SPACE", "TAB", "UP", "isDown", "getCode", ], [] ); }), (n.alInitStatic = function (t) { (this._keyStates = []), (this._lastKeyCode = 0); }), (n.bindStage = function (t, e, r, i) { n.keyDownDelegate && i.removeEventListener("keydown", n.keyDownDelegate), n.keyUpDelegate && i.removeEventListener("keyup", n.keyUpDelegate), (n.keyDownDelegate = function (r) { var i = t.getStaticState(n); (i._lastKeyCode = r.keyCode), (i._keyStates[r.keyCode] = 1), fm(e, "broadcastMessage", ["onKeyDown"]); }), (n.keyUpDelegate = function (r) { var i = t.getStaticState(n); (i._lastKeyCode = r.keyCode), delete i._keyStates[r.keyCode], fm(e, "broadcastMessage", ["onKeyUp"]); }), i.addEventListener("keydown", n.keyDownDelegate), i.addEventListener("keyup", n.keyUpDelegate); }), (n.isDown = function (t, e) { return !!t.getStaticState(n)._keyStates[e]; }), (n.getCode = function (t) { return t.getStaticState(n)._lastKeyCode; }), (n.BACKSPACE = 8), (n.CAPSLOCK = 20), (n.CONTROL = 17), (n.DELETEKEY = 46), (n.DOWN = 40), (n.END = 35), (n.ENTER = 13), (n.ESCAPE = 27), (n.HOME = 36), (n.INSERT = 45), (n.LEFT = 37), (n.PGDN = 34), (n.PGUP = 33), (n.RIGHT = 39), (n.SHIFT = 16), (n.SPACE = 32), (n.TAB = 9), (n.UP = 38), (n.keyDownDelegate = null), (n.keyUpDelegate = null), n ); })(vf), $f = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], [ "matrix#", "concatenatedMatrix#", "colorTransform#", "pixelBounds#", ], null, n.prototype.avm1Constructor ); }), Object.defineProperty(n.prototype, "as3Transform", { get: function () { return this._targetAwayObject.transform; }, enumerable: !0, configurable: !0, }), (n.prototype.avm1Constructor = function (t) { (this._target = this.context.resolveTarget(t)), (this._targetAwayObject = this._target.adaptee); }), (n.prototype.getMatrix = function () { var t = this._targetAwayObject.transform; return Uf.fromAS3Matrix(this.context, t.matrix); }), (n.prototype.setMatrix = function (t) { this._targetAwayObject.transform.matrix = Ff(t); }), (n.prototype.getConcatenatedMatrix = function () { return ( console.log("[AVM1Transform] concatenatedMatrix not implemented"), null ); }), (n.prototype.getColorTransform = function () { var t = this._targetAwayObject.transform; return Lf.fromAwayColorTransform(this.context, t.colorTransform); }), (n.prototype.setColorTransform = function (t) { this._targetAwayObject.transform.colorTransform = Mf(t); }), (n.prototype.getPixelBounds = function () { var t = this._targetAwayObject.transform; return Tf.fromAS3Rectangle(this.context, t.pixelBounds); }), n ); })(vf); !(function (t) { t[(t.DISPLACEMENT = 8)] = "DISPLACEMENT"; })(Kf || (Kf = {})); var Zf = r(r({}, Xp), Kf), tg = (((Xf = {})[Zf.DROPSHADOW] = "DropShadowFilter"), (Xf[Zf.GLOW] = "GlowFilter"), (Xf[Zf.BEVEL] = "BevelFilter"), (Xf[Zf.GRADIENTGLOW] = "GradientGlowFilter"), (Xf[Zf.GRADIENTBEVEL] = "GradientBevelFilter"), (Xf[Zf.BLUR] = "BlurFilter"), (Xf[Zf.CONVOLUTION] = "ConvolutionFilter"), (Xf[Zf.COLORMATRIX] = "ColorMatrixFilter"), (Xf[Zf.DISPLACEMENT] = "DisplacementMapFilter"), Xf), eg = (((Yf = {})[Zf.DROPSHADOW] = "dropShadow"), (Yf[Zf.GLOW] = "glow"), (Yf[Zf.BEVEL] = "bevel"), (Yf[Zf.GRADIENTGLOW] = "gradientGlow"), (Yf[Zf.GRADIENTBEVEL] = "bevel"), (Yf[Zf.BLUR] = "blur"), (Yf[Zf.CONVOLUTION] = "convolution"), (Yf[Zf.COLORMATRIX] = "colorMatrix"), (Yf[Zf.DISPLACEMENT] = "displacement"), Yf), ng = (((qf = {})[Zf.DROPSHADOW] = function (t) { var e = t.colors[0] >>> 8, n = (255 & t.colors[0]) / 255, r = (180 * t.angle) / Math.PI, i = !t.compositeSource; return { distance: t.distance, angle: r, color: e, alpha: n, blurX: t.blurX, blurY: t.blurY, strength: t.strength, quality: t.quality, inner: t.inner, knockout: t.knockout, hideObject: i, }; }), (qf[Zf.GLOW] = function (t) { return { color: t.colors[0] >>> 8, alpha: (255 & t.colors[0]) / 255, blurX: t.blurX, blurY: t.blurY, strength: t.strength, quality: t.quality, inner: t.inner, knockout: t.knockout, }; }), (qf[Zf.BEVEL] = function (t) { var e = t.colors[0] >>> 8, n = (255 & t.colors[0]) / 255, r = t.colors[1] >>> 8, i = (255 & t.colors[1]) / 255, o = "outer"; t.onTop ? (o = "full") : t.inner && (o = "inner"); var a = (180 * t.angle) / Math.PI; return { distance: t.distance, angle: a, highlightColor: e, highlightAlpha: n, shadowColor: r, shadowAlpha: i, blurX: t.blurX, blurY: t.blurY, strength: t.strength, quality: t.quality, type: o, knockout: t.knockout, }; }), (qf[Zf.GRADIENTGLOW] = function (t) { return null; }), (qf[Zf.GRADIENTBEVEL] = function (t) { return null; }), (qf[Zf.BLUR] = function (t) { return null; }), (qf[Zf.CONVOLUTION] = function (t) { return null; }), (qf[Zf.COLORMATRIX] = function (t) { return null; }), qf), rg = (function (t) { function n(e) { var n = t.call(this, e) || this; return n.alSetOwnPrototypeProperty(new ig(e, n)), n; } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = new vf(this.context); return (e.alPrototype = this.alGetPrototypeProperty()), e; }), n ); })(bf), ig = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( Am(r, { constructor: { value: n, writable: !0 }, clone: { value: r.clone, writable: !0 }, }), r ); } return ( e(n, t), (n.prototype.clone = function () { var t = new vf(this.context); return (t.alPrototype = this.alGetPrototypeProperty()), t; }), n ); })(vf); function og(t, e, n, r, i) { var o = tg[r]; function a(e) { var n = new vf(t); n.alPrototype = u; for (var r = 0; r < i.length; r += 2) n.alPut(i[r], sg(t, e[i[r]], i[r + 1])); return n; } var s = n.alGetPrototypeProperty(), u = Object.create(ig.prototype); vf.call(u, t), (u.alPrototype = s); var l = Object.create(rg.prototype); bf.call(l, t), l.alSetOwnPrototypeProperty(u), (l.alConstruct = function (e) { var n = new vf(t); if (((n.alPrototype = u), e)) for (var r = 0; r < e.length; r++) n.alPut(i[r << 1], e[r]); return n; }), Am(u, { constructor: { value: l, writable: !0 }, clone: { value: function () { var e = new vf(t); e.alPrototype = u; for (var n = 0; n < i.length; n += 2) e.alPut(i[n], this.alGet(i[n])); return e; }, writable: !0, }, }), (u.asFilterConverter = { toAS3Filter: function (e) { for ( var n = { filterName: o, filterType: r }, a = 0; a < i.length; a += 2 ) { var s = e.alGet(i[a]); void 0 !== s && (n[i[a]] = ag(t, s, i[a + 1])); } return n; }, fromAS3Filter: a, fromTimelineFilter: function (t) { var e = ng[t.type], n = e ? e(t) : null; if (n) return a(n); console.warn( "[AVM1 FILTER] Timeline filter converter not implemented for:", t ); }, getAS3Class: null, }), e.alPut(o, l); } function ag(t, e, n) { switch (n) { case "String": return om(t, e); case "Boolean": return em(t, e); case "Number": return nm(t, e); case "Numbers": var r = []; if (e) for (var i = 0, o = e.alGet("length"); i < o; i++) r[i] = nm(t, e.alGet(i)); return r; case "BitmapData": return Gf(e); case "Point": return Cf(e); default: console.warn("Filters", "Unknown convertFromAS3Field type: " + n); } } function sg(t, e, n) { switch (n) { case "String": case "Boolean": case "Number": return e; case "Numbers": var r = []; if (e) for (var i = 0, o = e.value.length; i < o; i++) r[i] = +e.value[i]; return new U_(t, r); case "BitmapData": return Hf.fromAS3BitmapData(t, e); case "Point": return Ef.fromAS3Point(t, e); default: console.warn("Filters", "Unknown convertFromAS3Field type: " + n); } } function ug(t, e) { for (var n = e ? e.alPrototype : null; n && !n.asFilterConverter; ) n = n.alPrototype; if (n) return n.asFilterConverter.toAS3Filter(e); } var lg = np.register(new tp("AVM1")), cg = lg.register( new ep("t1", "traceAvm1", "boolean", !1, "trace AVM1 execution") ), hg = lg.register( new ep( "e1", "errorsAvm1", "boolean", !1, "fail on AVM1 warnings and errors" ) ), pg = lg.register( new ep( "w1", "warningsAvm1", "boolean", !0, "Emit messages for AVM1 warnings and errors" ) ), dg = lg.register( new ep("ha1", "nohangAvm1", "boolean", !1, "disable fail on AVM1 hang") ), fg = lg.register( new ep("ca1", "compileAvm1", "boolean", !0, "compiles AVM1 code") ), gg = lg.register( new ep("da1", "debugAvm1", "boolean", !1, "allows AVM1 code debugging") ); lg.register( new ep( "cw1", "wellknownAvm1", "boolean", !0, "Replaces well-known actions patterns instead of compilation" ) ); var _g = { LAZY_EVENT_REGISTERING: !1 }, mg = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e.hasSwappedDepth = !1), (e.dynamicallyCreated = !1), (e._filterModels = []), (e.enabled = !0), e ); } return ( e(n, t), (n.CompleteEventRegistering = function () { var t = n.LAZY_EVENT_QUEUE.slice(); n.LAZY_EVENT_QUEUE = []; for (var e = 0, r = t; e < r.length; e++) { var i = r[e]; i.target.addEventListenerOnAdapter( i.event, i.callback, i.eventProps ); } }), (n.prototype.initAVM1SymbolInstance = function (t, e) { (this.constructorHasRun = !0), (this.avmType = "symbol"), (this.scriptRefsToChilds = {}), (this._mouseListenerCount = 0), (this._avm1Context = t), (this._ownProperties = Object.create(null)), (this._prototype = null); var n = this; this._onClipEventsListeners = []; var r = new Af( 131, null, { alCall: function (t, e) { return n.alPrototype; }, }, { alCall: function (t, e) { n.alPrototype = e[0]; }, } ); this.alSetOwnProperty("__proto__", r), (this.adaptee = e), (this.adaptee.partitionClass = vi), (this.node = Qf.avmStage.pool.getNode(this.adaptee)); var i = e.name, o = this.get_parent(); i && o && o._addChildName(this, i); }), (n.prototype.bindEvents = function (t, e) { this._events = t; var n = Object.create(null); (this._eventsMap = n), (this._eventsListeners = Object.create(null)), (this._eventHandlers = Object.create(null)); var r = this, i = this.context; t.forEach(function (t) { var e = (t.propertyName = i.normalizeName(t.propertyName)); (n[e] = t), r._updateEvent(t); }); }), (n.prototype.unbindEvents = function () { var t = this._events, e = this, n = this.context; t.forEach(function (t) { n.unregisterEventPropertyObserver(t.propertyName, e), e._removeEventListener(t); }), (this._events = null), (this._eventsMap = null), (this._eventsListeners = null), (this._eventHandlers = null); }), (n.prototype._initEventsHandlers = function () { throw "AVM1SymbolBase _initEventsHandlers must be overwritten"; }), (n.prototype.updateEventByPropName = function (t) { this._eventsMap ? this._eventsMap[t] && this._updateEvent(this._eventsMap[t]) : (this._initEventsHandlers(), console.log("no eventsmap set", this)); }), (n.prototype.updateAllEvents = function () { this._events.forEach(function (t) { this._updateEvent(t); }, this); }), (n.prototype._updateEvent = function (t) { !(function (t, e, n) { if (e.alHasProperty(n) && e.alGet(n) instanceof bf) return !0; if ( e.alHasProperty(n) && e._ownProperties[n] && e._ownProperties[n].value ) return !0; var r = e.alGet("_listeners"); if (!(r instanceof U_)) return !1; return r.value.some(function (t) { return t instanceof vf && t.alHasProperty(n); }); })(this.context, this, t.propertyName) ? this._removeEventListener(t) : this._addEventListener(t); }), (n.prototype._addOnClipEventListener = function (t, e, r) { void 0 === e && (e = null), void 0 === r && (r = null), (t.propertyName = this.context.normalizeName(t.propertyName)), (!this.enabled && t.allowDisable) || (_g.LAZY_EVENT_REGISTERING ? n.LAZY_EVENT_QUEUE.push({ target: this, event: t, callback: e, eventProps: r, }) : (this._onClipEventsListeners.push({ event: t, callback: e }), this.addEventListenerOnAdapter(t, e, r))); }), (n.prototype._addEventListener = function (t, e) { void 0 === e && (e = null); var n = this.context.normalizeName(t.propertyName), r = this._eventsListeners[n], i = this; r || ((r = e || function () { var t = null; "onchanged" == n.toLowerCase() && (t = [i]), (function (t, e, n, r) { void 0 === r && (r = null); var i = e.alGet(n); i instanceof bf && ("onenterframe" == n.toLowerCase() && (i.isOnEnter = !0), t.executeFunction(i, e, r)); var o = e.alGet("_listeners"); if (o instanceof U_) { var a = null; o.value.forEach(function (i) { i instanceof vf && (a = i.alGet(n)) instanceof bf && t.executeFunction(a, e, r); }); } })(this.context, this, n, t); }.bind(this)), (this._eventsListeners[n] = r), (this._eventHandlers[n] = t)), (!this.enabled && t.allowDisable) || this.addEventListenerOnAdapter(t, r); }), (n.prototype.addEventListenerOnAdapter = function (t, e, n) { (void 0 === n && (n = null), t.stageEvent) ? this.context.globals.Stage.avm1Handler.addAVM1EventListener( this.adaptee, t.eventName, e, n ) : (this.adaptee.addEventListener(t.eventName, e), this._updateMouseEnabled(t, !0)); }), (n.prototype.removeEventListenerOnAdapter = function (t, e) { if (t.stageEvent) { var n = this.context.globals.Stage.avm1Handler; n && n.removeAVM1EventListener(this.adaptee, t.eventName, e); } else this.adaptee.removeEventListener(t.eventName, e), this._updateMouseEnabled(t, !1); }), (n.prototype._updateMouseEnabled = function (t, e) { this.adaptee.isAVMScene || (t.isMouse && (e ? (this._mouseListenerCount++, (this.adaptee.mouseEnabled = !0), (this.adaptee.mouseChildren = !1)) : (this._mouseListenerCount--, this._mouseListenerCount <= 0 && ((this._mouseListenerCount = 0), (this.adaptee.mouseEnabled = !1), (this.adaptee.mouseChildren = !0))))); }), (n.prototype.freeFromScript = function () { for (var e in (t.prototype.freeFromScript.call(this), (this.enabled = !0), (this.adaptee.mouseEnabled = !1), (this.adaptee.mouseChildren = !0), this._eventsListeners)) this.removeEventListenerOnAdapter( this._eventHandlers[e], this._eventsListeners[e] ); this._eventsListeners = {}; for (var n = this._onClipEventsListeners.length; n > 0; ) n--, this.removeEventListenerOnAdapter( this._onClipEventsListeners[n].event, this._onClipEventsListeners[n].callback ); (this._onClipEventsListeners = []), (this._mouseListenerCount = 0); }), (n.prototype._removeEventListener = function (t) { var e = this.context.normalizeName(t.propertyName), n = this._eventsListeners[e]; n && (this.removeEventListenerOnAdapter(t, n), delete this._eventsListeners[e]); }), (n.prototype.onEventPropertyModified = function (t) { t = this.context.normalizeName(t); var e = this._eventsMap[t]; this._updateEvent(e); }), (n.prototype.getEnabled = function () { return this.enabled; }), (n.prototype.setEnabled = function (t) { t != this.enabled && ((this.enabled = t), this.setEnabledListener(t)); }), (n.prototype.setEnabledListener = function (t) { if (!1 !== t && 0 !== t) { for (var e in this._eventsListeners) this._eventHandlers[e].allowDisable && this.addEventListenerOnAdapter( this._eventHandlers[e], this._eventsListeners[e] ); for (var e in this._onClipEventsListeners) this._onClipEventsListeners[e].event.allowDisable && this.addEventListenerOnAdapter( this._onClipEventsListeners[e].event, this._onClipEventsListeners[e].callback ); } else { for (var e in this._eventsListeners) this._eventHandlers[e].allowDisable && this.removeEventListenerOnAdapter( this._eventHandlers[e], this._eventsListeners[e] ); for (var e in this._onClipEventsListeners) this._onClipEventsListeners[e].event.allowDisable && this.removeEventListenerOnAdapter( this._onClipEventsListeners[e].event, this._onClipEventsListeners[e].callback ); } }), (n.prototype.get_alpha = function () { return 100 * this.adaptee.alpha; }), (n.prototype.set_alpha = function (t) { (this._ctBlockedByScript = !0), (t = nm(this.context, t)), isNaN(t) || (this.adaptee.alpha = t / 100); }), (n.prototype.getBlendMode = function () { return ""; }), (n.prototype.setBlendMode = function (t) {}), (n.prototype.getCacheAsBitmap = function () { return this.adaptee.cacheAsBitmap; }), (n.prototype.setCacheAsBitmap = function (t) { (t = em(this.context, t)), (this.adaptee.cacheAsBitmap = t); }), (n.prototype.getFilters = function () { return this._as2Filters; }), (n.prototype.setFilters = function (t) { (this.adaptee.filters = (function (t, e) { var n = []; if (!e) return n; for (var r = e.alGet("length"), i = 0; i < r; i++) { var o = ug(0, e.alGet(i)); o && eg[o.filterType] && ((o.filterName = eg[o.filterType]), n.push(o)); } return n; })(this.context, t)), (this._as2Filters = t); }), (n.prototype.updateFilters = function (t) { if (!t) return this.setFilters(null); this.setFilters( (function (t, e) { if (e && e.length) { for ( var n = t.globals.filters, r = [], i = 0, o = e; i < o.length; i++ ) { var a = o[i], s = n.alGet(tg[a.type]); if (s) { var u = s.alGetPrototypeProperty(); if (u.asFilterConverter) { var l = u.asFilterConverter.fromTimelineFilter(a); if (!l) continue; r.push(l); } } } return new U_(t, r); } })(this.context, t) ); }), (n.prototype.get_focusrect = function () { return !1; }), (n.prototype.set_focusrect = function (t) {}), (n.prototype.get_height = function () { var t = Qf.avmStage.pickGroup .getBoundsPicker(this.node.partition) .getBoxBounds( Qf.avmStage.pool.getNode(this.adaptee.parent || Qf.avmStage.root) ); return null == t ? 0 : Pm(t.height); }), (n.prototype.set_height = function (t) { (t = Pm(nm(this.context, t))), (this._blockedByScript = !0), isNaN(t) || (Qf.avmStage.pickGroup.getBoundsPicker( this.node.partition ).height = t); }), (n.prototype.get_highquality = function () { switch (this.get_quality()) { case "BEST": return 2; case "HIGH": return 1; default: return 0; } }), (n.prototype.set_highquality = function (t) { var e; switch (rm(this.context, t)) { case 2: e = "BEST"; break; case 1: e = "HIGH"; break; default: e = "LOW"; } this.set_quality(e); }), (n.prototype.getMenu = function () {}), (n.prototype.setMenu = function (t) {}), (n.prototype.get_name = function () { return this.adaptee ? this.adaptee.name : void 0; }), (n.prototype.set_name = function (t) { t = lm(this.context, t); var e = this.adaptee.name; this.adaptee.name = t; var n = this.get_parent(); n && (n.registerScriptObject(this.adaptee), n._updateChildName(this, e, t)); }), (n.prototype.get_parent = function () { return Sm(this.adaptee.parent, this.context) || void 0; }), (n.prototype.set_parent = function (t) {}), (n.prototype.getOpaqueBackground = function () { return 0; }), (n.prototype.setOpaqueBackground = function (t) {}), (n.prototype.get_quality = function () { return "HIGH"; }), (n.prototype.set_quality = function (t) {}), (n.prototype.set_root = function (t) {}), (n.prototype.get_root = function () { for (var t = this.adaptee, e = null; t && !t.isAVMScene; ) { if ((e = Sm(t, this.context)) && e.get_lockroot()) return e; t = t.parent; } if (t) return Sm(t, this.context); }), (n.prototype.get_rotation = function () { for (var t = Math.round(this.adaptee.rotationZ); t > 180; ) t -= 360; for (; t < -180; ) t += 360; return t; }), (n.prototype.set_rotation = function (t) { (t = nm(this.context, t)), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.rotationZ = t); }), (n.prototype.getScale9Grid = function () { return Tf.fromAS3Rectangle(this.context, this.adaptee.scale9Grid); }), (n.prototype.setScale9Grid = function (t) { this.adaptee.scale9Grid = Wh(t) ? null : Sf(t); }), (n.prototype.getScrollRect = function () { return Tf.fromAS3Rectangle(this.context, this.adaptee.scrollRect); }), (n.prototype.setScrollRect = function (t) { this.adaptee.scrollRect = Wh(t) ? null : Sf(t); }), (n.prototype.get_soundbuftime = function () { return 0; }), (n.prototype.set_soundbuftime = function (t) {}), (n.prototype.getTabEnabled = function () { return !!this.adaptee && this.adaptee.tabEnabled; }), (n.prototype.setTabEnabled = function (t) { this.adaptee && (this.adaptee.tabEnabled = t); }), (n.prototype.getTabIndex = function () { return this.adaptee.tabIndex; }), (n.prototype.setTabIndex = function (t) { this.adaptee.tabIndex = t; }), (n.prototype.get_target = function () { var t = this.adaptee; if (t === t.root) return "/"; var e = ""; do { if (Wh(t)) return; (e = "/" + t.name + e), (t = t.parent); } while (t && !t.isAVMScene); return e; }), (n.prototype.getTransform = function () { return this.context.swfVersion < 8 ? this.transformPreFP8 : (this._avmTransform || (this._avmTransform = this.context.globals.Transform.alConstruct([this])), this._avmTransform); }), (n.prototype.setTransform = function (t) { this.context.swfVersion < 8 ? (this.transformPreFP8 = t) : t instanceof $f && console.log("not implemented: AVM1SymbolBase.setTransform"); }), (n.prototype.get_visible = function () { return this.adaptee.visible; }), (n.prototype.set_visible = function (t) { (this._visibilityByScript = !0), (t = em(this.context, t)), (this.adaptee.visible = t); }), (n.prototype.get_url = function () { return this.adaptee.assetNamespace; }), (n.prototype.get_width = function () { var t = Qf.avmStage.pickGroup .getBoundsPicker(this.node.partition) .getBoxBounds( Qf.avmStage.pool.getNode(this.adaptee.parent || Qf.avmStage.root) ); return null == t ? 0 : Om(t.width); }), (n.prototype.set_width = function (t) { (t = Om(nm(this.context, t))), (this._blockedByScript = !0), isNaN(t) || (Qf.avmStage.pickGroup.getBoundsPicker( this.node.partition ).width = t); }), (n.prototype.get_x = function () { return Pm(this.adaptee.x); }), (n.prototype.set_x = function (t) { (t = Pm(nm(this.context, t))), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.x = t); }), (n.prototype.get_xmouse = function () { return Pm(Qf.avmStage.getLocalMouseX(this.node)); }), (n.prototype.get_xscale = function () { return 100 * this.adaptee.scaleX; }), (n.prototype.set_xscale = function (t) { (t = nm(this.context, t)), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.scaleX = t / 100); }), (n.prototype.get_y = function () { return Pm(this.adaptee.y); }), (n.prototype.set_y = function (t) { (t = Pm(nm(this.context, t))), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.y = t); }), (n.prototype.get_ymouse = function () { return Pm(Qf.avmStage.getLocalMouseY(this.node)); }), (n.prototype.get_yscale = function () { return 100 * this.adaptee.scaleY; }), (n.prototype.set_yscale = function (t) { (t = nm(this.context, t)), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.scaleY = t / 100); }), (n.prototype.getDepth = function () { return this.protoTypeChanged ? null : Mm(this.adaptee._avmDepthID); }), (n.prototype.toString = function () { for (var t = this.adaptee, e = []; t; ) t.isAVMScene ? (e.push("_level0"), (t = null)) : (e.push(t.name), (t = t.parent)); for (var n = e.length, r = ""; n > 0; ) (r += e[--n]), n > 0 && (r += "."); return r; }), (n.LAZY_EVENT_QUEUE = []), n ); })(vf), yg = (function () { return function (t, e, n, r, i, o) { (this.propertyName = t), (this.eventName = e), (this.stageEvent = n), (this.allowDisable = r), (this.isMouse = i), (this.isButton = o); }; })(), Ag = (function () { return function () {}; })(), vg = [ -1, 37, 39, 36, 35, 45, 46, -1, 8, -1, -1, -1, -1, 13, 38, 40, 33, 34, 9, 27, ], bg = Object.create(null), Cg = bg, Ig = yg; (Cg[262144] = !0), (Cg[512] = !0), (Cg[131072] = new Ig("onKey", Xc.KEYDOWN, !0, !0, !1, !1)), (Cg[1] = new Ig("onLoad", "load", !1, !1, !1, !1)), (Cg[4] = new Ig("onUnload", "unload", !1, !1, !1, !1)), (Cg[256] = new Ig("onData", "data", !1, !1, !1, !1)), (Cg[2] = new Ig("onEnterFrame", "enterFrame", !1, !1, !1, !1)), (Cg[64] = new Ig("onKeyDown", Xc.KEYDOWN, !0, !0, !1, !1)), (Cg[128] = new Ig("onKeyUp", Xc.KEYUP, !0, !0, !1, !1)), (Cg[8] = new Ig("onMouseMove", vu.MOUSE_MOVE, !0, !0, !0, !1)), (Cg[16] = new Ig("onMouseDown", vu.MOUSE_DOWN, !0, !0, !0, !1)), (Cg[32] = new Ig("onMouseUp", vu.MOUSE_UP, !0, !0, !0, !1)), (Cg[1024] = new Ig("onPress", vu.MOUSE_DOWN, !1, !0, !0, !0)), (Cg[2048] = new Ig("onRelease", vu.MOUSE_UP, !1, !0, !0, !0)), (Cg[4096] = new Ig( "onReleaseOutside", vu.MOUSE_UP_OUTSIDE, !1, !0, !0, !0 )), (Cg[8192] = new Ig("onRollOver", vu.MOUSE_OVER, !1, !0, !0, !0)), (Cg[16384] = new Ig("onRollOut", vu.MOUSE_OUT, !1, !0, !0, !0)), (Cg[32768] = new Ig("onDragOver", vu.DRAG_OVER, !1, !0, !0, !0)), (Cg[65536] = new Ig("onDragOut", vu.DRAG_OUT, !1, !0, !0, !0)); var Eg = new Ig("onSetFocus", Ws.FOCUS_IN, !1, !0, !1, !1), xg = new Ig("onKillFocus", Ws.FOCUS_OUT, !1, !0, !1, !1), wg = new Ig("onChanged", Yc.CHANGED, !1, !0, !1, !1), Sg = [ bg[1], bg[4], bg[256], bg[2], bg[64], bg[128], bg[8], bg[16], bg[32], bg[1024], bg[2048], bg[4096], bg[8192], bg[16384], bg[32768], bg[65536], bg[131072], Eg, xg, wg, ], Dg = [ bg[1], bg[4], bg[256], bg[2], bg[64], bg[128], bg[1024], bg[2048], bg[4096], bg[8192], bg[16384], bg[32768], bg[65536], bg[131072], Eg, xg, wg, ], Tg = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e._prevTextVarContent = ""), (e._textVarHolder = null), (e._textVarPropName = ""), e ); } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], [ "_alpha#", "addListener", "antiAliasType#", "autoSize#", "background#", "backgroundColor#", "border#", "borderColor#", "bottomScroll#", "condenseWhite#", "embedFonts#", "filters#", "getAwayJSID", "getNewTextFormat", "getTextFormat", "gridFitType#", "getDepth", "_height#", "_highquality#", "hscroll#", "html#", "htmlText#", "length#", "maxChars#", "maxhscroll#", "maxscroll#", "multiline#", "_name#", "_parent#", "password#", "_quality#", "_rotation#", "replaceSel", "removeMovieClip", "removeTextField", "restrict#", "scroll#", "selectable#", "setNewTextFormat", "setTextFormat", "_soundbuftime#", "tabEnabled#", "tabIndex#", "_target#", "toString", "text#", "textColor#", "textHeight#", "textWidth#", "type#", "_url#", "variable#", "_visible#", "_width#", "wordWrap#", "_x#", "_xmouse#", "_xscale#", "_y#", "_ymouse#", "_yscale#", ] ); }), (n.prototype.dispatchKeyEvent = function (t, e, n, r) { if ( this.context.globals.Stage && this.context.globals.Stage.avmStage && this.context.globals.Stage.avmStage.mouseManager.useSoftkeyboard ) { var i = this.context.getStaticState(Jf); (i._lastKeyCode = t), (i._keyStates[t] = 1), fm(I_.instance.Key, "broadcastMessage", ["onKeyDown"]); var o = new Xc(Xc.KEYDOWN, "", t); (o.isShift = e), (o.isCTRL = n), (o.isAlt = r), this.context.globals.Stage.avmStage.dispatchEvent(o), delete i._keyStates[t], fm(I_.instance.Key, "broadcastMessage", ["onKeyUp"]), ((o = new Xc(Xc.KEYUP, "", t)).isShift = e), (o.isCTRL = n), (o.isAlt = r), this.context.globals.Stage.avmStage.dispatchEvent(o); } }), (n.syncAllTextfields = function () { for (var t in n.allTextfields) n.allTextfields[t] ? n.allTextfields[t].syncTextFieldValue() : delete n.allTextfields[t]; }), (n.syncQueedTextfields = function () { if (n.textFieldVars.length > 0) { for (var t = n.textFieldVars.length, e = 0; e < t; e++) n.textFieldVars[e].syncTextFieldValue(); n.textFieldVars.length = 0; } }), (n.prototype.getAwayJSID = function () { return this.adaptee.id; }), (n.prototype.selectTextField = function (t) { void 0 === t && (t = !1), I_.softKeyboardManager && (("dummy_txt" != this.adaptee.name && 0 != this.adaptee.name.indexOf("temp")) || (t = !0), I_.softKeyboardManager.openKeyboard(this.adaptee, t)); }), (n.prototype.removeMovieClip = function () { this.adaptee.isAVMScene || (this.adaptee.parent && Mm(this.adaptee._avmDepthID) >= -1 && this.adaptee.parent.adapter.removeChildAtDepth( this.adaptee._avmDepthID )); }), (n.prototype.alPut = function (e, n) { t.prototype.alPut.call(this, e, n); }), (n.prototype.initAdapter = function () { var t = this; this.adaptee._symbol && this.setVariable(this.adaptee._symbol.variableName || ""), this.adaptee.addEventListener(Yc.CHANGED, function () { t.updateVarFromText(), t.syncTextFieldValue(); }); }), (n.prototype.initAVM1SymbolInstance = function (e, n) { t.prototype.initAVM1SymbolInstance.call(this, e, n), (this.adaptee = n), this._initEventsHandlers(), (this._variable = ""), (this._exitFrameHandler = null), (this.adaptee = n); }), (n.prototype.clone = function () { return Sm(this.adaptee.clone(), this._avm1Context); }), (n.prototype.getAntiAliasType = function () { return ""; }), (n.prototype.setAntiAliasType = function (t) {}), (n.prototype.get_width = function () { return this.syncTextFieldValue(), Om(this.adaptee.width); }), (n.prototype.get_height = function () { return this.syncTextFieldValue(), Om(this.adaptee.height); }), (n.prototype.set_width = function (t) { (t = Om(nm(this.context, t))), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.width = t); }), (n.prototype.set_height = function (t) { (t = Om(nm(this.context, t))), (this._blockedByScript = !0), isNaN(t) || (this.adaptee.height = t); }), (n.prototype.get_x = function () { return ( this.syncTextFieldValue(), Pm(this.adaptee.x + this.adaptee.scaleX * this.adaptee.textOffsetX) ); }), (n.prototype.get_y = function () { return ( this.syncTextFieldValue(), Pm(this.adaptee.y + this.adaptee.scaleY * this.adaptee.textOffsetY) ); }), (n.prototype.set_x = function (t) { this.syncTextFieldValue(), (this.adaptee.x = Pm( t - this.adaptee.scaleX * this.adaptee.textOffsetX )); }), (n.prototype.set_y = function (t) { this.syncTextFieldValue(), (this.adaptee.y = Pm( t - this.adaptee.scaleY * this.adaptee.textOffsetY )); }), (n.prototype.getAutoSize = function () { return this.adaptee.autoSize; }), (n.prototype.setAutoSize = function (t) { !0 === t ? (t = "left") : !1 === t && (t = "none"), (t = lm(this.context, t)), (this.adaptee.autoSize = t); }), (n.prototype.getBackground = function () { return this.adaptee.background; }), (n.prototype.setBackground = function (t) { (t = em(this.context, t)), (this.adaptee.background = t); }), (n.prototype.getBackgroundColor = function () { return this.adaptee.backgroundColor; }), (n.prototype.setBackgroundColor = function (t) { (t = im(this.context, t)), (this.adaptee.backgroundColor = t); }), (n.prototype.getBorder = function () { return this.adaptee.border; }), (n.prototype.setBorder = function (t) { (t = em(this.context, t)), (this.adaptee.border = t); }), (n.prototype.getBorderColor = function () { return this.adaptee.borderColor; }), (n.prototype.setBorderColor = function (t) { (t = im(this.context, t)), (this.adaptee.borderColor = t); }), (n.prototype.getBottomScroll = function () { return this.adaptee.bottomScrollV + 1; }), (n.prototype.getCondenseWhite = function () { return this.adaptee.condenseWhite; }), (n.prototype.setCondenseWhite = function (t) { (t = em(this.context, t)), (this.adaptee.condenseWhite = t); }), (n.prototype.getEmbedFonts = function () { return this.adaptee.embedFonts; }), (n.prototype.setEmbedFonts = function (t) { (t = em(this.context, t)), (this.adaptee.embedFonts = t); }), (n.prototype.getNewTextFormat = function () { return Wf.createFromNative(this.context, this.adaptee.textFormat); }), (n.prototype.getTextFormat = function (t, e) { void 0 === t && (t = -1), void 0 === e && (e = -1), (t = rm(this.context, t)), (e = rm(this.context, e)); var n = this.adaptee.getTextFormat(t, e); return Wf.createFromNative(this.context, n); }), (n.prototype.getGridFitType = function () { return ""; }), (n.prototype.setGridFitType = function (t) {}), (n.prototype.getHscroll = function () { return this.adaptee.scrollH + 1; }), (n.prototype.setHscroll = function (t) { (t = cm(this.context, t)) <= 0 && (t = 1), (this.adaptee.scrollH = t - 1); }), (n.prototype.getHtml = function () { return this.adaptee.html; }), (n.prototype.setHtml = function (t) { this.adaptee.html = !!t; }), (n.prototype.getHtmlText = function () { return this.adaptee.html ? this.adaptee.htmlText : this.adaptee.text; }), (n.prototype.setHtmlText = function (t) { (t = void 0 === t ? "undefined" : om(this.context, t)), this.adaptee.html ? (this.adaptee.htmlText = t) : (this.adaptee.text = t), this.updateVarFromText(), this.syncTextFieldValue(); }), (n.prototype.getLength = function () { return this.adaptee.length; }), (n.prototype.getMaxChars = function () { return 0 == this.adaptee.maxChars ? null : this.adaptee.maxChars; }), (n.prototype.setMaxChars = function (t) { (t = cm(this.context, t)), (this.adaptee.maxChars = t); }), (n.prototype.getRestrict = function () { return this.adaptee.restrict; }), (n.prototype.setRestrict = function (t) { (t = lm(this.context, t)), (this.adaptee.restrict = t); }), (n.prototype.getMaxhscroll = function () { return this.adaptee.maxScrollH + 1; }), (n.prototype.getMaxscroll = function () { return this.adaptee.maxScrollV + 1; }), (n.prototype.getMultiline = function () { return this.adaptee.multiline; }), (n.prototype.setMultiline = function (t) { (t = em(this.context, t)), (this.adaptee.multiline = t); }), (n.prototype.getPassword = function () { return this.adaptee.displayAsPassword; }), (n.prototype.setPassword = function (t) { (t = em(this.context, t)), (this.adaptee.displayAsPassword = t); }), (n.prototype.getScroll = function () { return this.adaptee.scrollV + 1; }), (n.prototype.setScroll = function (t) { (t = cm(this.context, t)) <= 0 && (t = 1), (this.adaptee.scrollV = t - 1); }), (n.prototype.getSelectable = function () { return this.adaptee.selectable; }), (n.prototype.setSelectable = function (t) { "false" == t && (t = !1), (t = em(this.context, t)) || this.context.globals.Stage.avmStage.mouseManager.getFocus() != this.adaptee || this.context.globals.Stage.avmStage.mouseManager.setFocus(null), (this.adaptee.selectable = t); }), (n.prototype.replaceSel = function (t) { (t = om(this.context, t)), this.adaptee.replaceSelectedText(t); }), (n.prototype.setNewTextFormat = function (t) { var e; t instanceof Wf ? ((e = t.adaptee), this.adaptee.textFormat || (this.adaptee.textFormat = new zc()), (this.adaptee.newTextFormat = e)) : console.log( "AVM1Textfield.setNewtextFormat - trying to set something other than a TextFormat", t ); }), (n.prototype.setTextFormat = function () { this._variable && this.syncTextFieldValue(); var t, e, n = -1, r = -1; switch (arguments.length) { case 0: return; case 1: t = arguments[0]; break; case 2: (n = nm(this.context, arguments[0])), (t = arguments[1]); break; default: (n = nm(this.context, arguments[0])), (r = nm(this.context, arguments[1])), (t = arguments[2]); } n >= 0 && -1 == r && (r = n), t instanceof Wf && ((e = t.adaptee), this.adaptee.setTextFormat(e, n, r)); }), (n.prototype.getText = function () { return this._variable && this.syncTextFieldValue(), this.adaptee.text; }), (n.prototype.setText = function (t) { t = void 0 === t ? "" : om(this.context, t); var e = this.context.utils; if (this.adaptee.parent) { var n = Sm(this.adaptee.parent, this.context); e.setProperty(n, this._variable, t); } (this.adaptee.text = t), this._variable && (this.updateVarFromText(), this.syncTextFieldValue()); }), (n.prototype.getTextColor = function () { return this.adaptee.textColor; }), (n.prototype.setTextColor = function (t) { (t = im(this.context, t)), (this.adaptee.textColor = t); }), (n.prototype.getTextHeight = function () { return ( this._variable && this.syncTextFieldValue(), this.adaptee.textHeight ); }), (n.prototype.setTextHeight = function (t) {}), (n.prototype.getTextWidth = function () { return ( this._variable && this.syncTextFieldValue(), this.adaptee.textWidth ); }), (n.prototype.setTextWidth = function (t) {}), (n.prototype.getType = function () { return this.adaptee.type; }), (n.prototype.setType = function (t) { (t = lm(this.context, t)) && (t = t.toLowerCase()), (this.adaptee.type = t); }), (n.prototype.getVariable = function () { return this._variable; }), (n.prototype.setVariable = function (t) { if ((t = lm(this.context, t)) !== this._variable) { var e = this.adaptee; (n.allTextfields[e.id] = this), (this._prevTextVarContent = this.adaptee.text), this._syncTextFieldValue(e, t), this._exitFrameHandler && !t && (e.removeEventListener("exitFrame", this._exitFrameHandler), (this._exitFrameHandler = null)), (this._variable = t), !this._exitFrameHandler && t && ((this._exitFrameHandler = this._onAS3ObjectExitFrame.bind(this)), e.addEventListener("exitFrame", this._exitFrameHandler)); } }), (n.prototype._onAS3ObjectExitFrame = function () { this._variable && this._syncTextFieldValue(this.adaptee, this._variable); }), (n.prototype.syncTextFieldValue = function () { this._syncTextFieldValue(this.adaptee, this._variable); }), (n.prototype.updateVarFromText = function () { this._textVarHolder && (this.context.utils.setProperty( this._textVarHolder, this._textVarPropName, this.adaptee.html ? this.adaptee.htmlText : this.adaptee.text ), (this._prevTextVarContent = this.adaptee.text)); }), (n.prototype._syncTextFieldValue = function (t, e) { if (e && "" != e) { var r = this.context.utils; if (null == this._textVarHolder) if (e.indexOf(".") >= 0 || e.indexOf(":") >= 0) { var i = e.split(/[.:\/]/g); if ( ((this._textVarPropName = i.pop()), "_root" == i[0] || "_level0" == i[0] || "_level" == i[0] || "" === i[0]) ) { var o = t.parent; for (this._textVarHolder = null; o; ) o.isAVMScene ? ((this._textVarHolder = o.adapter), (o = null)) : (o = o.parent); if (null === this._textVarHolder) return; i.shift(), "" === i[0] && i.shift(); } else if ("_global" == i[0]) i.shift(), (this._textVarHolder = this.context.globals); else { if (!t.parent) return; this._textVarHolder = Sm(t.parent, this.context); } for (var a = null; i.length > 0; ) if ( ((a = i.shift()), (this._textVarHolder = r.getProperty( this._textVarHolder, a )), !this._textVarHolder) ) return; } else if ( ((this._textVarPropName = e), t.parent && t.parent.parent) ) { this._textVarHolder = Sm(t.parent, this.context); for ( var s = void 0, u = t.parent.parent, l = u.numChildren, c = 0; c < l; c++ ) (s = u.getChildAt(c)) != t.parent && s.name == t.parent.name && r.hasProperty(s.adapter, this._textVarPropName) && (this._textVarHolder = s.adapter); } if (!this._textVarHolder) return ( n.textFieldVars.push(this), t.html ? (this._prevTextVarContent = t.htmlText) : void (this._prevTextVarContent = t.text) ); if (!r.hasProperty(this._textVarHolder, this._textVarPropName)) { var h = void 0; return t.html ? ((h = { isTextVar: !0, value: void 0 }), "" != t.htmlText && (h.value = t.htmlText), r.setProperty(this._textVarHolder, this._textVarPropName, h), r.setProperty( this._textVarHolder, this._textVarPropName + "_internal_TF", this ), void (this._prevTextVarContent = t.htmlText)) : ((h = { isTextVar: !0, value: void 0 }), "" != t.text && (h.value = t.text), r.setProperty(this._textVarHolder, this._textVarPropName, h), r.setProperty( this._textVarHolder, this._textVarPropName + "_internal_TF", this ), void (this._prevTextVarContent = t.text)); } r.hasProperty( this._textVarHolder, this._textVarPropName + "_internal_TF" ) || r.setProperty( this._textVarHolder, this._textVarPropName + "_internal_TF", this ); var p = r.getProperty(this._textVarHolder, this._textVarPropName); if (("string" != typeof p && (p = om(this.context, p)), t.html)) { if (p !== this._prevTextVarContent) return ( (t.htmlText = void 0 === p ? "" : p), void (this._prevTextVarContent = p) ); t.htmlText === p || (void 0 === p && "" === t.htmlText) || (t.htmlText = void 0 === p ? "" : p); } else { if (p !== this._prevTextVarContent) return ( (t.text = void 0 === p ? "" : p), void (this._prevTextVarContent = p) ); t.text === p || (void 0 === p && "" === t.text) || (t.text = void 0 === p ? "" : p); } } }), (n.prototype.getWordWrap = function () { return this.adaptee.wordWrap; }), (n.prototype.setWordWrap = function (t) { (t = em(this.context, t)), (this.adaptee.wordWrap = t); }), (n.prototype._initEventsHandlers = function () { this.bindEvents(Sg); }), (n.allTextfields = {}), (n.textFieldVars = []), n ); })(mg), Pg = (function () { function t(t) { var e = this; (this.result = new Zh()), (this._context = t), (this._onAssetCompleteDelegate = function (t) { return e.onAssetComplete(t); }), (this._onLoaderCompleteDelegate = function (t) { return e.onLoaderComplete(t); }), (this._onLoadErrorDelegate = function (t) { return e.onLoadError(t); }), (this._loader = new ct()); } return ( Object.defineProperty(t.prototype, "loader", { get: function () { return this._loader; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "content", { get: function () { return this._content; }, enumerable: !0, configurable: !0, }), (t.prototype.onAssetComplete = function (t) { var e = t.asset; if (e.isAsset(Cu)) { if (e.assetNamespace != this._url) return; e.isAVMScene && ((this._content = e), this.result.resolve(e), e.adapter.initAdapter()); } }), (t.prototype.onLoaderComplete = function (t) { t.url == this._url && (pt.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), pt.removeEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), pt.removeEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate)); }), (t.prototype.onLoadError = function (t) { pt.removeEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), pt.removeEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), pt.removeEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), console.log("load error in loadMovie", t); }), (t.prototype._loadingCallback = function (t, e) { var n = e.adaptee, r = t; (n.isAVMScene = r.isAVMScene), (n.timeline = r.timeline), (n.assetNamespace = r.assetNamespace), n.reset(!0, !1); }), (t.prototype.loadMovieAt = function (e, n, r) { var i = this; if (!r) throw new Error("Target can't be null"); var o = t._loaderCache[e]; return o ? (this._loadingCallback(o, r), Promise.resolve(r)) : this.load(e, n).then(function () { return (o = i.content) ? ((t._loaderCache[e] = o), i._loadingCallback(o, r), r) : null; }); }), (t.prototype.load = function (t, e) { return ( (this._url = t), (this.result = new Zh()), pt.addEventListener( c.ASSET_COMPLETE, this._onAssetCompleteDelegate ), pt.addEventListener( V.LOADER_COMPLETE, this._onLoaderCompleteDelegate ), pt.addEventListener(H.LOAD_ERROR, this._onLoadErrorDelegate), pt.load(new dt(t), null, t, new Wd(I_._scenegraphFactory)), this.result.promise ); }), (t._loaderCache = {}), t ); })(); function Og(t, e) { var n = sm(e); return ( n.alPut("xMin", t.left), n.alPut("yMin", t.top), n.alPut("xMax", t.right), n.alPut("yMax", t.bottom), n ); } var Bg = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e._hitReportCount = 0), (e._depthToChilds = {}), (e._nextHighestDepth = 1), (e.executeConstructor = null), (e._locked = !1), (e.unregisteredColors = {}), (e.isDragging = !1), (e.startDragPoint = new P()), (e.startDragMCPosition = new P()), e ); } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], [ "$version#", "_alpha#", "getAwayJSID", "attachAudio", "attachBitmap", "attachMovie", "attachVideo", "beginFill", "beginBitmapFill", "beginGradientFill", "blendMode#", "cacheAsBitmap#", "_callFrame", "clear", "createEmptyMovieClip", "createTextField", "_currentframe#", "curveTo", "_droptarget#", "duplicateMovieClip", "enabled#", "endFill", "filters#", "_framesloaded#", "_focusrect#", "forceSmoothing#", "getBounds", "getBytesLoaded", "getBytesTotal", "getDepth", "getInstanceAtDepth", "getNextHighestDepth", "getRect", "getSWFVersion", "getTextSnapshot", "getURL", "globalToLocal", "gotoAndPlay", "gotoAndStop", "_height#", "_highquality#", "hitArea#", "hitTest", "lineGradientStyle", "lineStyle", "lineTo", "loadMovie", "loadVariables", "localToGlobal", "_lockroot#", "menu#", "moveTo", "_name#", "nextFrame", "opaqueBackground#", "_parent#", "play", "prevFrame", "_quality#", "removeMovieClip", "_root#", "_rotation#", "scale9Grid#", "scrollRect#", "setMask", "_soundbuftime#", "startDrag", "stop", "stopDrag", "swapDepths", "tabChildren#", "tabEnabled#", "tabIndex#", "_target#", "_totalframes#", "trackAsMenu#", "transform#", "toString", "unloadMovie", "_url#", "useHandCursor#", "_visible#", "_width#", "_x#", "_xmouse#", "_xscale#", "_y#", "_ymouse#", "_yscale#", ] ); }), Object.defineProperty(n.prototype, "_stage", { get: function () { return Qf.avmStage; }, enumerable: !0, configurable: !0, }), (n.prototype.setDepthToChild = function (t, e) { e ? (this._depthToChilds[t] = e) : delete this._depthToChilds[t]; }), (n.prototype.getDepthToChild = function (t) { return this._depthToChilds[t]; }), (n.prototype.addTimelineChildAtDepth = function (t, e) { (e -= 16383), t.adapter != t && t.adapter.deleteOwnProperties && t.adapter.deleteOwnProperties(), t.reset(), this.addChildAtDepth(t, e, !0); }), (n.prototype.removeTimelineChildAt = function (t) { (t -= 16383), this.removeChildAtDepth(t); }), (n.prototype.removeAllTimelineChilds = function () { for (var t = this.adaptee.numChildren - 1; t >= 0; t--) { this.adaptee.getChildAt(t)._avmDepthID < 0 && this.adaptee.removeChildAt(t); } }), (n.prototype.getTimelineChildAtSessionID = function (t) { return this.adaptee.getTimelineChildAtSessionID(t); }), (n.prototype.getDepthIndexInternal = function (t) { var e = this.getDepthToChild(t); return e ? e.parent !== this.adaptee ? -1 : this.adaptee.getChildIndex(e) : -1; }), (n.prototype.getIndexFromDepthOrTop = function (t) { for (var e = 0; e < this.adaptee.numChildren; e++) if (this.adaptee.getChildAt(e)._avmDepthID > t) return e; return this.adaptee.numChildren; }), (n.prototype.removeChildAtDepth = function (t) { var e = this.getDepthIndexInternal(t); -1 !== e && this.removeChildAt(e); }), (n.prototype.removeChildAt = function (t) { var e = this.adaptee.removeChildAt(t); e._adapter && e.adapter.freeFromScript(), this.unregisterScriptObject(e), delete this.adaptee._sessionID_childs[e._sessionID], this.setDepthToChild(e._avmDepthID), (e._sessionID = -1), (e._avmDepthID = -16384); }), (n.prototype.addChildAtDepth = function (t, e, n) { if ((void 0 === n && (n = !1), null == t)) throw "Parameter child cannot be null."; var r = this.getDepthIndexInternal(e); if (-1 != r) { if (n) return console.log("depth is occupied"), null; this.removeChildAt(r), this.adaptee.addChildAt(t, r); } else this.adaptee.addChildAt(t, this.getIndexFromDepthOrTop(e)); return ( this.adaptee.isSlice9ScaledMC && "[asset Sprite]" == t.assetType && (t.isSlice9ScaledSprite = !0), this._nextHighestDepth < e + 1 && (this._nextHighestDepth = e + 1), (t._avmDepthID = e), t.adapter != t && t.adapter.initAdapter(), this.setDepthToChild(e, t), n && (this.adaptee._sessionID_childs[t._sessionID] = t), Sm(t, this._avm1Context) ); }), (n.prototype.sortVirtualSceneGraph = function (t, e) { return t.depth - e.depth; }), (n.prototype.queueFrameScripts = function (t, e, n) { var r = t.get_script_for_frame(this.adaptee, e, !0); r && (n ? bu.add_script_to_queue(this.adaptee, r) : bu.add_script_to_queue_pass2(this.adaptee, r)); }), (n.prototype.constructFrame = function (t, e, n, r, i, o, a) { for ( var s, u, l = {}, c = {}, h = this.adaptee.numChildren, p = 0; p < h; p++ ) { var d = this.adaptee.getChildAt(p); (r || -1 == d._sessionID) && (l[d._avmDepthID] = { sessionID: d._sessionID, addedOnTargetFrame: !1, depth: d._avmDepthID, child: d, }), d._sessionID >= 0 && (c[d._sessionID] = d); } (t._update_indices.length = 0), (t._update_frames.length = 0); var f, g, _ = 0; for (u = e; u <= n; u++) { var m = t.frame_command_indices[u], y = t.frame_recipe[u]; if (2 & y) for ( g = (f = t.command_index_stream[m]) + t.command_length_stream[m++], s = f; s < g; s++ ) delete l[t.remove_child_stream[s] - 16383]; if (4 & y) if ( ((g = (f = t.command_index_stream[m]) + t.command_length_stream[m++]), o) ) for (s = g - 1; s >= f; s--) l[t.add_child_stream[3 * s + 1] - 16383] || (l[t.add_child_stream[3 * s + 1] - 16383] = { sessionID: t.add_child_stream[3 * s], symbolID: t.add_child_stream[3 * s + 2], addedOnTargetFrame: u == n, depth: t.add_child_stream[3 * s + 1] - 16383, }); else for (s = f; s < g; s++) l[t.add_child_stream[3 * s + 1] - 16383] || (l[t.add_child_stream[3 * s + 1] - 16383] = { sessionID: t.add_child_stream[3 * s], symbolID: t.add_child_stream[3 * s + 2], addedOnTargetFrame: u == n, depth: t.add_child_stream[3 * s + 1] - 16383, }); 8 & y && ((t._update_frames[_] = t.keyframe_firstframes[u]), (t._update_indices[_++] = m++)), 16 & y && u == n && t.start_sounds(this.adaptee, m); } var A = []; for (var v in l) A[A.length] = l[v]; A.sort(this.sortVirtualSceneGraph); var b, C = [], I = [], E = []; (this._depthToChilds = {}), (this.adaptee._sessionID_childs = {}), (this.adaptee.preventScript = !0), (h = C.length = A.length); for (var x = 0; x < h; x++) if (-1 == (b = A[x]).sessionID && b.child) (C[x] = b.child), this.setDepthToChild(b.depth, b.child); else if (c[b.sessionID]) { var w = c[b.sessionID], S = b.depth; (w._avmDepthID = S), (w._sessionID = b.sessionID), this.setDepthToChild(S, w), (this.adaptee._sessionID_childs[b.sessionID] = w), (C[x] = w), r || (C[x]._adapter ? (C[x].adapter.isColorTransformByScript() || C[x].transform.clearColorTransform(), C[x].adapter.isBlockedByScript() || C[x].noTimelineUpdate || (C[x].transform.clearMatrix3D(), (C[x].masks = null), (C[x].maskMode = !1)), C[x].adapter.isVisibilityByScript() || (C[x].visible = !0)) : (C[x].transform.clearColorTransform(), C[x].transform.clearMatrix3D(), (C[x].visible = !0), (C[x].masks = null), (C[x].maskMode = !1))); } else { var D = t.getChildInstance(b.symbolID, b.sessionID); this.adaptee.isSlice9ScaledMC && "[asset Sprite]" == D.assetType && (D.isSlice9ScaledSprite = !0); S = D._avmDepthID = b.depth; (D._sessionID = b.sessionID), this.setDepthToChild(S, D), (this.adaptee._sessionID_childs[b.sessionID] = D), (C[x] = D), b.addedOnTargetFrame ? (E[E.length] = D) : (I[I.length] = D); } for (var T = this.adaptee.numChildren - 1; T >= 0; T--) C.indexOf(this.adaptee.getChildAt(T)) < 0 && this.adaptee.removeChildAt(T); for (var P = 0; P < C.length; P++) this.adaptee.contains(C[P]) || this.adaptee.addChildAt(C[P], P); (this.adaptee.preventScript = !0), this.finalizeChildren(I), (this.adaptee.preventScript = !1), a && this.queueFrameScripts(t, i, !o), this.finalizeChildren(E); }), (n.prototype.finalizeChildren = function (t) { for (var e = t.length, n = 0; n < e; n++) { var r = t[n]; r.adapter != r && r.adapter.deleteOwnProperties && r.adapter.deleteOwnProperties(), r.reset(), r.adapter != r && r.adapter.initAdapter(); } }), (n.prototype.removeMovieClip = function () { this.adaptee.isAVMScene || !this.adaptee.parent || Mm(this.adaptee._avmDepthID) < 0 || (this.adaptee.parent.adapter.removeChildAtDepth( this.adaptee._avmDepthID ), this.scriptMaskee && this.scriptMaskee.setMask(null), this.freeFromScript(), (this._childrenByName = {}), (this._depthToChilds = {}), this.makeGhost()); }), (n.prototype._updateMouseEnabled = function (t, e) { this.adaptee.isAVMScene || (t.isMouse && (e ? (this._mouseListenerCount++, (this.adaptee.mouseEnabled = !0), (this.adaptee.mouseChildren = !1), t.isButton && (this._mouseButtonListenerCount++, (this.adaptee.buttonMode = !0))) : (this._mouseListenerCount--, this._mouseListenerCount <= 0 && ((this._mouseListenerCount = 0), (this.adaptee.mouseEnabled = !1), (this.adaptee.mouseChildren = !0)), t.isButton && (this._mouseButtonListenerCount--, this._mouseButtonListenerCount <= 0 && ((this._mouseButtonListenerCount = 0), (this.adaptee.buttonMode = !1)))))), this.enabled || (this.adaptee.mouseChildren = !1); }), (n.prototype.clone = function () { var t = Sm(this.adaptee.clone(), this._avm1Context); if ("piratefont" == this.adaptee.name) { var e = t.adaptee.timeline, n = e; (n.frame_command_indices = [e.frame_command_indices[0]]), (n.frame_recipe = [e.frame_recipe[0]]), (n.keyframe_constructframes = [e.keyframe_constructframes[0]]), (n.keyframe_durations = [e.keyframe_durations[0]]), (n.keyframe_firstframes = [e.keyframe_firstframes[0]]), (n.keyframe_indices = [e.keyframe_indices[0]]); } return t; }), (n.prototype.attachCustomConstructor = function () { if (this.adaptee) { var t = this.adaptee.avm1Symbol; if (t) { this.alPut("__proto__", t._ownProperties.prototype.value); var e = this; this.executeConstructor = function () { t.alCall(e), e.updateAllEvents(); }; } } }), (n.prototype.executeScript = function (t) { if ( ((n.currentMCAssetNameSpace = this.adaptee.assetNamespace), Tg.syncQueedTextfields(), t) ) { if (this.adaptee.parent) for (var e = 0; e < t.length; e++) { var r = t[e], i = function (t) { this._avm1Context.executeActions(t, this); }.bind(this, r.data); (i.precedence = r.precedence), (i.context = this.adaptee), i.call(this.adaptee); } } else { var o = this.adaptee.name.replace(/[^\w]/g, ""); window.alert( "actionsBlocks is empty, can not execute framescript" + o + this.adaptee.currentFrameIndex ); } }), (n.prototype.stopAllSounds = function () { for (var t, e = this.alGetKeys(), n = 0; n < e.length; n++) { var r = this.alGetProperty(e[n]), i = r ? r.value : null; i && i._sound && i._sound.isAsset && i._sound.isAsset(E) && i.stop(); } for (n = this.adaptee.numChildren - 1; n >= 0; n--) (t = this.adaptee.getChildAt(n)).isAsset(Cu) && t.adapter !== t && t.adapter.freeFromScript(); }), (n.prototype.freeFromScript = function () { this._locked || ((this.hasSwappedDepth = !1), t.prototype.freeFromScript.call(this), (this._mouseButtonListenerCount = 0)); }), (n.prototype.initAdapter = function () { for (var t in ((this._dropTarget = ""), (this._mouseButtonListenerCount = 0), (n.currentMCAssetNameSpace = this.adaptee.assetNamespace), this.adaptee.timeline.avm1InitActions)) this.executeScript( this.adaptee.timeline.symbolDecoder.prepareFrameScriptsForAVM1( this.adaptee.timeline.avm1InitActions[t], 0, "initActionsData" + t, this.adaptee.id ) ); this.initEvents && (function (t, e, n) { var r = Sm(t, e); n.variableName && r.alPut("variable", n.variableName); var i, o, a, s, u, l, c = n.events; if (!c) return; for (var h = null, p = 0; p < c.length; p++) for (var d in ((i = c[p]).actionsBlock ? ((o = e.actionsDataFactory.createActionsData( i.actionsBlock, "s" + n.symbolId + "d" + n.depth + "e" + p )), (i.actionsBlock = null), (i.compiled = o)) : (o = i.compiled), (a = Lm.bind(null, o, r)), (s = i.flags), bg)) (u = parseInt(d)), s & (0 | (u |= 0)) && (262144 != u ? 512 != u ? 1 != u ? (l = bg[u]).eventName ? (i.keyCode && (((h = new Ag()).keyCode = i.keyCode), i.keyCode < 32 && vg[i.keyCode] && (h.keyCode = vg[i.keyCode])), r._addOnClipEventListener(l, a, h)) : ip.warning("ClipEvent: " + u + " not implemented") : (t.onLoaded = a) : (t.onInitialize = a) : (t.onConstruct = a)); })(this.adaptee, this._avm1Context, this.initEvents), this.attachCustomConstructor(), (this.initialDepth = this.adaptee._avmDepthID), (this.adaptee.onLoaded || this.adaptee.onConstruct || this.adaptee.onInitialize || this.executeConstructor) && bu.add_loaded_action_to_queue(this.adaptee); }), (n.prototype.registerScriptObject = function (t, e) { void 0 === e && (e = !0), t.adapter != t && t.adapter.setEnabled(!0); var n = t.name; if (n) { this.context.swfVersion < 8 && (n = n.toLowerCase()); var r = this.alHasOwnProperty(n); if (e && r) { if (!this.alGetOwnProperty(n).isTextVar) return; this.alPut(n, Sm(t, this.context)); } (!this._childrenByName[n] || (this._childrenByName[n].adaptee && null == this._childrenByName[n].adaptee.parent) || (this._childrenByName[n].adaptee && this._childrenByName[n].adaptee._avmDepthID > t._avmDepthID)) && ((this._childrenByName[n] = Sm(t, this.context)), e || this.alPut(n, this._childrenByName[n])); } }), (n.prototype.unregisterScriptObject = function (t) { if (!t.adapter._locked) { var e = t.name; if (e) { this.context.swfVersion < 8 && (e = e.toLowerCase()); var n = this.alGetOwnProperty(e); if ( (n && n.value instanceof mg && this.alDeleteOwnProperty(e), this._childrenByName[e] && this._childrenByName[e].adaptee.id == t.id) ) { for ( var r = null, i = null, o = 0; o < this.adaptee.numChildren; o++ ) (r = this.adaptee.getChildAt(o)) != t && r.name && r.name.toLowerCase() == e && (!i || i._avmDepthID > r._avmDepthID) && (i = r); i ? (this._childrenByName[e] = Sm(i, this.context)) : delete this._childrenByName[e]; } } } }), (n.prototype.getLatestObjectForName = function (t) { if (!this.alHasOwnProperty(t)) { for (var e, n, r = 0; r < this.adaptee.numChildren; r++) (e = this.adaptee.getChildAt(r)).name == t && (!n || n._avmDepthID > e._avmDepthID) && (n = e); n && (this.context.swfVersion < 8 && (t = t.toLowerCase()), (this._childrenByName[t] = Sm(n, this.context)), this.unregisteredColors[t] && (this.unregisteredColors[t].changeTarget(n.adapter), (this.unregisteredColors[t] = null))); } }), Object.defineProperty(n.prototype, "graphics", { get: function () { return this.adaptee.graphics; }, enumerable: !0, configurable: !0, }), (n.prototype.initAVM1SymbolInstance = function (e, n) { var r = this; (this._childrenByName = Object.create(null)), (this._depthToChilds = Object.create(null)), t.prototype.initAVM1SymbolInstance.call(this, e, n), (this.dragListenerDelegate = function (t) { return r.dragListener(t); }), (this.stopDragDelegate = function (t) { return r.stopDrag(t); }), (this.dynamicallyCreated = !1), (this.adaptee = n), this._initEventsHandlers(); }), (n.prototype._lookupChildByName = function (t) { return this._childrenByName[t]; }), (n.prototype._lookupChildInAS3Object = function (t) { return Sm(this.adaptee.getChildByName(t), this.context); }), Object.defineProperty(n.prototype, "__targetPath", { get: function () { var t = this.get_target(), e = this.adaptee.root, n = "_level" + this.context.globals._getLevelForRoot(e); return "/" != t ? n + t.replace(/\//g, ".") : n; }, enumerable: !0, configurable: !0, }), (n.prototype.getAwayJSID = function () { return this.adaptee.id; }), (n.prototype.attachAudio = function (t) { Wh(t) || (!1 !== t && console.warn("[AVM1MovieClip] attachAudio not implemented")); }), (n.prototype.attachBitmap = function (t, e, n, r) { if ((void 0 === n && (n = "auto"), void 0 === r && (r = !1), t)) { (n = lm(this.context, n)), (r = em(this.context, r)), (t.as3BitmapData.transparent = !0); var i = t.getBillboard(n, r); this.addChildAtDepth(i, e); } else console.error( "[AVM1MovieClip:attachBitmap] Bitmap not resolved! Skip attach for prevent crash", this.adaptee.id ); }), (n.prototype._constructMovieClipSymbol = function (t, e) { (t = om(this.context, t)), (e = om(this.context, e)); var n = pt.getAsset(t, this.adaptee.assetNamespace); if (n) { var r = n.adaptee.clone(); return (r.name = e), Sm(r, this._avm1Context), r; } }), (n.prototype.get$version = function () { return ""; }), (n.prototype.rgbaToArgb = function (t) { return ( ((255 & t) << 24) | (((4278190080 & t) >>> 24) << 16) | (((16711680 & t) >>> 16) << 8) | ((65280 & t) >>> 8) ); }), (n.prototype.attachMovie = function (t, e, n, r) { if (this._constructMovieClipSymbol) { e && _m(this.context, e) && (e = e.value[0]); var i = this._constructMovieClipSymbol(t, e); if (i) { var o; i.name || (i.name = ""), (n = nm(this.context, n)), e && (o = this._childrenByName[e.toLowerCase()]), i.reset(); var a = this.addChildAtDepth(i, Bm(n)); r && a._init(r), o && o.avmColor && o.avmColor.changeTarget(a), i.timeline && i.timeline.isButton && i.addButtonListeners(), (a.dynamicallyCreated = !0), e && this.registerScriptObject(i, !0); var s = a.executeConstructor; return (a.executeConstructor = null), s && s(), a; } } }), (n.prototype.beginFill = function (t, e) { (t = im(this.context, t)), void 0 === e && (2 == arguments.length ? (e = 0) : arguments.length <= 1 && (e = 100)), (e = nm(this.context, e)), this.graphics.beginFill(t, e / 100); }), (n.prototype.beginBitmapFill = function (t, e, n, r) { void 0 === e && (e = null), void 0 === n && (n = !0), void 0 === r && (r = !1); var i = Gf(t); if (i) { var o = Wh(e) ? null : Ff(e); (n = em(this.context, n)), (r = em(this.context, r)), this.graphics.beginBitmapFill(i, o, n, r); } }), (n.prototype.beginGradientFill = function (t, e, n, r, i, o, a, s) { void 0 === o && (o = "pad"), void 0 === a && (a = "rgb"), void 0 === s && (s = 0); var u = this.context, l = U_.mapToJSArray(e, function (t) { return im(u, t); }), c = U_.mapToJSArray(n, function (t) { return nm(u, t) / 100; }), h = U_.mapToJSArray(r, function (t) { return nm(u, t); }); Wh(i) && console.warn( "[AVM1MovieClip] beginGradientFill not fully implemented" ), (o = om(u, o)), (a = om(u, a)), (s = nm(u, s)), this.graphics.beginGradientFill(t, l, c, h, null, o, a, s); }), (n.prototype._callFrame = function (t) { var e; "string" == typeof t ? ((t = t.toLowerCase()), (e = this.adaptee.timeline.getScriptForLabel(this.adaptee, t, !0))) : "number" == typeof t && (e = this.adaptee.timeline.get_script_for_frame( this.adaptee, t - 1, !0 )), e && this.executeScript(e); }), (n.prototype.clear = function () { this.graphics.clear(); }), (n.prototype._updateChildName = function (t, e, n) { e !== n && (e && this._removeChildName(t, e), n && this._addChildName(t, n)); }), (n.prototype._removeChildName = function (t, e) { if ( (this.context.isPropertyCaseSensitive || (e = e.toLowerCase()), this._childrenByName && this._childrenByName[e] && this._childrenByName[e] === t) ) { var n = this._lookupChildInAS3Object(e); n ? (this._childrenByName[e] = n) : delete this._childrenByName[e]; } }), (n.prototype._addChildName = function (t, e) { this.context.isPropertyCaseSensitive || (e = e.toLowerCase()); var n = this._childrenByName[e]; (!n || n.getDepth() > t.getDepth()) && (this._childrenByName[e] = t); }), (n.prototype.createEmptyMovieClip = function (t, e) { t = om(this.context, t); var n = new Cu(); (n.name = t), (n.assetNamespace = this.adaptee.assetNamespace), Sm(n, this._avm1Context); var r = this.addChildAtDepth(n, Bm(e)); return ( (r.dynamicallyCreated = !0), this.registerScriptObject(n, !1), (n.mouseEnabled = !1), r ); }), (n.prototype.createTextField = function (t, e, n, r, i, o) { t = om(this.context, t); var a = new bh(); (a.name = t), (a.textFormat = new zc()), Sm(a, this._avm1Context); var s = this.addChildAtDepth(a, Bm(e)); return ( this.registerScriptObject(a, !1), (a.x = n), (a.y = r), (a.width = i), (a.height = o), (s.dynamicallyCreated = !0), s ); }), (n.prototype.get_currentframe = function () { return this.adaptee.currentFrameIndex + 1; }), (n.prototype.curveTo = function (t, e, n, r) { (t = nm(this.context, t)), (e = nm(this.context, e)), (n = nm(this.context, n)), (r = nm(this.context, r)), this.graphics.curveTo(t, e, n, r); }), (n.prototype.setDropTarget = function (t) { if (t) { for (var e = []; t; ) t.isAVMScene ? (t = null) : (null != t.name && e.push(t.name), (t = t.parent)); for (var n = e.length, r = ""; n > 0; ) "" != e[--n] && (r += "/"), (r += e[n]); this._dropTarget = r; } else this._dropTarget = ""; }), (n.prototype.get_droptarget = function () { return this._dropTarget; }), (n.prototype.duplicateMovieClip = function (t, e, n) { if ((t = om(this.context, t)) == this.adaptee.name) return this; var r, i = this.get_parent(); i || (console.warn( "[AVM1MovieClip] duplicateMovieClip could not get parent" ), (i = this.context.resolveTarget(null))), this.adaptee._symbol ? console.warn( "[AVM1MovieClip] duplicateMovieClip from symbol not implemented" ) : (r = this.clone().adaptee), r.reset(), (r.name = t), (r.adapter.placeObjectTag = this.placeObjectTag), (r.adapter.initEvents = this.initEvents); var o = i.addChildAtDepth(r, Bm(e)); (o.dynamicallyCreated = !0), (o._avm1Context = this._avm1Context), i.registerScriptObject(r, !1); var a = r.transform.matrix3D, s = this.adaptee.transform.matrix3D._rawData; return ( (a._rawData[0] = s[0]), (a._rawData[1] = s[1]), (a._rawData[4] = s[4]), (a._rawData[5] = s[5]), (a._rawData[12] = s[12]), (a._rawData[13] = s[13]), r.transform.invalidateComponents(), (r.alpha = this.adaptee.alpha), (r.blendMode = this.adaptee.blendMode), (r.cacheAsBitmap = this.adaptee.cacheAsBitmap), n && o._init(n), o ); }), (n.prototype.endFill = function () { this.graphics.endFill(); }), (n.prototype.getForceSmoothing = function () { return console.warn("[AVM1MovieClip] getForceSmoothing"), !1; }), (n.prototype.setForceSmoothing = function (t) { (t = em(this.context, t)), console.warn("[AVM1MovieClip] setForceSmoothing"); }), (n.prototype.get_framesloaded = function () { return console.warn("[AVM1MovieClip] get_framesloaded"), 0; }), (n.prototype.getBounds = function (t) { if (t) { var e = this._stage.pickGroup .getBoundsPicker(this.node.partition) .getBoxBounds(t.node, !0, !0); if (e) return Og(e, this.context); console.warn( "[AVM1 MovieClip::getBounds] Bounds is null!", this.adaptee.id ); } }), (n.prototype.getBytesLoaded = function () { return this.adaptee.currentFrameIndex >= 0 ? 100 : -1; }), (n.prototype.getBytesTotal = function () { return 100; }), (n.prototype.getInstanceAtDepth = function (t) { var e = this.getDepthToChild(Bm(t)); return e ? Sm(e, this.context) : null; }), (n.prototype.getNextHighestDepth = function () { return this.context.swfVersion < 7 ? 0 : Mm(this._nextHighestDepth); }), (n.prototype.getRect = function (t) { if (t && t.node) return Og( this._stage.pickGroup .getBoundsPicker(this.node.partition) .getBoxBounds(t.node, !1, !0), this.context ); }), (n.prototype.getSWFVersion = function () { return this.context.swfVersion; }), (n.prototype.getTextSnapshot = function () { console.warn("[AVM1MovieClip] getTextSnapshot"); }), (n.prototype.getURL = function (t, e, n) { 0 !== (t = String(t)).toLowerCase().indexOf("fscommand:") ? window.open(t, e) : console.warn("[AVM1MovieClip] fsCommand not implemented "); }), (n.prototype.globalToLocal = function (t) { if (t) { var e = Cf(t); this.node.globalToLocal(e, e), If(e, t); } }), (n.prototype.gotoAndPlay = function (t) { if (!this.protoTypeChanged && null != t) { if (Array.isArray(t)) { if (0 == t.length) return; t = t[0]; } if (t instanceof U_) { if (!t.value || 0 == t.value.length) return; t = t.value[0]; } if ("string" == typeof t) { var e = t.toLowerCase(); if (null == this.adaptee.timeline._labels[e]) return ( (t = parseInt(t)), void ( isNaN(t) || ((this.adaptee.currentFrameIndex = t - 1), this.adaptee.play()) ) ); } ("number" == typeof t && t <= 0) || (this.adaptee.play(), this._gotoFrame(t)); } }), (n.prototype.gotoAndStop = function (t) { if (!this.protoTypeChanged && null != t) { if (Array.isArray(t)) { if (0 == t.length) return; t = t[0]; } if (t instanceof U_) { if (!t.value || 0 == t.value.length) return; t = t.value[0]; } ("number" == typeof t && t <= 0) || (this.adaptee.stop(), this._gotoFrame(t)); } }), (n.prototype._gotoFrame = function (t) { if ( ("number" == typeof t && t % 1 != 0 && (t = t.toString()), "string" == typeof t) ) { var e = t.toLowerCase(); if (null == this.adaptee.timeline._labels[e]) return ( (t = parseInt(t)), void (isNaN(t) || (this.adaptee.currentFrameIndex = t - 1)) ); this.adaptee.jumpToLabel(e); } else this.adaptee.currentFrameIndex = t - 1; }), (n.prototype.getHitArea = function () { return this._hitArea; }), (n.prototype.setHitArea = function (t) { this._hitArea = t; var e = t ? t.node : null; e && !e.container.isAsset(Cu) && (e = null); }), (n.prototype.hitTest = function (t, e, n) { if (arguments.length < 2) { var r = t; return ( "string" == typeof r && (r = this.context.resolveTarget(r)), !(null == r || !r.node) && Qf.avmStage.pickGroup .getBoundsPicker(this.node.partition) .hitTestObject( Qf.avmStage.pickGroup.getBoundsPicker(r.node.partition) ) ); } (t = nm(this.context, t)), (e = nm(this.context, e)); var i = this.get_root(); return i ? ((t += i.get_x()), (e += i.get_y()), (n = em(this.context, n)), this._stage.pickGroup .getBoundsPicker(this.node.partition) .hitTestPoint(t, e, n)) : (this._hitReportCount < 10 && (console.warn( "[AVM1MovieClip:: hitTest] Root return undef! Return false to prevent crash!", this.adaptee.id ), this._hitReportCount++, 10 === this._hitReportCount && console.warn( "[AVM1MovieClip:: hitTest] To many reports, supress other!" )), !1); }), (n.prototype.lineGradientStyle = function (t, e, n, r, i, o, a, s) { void 0 === o && (o = "pad"), void 0 === a && (a = "rgb"), void 0 === s && (s = 0); var u = this.context, l = U_.mapToJSArray(e, function (t) { return im(u, t); }), c = U_.mapToJSArray(n, function (t) { return nm(u, t) / 100; }), h = U_.mapToJSArray(r, function (t) { return nm(u, t); }); (o = om(u, o)), (a = om(u, a)), (s = nm(u, s)), this.graphics.lineGradientStyle(t, l, c, h, null, o, a, s); }), (n.prototype.lineStyle = function (t, e, r, i, o, a, s, u) { void 0 === t && (t = NaN), void 0 === e && (e = 0), void 0 === r && (r = 100), void 0 === i && (i = !1), void 0 === o && (o = "normal"), void 0 === a && (a = "round"), void 0 === s && (s = "round"), void 0 === u && (u = 3), (t = nm(this.context, t)), (e = im(this.context, e)), (i = em(this.context, i)), (o = om(this.context, o)); var l = n.capStyleMapStringToInt[om(this.context, a)], c = n.jointStyleMapStringToInt[om(this.context, s)]; (u = nm(this.context, u)), this.graphics.lineStyle( t, e, r / 100, i, n.noScaleDictionary[o], l, c, u ); }), (n.prototype.lineTo = function (t, e) { (t = Pm(nm(this.context, t))), (e = Pm(nm(this.context, e))), this.graphics.lineTo(t, e); }), (n.prototype.loadMovie = function (t, e) { new Pg(this.context).loadMovieAt(t, e, this).then(function (t) {}); }), (n.prototype.loadVariables = function (t, e) { this.context.actions._loadVariables(this, t, e); }), (n.prototype.localToGlobal = function (t) { if (t) { var e = Cf(t); this.node.localToGlobal(e, e), If(e, t); } }), (n.prototype.get_lockroot = function () { return this._lockroot; }), (n.prototype.set_lockroot = function (t) { this._lockroot = em(this.context, t); }), (n.prototype.moveTo = function (t, e) { (t = Pm(nm(this.context, t))), (e = Pm(nm(this.context, e))), this.graphics.moveTo(t, e); }), (n.prototype.nextFrame = function () { this.adaptee.stop(), ++this.adaptee.currentFrameIndex; }), (n.prototype.nextScene = function () { console.warn("[AVM1MovieClip] nextScene not implemented"); }), (n.prototype.play = function () { this.adaptee.play(); }), (n.prototype.prevFrame = function () { this.adaptee.stop(), --this.adaptee.currentFrameIndex; }), (n.prototype.prevScene = function () { console.warn("[AVM1MovieClip] prevScene not implemented"); }), (n.prototype.setMask = function (t) { null != t ? ((t.scriptMaskee = this), (t = this.context.resolveTarget(t)) && (this.adaptee.scriptMask = t.adaptee)) : (this.adaptee.scriptMask = null); }), (n.prototype.startDrag = function (t, e, r, i, o) { var a, s, u = this._stage; if ( (n.currentDraggedMC && n.currentDraggedMC != this && n.currentDraggedMC.stopDrag(), (n.currentDraggedMC = this), (t = em(this.context, t)), (this._dragBounds = null), e > i && ((i = (a = [e, i])[0]), (e = a[1])), r > o && ((r = (s = [o, r])[0]), (o = s[1])), arguments.length > 1 && ((e = nm(this.context, e)), (r = nm(this.context, r)), (i = nm(this.context, i)), (o = nm(this.context, o)), (this._dragBounds = new K(e, r, i - e, o - r))), !this.isDragging) ) { this.isDragging = !0; var l = u.pool.getNode(this.adaptee.parent), c = u.getLocalMouseX(l), h = u.getLocalMouseY(l); (this.startDragPoint = this.startDragPoint || new P()), this.startDragPoint.setTo(c, h), t && ((this.adaptee.x = this.startDragPoint.x), (this.adaptee.y = this.startDragPoint.y)), this._dragBounds && this.checkBounds(), (this.startDragMCPosition.x = this.adaptee.x), (this.startDragMCPosition.y = this.adaptee.y); var p = this.node; u.view.stage.addEventListener( vu.MOUSE_MOVE, this.dragListenerDelegate ); var d = this.adaptee .getAbstraction(p.partition) .getAbstraction(u.mousePicker.pickGroup).pickingCollision; (d.rootNode = p), u.mouseManager.startDragObject(d); } }), (n.prototype.dragListener = function (t) { if (this.adaptee.parent) { var e = this._stage.pool.getNode(this.adaptee.parent), n = this._stage.getLocalMouseX(e), r = this._stage.getLocalMouseY(e); (this.adaptee.x = this.startDragMCPosition.x + (n - this.startDragPoint.x)), (this.adaptee.y = this.startDragMCPosition.y + (r - this.startDragPoint.y)), this._dragBounds && this.checkBounds(); } }), (n.prototype.checkBounds = function () { this.adaptee.x < this._dragBounds.left && (this.adaptee.x = this._dragBounds.left), this.adaptee.x > this._dragBounds.right && (this.adaptee.x = this._dragBounds.right), this.adaptee.y < this._dragBounds.top && (this.adaptee.y = this._dragBounds.top), this.adaptee.y > this._dragBounds.bottom && (this.adaptee.y = this._dragBounds.bottom); }), (n.prototype.stop = function () { return this.adaptee.stop(); }), (n.prototype.stopDrag = function (t) { n.currentDraggedMC && n.currentDraggedMC != this && n.currentDraggedMC.stopDrag(), (this.isDragging = !1), (n.currentDraggedMC = null), (this._stage.mousePicker.dragNode = null), this._stage.mouseManager.stopDragObject(), this._stage.view.stage.removeEventListener( vu.MOUSE_MOVE, this.dragListenerDelegate ); }), (n.prototype.swapChildrenToDepth = function (t, e, n, r) { e && this._depthToChilds[n] && (e = this.getDepthToChild(n).adapter), delete this.adaptee._sessionID_childs[t.adaptee._sessionID], (t.adaptee._avmDepthID = n), (t.adaptee._sessionID = -1), this.adaptee.addChildAt(t.adaptee, this.getIndexFromDepthOrTop(n)), (t.hasSwappedDepth = !0), this.setDepthToChild(n, t.adaptee), e ? (delete this.adaptee._sessionID_childs[e.adaptee._sessionID], this.setDepthToChild(r, e.adaptee), (e.adaptee._avmDepthID = r), (e.adaptee._sessionID = -1), this.adaptee.addChildAt( e.adaptee, this.getIndexFromDepthOrTop(r) ), (e.hasSwappedDepth = !0)) : this.setDepthToChild(r), t && t.updateAllEvents(), e && e.updateAllEvents(), this.adaptee.name && parent && (this.getLatestObjectForName(t.adaptee.name), e && this.getLatestObjectForName(e.adaptee.name)); }), (n.prototype.swapDepths = function (t) { if (!this.adaptee.isAVMScene && this.get_parent()) { var e = this.get_parent(), n = null; if (e) if (void 0 !== t) { if ("number" == typeof t) { if (((t = Bm(t)), this.adaptee._avmDepthID == t)) return; (n = e.getDepthToChild(t)) && (n = n.adapter); } else if (t.adaptee) { if (t.get_parent() != e) return; t = (n = t).adaptee._avmDepthID; } e.swapChildrenToDepth(this, n, t, this.adaptee._avmDepthID); } else console.warn( "[AVM1MovieClip] swapDepth called with undefined as target depth" ); else console.warn( "[AVM1MovieClip] swapDepth called for object with no parent" ); } }), (n.prototype.getTabChildren = function () { return Cm(this).tabChildren; }), (n.prototype.setTabChildren = function (t) { Cm(this).tabChildren = em(this.context, t); }), (n.prototype.get_totalframes = function () { return this.adaptee.numFrames; }), (n.prototype.getTrackAsMenu = function () { return ( console.warn("[AVM1MovieClip] getTrackAsMenu not implemented"), Cm(this).trackAsMenu ); }), (n.prototype.setTrackAsMenu = function (t) { console.warn("[AVM1MovieClip] setTrackAsMenu not implemented"), (Cm(this).trackAsMenu = em(this.context, t)); }), (n.prototype.unloadMovie = function () { var t = this.adaptee; (this.adaptee.constructedKeyFrameIndex = 0), this.adaptee.stop(), t.removeChildren(0, t.numChildren), (this.dynamicallyCreated || this.hasSwappedDepth) && t.parent && t.parent.adapter && t.parent.adapter.unregisterScriptObject(t); }), (n.prototype.getUseHandCursor = function () { return this.adaptee.useHandCursor; }), (n.prototype.setUseHandCursor = function (t) { this.adaptee && (this.adaptee.useHandCursor = t); }), (n.prototype.setParameters = function (t) { for (var e in t) this.alHasProperty(e) || this.alPut(e, t[e]); }), (n.prototype._resolveLevelNProperty = function (t) { if ("_level0" === t || "_level" === t) return this.context.resolveRoot(); if ("_root" === t) return this.context.resolveRoot(); if (0 === t.indexOf("_level")) { var e = t.substring(6), n = 0 | e; if (n > 0 && e == n) return this.context.resolveLevel(n); } return null; }), (n.prototype._getCachedPropertyResult = function (t) { return ( this._cachedPropertyResult ? (this._cachedPropertyResult.value = t) : (this._cachedPropertyResult = { flags: 65, value: t }), this._cachedPropertyResult ); }), (n.prototype.alGetOwnProperty = function (e) { var n = t.prototype.alGetOwnProperty.call(this, e); if (n) return n; if ("_" === e[0]) if ( ("l" === e[1] && 0 === e.indexOf("_level")) || ("r" === e[1] && 0 === e.indexOf("_root")) ) { var r = this._resolveLevelNProperty(e); if (r) return this._getCachedPropertyResult(r); } else if (e.toLowerCase() in zf) return t.prototype.alGetOwnProperty.call(this, e.toLowerCase()); if (bm(this)) { var i = this._lookupChildByName(e); if (i) return this._getCachedPropertyResult(i); } }), (n.prototype.alGetOwnPropertiesKeys = function () { var e = t.prototype.alGetOwnPropertiesKeys.call(this); if (!bm(this)) return e; var n = this.adaptee; if (0 === n.numChildren) return e; var r = Object.create(null), i = e.length, o = 0; for (o = 0; o < i; o++) r[e[o]] = !0; var a = n.numChildren; for (o = 0; o < a; o++) r[n.getChildAt(o).name] = !0; return Object.getOwnPropertyNames(r); }), (n.prototype._init = function (t) { var e = this; t instanceof vf && pm( t, function (n) { e.alPut(n, t.alGet(n)); }, null ); }), (n.prototype._initEventsHandlers = function () { this.bindEvents(Sg); }), (n.currentMCAssetNameSpace = ""), (n.currentDraggedMC = null), (n.pokiSDKonStopActionChildName = null), (n.pokiSDKonStopAction = null), (n.capStyleMapStringToInt = { none: 0, round: 1, square: 2 }), (n.jointStyleMapStringToInt = { round: 0, bevel: 1, miter: 2 }), (n.noScaleDictionary = { normal: Eo.NORMAL, none: Eo.NONE, vertical: Eo.VERTICAL, horizontal: Eo.HORIZONTAL, }), n ); })(mg); function Mg(t) { bm(t) && t.updateAllEvents(); } var Lg, Ng, Rg = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm(t, !0, n, ["initialize"], []); }), (n.initialize = function (t, e) { var n = new Af(65, new U_(t, [])); e.alSetOwnProperty("_listeners", n), (n = new Af( 65, new J_(t, function (e) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; var i = this.alGet("_listeners"); i instanceof U_ && Em(t, this, e, n); }) )), e.alSetOwnProperty("broadcastMessage", n), (n = new Af( 65, new J_(t, function (t) { var e = this.alGet("_listeners"); return e instanceof U_ && (e.value.push(t), Mg(this), !0); }) )), e.alSetOwnProperty("addListener", n), (n = new Af( 65, new J_(t, function (t) { var e = this.alGet("_listeners"); if (!(e instanceof U_)) return !1; var n = e.value, r = n.indexOf(t); return !(r < 0) && (n.splice(r, 1), Mg(this), !0); }) )), e.alSetOwnProperty("removeListener", n); }), n ); })(vf), Fg = [ "avHardwareDisable", "hasAccessibility", "hasAudio", "hasAudioEncoder", "hasEmbeddedVideo", "hasIME", "hasMP3", "hasPrinting", "hasScreenBroadcast", "hasScreenPlayback", "hasStreamingAudio", "hasStreamingVideo", "hasVideoEncoder", "isDebugger", "language", "localFileReadDisable", "manufacturer", "os", "pixelAspectRatio", "playerType", "screenColor", "screenDPI", "screenResolutionX", "screenResolutionY", "serverString", "version", ], kg = (function (t) { function n(e) { var n = t.call(this, e) || this; n.alPrototype = e.builtins.Object.alGetPrototypeProperty(); var r = null; return ( Fg.forEach(function (t) { (r = new Af(131, null, { alCall: function () { return null; }, })), n.alSetOwnProperty(t, r); }, n), n ); } return e(n, t), n; })(vf), Ug = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { sandboxType: { get: n.getSandboxType }, allowDomain: { value: n.allowDomain }, allowInsecureDomain: { value: n.allowInsecureDomain }, loadPolicyFile: { value: n.loadPolicyFile }, }), n ); } return ( e(n, t), (n.prototype.getSandboxType = function () { return null; }), (n.prototype.allowDomain = function (t) { t = lm(this.context, t); }), (n.prototype.allowInsecureDomain = function (t) { t = lm(this.context, t); }), (n.prototype.loadPolicyFile = function (t) { t = lm(this.context, t); }), n ); })(vf), jg = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.alInitStatic = function (t) { (this._capabilities = new kg(t)), (this._security = new Ug(t)); }), (n.createAVM1Class = function (t) { return Tm(t, !1, n, ["capabilities#", "security#"], []); }), (n.getCapabilities = function (t) { return t.getStaticState(n)._capabilities; }), (n.getSecurity = function (t) { return t.getStaticState(n)._security; }), n ); })(vf), Vg = [ -1, 37, 39, 36, 35, 45, 46, -1, 8, -1, -1, -1, -1, 13, 38, 40, 33, 34, 9, 27, ], Qg = { 1: bg[8192], 2: bg[16384], 4: bg[1024], 8: bg[2048], 64: bg[4096], 160: bg[32768], 272: bg[65536], }, Gg = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], [ "$version#", "_alpha#", "getAwayJSID", "attachAudio", "attachBitmap", "attachMovie", "beginFill", "beginBitmapFill", "beginGradientFill", "blendMode#", "cacheAsBitmap#", "_callFrame", "clear", "createEmptyMovieClip", "createTextField", "_currentframe#", "curveTo", "_droptarget#", "duplicateMovieClip", "enabled#", "endFill", "filters#", "_framesloaded#", "_focusrect#", "forceSmoothing#", "getBounds", "getBytesLoaded", "getBytesTotal", "getDepth", "getInstanceAtDepth", "getNextHighestDepth", "getRect", "getSWFVersion", "getTextSnapshot", "getURL", "globalToLocal", "gotoAndPlay", "gotoAndStop", "_height#", "_highquality#", "hitArea#", "hitTest", "lineGradientStyle", "lineStyle", "lineTo", "loadMovie", "loadVariables", "localToGlobal", "_lockroot#", "menu#", "moveTo", "_name#", "nextFrame", "opaqueBackground#", "_parent#", "play", "prevFrame", "_quality#", "removeMovieClip", "_root#", "_rotation#", "scale9Grid#", "scrollRect#", "setMask", "_soundbuftime#", "startDrag", "stop", "stopDrag", "swapDepths", "tabChildren#", "tabEnabled#", "tabIndex#", "_target#", "_totalframes#", "trackAsMenu#", "toString", "unloadMovie", "_url#", "useHandCursor#", "_visible#", "_width#", "_x#", "_xmouse#", "_xscale#", "_y#", "_ymouse#", "_yscale#", ] ); }), (n.prototype._updateMouseEnabled = function (t, e) { this.adaptee.isAVMScene || (t.isMouse && (e ? (this._mouseListenerCount++, (this.adaptee.mouseEnabled = !0), (this.adaptee.mouseChildren = !1), t.isButton && (this._mouseButtonListenerCount++, (this.adaptee.buttonMode = !0))) : (this._mouseListenerCount--, this._mouseListenerCount <= 0 && ((this._mouseListenerCount = 0), (this.adaptee.mouseEnabled = !1), (this.adaptee.mouseChildren = !1)), t.isButton && (this._mouseButtonListenerCount--, this._mouseButtonListenerCount <= 0 && ((this._mouseButtonListenerCount = 0), (this.adaptee.buttonMode = !1)))))); }), (n.prototype.initAVM1SymbolInstance = function (e, n) { t.prototype.initAVM1SymbolInstance.call(this, e, n), (this._requiredListeners = Object.create(null)), (this._actions = this.adaptee.timeline.avm1ButtonActions); for ( var r = null, i = null, o = !1, a = this._actions.length, s = 0; s < a; s++ ) if ( ((r = this._actions[s]).actionsBlock || (r.actionsBlock = e.actionsDataFactory.createActionsData( r.actionsData, "s" + this.adaptee.id + "e" + s )), r.keyCode, 0 != r.stateTransitionFlags) ) { for (var u in ((i = this._mouseEventHandler.bind( this, r.stateTransitionFlags )), (o = !1), Qg)) r.stateTransitionFlags & parseInt(u) && ((o = !0), (this._requiredListeners[Qg[u].eventName] = { handler: Qg[u], boundListener: i, })); o || console.warn( "unknown button event flag", r.stateTransitionFlags ); } this.adaptee.addButtonListeners(), this._initEventsHandlers(), this._addListeners(); }), (n.prototype.initAdapter = function () { t.prototype.initAdapter.call(this), this._addListeners(); }), (n.prototype.stop = function () { return this.adaptee.stop(); }), (n.prototype.getEnabled = function () { return this.enabled; }), (n.prototype.setEnabled = function (t) { (this.adaptee.buttonEnabled = t), t != this.enabled && ((this.enabled = t), this.setEnabledListener(t), (this.adaptee.mouseEnabled = !0)); }), (n.prototype.getTrackAsMenu = function () { return !1; }), (n.prototype.setTrackAsMenu = function (t) {}), (n.prototype._addListeners = function () { for (var t in this._requiredListeners) (this._eventHandlers[t] = this._requiredListeners[t].handler), (this._eventsListeners[t] = this._requiredListeners[t].boundListener); this.setEnabledListener(this.enabled); }), (n.prototype._removeListeners = function () { for (var t in this._requiredListeners) this.adaptee.removeEventListener( t, this._requiredListeners[t].boundListener ); }), (n.prototype._keyDownHandler = function (t) { for (var e = this._actions, n = e.length, r = 0; r < n; r++) { var i = e[r]; i.keyCode && ((i.keyCode < 32 && Vg[i.keyCode] === t.axGetPublicProperty("keyCode")) || i.keyCode === t.axGetPublicProperty("charCode")) && this._runAction(i); } }), (n.prototype._mouseEventHandler = function (t) { for (var e = this._actions, n = e.length, r = 0; r < n; r++) { var i = e[r]; i.stateTransitionFlags === t && this._runAction(i); } }), (n.prototype._runAction = function (t) { var e = this._avm1Context; this.adaptee.parent && e.executeActions( t.actionsBlock, Sm(this.adaptee.parent, this.context) ); }), (n.prototype._initEventsHandlers = function () { this.bindEvents(Dg); }), n ); })(Bg), zg = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], ["getRGB", "getTransform", "setRGB", "setTransform"], null, n.prototype.avm1Constructor ); }), (n.prototype.avm1Constructor = function (t) { t && ((this._target = this.context.resolveTarget(t)), this._target && this._target.adaptee && !this._target.adaptee.isAVMScene && ((this._target.avmColor = this), (this._targetAwayObject = this._target.adaptee))); }), (n.prototype.changeTarget = function (t) { t && t instanceof mg ? ((this._target = t), (this._target.avmColor = this), (this._target._ctBlockedByScript = !0), (this._targetAwayObject = this._target.adaptee)) : (this._target = null); }), (n.prototype.getRGB = function () { var t = n.prototype.getTransform.call(this); return t ? t.getRgb() : null; }), (n.prototype.getTransform = function () { return this._targetAwayObject ? Lf.fromAwayColorTransform( this.context, this._targetAwayObject.transform.colorTransform ) : null; }), (n.prototype.setRGB = function (t) { var e = n.prototype.getTransform.call(this); e && (e.setRgb(t), n.prototype.setTransform.call(this, e)), this._target && (this._target._ctBlockedByScript = !0); }), (n.prototype.setTransform = function (t) { if (this._targetAwayObject && t) { var e = t; t instanceof Lf || (t instanceof vf && (e = (function (t) { var e = t.context; if (!(t instanceof vf)) return new Lf(e, 1, 1, 1, 1, 0, 0, 0, 0); var n = t.alGet("alphaOffset"); null == n && (n = t.alGet("ab")); var r = t.alGet("alphaMultiplier"); null == r && null != (r = t.alGet("aa")) && (r /= 100); var i = t.alGet("redOffset"); null == i && (i = t.alGet("rb")); var o = t.alGet("redMultiplier"); null == o && null != (o = t.alGet("ra")) && (o /= 100); var a = t.alGet("greenOffset"); null == a && (a = t.alGet("gb")); var s = t.alGet("greenMultiplier"); null == s && null != (s = t.alGet("ga")) && (s /= 100); var u = t.alGet("blueOffset"); null == u && (u = t.alGet("bb")); var l = t.alGet("blueMultiplier"); return ( null == l && null != (l = t.alGet("ba")) && (l /= 100), new Lf( e, cm(e, Bf(o, 1)), cm(e, Bf(s, 1)), cm(e, Bf(l, 1)), cm(e, Bf(r, 1)), cm(e, Bf(i, 0)), cm(e, Bf(a, 0)), cm(e, Bf(u, 0)), cm(e, Bf(n, 0)) ) ); })(t))), e && ((this._targetAwayObject.transform.colorTransform._rawData[0] = e._rawData[0]), (this._targetAwayObject.transform.colorTransform._rawData[1] = e._rawData[1]), (this._targetAwayObject.transform.colorTransform._rawData[2] = e._rawData[2]), (this._targetAwayObject.transform.colorTransform._rawData[3] = e._rawData[3]), (this._targetAwayObject.transform.colorTransform._rawData[4] = e._rawData[4]), (this._targetAwayObject.transform.colorTransform._rawData[5] = e._rawData[5]), (this._targetAwayObject.transform.colorTransform._rawData[6] = e._rawData[6]), (this._targetAwayObject.transform.colorTransform._rawData[7] = e._rawData[7]), this._targetAwayObject.transform.invalidateColorTransform(), this._targetAwayObject.invalidate(), this._targetAwayObject._invalidateHierarchicalProperty( Lt.COLOR_TRANSFORM )); } this._target && (this._target._ctBlockedByScript = !0); }), n ); })(vf), Hg = (((Lg = {})[0] = 1), (Lg[1] = 4), (Lg[2] = 2), Lg), Xg = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm(t, !1, n, ["show", "hide"], []); }), (n.bindStage = function (t, e, r, i) { (n.mouseButtonsState[1] = 0), (n.mouseButtonsState[4] = 0), (n.mouseButtonsState[2] = 0); var o = r.view.stage; n.mouseDownDelegate && o.removeEventListener(vu.MOUSE_DOWN, n.mouseDownDelegate), n.mouseMoveDelegate && o.removeEventListener(vu.MOUSE_MOVE, n.mouseMoveDelegate), n.mouseOutDelegate && o.removeEventListener(vu.MOUSE_OUT, n.mouseOutDelegate), n.mouseUpDelegate && o.removeEventListener(vu.MOUSE_UP, n.mouseUpDelegate), (n.mouseDownDelegate = function (t) { var r, i = null != (r = t.button) ? r : 0; (n.mouseButtonsState[Hg[i]] = 1), 1 !== i && fm(e, "broadcastMessage", ["onMouseDown"]); }), (n.mouseMoveDelegate = function (t) { fm(e, "broadcastMessage", ["onMouseMove"]); }), (n.mouseOutDelegate = function (t) { fm(e, "broadcastMessage", ["onMouseOut"]); }), (n.mouseUpDelegate = function (t) { var r, i = null != (r = t.button) ? r : 0; (n.mouseButtonsState[Hg[i]] = 0), 1 !== i && fm(e, "broadcastMessage", ["onMouseUp"]); }), o.addEventListener(vu.MOUSE_DOWN, n.mouseDownDelegate), o.addEventListener(vu.MOUSE_MOVE, n.mouseMoveDelegate), o.addEventListener(vu.MOUSE_OUT, n.mouseOutDelegate), o.addEventListener(vu.MOUSE_UP, n.mouseUpDelegate); }), (n.hide = function () { I_.instance.Stage.avmStage.mouseManager.showCursor = !1; }), (n.show = function () { I_.instance.Stage.avmStage.mouseManager.showCursor = !0; }), (n.mouseButtonsState = (((Ng = {})[1] = 0), (Ng[4] = 0), (Ng[2] = 0), Ng)), (n.mouseDownDelegate = null), (n.mouseMoveDelegate = null), (n.mouseOutDelegate = null), (n.mouseUpDelegate = null), n ); })(vf), Yg = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], ["loadClip", "unloadClip", "getProgress"], null, n.prototype.avm1Constructor ); }), (n.prototype.avm1Constructor = function () { Rg.initialize(this.context, this); }), (n.prototype.loadClip = function (t, e) { var n = this; if ("number" == typeof e) { if (0 === e) return !1; } else if (!this.context.resolveTarget(e)) return !1; var r = new Pg(this.context); if (((this._loaderHelper = r), (this._target = null), !t)) return !1; var i = e; return ( 0 !== t.indexOf("http://") && 0 !== t.indexOf("https://") && (t = this.context.globals.SWF_BASE_URL + t), r.loadMovieAt(t, "get", i).then(function (t) { t ? (fm(n, "broadcastMessage", ["onLoadComplete", e]), setTimeout(function () { fm(n, "broadcastMessage", ["onLoadInit", e]); })) : console.warn("load - content is null"); }), !0 ); }), (n.prototype.unloadClip = function (t) { return !0; }), (n.prototype.getProgress = function (t) { return 0; }), n ); })(vf); function qg(t, e, n, r, i, o) { var a = new dt(e), s = a.url || "", u = s.replace(/\?.*$/, ""), l = Zd(s, null); if (l) { if (l.supressLoad) return void console.log("[LOADER] Load supressed ", l.url); console.log("[LOADER] Override loading url:", l.url), (a.url = l.url); } else console.log("[LOADER] start loading the url:", u); n && (a.method = n), i && (a.data = "application/x-www-form-urlencoded" === r ? new at(i) : i); var c = new st(); c.dataFormat = "text"; var h = function (e) { c.removeEventListener(H.LOAD_COMPLETE, h), Em(t, o, "onData", [c.data]); }; c.addEventListener(H.LOAD_COMPLETE, h), (o._as3Loader = c), l && l.supressErrors && c.addEventListener(H.LOAD_ERROR, function (t) { console.log( "[LOADER] Error supressed by redirect rule as empty complete events!", t ), c.dispatchEvent(new H(H.LOAD_COMPLETE, c)); }), c.load(a); } var Kg, Wg = (function (t) { function n(e) { var n = t.call(this, e) || this; return n.alSetOwnPrototypeProperty(new Jg(e, n)), n; } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = new vf(this.context); return ( (e.alPrototype = this.alGetPrototypeProperty()), (e.isAVM1DataObject = !0), e ); }), (n.prototype.alCall = function (t, e) { return this.alConstruct(e); }), n ); })(bf), Jg = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( Am(r, { constructor: { value: n, writable: !0 }, toString: { value: r._toString }, load: { value: r.load }, onData: { value: r.defaultOnData }, decode: { value: r.decode }, send: { value: r.load }, sendAndLoad: { value: r.sendAndLoad }, }), r ); } return ( e(n, t), (n.prototype.getBytesLoaded = function () { if (this._as3Loader) return this._as3Loader.bytesLoaded; }), (n.prototype.getBytesTotal = function () { if (this._as3Loader) return this._as3Loader.bytesTotal; }), (n.prototype.load = function (t) { return ( !!(t = lm(this.context, t)) && (qg(this.context, t, null, null, null, this), !0) ); }), (n.prototype.defaultOnData = function (t) { Wh(t) ? Em(this.context, this, "onLoad", [!1]) : (n.prototype.decode.call(this, t), this.alPut("loaded", !0), Em(this.context, this, "onLoad", [!0])); }), (n.prototype.decode = function (t) { t = lm(this.context, t); var e = new at(t); for (var n in e.variables) this.alPut(n, e.variables[n]); }), (n.prototype._toString = function () { var t = {}; for (var e in this._ownProperties) t[e] = this.alGet(e); return new URLSearchParams(t).toString(); }), (n.prototype.send = function (t, e, n) { return ( (t = lm(this.context, t)), (n = Wh(n) ? "POST" : lm(this.context, n)), !1 ); }), (n.prototype.sendAndLoad = function (t, e, n) { if ( ((t = lm(this.context, t)), (n = Wh(n) ? "POST" : lm(this.context, n)), !(t && e instanceof vf)) ) return !1; if (!e.isAVM1DataObject) return !1; var r = this.alGet("contentType"); r = Wh(r) ? "application/x-www-form-urlencoded" : lm(this.context, r); var i = om(this.context, this); return qg(this.context, t, n, r, i, e), !0; }), n ); })(vf), $g = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], [ "attachSound", "duration#", "getBytesLoaded", "getBytesTotal", "loadSound", "getPan", "setPan", "getTransform", "setTransform", "getVolume", "setVolume", "start", "stop", "onSoundComplete", ], null, n.prototype.avm1Constructor ); }), (n.prototype.avm1Constructor = function (t) { (this._target = this.context.resolveTarget(t)), (this._sound = null), (this._channel = null), (this._linkageID = null), (this._playAfterLoading = !1), (this._assetNameSpace = Bg.currentMCAssetNameSpace); }), (n.prototype.alPut = function (e, n) { t.prototype.alPut.call(this, e, n), e && "onsoundcomplete" == e.toLowerCase() && this.onSoundComplete(n); }), (n.prototype.alDeleteProperty = function (e) { return ( t.prototype.alDeleteProperty.call(this, e), e && "onsoundcomplete" == e.toLowerCase() && this.onSoundComplete(), !0 ); }), (n.prototype.attachSound = function (t) { if ("string" == typeof t || "number" == typeof t) { var e = pt.getAsset(t, this._assetNameSpace); e && ((this._linkageID = t), (this._sound = e.clone()), this._sound && (this.soundCompleteInternal = this.soundCompleteInternal.bind(this))); } }), (n.prototype.soundCompleteInternal = function () { this._onCompleteCallback && this._onCompleteCallback(); }), (n.prototype.onSoundComplete = function (t) { void 0 === t && (t = null); var e = this; (this._onCompleteCallback = null), t && (this._onCompleteCallback = function () { t.alCall(e); }), this._sound; }), (n.prototype.loadSound = function (t, e) { var n = this; e ? ((this._playAfterLoading = !0), console.warn( "[AVM1Sound] - loadSound called with isStreaming=true, but streaming not implemented yet", t, e )) : (this._playAfterLoading = !1); var r = new ct(); r.addEventListener(c.ASSET_COMPLETE, function (t) { return n.onAssetComplete(t); }), r.addEventListener(V.LOADER_COMPLETE, function (t) { return n.onLoadComplete(t); }), r.addEventListener(H.LOAD_ERROR, function (t) { return n.onLoadError(t); }), r.load(new dt(t), null, t, new yt()); }), (n.prototype.onAssetComplete = function (t) { var e = t.asset; e.isAsset(E) && ((this._sound = e), this._playAfterLoading && this._sound.play(0)); }), (n.prototype.onLoadComplete = function (t) { this._sound || console.warn( "[AVM1Sound] - loadSound: Soundloading is complete, but no WaveAudio was created." ); }), (n.prototype.onLoadError = function (t) { console.warn("[AVM1Sound] - loadSound: onLoadError"); }), (n.prototype.getBytesLoaded = function () { return console.warn("AVM1Sound.getBytesLoaded"), 0; }), (n.prototype.getBytesTotal = function () { return console.warn("AVM1Sound.getBytesTotal"), 1; }), (n.prototype.getDuration = function () { return console.warn("AVM1Sound.getDuration"), 0; }), (n.prototype.getPan = function () { return 0; }), (n.prototype.setPan = function (t) {}), (n.prototype.getTransform = function () { return console.warn("AVM1Sound.getTransform"), null; }), (n.prototype.setTransform = function (t) { console.warn("AVM1Sound.setTransform"); }), (n.prototype.getVolume = function () { return this._sound ? 100 * this._sound.volume : (console.warn("AVM1Sound.getVolume called, but no WaveAudio set"), 100); }), (n.prototype.setVolume = function (t) { this._sound ? (this._target && this._target.adaptee && (this._target.adaptee.soundVolume = t / 100), (this._sound.volume = t / 100)) : console.warn("AVM1Sound.setVolume called, but no WaveAudio set"); }), (n.prototype.start = function (t, e) { this._sound && ((e = isNaN(e) || e < 1 ? 1 : Math.floor(e)), this._target && this._target.adaptee && this._target.adaptee.startSound( this._linkageID, this._sound, e, this.soundCompleteInternal )); }), (n.prototype.stop = function (t) { this._sound && this._target && this._target.adaptee && this._target.adaptee.stopSounds(this._linkageID); }), n ); })(vf), Zg = (function () { function t() { (this._values = {}), (this._realStorage = null); } return ( (t.prototype.getItem = function (t) { return ( this._realStorage && (this._values[t] = this._realStorage.getItem(t)), this._values[t] ); }), (t.prototype.setItem = function (t, e) { this._realStorage && this._realStorage.setItem(t, e), (this._values[t] = e); }), (t.prototype.removeItem = function (t) { this._realStorage && this._realStorage.removeItem(t), delete this._values[t]; }), t ); })(); function t_() { if (!Kg && ((Kg = new Zg()), "undefined" != typeof Storage)) try { Kg._realStorage = window.localStorage; } catch (t) { console.warn("[Shared Storage] ", t); } return Kg; } var e_, n_ = (function () { function t() {} return ( (t.decodedData = function () { var t = t_()._values, e = {}; for (var n in t) e[n] = JSON.parse(t[n]); return (this._lastRawData = e), e; }), (t.encodeAndApplyData = function () { if (!this._lastRawData) throw "Need call decode before encode for detecting a model"; var t = t_(); for (var e in this._lastRawData) t.setItem(e, JSON.stringify(this._lastRawData[e])); return t._values; }), (t._lastRawData = null), t ); })(), r_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n._flushPending = 0), Am(n, { data: { get: n.getData, enumerable: !0 }, clear: { value: n.clear, writable: !0 }, flush: { value: n.flush, writable: !0 }, }), (n._bindedFlush = n.flush.bind(n)), n ); } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm(t, !0, n, ["getLocal"], ["data#", "flush", "clear"]); }), (n.prototype.setName = function (t) { (t = lm(this.context, t)), (this._storage_name = t); var e = t_().getItem(t); if (e) try { return void (this._data = this.getAVM1Value(JSON.parse(e))); } catch (t) { console.warn("[AVM1 SharedObject]", "Invalid data:", e); } return ( (this._data = sm(this.context)), console.warn("[AVM1 SharedObject]", "No shared object found"), null ); }), (n.getLocal = function (t, e, r, i) { (r || i) && console.warn( "SharedObject.getLocal: params 'localPath' and 'secure' not supported" ); var o = new n(t); return o.setName(e), o; }), (n.prototype.applyDataHook = function (t) { var e = this; return ( t.__alPutHookApplyed || ((t.__alPutHookApplyed = !0), (t.alPut = function (n, r) { vf.prototype.alPut.call(t, n, r), e.requestFlush(); })), t ); }), (n.prototype.requestFlush = function () { clearTimeout(this._flushPending), (this._flushPending = setTimeout(this._bindedFlush, 100)); }), (n.prototype.getData = function () { return this.applyDataHook(this._data); }), (n.prototype.clear = function () { t_().removeItem(this._storage_name); }), (n.prototype.getAVM1Value = function (t) { if ( "number" == typeof t || "string" == typeof t || "boolean" == typeof t ) return t; if (Array.isArray(t)) { for (var e = 0; e < t.length; e++) t[e] = this.getAVM1Value(t[e]); return new U_(this.context, t); } if ("object" == typeof t) { var n = sm(this.context); for (var r in t) n.alSetOwnProperty(r, new Af(64, this.getAVM1Value(t[r]))); return n; } }), (n.prototype.getJSValue = function (t) { if ( "number" == typeof t || "string" == typeof t || "boolean" == typeof t ) return t; if (_m(this.context, t)) { console.log("array"); var e = t.value, n = []; if (e) for (var r = e.length, i = 0; i < r; i++) n[i] = this.getJSValue(e[i]); return n; } if (t instanceof vf) { var o = {}; for (var a in t._ownProperties) "__proto__" != a && "__constructor__" != a && (o[a] = this.getJSValue(t._ownProperties[a].value)); return o; } console.log("unknown datatype"); }), (n.prototype.flush = function (t) { this._flushPending && (clearTimeout(this._flushPending), (this._flushPending = null)); var e = this.getJSValue(this._data); return t_().setItem(this._storage_name, JSON.stringify(e)), !1; }), n ); })(vf), i_ = (function () { function t(t, e) {} return ( (t.prototype.axCallPublicProperty = function (t, e) { return null; }), (t.prototype.axGetPublicProperty = function (t) { return null; }), (t.prototype.axSetPublicProperty = function (t, e) { return null; }), (t.prototype.removeChild = function (t) {}), Object.defineProperty(t.prototype, "attributes", { get: function () { return ( console.log("attributes not implemented yet in flash/XMLNode"), null ); }, set: function (t) { console.log("attributes not implemented yet in flash/XMLNode"); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "childNodes", { get: function () { return ( console.log("childNodes not implemented yet in flash/XMLNode"), [] ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "localName", { get: function () { return ( console.log("localName not implemented yet in flash/XMLNode"), "" ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "namespaceURI", { get: function () { return ( console.log("namespaceURI not implemented yet in flash/XMLNode"), "" ); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "prefix", { get: function () { return ( console.log("prefix not implemented yet in flash/XMLNode"), "" ); }, enumerable: !0, configurable: !0, }), (t.prototype.appendChild = function (t) { console.log("appendChild not implemented yet in flash/XMLNode"); }), (t.prototype.cloneNode = function (t) { return ( console.log("cloneNode not implemented yet in flash/XMLNode"), null ); }), (t.prototype.getNamespaceForPrefix = function (t) { return ( console.log( "getNamespaceForPrefix not implemented yet in flash/XMLNode" ), "" ); }), (t.prototype.getPrefixForNamespace = function (t) { return ( console.log( "getPrefixForNamespace not implemented yet in flash/XMLNode" ), "" ); }), (t.prototype.hasChildNodes = function () { return ( console.log("hasChildNodes not implemented yet in flash/XMLNode"), !1 ); }), (t.prototype.insertBefore = function (t, e) { console.log("insertBefore not implemented yet in flash/XMLNode"); }), (t.prototype.removeNode = function () { console.log("removeNode not implemented yet in flash/XMLNode"); }), (t.prototype.toString = function () { return ( console.log("toString not implemented yet in flash/XMLNode"), "" ); }), t ); })(); function o_(t) { if (!(t instanceof vf)) return null; var e = t.context; return gm(e, t, e.globals.XMLNode) ? t.as3XMLNode : null; } function a_(t, e) { if (!Wh(e)) { var n = e._as2Node; return ( n || (((n = new vf(t)).alPrototype = t.globals.XMLNode.alGetPrototypeProperty()), c_.prototype.initializeFromAS3Node.call(n, e)), n ); } } !(function (t) { (t[(t.ELEMENT_NODE = 1)] = "ELEMENT_NODE"), (t[(t.TEXT_NODE = 3)] = "TEXT_NODE"); })(e_ || (e_ = {})); var s_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return n.alSetOwnPrototypeProperty(new c_(e, n)), n; } return ( e(n, t), (n.prototype.alConstruct = function (t) { if (!t && t.length < 2) ip.notImplemented( "Unsupported amount of parameters for AVM1XMLNode constructor" ); else { var e = cm(this.context, t[0]), n = lm(this.context, t[1]); if (e === e_.ELEMENT_NODE || e === e_.TEXT_NODE) { var r = new vf(this.context); return ( (r.alPrototype = this.alGetPrototypeProperty()), c_.prototype.initializeNode.call(r, e, n), r ); } ip.notImplemented("Unsupported AVM1XMLNode type: " + e); } }), (n.prototype.alCall = function (t, e) { return this.alConstruct(e); }), n ); })(bf), u_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r._as3XMLNode = n), (r._cachedNodePropertyDescriptor = new Af(70, void 0)), Am(r, { length: { get: r.getLength } }), r ); } return ( e(n, t), Object.defineProperty(n.prototype, "as3ChildNodes", { get: function () { return this._as3XMLNode.childNodes; }, enumerable: !0, configurable: !0, }), (n.prototype.getLength = function () { return this.as3ChildNodes.length; }), (n.prototype.alGetOwnProperty = function (e) { if (hm(this.context, e)) { var n = rm(this.context, e); if (n >= 0 && n < this.as3ChildNodes.length) return ( (this._cachedNodePropertyDescriptor.value = a_( this.context, this.as3ChildNodes[n] )), this._cachedNodePropertyDescriptor ); } return t.prototype.alGetOwnProperty.call(this, e); }), n ); })(vf), l_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), (r._nativeAttr = n), (r._cachedNodePropertyDescriptor = new Af(64, void 0)), r ); } return ( e(n, t), (n.prototype.alGetOwnProperty = function (t) { var e = lm(this.context, t), n = this._nativeAttr.getNamedItem(e); if (n) return ( (this._cachedNodePropertyDescriptor.value = n.nodeValue), this._cachedNodePropertyDescriptor ); }), (n.prototype.alSetOwnProperty = function (t, e) { var n = lm(this.context, t); if (64 & e.flags) { var r = lm(this.context, e.value); this._nativeAttr[n] = r; } }), (n.prototype.alHasOwnProperty = function (t) { var e = lm(this.context, t); return !!this._nativeAttr.getNamedItem(e); }), (n.prototype.alDeleteOwnProperty = function (t) { var e = lm(this.context, t); this._nativeAttr.removeNamedItem(e); }), (n.prototype.alGetOwnPropertiesKeys = function () { for (var t = [], e = 0; e < this._nativeAttr.length; e++) t[e] = lm(this.context, this._nativeAttr.item(e).name); return t; }), n ); })(vf), c_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( Am(r, { constructor: { value: n, writable: !0 }, attributes: { get: r.getAttributes, set: r.setAttributes }, childNodes: { get: r.getChildNodes }, firstChild: { get: r.getFirstChild }, lastChild: { get: r.getLastChild }, localName: { get: r.getLocalName }, namespaceURI: { get: r.getNamespaceURI }, nextSibling: { get: r.getNextSibling }, nodeName: { get: r.getNodeName, set: r.setNodeName }, nodeType: { get: r.getNodeType }, nodeValue: { get: r.getNodeValue, set: r.setNodeValue }, parentNode: { get: r.getParentNode }, prefix: { get: r.getPrefix }, previousSibling: { get: r.getPreviousSibling }, appendChild: { value: r.appendChild }, cloneNode: { value: r.cloneNode }, getNamespaceForPrefix: { value: r.getNamespaceForPrefix }, getPrefixForNamespace: { value: r.getPrefixForNamespace }, hasChildNodes: { value: r.hasChildNodes }, insertBefore: { value: r.insertBefore }, removeNode: { value: r.removeNode }, toString: { value: r._toString }, }), r ); } return ( e(n, t), (n.prototype.initializeNode = function (t, e) { (this.as3XMLNode = new i_(t, e)), (this._attributes = void 0), (this._childNodes = void 0), n.addMap(this.as3XMLNode, this); }), (n.prototype.initializeFromAS3Node = function (t) { (this.as3XMLNode = t), (this._attributes = void 0), (this._childNodes = void 0), n.addMap(this.as3XMLNode, this); }), (n.prototype._toString = function () { return new XMLSerializer() .serializeToString(this.as3XMLNode) .replace(/\/>/g, " />"); }), (n.prototype.appendChild = function (t) { this.as3XMLNode.appendChild(o_(t)); }), (n.prototype.getAttributes = function () { var t = this.as3XMLNode.attributes; if (!Wh(t)) return ( this._attributes || (this._attributes = new l_(this.context, t)), this._attributes ); }), (n.prototype.setAttributes = function (t) { var e = this; if (Wh(t)) this._attributes = void 0; else if (t instanceof l_) this._attributes = t; else { var n = this.context, r = this.as3XMLNode.attributes; pm( t, function (t) { var i = lm(n, t), o = lm(n, e.alGet(t)), a = document.createAttribute(i); (a.value = o), r.setNamedItem(a); }, this ), console.warn("[XMLNode] Invalid attribute implementation"), (this._attributes = new l_(n, this.as3XMLNode.attributes)); } }), (n.prototype.getChildNodes = function () { return ( this._childNodes || (this._childNodes = new u_(this.context, this.as3XMLNode)), this._childNodes ); }), (n.prototype.cloneNode = function (t) { t = em(this.context, t); var e = this.as3XMLNode.axCallPublicProperty("cloneNode", [t]); return a_(this.context, e); }), (n.prototype.getFirstChild = function () { return a_(this.context, this.as3XMLNode.firstChild); }), (n.prototype.getNamespaceForPrefix = function (t) { return this.as3XMLNode.axCallPublicProperty("getNamespaceForPrefix", [ t, ]); }), (n.prototype.getPrefixForNamespace = function (t) { return this.as3XMLNode.axCallPublicProperty("getNamespaceForPrefix", [ t, ]); }), (n.prototype.hasChildNodes = function () { return this.as3XMLNode.hasChildNodes(); }), (n.prototype.insertBefore = function (t, e) { this.as3XMLNode.axCallPublicProperty("insertBefore", [o_(t), o_(e)]); }), (n.prototype.getLastChild = function () { return a_(this.context, this.as3XMLNode.lastChild); }), (n.prototype.getLocalName = function () { return this.as3XMLNode.localName; }), (n.prototype.getNamespaceURI = function () { return this.as3XMLNode.namespaceURI; }), (n.prototype.getNextSibling = function () { return a_(this.context, this.as3XMLNode.nextSibling); }), (n.prototype.getNodeName = function () { return this.as3XMLNode.nodeName; }), (n.prototype.setNodeName = function (t) { (t = lm(this.context, t)), (this.as3XMLNode.nodeName = t); }), (n.prototype.getNodeType = function () { return this.as3XMLNode.nodeType; }), (n.prototype.getNodeValue = function () { return this.as3XMLNode.nodeValue; }), (n.prototype.setNodeValue = function (t) { (t = lm(this.context, t)), (this.as3XMLNode.nodeValue = t); }), (n.prototype.getParentNode = function () { return a_(this.context, this.as3XMLNode.parentNode); }), (n.prototype.getPrefix = function () { return this.as3XMLNode.prefix; }), (n.prototype.getPreviousSibling = function () { return a_(this.context, this.as3XMLNode.previousSibling); }), (n.prototype.removeNode = function () { this.as3XMLNode.removeNode(); }), (n.addMap = function (t, e) { t._as2Node = e; }), n ); })(vf), h_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return r.alSetOwnPrototypeProperty(new p_(e, r, n)), r; } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = t && lm(this.context, t[0]), n = new vf(this.context); return ( (n.alPrototype = this.alGetPrototypeProperty()), (n.isAVM1DataObject = !0), e || (e = ""), p_.prototype.initializeDocument.call(n, e), n ); }), (n.prototype.alCall = function (t, e) { return this.alConstruct(e); }), n ); })(bf), p_ = (function (t) { function n(e, n, r) { var i = t.call(this, e) || this; return ( (i.alPrototype = r.alGetPrototypeProperty()), Am(i, { constructor: { value: n, writable: !0 }, addRequestHeader: { value: i.addRequestHeader }, createElement: { value: i.createElement }, createTextNode: { value: i.createTextNode }, getBytesLoaded: { value: i.getBytesLoaded }, getBytesTotal: { value: i.getBytesTotal }, ignoreWhite: { value: !1, writable: !0 }, load: { value: i.load }, parseXML: { value: i.parseXML }, send: { value: i.send }, sendAndLoad: { value: i.sendAndLoad }, onData: { value: i.defaultOnData, writable: !0 }, }), i ); } return ( e(n, t), (n.prototype.initializeDocument = function (t) { t = lm(this.context, t) || null; var e = new DOMParser().parseFromString(t, "application/xml"); c_.prototype.initializeFromAS3Node.call(this, e), (this.as3XMLDocument = e); }), (n.prototype.addRequestHeader = function (t, e) { ip.notImplemented("AVM1XMLPrototype.addRequestHeader"); }), (n.prototype.createElement = function (t) { t = lm(this.context, t); var e = this.as3XMLDocument.axCallPublicProperty("createElement", [ t, ]); return a_(this.context, e); }), (n.prototype.createTextNode = function (t) { t = lm(this.context, t); var e = this.as3XMLDocument.axCallPublicProperty("createTextNode", [ t, ]); return a_(this.context, e); }), (n.prototype.getBytesLoaded = function () { if (this._as3Loader) return this._as3Loader.bytesLoaded; }), (n.prototype.getBytesTotal = function () { if (this._as3Loader) return this._as3Loader.bytesTotal; }), (n.prototype.load = function (t) { return ( !!(t = lm(this.context, t)) && (qg(this.context, t, null, null, null, this), !0) ); }), (n.prototype.defaultOnData = function (t) { Wh(t) ? Em(this.context, this, "onLoad", [!1]) : (n.prototype.parseXML.call(this, t), this.alPut("loaded", !0), Em(this.context, this, "onLoad", [!0])); }), (n.prototype.parseXML = function (t) { t = lm(this.context, t); var e = new DOMParser().parseFromString( "" + t + "", "application/xml" ), n = e.getElementsByTagName("parsererror"); if (n.length > 0) { var r = 1 === e.childElementCount, i = n[0].textContent; if (r) throw "[AVM1XML] Сritical parsing error:" + i; console.warn("[AVM1XML] Parsing error:", i), console.groupCollapsed("[XML Source]:"), console.log(t), console.groupEnd(); } (this.as3XMLDocument = e.childNodes[0]), c_.prototype.initializeFromAS3Node.call(this, this.as3XMLDocument); }), (n.prototype.send = function (t, e, n) { return ( (t = lm(this.context, t)), (e = Wh(e) ? void 0 : lm(this.context, e)), (n = Wh(n) ? void 0 : lm(this.context, n)), ip.notImplemented("AVM1XMLPrototype.send"), !1 ); }), (n.prototype.sendAndLoad = function (t, e) { if ((t = lm(this.context, t)) && e.isAVM1DataObject) { ip.somewhatImplemented("AVM1XMLPrototype.send"); var n = this.alGet("contentType"); n = Wh(n) ? void 0 : lm(this.context, n); var r = om(this.context, this); qg(this.context, t, "POST", n, r, e); } }), n ); })(vf), d_ = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm(t, !0, n, ["available#", "addCallback", "call"], []); }), (n.getAvailable = function (t) { return !0; }), (n.addCallback = function (t, e, n, r) { if (((e = lm(t, e)), !dm(r))) return !1; try { return ( window.flashObject || (window.flashObject = {}), (window.flashObject[e] = function () { for (var t = [], r = 0; r < arguments.length; r++) t[r] = arguments[r]; var i = n.alGet(e.toLowerCase()); i && dm(i) ? i.alCall(n, t) : i && i.value && i.value.alCall(n, t); }), !0 ); } catch (t) { console.warn("[AVM1ExternalInterface] - error in addCallback", t); } return !1; }), (n.call = function (t, e) { for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r]; var i = [], o = n.length, a = 0; for (a = 0; a < o; a++) i.push(n[a]); 1 == i.length && (i = i[0]); try { var s = e.split("."), u = window; for (a = 0; a < s.length; a++) u = u[s[a]]; u(i); var l = ""; return l; } catch (t) { return; } }), n ); })(vf), f_ = eh(function (t, e) { function n(t, e) { var n = [], r = []; return ( null == e && (e = function (t, e) { return n[0] === e ? "[Circular ~]" : "[Circular ~." + r.slice(0, n.indexOf(e)).join(".") + "]"; }), function (i, o) { if (n.length > 0) { var a = n.indexOf(this); ~a ? n.splice(a + 1) : n.push(this), ~a ? r.splice(a, 1 / 0, i) : r.push(i), ~n.indexOf(o) && (o = e.call(this, i, o)); } else n.push(o); return null == t ? o : t.call(this, i, o); } ); } (t.exports = function (t, e, r, i) { return JSON.stringify(t, n(e, i), r); }).getSerialize = n; }), g_ = function () { var t = 4022871197; return function (e) { if (e) { e = e.toString(); for (var n = 0; n < e.length; n++) { var r = 0.02519603282416938 * (t += e.charCodeAt(n)); (r -= t = r >>> 0), (t = (r *= t) >>> 0), (t += 4294967296 * (r -= t)); } return 2.3283064365386963e-10 * (t >>> 0); } t = 4022871197; }; }, __ = function (t) { return (function () { var e, n, r = 48, i = 1, o = r, a = new Array(r), s = 0, u = new g_(); for (e = 0; e < r; e++) a[e] = u(Math.random()); var l = function () { ++o >= r && (o = 0); var t = 1768863 * a[o] + 2.3283064365386963e-10 * i; return (a[o] = t - (i = 0 | t)); }, c = function (t) { return Math.floor( t * (l() + 11102230246251565e-32 * ((2097152 * l()) | 0)) ); }; c.string = function (t) { var e, n = ""; for (e = 0; e < t; e++) n += String.fromCharCode(33 + c(94)); return n; }; var h = function () { var t = Array.prototype.slice.call(arguments); for (e = 0; e < t.length; e++) for (n = 0; n < r; n++) (a[n] -= u(t[e])), a[n] < 0 && (a[n] += 1); }; return ( (c.cleanString = function (t) { return (t = (t = (t = t.replace(/(^\s*)|(\s*$)/gi, "")).replace( /[\x00-\x1F]/gi, "" )).replace(/\n /, "\n")); }), (c.hashString = function (t) { for (t = c.cleanString(t), u(t), e = 0; e < t.length; e++) for (s = t.charCodeAt(e), n = 0; n < r; n++) (a[n] -= u(s)), a[n] < 0 && (a[n] += 1); }), (c.seed = function (t) { null == t && (t = Math.random()), "string" != typeof t && (t = f_(t, function (t, e) { return "function" == typeof e ? e.toString() : e; })), c.initState(), c.hashString(t); }), (c.addEntropy = function () { var t = []; for (e = 0; e < arguments.length; e++) t.push(arguments[e]); h(s++ + new Date().getTime() + t.join("") + Math.random()); }), (c.initState = function () { for (u(), e = 0; e < r; e++) a[e] = u(" "); (i = 1), (o = r); }), (c.done = function () { u = null; }), void 0 !== t && c.seed(t), (c.range = function (t) { return c(t); }), (c.random = function () { return c(Number.MAX_VALUE - 1) / Number.MAX_VALUE; }), (c.floatBetween = function (t, e) { return c.random() * (e - t) + t; }), (c.intBetween = function (t, e) { return Math.floor(c.random() * (e - t + 1)) + t; }), c ); })(); }; __.create = function (t) { return new __(t); }; var m_, y_ = __, A_ = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return ( (e.url = ""), (e.targetMC = null), (e._queued_focus_value = null), (e._queued_focus = !1), (e.callbackName = ""), (e.callbackTarget = null), e ); } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [], [ "addListener", "getFocus", "getBeginIndex", "getEndIndex", "removeListener", "setFocus", "setSelection", "getCaretIndex", ], null, n.prototype.avm1Constructor ); }), (n.prototype.avm1Constructor = function (t, e) { (this.url = t), (this.targetMC = e), (this._queued_focus = !1); }), (n.prototype.addListener = function (t) {}), (n.prototype.removeListener = function (t) { return !0; }), (n.prototype.getBeginIndex = function () { var t = ef.instance().mouseManager.getFocus(); return t && t.isAsset(bh) ? t.selectionBeginIndex : -1; }), (n.prototype.getEndIndex = function () { var t = ef.instance().mouseManager.getFocus(); return t && t.isAsset(bh) ? t.selectionEndIndex : -1; }), (n.prototype.getCaretIndex = function () { var t = ef.instance().mouseManager.getFocus(); return t && t.isAsset(bh) ? t.selectionBeginIndex : -1; }), (n.prototype.getFocus = function () { var t = ef.instance().mouseManager.getFocus(); if (t) { for (var e = []; t; ) t.isAVMScene ? (t = null) : (e.push(t.name), (t = t.parent)); for (var n = e.length, r = ""; n > 0; ) (r += e[--n]), n > 0 && (r += "."); return r; } return ""; }), (n.prototype.setFocus = function (t) { var e; if ("" !== t) return "string" == typeof t ? ((e = this.context.resolveTarget(t)) && e.adaptee) || ((e = this.context.resolveTarget(t + "_internal_TF")) && e.adaptee) ? void ef.instance().mouseManager.setFocus(e.adaptee) : void console.warn( "AVM1Selection.setFocus - no object found for string " + t ) : ((e = this.context.resolveTarget(t)) && e.adaptee ? ef.instance().mouseManager.setFocus(e.adaptee) : console.warn( "AVM1Selection.setFocus - no object found '" + t.toString() + "'" ), !0); }), (n.prototype.setSelection = function (t, e) { var n = ef.instance().mouseManager.getFocus(); n && n.isAsset(bh) && n.setSelection(t, e); }), n ); })(vf), v_ = wh.escape, b_ = [], C_ = (function () { function t() {} return (t.ALL = "all"), (t.NONE = "none"), (t.IMPORTANT = "important"), t; })(), I_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.SWF_BASE_URL = ""), (n.registeredLevels = {}), (n.NaN = Number.NaN), (n.Infinity = Number.POSITIVE_INFINITY), (n.newline = "\n"), (n.undefined = void 0), n._initBuiltins(e), n._initializeFlashObject(e), (n.buttonCheckFunc = new bf(e)), (n.buttonCheckFunc.alCall = function (t, e) { return Xg.mouseButtonsState[e[0]]; }), n ); } return ( e(n, t), (n.generateRandomSeed = function () { for ( var t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", e = 10 + Math.round(10 * Math.random()), n = "", r = 0; r < e; r++ ) n += t[Math.floor(Math.random() * t.length)]; return n; }), (n.setRandom = function (t) { return ( void 0 === t && (t = null), t ? (t == n.GENERATE_SEED && (t = n.generateRandomSeed()), (n.randomProvider = y_.create(t)), t) : ((n.randomProvider = null), null) ); }), (n.registerCustomClass = function (t, e) { (n._registeredCustomClasses[t] = e), n.instance && n.instance.alPut(t, e); }), (n.registerCustomClassInstance = function (t, e) { (n._registeredCustomClassInstances[t] = e), n.instance && n.instance.alPut(t, e); }), (n.createGlobalsObject = function (t) { var e = new n(t); return ( Dm( t, e, e, [ "flash", "ASnative", "ASSetPropFlags", "BitmapData", "clearInterval", "clearTimeout", "ExternalInterface", "escape", "unescape", "setInterval", "setTimeout", "showRedrawRegions", "trace", "updateAfterEvent", "myName", "NaN", "Infinity", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "Object", "Function", "Array", "Number", "Math", "Boolean", "Date", "Selection", "String", "Error", "MovieClip", "AsBroadcaster", "System", "Stage", "Button", "TextField", "Color", "Key", "Mouse", "MovieClipLoader", "newline", "XML", "XMLNode", "LoadVars", "Sound", "SharedObject", "ContextMenu", "ContextMenuItem", "TextFormat", ], !1 ), (n.instance = e), e ); }), (n.prototype._getLevelForRoot = function (t) { for (var e in this.registeredLevels) if (this.registeredLevels[e] === t) return +e; return -1; }), (n.prototype._getRootForLevel = function (t) { return this.registeredLevels[t]; }), (n.prototype._addRoot = function (t, e) { return this.registeredLevels[t] ? this.registeredLevels[t] : (Sm(e, this.context).adaptee, Qf.avmStage.root.addChildAt(e, t), e.adapter != e && e.adapter.initAdapter(), (this.registeredLevels[t] = e), e); }), (n.prototype._removeRoot = function (t) { this.registeredLevels[t] && (Qf.avmStage.root.removeChild(this.registeredLevels[t]), delete this.registeredLevels[t]); }), (n.prototype.ASnative = function (t, e) { return 800 === t && 2 === e ? this.buttonCheckFunc : (console.log("ASnatives", t, e), null); }), (n.prototype.ASSetPropFlags = function (t, e, n, r) {}), (n.prototype.clearIntervals = function () { var t = 0, e = b_.length; for (t = 0; t < e; t++) bu.clearInterval(b_[t]); b_.length = 0; }), (n.prototype.clearInterval = function (t) { var e = b_[t - 1]; e && (bu.clearInterval(e), delete b_[t - 1]); }), (n.prototype.clearTimeout = function (t) { var e = b_[t - 1]; e && (bu.clearTimeout(e), delete b_[t - 1]); }), (n.prototype.escape = function (t) { return encodeURIComponent(t).replace( /!|'|\(|\)|\*|-|\.|_|~/g, function (t) { switch (t) { case "*": return "%2A"; case "-": return "%2D"; case ".": return "%2E"; case "_": return "%5F"; default: return v_(t); } } ); }), (n.prototype.unescape = function (t) { return decodeURIComponent(t); }), (n.prototype.setInterval = function () { if (!(arguments.length < 2)) { var t, e = arguments, n = this.context, r = void 0, i = 2; if (dm(e[0])) (t = e[0].toJSFunction()), (r = e[1]); else { if (e.length < 3) return; var o = e[0], a = e[1]; if ( ((r = e[2]), (i = 3), !(o instanceof vf) || "string" != typeof a) ) return; t = function () { var t = o.alGet(a); if (dm(t)) { var e = Array.prototype.slice.call(arguments, 0); n.executeFunction(t, o, e); } }; } if (void 0 !== r) { r = rm(n, r); var s, u = Array.prototype.slice.call(e, i); if (t) { var l = function () { t.apply(null, u); }; s = bu.setInterval(l, r); } return b_.push(s); } } }), (n.prototype.setTimeout = function () { var t = arguments; if (!(t.length < 2) && dm(t[0])) { for ( var e = t[0].toJSFunction(), n = rm(this.context, t[1]), r = [], i = t.length, o = 2; o < i; o++ ) r.push(t[o]); var a = function () { e.apply(null, r); }, s = bu.setTimeOut(a, n); return b_.push(s); } }), (n.prototype.showRedrawRegions = function (t, e) {}), (n.prototype.trace = function (t) { this && this.context.actions.trace(t); }), (n.prototype.updateAfterEvent = function () {}), (n.prototype.isFinite = function (t) { return isFinite(nm(this.context, t)); }), (n.prototype.isNaN = function (t) { return " " === t || isNaN(nm(this.context, t)); }), (n.prototype.parseFloat = function (t) { return parseFloat(om(this.context, t)); }), (n.prototype.parseInt = function (t, e) { return parseInt(om(this.context, t), im(this.context, e)); }), (n.prototype._initBuiltins = function (t) { var e = t.builtins; for (var r in ((this.Object = e.Object), (this.Function = e.Function), (this.Array = e.Array), (this.Number = e.Number), (this.Math = e.Math), (this.Boolean = e.Boolean), (this.Date = e.Date), (this.String = e.String), (this.Error = e.Error), (this.Selection = A_.createAVM1Class(t)._ownProperties.prototype.value), (this.ExternalInterface = d_.createAVM1Class(t)), (this.MovieClip = Bg.createAVM1Class(t)), (this.AsBroadcaster = Rg.createAVM1Class(t)), (this.System = jg.createAVM1Class(t)), (this.Stage = Qf.createAVM1Class(t)), (this.Button = Gg.createAVM1Class(t)), (this.TextField = Tg.createAVM1Class(t)), (this.Color = zg.createAVM1Class(t)), (this.Key = Jf.createAVM1Class(t)), (this.Mouse = Xg.createAVM1Class(t)), (this.MovieClipLoader = Yg.createAVM1Class(t)), (this.LoadVars = new Wg(t)), (this.Sound = $g.createAVM1Class(t)), (this.SharedObject = r_.createAVM1Class(t)), (this.ContextMenu = void 0), (this.ContextMenuItem = void 0), (this.TextFormat = Wf.createAVM1Class(t)), (this.XMLNode = new s_(t)), (this.XML = new h_(t, this.XMLNode)), (this.BitmapData = Hf.createAVM1Class(t)), (this.Matrix = new jf(t)), (this.Point = new xf(t)), (this.Rectangle = new Pf(t)), (this.Transform = $f.createAVM1Class(t)), (this.ColorTransform = new Nf(t)), Rg.initialize(t, this.Stage), Rg.initialize(t, this.Key), Rg.initialize(t, this.Mouse), n._registeredCustomClasses)) this.alPut(r, n._registeredCustomClasses[r]); for (var r in n._registeredCustomClassInstances) this.alPut(r, n._registeredCustomClassInstances[r]); }), (n.prototype._initializeFlashObject = function (t) { this.flash = sm(t); var e = sm(t); e.alPut("BitmapData", this.BitmapData), this.flash.alPut("display", e); var n = sm(t); n.alPut("ExternalInterface", d_.createAVM1Class(t)), this.flash.alPut("external", n); var r = (function (t) { var e = sm(t), n = new rg(t); return ( e.alPut("BitmapFilter", n), og(t, e, n, Zf.BEVEL, [ "distance", "Number", "angle", "Number", "highlightColor", "Number", "highlightAlpha", "Number", "shadowColor", "Number", "shadowAlpha", "Number", "blurX", "Number", "blurY", "Number", "strength", "Number", "quality", "Number", "type", "String", "knockout", "Boolean", ]), og(t, e, n, Zf.BLUR, [ "blurX", "Number", "blurY", "Number", "quality", "Number", ]), og(t, e, n, Zf.COLORMATRIX, ["matrix", "Numbers"]), og(t, e, n, Zf.CONVOLUTION, [ "matrixX", "Number", "matrixY", "Number", "matrix", "Numbers", "divisor", "Number", "bias", "Number", "preserveAlpha", "Boolean", "clamp", "Boolean", "color", "Number", "alpha", "Number", ]), og(t, e, n, Zf.DISPLACEMENT, [ "mapBitmap", "BitmapData", "mapPoint", "Point", "componentX", "Number", "componentY", "Number", "scaleX", "Number", "scaleY", "Number", "mode", "String", "color", "Number", "alpha", "Number", ]), og(t, e, n, Zf.DROPSHADOW, [ "distance", "Number", "angle", "Number", "color", "Number", "alpha", "Number", "blurX", "Number", "blurY", "Number", "strength", "Number", "quality", "Number", "inner", "Boolean", "knockout", "Boolean", "hideObject", "Boolean", ]), og(t, e, n, Zf.GLOW, [ "color", "Number", "alpha", "Number", "blurX", "Number", "blurY", "Number", "strength", "Number", "quality", "Number", "inner", "Boolean", "knockout", "Boolean", ]), og(t, e, n, Zf.GRADIENTBEVEL, [ "distance", "Number", "angle", "Number", "colors", "Numbers", "alphas", "Numbers", "ratios", "Numbers", "blurX", "Number", "blurY", "Number", "strength", "Number", "quality", "Number", "type", "String", "knockout", "Boolean", ]), og(t, e, n, Zf.GRADIENTGLOW, [ "distance", "Number", "angle", "Number", "colors", "Numbers", "alphas", "Numbers", "ratios", "Numbers", "blurX", "Number", "blurY", "Number", "strength", "Number", "quality", "Number", "type", "String", "knockout", "Boolean", ]), e ); })(t); this.flash.alPut("filters", r), (this.filters = r); var i = sm(t); i.alPut("ColorTransform", this.ColorTransform), i.alPut("Matrix", this.Matrix), i.alPut("Point", this.Point), i.alPut("Rectangle", this.Rectangle), i.alPut("Transform", this.Transform), this.flash.alPut("geom", i); var o = sm(t); this.flash.alPut("text", o); }), (n.swfStartTime = Date.now()), (n._registeredCustomClasses = {}), (n._registeredCustomClassInstances = {}), (n.GENERATE_SEED = "GENERATE_SEED"), (n.tracelevel = C_.NONE), (n.toStringPrecision = -1), n ); })(vf), E_ = (function () { function t(t) { this.context = t; } return ( (t.prototype.asfunction = function (t) {}), (t.prototype.call = function (t) { this.context.resolveTarget(null)._callFrame(t); }), (t.prototype.chr = function (t) { return ( (t = rm(this.context, t)), this.context.swfVersion <= 5 && (t &= 255), t ? String.fromCharCode(t) : "" ); }), (t.prototype.duplicateMovieClip = function (t, e, n) { var r = cm(this.context, n) - vm; this.context.resolveTarget(t).duplicateMovieClip(e, r, null); }), (t.prototype.fscommand = function (t, e) {}), (t.prototype.getTimer = function () { return Date.now() - I_.swfStartTime; }), (t.prototype.getURL = function (t, e, n) { (t = String(t)), "string" != typeof e || 0 !== e.indexOf("_level") ? 0 !== t.toLowerCase().indexOf("fscommand:") ? window.open(t, e) : console.log("fsCommand not implemented ") : this.loadMovieNum(t, +e.substr(6), n); }), (t.prototype.gotoAndPlay = function (t, e) { var n = this.context.resolveTarget(null); n.adaptee.play(), this._gotoFrame(n.adaptee, t, e); }), (t.prototype.gotoAndStop = function (t, e) { var n = this.context.resolveTarget(null); ("number" == typeof e && e <= 0) || (n.adaptee.stop(), this._gotoFrame(n.adaptee, t, e)); }), (t.prototype._gotoFrame = function (t, e, n) { if (Array.isArray(e)) { if (0 == e.length) return; e = e[0]; } if (e instanceof U_) { if (!e.value || 0 == e.value.length) return; e = e.value[0]; } if ( ("number" == typeof e && e % 1 != 0 && (e = e.toString()), "string" == typeof e) ) { var r = e.toLowerCase(); if (null === t.timeline._labels[r]) return ( (e = parseInt(e)), void (isNaN(e) || (t.currentFrameIndex = e - 1)) ); t.jumpToLabel(r, n); } else t.currentFrameIndex = e - 1; }), (t.prototype.ifFrameLoaded = function (t, e) { var n = this.context.resolveTarget(null), r = arguments.length < 2 ? arguments[0] : arguments[1], i = n.alGet("_framesloaded"), o = n.alGet("_totalframes"); return Math.min(r + 1, o) <= i; }), (t.prototype.length_ = function (t) { return ("" + t).length; }), (t.prototype.loadMovie = function (t, e, n) { if (t && 0 === t.toLowerCase().indexOf("fscommand:")) this.fscommand(t.substring("fscommand:".length), e); else if ("" === t && e) e.unloadMovie(); else { "" != t && 0 !== t.indexOf("http://") && 0 !== t.indexOf("https://") && (t = this.context.globals.SWF_BASE_URL + t); var r, i = "string" == typeof e && 0 === e.indexOf("_level"); if (i) { var o = e.substr(6); i = (r = parseInt(o, 10)).toString() === o; } if (i) this.loadMovieNum(t, r, n); else this.context.resolveTarget(e).loadMovie(t, n); } }), (t.prototype.loadMovieNum = function (t, e, n) { if ( ((t = lm(this.context, t)), (e = rm(this.context, e)), (n = lm(this.context, n)), t && 0 === t.toLowerCase().indexOf("fscommand:")) ) return this.fscommand(t.substring("fscommand:".length)); if ("" != t) { var r = this.context.globals._addRoot(e, new Cu()); 0 !== t.indexOf("http://") && 0 !== t.indexOf("https://") && (t = this.context.globals.SWF_BASE_URL + t), r.adapter.loadMovie(t, n); } else this.context.globals._removeRoot(e); }), (t.prototype.loadVariables = function (t, e, n) { void 0 === n && (n = ""), (t = lm(this.context, t)), (n = lm(this.context, n)); var r = this.context.resolveTarget(e); r && this._loadVariables(r, t, n); }), (t.prototype.loadVariablesNum = function (t, e, n) { void 0 === n && (n = ""), (t = lm(this.context, t)), (e = rm(this.context, e)), (n = lm(this.context, n)); var r = this.context.resolveLevel(e); r && this._loadVariables(r, t, n); }), (t.prototype._loadVariables = function (t, e, n) { var r = this.context, i = new dt(e); n && (i.method = n); var o = new st(); o.dataFormat = "variables"; var a = function (e) { if ( (o.removeEventListener(H.LOAD_COMPLETE, a), o.dataFormat == it.VARIABLES) ) for (var n in o.data) r.utils.setProperty(t, n, o.data[n]); t instanceof Bg && Em(r, t, "onData"); }; o.addEventListener(H.LOAD_COMPLETE, a), o.load(i); }), (t.prototype.mbchr = function (t) { return (t = rm(this.context, t)) ? String.fromCharCode(t) : ""; }), (t.prototype.mblength = function (t) { return ("" + t).length; }), (t.prototype.mbord = function (t) { return ("" + t).charCodeAt(0); }), (t.prototype.mbsubstring = function (t, e, n) { return e !== (0 | e) || n !== (0 | n) ? "" : (n < 0 && (n = void 0), ("" + t).substr((e = e < 1 ? 0 : e - 1), n)); }), (t.prototype.nextFrame = function () { var t = this.context.resolveTarget(null).adaptee; t.stop(), ++t.currentFrameIndex; }), (t.prototype.nextScene = function () {}), (t.prototype.ord = function (t) { return ("" + t).charCodeAt(0); }), (t.prototype.play = function () { this.context.resolveTarget(null).play(); }), (t.prototype.prevFrame = function () { var t = this.context.resolveTarget(null).adaptee; --t.currentFrameIndex, t.stop(); }), (t.prototype.prevScene = function () {}), (t.prototype.print = function (t, e) {}), (t.prototype.printAsBitmap = function (t, e) {}), (t.prototype.printAsBitmapNum = function (t, e) {}), (t.prototype.printNum = function (t, e) {}), (t.prototype.random = function (t) { return I_.randomProvider ? 0 | (I_.randomProvider.random() * (0 | t)) : 0 | (Math.random() * (0 | t)); }), (t.prototype.removeMovieClip = function (t) { if (t) { var e = this.context.resolveTarget(t); e && e.removeMovieClip(); } }), (t.prototype.startDrag = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; var r = this.context.resolveTarget(t); r && r.startDrag.apply(r, e); }), (t.prototype.stop = function () { this.context.resolveTarget(null).stop(); }), (t.prototype._stopSoundsOnObjectsRecursivly = function (t) { if (t.numChildren) for (var e = 0; e < t.numChildren; e++) t.getChildAt(e).isAsset(Cu) ? t.getChildAt(e).stopSounds() : this._stopSoundsOnObjectsRecursivly(t.getChildAt(e)); }), (t.prototype.stopAllSounds = function () { I.stopAllSounds(), this._stopSoundsOnObjectsRecursivly(Qf.avmStage.root); }), (t.prototype.stopDrag = function () { Bg.currentDraggedMC && Bg.currentDraggedMC.stopDrag(); }), (t.prototype.substring = function (t, e, n) { return this.mbsubstring(t, e, n); }), (t.prototype.toggleHighQuality = function () {}), (t.prototype.trace = function (t) { if (I_.tracelevel != C_.NONE) { var e, n = !1; switch (typeof t) { case "undefined": e = "undefined"; break; case "string": n = (e = t).length > 0 && "!" == e[0]; break; default: e = om(this.context, t); } (I_.tracelevel != C_.IMPORTANT || n) && console.log( "%cAVM1 trace: %c " + e + " ", "color: #054996", "background: #eee; color: #054996" ); } }), (t.prototype.unloadMovie = function (t) { var e = this.context.resolveTarget(t); e && e.unloadMovie(); }), (t.prototype.unloadMovieNum = function (t) { 0 !== (t = im(this.context, t)) && this.context.globals._removeRoot(t); }), t ); })(), x_ = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype._initializePrototype = function () { Am(this, { constructor: { value: this.context.builtins.Object, writable: !0 }, valueOf: { value: this._valueOf, writable: !0 }, toString: { value: this._toString, writable: !0 }, addProperty: { value: this.addProperty }, hasOwnProperty: { value: this.hasOwnProperty }, isPropertyEnumerable: { value: this.isPropertyEnumerable }, isPrototypeOf: { value: this.isPrototypeOf }, unwatch: { value: this.unwatch }, watch: { value: this.watch }, }); }), (n.prototype._valueOf = function () { return this; }), (n.prototype._toString = function () { return dm(this) ? "[type " + um(this) + "]" : "[object " + um(this) + "]"; }), (n.prototype.addProperty = function (t, e, n) { if ("string" != typeof t || "" === t) return !1; if (!dm(e)) return !1; if (!dm(n) && null !== n) return !1; var r = this.alGetOwnProperty(t); return ( !(r && 2 & r.flags) && (this.alSetOwnProperty(t, new Af(128, null, e, n || void 0)), !0) ); }), (n.prototype.hasOwnProperty = function (t) { return this.alHasOwnProperty(t); }), (n.prototype.isPropertyEnumerable = function (t) { return !(1 & this.alGetProperty(t).flags); }), (n.prototype.isPrototypeOf = function (t) { return gm(this.context, this, t); }), (n.prototype.unwatch = function (t) { return (t = lm(this.context, t)), this.alRemotePropertyWatcher(t); }), (n.prototype.watch = function (t, e, n) { return ( (t = lm(this.context, t)), !!dm(e) && this.alAddPropertyWatcher(t, e, n) ); }), n ); })(vf), w_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: e.builtins.Object.alGetPrototypeProperty() }, registerClass: { value: n.registerClass }, }), n ); } return ( e(n, t), (n.prototype.registerClass = function (t, e) { this.context.registerClass(t, e); }), (n.prototype.alConstruct = function (t) { if (t) { var e = t[0]; if (e instanceof vf) return e; switch (typeof e) { case "string": case "boolean": case "number": return am(this.context, e); } } return sm(this.context); }), (n.prototype.alCall = function (t, e) { return e && null !== e[0] && void 0 !== e[0] ? am(this.context, e[0]) : sm(this.context); }), n ); })(bf), S_ = (function (t) { function n(e) { return t.call(this, e) || this; } return ( e(n, t), (n.prototype._initializePrototype = function () { var t = this.context; (this.alPrototype = t.builtins.Object.alGetPrototypeProperty()), Am(this, { constructor: { value: t.builtins.Function, writable: !0 }, call: this.call, apply: this.apply, }); }), (n.prototype.call = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; var r = W_(this, bf); return r.alCall(t, e); }), (n.prototype.apply = function (t, e) { var n = W_(this, bf), r = e ? W_(e, U_).value : void 0; return n.alCall(t, r); }), n ); })(vf), D_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: e.builtins.Function.alGetPrototypeProperty() }, }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { return t ? t[0] : void 0; }), (n.prototype.alCall = function (t, e) { return e ? e[0] : void 0; }), n ); })(bf), T_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Boolean.alGetPrototypeProperty()), r.alSetOwnConstructorProperty(e.builtins.Boolean), (r.value = n), r ); } return ( e(n, t), (n.prototype.valueOf = function () { return this.value; }), n ); })(vf), P_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { constructor: { value: e.builtins.Boolean, writable: !0 }, valueOf: { value: n._valueOf, writable: !0 }, toString: { value: n._toString, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype._valueOf = function () { return W_(this, T_).value; }), (n.prototype._toString = function () { return W_(this, T_).value ? "true" : "false"; }), n ); })(vf), O_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: new P_(e) } }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = !!t && em(this.context, t[0]); return new T_(this.context, e); }), (n.prototype.alCall = function (t, e) { return !!e && em(this.context, e[0]); }), n ); })(bf), B_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Number.alGetPrototypeProperty()), r.alSetOwnConstructorProperty(e.builtins.Number), (r.value = n), r ); } return ( e(n, t), (n.prototype.valueOf = function () { return this.value; }), n ); })(vf), M_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { constructor: { value: e.builtins.Number, writable: !0 }, valueOf: { value: n._valueOf, writable: !0 }, toString: { value: n._toString, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype._valueOf = function () { return W_(this, B_).value; }), (n.prototype._toString = function (t) { return W_(this, B_).value.toString(t || 10); }), n ); })(vf), L_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: new M_(e) }, MAX_VALUE: Number.MAX_VALUE, MIN_VALUE: Number.MIN_VALUE, NaN: Number.NaN, NEGATIVE_INFINITY: Number.NEGATIVE_INFINITY, POSITIVE_INFINITY: Number.POSITIVE_INFINITY, }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = t ? nm(this.context, t[0]) : 0; return new B_(this.context, e); }), (n.prototype.alCall = function (t, e) { return e ? nm(this.context, e[0]) : 0; }), n ); })(bf), N_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.String.alGetPrototypeProperty()), r.alSetOwnConstructorProperty(e.builtins.String), (r.value = n), r ); } return ( e(n, t), (n.prototype.toString = function () { return this.value; }), n ); })(vf), R_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { constructor: { value: e.builtins.String, writable: !0 }, valueOf: { value: n._valueOf, writable: !0 }, toString: { value: n._toString, writable: !0 }, length: { get: n.getLength }, charAt: { value: n.charAt, writable: !0 }, charCodeAt: { value: n.charCodeAt, writable: !0 }, concat: { value: n.concat, writable: !0 }, indexOf: { value: n.indexOf, writable: !0 }, lastIndexOf: { value: n.lastIndexOf, writable: !0 }, slice: { value: n.slice, writable: !0 }, split: { value: n.split, writable: !0 }, substr: { value: n.substr, writable: !0 }, substring: { value: n.substring, writable: !0 }, toLowerCase: { value: n.toLowerCase, writable: !0 }, toUpperCase: { value: n.toUpperCase, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype._valueOf = function () { return W_(this, N_).value; }), (n.prototype._toString = function () { return W_(this, N_).value; }), (n.prototype.getLength = function () { return W_(this, N_).value.length; }), (n.prototype.charAt = function (t) { return om(this.context, this).charAt(rm(this.context, t)); }), (n.prototype.charCodeAt = function (t) { return om(this.context, this).charCodeAt(rm(this.context, t)); }), (n.prototype.concat = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for (var n = [om(this.context, this)], r = 0; r < t.length; ++r) n.push(om(this.context, t[r])); return n.join(""); }), (n.prototype.indexOf = function (t, e) { var n = om(this.context, this); return ( (t = om(this.context, t)), (e = rm(this.context, e)), n.indexOf(t, e) ); }), (n.prototype.lastIndexOf = function (t, e) { var n = om(this.context, this); return ( (t = om(this.context, t)), (e = arguments.length < 2 ? NaN : nm(this.context, e)) < 0 ? -1 : n.lastIndexOf(t, isNaN(e) ? void 0 : e) ); }), (n.prototype.slice = function (t, e) { if (0 !== arguments.length) { var n = om(this.context, this); return ( (t = rm(this.context, t)), (e = void 0 === e ? void 0 : rm(this.context, e)), n.slice(t, e) ); } }), (n.prototype.split = function (t, e) { var n = om(this.context, this); return void 0 !== t ? ((t = om(this.context, t)), (e = (void 0 === e ? -1 : im(this.context, e)) >>> 0), new U_(this.context, n.split(t, e))) : new U_(this.context, [n]); }), (n.prototype.substr = function (t, e) { var n = om(this.context, this), r = n.length; if ( ((t = rm(this.context, t)), (e = void 0 === e ? r : rm(this.context, e)), t < 0 && (t = Math.max(0, r + t)), e < 0) ) { if (-e <= t) return ""; e = Math.max(0, r + e); } return n.substr(t, e); }), (n.prototype.substring = function (t, e) { var n = om(this.context, this); return (t = rm(this.context, t)) >= n.length ? "" : ((e = void 0 === e ? void 0 : rm(this.context, e)), n.substring(t, e)); }), (n.prototype.toLowerCase = function () { return om(this.context, this).toLowerCase(); }), (n.prototype.toUpperCase = function () { return om(this.context, this).toUpperCase(); }), n ); })(vf), F_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: new R_(e) }, fromCharCode: { value: n.fromCharCode }, }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = t ? om(this.context, t[0]) : ""; return new N_(this.context, e); }), (n.prototype.alCall = function (t, e) { return e ? om(this.context, e[0]) : ""; }), (n.prototype.fromCharCode = function () { for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; return ( (e = e.map(function (e) { return 65535 & im(t.context, e); })), String.fromCharCode.apply(String, e) ); }), n ); })(bf), k_ = new Af(64, void 0), U_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Array.alGetPrototypeProperty()), r.alSetOwnConstructorProperty(e.builtins.Array), (r.value = n), r ); } return ( e(n, t), (n.prototype.alGetOwnProperty = function (e) { if (hm(this.context, e)) { var n = im(this.context, e); if (Object.getOwnPropertyDescriptor(this.value, n)) return (k_.value = this.value[n]), k_; } return t.prototype.alGetOwnProperty.call(this, e); }), (n.prototype.alSetOwnProperty = function (e, n) { if (hm(this.context, e)) { var r = im(this.context, e); if (!(64 & n.flags) || 1 & n.flags || 2 & n.flags) throw new Error("Special property is non-supported for array"); this.value[r] = n.value; } else t.prototype.alSetOwnProperty.call(this, e, n); }), (n.prototype.alDeleteOwnProperty = function (e) { if (hm(this.context, e)) { var n = im(this.context, e); delete this.value[n]; } else t.prototype.alDeleteOwnProperty.call(this, e); }), (n.prototype.alGetOwnPropertiesKeys = function () { var e = t.prototype.alGetOwnPropertiesKeys.call(this), n = []; for (var r in this.value) n.push(r); return n.concat(e); }), (n.mapToJSArray = function (t, e, r) { if (t instanceof n) return t.value.map(e, r); if (!mm(t.context, t)) throw new Error("Invalid type"); var i = []; return ( ym(t.context, t, function (t, n) { i.push(e.call(r, t, n)); }), i ); }), n ); })(vf); !(function (t) { (t[(t.CASEINSENSITIVE = 1)] = "CASEINSENSITIVE"), (t[(t.DESCENDING = 2)] = "DESCENDING"), (t[(t.UNIQUESORT = 4)] = "UNIQUESORT"), (t[(t.RETURNINDEXEDARRAY = 8)] = "RETURNINDEXEDARRAY"), (t[(t.NUMERIC = 16)] = "NUMERIC"); })(m_ || (m_ = {})); var j_ = function (t, e) { var n = W_(t, U_).value; if (dm(e)) { var r = [void 0, void 0]; n.sort(function (t, n) { return (r[0] = t), (r[1] = n), e.alCall(null, r); }); } else { var i = "number" == typeof e && (e & m_.NUMERIC || -1 == e), o = "number" == typeof e && e & m_.DESCENDING; if (i) n.sort(function (t, e) { for (; t instanceof U_; ) (t = W_(t, U_).value) && t.length > 0 && (t = t[0]); for (; e instanceof U_; ) (e = W_(e, U_).value) && e.length > 0 && (e = e[0]); return t - e; }); else { for (var a = n.length; a > 0; ) (void 0 !== n[--a] && null !== n[a]) || (n[a] = "00000000000AwayInternal"); for ( n.sort(function (t, e) { for (; t instanceof U_; ) (t = W_(t, U_).value) && t.length > 0 && (t = t[0]); for (; e instanceof U_; ) (e = W_(e, U_).value) && e.length > 0 && (e = e[0]); return t < e ? -1 : 1; }), a = n.length; a > 0; ) "00000000000AwayInternal" == n[--a] && (n[a] = void 0); } o && n.reverse(); } return t; }, V_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { constructor: { value: e.builtins.Array, writable: !0 }, join: { value: n.join, writable: !0 }, length: { get: n.getLength, set: n.setLength }, concat: { value: n.concat, writable: !0 }, pop: { value: n.pop, writable: !0 }, push: { value: n.push, writable: !0 }, reverse: { value: n.reverse, writable: !0 }, shift: { value: n.shift, writable: !0 }, slice: { value: n.slice, writable: !0 }, splice: { value: n.splice, writable: !0 }, sort: { value: n.sort, writable: !0 }, sortOn: { value: n.sortOn, writable: !0 }, toString: { value: n._toString, writable: !0 }, unshift: { value: n.unshift, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype._toString = function () { var t, e = this.alGet("length"), n = 0, r = ""; for (n = 0; n < e; n++) r += void 0 !== (t = this.alGet(n)) ? om(this.context, t) + (n == e - 1 ? "" : ",") : n == e - 1 ? "" : ","; return r; }), (n.prototype.getLength = function () { return W_(this, U_).value.length; }), (n.prototype.setLength = function (t) { (null === t && (t = 0), Kh(t)) && ((t = im(this.context, t) >>> 0), (W_(this, U_).value.length = t)); }), (n.prototype.concat = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this instanceof U_) { for (var n = W_(this, U_).value, r = 0; r < t.length; r++) t[r] instanceof U_ && (t[r] = W_(t[r], U_).value); return new U_(this.context, Array.prototype.concat.apply(n, t)); } for ( var i = [], o = this, a = mm(this.context, this), s = 0; a ? ym(this.context, o, function (t) { return i.push(t); }) : i.push(om(this.context, o)), !(s >= t.length); ) (o = t[s++]), (a = _m(this.context, o)); return new U_(this.context, i); }), (n.prototype.join = function (t) { if ( ((t = void 0 === t ? "," : lm(this.context, t)), this instanceof U_) ) { var e = W_(this, U_).value; if (0 === e.length) return ""; if ( e.every(function (t) { return !(t instanceof vf); }) ) return e.join(t); } var n = this.context, r = im(n, this.alGet("length")) >>> 0; if (0 === r) return ""; for (var i = [], o = 0; o < r; o++) { var a = this.alGet(o); i[o] = null == a ? "" : lm(n, a); } return i.join(t); }), (n.prototype.pop = function () { if (this instanceof U_) return W_(this, U_).value.pop(); var t = im(this.context, this.alGet("length")) >>> 0; if (0 !== t) { var e = t - 1, n = this.alGet(e); return this.alDeleteProperty(e), this.alPut("length", e), n; } }), (n.prototype.push = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this instanceof U_) { var n = W_(this, U_).value; return Array.prototype.push.apply(n, t); } for ( var r = im(this.context, this.alGet("length")) >>> 0, i = 0; i < t.length; i++ ) this.alPut(r, t[i]), r++; return this.alPut("length", r), r; }), (n.prototype.reverse = function () { var t = [], e = this.alGet("length"), n = 0; for (n = 0; n < e; n++) t[n] = this.alGet(n); for (n = e - 1; n >= 0; ) this.alPut(e - 1 - n, t[n]), n--; return this.value; }), (n.prototype.shift = function () { if (this instanceof U_) return W_(this, U_).value.shift(); var t = im(this.context, this.alGet("length")) >>> 0; if (0 !== t) { for (var e = this.alGet(0), n = 1; n < t; n++) this.alHasProperty(n) ? this.alPut(n - 1, this.alGet(n)) : this.alDeleteProperty(n - 1); return this.alDeleteProperty(t - 1), this.alPut("length", t - 1), e; } }), (n.prototype.slice = function (t, e) { if ( ((t = rm(this.context, t)), (e = void 0 !== e ? rm(this.context, e) : void 0), this instanceof U_) ) { var n = W_(this, U_).value; return new U_(this.context, n.slice(t, e)); } var r = [], i = im(this.context, this.alGet("length")) >>> 0; (t = t < 0 ? Math.max(i + t, 0) : Math.min(i, t)), (e = void 0 === e ? i : e < 0 ? Math.max(i + e, 0) : Math.min(i, e)); for (var o = t, a = 0; o < e; o++, a++) this.alHasProperty(o) && (r[a] = this.alGet(o)); return new U_(this.context, r); }), (n.prototype.splice = function (t, e) { for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r]; t = rm(this.context, t); var i = im(this.context, this.alGet("length")) >>> 0; if ( ((t = t < 0 ? Math.max(i + t, 0) : Math.min(i, t)), (e = e || "number" == typeof e ? rm(this.context, e) : i - t), this instanceof U_) ) { var o = W_(this, U_).value; return new U_( this.context, Array.prototype.splice.apply(o, [t, e].concat(n)) ); } for (var a = [], s = 0; s < e; s++) this.alHasProperty(t + s) && (a[s] = this.alGet(t + s)); var u = n.length - e; if (u < 0) { for (s = t - u; s < i; s++) this.alHasProperty(s) ? this.alPut(s + u, this.alGet(s)) : this.alDeleteProperty(s + u); for (s = u; s < 0; s++) this.alDeleteProperty(i + s); } else if (u > 0) for (s = i - 1; s >= t + u; s--) this.alHasProperty(s) ? this.alPut(s + u, this.alGet(s)) : this.alDeleteProperty(s + u); for (s = 0; s < n.length; s++) this.alPut(t + s, n[s]); return this.alPut("length", i + u), new U_(this.context, a); }), (n.prototype.sort = function (t) { return j_(this, t); }), (n.prototype.sortOn = function (t, e) { var n = this.context, r = [], i = []; if ("string" == typeof t) (r = [om(n, t)]), (i = [im(n, e)]); else { if (!_m(n, t)) return j_(this, e); (r = []), (i = []); var o = _m(n, e) ? e : null, a = rm(n, t.alGet("length")); o && a !== rm(n, o.alGet("length")) && (o = null); for (var s = 0; s < a; s++) r.push(om(n, t.alGet(s))), i.push(o ? im(n, o.alGet(s)) : 0); } i[0]; return ( W_(this, U_).value.sort(function (t, e) { for (; t instanceof U_; ) (t = W_(t, U_).value) && t.length > 0 && (t = t[0]); for (; e instanceof U_; ) (e = W_(e, U_).value) && e.length > 0 && (e = e[0]); for (var o = am(n, t), a = am(n, e), s = 0; s < r.length; s++) { var u = o.alGet(r[s]), l = a.alGet(r[s]), c = void 0; if (i[s] & m_.NUMERIC) { var h = nm(n, u), p = nm(n, l); c = h < p ? -1 : h > p ? 1 : 0; } else { var d = om(n, u), f = om(n, l); i[s] & m_.CASEINSENSITIVE && ((d = d.toLowerCase()), (f = f.toLowerCase())), (c = d < f ? -1 : d > f ? 1 : 0); } if (0 !== c) return i[s] & m_.DESCENDING ? -c : c; } return 0; }), this ); }), (n.prototype.unshift = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this instanceof U_) { var n = W_(this, U_).value; return Array.prototype.unshift.apply(n, t); } for ( var r = im(this.context, this.alGet("length")) >>> 0, i = t.length, o = r - 1; o >= 0; o-- ) this.alHasProperty(o) ? this.alPut(o + i, this.alGet(o)) : this.alDeleteProperty(o + i); for (o = 0; o < t.length; o++) this.alPut(o, t[o]); return (r += i), this.alPut("length", r), r; }), n ); })(vf), Q_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: new V_(e) } }), Am(n, { NUMERIC: { value: m_.NUMERIC } }), Am(n, { DESCENDING: { value: m_.DESCENDING } }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { if (!t) return new U_(this.context, []); if (1 === t.length && "number" == typeof t[0]) { var e = t[0]; if (e >>> 0 !== e) throw new Error("Range error"); return new U_(this.context, new Array(e)); } return new U_(this.context, t); }), (n.prototype.alCall = function (t, e) { return this.alConstruct.apply(this, e); }), n ); })(bf), G_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { E: Math.E, LN10: Math.LN10, LN2: Math.LN2, LOG10E: Math.LOG10E, LOG2E: Math.LOG2E, PI: Math.PI, SQRT1_2: Math.SQRT1_2, SQRT2: Math.SQRT2, abs: n.abs, acos: n.acos, asin: n.asin, atan: n.atan, atan2: n.atan2, ceil: n.ceil, cos: n.cos, exp: n.exp, floor: n.floor, log: n.log, max: n.max, min: n.min, pow: n.pow, random: n.random, round: n.round, sin: n.sin, sqrt: n.sqrt, tan: n.tan, }), n ); } return ( e(n, t), (n.prototype.abs = function (t) { return Math.abs(nm(this.context, t)); }), (n.prototype.acos = function (t) { return Math.acos(nm(this.context, t)); }), (n.prototype.asin = function (t) { return Math.asin(nm(this.context, t)); }), (n.prototype.atan = function (t) { return Math.atan(nm(this.context, t)); }), (n.prototype.atan2 = function (t, e) { return Math.atan2(nm(this.context, t), nm(this.context, e)); }), (n.prototype.ceil = function (t) { return Math.ceil(nm(this.context, t)); }), (n.prototype.cos = function (t) { return Math.cos(nm(this.context, t)); }), (n.prototype.exp = function (t) { return Math.exp(nm(this.context, t)); }), (n.prototype.floor = function (t) { return Math.floor(nm(this.context, t)); }), (n.prototype.log = function (t) { return Math.log(nm(this.context, t)); }), (n.prototype.max = function () { for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; return ( (e = e.map(function (e) { return nm(t.context, e); })), Math.max.apply(null, e) ); }), (n.prototype.min = function () { for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; return ( (e = e.map(function (e) { return nm(t.context, e); })), Math.min.apply(null, e) ); }), (n.prototype.pow = function (t, e) { return Math.pow(nm(this.context, t), nm(this.context, e)); }), (n.prototype.random = function () { return I_.randomProvider ? I_.randomProvider.random() : Math.random(); }), (n.prototype.round = function (t) { return Math.round(nm(this.context, t)); }), (n.prototype.sin = function (t) { return Math.sin(nm(this.context, t)); }), (n.prototype.sqrt = function (t) { return Math.sqrt(nm(this.context, t)); }), (n.prototype.tan = function (t) { return Math.tan(nm(this.context, t)); }), n ); })(vf), z_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Date.alGetPrototypeProperty()), r.alSetOwnConstructorProperty(e.builtins.Date), (r.value = n), r ); } return ( e(n, t), (n.prototype.alDefaultValue = function (e) { return void 0 !== e ? t.prototype.alDefaultValue.call(this, e) : this.context.swfVersion >= 6 ? t.prototype.alDefaultValue.call(this, 1) : t.prototype.alDefaultValue.call(this, 0); }), n ); })(vf), H_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { constructor: { value: e.builtins.Date, writable: !0 }, valueOf: { value: n._valueOf, writable: !0 }, toString: { value: n._toString, writable: !0 }, toLocaleString: { value: n._toLocaleString, writable: !0 }, toDateString: { value: n.toDateString, writable: !0 }, toTimeString: { value: n.toTimeString, writable: !0 }, toLocaleDateString: { value: n.toLocaleDateString, writable: !0 }, toLocaleTimeString: { value: n.toLocaleTimeString, writable: !0 }, getTime: { value: n.getTime, writable: !0 }, getFullYear: { value: n.getFullYear, writable: !0 }, getUTCFullYear: { value: n.getUTCFullYear, writable: !0 }, getMonth: { value: n.getMonth, writable: !0 }, getUTCMonth: { value: n.getUTCMonth, writable: !0 }, getDate: { value: n.getDate, writable: !0 }, getUTCDate: { value: n.getUTCDate, writable: !0 }, getDay: { value: n.getDay, writable: !0 }, getUTCDay: { value: n.getUTCDay, writable: !0 }, getHours: { value: n.getHours, writable: !0 }, getUTCHours: { value: n.getUTCHours, writable: !0 }, getMinutes: { value: n.getMinutes, writable: !0 }, getUTCMinutes: { value: n.getUTCMinutes, writable: !0 }, getSeconds: { value: n.getSeconds, writable: !0 }, getUTCSeconds: { value: n.getUTCSeconds, writable: !0 }, getMilliseconds: { value: n.getMilliseconds, writable: !0 }, getUTCMilliseconds: { value: n.getUTCMilliseconds, writable: !0 }, getTimezoneOffset: { value: n.getTimezoneOffset, writable: !0 }, setTime: { value: n.setTime, writable: !0 }, setMilliseconds: { value: n.setMilliseconds, writable: !0 }, setUTCMilliseconds: { value: n.setUTCMilliseconds, writable: !0 }, setSeconds: { value: n.setSeconds, writable: !0 }, setUTCSeconds: { value: n.setUTCSeconds, writable: !0 }, setMinutes: { value: n.setMinutes, writable: !0 }, setUTCMinutes: { value: n.setUTCMinutes, writable: !0 }, setHours: { value: n.setHours, writable: !0 }, setUTCHours: { value: n.setUTCHours, writable: !0 }, setDate: { value: n.setDate, writable: !0 }, setUTCDate: { value: n.setUTCDate, writable: !0 }, setMonth: { value: n.setMonth, writable: !0 }, setUTCMonth: { value: n.setUTCMonth, writable: !0 }, setFullYear: { value: n.setFullYear, writable: !0 }, setUTCFullYear: { value: n.setUTCFullYear, writable: !0 }, toUTCString: { value: n.toUTCString, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype._valueOf = function () { return W_(this, z_).value.valueOf(); }), (n.prototype._toString = function () { return W_(this, z_).value.toString(); }), (n.prototype._toLocaleString = function () { return W_(this, z_).value.toLocaleString(); }), (n.prototype.toDateString = function () { return W_(this, z_).value.toDateString(); }), (n.prototype.toTimeString = function () { return W_(this, z_).value.toTimeString(); }), (n.prototype.toLocaleDateString = function () { return W_(this, z_).value.toLocaleDateString(); }), (n.prototype.toLocaleTimeString = function () { return W_(this, z_).value.toLocaleTimeString(); }), (n.prototype.getTime = function () { return W_(this, z_).value.getTime(); }), (n.prototype.getFullYear = function () { return W_(this, z_).value.getFullYear(); }), (n.prototype.getUTCFullYear = function () { return W_(this, z_).value.getUTCFullYear(); }), (n.prototype.getMonth = function () { return W_(this, z_).value.getMonth(); }), (n.prototype.getUTCMonth = function () { return W_(this, z_).value.getUTCMonth(); }), (n.prototype.getDate = function () { return W_(this, z_).value.getDate(); }), (n.prototype.getUTCDate = function () { return W_(this, z_).value.getUTCDate(); }), (n.prototype.getDay = function () { return W_(this, z_).value.getDay(); }), (n.prototype.getUTCDay = function () { return W_(this, z_).value.getUTCDay(); }), (n.prototype.getHours = function () { return W_(this, z_).value.getHours(); }), (n.prototype.getUTCHours = function () { return W_(this, z_).value.getUTCHours(); }), (n.prototype.getMinutes = function () { return W_(this, z_).value.getMinutes(); }), (n.prototype.getUTCMinutes = function () { return W_(this, z_).value.getUTCMinutes(); }), (n.prototype.getSeconds = function () { return W_(this, z_).value.getSeconds(); }), (n.prototype.getUTCSeconds = function () { return W_(this, z_).value.getUTCSeconds(); }), (n.prototype.getMilliseconds = function () { return W_(this, z_).value.getMilliseconds(); }), (n.prototype.getUTCMilliseconds = function () { return W_(this, z_).value.getUTCMilliseconds(); }), (n.prototype.getTimezoneOffset = function () { return W_(this, z_).value.getTimezoneOffset(); }), (n.prototype.setTime = function (t) { return (t = nm(this.context, t)), W_(this, z_).value.setTime(t); }), (n.prototype.setMilliseconds = function (t) { return ( (t = nm(this.context, t)), W_(this, z_).value.setMilliseconds(t) ); }), (n.prototype.setUTCMilliseconds = function (t) { return ( (t = nm(this.context, t)), W_(this, z_).value.setUTCMilliseconds(t) ); }), (n.prototype.setSeconds = function (t, e) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setSeconds(t) : ((e = nm(this.context, e)), W_(this, z_).value.setSeconds(t, e)) ); }), (n.prototype.setUTCSeconds = function (t, e) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setUTCSeconds(t) : ((e = nm(this.context, e)), W_(this, z_).value.setUTCSeconds(t, e)) ); }), (n.prototype.setMinutes = function (t, e, n) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setMinutes(t) : ((e = nm(this.context, e)), arguments.length <= 2 ? W_(this, z_).value.setMinutes(t, e) : ((n = nm(this.context, n)), W_(this, z_).value.setMinutes(t, e, n))) ); }), (n.prototype.setUTCMinutes = function (t, e, n) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setUTCMinutes(t) : ((e = nm(this.context, e)), arguments.length <= 2 ? W_(this, z_).value.setUTCMinutes(t, e) : ((n = nm(this.context, n)), W_(this, z_).value.setUTCMinutes(t, e, n))) ); }), (n.prototype.setHours = function (t, e, n, r) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setHours(t) : ((e = nm(this.context, e)), arguments.length <= 2 ? W_(this, z_).value.setHours(t, e) : ((n = nm(this.context, n)), arguments.length <= 3 ? W_(this, z_).value.setHours(t, e, n) : ((r = nm(this.context, r)), W_(this, z_).value.setHours(t, e, n, r)))) ); }), (n.prototype.setUTCHours = function (t, e, n, r) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setUTCHours(t) : ((e = nm(this.context, e)), arguments.length <= 2 ? W_(this, z_).value.setUTCHours(t, e) : ((n = nm(this.context, n)), arguments.length <= 3 ? W_(this, z_).value.setUTCHours(t, e, n) : ((r = nm(this.context, r)), W_(this, z_).value.setUTCHours(t, e, n, r)))) ); }), (n.prototype.setDate = function (t) { return (t = nm(this.context, t)), W_(this, z_).value.setDate(t); }), (n.prototype.setUTCDate = function (t) { return (t = nm(this.context, t)), W_(this, z_).value.setUTCDate(t); }), (n.prototype.setMonth = function (t, e) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setMonth(t) : ((e = nm(this.context, e)), W_(this, z_).value.setMonth(t, e)) ); }), (n.prototype.setUTCMonth = function (t, e) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setUTCMonth(t) : ((e = nm(this.context, e)), W_(this, z_).value.setUTCMonth(t, e)) ); }), (n.prototype.setFullYear = function (t, e, n) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setFullYear(t) : ((e = nm(this.context, e)), arguments.length <= 2 ? W_(this, z_).value.setFullYear(t, e) : ((n = nm(this.context, n)), W_(this, z_).value.setFullYear(t, e, n))) ); }), (n.prototype.setUTCFullYear = function (t, e, n) { return ( (t = nm(this.context, t)), arguments.length <= 1 ? W_(this, z_).value.setUTCFullYear(t) : ((e = nm(this.context, e)), arguments.length <= 2 ? W_(this, z_).value.setUTCFullYear(t, e) : ((n = nm(this.context, n)), W_(this, z_).value.setUTCFullYear(t, e, n))) ); }), (n.prototype.toUTCString = function () { return W_(this, z_).value.toUTCString(); }), n ); })(vf), X_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: new H_(e) }, UTC: { value: n._UTC, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e, n = this.context; switch (t.length) { case 0: e = new Date(); break; case 1: e = new Date(tm(n, t[0])); break; default: for (var r = [], i = 0; i < t.length; i++) r.push(nm(n, t[i])); e = new Date( nm(n, t[0]), nm(n, t[1]), t.length > 2 ? nm(n, t[2]) : 1, t.length > 3 ? nm(n, t[3]) : 0, t.length > 4 ? nm(n, t[4]) : 0, t.length > 5 ? nm(n, t[5]) : 0, t.length > 6 ? nm(n, t[6]) : 0 ); } return new z_(n, e); }), (n.prototype.alCall = function (t, e) { return fm(this.alConstruct.apply(this, e), "toString"); }), (n.prototype._UTC = function (t, e, n, r, i, o) { var a = this.context; return Date.UTC( nm(a, arguments[0]), nm(a, arguments[1]), arguments.length > 2 ? nm(a, arguments[2]) : 1, arguments.length > 3 ? nm(a, arguments[3]) : 0, arguments.length > 4 ? nm(a, arguments[4]) : 0, arguments.length > 5 ? nm(a, arguments[5]) : 0, arguments.length > 6 ? nm(a, arguments[6]) : 0 ); }), n ); })(bf), Y_ = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.alPrototype = e.builtins.Error.alGetPrototypeProperty()), r.alSetOwnConstructorProperty(e.builtins.Error), void 0 !== n && r.alPut("message", n), r ); } return e(n, t), n; })(vf), q_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Object.alGetPrototypeProperty()), Am(n, { constructor: { value: e.builtins.Error, writable: !0 }, name: { value: "Error", writable: !0 }, message: { value: "Error", writable: !0 }, toString: { value: n._toString, writable: !0 }, }), n ); } return ( e(n, t), (n.prototype._toString = function () { return this.alGet("message"); }), n ); })(vf), K_ = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.alPrototype = e.builtins.Function.alGetPrototypeProperty()), Am(n, { prototype: { value: new q_(e) } }), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = t && void 0 !== t[0] ? lm(this.context, t[0]) : void 0; return new Y_(this.context, e); }), (n.prototype.alCall = function (t, e) { var n = e && void 0 !== e[0] ? lm(this.context, e[0]) : void 0; return new Y_(this.context, n); }), n ); })(bf); function W_(t, e) { if (t instanceof e) return t; throw new Error("Invalid type"); } var J_ = (function (t) { function n(e, n, r) { var i = t.call(this, e) || this; return (i._fn = n), r && (i._ctor = r), i; } return ( e(n, t), (n.prototype.alConstruct = function (t) { if (!this._ctor) throw new Error("not a constructor"); return this._ctor.apply(this, t); }), (n.prototype.alCall = function (t, e) { if (!this._fn) throw new Error("not callable"); return this._fn.apply(t, e); }), n ); })(bf), $_ = (function (t) { function n(e) { var n = t.call(this, e) || this, r = new vf(e); return ( (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), r.alSetOwnProperty("constructor", new Af(67)), n.alSetOwnPrototypeProperty(r), n ); } return ( e(n, t), (n.prototype.alConstruct = function (t) { var e = new vf(this.context), n = this.alGetPrototypeProperty(); n instanceof vf || (n = this.context.builtins.Object.alGetPrototypeProperty()), (e.alPrototype = n), e.alSetOwnConstructorProperty(this); var r = this.alCall(e, t); return r instanceof vf ? r : e; }), n ); })(bf); function Z_(t) {} function tm(t, e, n) { var r = typeof e; if ("string" === r || "number" === r || "undefined" === r) return e; if (!(e instanceof vf)) return e; var i = e; return void 0 !== n ? i.alDefaultValue(n) : i.alDefaultValue(); } function em(t, e) { var n = t.swfVersion >= 7; switch (typeof e) { case "undefined": return !1; case "object": return null !== e; case "boolean": return e; case "string": return n ? !!e : !isNaN(+e) && 0 != +e; case "number": return !!e; } } function nm(t, e) { switch ( ("object" == typeof e && null !== e && (e = tm(0, e, 0)), typeof e) ) { case "undefined": return t.swfVersion >= 7 ? NaN : 0; case "object": return null === e ? t.swfVersion >= 7 ? NaN : 0 : void 0 !== e.nodeValue ? parseFloat(e.nodeValue) : t.swfVersion >= 5 ? NaN : 0; case "boolean": return e ? 1 : 0; case "number": return e; case "string": return "" === e && t.swfVersion < 5 ? 0 : "" === e ? NaN : +e; } } function rm(t, e) { var n = nm(t, e); return isNaN(n) ? 0 : 0 === n || n === Number.POSITIVE_INFINITY || n === Number.NEGATIVE_INFINITY ? n : n < 0 ? Math.ceil(n) : Math.floor(n); } function im(t, e) { return 0 | nm(t, e); } function om(t, e) { switch ( ("object" == typeof e && null !== e && (e = tm(0, e, 1)), typeof e) ) { case "undefined": return t.swfVersion >= 7 ? "undefined" : ""; case "object": if (null === e) return "null"; if (e && e instanceof Array) { for (var n = "", r = 0; r < e.length; r++) (n += om(t, e[r])), (n += r === e.length - 1 ? "" : ","); return n; } return "[type " + um(e) + "]"; case "boolean": return e ? "true" : "false"; case "number": if ((0 | e) === e) return "" + e; if (isFinite(e)) { var i = Math.floor(Math.log10(Math.abs(+e))); if (Math.abs(i) < 14) { var o = Math.pow(10, 14 - i); e = Math.round(e * o) / o; } } return "" + e; case "string": return e; } } function am(t, e) { switch (typeof e) { case "undefined": throw new Z_(); case "object": if (null === e) throw new Z_(); return Array.isArray(e) ? new U_(t, e) : e; case "boolean": return new T_(t, e); case "number": return new B_(t, e); case "string": return new N_(t, e); } } function sm(t) { var e = new vf(t); return ( (e.alPrototype = t.builtins.Object.alGetPrototypeProperty()), e.alSetOwnConstructorProperty(t.builtins.Object), e ); } function um(t) { return t instanceof bf ? "Function" : "Object"; } function lm(t, e) { return e instanceof vf ? om(t, e) : "string" == typeof e ? e : null == e ? null : e + ""; } function cm(t, e) { if (!Wh(e)) return nm(t, e); } function hm(t, e) { return Kh(e instanceof vf ? om(t, e) : e); } function pm(t, e, n) { t.alGetKeys().forEach(e, n); } function dm(t) { return t instanceof bf; } function fm(t, e, n) { t.alGet(e).alCall(t, n); } function gm(t, e, n) { if (!(e instanceof vf)) return !1; if (!(n instanceof vf)) return !1; for (var r = n.alGetPrototypeProperty(), i = e; i; i = i.alPrototype) if (i === r) return !0; return !1; } function _m(t, e) { return gm(0, e, t.builtins.Array); } function mm(t, e) { if (!(e instanceof vf)) return !1; var n = rm(t, e.alGet("length")); return !(isNaN(n) || n < 0 || n >= 4294967296); } function ym(t, e, n, r) { void 0 === r && (r = null); var i = rm(t, e.alGet("length")); if (!(isNaN(i) || i >= 4294967296)) for (var o = 0; o < i; o++) n.call(r, e.alGet(o), o); } function Am(t, e) { var n = t.context; Object.getOwnPropertyNames(e).forEach(function (r) { var i, o, a, s = e[r], u = 0; "object" == typeof s ? (s.get || s.set ? ((o = s.get ? new J_(n, s.get) : void 0), (a = s.set ? new J_(n, s.set) : void 0), (u |= 128)) : ("function" == typeof (i = s.value) && (i = new J_(n, i)), (u |= 64), s.writable || (u |= 4)), s.enumerable || (u |= 1), s.configurable || (u |= 2)) : ("function" == typeof (i = s) && (i = new J_(n, i)), (u |= 71)), t.alSetOwnProperty(r, new Af(u, i, o, a)); }); } Z_.prototype = Object.create(Error.prototype); var vm = 16384; function bm(t) { return !!t.adaptee; } function Cm(t) { if (t.adaptee) return t.adaptee; if (!t._as3ObjectTemplate) { for ( var e = void 0, n = t.alPrototype; n && !n.initAVM1SymbolInstance && !(e = n._as3ObjectTemplate); ) n = n.alPrototype; t._as3ObjectTemplate = Object.create(e || null); } return t._as3ObjectTemplate; } var Im = [ void 0, "normal", "layer", "multiply", "screen", "lighten", "darken", "difference", "add", "subtract", "invert", "alpha", "erase", "overlay", "hardlight", ]; function Em(t, e, n, r) { void 0 === r && (r = null); var i = e.alGet(n); i instanceof bf && i.alCall(e, r); var o = e.alGet("_listeners"); if (o instanceof U_) { var a = null; o.value.forEach(function (t) { t instanceof vf && (a = t.alGet(n)) instanceof bf && a.alCall(t, r); }); } } var xm = 0; function wm(t, e, n) { for ( var r, i = t.alGetPrototypeProperty(); i && !i.initAVM1SymbolInstance; ) i._as3ObjectTemplate && !r && (r = i._as3ObjectTemplate), (i = i.alPrototype); var o = Object.create(i); if ( (i.initAVM1SymbolInstance.call(o, n, e), (o.alPrototype = t.alGetPrototypeProperty()), o.alSetOwnConstructorProperty(t), (e._as2Object = o), t.alCall(o), (o.aCount = xm++), r) ) for (var a in r) e[a] = r[a]; return o; } function Sm(t, e) { return t ? t._as2Object ? t._as2Object : (t.isAsset(Cu) ? (n = t.timeline.isButton ? wm(e.globals.Button, t, e) : wm(e.globals.MovieClip, t, e)) : t.isAsset(bh) && (n = wm(e.globals.TextField, t, e)), n && ((t._as2Object = n), (t.adapter = n), (n.adaptee = t)), (t._as2Object = n), n) : null; var n; } function Dm(t, e, n, r, i) { function o(e) { if (!Wh(e)) return new J_( t, i ? function () { var n = Array.prototype.slice.call(arguments, 0); return n.unshift(t), e.apply(this, n); } : e ); } void 0 === i && (i = !1), r && r.forEach(function (t) { if ("#" !== t[t.length - 1]) { var r = (function (t) { for (var e, r = n; r; r = Object.getPrototypeOf(r)) if ((e = Object.getOwnPropertyDescriptor(r, t))) return e; return null; })(t); if (r && !r.get && !r.set) { var i = r.value; "function" == typeof i && (i = o(i)); var a = new Af(67, i); e.alSetOwnProperty(t, a); } } else { var s = "get" + t[0].toUpperCase() + t.slice(1, -1), u = n[s], l = "set" + t[0].toUpperCase() + t.slice(1, -1), c = n[l], h = new Af(131, null, o(u), o(c)); e.alSetOwnProperty(t.slice(0, -1), h); } }); } function Tm(t, e, n, r, i, o, a) { var s = e ? new J_(t, o || function () {}, function () { var e = new n(t); return ( (e.alPrototype = u), e.alSetOwnConstructorProperty(s), a && a.apply(e, arguments), e ); }) : new vf(t); Dm(t, s, n, r, !0); var u = new n(t); return ( (u.alPrototype = t.builtins.Object.alGetPrototypeProperty()), Dm(t, u, n.prototype, i, !1), Am(s, { prototype: { value: u } }), Am(u, { constructor: { value: s, writable: !0 } }), s ); } function Pm(t) { var e = t < 0 ? -1 : 1; t = Math.abs(t); var n = Math.floor(20 * t) / 20; return ( t > n && t - n > 0.04 && ((n += 0.05), (n = Math.round(20 * n) / 20)), n * e ); } function Om(t) { return Math.round(20 * t) / 20; } function Bm(t) { return t + 1; } function Mm(t) { return t - 1; } function Lm(t, e) { return e.context.executeActions(t, e); } var Nm, Rm = (function (t) { function n(e) { var r = t.call(this) || this; return (r.imageStore = {}), (r.avm1Context = e), (n._instance = r), r; } return ( e(n, t), Object.defineProperty(n, "instance", { get: function () { return ( n._instance || console.log( "Error. A instance of AVM1SceneGraphFactory must be created manually \t\t\t\tbefore accessing the singleton AVM1SceneGraphFactory._instance" ), n._instance ); }, enumerable: !0, configurable: !0, }), (n.prototype.createSprite = function (t) { return new ru(); }), (n.prototype.createDisplayObjectContainer = function () { return new nu(); }), (n.prototype.createMovieClip = function (t, e) { void 0 === t && (t = null), void 0 === e && (e = null); var n = new Cu(t || new lu()); return Sm(n, this.avm1Context), (n._symbol = e), n; }), (n.prototype.createTextField = function () { var t = new bh(); return ( (t.multiline = !0), (t.wordWrap = !0), Sm(t, this.avm1Context), t ); }), (n.prototype.createBillboard = function (t) { return null; }), (n.prototype.createImage2D = function (t, e, n, r, i) { return ( void 0 === n && (n = !0), void 0 === r && (r = null), void 0 === i && (i = !0), new nn(t, e, n, r, i) ); }), (n.prototype.createFrameScripts = function (t, e, n, r) { n = n.replace(/[^\w]/g, ""); for (var i = [], o = 0; o < t.length; o++) { var a = t[o]; (a.data = this.avm1Context.actionsDataFactory.createActionsData( a, "script_" + name + "_" + r + "_frame_" + e + "_idx_" + o )), (i[i.length] = a); } return i.length && i.sort(this.compareAVM1FrameScripts), i; }), (n.prototype.compareAVM1FrameScripts = function (t, e) { if (!t.precedence) return e.precedence ? -1 : 0; if (!e.precedence) return 1; for ( var n = 0; n < t.precedence.length && n < e.precedence.length && t.precedence[n] === e.precedence[n]; ) n++; return n >= t.precedence.length ? t.precedence.length === e.precedence.length ? 0 : -1 : n >= e.precedence.length ? 1 : t.precedence[n] - e.precedence[n]; }), n ); })(Ch), Fm = (function () { return function (t, e, n, r) { void 0 === n && (n = null), (this.bytes = t), (this.id = e), (this.parent = n), (this.encryptedData = r), (this.debugPath = this.id), (this.ir = null), (this.compiled = null); }; })(), km = (function () { function t() { this._cache = new WeakMap(); } return ( (t.prototype.createActionsData = function (t, e, n) { void 0 === n && (n = null); var r = t instanceof Uint8Array, i = r ? t : t.actionsData, o = r ? void 0 : t.encryptedData, a = this._cache.get(i); return a || ((a = new Fm(i, e, n, o)), this._cache.set(i, a)), a; }), t ); })(), Um = (function () { function t(t) { (this.swfVersion = t), (this.globals = null), (this.actionsDataFactory = new km()), t > 6 ? ((this.isPropertyCaseSensitive = !0), (this.normalizeName = this.normalizeNameCaseSensitive)) : ((this.isPropertyCaseSensitive = !1), (this._nameCache = Object.create(null)), (this.normalizeName = this.normalizeNameCaseInsensitive)), (this.builtins = {}), (function (t) { var e = t.builtins, n = new x_(t), r = new vf(t); r.alSetOwnPrototypeProperty(n), (e.Object = r); var i = new S_(t), o = new vf(t); o.alSetOwnPrototypeProperty(i), (e.Function = o), n._initializePrototype(), i._initializePrototype(), (e.Object = new w_(t)), (e.Function = new D_(t)), (e.Boolean = new O_(t)), (e.Number = new L_(t)), (e.String = new F_(t)), (e.Array = new Q_(t)), (e.Date = new X_(t)), (e.Math = new G_(t)), (e.Error = new K_(t)); })(this), (this.eventObservers = Object.create(null)), (this.assets = {}), (this.assetsSymbols = []), (this.assetsClasses = []), (this.awayAssets = {}), (this.staticStates = new WeakMap()); } return ( (t.prototype.resolveTarget = function (t) {}), (t.prototype.resolveRoot = function () {}), (t.prototype.checkTimeout = function () {}), (t.prototype.executeActions = function (t, e) {}), (t.prototype.executeFunction = function (t, e, n) {}), (t.prototype.normalizeNameCaseSensitive = function (t) { switch (typeof t) { case "number": case "string": return t; default: return om(this, t); } }), (t.prototype.normalizeNameCaseInsensitive = function (t) { switch (typeof t) { case "number": return t.toString(); case "string": break; default: t = om(this, t); } var e = this._nameCache[t]; return e || ((e = t.toLowerCase()), (this._nameCache[t] = e), e); }), (t.prototype._getEventPropertyObservers = function (t, e) { this.isPropertyCaseSensitive || (t = t.toLowerCase()); var n = this.eventObservers[t]; return n || (e ? ((n = []), (this.eventObservers[t] = n), n) : null); }), (t.prototype.registerEventPropertyObserver = function (t, e) { this._getEventPropertyObservers(t, !0).push(e); }), (t.prototype.unregisterEventPropertyObserver = function (t, e) { var n = this._getEventPropertyObservers(t, !1); if (n) { var r = n.indexOf(e); r < 0 || n.splice(r, 1); } }), (t.prototype.broadcastEventPropertyChange = function (t) { var e = this._getEventPropertyObservers(t, !1); e && e.forEach(function (e) { return e.onEventPropertyModified(t); }); }), (t.prototype.addAsset = function (t, e, n) { (this.assets[t.toLowerCase()] = e), (this.assetsSymbols[e] = n), (this.awayAssets[t.toLowerCase()] = n); }), (t.prototype.registerClass = function (t, e) { if (null !== (t = lm(this, t))) { var n = pt.getAsset(t, Bg.currentMCAssetNameSpace); n && n.adaptee ? (n.adaptee.avm1Symbol = e) : console.warn("can not find symbol to register class " + t); } else this.utils.warn( "Cannot register class for symbol: className is missing" ); }), (t.prototype.getSymbolClass = function (t) { return this.assetsClasses[t] || null; }), (t.prototype.getAsset = function (t) { if (null !== (t = lm(this, t))) { var e = this.assets[t.toLowerCase()]; if (void 0 !== e) { var n = this.awayAssets[t.toLowerCase()]; return ( n || console.log( "error in getAsset. not implemented to grab assets from loaderInfo" ), { symbolId: e, symbolProps: n } ); } } }), (t.prototype.reset = function () { (this.eventObservers = Object.create(null)), (this.assets = {}), (this.assetsSymbols = []), (this.assetsClasses = []), (this.awayAssets = {}), (this.staticStates = new WeakMap()), Qf.bindStage(this, this.globals.Stage, null, null, null); }), (t.prototype.setStage = function (t, e, n) { Jf.bindStage(this, this.globals.Key, t, n), Xg.bindStage(this, this.globals.Mouse, t, n), Qf.bindStage(this, this.globals.Stage, t, e, n); }), (t.prototype.getStaticState = function (t) { var e = this.staticStates.get(t); if (!e) { e = Object.create(null); var n = t.alInitStatic; n && n.call(e, this), this.staticStates.set(t, e); } return e; }), (t.prototype.resolveLevel = function (t) { var e = this.globals._getRootForLevel(t); if (e) return Sm(e, this); this.utils.warn("Unable to resolve level " + t + " root"); }), t ); })(), jm = (function () { function t() { (this.parentResults = null), (this.registersLimit = 0); } return ( (t.prototype.analyze = function (t) { for ( var e, n, r, i, o, a, s, u, l = [], c = [0], h = [!0], p = !1, d = null, f = [0]; f.length > 0; ) if (((e = f.shift()), !l[e])) for ( t.position = e; !t.eof && !l[e] && 0 !== (n = t.readNext()).actionCode; ) { switch ( ((i = { action: n, next: (r = t.position), conditionalJumpTo: -1, }), (o = 0), (a = !1), (s = !1), n.actionCode) ) { case 138: case 141: (a = !0), (u = 138 === n.actionCode ? n.args[1] : n.args[0]), t.skip(u), (o = t.position), (t.position = r); break; case 153: (s = !0), (a = !0), (o = r + n.args[0]); break; case 157: (a = !0), (o = r + n.args[0]); break; case 42: case 62: case 0: (s = !0), (a = !0), (o = t.length); break; case 136: if (p) { d = null; break; } (p = !0), 0 === e && (d = n.args[0]); } if ( (a && (s ? (i.next = o) : (i.conditionalJumpTo = o), h[o] || (c.push(o), f.push(o), (h[o] = !0))), (l[e] = i), s) ) break; e = r; } var g, _, m = []; c.forEach(function (t) { if (l[t]) { var e; (g = []), (_ = t); do { (e = l[_]), g.push(e), (_ = e.next); } while (!h[_] && l[_]); m.push({ label: t, items: g, jump: _ }); } }); var y = null; return ( p ? (y = d) : this.parentResults && (y = this.parentResults.singleConstantPool), { actions: l, blocks: m, dataId: t.dataId, singleConstantPool: y, registersLimit: this.registersLimit, } ); }), t ); })(), Vm = (function () { function t(t, e) { (this.array = t), (this.position = 0), (this.end = t.length), (this.readANSI = e < 6); var n = new ArrayBuffer(4); if (((new Int32Array(n)[0] = 1), !new Uint8Array(n)[0])) throw new Error("big-endian platform"); } return ( (t.prototype.readUI8 = function () { return this.array[this.position++]; }), (t.prototype.readUI16 = function () { var t = this.position, e = this.array, n = (e[t + 1] << 8) | e[t]; return (this.position = t + 2), n; }), (t.prototype.readSI16 = function () { var t = this.position, e = this.array, n = (e[t + 1] << 8) | e[t]; return (this.position = t + 2), n < 32768 ? n : n - 65536; }), (t.prototype.readInteger = function () { var t = this.position, e = this.array, n = e[t] | (e[t + 1] << 8) | (e[t + 2] << 16) | (e[t + 3] << 24); return (this.position = t + 4), n; }), (t.prototype.readFloat = function () { var t = this.position, e = this.array, n = new ArrayBuffer(4), r = new Uint8Array(n); return ( (r[0] = e[t]), (r[1] = e[t + 1]), (r[2] = e[t + 2]), (r[3] = e[t + 3]), (this.position = t + 4), new Float32Array(n)[0] ); }), (t.prototype.readDouble = function () { var t = this.position, e = this.array, n = new ArrayBuffer(8), r = new Uint8Array(n); return ( (r[4] = e[t]), (r[5] = e[t + 1]), (r[6] = e[t + 2]), (r[7] = e[t + 3]), (r[0] = e[t + 4]), (r[1] = e[t + 5]), (r[2] = e[t + 6]), (r[3] = e[t + 7]), (this.position = t + 8), new Float64Array(n)[0] ); }), (t.prototype.readBoolean = function () { return !!this.readUI8(); }), (t.prototype.readANSIString = function () { for (var t, e = ""; (t = this.readUI8()); ) e += String.fromCharCode(t); return e; }), (t.prototype.readUTF8String = function () { for (var t, e = ""; (t = this.readUI8()); ) if (t < 128) e += String.fromCharCode(t); else if (128 != (192 & t)) { var n = this.position - 1, r = 192, i = 5; do { var o = (r >> 1) | 128; if ((t & o) === r) break; (r = o), --i; } while (i >= 0); for (var a = t & ((1 << i) - 1), s = 5; s >= i; --s) if (128 == (192 & (t = this.readUI8()))) a = (a << 6) | (63 & t); else { var u = this.position - 1; for (this.position = n; this.position < u; ) e += String.fromCharCode(this.readUI8()); } e += a >= 65536 ? String.fromCharCode( (((a - 65536) >> 10) & 1023) | 55296, (1023 & a) | 56320 ) : String.fromCharCode(a); } else e += String.fromCharCode(t); return e; }), (t.prototype.readString = function () { return this.readANSI ? this.readANSIString() : this.readUTF8String(); }), (t.prototype.readBytes = function (t) { var e = this.position, n = Math.max(this.end - e, 0); n < t && (t = n); var r = this.array.subarray(e, e + t); return (this.position = e + t), r; }), t ); })(), Qm = /[^A-Za-z0-9_]+/g, Gm = (function () { return function (t) { this.registerNumber = t; }; })(), zm = (function () { return function (t) { this.constantIndex = t; }; })(), Hm = (function () { function t(t, e) { (this.swfVersion = e), (this._lastPushedValue = null), (this._lastDefinedConstantPool = null), (this._initialPosition = 0), (this._initialLen = 0), (this._actionsData = t), (this.dataId = t.id); var n = t.bytes, r = new Uint8Array(n.buffer, 0); (this._initialPosition = n.byteOffset), (this._initialLen = n.length), (this._stream = new Vm(r, e)), (this._stream.position = this._initialPosition); } return ( Object.defineProperty(t.prototype, "position", { get: function () { return this._stream.position - this._initialPosition; }, set: function (t) { this._stream.position = t + this._initialPosition; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "eof", { get: function () { return this.position >= this._initialLen; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "length", { get: function () { return this._initialLen; }, enumerable: !0, configurable: !0, }), (t.prototype.readNext = function () { var t = this._stream, e = t.position, n = t.readUI8(), r = n >= 128 ? t.readUI16() : 0, i = t.position + r, o = null; switch ( (155 !== n && 142 !== n && (this._lastPushedValue = null), 0 | n) ) { case 129: var a = t.readUI16(), s = !1; 6 !== (u = t.readUI8()) && 7 !== u ? t.position-- : (i++, (s = 6 === u)), (o = [a, s]); break; case 131: o = [t.readString(), t.readString()]; break; case 138: o = [(a = t.readUI16()), (p = t.readUI8())]; break; case 139: o = [t.readString()]; break; case 140: var u, l = t.readString(); s = !1; 6 !== (u = t.readUI8()) && 7 !== u ? t.position-- : (i++, (s = 6 === u)), (o = [l, s]); break; case 150: var c, h; for (o = []; t.position < i; ) { switch (0 | (c = t.readUI8())) { case 0: (h = t.readString()), (this._lastPushedValue = h); break; case 1: h = t.readFloat(); break; case 2: h = null; break; case 3: h = void 0; break; case 4: h = new Gm(t.readUI8()); break; case 5: h = t.readBoolean(); break; case 6: h = t.readDouble(); break; case 7: h = t.readInteger(); break; case 8: h = new zm(t.readUI8()); break; case 9: h = new zm(t.readUI16()); break; default: console.error("Unknown value type: " + c, t.position), (t.position = i); continue; } (this._lastPushedValue = h), o.push(h); } break; case 153: case 157: o = [t.readSI16()]; break; case 154: o = [(A = t.readUI8())]; break; case 159: (o = [(A = t.readUI8())]), 2 & A && o.push(t.readUI16()); break; case 141: o = [(p = t.readUI8())]; break; case 136: for (var p = t.readUI16(), d = [], f = 0; f < p; f++) d.push(t.readString()); (this._lastDefinedConstantPool = d), (o = [d]); break; case 155: var g = t.readString(), _ = ((p = t.readUI16()), []); for (f = 0; f < p; f++) _.push(t.readString()); (i += E = t.readUI16()), (o = [ (w = new Fm( t.readBytes(E), this.dataId + "_f" + t.position, this._actionsData )), g, _, ]); break; case 148: (i += E = t.readUI16()), (o = [ new Fm( t.readBytes(E), this.dataId + "_w" + t.position, this._actionsData ), ]); break; case 135: o = [(b = t.readUI8())]; break; case 142: var m = null; this._lastPushedValue instanceof zm && this._lastDefinedConstantPool && (m = this._lastDefinedConstantPool[ this._lastPushedValue.constantIndex ]), "string" == typeof this._lastPushedValue && (m = this._lastPushedValue), m && Qm.test(m) && (m = null); (g = t.readString()), (p = t.readUI16()); var y = t.readUI8(), A = t.readUI16(), v = []; for (_ = [], f = 0; f < p; f++) { var b = t.readUI8(), C = t.readString(); _.push(C), b && (v[b] = { type: 1, name: C, index: f }); } var I = 1; 1 & A && (v[I++] = { type: 2 }), 4 & A && (v[I++] = { type: 4 }), 16 & A && (v[I++] = { type: 8 }), 64 & A && (v[I++] = { type: 64 }), 128 & A && (v[I++] = { type: 32 }), 256 & A && (v[I++] = { type: 16 }); var E, x = 0; 2 & A && (x |= 2), 8 & A && (x |= 4), 32 & A && (x |= 8), (i += E = t.readUI16()); var w, S = this.dataId + "_f" + t.position; m && (S = m + "__" + S), ((w = new Fm(t.readBytes(E), S, this._actionsData)).debugPath = this.dataId + "/" + (m || "f" + t.position)), (o = [w, g, _, y, v, x]); break; case 143: var D = !!(4 & (A = t.readUI8())), T = !!(2 & A), P = !!(1 & A), O = t.readUI16(), B = t.readUI16(), M = t.readUI16(), L = D ? t.readUI8() : t.readString(); i += O + B + M; var N = this._actionsData.debugPath, R = new Fm( t.readBytes(O), this.dataId + "_t" + t.position, this._actionsData ); N && (R.debugPath = N + "/try_" + this._stream.position); var F = new Fm( t.readBytes(B), this.dataId + "_c" + t.position, this._actionsData ); N && (F.debugPath = N + "/catch_" + this._stream.position); var k = new Fm( t.readBytes(M), this.dataId + "_z" + t.position, this._actionsData ); N && (k.debugPath = N + "/finaly_" + this._stream.position), (o = [D, L, R, P, F, T, k]); break; case 137: o = [t.readUI8()]; } return ( (t.position = i), { position: e - this._initialPosition, actionCode: n, actionName: Xm[n], knownAction: !!Xm[n], args: o, } ); }), (t.prototype.skip = function (t) { for ( var e = this._stream; t > 0 && this.position < this._initialLen; ) { var n = e.readUI8() >= 128 ? e.readUI16() : 0; (e.position += n), t--; } }), t ); })(), Xm = { 0: "EOA", 4: "ActionNextFrame", 5: "ActionPreviousFrame", 6: "ActionPlay", 7: "ActionStop", 8: "ActionToggleQuality", 9: "ActionStopSounds", 10: "ActionAdd", 11: "ActionSubtract", 12: "ActionMultiply", 13: "ActionDivide", 14: "ActionEquals", 15: "ActionLess", 16: "ActionAnd", 17: "ActionOr", 18: "ActionNot", 19: "ActionStringEquals", 20: "ActionStringLength", 21: "ActionStringExtract", 23: "ActionPop", 24: "ActionToInteger", 28: "ActionGetVariable", 29: "ActionSetVariable", 32: "ActionSetTarget2", 33: "ActionStringAdd", 34: "ActionGetProperty", 35: "ActionSetProperty", 36: "ActionCloneSprite", 37: "ActionRemoveSprite", 38: "ActionTrace", 39: "ActionStartDrag", 40: "ActionEndDrag", 41: "ActionStringLess", 42: "ActionThrow", 43: "ActionCastOp", 44: "ActionImplementsOp", 45: "ActionFSCommand2", 48: "ActionRandomNumber", 49: "ActionMBStringLength", 50: "ActionCharToAscii", 51: "ActionAsciiToChar", 52: "ActionGetTime", 53: "ActionMBStringExtract", 54: "ActionMBCharToAscii", 55: "ActionMBAsciiToChar", 58: "ActionDelete", 59: "ActionDelete2", 60: "ActionDefineLocal", 61: "ActionCallFunction", 62: "ActionReturn", 63: "ActionModulo", 64: "ActionNewObject", 65: "ActionDefineLocal2", 66: "ActionInitArray", 67: "ActionInitObject", 68: "ActionTypeOf", 69: "ActionTargetPath", 70: "ActionEnumerate", 71: "ActionAdd2", 72: "ActionLess2", 73: "ActionEquals2", 74: "ActionToNumber", 75: "ActionToString", 76: "ActionPushDuplicate", 77: "ActionStackSwap", 78: "ActionGetMember", 79: "ActionSetMember", 80: "ActionIncrement", 81: "ActionDecrement", 82: "ActionCallMethod", 83: "ActionNewMethod", 84: "ActionInstanceOf", 85: "ActionEnumerate2", 96: "ActionBitAnd", 97: "ActionBitOr", 98: "ActionBitXor", 99: "ActionBitLShift", 100: "ActionBitRShift", 101: "ActionBitURShift", 102: "ActionStrictEquals", 103: "ActionGreater", 104: "ActionStringGreater", 105: "ActionExtends", 129: "ActionGotoFrame", 131: "ActionGetURL", 135: "ActionStoreRegister", 136: "ActionConstantPool", 137: "ActionStrictMode", 138: "ActionWaitForFrame", 139: "ActionSetTarget", 140: "ActionGoToLabel", 141: "ActionWaitForFrame2", 142: "ActionDefineFunction2", 143: "ActionTry", 148: "ActionWith", 150: "ActionPush", 153: "ActionJump", 154: "ActionGetURL2", 155: "ActionDefineFunction", 157: "ActionIf", 158: "ActionCall", 159: "ActionGotoFrame2", }, Ym = /[^A-Za-z0-9_/]+/g, qm = null; function Km() { return ( qm || (qm = (function () { var t = function (t) { return t; }; return { ActionGotoFrame: t(Ry), ActionGetURL: t(Fy), ActionNextFrame: t(ky), ActionPreviousFrame: t(Uy), ActionPlay: t(jy), ActionStop: t(Vy), ActionToggleQuality: t(Qy), ActionStopSounds: t(Gy), ActionWaitForFrame: t(zy), ActionSetTarget: t(Hy), ActionGoToLabel: t(Xy), ActionPush: t(Yy), ActionPop: t(qy), ActionAdd: t(Ky), ActionSubtract: t(Wy), ActionMultiply: t(Jy), ActionDivide: t($y), ActionEquals: t(Zy), ActionLess: t(tA), ActionAnd: t(eA), ActionOr: t(nA), ActionNot: t(rA), ActionStringEquals: t(iA), ActionStringLength: t(oA), ActionMBStringLength: t(aA), ActionStringAdd: t(sA), ActionStringExtract: t(uA), ActionMBStringExtract: t(lA), ActionStringLess: t(cA), ActionToInteger: t(hA), ActionCharToAscii: t(pA), ActionMBCharToAscii: t(dA), ActionAsciiToChar: t(fA), ActionMBAsciiToChar: t(gA), ActionJump: t(_A), ActionIf: t(mA), ActionCall: t(yA), ActionGetVariable: t(AA), ActionSetVariable: t(vA), ActionGetURL2: t(bA), ActionGotoFrame2: t(CA), ActionSetTarget2: t(IA), ActionGetProperty: t(EA), ActionSetProperty: t(xA), ActionCloneSprite: t(wA), ActionRemoveSprite: t(SA), ActionStartDrag: t(DA), ActionEndDrag: t(TA), ActionWaitForFrame2: t(PA), ActionTrace: t(OA), ActionGetTime: t(BA), ActionRandomNumber: t(MA), ActionCallFunction: t(LA), ActionCallMethod: t(NA), ActionConstantPool: t(FA), ActionDefineFunction: t(kA), ActionDefineLocal: t(UA), ActionDefineLocal2: t(jA), ActionDelete: t(VA), ActionDelete2: t(QA), ActionEnumerate: t(GA), ActionEquals2: t(zA), ActionGetMember: t(HA), ActionInitArray: t(XA), ActionInitObject: t(YA), ActionNewMethod: t(qA), ActionNewObject: t(KA), ActionSetMember: t(WA), ActionTargetPath: t(JA), ActionWith: t($A), ActionToNumber: t(ZA), ActionToString: t(tv), ActionTypeOf: t(ev), ActionAdd2: t(nv), ActionLess2: t(rv), ActionModulo: t(iv), ActionBitAnd: t(ov), ActionBitLShift: t(av), ActionBitOr: t(sv), ActionBitRShift: t(uv), ActionBitURShift: t(lv), ActionBitXor: t(cv), ActionDecrement: t(hv), ActionIncrement: t(pv), ActionPushDuplicate: t(dv), ActionReturn: t(fv), ActionStackSwap: t(gv), ActionStoreRegister: t(_v), ActionInstanceOf: t(mv), ActionEnumerate2: t(yv), ActionStrictEquals: t(Av), ActionGreater: t(vv), ActionStringGreater: t(bv), ActionDefineFunction2: t(Cv), ActionExtends: t(Iv), ActionCastOp: t(Ev), ActionImplementsOp: t(xv), ActionTry: t(wv), ActionThrow: t(Sv), ActionFSCommand2: t(Dv), ActionStrictMode: t(Tv), }; })()), qm ); } var Wm = (function () { return function (t) { void 0 === t && (t = !1), (this.inlinePop = t); }; })(), Jm = (((Nm = {})[78] = { AllowReturnValue: !0, AllowStackToArgs: !0, AllowCallapsDouble: !0, ArgsCount: 2, }), (Nm[79] = { AllowStackToArgs: !0, ArgsCount: 3 }), (Nm[71] = { AllowStackToArgs: !0, AllowReturnValue: !0, PlainArgs: !0, ArgsCount: 2, }), (Nm[103] = { AllowStackToArgs: !0, AllowReturnValue: !0, ArgsCount: 2 }), Nm), $m = (function () { function t() {} return ( (t.prototype.convertArgs = function (t, e, n, r) { for (var i, o, a, s, u, l, c = [], h = t.length, p = 0; p < h; p++) "object" != typeof (i = t[p]) || null === i || Array.isArray(i) ? void 0 === i ? c.push("undefined") : c.push(JSON.stringify(i)) : i instanceof zm ? r.singleConstantPool ? ((o = r.singleConstantPool[i.constantIndex]), c.push(void 0 === o ? "undefined" : JSON.stringify(o))) : ((a = ""), (s = n.constantPool) && (a = (a = void 0 === (o = s[i.constantIndex]) ? "undefined" : JSON.stringify(o)).indexOf("*/") >= 0 ? "" : " /* " + a + " */"), c.push("constantPool[" + i.constantIndex + "]" + a)) : i instanceof Gm ? (u = i.registerNumber) < 0 || u >= r.registersLimit ? c.push("undefined") : c.push("registers[" + u + "]") : i instanceof Fm ? ((n[(l = "code_" + e + "_" + p)] = i), c.push("res." + l)) : i instanceof Wm && i.inlinePop && c.push("stack.pop()"); return c.join(","); }), (t.prototype.convertAction = function (t, e, n, r, i, o, a) { var s, u, l = o[r - 1], c = t.flags, h = ""; if ( ((null === (s = c) || void 0 === s ? void 0 : s.optimised) && (h = " /* " + t.action.actionName + " optimised */\n"), null === (u = c) || void 0 === u ? void 0 : u.killed) ) return " /* " + t.action.actionName + " killed by optimiser */\n"; if (!t.action.knownAction) return ( " // unknown actionCode " + t.action.actionCode + " at " + t.action.position + "\n" ); switch (t.action.actionCode) { case 153: case 62: return ""; case 136: return ( (n.constantPool = t.action.args[0]), (a.forward["constPool" + e] = "[" + this.convertArgs(t.action.args[0], e, n, i) + "]"), " constantPool = ectx.constantPool = constPool" + e + ";\n" ); case 150: return ( h + " stack.push(" + this.convertArgs(t.action.args, e, n, i) + ");\n" ); case 135: var p = t.action.args[0]; return p < 0 || p >= i.registersLimit ? "" : " registers[" + p + "] = stack[stack.length - 1];\n"; case 138: case 141: var d = this.convertArgs(t.action.args, e, n, i); return ( " if (calls." + t.action.actionName + "(ectx,[" + d + "])) { position = " + t.conditionalJumpTo + "; checkTimeAfter -= " + (r + 1) + "; break; }\n" ); case 157: return ( " if (!!stack.pop()) { position = " + t.conditionalJumpTo + "; checkTimeAfter -= " + (r + 1) + "; break; }\n" ); default: if ( ((d = t.action.args ? this.convertArgs(t.action.args, e, n, i) : "") && !c.PlainArgs && (d = "[" + d + "]"), 142 === t.action.actionCode) ) { var f = "defFunArgs" + e; (a.forward[f] = d), (d = f); } if ( ((h += " calls." + t.action.actionName + "(ectx" + (d ? ", " + d : "") + ");\n"), "ActionCallMethod" == t.action.actionName && (l || (h = "// strange oppcode at " + t.action.position + "\n" + h), l && 150 == l.action.actionCode)) ) { var g = this.convertArgs(l.action.args, e - 1, n, i); ('"gotoAndStop"' != g && '"gotoAndPlay"' != g) || (h += " if(ectx.scopeList && ectx.scopeList.scope && ectx.scopeList.scope.adaptee && !ectx.scopeList.scope.adaptee.parent){ ectx.framescriptmanager.execute_avm1_constructors(); return;}\n"); } return h; } }), (t.prototype.inlineStackOpt = function (t, e, n) { if (!n.length) return !1; var r = e[t], i = r.flags, o = r.action.actionCode, a = e[n[0]]; n.length = 0; var s = Jm[o]; if (!s || !s.AllowStackToArgs) return !1; i.PlainArgs = s.PlainArgs; var u = a.action.args; if (u.length === s.ArgsCount) (a.flags.killed = !0), (r.action.args = u); else if (u.length > s.ArgsCount) { var l = u.length - s.ArgsCount; (r.action.args = u.slice(l)), (u.length = l), (a.flags.optimised = !0); } else { var c = s.ArgsCount - u.length; if (c > 1) return !1; (a.flags.killed = !0), (r.action.args = u.slice()); for (var h = 0; h < c; h++) r.action.args.unshift(new Wm(!0)); } return (i.optimised = !0), !0; }), (t.prototype.optimiser = function (t) { for ( var e, n, r = t.items, i = [], o = !0, a = 0, s = r.length; a < s; a++ ) { var u = r[a], l = u.action.actionCode; if (((u.flags = u.flags || {}), 150 !== l)) { if (i.length > 1) for ( var c = i[0], h = i[i.length - 1], p = r[c].action, d = c + 1; d <= h; d++ ) (p.args = p.args.concat(r[d].action.args)), (r[d].flags.killed = !0); (o = !!o && this.inlineStackOpt(a, r, i)), (i.length = 0); } switch (l) { case 150: i.push(a), (o = !0); break; case 78: var f = u.action.args; if (!(null === (e = f) || void 0 === e ? void 0 : e.length)) break; var g = f[0]; if (!(g instanceof Wm && g.inlinePop)) break; for (var _ = a - 1; _ >= 0 && r[_].flags.killed; _--); if (_ >= 0) { var m = r[_], y = m.action.args; if ( 78 === m.action.actionCode && (null === (n = y) || void 0 === n ? void 0 : n.length) ) { (m.flags.killed = !0), (u.flags.optimised = !0), f.shift(); for (var A = y.length - 1; A >= 0; A--) f.unshift(y[A]); } } } } }), (t.prototype.generate = function (t, e) { var n = this; void 0 === e && (e = null); var r = t.blocks, i = {}, o = { forward: {}, back: {} }, a = t.dataId.replace(Ym, "_"), s = "return function " + a + "(ectx) {\nvar position = 0;\nvar checkTimeAfter = 0;\nvar constantPool = ectx.constantPool, registers = ectx.registers, stack = ectx.stack;\n", u = "", l = ""; gg.value && (l += "/* Running " + a + " */ if (Shumway.AVM1.Debugger.pause || Shumway.AVM1.Debugger.breakpoints." + a + ") { debugger; }\n"), (l += "while (!ectx.isEndOfActions) {\nif (checkTimeAfter <= 0) { checkTimeAfter = " + ey + "; ectx.context.checkTimeout(); }\n\nswitch(position) {\n"); var c = 0; for (var h in (r.forEach(function (e) { (l += " case " + e.label + ":\n"), n.optimiser(e); var r = e.items.map(function (r, a) { return n.convertAction(r, c++, i, a, t, e.items, o); }); (l += r.join("")), (l += " position = " + e.jump + ";\n checkTimeAfter -= " + e.items.length + ";\n break;\n"); }), (l += " default: ectx.isEndOfActions = true; break;\n}\n}\nreturn stack.pop();};"), (u += "\n// hoisted vars\n"), o.forward)) u += "var " + h + " = " + o.forward[h] + ";\n"; (l = (u += "\n") + s + l), (l += "//# sourceURL=http://jit/" + (e && !Ym.test(e) ? e : a)); try { return new Function("calls", "res", l)(Km(), i); } catch (t) { throw t; } }), t ); })(); function Zm(t, e, n, r, i) { if (hg.value) try { throw new Error(t); } catch (t) {} pg.value && ip.warning.apply(console, arguments); } var ty, ey = 1e3; !(function (t) { (t[(t.DEFAULT = 0)] = "DEFAULT"), (t[(t.TARGET = 1)] = "TARGET"), (t[(t.REPLACE_TARGET = 2)] = "REPLACE_TARGET"); })(ty || (ty = {})); var ny = (function () { return function (t, e) { (this.scope = t), (this.previousScopeItem = e), (this.flags = ty.DEFAULT); }; })(), ry = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( r.alSetOwnProperty("this", new Af(71, n)), r.alSetOwnProperty("_global", new Af(71, e.globals)), r ); } return e(n, t), n; })(vf), iy = (function () { function t(t, e, n, r, i) { (this.previousFrame = t), (this.currentThis = e), (this.fn = n), (this.args = r), (this.ectx = i), (this.inSequence = !!t && t.calleeThis === e && t.calleeFn === n), this.resetCallee(); } return ( (t.prototype.setCallee = function (t, e, n, r) { (this.calleeThis = t), (this.calleeSuper = e), (this.calleeFn = n); }), (t.prototype.resetCallee = function () { (this.calleeThis = null), (this.calleeSuper = null), (this.calleeFn = null); }), t ); })(), oy = (function () { function t(t) { this._context = t; } return ( (t.prototype.hasProperty = function (t, e) { return (function (t, e, n) { var r = am(t, e); return (n = t.normalizeName(n)), r.alHasProperty(n); })(this._context, t, e); }), (t.prototype.getProperty = function (t, e) { return py(this._context, t, e); }), (t.prototype.setProperty = function (t, e, n) { return dy(this._context, t, e, n); }), (t.prototype.warn = function (t) { Zm.apply(null, arguments); }), t ); })(), ay = (function (t) { function n(e) { var n = t.call(this, e) || this; return ( (n.globals = I_.createGlobalsObject(n)), (n.actions = new E_(n)), (n.initialScope = new ny(n.globals, null)), (n.utils = new oy(n)), (n.isActive = !1), (n.executionProhibited = !1), (n.actionTracer = cg.value ? new Bv() : null), (n.abortExecutionAt = 0), (n.stackDepth = 0), (n.frame = null), (n.isTryCatchListening = !1), (n.errorsIgnored = 0), (n.deferScriptExecution = !0), n ); } return ( e(n, t), (n.prototype._getExecutionContext = function () { return this.frame.ectx; }), (n.prototype.resolveTarget = function (t) { return Ly(this._getExecutionContext(), t, !0); }), (n.prototype.resolveRoot = function () { return Ny(this._getExecutionContext()); }), (n.prototype.checkTimeout = function () { Date.now(), this.abortExecutionAt; }), (n.prototype.pushCallFrame = function (t, e, n, r) { var i = new iy(this.frame, t, e, n, r); return (this.frame = i), i; }), (n.prototype.popCallFrame = function () { var t = this.frame.previousFrame; return (this.frame = t), t; }), (n.prototype.executeActions = function (t, e) { if (!this.executionProhibited) { var n, r = this.isActive; r || ((this.isActive = !0), (this.abortExecutionAt = dg.value ? Number.MAX_VALUE : Date.now() + 1e3), (this.errorsIgnored = 0)); try { !(function (t, e, n) { t.actionTracer; var r, i = new ny(new ry(t, n), t.initialScope), o = new ny(n, i); o.flags |= ty.TARGET; var a = Cy.create(t, o, [], 4); t.pushCallFrame(n, null, null, a); try { Ov(a, e); } catch (t) { r = _y(t); } a.dispose(), r instanceof uy && ((t.executionProhibited = !0), console.error("Disabling AVM1 execution")); if ((t.popCallFrame(), r)) throw r; })(this, t, e); } catch (t) { n = t; } (this.isActive = r), n && console.error("error in framescripts", n); } }), (n.prototype.executeFunction = function (t, e, n) { if (!this.executionProhibited) { var r, i, o = this.isActive; o || ((this.isActive = !0), (this.abortExecutionAt = dg.value ? Number.MAX_VALUE : Date.now() + 1e3), (this.errorsIgnored = 0)); try { i = t.alCall(e, n); } catch (t) { r = t; } if (((this.isActive = o), r)) throw r; return i; } }), n ); })(Um); Um.create = function (t) { return new ay(t); }; var sy = (function () { return function (t) { this.error = t; }; })(), uy = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return (r.error = n), r; } return e(n, t), n; })(Error); function ly(t, e, n) { var r = tm(0, e), i = tm(0, n); if ("string" == typeof r && "string" == typeof i) return om(t, r) < om(t, i); var o = nm(t, r), a = nm(t, i); return isNaN(o) || isNaN(a) ? void 0 : o < a; } function cy(t, e, n) { if (typeof e == typeof n) { if ("number" == typeof e) { var r = Math.abs(e), i = Math.abs(n), o = 1e-6 * (r > i ? r : i); return Math.abs(e - n) <= o; } return e === n; } return ( (null == e && null == n) || ("number" == typeof e && "string" == typeof n ? "" !== n && e === +n : "string" == typeof e && "number" == typeof n ? "" !== e && +e === n : "boolean" == typeof e && ((e = +e), "number" == typeof n || "string" == typeof n) ? "" !== n && e === +n : "boolean" == typeof n && ((n = +n), "number" == typeof e || "string" == typeof e) ? "" !== e && +e === n : ("number" != typeof e && "string" != typeof e) || "object" != typeof n || null === n ? "object" == typeof e && null !== e && ("number" == typeof n || "string" == typeof n) && "object" != typeof (e = tm(0, e)) && cy(t, e, n) : "object" != typeof (n = tm(0, n)) && cy(t, e, n)) ); } function hy(t, e) { if (Wh(t) || Wh(e)) return !1; var n = e.alGetPrototypeProperty(); if (!n) return !1; for (var r = t; r; ) { if (r === n) return !0; r = r.alPrototype; } return !1; } function py(t, e, n) { var r = am(t, e); if (r) return r.alGet(n); } function dy(t, e, n, r) { var i = am(t, e); if (i) if ("__proto__" == n) { if (r) { for (var o = r.alGetKeys(), a = 0; a < o.length; a++) { var s = o[a]; "" != s && (i.alPut(s, r.alGet(s)), gy(t, s, i)); } i.protoTypeChanged = !(r instanceof Bg); } } else i.alPut(n, r), i.adaptee && gy(t, n, i); } function fy(t, e, n) { var r = am(t, e); n = t.normalizeName(n); var i = r.alDeleteProperty(n); return gy(t, n, r), i; } function gy(t, e, n) { void 0 !== e && ((e = lm(t, e)), "o" === (e = t.normalizeName(e))[0] && "n" === e[1] && n && n.updateEventByPropName && n.updateEventByPropName(e)); } function _y(t) { return "undefined" != typeof InternalError && t instanceof InternalError && "too much recursion" === t.message ? new uy("long running script -- AVM1 recursion limit is reached") : t; } function my(t, e) { if (dm(t)) return t.alConstruct(e); } function yy(t, e, n) { "boolean" != typeof t && "string" != typeof t && "number" != typeof t && pm( t, function (r) { var i, o; if ("string" != typeof r || -1 == r.indexOf("_internal_TF")) { var a = t.alGet(r); ((null === (o = null === (i = a) || void 0 === i ? void 0 : i.adaptee) || void 0 === o ? void 0 : o.isAsset(bh)) && a.adaptee.isStatic) || e.call(n, r); } }, n ); } function Ay(t, e, n) { if (t.swfVersion < 6) return null; var r = e.inSequence && e.previousFrame.calleeSuper; if (!r) { for (r = e.currentThis; r && !r.alHasOwnProperty(n); ) r = r.alPrototype; if (!r) return null; } return (r = r.alPrototype); } var vy = (function (t) { function n(e, n) { var r = t.call(this, e) || this; return ( (r.callFrame = n), (r.alPrototype = e.builtins.Object.alGetPrototypeProperty()), r ); } return e(n, t), n; })(vf), by = (function (t) { function n(e, n, r, i) { var o = t.call(this, e, n) || this; return Am(o, { callee: { value: r }, caller: { value: i } }), o; } return e(n, t), n; })(U_), Cy = (function () { function t(t, e, n, r) { (this.framescriptmanager = bu), (this.context = t), (this.actions = t.actions), (this.isSwfVersion5 = t.swfVersion >= 5), (this.isSwfVersion7 = t.swfVersion >= 7), (this.registers = []), (this.stack = []), (this.frame = null), (this.recoveringFromError = !1), (this.isEndOfActions = !1), this.reset(e, n, r); } return ( (t.alInitStatic = function () { this.cache = []; }), (t.prototype.reset = function (t, e, n) { (this.scopeList = t), (this.constantPool = e), (this.registers.length = n); }), (t.prototype.clean = function () { (this.scopeList = null), (this.constantPool = null), (this.registers.length = 0), (this.stack.length = 0), (this.frame = null), (this.recoveringFromError = !1), (this.isEndOfActions = !1); }), (t.prototype.pushScope = function (t) { var e = Object.create(this); return (e.stack = []), Wh(t) || (e.scopeList = t), e; }), (t.prototype.dispose = function () { this.clean(); var e = this.context.getStaticState(t); e.cache.length < t.MAX_CACHED_EXECUTIONCONTEXTS && e.cache.push(this); }), (t.create = function (e, n, r, i) { var o, a = e.getStaticState(t); return ( a.cache.length > 0 ? (o = a.cache.pop()).reset(n, r, i) : (o = new t(e, n, r, i)), o ); }), (t.MAX_CACHED_EXECUTIONCONTEXTS = 20), t ); })(), Iy = (function (t) { function n(e) { var n = t.call(this, e) || this; return n.alPut("toString", new J_(e, n._toString)), n; } return ( e(n, t), (n.prototype._toString = function () { return this; }), n ); })(vf), Ey = (function (t) { function n(e, n, r, i, o, a, s, u) { var l = t.call(this, e) || this; (l.functionName = i), (l.actionsData = r), (l.parametersNames = o), (l.registersAllocation = s), (l.suppressArguments = u), (l.scopeList = n.scopeList), (l.constantPool = n.constantPool); for (var c = null, h = s ? s.length : 0, p = 0; p < h; p++) { var d = s[p]; d && 1 === d.type && (c || (c = []), (c[s[p].index] = !0)); } l.skipArguments = c; var f = Math.min(a, 255); return (f = Math.max(f, h + 1)), (l.registersLength = f), l; } return ( e(n, t), (n.prototype.alCall = function (t, e) { var n, r, i = this.context; if (!i.executionProhibited) { var o = new Iy(i), a = new ny(o, this.scopeList), s = this.scopeList.scope; e = e || []; var u, l, c = Cy.create(i, a, this.constantPool, this.registersLength), h = i.frame ? i.frame.fn : void 0, p = i.pushCallFrame(t, this, e, c), d = this.suppressArguments; 4 & d || o.alPut("arguments", new by(i, e, this, h)), 2 & d || o.alPut("this", t), 8 & d || ((u = new vy(i, p)), o.alPut("super", u)); var f = c.registers, g = this.registersAllocation, _ = g ? g.length : 0; for (l = 0; l < _; l++) { var m = g[l]; if (m) switch (m.type) { case 1: f[l] = e[m.index]; break; case 2: f[l] = t; break; case 4: f[l] = new by(i, e, this, h); break; case 8: (u = u || new vy(i, p)), (f[l] = u); break; case 16: f[l] = i.globals; break; case 32: var y = null; if ( (s && ((y = s.alGet("_parent")) || ((y = s.alGet("this")) && (y = y.alGet("_parent")))), !y && ((y = t) && (y = y.alGet("_parent")), y && this.isOnEnter && y.alGet("_parent") && (y = y.alGet("_parent")), !y && (null === (r = null === (n = this.scopeList) || void 0 === n ? void 0 : n.previousScopeItem) || void 0 === r ? void 0 : r.scope))) ) for (var A = this.scopeList.previousScopeItem; A; ) A.scope && A.scope instanceof Bg ? (y = A.scope) : A.scope && (y = A.scope.alGet("this")), y && (y = y.alGet("_parent")), (A = A.previousScopeItem ? A.previousScopeItem : null); y && (f[l] = y); break; case 64: f[l] = Ny(c); } } var v, b, C = this.parametersNames, I = this.skipArguments; for (l = 0; l < e.length || l < C.length; l++) (I && I[l]) || o.alPut(C[l], e[l]); i.actionTracer; var E = this.actionsData; if (++i.stackDepth >= 256) throw new uy( "long running script -- AVM1 recursion limit is reached" ); try { v = Ov(c, E); } catch (t) { b = t; } if ((i.stackDepth--, i.popCallFrame(), c.dispose(), b)) throw b; return v; } }), n ); })($_); function xy(t, e) { return isNaN(t) || t < 0 ? (Zm("Invalid amount of arguments: " + t), 0) : (t |= 0) > e ? (Zm("Truncating amount of arguments: from " + t + " to " + e), e) : t; } function wy(t) { var e = +t.pop(); e = xy(e, t.length); for (var n = [], r = 0; r < e; r++) n.push(t.pop()); return n; } function Sy(t, e) { var n = null; if (e) { if ("string" == typeof e) for (; e.length && "." == e[e.length - 1]; ) e = e.substring(0, e.length - 1); try { Py((n = Ly(t, e, !1))) || (Zm("Invalid AVM1 target object: " + e), (n = void 0)); } catch (t) { Zm("Unable to set target: " + t); } } n ? ((t.scopeList.flags |= ty.REPLACE_TARGET), (t.scopeList.replaceTargetBy = n)) : ((t.scopeList.flags &= ~ty.REPLACE_TARGET), (t.scopeList.replaceTargetBy = null)); } function Dy(t, e, n, r, i, o, a) { return new Ey(t.context, t, e, n, r, i, o, a); } var Ty = { scope: null, propertyName: null, value: void 0 }; function Py(t) { return t instanceof vf && bm(t); } function Oy(t, e, n, r) { var i; void 0 === r && (r = null); for (var o = Ty, a = t; a; a = a.previousScopeItem) { if ( (!(a.flags & ty.REPLACE_TARGET) || 64 & n || i || (i = a.replaceTargetBy), a.flags & ty.TARGET) ) { if (2 & n) return ( (o.scope = i || a.scope), (o.propertyName = e), (o.value = 32 & n ? o.scope.alGet(e) : void 0), o ); if (1 & n && i) { if (i.alHasProperty(e)) return ( (o.scope = i), (o.propertyName = e), (o.value = 32 & n ? i.alGet(e) : void 0), o ); continue; } } if (a.scope.alHasProperty(e)) { var s = a.scope.alGet(e); if ( r && (!s || "object" != typeof s || !s.alHasProperty || !s.alHasProperty(r)) ) continue; return ( (o.scope = a.scope), (o.propertyName = e), (o.value = 32 & n ? a.scope.alGet(e) : void 0), o ); } } } function By(t, e, n) { var r, i, o, a = e.length, s = 0, u = !0, l = null, c = null, h = void 0, p = e; if ( !(function (t) { return ( t && (t.indexOf(".") >= 0 || t.indexOf(":") >= 0 || t.indexOf("/") >= 0) ); })(e) ) return "string" == typeof (e = t.context.normalizeName(e)) && e.startsWith("_level") ? (((r = Ty).scope = c), (r.propertyName = e), (r.value = t.context.resolveLevel(+e[6])), r) : Oy(t.scopeList, e, n); if ("." == e[e.length - 1]) return null; if ( ("/" === e[0] ? ((r = Oy(t.scopeList, "_root", 33)) && ((l = r.propertyName), (c = r.scope), (h = r.value)), s++, (o = !1)) : ((r = null), (o = !0)), s >= a) ) return r; for (var d = s; s < a; ) { if (!(o || h instanceof vf)) return ( Zm( "Unable to resolve variable on invalid object " + e.substring(d, s - 1) + " (expr " + e + ")" ), null ); if (((d = s), "." === e[s] && "." === e[s + 1])) (s += 2), (l = "_parent"); else { for (; s < a && "/" !== (i = e[s]) && "." !== i && ":" !== i; ) s++; l = e.substring(d, s); } if ("" === l && s < a) s++; else { c = h; var f = !1; if (u) { var g = h instanceof Bg ? h._lookupChildByName(l) : void 0; g && ((f = !0), (h = g)); } if (!f) if (o) { d = s + 1; var _ = s + 1, m = ""; if ("." === e[_] && "." === e[_ + 1]) (_ += 2), (m = "_parent"); else { for (; _ < a && "/" !== (i = e[_]) && "." !== i && ":" !== i; ) _++; m = e.substring(d, _); } "" == m && (m = null), !(r = Oy(t.scopeList, l, n, m)) && m && (r = Oy(t.scopeList, l, n)), r && ((f = !0), (l = r.propertyName), (c = r.scope), (h = r.value), s < a && !h && c && (h = c)), (o = !1); } else h.alHasProperty(l) && ((h = h.alGet(l)), (f = !0)); if ( (f || "_" !== l[0] || (l.startsWith("_level") ? ((h = t.context.resolveLevel(+l[6])), (f = !0)) : "_root" === l && ((h = Ny(t)), (f = !0))), !(f || 2 & n)) ) return ( Zm( "Unable to resolve " + l + " on " + e.substring(d, s - 1) + " (expr " + e + ")" ), null ); if (s >= a) break; var y = e[s++]; "/" !== y || (":" !== (i = e[s]) && "." !== i) || (y = e[s++]), (u = "/" === y); } } return ( ((r = Ty).scope = c), (r.propertyName = p.substring(d, s)), (r.value = 32 & n ? h : void 0), r ); } function My(t, e) { for (var n = t.scopeList; n.previousScopeItem; n = n.previousScopeItem) { if (n.flags & ty.REPLACE_TARGET && e) return n.replaceTargetBy; if (n.flags & ty.TARGET) return n.scope; } } function Ly(t, e, n) { var r; if (Py(e)) r = e; else if ((e = Wh(e) ? "" : om(this, e))) { var i = om(t.context, e), o = By(t, i, 161 | (n ? 0 : 64)); o && Py(o.value) ? (r = o.value) : (Zm("Invalid AVM1 target object: " + i), (r = void 0)); } else r = My(t, !0); return r; } function Ny(t) { return My(t, !0).get_root(); } function Ry(t, e) { var n = e[0]; e[1] ? t.actions.gotoAndPlay(n + 1) : t.actions.gotoAndStop(n + 1); } function Fy(t, e) { var n = e[0], r = e[1]; t.actions.getURL(n, r); } function ky(t) { t.actions.nextFrame(); } function Uy(t) { t.actions.prevFrame(); } function jy(t) { t.actions.play(); } function Vy(t) { t.actions.stop(); } function Qy(t) { t.actions.toggleHighQuality(); } function Gy(t) { t.actions.stopAllSounds(); } function zy(t, e) { var n = e[0]; return !t.actions.ifFrameLoaded(n); } function Hy(t, e) { Sy(t, e[0]); } function Xy(t, e) { var n = e[0]; e[1] ? t.actions.gotoAndPlay(n) : t.actions.gotoAndStop(n); } function Yy(t, e) { var n = t.registers, r = t.constantPool, i = t.stack; e.forEach(function (t) { if (t instanceof zm) i.push(r[t.constantIndex]); else if (t instanceof Gm) { var e = t.registerNumber; e < 0 || e >= n.length ? i.push(void 0) : i.push(n[e]); } else i.push(t); }); } function qy(t) { t.stack.pop(); } function Ky(t) { var e = t.stack, n = nm(t.context, e.pop()), r = nm(t.context, e.pop()); t.isSwfVersion7 || (void 0 === n && (n = 0), void 0 === r && (r = 0)), isFinite(n) && isFinite(r) ? null == r ? e.push(NaN) : e.push(n + r) : n === -1 / 0 && r === -1 / 0 ? e.push(-1 / 0) : isNaN(n) || isNaN(r) ? e.push(NaN) : n === r ? e.push(1 / 0) : isFinite(n) || isFinite(r) ? isFinite(n) ? isFinite(r) || e.push(r) : e.push(n) : e.push(NaN); } function Wy(t) { var e = t.stack, n = e.pop(), r = e.pop(); (n = nm(t.context, n)), (r = nm(t.context, r)), t.isSwfVersion7 || (null == n && (n = 0), null == r && (r = 0)), isFinite(n) && isFinite(r) ? e.push(r - n) : isNaN(n) || isNaN(r) || n === r ? e.push(NaN) : isFinite(n) ? isFinite(r) || e.push(r) : n === -1 / 0 ? e.push(1 / 0) : e.push(-1 / 0); } function Jy(t) { var e = t.stack, n = e.pop(); n = "\n" === n ? NaN : nm(t.context, n); var r = e.pop(); (r = "\n" === r ? NaN : nm(t.context, r)), t.isSwfVersion7 || ((null != n && void 0 !== n) || (n = 0), (null != r && void 0 !== r) || (r = 0)), isFinite(n) && isFinite(r) ? e.push(n * r) : isNaN(n) || isNaN(r) ? e.push(NaN) : n === r ? e.push(1 / 0) : isFinite(n) || isFinite(r) ? isFinite(n) ? isFinite(r) || (0 == n ? e.push(NaN) : r >= 0 ? n >= 0 ? e.push(1 / 0) : e.push(-1 / 0) : n >= 0 ? e.push(-1 / 0) : e.push(1 / 0)) : 0 == r ? e.push(NaN) : n >= 0 ? r >= 0 ? e.push(1 / 0) : e.push(-1 / 0) : r >= 0 ? e.push(-1 / 0) : e.push(1 / 0) : e.push(-1 / 0); } function $y(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = typeof (n = Number.isNaN(+n) ? n : +n), o = typeof (r = Number.isNaN(+r) ? r : +r); t.isSwfVersion7 || ((null !== n && "undefined" !== i) || ((n = 0), (i = "number")), (null !== r && "undefined" !== o) || ((r = 0), (o = "number"))), "object" === i || "object" === o || "string" === i || "string" === o || "undefined" === i || "undefined" === o || isNaN(n) || isNaN(r) ? e.push(NaN) : ((n = "boolean" === i ? +n : nm(t.context, n)), (r = "boolean" === o ? +r : nm(t.context, r)), !isFinite(n) || !isFinite(r) || (0 == n && 0 == r) ? (0 == n && 0 == r) || (!isFinite(n) && !isFinite(r)) ? e.push(NaN) : 0 == n ? e.push(r) : 0 == r ? e.push(0) : isFinite(r) ? isFinite(n) || (isNaN(n) ? e.push(n) : e.push(0)) : r >= 0 ? n >= 0 ? e.push(1 / 0) : e.push(-1 / 0) : n >= 0 ? e.push(-1 / 0) : e.push(1 / 0) : 0 == n ? e.push(r > 0 ? 1 / 0 : -1 / 0) : e.push(r / n)); } function Zy(t) { var e = t.stack, n = t.isSwfVersion5, r = nm(t.context, e.pop()), i = nm(t.context, e.pop()), o = Math.abs(r), a = Math.abs(i), s = 1e-6 * (o > a ? o : a), u = Math.abs(r - i) <= s; e.push(n ? u : u ? 1 : 0); } function tA(t) { var e = t.stack, n = t.isSwfVersion5, r = nm(t.context, e.pop()), i = nm(t.context, e.pop()) < r; e.push(n ? i : i ? 1 : 0); } function eA(t) { var e = t.stack, n = t.isSwfVersion5, r = em(t.context, e.pop()), i = em(t.context, e.pop()), o = r && i; e.push(n ? o : o ? 1 : 0); } function nA(t) { var e = t.stack, n = t.isSwfVersion5, r = em(t.context, e.pop()), i = em(t.context, e.pop()), o = r || i; e.push(n ? o : o ? 1 : 0); } function rA(t) { var e = t.context, n = t.stack, r = !em(e, n.pop()); n.push( (function (t, e) { return t.swfVersion >= 5 ? !!e : +e; })(e, r) ); } function iA(t) { var e = t.stack, n = t.isSwfVersion5, r = om(t.context, e.pop()) == om(t.context, e.pop()); e.push(n ? r : r ? 1 : 0); } function oA(t) { var e = t.stack, n = om(t.context, e.pop()); e.push(t.actions.length_(n)); } function aA(t) { var e = t.stack, n = om(t.context, e.pop()); e.push(t.actions.length_(n)); } function sA(t) { var e = t.stack, n = om(t.context, e.pop()), r = om(t.context, e.pop()); e.push(r + n); } function uA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = om(t.context, e.pop()); e.push(t.actions.substring(i, r, n)); } function lA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = om(t.context, e.pop()); e.push(t.actions.mbsubstring(i, r, n)); } function cA(t) { var e = t.stack, n = t.isSwfVersion5, r = om(t.context, e.pop()), i = om(t.context, e.pop()) < r; e.push(n ? i : i ? 1 : 0); } function hA(t) { var e = t.stack, n = im(t.context, e.pop()); e.push(n); } function pA(t) { var e = t.stack, n = e.pop(), r = t.actions.ord(n); e.push(r); } function dA(t) { var e = t.stack, n = e.pop(), r = t.actions.mbord(n); e.push(r); } function fA(t) { var e = t.stack, n = +e.pop(), r = t.actions.chr(n); e.push(r); } function gA(t) { var e = t.stack, n = +e.pop(), r = t.actions.mbchr(n); e.push(r); } function _A(t, e) {} function mA(t, e) { return !!t.stack.pop(); } function yA(t) { var e = t.stack.pop(); t.actions.call(e); } function AA(t) { var e = t.stack, n = e.pop(); n && (n = om(t.context, n)); var r = e.length; e.push(void 0); var i = By(t, "__get__" + n, 33); if (i && i.value) { var o = RA(t, i.scope, i.propertyName, []), a = o.result; if (o.called) return void (e[r] = a); } var s = By(t, n, 33); Wh(s) ? "TRUE" == n ? (e[r] = !0) : "FALSE" == n ? (e[r] = !1) : n && 0 == n.indexOf("this.") ? ((s = By(t, (n = n.replace("this.", "")), 33)), (e[r] = s ? s.value : void 0)) : pg.value && Zm("AVM1 warning: cannot look up variable '" + n + "'") : (e[r] = s ? s.value : void 0); } function vA(t) { var e = t.stack, n = e.pop(), r = "" + e.pop(), i = By(t, "__set__" + r, 33); if (i && i.value && RA(t, i.scope, i.propertyName, [n]).called) return; var o = By(t, r, 2); o ? (o.scope.alPut(o.propertyName, n), gy(t.context, o.propertyName, o.scope)) : pg.value && Zm("AVM1 warning: cannot look up variable '" + r + "'"); } function bA(t, e) { var n, r = t.stack, i = e[0], o = r.pop(), a = r.pop(); 1 & i ? (n = "GET") : 2 & i && (n = "POST"); var s = 64 & i; 128 & i ? t.actions.loadVariables(a, o, n) : s ? t.actions.loadMovie(a, o, n) : t.actions.getURL(a, o, n); } function CA(t, e) { var n = t.stack, r = e[0], i = [n.pop()]; 2 & r && i.push(e[1]), (1 & r ? t.actions.gotoAndPlay : t.actions.gotoAndStop).apply( t.actions, i ); } function IA(t) { var e = t.stack; Sy(t, om(t.context, e.pop())); } function EA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = e.length; e.push(void 0); var o = Ly(t, r, !0), a = zf[n]; o && a && (e[i] = o.alGet(a)); } function xA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = Ly(t, e.pop(), !0), o = zf[r]; i && o && i.alPut(o, n); } function wA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = e.pop(); t.actions.duplicateMovieClip(i, r, n); } function SA(t) { var e = t.stack.pop(); t.actions.removeMovieClip(e); } function DA(t) { var e = t.stack, n = t.actions.startDrag, r = e.pop(), i = e.pop(); if (!!e.pop()) { var o = e.pop(), a = e.pop(), s = e.pop(), u = e.pop(); n.call(t.actions, r, i, u, s, a, o); } else n.call(t.actions, r, i); } function TA(t) { t.actions.stopDrag(); } function PA(t, e) { var n = t.stack.pop(); return !t.actions.ifFrameLoaded(n); } function OA(t) { var e = t.stack.pop(); t.actions.trace(e); } function BA(t) { t.stack.push(t.actions.getTimer()); } function MA(t) { var e = t.stack; e.push(t.actions.random(e.pop())); } function LA(t) { var e = t.stack, n = e.pop(); _m(t.context, n) && (n = n.value.join(".")); var r = wy(e), i = e.length; e.push(void 0); var o = By(t, n, 33); if (Wh(o)) Zm("AVM1 warning: cannot look up function '" + n + "'"); else { var a = o.value; dm(a) ? ("array" == n.toLowerCase() && (r = [r]), (e[i] = a.alCall(o.scope || null, r))) : Zm( "AVM1 warning: function '" + n + (a ? "' is not callable" : "' is undefined") ); } } function NA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = wy(e), o = e.length; e.push(void 0); var a = RA(t, r, n, i); a.called && (e[o] = a.result); } function RA(t, e, n, r) { if (Wh(e)) return ( Zm( "AVM1 warning: method '" + n + "' can't be called on undefined object" ), { called: !1, result: void 0 } ); var i, o, a, s, u = t.context.frame, l = !1; if (Wh(n) || "" === n) { if (e instanceof vy) { var c = e.callFrame; (i = Ay(t.context, c, "__constructor__")) && ((o = i.alGet("__constructor__")), (a = c.currentThis)); } else (o = e), (a = e); return ( dm(o) ? (u.setCallee(a, i, o, r), (s = o.alCall(a, r)), (l = !0), u.resetCallee()) : Zm( "AVM1 warning: obj '" + e + (e ? "' is not callable" : "' is undefined") ), { result: s, called: l } ); } if (e instanceof vy) { c = e.callFrame; (i = Ay(t.context, c, n)) && ((o = i.alGet(n)), (a = c.currentThis)); } else (o = py(t.context, e, n)), (a = am(t.context, e)); return dm(o) ? (u.setCallee(a, i, o, r), "toString" == n && "number" == typeof e ? 1 == r.length && 16 == r[0] ? (s = e.toString(16)) : ((s = om(t.context, e)), (l = !0)) : ((s = o.alCall(a, r)), (l = !0)), u.resetCallee(), { result: s, called: l }) : ("function" == typeof o ? ((s = o(r)), (l = !0)) : Zm( "AVM1 warning: method '" + n + "' on object", e, Wh(o) ? "is undefined" : "is not callable" ), { result: s, called: l }); } function FA(t, e) { var n = e[0]; t.constantPool = n; } function kA(t, e) { var n = t.stack, r = e[0], i = e[1], o = Dy(t, r, i, e[2], 4, null, 0); if (i) { var a = t.scopeList.scope; a.alPut(i, o), gy(t.context, i, a); } else n.push(o); } function UA(t) { var e = t.stack, n = t.scopeList.scope, r = e.pop(), i = e.pop(); n.alPut(i, r); } function jA(t) { var e = t.stack, n = t.scopeList.scope, r = e.pop(); n.alHasProperty(r) || n.alPut(r, void 0); } function VA(t) { var e = t.stack, n = e.pop(), r = e.pop(); Wh(r) ? Zm("AVM1 warning: cannot delete member '" + n + "' on undefined object") : e.push(fy(t.context, r, n)); } function QA(t) { var e = t.stack, n = e.pop(), r = By(t, n, 1); if (Wh(r)) Zm("AVM1 warning: cannot look up variable '" + n + "'"); else { var i = r.scope.alGetProperty(n); (i && i.value && i.value.adaptee) || e.push(fy(t.context, r.scope, n)); } } function GA(t) { var e = t.stack, n = e.pop(); e.push(null); var r = By(t, n, 33); if (Wh(r)) Zm("AVM1 warning: cannot look up variable '" + n + "'"); else { var i = r.value; Wh(i) ? Zm("AVM1 warning: cannot iterate over undefined object") : yy( i, function (t) { e.push(t); }, null ); } } function zA(t) { var e = t.stack, n = e.pop(), r = e.pop(); e.push(cy(t.context, n, r)); } function HA(t, e) { for ( var n = t.stack, r = e ? e[1] : n.pop(), i = e ? e[0] : n.pop(), o = e ? e.length - 1 : 1, a = void 0, s = 0; s < o; ) { if (null == i) return ( Zm("AVM1 warning: cannot get member '" + r + "' on undefined object"), (n[n.length] = void 0) ); if (i instanceof vy) { var u = i.callFrame, l = Ay(t.context, u, r); l && (a = l.alGet(r)); } else a = py(t.context, i, r); if (s === o - 1) return (n[n.length] = a); (i = a), (r = e[s + 2]), s++; } return (n[n.length] = a); } function XA(t) { var e = t.stack, n = new U_(t.context, wy(e)); e.push(n); } function YA(t) { var e = t.stack, n = +e.pop(); n = xy(n, e.length >> 1); for (var r = sm(t.context), i = 0; i < n; i++) { var o = e.pop(), a = e.pop(); r.alPut(a, o); } e.push(r); } function qA(t) { var e = t.stack, n = e.pop(), r = e.pop(), i = wy(e), o = e.length; if ((e.push(void 0), Wh(r))) Zm( "AVM1 warning: method '" + n + "' can't be constructed on undefined object" ); else { var a = my(Wh(n) || "" === n ? r : py(t.context, r, n), i); void 0 === a && Zm( "AVM1 warning: method '" + n + "' on object", r, "is not constructible" ), (e[o] = a); } } function KA(t) { var e = t.stack, n = e.pop(), r = wy(e), i = e.length; e.push(void 0); var o = By(t, n, 33); if (Wh(o)) Zm("AVM1 warning: cannot look up object '" + n + "'"); else { var a = o.value, s = (function (t, e, n) { var r = t.builtins, i = void 0; if ( ((e !== r.Array && e !== r.Object && e !== r.Date && e !== r.String && e !== r.Function) || (i = e.alConstruct(n)), (e !== r.Boolean && e !== r.Number) || (i = e.alConstruct(n).value), i instanceof vf) ) { var o = new Af(65, e); i.alSetOwnProperty("__constructor__", o); } return i; })(t.context, a, r); void 0 === s && void 0 === (s = my(a, r)) && Zm( "AVM1 warning: object '" + n + (a ? "' is not constructible" : "' is undefined") ), (e[i] = s); } } function WA(t, e) { var n = t.stack, r = e ? e[2] : n.pop(), i = e ? e[1] : n.pop(), o = e ? e[0] : n.pop(); Wh(o) ? Zm("AVM1 warning: cannot set member '" + i + "' on undefined object") : o instanceof vy ? Zm("AVM1 warning: cannot set member '" + i + "' on super") : void 0 !== i && dy(t.context, o, i, r); } function JA(t) { var e = t.stack, n = e.pop(); e.push( (function (t) { return "object" == typeof t && t && t instanceof Bg; })(n) ? n._target : void 0 ); } function $A(t, e) { var n = t.stack, r = e[0]; !(function (t, e, n) { if (Wh(e)) Zm("The with statement object cannot be undefined."); else { var r = t.context, i = t.scopeList, o = new ny(am(r, e), i); Ov(t.pushScope(o), n); } })(t, n.pop(), r); } function ZA(t) { var e = t.stack; e.push(nm(t.context, e.pop())); } function tv(t) { var e = t.stack; e.push(om(t.context, e.pop())); } function ev(t) { var e = t.stack, n = (function (t) { if (null === t) return "null"; if ("object" == typeof t) { if (t instanceof Bg) return "movieclip"; if (t instanceof bf) return "function"; } return typeof t; })(e.pop()); e.push(n); } function nv(t, e, n) { var r = t.stack; arguments.length > 1 ? ((n = tm(t.context, n)), (e = tm(t.context, e))) : ((n = tm(t.context, r.pop())), (e = tm(t.context, r.pop()))); var i = typeof e, o = typeof n, a = "string" === i, s = "string" === o; return a && s ? (r[r.length] = e + n) : a || s ? (r[r.length] = (a ? e : om(t.context, e)) + (s ? n : om(t.context, n))) : (t.isSwfVersion7 || ((null !== e && "undefined" !== i) || (e = 0), (null !== n && "undefined" !== o) || (n = 0)), null == n || null == e ? r.push(NaN) : isFinite(e) && isFinite(n) ? r.push(e + n) : e === -1 / 0 && n === -1 / 0 ? r.push(-1 / 0) : isNaN(e) || isNaN(n) ? r.push(NaN) : e === n ? r.push(1 / 0) : isFinite(e) || isFinite(n) ? isFinite(e) ? isFinite(n) || r.push(n) : r.push(e) : r.push(NaN), r[r.length - 1]); } function rv(t) { var e = t.stack, n = e.pop(), r = e.pop(); e.push(ly(t.context, r, n)); } function iv(t) { var e = t.stack, n = e.pop(), r = e.pop(); t.isSwfVersion7 || (void 0 === n && (n = 0), void 0 === r && (r = 0)), (n = nm(t.context, n)), (r = nm(t.context, r)), !isFinite(n) || !isFinite(r) || (0 == n && 0 == r) ? isNaN(n) || isNaN(r) || (!isFinite(n) && !isFinite(r)) || isFinite(n) ? e.push(NaN) : e.push(r) : e.push(r % n); } function ov(t) { var e = t.stack, n = im(t.context, e.pop()), r = im(t.context, e.pop()); e.push(r & n); } function av(t) { var e = t.stack, n = im(t.context, e.pop()), r = im(t.context, e.pop()); e.push(r << n); } function sv(t) { var e = t.stack, n = im(t.context, e.pop()), r = im(t.context, e.pop()); e.push(r | n); } function uv(t) { var e = t.stack, n = im(t.context, e.pop()), r = im(t.context, e.pop()); e.push(r >> n); } function lv(t) { var e = t.stack, n = im(t.context, e.pop()), r = im(t.context, e.pop()); e.push(r >>> n); } function cv(t) { var e = t.stack, n = im(t.context, e.pop()), r = im(t.context, e.pop()); e.push(r ^ n); } function hv(t) { var e = t.stack, n = nm(t.context, e.pop()); n--, e.push(n); } function pv(t) { var e = t.stack, n = nm(t.context, e.pop()); n++, e.push(n); } function dv(t) { var e = t.stack; e.push(e[e.length - 1]); } function fv(t) { t.isEndOfActions = !0; } function gv(t) { var e = t.stack; e.push(e.pop(), e.pop()); } function _v(t, e) { var n = t.stack, r = t.registers, i = e[0]; i < 0 || i >= r.length || (r[i] = n[n.length - 1]); } function mv(t) { var e = t.stack, n = e.pop(), r = e.pop(); e.push(hy(r, n)); } function yv(t) { var e = t.stack, n = e.pop(); e.push(null), Wh(n) ? Zm("AVM1 warning: cannot iterate over undefined object") : yy( n, function (t) { e.push(t); }, null ); } function Av(t) { var e = t.stack, n = e.pop(), r = e.pop(); e.push(r === n); } function vv(t, e) { var n = t.stack, r = e ? e[1] : n.pop(), i = e ? e[0] : n.pop(); return (n[n.length] = ly(t.context, r, i)); } function bv(t) { var e = t.stack, n = t.isSwfVersion5, r = om(t.context, e.pop()), i = om(t.context, e.pop()) > r; e.push(n ? i : i ? 1 : 0); } function Cv(t, e) { var n = t.stack, r = t.scopeList.scope, i = e[0], o = e[1], a = Dy(t, i, o, e[2], e[3], e[4], e[5]); o ? (r.alPut(o, a), gy(t.context, o, r)) : n.push(a); } function Iv(t) { var e = t.stack, n = t.context, r = am(n, e.pop()), i = am(n, e.pop()).alGetPrototypeProperty(), o = r.alGetPrototypeProperty(); i.alPrototype = o; var a = new Af(65, r); i.alSetOwnProperty("__constructor__", a); } function Ev(t) { var e = t.stack, n = e.pop(), r = e.pop(); e.push(hy(n, r) ? n : null); } function xv(t) { var e = t.stack, n = e.pop(), r = +e.pop(); xy(r, e.length); for (var i = [], o = 0; o < r; o++) i.push(e.pop()); n._as2Interfaces = i; } function wv(t, e) { e[0]; var n = e[1], r = e[2], i = e[3], o = e[4]; !(function (t, e, n, r, i, o, a, s) { var u, l = t.context, c = t.scopeList, h = t.registers, p = l.isTryCatchListening; try { (l.isTryCatchListening = !0), Ov(t.pushScope(), o); } catch (e) { (l.isTryCatchListening = p), r && e instanceof sy ? ("string" == typeof i ? c.scope.alPut(i, e.error) : (h[i] = e.error), Ov(t.pushScope(), a)) : (u = e); } if (((l.isTryCatchListening = p), n && Ov(t.pushScope(), s), u)) throw u; })(t, 0, e[5], i, n, r, o, e[6]); } function Sv(t) { var e = t.stack.pop(); throw new sy(e); } function Dv(t) { var e = t.stack, n = wy(e), r = e.length; e.push(void 0); var i = t.actions.fscommand.apply(t.actions, n); e[r] = i; } function Tv(t, e) {} function Pv(t, e) { var n, r; try { (r = (function (t, e) { t.stack; var n = e.actionCode, r = e.args; t.context.actionTracer; var i = !1; switch (0 | n) { case 129: Ry(t, r); break; case 131: Fy(t, r); break; case 4: ky(t); break; case 5: Uy(t); break; case 6: jy(t); break; case 7: Vy(t); break; case 8: Qy(t); break; case 9: Gy(t); break; case 138: i = zy(t, r); break; case 139: Hy(t, r); break; case 140: Xy(t, r); break; case 150: Yy(t, r); break; case 23: qy(t); break; case 10: Ky(t); break; case 11: Wy(t); break; case 12: Jy(t); break; case 13: $y(t); break; case 14: Zy(t); break; case 15: tA(t); break; case 16: eA(t); break; case 17: nA(t); break; case 18: rA(t); break; case 19: iA(t); break; case 20: oA(t); break; case 49: aA(t); break; case 33: sA(t); break; case 21: uA(t); break; case 53: lA(t); break; case 41: cA(t); break; case 24: hA(t); break; case 50: pA(t); break; case 54: dA(t); break; case 51: fA(t); break; case 55: gA(t); break; case 153: break; case 157: i = mA(t); break; case 158: yA(t); break; case 28: AA(t); break; case 29: vA(t); break; case 154: bA(t, r); break; case 159: CA(t, r); break; case 32: IA(t); break; case 34: EA(t); break; case 35: xA(t); break; case 36: wA(t); break; case 37: SA(t); break; case 39: DA(t); break; case 40: TA(t); break; case 141: i = PA(t); break; case 38: OA(t); break; case 52: BA(t); break; case 48: MA(t); break; case 61: LA(t); break; case 82: NA(t); break; case 136: FA(t, r); break; case 155: kA(t, r); break; case 60: UA(t); break; case 65: jA(t); break; case 58: VA(t); break; case 59: QA(t); break; case 70: GA(t); break; case 73: zA(t); break; case 78: HA(t); break; case 66: XA(t); break; case 67: YA(t); break; case 83: qA(t); break; case 64: KA(t); break; case 79: WA(t); break; case 69: JA(t); break; case 148: $A(t, r); break; case 74: ZA(t); break; case 75: tv(t); break; case 68: ev(t); break; case 71: nv(t); break; case 72: rv(t); break; case 63: iv(t); break; case 96: ov(t); break; case 99: av(t); break; case 97: sv(t); break; case 100: uv(t); break; case 101: lv(t); break; case 98: cv(t); break; case 81: hv(t); break; case 80: pv(t); break; case 76: dv(t); break; case 62: fv(t); break; case 77: gv(t); break; case 135: _v(t, r); break; case 84: mv(t); break; case 85: yv(t); break; case 102: Av(t); break; case 103: vv(t); break; case 104: bv(t); break; case 142: Cv(t, r); break; case 105: Iv(t); break; case 43: Ev(t); break; case 44: xv(t); break; case 143: wv(t, r); break; case 42: Sv(t); break; case 45: Dv(t); break; case 137: break; case 0: t.isEndOfActions = !0; break; default: throw new Error("Unknown action code: " + n); } return i; })(t, e)), (t.recoveringFromError = !1); } catch (e) { n = t.context; var i = _y(e); if ((hg.value && !n.isTryCatchListening) || i instanceof uy) throw i; if (i instanceof sy) throw i; if ( (nf.instance.reportTelemetry({ topic: "error", error: 1 }), !t.recoveringFromError) ) { if (n.errorsIgnored++ >= 1e3) throw new uy("long running script -- AVM1 errors limit is reached"); console.error("AVM1 error: " + e), (t.recoveringFromError = !0); } } return r; } function Ov(t, e) { e.ir || e.compiled || (function (t, e) { var n, r = t.context, i = new Hm(e, r.swfVersion), o = new jm(); (o.registersLimit = t.registers.length), (o.parentResults = e.parent && e.parent.ir); var a = o.analyze(i); (e.ir = a), fg.value && ((n = new $m().generate(a, e.debugPath)), (e.compiled = n)); })(t, e); var n = t.context, r = t.scopeList.scope.adaptee; r && r._deferScriptExecution && (n.deferScriptExecution = !0), r && (Bg.currentMCAssetNameSpace = r.assetNamespace); var i = e.compiled; if (i) return i(t); for ( var o = 0, a = n.abortExecutionAt, s = e.ir, u = 0, l = s.actions[u]; l && !t.isEndOfActions; ) { if (o++ % ey == 0 && Date.now() >= a) throw new uy("long running script -- AVM1 instruction hang timeout"); (u = Pv(t, l.action) ? l.conditionalJumpTo : l.next), (l = s.actions[u]); } return t.stack.pop(); } var Bv = (function () { function t() { (this._indentation = 0), (this._indentStringCache = []); } return ( (t.prototype._getIndentString = function () { return ( this._indentStringCache[this._indentation] || (this._indentStringCache[this._indentation] = new Array( this._indentation + 1 ).join("..")) ); }), (t.prototype.print = function (t, e) { for ( var n = t.position, r = t.actionCode, i = t.actionName, o = [], a = 0; a < e.length; a++ ) { var s = e[a]; if (s && "object" == typeof s) { var u = s.alGetConstructorProperty(); o.push("[" + (u ? u.name : "Object") + "]"); } else o.push(s); } console.log( "AVM1 trace: " + this._getIndentString() + n + ": " + i + "(" + r.toString(16) + "), stack=" + o ); }), (t.prototype.indent = function () { this._indentation++; }), (t.prototype.unindent = function () { this._indentation--; }), (t.prototype.message = function (t) { console.log("AVM1 trace: ------- " + t); }), t ); })(), Mv = (function () { function t() {} return ( (t.CDATA_NODE = 100), (t.COMMENT_NODE = 101), (t.DOCUMENT_TYPE_NODE = 102), (t.ELEMENT_NODE = 1), (t.PROCESSING_INSTRUCTION_NODE = 103), (t.TEXT_NODE = 3), (t.XML_DECLARATION = 104), t ); })(), Lv = (function (t) { function n(e) { return t.call(this, Mv.DOCUMENT_TYPE_NODE, "null") || this; } return ( e(n, t), (n.prototype.axCallPublicProperty = function (t, e) { return null; }), (n.prototype.axGetPublicProperty = function (t) { return null; }), (n.prototype.axSetPublicProperty = function (t, e) { return null; }), (n.prototype.createElement = function (t) { return ( console.log( "createElement not implemented yet in flash/XMLDocument" ), null ); }), (n.prototype.createTextNode = function (t) { return ( console.log( "createTextNode not implemented yet in flash/XMLDocument" ), null ); }), (n.prototype.parseXML = function (t) { console.log("parseXML not implemented yet in flash/XMLDocument"); }), (n.prototype.toString = function () { return ( console.log("toString not implemented yet in flash/XMLDocument"), "" ); }), n ); })(i_), Nv = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype._getLevelForRoot = function (t) { return 0; }), (n.prototype._getRootForLevel = function (t) { return null; }), (n.prototype._addRoot = function (t, e) {}), (n.prototype._removeRoot = function (t) {}), n ); })(eu), Rv = (function () { return function () {}; })(), Fv = (function () { return function () {}; })(), kv = (function () { return function () {}; })(), Uv = (function () { return function () {}; })(), jv = (function () { return function () {}; })(), Vv = (function () { return function () {}; })(), Qv = (function () { return function () {}; })(), Gv = (function () { return function () {}; })(), zv = (function () { return function () {}; })(), Hv = (function () { return function () {}; })(), Xv = (function () { return function () { (this.flash = { display: { AVM1Movie: Nv, Stage: Qf }, events: { Event: Event, KeyboardEvent: KeyboardEvent, MouseEvent: MouseEvent, ProgressEvent: ProgressEvent, }, external: { ExternalInterface: Vv }, filters: {}, system: { Capabilities: jv, Security: Uv, fscommand: kv }, ui: { ContextMenu: Rv, ContextMenuItem: Fv, Mouse: Qv }, media: { SoundChannel: Gv, SoundTransform: zv, SoundMixer: Hv }, xml: { XMLDocument: Lv }, }), (this.player = {}); }; })(), Yv = (function () { function t() { (this.avmVersion = "AVM1"), (this.enterEvent = new l("enterFrame")), (this.exitEvent = new l("exitFrame")), (this.avm1Listener = {}), (this._collectedDispatcher = []); } return ( Object.defineProperty(t.prototype, "factory", { get: function () { if (!this._factory) throw "AVM1Handler - no factory set"; return this._factory; }, enumerable: !0, configurable: !0, }), (t.prototype.init = function (t, e, n) { var r = this; if (((bu.useAVM1 = !0), this._avmStage)) n(!1); else { (this._avmStage = t), (this._avmStage.mouseManager.eventBubbling = !1), (this._factory = new Rm(new ay(e.swfVersion))), (this._factory.avm1Context.sec = new Xv()), this._factory.avm1Context.setStage( this._avmStage, this, document ), (this._factory.avm1Context.swfVersion = e.swfVersion), (this._avmStage.scaleMode = Rp.SHOW_ALL), (this._avmStage.align = Fp.TOP), (I_.tracelevel = C_.ALL), (I_._scenegraphFactory = this._factory), pt.enableParser(Wd), (this._factory.avm1Context.globals.SWF_BASE_URL = e.url.substring( 0, e.url.lastIndexOf("/") + 1 )), this.clearAllAVM1Listener(); var i = this._avmStage.view.stage; i.addEventListener(vu.MOUSE_DOWN, function (t) { return r.onMouseEvent(t); }), i.addEventListener(vu.MOUSE_UP, function (t) { return r.onMouseEvent(t); }), i.addEventListener(vu.MOUSE_MOVE, function (t) { return r.onMouseEvent(t); }), i.addEventListener(Xc.KEYDOWN, function (t) { return r.onKeyEvent(t); }), i.addEventListener(Xc.KEYUP, function (t) { return r.onKeyEvent(t); }), this._avmStage.avmTestHandler && ((this._factory.avm1Context.actions.originalTrace = this._factory.avm1Context.actions.trace), (this._factory.avm1Context.actions.trace = function (t) { r._factory.avm1Context.actions.originalTrace(t), r._avmStage.avmTestHandler.addMessage(t); })), n(!0); } }), (t.prototype.executeEnterFrame = function (t, e) { for (var n, r = t.numChildren; r > 0; ) r--, (n = t.getChildAt(r)), this.executeEnterFrame(n, e); t.isAsset(Cu) && t.hasEventListener(this.enterEvent.type) && e.push(t); }), (t.prototype.enterFrame = function (t) { bu.execute_queue(), this._avmStage.root.advanceFrame(); for (var e = [], n = 0; n < this._avmStage.root.numChildren; n++) { var r = this._avmStage.root.getChildAt(n); this.executeEnterFrame(r, e); } for (n = 0; n < e.length; n++) e[n].dispatchEvent(this.enterEvent); mg.CompleteEventRegistering(), bu.execute_queue(), bu.execute_intervals(t), bu.execute_queue(); for (n = 0; n < this._avmStage.root.numChildren; n++) { (r = this._avmStage.root.getChildAt(n)).isAsset(Cu) && r.dispatchExitFrame(this.exitEvent); } bu.execute_queue(); }), (t.prototype.onKeyEvent = function (t) { if (this.avm1Listener[t.type]) { this._collectedDispatcher.length = 0; var e, n = 0; for (n = 0; n < this._avmStage.root.numChildren; n++) (e = this._avmStage.root.getChildAt(n)).isAsset(Cu) && this.collectMousEvents(e); for (n = 0; n < this._collectedDispatcher.length; n++) if ( this.avm1Listener[t.type] && this.avm1Listener[t.type][this._collectedDispatcher[n].id] ) for ( var r = this.avm1Listener[t.type][ this._collectedDispatcher[n].id ], i = 0; i < r.length; i++ ) ("number" == typeof r[i].keyCode && r[i].keyCode != t.keyCode) || r[i].callback(); bu.execute_queue(); } }), (t.prototype.addAVM1EventListener = function (t, e, n, r) { this.avm1Listener[e] || (this.avm1Listener[e] = {}), this.avm1Listener[e][t.id] || (this.avm1Listener[e][t.id] = []); var i = this.avm1Listener[e][t.id]; i.push({ type: e, callback: n }), r && "number" == typeof r.keyCode && (i[i.length - 1].keyCode = r.keyCode); }), (t.prototype.removeAVM1EventListener = function (t, e, n) { this.avm1Listener[e] && delete this.avm1Listener[e][t.id]; }), (t.prototype.clearAllAVM1Listener = function () { this.avm1Listener = {}; }), (t.prototype.collectMousEvents = function (t) { for (var e, n = t.numChildren; n > 0; ) n--, (e = t.getChildAt(n)), this.collectMousEvents(e); t.isAsset(Cu) && (this._collectedDispatcher[this._collectedDispatcher.length] = t); }), (t.prototype.onMouseEvent = function (t) { if (this.avm1Listener[t.type]) { this._collectedDispatcher.length = 0; var e, n, r = 0, i = this._avmStage.root.numChildren; for (r = 0; r < i; r++) (e = this._avmStage.root.getChildAt(r)).isAsset(Cu) && this.collectMousEvents(e); for (i = this._collectedDispatcher.length, r = 0; r < i; r++) { var o = this.avm1Listener[t.type]; if (o && o[this._collectedDispatcher[r].id]) { n = o[this._collectedDispatcher[r].id].length; for (var a = 0; a < n; a++) { var s = o[this._collectedDispatcher[r].id]; s && s[a] && s[a].callback(); } } } bu.execute_queue(); } }), (t.prototype.dispose = function () {}), (t.prototype.resizeStage = function () {}), (t.prototype.addAsset = function (t, e) { if (t.isAsset(Cu) && e && t.isAVMScene) { var n = Sm(t.clone(), this._factory.avm1Context); this._factory.avm1Context.globals._addRoot(0, n.adaptee); } }), t ); })(); console.debug("AwayFL - AVM1 - 0.2.131"); var qv = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.createAVM1Class = function (t) { return Tm( t, !0, n, [ "init", "isAdBlocked", "gameLoadingStart", "gameLoadingFinished", "commercialBreak", "gameplayStart", "gameplayStop", ], [], null, n.prototype.avm1Constructor ); }), (n.prototype.avm1Constructor = function () {}), (n.init = function (t, e, r) { var i = function (t) {}; if ( (null != e && null != r && (i = function (t) { var n = e.alGet(r.toLowerCase()); n && dm(n) ? n.alCall(e, [t]) : n && n.value && n.value.alCall(e, [t]); }), n.usePokiSDK) ) { if (!PokiSDK || !PokiSDK.hasOwnProperty("adBlocked")) throw "POKISDK is not available"; i(PokiSDK.adBlocked); } else i(!0); }), (n.isAdBlocked = function () { if (!n.usePokiSDK) return !0; if (!PokiSDK.hasOwnProperty("adBlocked")) throw "AS2 is trying to use the PokiSDK before it has been init"; return PokiSDK.adBlocked; }), (n.gameLoadingStart = function () { if (n.usePokiSDK) { if (!PokiSDK.hasOwnProperty("adBlocked")) throw "AS2 is trying to use the PokiSDK before it has been init"; PokiSDK.gameLoadingStart(); } }), (n.gameLoadingFinished = function () { if (n.usePokiSDK) { if (!PokiSDK.hasOwnProperty("adBlocked")) throw "AS2 is trying to use the PokiSDK before it has been init"; PokiSDK.gameLoadingFinished(); } }), (n.gameplayStart = function () { if (n.usePokiSDK) { if (!PokiSDK.hasOwnProperty("adBlocked")) throw "AS2 is trying to use the PokiSDK before it has been init"; PokiSDK.gameplayStart(); } }), (n.gameplayStop = function () { if (n.usePokiSDK) { if (!PokiSDK.hasOwnProperty("adBlocked")) throw "AS2 is trying to use the PokiSDK before it has been init"; PokiSDK.gameplayStop(); } }), (n.commercialBreak = function (t, e, r) { var i = function () {}; if ( (null != e && null != r && (i = function () { r.alCall(e); }), n.usePokiSDK) ) { if (!PokiSDK.hasOwnProperty("adBlocked")) throw "AS2 is trying to use the PokiSDK before it has been init"; I.setVolume(0), PokiSDK.commercialBreak().then(function () { I.setVolume(1), i(); }); } else i(); }), (n.happyTime = function (t, e) { PokiSDK.happyTime(e); }), (n.usePokiSDK = !0), n ); })(vf), Kv = (function () { return function (t) { window.initPokiBridge = function (e) { flash.Ready(), (t && !window.pokiAdBlock) || flash.AdBlocked(), (window.commercialBreak = function () { t ? (ef.instance().pause(), PokiSDK.commercialBreak().then(function () { ef.instance().unPause(), flash.commercialBreakCompleted(); })) : flash.commercialBreakCompleted(); }), (window.rewardedBreak = function () { t ? (ef.instance().pause(), PokiSDK.rewardedBreak().then(function (t) { ef.instance().unPause(), flash.rewardedBreakCompleted(t); })) : flash.rewardedBreakCompleted(!0); }); }; }; })(); var Wv = {}, Jv = [ "Public", "Protected", "PackageInternal", "Private", "Explicit", "StaticProtected", ]; var $v = new Uint8Array(100), Zv = (function () { function t(t, e, n) { (this.type = t), (this.uri = e), (this.prefix = n), (this.mangledName = null), Po(void 0 !== t), this.mangleName(); } return ( (t.prototype.toString = function () { return ( (t = this.type), String(t) + ("" !== this.uri ? ":" + this.uri : "") ); var t; }), (t._hashNamespace = function (e, n, r) { (n += ""), (r += ""); var i = t._knownNames.indexOf(n); if (i >= 0) return (e << 2) | i; var o = 1 + n.length + r.length, a = o < 101 ? $v : new Uint8Array(o), s = 0; a[s++] = e; for (var u = 0; u < n.length; u++) a[s++] = n.charCodeAt(u); for (u = 0; u < r.length; u++) a[s++] = r.charCodeAt(u); return _f.hashBytesTo32BitsMD5(a, 0, s); }), (t.prototype.mangleName = function () { if (0 !== this.type || "" !== this.uri) { var e = t._hashNamespace(this.type, this.uri, this.prefix); this.mangledName = Uh.variableLengthEncodeInt32(e); } else this.mangledName = "Bg"; }), (t.prototype.isPublic = function () { return 0 === this.type; }), Object.defineProperty(t.prototype, "reflectedURI", { get: function () { return this.uri || (0 === this.type ? null : this.uri); }, enumerable: !0, configurable: !0, }), (t._knownNames = [""]), t ); })(); function tb(t, e) { var n = t + e; return Wv[n] || (Wv[n] = new Zv(t, e, "")); } function eb(t, e, n) { var r = t + e + n, i = Wv[r]; return i || (i = Wv[r] = new Zv(t, e, n)), i; } function nb(t) { return "string" == typeof t ? t : null == t ? null : t + ""; } var rb = "primitive", ib = !0, ob = "http://", ab = !0, sb = !0, ub = (function () { function t(e, n, r, i, o, a, s) { void 0 === a && (a = null), void 0 === s && (s = !1), (this.abc = e), (this.index = n), (this.kind = r), (this.namespaces = i), (this.name = o), (this.parameterType = a), (this.mutable = s), (this.id = t._nextID++), (this._mangledName = null), (this.script = null), (this.numeric = !1), (this.numericValue = 0), (this.resolved = {}), (this._scope = null), (this._value = null), (this._key = null); } return ( (t.prototype.set = function (t, e) { var n = "number" == typeof t || ("string" == typeof t && !t.includes(".") && Number.isInteger(+t)); (this.namespaces = e ? [e] : []), (this.name = t), (this.numeric = !1), n && ((this.numericValue = +t), (this.numeric = !0)); }), (t.prototype.drop = function () { this.mutable && this.isRuntimeName && ((this.numeric = !1), (this.name = void 0), (this.namespaces = []), (this.numericValue = NaN), (this.resolved = {}), (this._scope = null)); }), Object.defineProperty(t.prototype, "scope", { get: function () { return this._scope && t._isWeak ? this._scope.deref() : this._scope; }, set: function (e) { t._isWeak && e ? (this._scope = new self.WeakRef(e)) : (this._scope = e); }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "value", { get: function () { return this._value && t._isWeak ? this._value.deref() : this._value; }, set: function (e) { t._isWeak && e ? (this._value = new self.WeakRef(e)) : (this._value = e); }, enumerable: !0, configurable: !0, }), (t.prototype.key = function () { if (this._key) return this._key; var t = this.toString(); return this.mutable || (this._key = t), t; }), (t.FromFQNString = function (e, n) { var r = e.lastIndexOf("."), i = -1 === r ? "" : e.substr(0, r), o = -1 === r ? e : e.substr(r + 1); return new t(null, 0, 15, [tb(n, i)], o); }), (t.prototype._nameToString = function () { return this.isAnyName() ? "*" : this.isRuntimeName() ? "[" + this.name + "]" : this.name; }), (t.prototype.isRuntime = function () { switch (this.kind) { case 7: case 13: case 9: case 14: return !1; } return !0; }), (t.prototype.isRuntimeName = function () { switch (this.kind) { case 17: case 18: case 27: case 28: return !0; } return !1; }), (t.prototype.isRuntimeNamespace = function () { return this.kind >= 15 && this.kind <= 18; }), (t.prototype.isAnyName = function () { return null === this.name; }), (t.prototype.isAnyNamespace = function () { return ( !(this.isRuntimeNamespace() || this.namespaces.length > 1) && (0 === this.namespaces.length || "" === this.namespaces[0].uri) ); }), (t.prototype.isQName = function () { var t = this.kind; return 29 === t || 7 === t || 13 === t || (t >= 15 && t <= 18); }), Object.defineProperty(t.prototype, "namespace", { get: function () { return this.namespaces[0]; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "uri", { get: function () { return this.namespaces[0].uri; }, enumerable: !0, configurable: !0, }), Object.defineProperty(t.prototype, "prefix", { get: function () { return this.namespaces[0].prefix; }, set: function (t) { var e = this.namespaces[0]; e.prefix !== t && (this.namespaces[0] = eb(e.type, e.uri, t)); }, enumerable: !0, configurable: !0, }), (t.prototype.equalsQName = function (t) { return ( this.name === t.name && this.namespaces[0].uri === t.namespaces[0].uri ); }), (t.prototype.matches = function (t) { var e = t.isAnyName(); if (e && !t.isQName()) return !0; if (!e && this.name !== t.name) return !1; var n = this.namespaces[0].uri; if ("" == n || "default" == n) return !0; for (var r = t.namespaces.length; r--; ) if ("" == t.namespaces[r].uri || t.namespaces[r].uri === n) return !0; return !1; }), (t.prototype.isAttribute = function () { switch (this.kind) { case 13: case 16: case 18: case 14: case 28: return !0; } return !1; }), (t.prototype.getMangledName = function () { return this._mangledName || this._mangleName(); }), (t.prototype._mangleName = function () { var t = "$Bg" + nb(this.name); return this.isRuntime() || (this._mangledName = t), t; }), (t.prototype.getPublicMangledName = function () { return qh(this.name) ? this.name : "$Bg" + nb(this.name); }), (t.isPublicQualifiedName = function (t) { return 0 === t.indexOf("$Bg"); }), (t.getPublicMangledName = function (t) { return qh(t) ? t : "$Bg" + t; }), (t.prototype.toFQNString = function (t) { var e = this.namespaces[0].uri; return e.length && (e += t ? "::" : "."), e + this.name; }), (t.prototype.toString = function () { var t, e = ((t = this.kind), String(t) + " "); ((e += this.isAttribute() ? "@" : ""), this.isRuntimeNamespace()) ? (e += "[" + (this.namespaces ? this.namespaces .map(function (t) { return String(t); }) .join(", ") : null) + "]::" + this._nameToString()) : this.isQName() ? ((e += this.namespaces[0] + "::"), (e += this._nameToString())) : this.namespaces ? ((e += "{" + this.namespaces .map(function (t) { return String(t); }) .join(", ") + "}"), (e += "::" + this._nameToString())) : ((e += "{" + this.namespaces + "}"), (e += "::" + this._nameToString())); return this.parameterType && (e += "<" + this.parameterType + ">"), e; }), (t.prototype.toFlashlogString = function () { var t = this.uri; return t ? t + "::" + this.name : this.name; }), (t.stripPublicMangledName = function (t) { if (0 === t.indexOf("$Bg")) return t.substring(3); }), (t.FromSimpleName = function (e) { var n, r = ""; "string" != typeof e && 1 === (null === (n = e._children) || void 0 === n ? void 0 : n.length) ? (e = e._children[0]._value || "") : (r = e); var i = r.lastIndexOf("::"); i > 0 ? (r = r.replace("::", ":")) : (i = r.lastIndexOf(".")); var o = "", a = r; return ( i > 0 && i < r.length - 1 && ((a = r.substring(i + 1).trim()), (o = r.substring(0, i).trim())), new t(null, 0, 15, [tb(0, o)], a) ); }), (t._isWeak = self.WeakRef && sb), (t._nextID = 1), t ); })(); function lb(t, e, n) { cf(t, e, t.sec.AXFunction.axBox(n)); } function cb(t) { return this.classInfo.instanceInfo.getInterfaces(this.axClass).has(t); } var hb = (function () { function t(t, e, n) { (this.superTraits = t), (this.protectedNs = e), (this.protectedNsMappings = n), (this.slots = []), (this._nextSlotID = 1), (this.multinames = {}); var r = (this._traits = Object.create(null)); if (t) { var i = t._traits; for (var o in i) r[o] = Object.create(i[o]); } } return ( (t.prototype.addTrait = function (t) { var e = t.name, n = this._traits[e.name]; n || (n = this._traits[e.name] = Object.create(null)); var r = e.namespaces[0].mangledName, i = n[r]; return (n[r] = t), i; }), (t.prototype.addSlotTrait = function (t) { var e = t.slot; e ? (this._nextSlotID = e + 1) : (e = t.slot = this._nextSlotID++), (this.slots[e] = t); }), (t.prototype.getTraitMultiname = function (t) { return t.mutable ? this.getTrait(t.namespaces, t.name) : this.multinames[t.id] || (this.multinames[t.id] = this.getTrait(t.namespaces, t.name)); }), (t.prototype.getTrait = function (t, e) { var n, r = this._traits[e]; if (!r) return null; for (var i = 0; i < t.length; i++) { var o = t[i]; if ((n = r[o.mangledName])) return n; if (1 === o.type) for (var a = this; a; ) { if (a.protectedNs === o && (n = a.protectedNsMappings[e])) return n; a = a.superTraits; } } return null; }), (t.prototype.getTraitsList = function () { var t = [], e = this._traits; for (var n in e) { var r = e[n]; for (var i in r) t.push(r[i]); } return t; }), (t.prototype.getSlotPublicTraitNames = function () { for (var t = this.slots, e = [], n = 1; n < t.length; n++) { var r = t[n]; r.name.namespace.isPublic() && e.push(r.name.name); } return e; }), (t.prototype.getSlot = function (t) { return this.slots[t]; }), t ); })(); function pb() { var t = this.hasOwnProperty("classInfo") ? "Object" : this.classInfo.instanceInfo.name.name; return Uh.concat3("[object ", t, "]"); } function db(t) { return ( null == t || "number" == typeof t || "string" == typeof t || "boolean" == typeof t ); } var fb = Symbol("AX class marker"); function gb() { return this.$BgtoString.axCall(this); } function _b() { return this; } function mb() { return this.$BgvalueOf.axCall(this); } var yb = cf, Ab = null; function vb(t) { return Ab.isPrototypeOf(t) || db(t); } function bb() { if (!Ab) { var t = Lb.prototype; (Ab = Object.create(null)), yb(Ab, "axHasPropertyInternal", t.axHasPropertyInternal), yb(Ab, "axHasProperty", t.axHasProperty), yb(Ab, "axSetProperty", t.axSetProperty), yb(Ab, "axHasProperty", t.axHasProperty), yb(Ab, "axHasPublicProperty", t.axHasPublicProperty), yb(Ab, "axSetPublicProperty", t.axSetPublicProperty), yb(Ab, "axGetPublicProperty", t.axGetPublicProperty), yb(Ab, "axCallPublicProperty", t.axCallPublicProperty), yb(Ab, "axDeletePublicProperty", t.axDeletePublicProperty), yb(Ab, "axGetProperty", t.axGetProperty), yb(Ab, "axDeleteProperty", t.axDeleteProperty), yb(Ab, "axGetSuper", t.axGetSuper), yb(Ab, "axSetSuper", t.axSetSuper), yb(Ab, "axSetSlot", t.axSetSlot), yb(Ab, "axGetSlot", t.axGetSlot), yb(Ab, "axCallProperty", t.axCallProperty), yb(Ab, "axCallSuper", t.axCallSuper), yb(Ab, "axConstructProperty", t.axConstructProperty), yb(Ab, "axResolveMultiname", t.axResolveMultiname), yb(Ab, "axNextNameIndex", t.axNextNameIndex), yb(Ab, "axNextName", t.axNextName), yb(Ab, "axNextValue", t.axNextValue), yb(Ab, "axGetEnumerableKeys", t.axGetEnumerableKeys), yb(Ab, "axImplementsInterface", cb), yb(Ab, "traits", new hb(null, null, Object.create(null))), yb(Ab, "isPrototypeOf", Object.prototype.isPrototypeOf), yb(Ab, "hasOwnProperty", Object.prototype.hasOwnProperty), yb(Ab, fb, !0), (Ab.$BgtoString = pb), (Ab.toString = gb), (Ab.$BgvalueOf = _b), (Ab.valueOf = mb); } } function Cb(t, e) { var n = new ub(null, 0, 17, [], null); return n.set(t, e || Zv.PUBLIC), n; } function Ib(t) { return Kh(t) ? t : "$Bg" + t; } function Eb(t) { return "string" == typeof t ? t : null == t ? "null" : t.toString(); } var xb = new ub(null, 0, 17, [], null, null, !0), wb = { NotImplementedError: { code: 1001, message: "The method %1 is not implemented.", }, InvalidPrecisionError: { code: 1002, message: "Number.toPrecision has a range of 1 to 21. Number.toFixed and Number.toExponential have a range of 0 to 20. Specified value is not within expected range.", }, InvalidRadixError: { code: 1003, message: "The radix argument must be between 2 and 36; got %1.", }, InvokeOnIncompatibleObjectError: { code: 1004, message: "Method %1 was invoked on an incompatible object.", }, ArrayIndexNotIntegerError: { code: 1005, message: "Array index is not a positive integer (%1).", }, CallOfNonFunctionError: { code: 1006, message: "%1 is not a function." }, ConstructOfNonFunctionError: { code: 1007, message: "Instantiation attempted on a non-constructor.", }, ConvertNullToObjectError: { code: 1009, message: "Cannot access a property or method of a null object reference.", }, ConvertUndefinedToObjectError: { code: 1010, message: "A term is undefined and has no properties.", }, ClassNotFoundError: { code: 1014, message: "Class %1 could not be found.", }, DescendentsError: { code: 1016, message: "Descendants operator (..) not supported on type %1.", }, StackOverflowError: { code: 1023, message: "Stack overflow occurred." }, CpoolIndexRangeError: { code: 1032, message: "Cpool index %1 is out of range %2.", }, CpoolEntryWrongTypeError: { code: 1033, message: "Cpool entry %1 is wrong type.", }, CheckTypeFailedError: { code: 1034, message: "Type Coercion failed: cannot convert %1 to %2.", }, CannotAssignToMethodError: { code: 1037, message: "Cannot assign to a method %1 on %2.", }, CantUseInstanceofOnNonObjectError: { code: 1040, message: "The right-hand side of instanceof must be a class or function.", }, IsTypeMustBeClassError: { code: 1041, message: "The right-hand side of operator must be a class.", }, InvalidMagicError: { code: 1042, message: "Not an ABC file. major_version=%1 minor_version=%2.", }, UnsupportedTraitsKindError: { code: 1045, message: "Unsupported traits kind=%1.", }, PrototypeTypeError: { code: 1049, message: "Prototype objects must be vanilla Objects.", }, ConvertToPrimitiveError: { code: 1050, message: "Cannot convert %1 to primitive.", }, InvalidURIError: { code: 1052, message: "Invalid URI passed to %1 function.", }, WriteSealedError: { code: 1056, message: "Cannot create property %1 on %2.", }, WrongArgumentCountError: { code: 1063, message: "Argument count mismatch on %1. Expected %2, got %3.", }, UndefinedVarError: { code: 1065, message: "Variable %1 is not defined." }, ReadSealedError: { code: 1069, message: "Property %1 not found on %2 and there is no default value.", }, ConstWriteError: { code: 1074, message: "Illegal write to read-only property %1 on %2.", }, XMLPrefixNotBound: { code: 1083, message: 'The prefix "%1" for element "%2" is not bound.', }, XMLUnterminatedElementTag: { code: 1085, message: 'The element type "%1" must be terminated by the matching end-tag "".', }, XMLOnlyWorksWithOneItemLists: { code: 1086, message: "The %1 method only works on lists containing one item.", }, XMLAssignmentToIndexedXMLNotAllowed: { code: 1087, message: "Assignment to indexed XML is not allowed.", }, XMLMarkupMustBeWellFormed: { code: 1088, message: "The markup in the document following the root element must be well-formed.", }, XMLAssigmentOneItemLists: { code: 1089, message: "Assignment to lists with more than one item is not supported.", }, XMLMalformedElement: { code: 1090, message: "XML parser failure: element is malformed.", }, XMLUnterminatedCData: { code: 1091, message: "XML parser failure: Unterminated CDATA section.", }, XMLUnterminatedXMLDecl: { code: 1092, message: "XML parser failure: Unterminated XML declaration.", }, XMLUnterminatedDocTypeDecl: { code: 1093, message: "XML parser failure: Unterminated DOCTYPE declaration.", }, XMLUnterminatedComment: { code: 1094, message: "XML parser failure: Unterminated comment.", }, XMLUnterminatedElement: { code: 1096, message: "XML parser failure: Unterminated element.", }, XMLNamespaceWithPrefixAndNoURI: { code: 1098, message: "Illegal prefix %1 for no namespace.", }, RegExpFlagsArgumentError: { code: 1100, message: "Cannot supply flags when constructing one RegExp from another.", }, InvalidBaseClassError: { code: 1108, message: "The OP_newclass opcode was used with the incorrect base class.", }, XMLInvalidName: { code: 1117, message: "Invalid XML name: %1." }, XMLIllegalCyclicalLoop: { code: 1118, message: "Illegal cyclical loop between nodes.", }, FilterError: { code: 1123, message: "Filter operator not supported on type %1.", }, OutOfRangeError: { code: 1125, message: "The index %1 is out of range %2.", }, VectorFixedError: { code: 1126, message: "Cannot change the length of a fixed Vector.", }, TypeAppOfNonParamType: { code: 1127, message: "Type application attempted on a non-parameterized type.", }, WrongTypeArgCountError: { code: 1128, message: "Incorrect number of type parameters for %1. Expected %2, got %3.", }, JSONCyclicStructure: { code: 1129, message: "Cyclic structure cannot be converted to JSON string.", }, JSONInvalidReplacer: { code: 1131, message: "Replacer argument to JSON stringifier must be an array or a two parameter function.", }, JSONInvalidParseInput: { code: 1132, message: "Invalid JSON parse input.", }, InvalidRangeError: { code: 1506, message: "The specified range is invalid.", }, NullArgumentError: { code: 1507, message: "Argument %1 cannot be null." }, InvalidArgumentError: { code: 1508, message: "The value specified for argument %1 is invalid.", }, ArrayFilterNonNullObjectError: { code: 1510, message: "When the callback argument is a method of a class, the optional this argument must be null.", }, InvalidParamError: { code: 2004, message: "One of the parameters is invalid.", }, ParamRangeError: { code: 2006, message: "The supplied index is out of bounds.", }, NullPointerError: { code: 2007, message: "Parameter %1 must be non-null.", }, InvalidEnumError: { code: 2008, message: "Parameter %1 must be one of the accepted values.", }, CantInstantiateError: { code: 2012, message: "%1 class cannot be instantiated.", }, InvalidBitmapData: { code: 2015, message: "Invalid BitmapData." }, EOFError: { code: 2030, message: "End of file was encountered.", fqn: "flash.errors.EOFError", }, CompressedDataError: { code: 2058, message: "There was an error decompressing the data.", fqn: "flash.errors.IOError", }, EmptyStringError: { code: 2085, message: "Parameter %1 must be non-empty string.", }, ProxyGetPropertyError: { code: 2088, message: "The Proxy class does not implement getProperty. It must be overridden by a subclass.", }, ProxySetPropertyError: { code: 2089, message: "The Proxy class does not implement setProperty. It must be overridden by a subclass.", }, ProxyCallPropertyError: { code: 2090, message: "The Proxy class does not implement callProperty. It must be overridden by a subclass.", }, ProxyHasPropertyError: { code: 2091, message: "The Proxy class does not implement hasProperty. It must be overridden by a subclass.", }, ProxyDeletePropertyError: { code: 2092, message: "The Proxy class does not implement deleteProperty. It must be overridden by a subclass.", }, ProxyGetDescendantsError: { code: 2093, message: "The Proxy class does not implement getDescendants. It must be overridden by a subclass.", }, ProxyNextNameIndexError: { code: 2105, message: "The Proxy class does not implement nextNameIndex. It must be overridden by a subclass.", }, ProxyNextNameError: { code: 2106, message: "The Proxy class does not implement nextName. It must be overridden by a subclass.", }, ProxyNextValueError: { code: 2107, message: "The Proxy class does not implement nextValue. It must be overridden by a subclass.", }, TooFewArgumentsError: { code: 2001, message: "Too few arguments were specified; got %1, %2 expected.", }, ParamTypeError: { code: 2005, message: "Parameter %1 is of the incorrect type. Should be type %2.", }, SocketConnectError: { code: 2011, message: "Socket connection failed to %1:%2.", }, CantAddSelfError: { code: 2024, message: "An object cannot be added as a child of itself.", }, NotAChildError: { code: 2025, message: "The supplied DisplayObject must be a child of the caller.", }, UnhandledError: { code: 2044, message: "Unhandled %1:." }, AllowDomainArgumentError: { code: 2052, message: "Only String arguments are permitted for allowDomain and allowInsecureDomain.", }, DelayRangeError: { code: 2066, message: "The Timer delay specified is out of range.", }, ExternalInterfaceNotAvailableError: { code: 2067, message: "The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.", }, InvalidLoaderMethodError: { code: 2069, message: "The Loader class does not implement this method.", }, InvalidStageMethodError: { code: 2071, message: "The Stage class does not implement this property or method.", }, TimelineObjectNameSealedError: { code: 2078, message: "The name property of a Timeline-placed object cannot be modified.", }, AlreadyConnectedError: { code: 2082, message: "Connect failed because the object is already connected.", }, CloseNotConnectedError: { code: 2083, message: "Close failed because the object is not connected.", }, ArgumentSizeError: { code: 2084, message: "The AMF encoding of the arguments cannot exceed 40K.", }, AsyncError: { code: 2095, message: "%1 was unable to invoke callback %2.", }, LoadingObjectNotSWFError: { code: 2098, message: "The loading object is not a .swf file, you cannot request SWF properties from it.", }, LoadingObjectNotInitializedError: { code: 2099, message: "The loading object is not sufficiently loaded to provide this information.", }, DecodeParamError: { code: 2101, message: "The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.", }, SceneNotFoundError: { code: 2108, message: "Scene %1 was not found." }, FrameLabelNotFoundError: { code: 2109, message: "Frame label %1 not found in scene %2.", }, InvalidLoaderInfoMethodError: { code: 2118, message: "The LoaderInfo class does not implement this method.", }, SecuritySwfNotAllowedError: { code: 2121, message: "Security sandbox violation: %1: %2 cannot access %3. This may be worked around by calling Security.allowDomain.", }, UnknownFileTypeError: { code: 2124, message: "Loaded file is an unknown type.", }, DefinitionNotFoundError: { code: 2131, message: "Definition %1 cannot be found.", }, CantAddParentError: { code: 2150, message: "An object cannot be added as a child to one of it's children (or children's children, etc.).", }, Matrix3DRefCannontBeShared: { code: 2189, message: "A Matrix3D can not be assigned to more than one DisplayObject.", }, ObjectWithStringsParamError: { code: 2196, message: "Parameter %1 must be an Object with only String values.", }, AllowCodeImportError: { code: 3226, message: "Cannot import a SWF file when LoaderContext.allowCodeImport is false.", }, PermissionDenied: { code: 3315, message: "The current security context does not allow this operation.", }, InternalErrorIV: { code: 3343, message: "Internal Error." }, }; for (var Sb in wb) { var Db = wb[Sb]; (Db.typeName = Sb), (wb[Db.code] = Db); } function Tb(t) { var e = "Error #" + t, n = wb[t]; return e + ": " + ((n && n.message) || "(unknown)"); } function Pb(t) { return wb[t]; } function Ob(t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; var r = t.message; return ( e.forEach(function (t, e) { r = r.replace("%" + (e + 1), t); }), "Error #" + t.code + ": " + r ); } function Bb(t, e, n) { (e && e.axApply) || t.throwError( "TypeError", wb.CallOfNonFunctionError, e && e.methodInfo ? e.methodInfo.getName() : "value" ), e.methodInfo && n < e.methodInfo.minArgs && t.throwError( "ArgumentError", wb.WrongArgumentCountError, e.methodInfo.getName(), e.methodInfo.minArgs, n ); } function Mb(t, e, n) { if (!e || !e.axConstruct) { var r = e && e.classInfo ? e.classInfo.instanceInfo.getName().name : "value"; t.throwError("TypeError", wb.ConstructOfNonFunctionError, r); } var i = e.classInfo.getInitializer(); n < i.minArgs && t.throwError( "ArgumentError", wb.WrongArgumentCountError, e.classInfo.instanceInfo.getName().name, i.minArgs, n ); } var Lb = (function () { function t() {} return ( (t.classInitializer = function () { var e = this.dPrototype, n = t.prototype; lb(e, "$BghasOwnProperty", n.native_hasOwnProperty), lb(e, "$BgpropertyIsEnumerable", n.native_propertyIsEnumerable), lb( e, "$BgsetPropertyIsEnumerable", n.native_setPropertyIsEnumerable ), lb(e, "$BgisPrototypeOf", n.native_isPrototypeOf), lb(e, "$BgtoLocaleString", n.toString); }), (t._init = function () {}), (t.init = function () {}), (t.prototype.native_isPrototypeOf = function (t) { return this.isPrototypeOf(this.sec.box(t)); }), (t.prototype.native_hasOwnProperty = function (t) { return this.axHasOwnProperty(Cb(t)); }), (t.prototype.native_propertyIsEnumerable = function (t) { var e = Object.getOwnPropertyDescriptor(this, Ib(nb(t))); return !!e && e.enumerable; }), (t.prototype.native_setPropertyIsEnumerable = function (t, e) { void 0 === e && (e = !0); var n = Ib(nb(t)); e = !!e; var r = this.axClass.classInfo.instanceInfo; r.isSealed() && this !== this.axClass.dPrototype && this.sec.throwError( "ReferenceError", wb.WriteSealedError, t, r.name.name ); var i = Object.getOwnPropertyDescriptor(this.axClass.tPrototype, n); (i && this !== this.axClass.dPrototype) || ((i = Object.getOwnPropertyDescriptor(this, n)) && i.enumerable !== e && ((i.enumerable = e), Object.defineProperty(this, n, i))); }), (t.prototype.axResolveMultiname = function (t) { if (t.numeric) return t.numericValue; var e = t.name; if (t.mutable) return (r = this.traits.getTrait(t.namespaces, e)) ? r.name.getMangledName() : "$Bg" + e; var n = t.resolved[this.axClassName]; if (n) return n; var r, i = (r = this.traits.getTraitMultiname(t)) ? r.name.getMangledName() : "$Bg" + e; return (t.resolved[this.axClassName] = i), i; }), (t.prototype.axHasProperty = function (t) { return this.axHasPropertyInternal(t); }), (t.prototype.axHasPublicProperty = function (t) { xb.set(t); var e = this.axHasProperty(xb); return xb.drop(), e; }), (t.prototype.axSetProperty = function (t, e, n) { var r = t.name; if ("number" == typeof r || qh((r = Eb(r)))) this[+r] = e; else { var i = !1, o = this.traits.getTrait(t.namespaces, r); if (o) { var a = o.name.getMangledName(); switch (o.kind) { case 1: this.sec.throwError( "ReferenceError", wb.CannotAssignToMethodError, r, this.axClass.name.name ); case 2: this.sec.throwError( "ReferenceError", wb.ConstWriteError, r, this.axClass.name.name ); case 4: case 6: 104 !== n && this.sec.throwError( "ReferenceError", wb.ConstWriteError, r, this.axClass.name.name ), (i = !0); } var s = o.getType(); s && (e = s.axCoerce(e)); } else a = "$Bg" + r; (this[a] = e), i && Object.defineProperty(this, a, { writable: !1 }); } }), (t.prototype.axGetProperty = function (t) { var e = this.axResolveMultiname(t), n = this[e]; return "function" == typeof n ? this.axGetMethod(e) : void 0 === n && "number" != typeof e ? this[t.name] : n; }), (t.prototype.axGetMethod = function (t) { var e = this._methodClosureCache; e || (Object.defineProperty(this, "_methodClosureCache", { value: Object.create(null), }), (e = this._methodClosureCache)); var n = e[t]; return ( n || (n = e[t] = this.sec.AXMethodClosure.Create(this, this[t])), n ); }), (t.prototype.axGetSuper = function (t, e) { var n, r = Eb(t.name), i = t.namespaces, o = e.parent.object.tPrototype.traits.getTrait(i, r); if (2 === o.kind || 7 === o.kind) n = o.get.call(this); else { var a = o.name.getMangledName(), s = e.parent.object.tPrototype[a]; if (s) return this.sec.AXMethodClosure.Create(this, s); } return n; }), (t.prototype.axSetSuper = function (t, e, n) { var r = Eb(t.name), i = t.namespaces, o = e.parent.object.tPrototype.traits.getTrait(i, r), a = o.getType(); a && (n = a.axCoerce(n)), 3 === o.kind || 7 === o.kind ? o.set.call(this, n) : (this[o.name.getMangledName()] = n); }), (t.prototype.axDeleteProperty = function (t) { var e = Eb(t.name), n = t.namespaces; return ( !this.traits.getTrait(n, e) && delete this[t.getPublicMangledName()] ); }), (t.prototype.axCallProperty = function (t, e, n) { var r = this[this.axResolveMultiname(t)]; return Bb(this.sec, r, e.length), r.axApply(n ? null : this, e); }), (t.prototype.axCallSuper = function (t, e, n) { var r = e.parent.object.tPrototype[this.axResolveMultiname(t)]; return Bb(this.sec, r, n.length), r.axApply(this, n); }), (t.prototype.axConstructProperty = function (t, e) { var n = this[this.axResolveMultiname(t)]; return Mb(this.sec, n, e.length), n.axConstruct(e); }), (t.prototype.axHasPropertyInternal = function (t) { return this.axResolveMultiname(t) in this; }), (t.prototype.axHasOwnProperty = function (t) { var e = this.axResolveMultiname(t); return ( this.hasOwnProperty(e) || this.axClass.tPrototype.hasOwnProperty(e) ); }), (t.prototype.axGetEnumerableKeys = function () { if (this.sec.isPrimitive(this)) return []; for ( var t = Object.getPrototypeOf(this), e = Object.keys(this), n = [], r = 0; r < e.length; r++ ) { var i = e[r]; if (qh(i)) n.push(i); else { if (t.hasOwnProperty(i)) continue; var o = ub.stripPublicMangledName(i); void 0 !== o && n.push(o); } } return n; }), (t.prototype.axGetPublicProperty = function (t) { return this[ub.getPublicMangledName(t)]; }), (t.prototype.axSetPublicProperty = function (t, e) { this[ub.getPublicMangledName(t)] = e; }), (t.prototype.axCallPublicProperty = function (t, e) { return this[ub.getPublicMangledName(t)].axApply(this, e); }), (t.prototype.axDeletePublicProperty = function (t) { return delete this[ub.getPublicMangledName(t)]; }), (t.prototype.axGetSlot = function (t) { return this[this.traits.getSlot(t).name.getMangledName()]; }), (t.prototype.axSetSlot = function (t, e) { var n = this.traits.getSlot(t), r = n.name.getMangledName(), i = n.getType(); this[r] = i ? i.axCoerce(e) : e; }), (t.prototype.axNextNameIndex = function (t) { var e = this; 0 === t && cf(e, "axEnumerableKeys", e.axGetEnumerableKeys()), xb.drop(); for (var n = e.axEnumerableKeys; t < n.length; ) { var r = n[t]; if ((xb.set(r), e.axHasPropertyInternal(xb))) return t + 1; t++; } return 0; }), (t.prototype.axNextName = function (t) { return this.axEnumerableKeys[t - 1]; }), (t.prototype.axNextValue = function (t) { return this.axGetPublicProperty(this.axNextName(t)); }), (t.prototype.axSetNumericProperty = function (t, e) { this.axSetPublicProperty(t, e); }), (t.prototype.axGetNumericProperty = function (t) { return this.axGetPublicProperty(t); }), (t.forceNativeConstructor = !1), (t.forceNativeMethods = !1), (t.classSymbols = null), (t.instanceSymbols = null), t ); })(), Nb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.axCoerce = function (t) { return t; }), Object.defineProperty(n.prototype, "prototype", { get: function () { return this.dPrototype; }, enumerable: !0, configurable: !0, }), (n.classInitializer = null), n ); })(Lb), Rb = []; function Fb(t, e, n) { if (e && "object" == typeof e) return e; var r = t.box(e); return ( r || (Rb.length ? (r = Rb[Rb.length - 1].topScope().global.object) : n.receiver && (r = n.receiver.scope.global.object)), r ); } function kb(t) { if (!t || !t.sec) throw new TypeError("Conversion to Array failed"); return t.sec.AXArray.axCoerce(t); } function Ub(t, e) { if (1 === e.length && "number" == typeof e[0]) { var n = e[0]; try { return new Array(n); } catch (e) { t.throwError("RangeError", wb.ArrayIndexNotIntegerError, n); } } return Array.apply(Array, e); } function jb(t, e) { return String(t).localeCompare(String(e)); } function Vb(t, e, n, r, i) { return ( 1 & n && ((t = String(t).toLowerCase()), (e = String(e).toLowerCase())), (16 & n ? ((t = +t) < (e = +e) ? -1 : t > e ? 1 : 0) : i(t, e)) * r ); } function Qb(t, e, n, r) { var i, o = 0; for (i = 0; i < n.length && 0 === o; i++) { var a = n[i], s = t[a], u = e[a], l = r[i]; 1 & l && ((s = String(s).toLowerCase()), (u = String(u).toLowerCase())), (o = 16 & l ? (s = +s) < (u = +u) ? -1 : s > u ? 1 : 0 : String(s).localeCompare(String(u))); } return 2 & r[i - 1] && (o *= -1), o; } function Gb(t) { var e = Object.create(this.tPrototype); return (e.value = t), e; } var zb, Hb = (function (t) { function n() { var e = t.call(this) || this; return (e.value = Ub(e.sec, arguments)), n.wrapProxy(e); } return ( e(n, t), (n.wrapProxy = function (t) { return new Proxy(t, { set: function (t, e, n, r) { return "string" != typeof e || Number.isNaN(+e) ? ((t[e] = n), !0) : ((t.value[+e] = n), !0); }, get: function (t, e, n) { return "string" != typeof e || Number.isNaN(+e) ? t[e] : t.value[+e]; }, }); }), (n.axBox = function (t) { return n.wrapProxy(Gb.call(this, t)); }), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; cf(this, "$BgCASEINSENSITIVE", 1), cf(this, "$BgDESCENDING", 2), cf(this, "$BgUNIQUESORT", 4), cf(this, "$BgRETURNINDEXEDARRAY", 8), cf(this, "$BgNUMERIC", 16), lb(t, "$Bgpush", e.generic_push), lb(t, "$Bgpop", e.generic_pop), lb(t, "$Bgshift", e.generic_shift), lb(t, "$Bgunshift", e.generic_unshift), lb(t, "$Bgreverse", e.generic_reverse), lb(t, "$Bgconcat", e.generic_concat), lb(t, "$Bgslice", e.generic_slice), lb(t, "$Bgsplice", e.generic_splice), lb(t, "$Bgjoin", e.generic_join), lb(t, "$BgtoString", e.generic_toString), lb(t, "$BgindexOf", e.generic_indexOf), lb(t, "$BglastIndexOf", e.generic_lastIndexOf), lb(t, "$Bgevery", e.generic_every), lb(t, "$Bgsome", e.generic_some), lb(t, "$BgforEach", e.generic_forEach), lb(t, "$Bgmap", e.generic_map), lb(t, "$Bgfilter", e.generic_filter), lb(t, "$Bgsort", e.generic_sort), lb(t, "$BgsortOn", e.generic_sortOn), lb(t, "$BghasOwnProperty", e.native_hasOwnProperty), lb(t, "$BgpropertyIsEnumerable", e.native_propertyIsEnumerable), lb(t, "$BgtoLocaleString", e.generic_toString); }), (n.prototype.native_hasOwnProperty = function (t) { return this.axHasOwnProperty(Cb(t)); }), (n.prototype.native_propertyIsEnumerable = function (e) { if ("number" == typeof e || qh((e = Eb(e)))) { var n = Object.getOwnPropertyDescriptor(this.value, e); return !!n && n.enumerable; } t.prototype.native_propertyIsEnumerable.call(this, e); }), (n.axApply = function (t, e) { return this.sec.createArrayUnsafe(Ub(this.sec, e)); }), (n.axConstruct = function (t) { return this.sec.createArrayUnsafe(Ub(this.sec, t)); }), (n.prototype.push = function () { if (this.value.length + arguments.length > 4294967295) { for (var t = 4294967295 - this.value.length, e = 0; e < t; e++) this.value.push(arguments[e]); return 4294967295; } return this.value.push.apply(this.value, arguments); }), (n.prototype.generic_push = function () { if (this && this.value instanceof Array) return this.push.apply(this, arguments); for ( var t = this.axGetPublicProperty("length") >>> 0, e = 0; e < arguments.length; e++ ) this.axSetNumericProperty(t++, arguments[e]); return this.axSetPublicProperty("length", t), t; }), (n.prototype.pop = function () { return this.value.pop(); }), (n.prototype.generic_pop = function () { if (this && this.value instanceof Array) return this.value.pop(); var t = this.axGetPublicProperty("length") >>> 0; if (t) { var e = this.axGetNumericProperty(t - 1); return ( (xb.name = t - 1), (xb.namespaces = [Zv.PUBLIC]), this.axDeleteProperty(xb), this.axSetPublicProperty("length", t - 1), e ); } this.axSetPublicProperty("length", 0); }), (n.prototype.shift = function () { return this.value.shift(); }), (n.prototype.generic_shift = function () { return kb(this).shift(); }), (n.prototype.unshift = function () { return this.value.unshift.apply(this.value, arguments); }), (n.prototype.generic_unshift = function () { var t = kb(this); return t.value.unshift.apply(t.value, arguments); }), (n.prototype.reverse = function () { return this.value.reverse(), this; }), (n.prototype.generic_reverse = function () { return kb(this).reverse(); }), (n.prototype.concat = function () { for (var t = this.value.slice(), e = 0; e < arguments.length; e++) { var n = arguments[e]; "object" == typeof n && n && n.sec && Array.isArray(n.value) ? t.push.apply(t, n.value) : t.push(n); } return this.sec.createArrayUnsafe(t); }), (n.prototype.generic_concat = function () { return kb(this).concat.apply(this, arguments); }), (n.prototype.slice = function (t, e) { return this.sec.createArray(this.value.slice(t, e)); }), (n.prototype.generic_slice = function (t, e) { return kb(this).slice(t, e); }), (n.prototype.splice = function () { var t = this.value; if (0 !== arguments.length) return this.sec.createArray(t.splice.apply(t, arguments)); }), (n.prototype.generic_splice = function () { return kb(this).splice.apply(this, arguments); }), (n.prototype.join = function (t) { return this.value.join(t); }), (n.prototype.generic_join = function (t) { return kb(this).join(t); }), (n.prototype.toString = function () { return this.value.join(","); }), (n.prototype.valueOf = function () { return this.value.join(","); }), (n.prototype.generic_toString = function () { return kb(this).join(","); }), (n.prototype.indexOf = function (t, e) { return this.value.indexOf(t, 0 | e); }), (n.prototype.generic_indexOf = function (t, e) { return kb(this).indexOf(t, 0 | e); }), (n.prototype.lastIndexOf = function (t, e) { return this.value.lastIndexOf( t, arguments.length > 1 ? e : 2147483647 ); }), (n.prototype.generic_lastIndexOf = function (t, e) { return kb(this).lastIndexOf(t, arguments.length > 1 ? e : 2147483647); }), (n.prototype.every = function (t, e) { if (!t || !t.value || "function" != typeof t.value) return !0; e = Fb(this.sec, e, t); for (var n = this.value, r = 0; r < n.length; r++) if (!0 !== t.value.call(e, n[r], r, this)) return !1; return !0; }), (n.prototype.generic_every = function (t, e) { return kb(this).every(t, e); }), (n.prototype.some = function (t, e) { if (!t || !t.value || "function" != typeof t.value) return !1; e = Fb(this.sec, e, t); var n = this; return this.value.some(function (r, i, o) { return t.value.call(e, r, i, n); }); }), (n.prototype.generic_some = function (t, e) { return kb(this).some(t, e); }), (n.prototype.forEach = function (t, e) { if (t && t.value && "function" == typeof t.value) { e = Fb(this.sec, e, t); var n = this; this.value.forEach(function (r, i) { t.value.call(e, r, i, n); }); } }), (n.prototype.generic_forEach = function (t, e) { return kb(this).forEach(t, e); }), (n.prototype.map = function (t, e) { if (!t || !t.value || "function" != typeof t.value) return this.sec.createArrayUnsafe([]); e = Fb(this.sec, e, t); var n = this; return this.sec.createArrayUnsafe( this.value.map(function (r, i) { return t.value.call(e, r, i, n); }) ); }), (n.prototype.generic_map = function (t, e) { return kb(this).map(t, e); }), (n.prototype.filter = function (t, e) { if (!t || !t.value || "function" != typeof t.value) return this.sec.createArrayUnsafe([]); e = Fb(this.sec, e, t); for (var n = [], r = this.value, i = 0; i < r.length; i++) !0 === t.value.call(e, r[i], i, this) && n.push(r[i]); return this.sec.createArrayUnsafe(n); }), (n.prototype.generic_filter = function (t, e) { return kb(this).filter(t, e); }), (n.prototype.toLocaleString = function () { for ( var t = this.sec.AXArray.axCoerce(this).value, e = "", n = 0, r = t.length; n < r; n++ ) { var i = t[n]; null != i && (e += i.toLocaleString()), n + 1 < r && (e += ","); } return e; }), (n.prototype.sort = function () { var t, e = this.value; if (0 === arguments.length) return e.sort(), this; var n = 0; if ( (this.sec.AXFunction.axIsInstanceOf(arguments[0]) ? (t = arguments[0].value) : Hh(arguments[0]) && (n = arguments[0]), Hh(arguments[1]) && (n = arguments[1]), !n) ) return e.sort(t), this; t || (t = jb); var r = 2 & n ? -1 : 1; return ( e.sort(function (e, i) { return Vb(e, i, n, r, t); }), this ); }), (n.prototype.generic_sort = function () { return kb(this).sort.apply(this, arguments); }), (n.prototype.sortOn = function (t, e) { 0 === arguments.length && this.sec.throwError( "ArgumentError", wb.WrongArgumentCountError, "Array/http://adobe.com/AS3/2006/builtin::sortOn()", "1", "0" ); var n = this.value, r = []; if (zh(t)) (t = [ub.getPublicMangledName(t)]), (r = [0 | e]); else { if (!t || !Array.isArray(t.value)) return this; t = t.value; for (var i = 0; i < t.length; i++) t[i] = ub.getPublicMangledName(t[i]); if (e && Array.isArray(e.value)) if ((e = e.value).length === t.length) for (i = 0; i < e.length; i++) r[i] = 0 | e[i]; else for (i = 0; i < t.length; i++) r[i] = 0; else { var o = 0 | e; for (i = 0; i < t.length; i++) r[i] = o; } } o = r[0]; return ( n.sort(function (e, n) { return Qb(e, n, t, r); }), this ); }), (n.prototype.generic_sortOn = function () { return kb(this).sortOn.apply(this, arguments); }), Object.defineProperty(n.prototype, "length", { get: function () { return this.value.length; }, set: function (t) { this.value.length = t >>> 0; }, enumerable: !0, configurable: !0, }), (n.prototype.axGetEnumerableKeys = function () { return Object.keys(this.value).concat( t.prototype.axGetEnumerableKeys.call(this) ); }), (n.prototype.axHasPropertyInternal = function (t) { var e = t.name; return "number" == typeof e || qh((e = Eb(e))) ? e in this.value : !!this.traits.getTrait(t.namespaces, e) || "$Bg" + e in this; }), (n.prototype.axHasOwnProperty = function (t) { var e = t.name; return "number" == typeof e || qh((e = Eb(e))) ? this.value.hasOwnProperty(e) : !!this.traits.getTrait(t.namespaces, e) || this.hasOwnProperty("$Bg" + e); }), (n.prototype.axGetProperty = function (e) { var n, r = e.name; return "number" == typeof r || qh((r = Eb(r))) ? null != (n = this.value[r]) ? n : this[r] : t.prototype.axGetProperty.call(this, e); }), (n.prototype.axSetProperty = function (e, n, r) { var i = e.name; "number" == typeof i || qh((i = Eb(i))) ? (this.value[i] = n) : t.prototype.axSetProperty.call(this, e, n, r); }), (n.prototype.axDeleteProperty = function (t) { var e = t.name; return "number" == typeof e || qh((e = Eb(e))) ? delete this.value[e] : !this.traits.getTrait(t.namespaces, e) && delete this["$Bg" + e]; }), (n.prototype.axGetPublicProperty = function (t) { return "number" == typeof t || qh((t = Eb(t))) ? this.value[t] : this["$Bg" + t]; }), (n.prototype.axSetPublicProperty = function (t, e) { "number" == typeof t || qh((t = Eb(t))) ? (this.value[t] = e) : (this["$Bg" + t] = e); }), n ); })(Lb), Xb = (function (t) { function n(e, n) { var r = t.call(this) || this; return ( arguments.length < 1 && (e = ""), (r.$Bgmessage = String(e)), (r._errorID = 0 | n), r ); } return ( e(n, t), (n.throwError = function (t, e) { for (var n = Pb(e), r = [n], i = 2; i < arguments.length; i++) r.push(arguments[i]); var o = Ob.apply(null, r); throw t.axConstruct([o, e]); }), (n.classInitializer = function (t) { cf(this, "$Bglength", 1), cf( this.dPrototype, "$Bgname", this.classInfo.instanceInfo.getName().name ), t === n && (cf(this.dPrototype, "$Bgmessage", "Error"), cf(this.dPrototype, "$BgtoString", n.prototype.toString)); }), (n.prototype.toString = function () { return "" !== this.$Bgmessage ? this.$Bgname + ": " + this.$Bgmessage : this.$Bgname; }), Object.defineProperty(n.prototype, "errorID", { get: function () { return this._errorID; }, enumerable: !0, configurable: !0, }), (n.prototype.getStackTrace = function () { return null; }), (n.getErrorMessage = Tb), n ); })(Lb), Yb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), qb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), Kb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), Wb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), Jb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), $b = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), Zb = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), tC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), eC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), nC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), rC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), iC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), oC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), aC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb), sC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return e(n, t), n; })(Xb); !(function (t) { (t[(t.None = 0)] = "None"), (t[(t.Runtime = 1)] = "Runtime"), (t[(t.Execution = 2)] = "Execution"), (t[(t.Interpreter = 4)] = "Interpreter"); })(zb || (zb = {})), new $h(!1, function (t) { var e; (e = t), "undefined" != typeof dump && dump(e + "\n"); }); function uC(t, e) { return Array.prototype.slice.call(t, e); } var lC = (function (t) { function n() { var e = (null !== t && t.apply(this, arguments)) || this; return (e._prototypeInitialzed = !1), e; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; lb(t, "$BgtoString", e.toString), lb(t, "$Bgcall", e.call), lb(t, "$Bgapply", e.apply), cf(t, "value", e.native_functionValue); }), (n.prototype.setReceiver = function (t) { this.receiver = t; }), (n.prototype.axConstruct = function (t) { var e = this.prototype; No(e) && (e = this.sec.AXFunctionUndefinedPrototype); var n = Object.create(e); return (n.__ctorFunction = this), this.value.apply(n, t), n; }), (n.prototype.axIsInstanceOf = function (t) { return t && t.__ctorFunction === this; }), (n.prototype.native_functionValue = function () {}), Object.defineProperty(n.prototype, "prototype", { get: function () { return ( this._prototypeInitialzed || ((this._prototype = Object.create( this.sec.AXObject.tPrototype )), (this._prototypeInitialzed = !0)), this._prototype ); }, set: function (t) { No(t) ? (t = void 0) : ("object" != typeof t || this.sec.isPrimitive(t)) && this.sec.throwError("TypeError", wb.PrototypeTypeError), (this._prototypeInitialzed = !0), (this._prototype = t); }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "length", { get: function () { return this.value.methodInfo ? this.value.methodInfo.parameters.length : this.value.length; }, enumerable: !0, configurable: !0, }), (n.prototype.toString = function () { return "function Function() {}"; }), (n.prototype.call = function (t) { return ( (t = Fb(this.sec, t, this)), this.value.apply(t, uC(arguments, 1)) ); }), (n.prototype.apply = function (t, e) { return ( (t = Fb(this.sec, t, this)), this.value.apply(t, e ? e.value : void 0) ); }), (n.prototype.axCall = function (t) { return this.value.apply(t, uC(arguments, 1)); }), (n.prototype.axApply = function (t, e) { return this.value.apply(t, e); }), n ); })(Lb), cC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; cf(t, "$Bgcall", e.call), cf(t, "$Bgapply", e.apply); }), (n.Create = function (t, e) { var n = function () { return n.value.apply(n.receiver, arguments); }; return ( Object.setPrototypeOf(n, this.sec.AXMethodClosure.tPrototype), (n.receiver = t), (n.value = e), (n.methodInfo = e.methodInfo), (n.axCall = n.call), (n.axApply = n.apply), n ); }), Object.defineProperty(n.prototype, "prototype", { get: function () { return null; }, set: function (t) { this.sec.throwError( "ReferenceError", wb.ConstWriteError, "prototype", "MethodClosure" ); }, enumerable: !0, configurable: !0, }), (n.prototype.axCall = function (t) { return this.value.apply(this.receiver, uC(arguments, 1)); }), (n.prototype.axApply = function (t, e) { return this.value.apply(this.receiver, e); }), (n.prototype.call = function (t) { var e = arguments, n = e.length; return n <= 6 ? this.value.call(this.receiver, e[1], e[2], e[3], e[4], e[5]) : this.value.apply(this.receiver, uC(arguments, 1)); }), (n.prototype.apply = function (t, e) { return this.value.apply(this.receiver, e && e.value ? e.value : e); }), n ); })(lC), hC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; lb(t, "$BgtoString", e.toString), lb(t, "$BgtoLocaleString", e.toString), lb(t, "$BgvalueOf", e.valueOf), lb(t, "$BgtoFixed", e.toFixed), lb(t, "$BgtoExponential", e.toExponential), lb(t, "$BgtoPrecision", e.toPrecision), cf(this, "$BgNaN", Number.NaN), cf(this, "$BgNEGATIVE_INFINITY", -1 / 0), cf(this, "$BgPOSITIVE_INFINITY", 1 / 0), cf(this, "$BgMAX_VALUE", Number.MAX_VALUE), cf(this, "$BgMIN_VALUE", Number.MIN_VALUE), cf(this, "$BgE", Math.E), cf(this, "$BgLN10", Math.LN10), cf(this, "$BgLN2", Math.LN2), cf(this, "$BgLOG10E", Math.LOG10E), cf(this, "$BgLOG2E", Math.LOG2E), cf(this, "$BgPI", Math.PI), cf(this, "$BgSQRT1_2", Math.SQRT2), cf(this, "$BgSQRT2", Math.SQRT2); }), (n.prototype.toString = function (t) { return ( 0 === arguments.length ? (t = 10) : ((t |= 0) < 2 || t > 36) && this.sec.throwError("RangeError", wb.InvalidRadixError, t), this.axClass !== this.sec.AXNumber && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "Number.prototype.toString" ), this.value.toString(t) ); }), (n.prototype.valueOf = function () { return ( this.axClass !== this.sec.AXNumber && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "Number.prototype.valueOf" ), this.value ); }), (n.prototype.toExponential = function (t) { return ( ((t |= 0) < 0 || t > 20) && this.sec.throwError("RangeError", wb.InvalidPrecisionError), this.axClass !== this.sec.AXNumber ? "NaN" : this.value.toExponential(t) ); }), (n.prototype.toPrecision = function (t) { return ( t ? (t |= 0) : (t = 1), (t < 1 || t > 21) && this.sec.throwError("RangeError", wb.InvalidPrecisionError), this.axClass !== this.sec.AXNumber ? "NaN" : this.value.toPrecision(t) ); }), (n.prototype.toFixed = function (t) { return ( ((t |= 0) < 0 || t > 20) && this.sec.throwError("RangeError", wb.InvalidPrecisionError), this.axClass !== this.sec.AXNumber ? "NaN" : this.value.toFixed(t) ); }), (n._minValue = function () { return Number.MIN_VALUE; }), (n.convertStringToDouble = function (t) { var e = t.indexOf(String.fromCharCode(0)); return e >= 0 ? +t.substring(0, e) : +t; }), (n.classNatives = [Math]), n ); })(Lb), pC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; lb(t, "$BgtoString", e.toString), lb(t, "$BgtoLocaleString", e.toString), lb(t, "$BgvalueOf", e.valueOf), cf(this, "$BgMAX_VALUE", 2147483647), cf(this, "$BgMIN_VALUE", -2147483648); }), (n.prototype.toString = function (t) { return ( 0 === arguments.length ? (t = 10) : ((t |= 0) < 2 || t > 36) && this.sec.throwError("RangeError", wb.InvalidRadixError, t), this.axClass !== this.sec.AXInt && this.axClass !== this.sec.AXNumber && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "Number.prototype.toString" ), this.value.toString(t) ); }), (n.prototype.valueOf = function () { return ( this.axClass !== this.sec.AXInt && this.axClass !== this.sec.AXNumber && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "Number.prototype.valueOf" ), this.value ); }), (n.staticNatives = [Math]), (n.instanceNatives = [hC.prototype]), n ); })(hC); function dC(t, e) { var n = t.createArray(e); return ( n.axSetPublicProperty("index", e.index), n.axSetPublicProperty("input", e.input), n ); } var fC = (function (t) { function n(e) { var n = t.call(this) || this; return (n.value = e), n; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; lb(t, "$BgindexOf", e.generic_indexOf), lb(t, "$BglastIndexOf", e.generic_lastIndexOf), lb(t, "$BgcharAt", e.generic_charAt), lb(t, "$BgcharCodeAt", e.generic_charCodeAt), lb(t, "$Bgconcat", e.generic_concat), lb(t, "$BglocaleCompare", e.generic_localeCompare), lb(t, "$Bgmatch", e.generic_match), lb(t, "$Bgreplace", e.generic_replace), lb(t, "$Bgsearch", e.generic_search), lb(t, "$Bgslice", e.generic_slice), lb(t, "$Bgsplit", e.generic_split), lb(t, "$Bgsubstring", e.generic_substring), lb(t, "$Bgsubstr", e.generic_substr), lb(t, "$BgtoLowerCase", e.generic_toLowerCase), lb(t, "$BgtoLocaleLowerCase", e.generic_toLowerCase), lb(t, "$BgtoUpperCase", e.generic_toUpperCase), lb(t, "$BgtoLocaleUpperCase", e.generic_toUpperCase), lb(t, "$BgtoString", e.toString), lb(t, "$BgtoString", e.public_toString), lb(t, "$BgvalueOf", e.public_valueOf), lb(this, "$BgfromCharCode", n.fromCharCode); }), (n.fromCharCode = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return String.fromCharCode.apply(null, t); }), (n.prototype.indexOf = function (t, e) { return this.value.indexOf(t, e); }), (n.prototype.lastIndexOf = function (t, e) { return this.value.lastIndexOf(t, e); }), (n.prototype.charAt = function (t) { return this.value.charAt(t); }), (n.prototype.charCodeAt = function (t) { return this.value.charCodeAt(t); }), (n.prototype.concat = function () { return this.value.concat.apply(this.value, arguments); }), (n.prototype.localeCompare = function (t) { arguments.length > 1 && this.sec.throwError( "ArgumentError", wb.WrongArgumentCountError, "Function/()", 0, 2 ); var e = this.value; if ((t = String(t)) === e) return 0; for (var n = Math.min(e.length, t.length), r = 0; r < n; r++) if (e[r] !== t[r]) return e.charCodeAt(r) - t.charCodeAt(r); return e.length > t.length ? 1 : -1; }), (n.prototype.__getRegExp = function (t) { return this.sec.AXRegExp.axIsType(t) ? t : this.sec.AXRegExp.axConstruct([nb(t)]); }), (n.prototype.match = function (t) { var e = this.__getRegExp(t).internalStringMatch(this.value); if (!e) return null; try { return dC(this.sec, e); } catch (t) { return null; } }), (n.prototype.replace = function (t, e) { this.sec.AXFunction.axIsType(e) && (e = e.value); try { return this.sec.AXRegExp.axIsType(t) ? this.__getRegExp(t).internalStringReplace(this.value, e) : ((t = nb(t)), this.value.replace(t, e)); } catch (t) { return this.value; } }), (n.prototype.search = function (t) { try { return this.sec.AXRegExp.axIsType(t) ? this.__getRegExp(t).internalStringSearch(this.value) : this.value.search(nb(t)); } catch (t) { return -1; } }), (n.prototype.slice = function (t, e) { return ( (t = arguments.length < 1 ? 0 : 0 | t), (e = arguments.length < 2 ? 4294967295 : 0 | e), this.value.slice(t, e) ); }), (n.prototype.split = function (t, e) { (t = this.sec.AXRegExp.axIsType(t) ? t.value : nb(t)), (e = void 0 === e ? -1 : 0 | e); try { return this.sec.createArray(this.value.split(t, e)); } catch (t) { return this.sec.createArrayUnsafe([this.value]); } }), (n.prototype.substring = function (t, e) { return this.value.substring(t, e); }), (n.prototype.substr = function (t, e) { return ( -1 == e && (e = this.value.length - t - 1), this.value.substr(t, e) ); }), (n.prototype.toLocaleLowerCase = function () { return this.value.toLowerCase(); }), (n.prototype.toLowerCase = function () { return this.value.toLowerCase(); }), (n.prototype.toLocaleUpperCase = function () { return this.value.toUpperCase(); }), (n.prototype.toUpperCase = function () { return this.value.toUpperCase(); }), (n.prototype.generic_indexOf = function (t, e) { var n = null == this ? "" : this; return String.prototype.indexOf.call(n, t, e); }), (n.prototype.generic_lastIndexOf = function (t, e) { var n = null == this ? "" : this; return String.prototype.lastIndexOf.call(n, t, e); }), (n.prototype.generic_charAt = function (t) { var e = null == this ? "" : this; return String.prototype.charAt.call(e, t); }), (n.prototype.generic_charCodeAt = function (t) { var e = null == this ? "" : this; return String.prototype.charCodeAt.call(e, t); }), (n.prototype.generic_concat = function () { var t = null == this ? "" : this; return String.prototype.concat.apply(t, arguments); }), (n.prototype.generic_localeCompare = function (t) { var e = this.sec.AXString.axBox(String(this)); return e.localeCompare.apply(e, arguments); }), (n.prototype.generic_match = function (t) { return this.sec.AXString.axBox(String(this)).match(t); }), (n.prototype.generic_replace = function (t, e) { return this.sec.AXString.axBox(String(this)).replace(t, e); }), (n.prototype.generic_search = function (t) { return this.sec.AXString.axBox(String(this)).search(t); }), (n.prototype.generic_slice = function (t, e) { var n = null == this ? "" : this; return String.prototype.slice.call(n, t, e); }), (n.prototype.generic_split = function (t, e) { return ( (e = arguments.length < 2 ? 4294967295 : 0 | e), this.sec.AXString.axBox(String(this)).split(t, e) ); }), (n.prototype.generic_substring = function (t, e) { var n = null == this ? "" : this; return String.prototype.substring.call(n, t, e); }), (n.prototype.generic_substr = function (t, e) { var n = null == this ? "" : this; return String.prototype.substr.call(n, t, e); }), (n.prototype.generic_toLowerCase = function () { var t = null == this ? "" : this; String.prototype.toLowerCase.call(t); }), (n.prototype.generic_toUpperCase = function () { var t = null == this ? "" : this; return String.prototype.toUpperCase.call(t); }), (n.prototype.toString = function () { return this.value.toString(); }), (n.prototype.public_toString = function () { return this === this.sec.AXString.dPrototype ? "" : (this.axClass !== this.sec.AXString && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "String.prototype.toString" ), this.value.toString()); }), (n.prototype.valueOf = function () { return this.value.valueOf(); }), (n.prototype.public_valueOf = function () { return this === this.sec.AXString.dPrototype ? "" : (this.axClass !== this.sec.AXString && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "String.prototype.valueOf" ), this.value.valueOf()); }), Object.defineProperty(n.prototype, "length", { get: function () { return this.value.length; }, enumerable: !0, configurable: !0, }), (n.classNatives = [String]), n ); })(Lb), gC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; lb(t, "$BgtoString", e.toString), lb(t, "$BgtoLocaleString", e.toString), lb(t, "$BgvalueOf", e.valueOf), cf(this, "$BgMAX_VALUE", 4294967295), cf(this, "$BgMIN_VALUE", 0); }), (n.prototype.toString = function (t) { return ( 0 === arguments.length ? (t = 10) : ((t |= 0) < 2 || t > 36) && this.sec.throwError("RangeError", wb.InvalidRadixError, t), this.axClass !== this.sec.AXUint && this.axClass !== this.sec.AXNumber && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "Number.prototype.toString" ), this.value.toString(t) ); }), (n.prototype.valueOf = function () { return ( this.axClass !== this.sec.AXUint && this.axClass !== this.sec.AXNumber && this.sec.throwError( "TypeError", wb.InvokeOnIncompatibleObjectError, "Number.prototype.valueOf" ), this.value ); }), (n.staticNatives = [Math]), (n.instanceNatives = [hC.prototype]), n ); })(hC), _C = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = n.prototype; lb(t, "$BgtoString", e.toString), lb(t, "$BgvalueOf", e.valueOf); }), (n.prototype.toString = function () { return this.value.toString(); }), (n.prototype.valueOf = function () { return this.value.valueOf(); }), n ); })(Lb); function mC(t) { return t && "function" == typeof t.axApply; } function yC(t) { return +t; } var AC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.prototype.axGetProperty = function (e) { var n = e.name; return (0 | (n = "number" == typeof n ? n : Eb(n))) === n || qh(n) ? this.axGetNumericProperty("number" == typeof n ? n : 0 | n) : t.prototype.axGetProperty.call(this, e); }), (n.prototype.axSetProperty = function (e, n, r) { var i = e.name; (0 | (i = "number" == typeof i ? i : Eb(i))) === i || qh(i) ? this.axSetNumericProperty("number" == typeof i ? i : 0 | i, n) : t.prototype.axSetProperty.call(this, e, n, r); }), (n.prototype.axGetPublicProperty = function (t) { return (0 | (t = "number" == typeof t ? t : Eb(t))) === t || qh(t) ? this.axGetNumericProperty("number" == typeof t ? t : 0 | t) : this["$Bg" + t]; }), (n.prototype.axSetPublicProperty = function (t, e) { (0 | (t = "number" == typeof t ? t : Eb(t))) === t || qh(t) ? this.axSetNumericProperty("number" == typeof t ? t : 0 | t, e) : (this["$Bg" + t] = e); }), (n.prototype.axNextName = function (t) { return t - 1; }), (n.prototype.checkVectorMethodArgs = function (t, e) { if (Wh(t)) return !1; var n = this.sec; return ( mC(t) || n.throwError("TypeError", wb.CheckTypeFailedError, t, "Function"), t.axClass !== n.AXMethodClosure || Wh(e) || n.throwError("TypeError", wb.ArrayFilterNonNullObjectError), !0 ); }), n ); })(Lb), vC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.axIsType = function (t) { return ( this.dPrototype.isPrototypeOf(t) || this.sec.Int32Vector.axClass.dPrototype.isPrototypeOf(t) || this.sec.Uint32Vector.axClass.dPrototype.isPrototypeOf(t) || this.sec.Float64Vector.axClass.dPrototype.isPrototypeOf(t) || this.sec.ObjectVector.axClass.dPrototype.isPrototypeOf(t) ); }), n ); })(Lb), bC = (function (t) { function n(e, n) { void 0 === e && (e = 0), void 0 === n && (n = !1); var r = t.call(this) || this; return ( (e >>>= 0), (n = !!n), (r._fixed = !!n), (r._buffer = new Array(e)), r._fill(0, e, r.axClass.defaultValue), r ); } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = this.tPrototype; (e.axGetProperty = t.axGetProperty), (e.axGetNumericProperty = t.axGetNumericProperty), (e.axSetProperty = t.axSetProperty), (e.axSetNumericProperty = t.axSetNumericProperty), (e.axHasPropertyInternal = t.axHasPropertyInternal), (e.axNextName = t.axNextName), (e.axNextNameIndex = t.axNextNameIndex), (e.axNextValue = t.axNextValue), (t.axGetProperty = Lb.prototype.axGetProperty), (t.axGetNumericProperty = Lb.prototype.axGetNumericProperty), (t.axSetProperty = Lb.prototype.axSetProperty), (t.axSetNumericProperty = Lb.prototype.axSetNumericProperty), (t.axHasPropertyInternal = Lb.prototype.axHasPropertyInternal), (t.axNextName = Lb.prototype.axNextName), (t.axNextNameIndex = Lb.prototype.axNextNameIndex), (t.axNextValue = Lb.prototype.axNextValue); var r = n.prototype; cf(t, "$Bgjoin", r.join), cf(t, "$BgtoString", r.join), cf(t, "$BgtoLocaleString", r.toLocaleString), cf(t, "$Bgpop", r.pop), cf(t, "$Bgpush", r.push), cf(t, "$Bgreverse", r.reverse), cf(t, "$Bgconcat", r.concat), cf(t, "$Bgsplice", r.splice), cf(t, "$Bgslice", r.slice), cf(t, "$Bgshift", r.shift), cf(t, "$Bgunshift", r.unshift), cf(t, "$BgindexOf", r.indexOf), cf(t, "$BglastIndexOf", r.lastIndexOf), cf(t, "$BgforEach", r.forEach), cf(t, "$Bgmap", r.map), cf(t, "$Bgfilter", r.filter), cf(t, "$Bgsome", r.some), cf(t, "$Bgevery", r.every), cf(t, "$Bgsort", r.sort), cf(t, "checkVectorMethodArgs", r.checkVectorMethodArgs); }), (n.axApply = function (t, e) { var n = e[0]; if (this.axIsType(n)) return n; var r = n.axGetPublicProperty("length"); if (void 0 !== r) { for (var i = this.axConstruct([r, !1]), o = 0; o < r; o++) i.axSetNumericProperty(o, n.axGetPublicProperty(o)); return i; } _p(); }), (n.defaultCompareFunction = function (t, e) { return String(t).localeCompare(String(e)); }), (n.compare = function (t, e, r, i) { var o = 0; return ( i || (i = n.defaultCompareFunction), (o = r & n.NUMERIC ? (t = Yh(t)) < (e = Yh(e)) ? -1 : t > e ? 1 : 0 : i(t, e)), r & n.DESCENDING && (o *= -1), o ); }), (n.prototype._fill = function (t, e, n) { for (var r = 0; r < e; r++) this._buffer[t + r] = n; }), (n.prototype.toString = function () { for (var t = [], e = 0; e < this._buffer.length; e++) { var n = this._buffer[e]; t.push(null === n ? "null" : n + ""); } return t.join(","); }), (n.prototype.toLocaleString = function () { for (var t = [], e = 0; e < this._buffer.length; e++) { var n = this._buffer[e]; n && "object" == typeof n ? t.push(n.$BgtoLocaleString()) : t.push(n + ""); } return t.join(","); }), (n.prototype.sort = function (t) { if (void 0 === t) return this._buffer.sort(), this; if (this.sec.AXFunction.axIsType(t)) { var e = t.value, r = t.receiver; return this._buffer.sort(e.bind(r)), this; } var i = 0 | t; return i & n.NUMERIC ? i & n.DESCENDING ? (this._buffer.sort(function (t, e) { return yC(e) - yC(t); }), this) : (this._buffer.sort(function (t, e) { return yC(t) - yC(e); }), this) : i & n.CASEINSENSITIVE ? i & n.DESCENDING ? (this._buffer.sort(function (t, e) { return nb(e).toLowerCase() - nb(t).toLowerCase(); }), this) : (this._buffer.sort(function (t, e) { return nb(t).toLowerCase() - nb(e).toLowerCase(); }), this) : i & n.DESCENDING ? (this._buffer.sort(function (t, e) { return e - t; }), this) : (this._buffer.sort(), this); }), (n.prototype.every = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !0; for (var n = 0; n < this._buffer.length; n++) if (!t.axCall(e, this.axGetNumericProperty(n), n, this)) return !1; return !0; }), (n.prototype.filter = function (t, e) { var n = this.axClass.axConstruct([0, !1]); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._buffer.length; r++) t.call(e, this.axGetNumericProperty(r), r, this) && n.push(this.axGetNumericProperty(r)); return n; }), (n.prototype.map = function (t, e) { var n = this.axClass.axConstruct([this.length, !1]); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._buffer.length; r++) n.push( this._coerce(t.call(e, this.axGetNumericProperty(r), r, this)) ); return n; }), (n.prototype.some = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !1; for (var n = 0; n < this._buffer.length; n++) if (t.call(e, this.axGetNumericProperty(n), n, this)) return !0; return !1; }), (n.prototype.forEach = function (t, e) { if (this.checkVectorMethodArgs(t, e)) for (var n = 0; n < this._buffer.length; n++) t.call(e, this.axGetNumericProperty(n), n, this); }), (n.prototype.join = function (t) { void 0 === t && (t = ","); for ( var e = this._buffer, n = this._buffer.length, r = "", i = 0; i < n - 1; i++ ) r += e[i] + t; return n > 0 && (r += e[n - 1]), r; }), (n.prototype.indexOf = function (t, e) { return void 0 === e && (e = 0), this._buffer.indexOf(t, e); }), (n.prototype.lastIndexOf = function (t, e) { return ( void 0 === e && (e = 2147483647), this._buffer.lastIndexOf(t, e) ); }), (n.prototype.push = function (t, e, n, r, i, o, a, s) { this._checkFixed(); for (var u = 0; u < arguments.length; u++) this._buffer.push(this._coerce(arguments[u])); }), (n.prototype.pop = function () { if ((this._checkFixed(), 0 !== this._buffer.length)) return this._buffer.pop(); }), (n.prototype.concat = function () { for (var t = [], e = 0; e < arguments.length; e++) t.push(arguments[e]._buffer); var n = this._buffer.concat.apply(this._buffer, t), r = this.axClass.axConstruct([]); return (r._buffer = n), r; }), (n.prototype.reverse = function () { return this._buffer.reverse(), this; }), (n.prototype._coerce = function (t) { return this.axClass.type && this.axClass.type[fb] ? this.axClass.type.axCoerce(t) : t; }), (n.prototype.shift = function () { if ((this._checkFixed(), 0 !== this._buffer.length)) return this._buffer.shift(); }), (n.prototype.unshift = function () { if (arguments.length) { this._checkFixed(); for (var t = 0; t < arguments.length; t++) this._buffer.unshift(this._coerce(arguments[t])); } }), (n.prototype.slice = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 2147483647); var n = this._buffer, r = n.length, i = Math.min(Math.max(t, 0), r), o = Math.min(Math.max(e, i), r), a = this.axClass.axConstruct([o - i, this.fixed]); return (a._buffer = n.slice(i, o)), a; }), (n.prototype.splice = function (t, e) { var n = this._buffer, r = n.length, i = Math.min(Math.max(t, 0), r), o = Math.min(Math.max(e, 0), r - i), a = arguments.length - 2; o !== a && this._checkFixed(); for (var s = [i, o], u = 2; u < a + 2; u++) s[u] = this._coerce(arguments[u]); var l = this.axClass.axConstruct([o, this.fixed]); return (l._buffer = n.splice.apply(n, s)), l; }), Object.defineProperty(n.prototype, "length", { get: function () { return this._buffer.length; }, set: function (t) { if ((t >>>= 0) > this._buffer.length) for (var e = this._buffer.length; e < t; e++) this._buffer[e] = this.axClass.defaultValue; else this._buffer.length = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fixed", { get: function () { return this._fixed; }, set: function (t) { this._fixed = !!t; }, enumerable: !0, configurable: !0, }), (n.prototype._checkFixed = function () { this._fixed && this.sec.throwError("RangeError", wb.VectorFixedError); }), (n.prototype.axGetNumericProperty = function (t) { var e = 0 | t; return ( (e < 0 || e >= this._buffer.length || e != t) && this.sec.throwError( "RangeError", wb.OutOfRangeError, t, this._buffer.length ), this._buffer[e] ); }), (n.prototype.axSetNumericProperty = function (t, e) { var n = this._buffer.length, r = 0 | t; (r < 0 || r > n || r != t || (r === n && this._fixed)) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, n), (this._buffer[r] = this._coerce(e)); }), (n.prototype.axHasPropertyInternal = function (t) { if ((0 | t.name) === t.name) return t.name >= 0 && t.name < this._buffer.length; var e = Eb(t.name); if (t.isRuntimeName() && Kh(e)) { var n = e >>> 0; return n >= 0 && n < this._buffer.length; } return this.axResolveMultiname(t) in this; }), (n.prototype.axNextValue = function (t) { return this._buffer[t - 1]; }), (n.prototype.axNextNameIndex = function (t) { var e = t + 1; return e <= this._buffer.length ? e : 0; }), (n.CASEINSENSITIVE = 1), (n.DESCENDING = 2), (n.UNIQUESORT = 4), (n.RETURNINDEXEDARRAY = 8), (n.NUMERIC = 16), (n.defaultValue = null), n ); })(AC), CC = (function (t) { function n(e, r) { void 0 === e && (e = 0), void 0 === r && (r = !1); var i = t.call(this) || this; return ( (e >>>= 0), (i._fixed = !!r), (i._buffer = new Int32Array( Math.max(n.INITIAL_CAPACITY, e + n.EXTRA_CAPACITY) )), (i._offset = 0), (i._length = e), i ); } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = this.tPrototype; (e.axGetProperty = t.axGetProperty), (e.axGetNumericProperty = t.axGetNumericProperty), (e.axSetProperty = t.axSetProperty), (e.axSetNumericProperty = t.axSetNumericProperty), (e.axHasPropertyInternal = t.axHasPropertyInternal), (e.axNextName = t.axNextName), (e.axNextNameIndex = t.axNextNameIndex), (e.axNextValue = t.axNextValue), (t.axGetProperty = Lb.prototype.axGetProperty), (t.axGetNumericProperty = Lb.prototype.axGetNumericProperty), (t.axSetProperty = Lb.prototype.axSetProperty), (t.axSetNumericProperty = Lb.prototype.axSetNumericProperty), (t.axHasPropertyInternal = Lb.prototype.axHasPropertyInternal), (t.axNextName = Lb.prototype.axNextName), (t.axNextNameIndex = Lb.prototype.axNextNameIndex), (t.axNextValue = Lb.prototype.axNextValue); var r = n.prototype; cf(t, "$Bgjoin", r.join), cf(t, "$BgtoString", r.join), cf(t, "$BgtoLocaleString", r.toLocaleString), cf(t, "$Bgpop", r.pop), cf(t, "$Bgpush", r.push), cf(t, "$Bgreverse", r.reverse), cf(t, "$Bgconcat", r.concat), cf(t, "$Bgsplice", r.splice), cf(t, "$Bgslice", r.slice), cf(t, "$Bgshift", r.shift), cf(t, "$Bgunshift", r.unshift), cf(t, "$BgindexOf", r.indexOf), cf(t, "$BglastIndexOf", r.lastIndexOf), cf(t, "$BgforEach", r.forEach), cf(t, "$Bgmap", r.map), cf(t, "$Bgfilter", r.filter), cf(t, "$Bgsome", r.some), cf(t, "$Bgevery", r.every), cf(t, "$Bgsort", r.sort), cf(t, "checkVectorMethodArgs", r.checkVectorMethodArgs); }), (n.axApply = function (t, e) { var n = e[0]; if (this.axIsType(n)) return n; var r = n.axGetPublicProperty("length"); if (void 0 !== r) { for (var i = this.axConstruct([r, !1]), o = 0; o < r; o++) i.axSetNumericProperty(o, n.axGetPublicProperty(o)); return i; } _p(); }), (n.prototype.internalToString = function () { for ( var t = "", e = this._offset, n = e + this._length, r = 0; r < this._buffer.length; r++ ) r === e && (t += "["), r === n && (t += "]"), (t += this._buffer[r]), r < this._buffer.length - 1 && (t += ","); return ( this._offset + this._length === this._buffer.length && (t += "]"), t + ": offset: " + this._offset + ", length: " + this._length + ", capacity: " + this._buffer.length ); }), (n.prototype.toString = function () { for (var t = "", e = 0; e < this._length; e++) (t += this._buffer[this._offset + e]), e < this._length - 1 && (t += ","); return t; }), (n.prototype.toLocaleString = function () { for (var t = "", e = 0; e < this._length; e++) (t += this._buffer[this._offset + e]), e < this._length - 1 && (t += ","); return t; }), (n.prototype._view = function () { return this._buffer.subarray( this._offset, this._offset + this._length ); }), (n.prototype._ensureCapacity = function (t) { var e = this._offset + t; if (!(e < this._buffer.length)) { if (t <= this._buffer.length) { var n = (this._buffer.length - t) >> 2; return this._buffer.set(this._view(), n), void (this._offset = n); } var r = 1 + ((3 * this._buffer.length) >> 1); r < e && (r = e); var i = new Int32Array(r); i.set(this._buffer, 0), (this._buffer = i); } }), (n.prototype.concat = function () { for (var t = this._length, e = 0; e < arguments.length; e++) { (o = arguments[e])._buffer instanceof Int32Array || Po(!1), (t += o._length); } var n = new this.sec.Int32Vector(t), r = n._buffer; r.set(this._buffer); var i = this._length; for (e = 0; e < arguments.length; e++) { var o; i + (o = arguments[e])._buffer.length < o._buffer.length ? r.set(o._buffer, i) : r.set(o._buffer.subarray(0, o._length), i), (i += o._length); } return n; }), (n.prototype.every = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !0; for (var n = 0; n < this._length; n++) if (!t.call(e, this._buffer[this._offset + n], n, this)) return !1; return !0; }), (n.prototype.filter = function (t, e) { var n = new this.sec.Int32Vector(); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._length; r++) t.call(e, this._buffer[this._offset + r], r, this) && n.push(this._buffer[this._offset + r]); return n; }), (n.prototype.map = function (t, e) { var n = this.axClass.axConstruct([this.length, !1]); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._length; r++) n[r] = t.call(e, this._buffer[this._offset + r], r, this); return n; }), (n.prototype.some = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !1; for (var n = 0; n < this._length; n++) if (t.call(e, this._buffer[this._offset + n], n, this)) return !0; return !1; }), (n.prototype.forEach = function (t, e) { if (this.checkVectorMethodArgs(t, e)) for (var n = 0; n < this._length; n++) t.call(e, this._buffer[this._offset + n], n, this); }), (n.prototype.join = function (t) { void 0 === t && (t = ","); for ( var e = this.length, n = this._buffer, r = this._offset, i = "", o = 0; o < e - 1; o++ ) i += n[r + o] + t; return e > 0 && (i += n[r + e - 1]), i; }), (n.prototype.indexOf = function (t, e) { void 0 === e && (e = 0); var n = this._length, r = 0 | e; if (r < 0) (r += n) < 0 && (r = 0); else if (r >= n) return -1; for ( var i = this._buffer, o = ((n = this._length), this._offset), a = o + n, s = (r += o); s < a; s++ ) if (i[s] === t) return s - o; return -1; }), (n.prototype.lastIndexOf = function (t, e) { void 0 === e && (e = 2147483647); var n = this._length, r = 0 | e; if (r < 0) { if ((r += n) < 0) return -1; } else r >= n && (r = n); for ( var i = this._buffer, o = this._offset, a = o, s = (r += o); s-- > a; ) if (i[s] === t) return s - o; return -1; }), (n.prototype.push = function (t, e, n, r, i, o, a, s) { this._checkFixed(), this._ensureCapacity(this._length + arguments.length); for (var u = 0; u < arguments.length; u++) this._buffer[this._offset + this._length++] = arguments[u]; }), (n.prototype.pop = function () { return ( this._checkFixed(), 0 === this._length ? n.DEFAULT_VALUE : (this._length--, this._buffer[this._offset + this._length]) ); }), (n.prototype.reverse = function () { for ( var t = this._offset, e = this._offset + this._length - 1, n = this._buffer; t < e; ) { var r = n[t]; (n[t] = n[e]), (n[e] = r), t++, e--; } return this; }), (n.prototype.sort = function (t) { if (0 === arguments.length) return Array.prototype.sort.call(this._view()), this; if (this.sec.AXFunction.axIsType(t)) return Array.prototype.sort.call(this._view(), t.value), this; var e = 0 | t; return ( e & n.DESCENDING ? Array.prototype.sort.call(this._view(), function (t, e) { return e - t; }) : Array.prototype.sort.call(this._view(), function (t, e) { return t - e; }), this ); }), (n.prototype.shift = function () { return ( this._checkFixed(), 0 === this._length ? 0 : (this._length--, this._buffer[this._offset++]) ); }), (n.prototype.unshift = function () { if ((this._checkFixed(), arguments.length)) { this._ensureCapacity(this._length + arguments.length), this._slide(arguments.length), (this._offset -= arguments.length), (this._length += arguments.length); for (var t = 0; t < arguments.length; t++) this._buffer[this._offset + t] = arguments[t]; } }), (n.prototype.slice = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 2147483647); var n = this._buffer, r = this._length, i = Math.min(Math.max(t, 0), r), o = Math.min(Math.max(e, i), r), a = new this.sec.Int32Vector(o - i, this.fixed); return ( a._buffer.set( n.subarray(this._offset + i, this._offset + o), a._offset ), a ); }), (n.prototype.splice = function (t, e) { var n, r = this._buffer, i = this._length, o = Math.min(Math.max(t, 0), i), a = this._offset + o, s = Math.min(Math.max(e, 0), i - o), u = arguments.length - 2, l = new this.sec.Int32Vector(s, this.fixed); s > 0 && ((n = r.subarray(a, a + s)), l._buffer.set(n, l._offset)), this._ensureCapacity(i - s + u); var c = a + s, h = r.subarray(c, i); r.set(h, a + u), (this._length += u - s); for (var p = 0; p < u; p++) r[a + p] = arguments[p + 2]; return l; }), (n.prototype._slide = function (t) { this._buffer.set(this._view(), this._offset + t), (this._offset += t); }), Object.defineProperty(n.prototype, "length", { get: function () { return this._length; }, set: function (t) { if ((t >>>= 0) > this._length) { this._ensureCapacity(t); for ( var e = this._offset + this._length, r = this._offset + t; e < r; e++ ) this._buffer[e] = n.DEFAULT_VALUE; } this._length = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fixed", { get: function () { return this._fixed; }, set: function (t) { this._fixed = !!t; }, enumerable: !0, configurable: !0, }), (n.prototype._checkFixed = function () { this._fixed && this.sec.throwError("RangeError", wb.VectorFixedError); }), (n.prototype.axGetNumericProperty = function (t) { var e = this._length, n = 0 | t; return ( (n < 0 || n >= e || n != t) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, e), this._buffer[this._offset + n] ); }), (n.prototype.axSetNumericProperty = function (t, e) { var n = this._length, r = 0 | t; (r < 0 || r > n || r != t || (r === n && this._fixed)) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, n), r === this._length && (this._ensureCapacity(this._length + 1), this._length++), (this._buffer[this._offset + r] = e); }), (n.prototype.axHasPropertyInternal = function (t) { if ((0 | t.name) === t.name) return t.name >= 0 && t.name < this._length; var e = Eb(t.name); if (t.isRuntimeName() && Kh(e)) { var n = e >>> 0; return n >= 0 && n < this._length; } return this.axResolveMultiname(t) in this; }), (n.prototype.axNextValue = function (t) { return this._buffer[this._offset + t - 1]; }), (n.prototype.axNextNameIndex = function (t) { var e = t + 1; return e <= this._length ? e : 0; }), (n.EXTRA_CAPACITY = 4), (n.INITIAL_CAPACITY = 10), (n.DEFAULT_VALUE = 0), (n.DESCENDING = 2), (n.UNIQUESORT = 4), (n.RETURNINDEXEDARRAY = 8), n ); })(AC), IC = (function (t) { function n(e, r) { void 0 === e && (e = 0), void 0 === r && (r = !1); var i = t.call(this) || this; return ( (e >>>= 0), (i._fixed = !!r), (i._buffer = new Uint32Array( Math.max(n.INITIAL_CAPACITY, e + n.EXTRA_CAPACITY) )), (i._offset = 0), (i._length = e), i ); } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = this.tPrototype; (e.axGetProperty = t.axGetProperty), (e.axGetNumericProperty = t.axGetNumericProperty), (e.axSetProperty = t.axSetProperty), (e.axSetNumericProperty = t.axSetNumericProperty), (e.axHasPropertyInternal = t.axHasPropertyInternal), (e.axNextName = t.axNextName), (e.axNextNameIndex = t.axNextNameIndex), (e.axNextValue = t.axNextValue), (t.axGetProperty = Lb.prototype.axGetProperty), (t.axGetNumericProperty = Lb.prototype.axGetNumericProperty), (t.axSetProperty = Lb.prototype.axSetProperty), (t.axSetNumericProperty = Lb.prototype.axSetNumericProperty), (t.axHasPropertyInternal = Lb.prototype.axHasPropertyInternal), (t.axNextName = Lb.prototype.axNextName), (t.axNextNameIndex = Lb.prototype.axNextNameIndex), (t.axNextValue = Lb.prototype.axNextValue); var r = n.prototype; cf(t, "$Bgjoin", r.join), cf(t, "$BgtoString", r.join), cf(t, "$BgtoLocaleString", r.toLocaleString), cf(t, "$Bgpop", r.pop), cf(t, "$Bgpush", r.push), cf(t, "$Bgreverse", r.reverse), cf(t, "$Bgconcat", r.concat), cf(t, "$Bgsplice", r.splice), cf(t, "$Bgslice", r.slice), cf(t, "$Bgshift", r.shift), cf(t, "$Bgunshift", r.unshift), cf(t, "$BgindexOf", r.indexOf), cf(t, "$BglastIndexOf", r.lastIndexOf), cf(t, "$BgforEach", r.forEach), cf(t, "$Bgmap", r.map), cf(t, "$Bgfilter", r.filter), cf(t, "$Bgsome", r.some), cf(t, "$Bgevery", r.every), cf(t, "$Bgsort", r.sort), cf(t, "checkVectorMethodArgs", r.checkVectorMethodArgs); }), (n.axApply = function (t, e) { var n = e[0]; if (this.axIsType(n)) return n; var r = n.axGetPublicProperty("length"); if (void 0 !== r) { for (var i = this.axConstruct([r, !1]), o = 0; o < r; o++) i.axSetNumericProperty(o, n.axGetPublicProperty(o)); return i; } _p(); }), (n.prototype.internalToString = function () { for ( var t = "", e = this._offset, n = e + this._length, r = 0; r < this._buffer.length; r++ ) r === e && (t += "["), r === n && (t += "]"), (t += this._buffer[r]), r < this._buffer.length - 1 && (t += ","); return ( this._offset + this._length === this._buffer.length && (t += "]"), t + ": offset: " + this._offset + ", length: " + this._length + ", capacity: " + this._buffer.length ); }), (n.prototype.toString = function () { for (var t = "", e = 0; e < this._length; e++) (t += this._buffer[this._offset + e]), e < this._length - 1 && (t += ","); return t; }), (n.prototype.toLocaleString = function () { for (var t = "", e = 0; e < this._length; e++) (t += this._buffer[this._offset + e]), e < this._length - 1 && (t += ","); return t; }), (n.prototype._view = function () { return this._buffer.subarray( this._offset, this._offset + this._length ); }), (n.prototype._ensureCapacity = function (t) { var e = this._offset + t; if (!(e < this._buffer.length)) { if (t <= this._buffer.length) { var n = (this._buffer.length - t) >> 2; return this._buffer.set(this._view(), n), void (this._offset = n); } var r = 1 + ((3 * this._buffer.length) >> 1); r < e && (r = e); var i = new Uint32Array(r); i.set(this._buffer, 0), (this._buffer = i); } }), (n.prototype.concat = function () { for (var t = this._length, e = 0; e < arguments.length; e++) { (o = arguments[e])._buffer instanceof Uint32Array || Po(!1), (t += o._length); } var n = new this.sec.Uint32Vector(t), r = n._buffer; r.set(this._buffer); var i = this._length; for (e = 0; e < arguments.length; e++) { var o; i + (o = arguments[e])._buffer.length < o._buffer.length ? r.set(o._buffer, i) : r.set(o._buffer.subarray(0, o._length), i), (i += o._length); } return n; }), (n.prototype.every = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !0; for (var n = 0; n < this._length; n++) if (!t.call(e, this._buffer[this._offset + n], n, this)) return !1; return !0; }), (n.prototype.filter = function (t, e) { var n = new this.sec.Uint32Vector(); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._length; r++) t.call(e, this._buffer[this._offset + r], r, this) && n.push(this._buffer[this._offset + r]); return n; }), (n.prototype.map = function (t, e) { var n = this.axClass.axConstruct([this.length, !1]); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._length; r++) n[r] = t.call(e, this._buffer[this._offset + r], r, this); return n; }), (n.prototype.some = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !1; for (var n = 0; n < this._length; n++) if (t.call(e, this._buffer[this._offset + n], n, this)) return !0; return !1; }), (n.prototype.forEach = function (t, e) { if (this.checkVectorMethodArgs(t, e)) for (var n = 0; n < this._length; n++) t.call(e, this._buffer[this._offset + n], n, this); }), (n.prototype.join = function (t) { void 0 === t && (t = ","); for ( var e = this.length, n = this._buffer, r = this._offset, i = "", o = 0; o < e - 1; o++ ) i += n[r + o] + t; return e > 0 && (i += n[r + e - 1]), i; }), (n.prototype.indexOf = function (t, e) { void 0 === e && (e = 0); var n = this._length, r = 0 | e; if (r < 0) (r += n) < 0 && (r = 0); else if (r >= n) return -1; for ( var i = this._buffer, o = ((n = this._length), this._offset), a = o + n, s = (r += o); s < a; s++ ) if (i[s] === t) return s - o; return -1; }), (n.prototype.lastIndexOf = function (t, e) { void 0 === e && (e = 2147483647); var n = this._length, r = 0 | e; if (r < 0) { if ((r += n) < 0) return -1; } else r >= n && (r = n); for ( var i = this._buffer, o = this._offset, a = o, s = (r += o); s-- > a; ) if (i[s] === t) return s - o; return -1; }), (n.prototype.push = function (t, e, n, r, i, o, a, s) { this._checkFixed(), this._ensureCapacity(this._length + arguments.length); for (var u = 0; u < arguments.length; u++) this._buffer[this._offset + this._length++] = arguments[u]; }), (n.prototype.pop = function () { return ( this._checkFixed(), 0 === this._length ? n.DEFAULT_VALUE : (this._length--, this._buffer[this._offset + this._length]) ); }), (n.prototype.reverse = function () { for ( var t = this._offset, e = this._offset + this._length - 1, n = this._buffer; t < e; ) { var r = n[t]; (n[t] = n[e]), (n[e] = r), t++, e--; } return this; }), (n.prototype.sort = function (t) { if (0 === arguments.length) return Array.prototype.sort.call(this._view()), this; if (this.sec.AXFunction.axIsType(t)) return Array.prototype.sort.call(this._view(), t.value), this; var e = 0 | t; return ( e & n.DESCENDING ? Array.prototype.sort.call(this._view(), function (t, e) { return e - t; }) : Array.prototype.sort.call(this._view(), function (t, e) { return t - e; }), this ); }), (n.prototype.shift = function () { return ( this._checkFixed(), 0 === this._length ? 0 : (this._length--, this._buffer[this._offset++]) ); }), (n.prototype.unshift = function () { if ((this._checkFixed(), arguments.length)) { this._ensureCapacity(this._length + arguments.length), this._slide(arguments.length), (this._offset -= arguments.length), (this._length += arguments.length); for (var t = 0; t < arguments.length; t++) this._buffer[this._offset + t] = arguments[t]; } }), (n.prototype.slice = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 2147483647); var n = this._buffer, r = this._length, i = Math.min(Math.max(t, 0), r), o = Math.min(Math.max(e, i), r), a = new this.sec.Uint32Vector(o - i, this.fixed); return ( a._buffer.set( n.subarray(this._offset + i, this._offset + o), a._offset ), a ); }), (n.prototype.splice = function (t, e) { var n, r = this._buffer, i = this._length, o = Math.min(Math.max(t, 0), i), a = this._offset + o, s = Math.min(Math.max(e, 0), i - o), u = arguments.length - 2, l = new this.sec.Uint32Vector(s, this.fixed); s > 0 && ((n = r.subarray(a, a + s)), l._buffer.set(n, l._offset)), this._ensureCapacity(i - s + u); var c = a + s, h = r.subarray(c, i); r.set(h, a + u), (this._length += u - s); for (var p = 0; p < u; p++) r[a + p] = arguments[p + 2]; return l; }), (n.prototype._slide = function (t) { this._buffer.set(this._view(), this._offset + t), (this._offset += t); }), Object.defineProperty(n.prototype, "length", { get: function () { return this._length; }, set: function (t) { if ((t >>>= 0) > this._length) { this._ensureCapacity(t); for ( var e = this._offset + this._length, r = this._offset + t; e < r; e++ ) this._buffer[e] = n.DEFAULT_VALUE; } this._length = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fixed", { get: function () { return this._fixed; }, set: function (t) { this._fixed = !!t; }, enumerable: !0, configurable: !0, }), (n.prototype._checkFixed = function () { this._fixed && this.sec.throwError("RangeError", wb.VectorFixedError); }), (n.prototype.axGetNumericProperty = function (t) { var e = this._length, n = 0 | t; return ( (n < 0 || n >= e || n != t) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, e), this._buffer[this._offset + n] ); }), (n.prototype.axSetNumericProperty = function (t, e) { var n = this._length, r = 0 | t; (r < 0 || r > n || r != t || (r === n && this._fixed)) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, n), r === this._length && (this._ensureCapacity(this._length + 1), this._length++), (this._buffer[this._offset + r] = e); }), (n.prototype.axHasPropertyInternal = function (t) { if ((0 | t.name) === t.name) return t.name >= 0 && t.name < this._length; var e = Eb(t.name); if (t.isRuntimeName() && Kh(e)) { var n = e >>> 0; return n >= 0 && n < this._length; } return this.axResolveMultiname(t) in this; }), (n.prototype.axNextValue = function (t) { return this._buffer[this._offset + t - 1]; }), (n.prototype.axNextNameIndex = function (t) { var e = t + 1; return e <= this._length ? e : 0; }), (n.EXTRA_CAPACITY = 4), (n.INITIAL_CAPACITY = 10), (n.DEFAULT_VALUE = 0), (n.DESCENDING = 2), (n.UNIQUESORT = 4), (n.RETURNINDEXEDARRAY = 8), n ); })(AC), EC = (function (t) { function n(e, r) { void 0 === e && (e = 0), void 0 === r && (r = !1); var i = t.call(this) || this; return ( (e >>>= 0), (i._fixed = !!r), (i._buffer = new Float64Array( Math.max(n.INITIAL_CAPACITY, e + n.EXTRA_CAPACITY) )), (i._offset = 0), (i._length = e), i ); } return ( e(n, t), (n.classInitializer = function () { var t = this.dPrototype, e = this.tPrototype; (e.axGetProperty = t.axGetProperty), (e.axGetNumericProperty = t.axGetNumericProperty), (e.axSetProperty = t.axSetProperty), (e.axSetNumericProperty = t.axSetNumericProperty), (e.axHasPropertyInternal = t.axHasPropertyInternal), (e.axNextName = t.axNextName), (e.axNextNameIndex = t.axNextNameIndex), (e.axNextValue = t.axNextValue), (t.axGetProperty = Lb.prototype.axGetProperty), (t.axGetNumericProperty = Lb.prototype.axGetNumericProperty), (t.axSetProperty = Lb.prototype.axSetProperty), (t.axSetNumericProperty = Lb.prototype.axSetNumericProperty), (t.axHasPropertyInternal = Lb.prototype.axHasPropertyInternal), (t.axNextName = Lb.prototype.axNextName), (t.axNextNameIndex = Lb.prototype.axNextNameIndex), (t.axNextValue = Lb.prototype.axNextValue); var r = n.prototype; cf(t, "$Bgjoin", r.join), cf(t, "$BgtoString", r.join), cf(t, "$BgtoLocaleString", r.toLocaleString), cf(t, "$Bgpop", r.pop), cf(t, "$Bgpush", r.push), cf(t, "$Bgreverse", r.reverse), cf(t, "$Bgconcat", r.concat), cf(t, "$Bgsplice", r.splice), cf(t, "$Bgslice", r.slice), cf(t, "$Bgshift", r.shift), cf(t, "$Bgunshift", r.unshift), cf(t, "$BgindexOf", r.indexOf), cf(t, "$BglastIndexOf", r.lastIndexOf), cf(t, "$BgforEach", r.forEach), cf(t, "$Bgmap", r.map), cf(t, "$Bgfilter", r.filter), cf(t, "$Bgsome", r.some), cf(t, "$Bgevery", r.every), cf(t, "$Bgsort", r.sort), cf(t, "checkVectorMethodArgs", r.checkVectorMethodArgs); }), (n.axApply = function (t, e) { var n = e[0]; if (this.axIsType(n)) return n; var r = n.axGetPublicProperty("length"); if (void 0 !== r) { for (var i = this.axConstruct([r, !1]), o = 0; o < r; o++) i.axSetNumericProperty(o, n.axGetPublicProperty(o)); return i; } _p(); }), (n.prototype.internalToString = function () { for ( var t = "", e = this._offset, n = e + this._length, r = 0; r < this._buffer.length; r++ ) r === e && (t += "["), r === n && (t += "]"), (t += this._buffer[r]), r < this._buffer.length - 1 && (t += ","); return ( this._offset + this._length === this._buffer.length && (t += "]"), t + ": offset: " + this._offset + ", length: " + this._length + ", capacity: " + this._buffer.length ); }), (n.prototype.toString = function () { for (var t = "", e = 0; e < this._length; e++) (t += this._buffer[this._offset + e]), e < this._length - 1 && (t += ","); return t; }), (n.prototype.toLocaleString = function () { for (var t = "", e = 0; e < this._length; e++) (t += this._buffer[this._offset + e]), e < this._length - 1 && (t += ","); return t; }), (n.prototype._view = function () { return this._buffer.subarray( this._offset, this._offset + this._length ); }), (n.prototype._ensureCapacity = function (t) { var e = this._offset + t; if (!(e < this._buffer.length)) { if (t <= this._buffer.length) { var n = (this._buffer.length - t) >> 2; return this._buffer.set(this._view(), n), void (this._offset = n); } var r = 1 + ((3 * this._buffer.length) >> 1); r < e && (r = e); var i = new Float64Array(r); i.set(this._buffer, 0), (this._buffer = i); } }), (n.prototype.concat = function () { for (var t = this._length, e = 0; e < arguments.length; e++) { (o = arguments[e])._buffer instanceof Float64Array || Po(!1), (t += o._length); } var n = new this.sec.Float64Vector(t), r = n._buffer; r.set(this._buffer); var i = this._length; for (e = 0; e < arguments.length; e++) { var o; i + (o = arguments[e])._buffer.length < o._buffer.length ? r.set(o._buffer, i) : r.set(o._buffer.subarray(0, o._length), i), (i += o._length); } return n; }), (n.prototype.every = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !0; for (var n = 0; n < this._length; n++) if (!t.call(e, this._buffer[this._offset + n], n, this)) return !1; return !0; }), (n.prototype.filter = function (t, e) { var n = new this.sec.Float64Vector(); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._length; r++) t.call(e, this._buffer[this._offset + r], r, this) && n.push(this._buffer[this._offset + r]); return n; }), (n.prototype.map = function (t, e) { var n = this.axClass.axConstruct([this.length, !1]); if (!this.checkVectorMethodArgs(t, e)) return n; for (var r = 0; r < this._length; r++) n[r] = t.call(e, this._buffer[this._offset + r], r, this); return n; }), (n.prototype.some = function (t, e) { if (!this.checkVectorMethodArgs(t, e)) return !1; for (var n = 0; n < this._length; n++) if (t.call(e, this._buffer[this._offset + n], n, this)) return !0; return !1; }), (n.prototype.forEach = function (t, e) { if (this.checkVectorMethodArgs(t, e)) for (var n = 0; n < this._length; n++) t.call(e, this._buffer[this._offset + n], n, this); }), (n.prototype.join = function (t) { void 0 === t && (t = ","); for ( var e = this.length, n = this._buffer, r = this._offset, i = "", o = 0; o < e - 1; o++ ) i += n[r + o] + t; return e > 0 && (i += n[r + e - 1]), i; }), (n.prototype.indexOf = function (t, e) { void 0 === e && (e = 0); var n = this._length, r = 0 | e; if (r < 0) (r += n) < 0 && (r = 0); else if (r >= n) return -1; for ( var i = this._buffer, o = ((n = this._length), this._offset), a = o + n, s = (r += o); s < a; s++ ) if (i[s] === t) return s - o; return -1; }), (n.prototype.lastIndexOf = function (t, e) { void 0 === e && (e = 2147483647); var n = this._length, r = 0 | e; if (r < 0) { if ((r += n) < 0) return -1; } else r >= n && (r = n); for ( var i = this._buffer, o = this._offset, a = o, s = (r += o); s-- > a; ) if (i[s] === t) return s - o; return -1; }), (n.prototype.push = function (t, e, n, r, i, o, a, s) { this._checkFixed(), this._ensureCapacity(this._length + arguments.length); for (var u = 0; u < arguments.length; u++) this._buffer[this._offset + this._length++] = arguments[u]; }), (n.prototype.pop = function () { return ( this._checkFixed(), 0 === this._length ? n.DEFAULT_VALUE : (this._length--, this._buffer[this._offset + this._length]) ); }), (n.prototype.reverse = function () { for ( var t = this._offset, e = this._offset + this._length - 1, n = this._buffer; t < e; ) { var r = n[t]; (n[t] = n[e]), (n[e] = r), t++, e--; } return this; }), (n.prototype.sort = function (t) { if (0 === arguments.length) return Array.prototype.sort.call(this._view()), this; if (this.sec.AXFunction.axIsType(t)) return Array.prototype.sort.call(this._view(), t.value), this; var e = 0 | t; return ( e & n.DESCENDING ? Array.prototype.sort.call(this._view(), function (t, e) { return e - t; }) : Array.prototype.sort.call(this._view(), function (t, e) { return t - e; }), this ); }), (n.prototype.shift = function () { return ( this._checkFixed(), 0 === this._length ? 0 : (this._length--, this._buffer[this._offset++]) ); }), (n.prototype.unshift = function () { if ((this._checkFixed(), arguments.length)) { this._ensureCapacity(this._length + arguments.length), this._slide(arguments.length), (this._offset -= arguments.length), (this._length += arguments.length); for (var t = 0; t < arguments.length; t++) this._buffer[this._offset + t] = arguments[t]; } }), (n.prototype.slice = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 2147483647); var n = this._buffer, r = this._length, i = Math.min(Math.max(t, 0), r), o = Math.min(Math.max(e, i), r), a = new this.sec.Float64Vector(o - i, this.fixed); return ( a._buffer.set( n.subarray(this._offset + i, this._offset + o), a._offset ), a ); }), (n.prototype.splice = function (t, e) { var n, r = this._buffer, i = this._length, o = Math.min(Math.max(t, 0), i), a = this._offset + o, s = Math.min(Math.max(e, 0), i - o), u = arguments.length - 2, l = new this.sec.Float64Vector(s, this.fixed); s > 0 && ((n = r.subarray(a, a + s)), l._buffer.set(n, l._offset)), this._ensureCapacity(i - s + u); var c = a + s, h = r.subarray(c, i); r.set(h, a + u), (this._length += u - s); for (var p = 0; p < u; p++) r[a + p] = arguments[p + 2]; return l; }), (n.prototype._slide = function (t) { this._buffer.set(this._view(), this._offset + t), (this._offset += t); }), Object.defineProperty(n.prototype, "length", { get: function () { return this._length; }, set: function (t) { if ((t >>>= 0) > this._length) { this._ensureCapacity(t); for ( var e = this._offset + this._length, r = this._offset + t; e < r; e++ ) this._buffer[e] = n.DEFAULT_VALUE; } this._length = t; }, enumerable: !0, configurable: !0, }), Object.defineProperty(n.prototype, "fixed", { get: function () { return this._fixed; }, set: function (t) { this._fixed = !!t; }, enumerable: !0, configurable: !0, }), (n.prototype._checkFixed = function () { this._fixed && this.sec.throwError("RangeError", wb.VectorFixedError); }), (n.prototype.axGetNumericProperty = function (t) { var e = this._length, n = 0 | t; return ( (n < 0 || n >= e || n != t) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, e), this._buffer[this._offset + n] ); }), (n.prototype.axSetNumericProperty = function (t, e) { var n = this._length, r = 0 | t; (r < 0 || r > n || r != t || (r === n && this._fixed)) && this.sec.throwError("RangeError", wb.OutOfRangeError, t, n), r === this._length && (this._ensureCapacity(this._length + 1), this._length++), (this._buffer[this._offset + r] = e); }), (n.prototype.axHasPropertyInternal = function (t) { if ((0 | t.name) === t.name) return t.name >= 0 && t.name < this._length; var e = Eb(t.name); if (t.isRuntimeName() && Kh(e)) { var n = e >>> 0; return n >= 0 && n < this._length; } return this.axResolveMultiname(t) in this; }), (n.prototype.axNextValue = function (t) { return this._buffer[this._offset + t - 1]; }), (n.prototype.axNextNameIndex = function (t) { var e = t + 1; return e <= this._length ? e : 0; }), (n.EXTRA_CAPACITY = 4), (n.INITIAL_CAPACITY = 10), (n.DEFAULT_VALUE = 0), (n.DESCENDING = 2), (n.UNIQUESORT = 4), (n.RETURNINDEXEDARRAY = 8), n ); })(AC), xC = (function (t) { function n() { return (null !== t && t.apply(this, arguments)) || this; } return ( e(n, t), (n.classNatives = [Math]), (n.classInitializer = function () { cf(this, "$BgE", Math.E), cf(this, "$BgLN10", Math.LN10), cf(this, "$BgLN2", Math.LN2), cf(this, "$BgLOG10E", Math.LOG10E), cf(this, "$BgLOG2E", Math.LOG2E), cf(this, "$BgPI", Math.PI), cf(this, "$BgSQRT1_2", Math.SQRT2), cf(this, "$BgSQRT2", Math.SQRT2); }), n ); })(Lb); var wC = function (t) { return t && t.__esModule ? t : { default: t }; }, SC = function (t) { return t && t.Math == Math && t; }, DC = SC("object" == typeof globalThis && globalThis) || SC("object" == typeof window && window) || SC("object" == typeof self && self) || SC("object" == typeof Zc && Zc) || (function () { return this; })() || Function("return this")(), TC = function (t) { try { return !!t(); } catch (t) { return !0; } }, PC = !TC(function () { return ( 7 != Object.defineProperty({}, 1, { get: function () { return 7; }, })[1] ); }), OC = {}.propertyIsEnumerable, BC = Object.getOwnPropertyDescriptor, MC = { f: BC && !OC.call({ 1: 2 }, 1) ? function (t) { var e = BC(this, t); return !!e && e.enumerable; } : OC, }, LC = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e, }; }, NC = {}.toString, RC = function (t) { return NC.call(t).slice(8, -1); }, FC = "".split, kC = TC(function () { return !Object("z").propertyIsEnumerable(0); }) ? function (t) { return "String" == RC(t) ? FC.call(t, "") : Object(t); } : Object, UC = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t; }, jC = function (t) { return kC(UC(t)); }, VC = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t; }, QC = function (t, e) { if (!VC(t)) return t; var n, r; if (e && "function" == typeof (n = t.toString) && !VC((r = n.call(t)))) return r; if ("function" == typeof (n = t.valueOf) && !VC((r = n.call(t)))) return r; if (!e && "function" == typeof (n = t.toString) && !VC((r = n.call(t)))) return r; throw TypeError("Can't convert object to primitive value"); }, GC = {}.hasOwnProperty, zC = function (t, e) { return GC.call(t, e); }, HC = DC.document, XC = VC(HC) && VC(HC.createElement), YC = function (t) { return XC ? HC.createElement(t) : {}; }, qC = !PC && !TC(function () { return ( 7 != Object.defineProperty(YC("div"), "a", { get: function () { return 7; }, }).a ); }), KC = Object.getOwnPropertyDescriptor, WC = { f: PC ? KC : function (t, e) { if (((t = jC(t)), (e = QC(e, !0)), qC)) try { return KC(t, e); } catch (t) {} if (zC(t, e)) return LC(!MC.f.call(t, e), t[e]); }, }, JC = /#|\.prototype\./, $C = function (t, e) { var n = tI[ZC(t)]; return n == nI || (n != eI && ("function" == typeof e ? TC(e) : !!e)); }, ZC = ($C.normalize = function (t) { return String(t).replace(JC, ".").toLowerCase(); }), tI = ($C.data = {}), eI = ($C.NATIVE = "N"), nI = ($C.POLYFILL = "P"), rI = $C, iI = {}, oI = function (t) { if ("function" != typeof t) throw TypeError(String(t) + " is not a function"); return t; }, aI = function (t, e, n) { if ((oI(t), void 0 === e)) return t; switch (n) { case 0: return function () { return t.call(e); }; case 1: return function (n) { return t.call(e, n); }; case 2: return function (n, r) { return t.call(e, n, r); }; case 3: return function (n, r, i) { return t.call(e, n, r, i); }; } return function () { return t.apply(e, arguments); }; }, sI = function (t) { if (!VC(t)) throw TypeError(String(t) + " is not an object"); return t; }, uI = Object.defineProperty, lI = { f: PC ? uI : function (t, e, n) { if ((sI(t), (e = QC(e, !0)), sI(n), qC)) try { return uI(t, e, n); } catch (t) {} if ("get" in n || "set" in n) throw TypeError("Accessors not supported"); return "value" in n && (t[e] = n.value), t; }, }, cI = PC ? function (t, e, n) { return lI.f(t, e, LC(1, n)); } : function (t, e, n) { return (t[e] = n), t; }, hI = WC.f, pI = function (t) { var e = function (e, n, r) { if (this instanceof t) { switch (arguments.length) { case 0: return new t(); case 1: return new t(e); case 2: return new t(e, n); } return new t(e, n, r); } return t.apply(this, arguments); }; return (e.prototype = t.prototype), e; }, dI = function (t, e) { var n, r, i, o, a, s, u, l, c = t.target, h = t.global, p = t.stat, d = t.proto, f = h ? DC : p ? DC[c] : (DC[c] || {}).prototype, g = h ? iI : iI[c] || (iI[c] = {}), _ = g.prototype; for (i in e) (n = !rI(h ? i : c + (p ? "." : "#") + i, t.forced) && f && zC(f, i)), (a = g[i]), n && (s = t.noTargetGet ? (l = hI(f, i)) && l.value : f[i]), (o = n && s ? s : e[i]), (n && typeof a == typeof o) || ((u = t.bind && n ? aI(o, DC) : t.wrap && n ? pI(o) : d && "function" == typeof o ? aI(Function.call, o) : o), (t.sham || (o && o.sham) || (a && a.sham)) && cI(u, "sham", !0), (g[i] = u), d && (zC(iI, (r = c + "Prototype")) || cI(iI, r, {}), (iI[r][i] = o), t.real && _ && !_[i] && cI(_, i, o))); }; dI( { target: "Object", stat: !0, forced: !PC, sham: !PC }, { defineProperty: lI.f } ); var fI = eh(function (t) { var e = iI.Object, n = (t.exports = function (t, n, r) { return e.defineProperty(t, n, r); }); e.defineProperty.sham && (n.sham = !0); }), gI = {}, _I = "__core-js_shared__", mI = DC[_I] || (function (t, e) { try { cI(DC, t, e); } catch (n) { DC[t] = e; } return e; })(_I, {}), yI = Function.toString; "function" != typeof mI.inspectSource && (mI.inspectSource = function (t) { return yI.call(t); }); var AI, vI, bI, CI = mI.inspectSource, II = DC.WeakMap, EI = "function" == typeof II && /native code/.test(CI(II)), xI = eh(function (t) { (t.exports = function (t, e) { return mI[t] || (mI[t] = void 0 !== e ? e : {}); })("versions", []).push({ version: "3.7.0", mode: "pure", copyright: "© 2020 Denis Pushkarev (zloirock.ru)", }); }), wI = 0, SI = Math.random(), DI = function (t) { return ( "Symbol(" + String(void 0 === t ? "" : t) + ")_" + (++wI + SI).toString(36) ); }, TI = xI("keys"), PI = function (t) { return TI[t] || (TI[t] = DI(t)); }, OI = {}, BI = DC.WeakMap; if (EI) { var MI = mI.state || (mI.state = new BI()), LI = MI.get, NI = MI.has, RI = MI.set; (AI = function (t, e) { return (e.facade = t), RI.call(MI, t, e), e; }), (vI = function (t) { return LI.call(MI, t) || {}; }), (bI = function (t) { return NI.call(MI, t); }); } else { var FI = PI("state"); (OI[FI] = !0), (AI = function (t, e) { return (e.facade = t), cI(t, FI, e), e; }), (vI = function (t) { return zC(t, FI) ? t[FI] : {}; }), (bI = function (t) { return zC(t, FI); }); } var kI = { set: AI, get: vI, has: bI, enforce: function (t) { return bI(t) ? vI(t) : AI(t, {}); }, getterFor: function (t) { return function (e) { var n; if (!VC(e) || (n = vI(e)).type !== t) throw TypeError("Incompatible receiver, " + t + " required"); return n; }; }, }, UI = function (t) { return Object(UC(t)); }, jI = !TC(function () { function t() {} return ( (t.prototype.constructor = null), Object.getPrototypeOf(new t()) !== t.prototype ); }), VI = PI("IE_PROTO"), QI = Object.prototype, GI = jI ? Object.getPrototypeOf : function (t) { return ( (t = UI(t)), zC(t, VI) ? t[VI] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? QI : null ); }, zI = !!Object.getOwnPropertySymbols && !TC(function () { return !String(Symbol()); }), HI = zI && !Symbol.sham && "symbol" == typeof Symbol.iterator, XI = xI("wks"), YI = DC.Symbol, qI = HI ? YI : (YI && YI.withoutSetter) || DI, KI = function (t) { return ( zC(XI, t) || (zI && zC(YI, t) ? (XI[t] = YI[t]) : (XI[t] = qI("Symbol." + t))), XI[t] ); }; KI("iterator"); var WI, JI, $I, ZI = !1; [].keys && ("next" in ($I = [].keys()) ? (JI = GI(GI($I))) !== Object.prototype && (WI = JI) : (ZI = !0)), null == WI && (WI = {}); var tE, eE = { IteratorPrototype: WI, BUGGY_SAFARI_ITERATORS: ZI }, nE = Math.ceil, rE = Math.floor, iE = function (t) { return isNaN((t = +t)) ? 0 : (t > 0 ? rE : nE)(t); }, oE = Math.min, aE = function (t) { return t > 0 ? oE(iE(t), 9007199254740991) : 0; }, sE = Math.max, uE = Math.min, lE = function (t, e) { var n = iE(t); return n < 0 ? sE(n + e, 0) : uE(n, e); }, cE = function (t) { return function (e, n, r) { var i, o = jC(e), a = aE(o.length), s = lE(r, a); if (t && n != n) { for (; a > s; ) if ((i = o[s++]) != i) return !0; } else for (; a > s; s++) if ((t || s in o) && o[s] === n) return t || s || 0; return !t && -1; }; }, hE = { includes: cE(!0), indexOf: cE(!1) }, pE = hE.indexOf, dE = function (t, e) { var n, r = jC(t), i = 0, o = []; for (n in r) !zC(OI, n) && zC(r, n) && o.push(n); for (; e.length > i; ) zC(r, (n = e[i++])) && (~pE(o, n) || o.push(n)); return o; }, fE = [ "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf", ], gE = Object.keys || function (t) { return dE(t, fE); }, _E = PC ? Object.defineProperties : function (t, e) { sI(t); for (var n, r = gE(e), i = r.length, o = 0; i > o; ) lI.f(t, (n = r[o++]), e[n]); return t; }, mE = function (t) { return "function" == typeof t ? t : void 0; }, yE = function (t, e) { return arguments.length < 2 ? mE(iI[t]) || mE(DC[t]) : (iI[t] && iI[t][e]) || (DC[t] && DC[t][e]); }, AE = yE("document", "documentElement"), vE = PI("IE_PROTO"), bE = function () {}, CE = function (t) { return "