import { a6 as cB, a7 as cE, d as defineComponent, a8 as useConfig, a9 as useTheme, E as computed, aa as createKey, ab as useThemeClass, ac as h$1, ad as inputLight, r as ref, w as watch, f as createVNode, ae as NSkeleton, af as commonjsGlobal, q as onMounted, ag as openBlock, ah as createElementBlock, ai as normalizeStyle, aj as toRefs, M as nextTick, e as reactive, k as createTextVNode, c as useUserStore, ak as useDialog, al as NEllipsis, j as NButton, o as NImage, Q as NSpace, am as NTag, y as resolveComponent, V as isVNode, N as NForm, g as NFormItem, F as Fragment, an as NInputNumber, i as NInputGroup, h as NInput, m as NTabs, n as NTabPane, H as NDatePicker, z as NModal, b as useMessage, Z as onUnmounted, T as Transition, ao as NTooltip, ap as NDrawer, aq as NDrawerContent } from './index-95e721f9.js'; import { C as CardType } from './index-c8870a16.js'; import { N as NSlider } from './Slider-6165502a.js'; import { T as TheSearch } from './index-a585796f.js'; import { l as listData } from './data-c15517db.js'; import { N as NScrollbar } from './Scrollbar-27c35a2f.js'; import './index-73922017.js'; const style = cB( 'input-group-label', ` position: relative; user-select: none; -webkit-user-select: none; box-sizing: border-box; padding: 0 12px; display: inline-block; border-radius: var(--n-border-radius); background-color: var(--n-group-label-color); color: var(--n-group-label-text-color); font-size: var(--n-font-size); line-height: var(--n-height); height: var(--n-height); flex-shrink: 0; white-space: nowrap; transition: color .3s var(--n-bezier), background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier); `, [ cE( 'border', ` position: absolute; left: 0; right: 0; top: 0; bottom: 0; border-radius: inherit; border: var(--n-group-label-border); transition: border-color .3s var(--n-bezier); ` ) ] ), inputGroupLabelProps = Object.assign(Object.assign({}, useTheme.props), { size: { type: String, default: 'medium' }, bordered: { type: Boolean, default: void 0 } }), NInputGroupLabel = defineComponent({ name: 'InputGroupLabel', props: inputGroupLabelProps, setup(e) { const { mergedBorderedRef: t, mergedClsPrefixRef: r, inlineThemeDisabled: i } = useConfig(e), s = useTheme('Input', '-input-group-label', style, inputLight, e, r), n = computed(() => { const { size: o } = e, { common: { cubicBezierEaseInOut: l }, self: { groupLabelColor: c, borderRadius: g, groupLabelTextColor: S, lineHeight: p, groupLabelBorder: P, [createKey('fontSize', o)]: b, [createKey('height', o)]: y } } = s.value; return { '--n-bezier': l, '--n-group-label-color': c, '--n-group-label-border': P, '--n-border-radius': g, '--n-group-label-text-color': S, '--n-font-size': b, '--n-line-height': p, '--n-height': y }; }), a = i ? useThemeClass( 'input-group-label', computed(() => e.size[0]), n, e ) : void 0; return { mergedClsPrefix: r, mergedBordered: t, cssVars: i ? void 0 : n, themeClass: a == null ? void 0 : a.themeClass, onRender: a == null ? void 0 : a.onRender }; }, render() { var e, t, r; const { mergedClsPrefix: i } = this; return ( (e = this.onRender) === null || e === void 0 || e.call(this), h$1( 'div', { class: [`${i}-input-group-label`, this.themeClass], style: this.cssVars }, (r = (t = this.$slots).default) === null || r === void 0 ? void 0 : r.call(t), this.mergedBordered ? h$1('div', { class: `${i}-input-group-label__border` }) : null ) ); } }), playContent = '_playContent_10y90_1', assignHomework = '_assignHomework_10y90_10', sectionAnimateUp = '_sectionAnimateUp_10y90_23', coursewarePlay = '_coursewarePlay_10y90_29', playModel = '_playModel_10y90_35', headerContainer = '_headerContainer_10y90_44', backBtn = '_backBtn_10y90_61', headRight = '_headRight_10y90_73', rightBtn = '_rightBtn_10y90_82', menu = '_menu_10y90_94', tabsContent = '_tabsContent_10y90_104', wraps = '_wraps_10y90_115', itemDiv = '_itemDiv_10y90_122', itemActive = '_itemActive_10y90_135', acitveAnimation = '_acitveAnimation_10y90_138', show = '_show_10y90_141', hide$1 = '_hide_10y90_144', rightFixedBtns = '_rightFixedBtns_10y90_157', fullBtn = '_fullBtn_10y90_164', point = '_point_10y90_169', btnsDisabled = '_btnsDisabled_10y90_179', loadWrap = '_loadWrap_10y90_208', drawerContainer = '_drawerContainer_10y90_219', sectionAnimate$1 = '_sectionAnimate_10y90_23', switchDisplaySection = '_switchDisplaySection_10y90_264', displayBtn = '_displayBtn_10y90_272', attendClassModal = '_attendClassModal_10y90_284', modelAttendContent = '_modelAttendContent_10y90_308', modelAttendBtnGroup = '_modelAttendBtnGroup_10y90_314', trainClassModal = '_trainClassModal_10y90_322', styles$8 = { playContent, assignHomework, sectionAnimateUp, coursewarePlay, playModel, headerContainer, backBtn, headRight, rightBtn, menu, tabsContent, wraps, itemDiv, itemActive, acitveAnimation, show, hide: hide$1, rightFixedBtns, fullBtn, point, btnsDisabled, loadWrap, drawerContainer, sectionAnimate: sectionAnimate$1, switchDisplaySection, displayBtn, attendClassModal, modelAttendContent, modelAttendBtnGroup, trainClassModal }, plyr = '', musicScore = '_musicScore_piq8y_1', container = '_container_piq8y_8', musicModel = '_musicModel_piq8y_16', errorModel = '_errorModel_piq8y_23', startBtn = '_startBtn_piq8y_35', loading = '_loading_piq8y_45', skeletonWrap = '_skeletonWrap_piq8y_51', skeleton = '_skeleton_piq8y_51', styles$7 = { musicScore, container, musicModel, errorModel, startBtn, loading, skeletonWrap, skeleton }; var inBrowser = typeof window < 'u', visibility; function usePageVisibility() { if (!visibility && ((visibility = ref('visible')), inBrowser)) { const e = () => { visibility.value = document.hidden ? 'hidden' : 'visible'; }; e(), window.addEventListener('visibilitychange', e); } return visibility; } const MusicScore = defineComponent({ name: 'musicScore', props: { music: { type: Object, default: () => ({}) }, activeModel: { type: Boolean } }, emits: ['setIframe'], setup(e, { emit: t }) { const r = ref(!1), i = usePageVisibility(); watch(i, g => { console.log('🚀 ~ value:', g), g == 'hidden' && (r.value = !1); }); const s = ref(), n = ref(!1), a = ref(!1), o = ref(!1), l = 'https://dev.kt.colexiu.com/instrument?platform=pc&modelType=practise', c = () => { fetch(l) .then(() => { (o.value = !0), (a.value = !1); }) .catch(() => { a.value = !0; }); }; return ( watch(e.music, () => { o.value || ((a.value = !1), e.music.display && c()); }), () => createVNode('div', { class: styles$7.musicScore }, [ createVNode( 'iframe', { ref: s, onLoad: () => { t('setIframe', s.value), (n.value = !0); }, class: [styles$7.container, 'musicIframe'], frameborder: '0', src: l }, null ), createVNode('div', { class: styles$7.skeletonWrap }, [ createVNode(NSkeleton, { text: !0, repeat: 8 }, null) ]) ]) ); } }), iconMenu = '' + new URL('icon-menu-74c5e633.svg', import.meta.url).href, iconUp = '' + new URL('icon-up-c2aeb981.svg', import.meta.url).href, iconDown = '' + new URL('icon-down-c5693186.svg', import.meta.url).href, iconNote = '' + new URL('icon-note-e717c676.png', import.meta.url).href, iconWhiteboard = '' + new URL('icon-whiteboard-c1022e62.png', import.meta.url).href, iconAssignHomework = '' + new URL('icon-assignHomework-16a80795.svg', import.meta.url).href; var lottieExports = {}, lottie = { get exports() { return lottieExports; }, set exports(e) { lottieExports = e; } }; (function (module, exports) { typeof navigator < 'u' && (function (e, t) { module.exports = t(); })(commonjsGlobal, function () { var svgNS = 'http://www.w3.org/2000/svg', locationHref = '', _useWebWorker = !1, initialDefaultFrame = -999999, setWebWorker = function (t) { _useWebWorker = !!t; }, getWebWorker = function () { return _useWebWorker; }, setLocationHref = function (t) { locationHref = t; }, getLocationHref = function () { return locationHref; }; function createTag(e) { return document.createElement(e); } function extendPrototype(e, t) { var r, i = e.length, s; for (r = 0; r < i; r += 1) { s = e[r].prototype; for (var n in s) Object.prototype.hasOwnProperty.call(s, n) && (t.prototype[n] = s[n]); } } function getDescriptor(e, t) { return Object.getOwnPropertyDescriptor(e, t); } function createProxyFunction(e) { function t() {} return (t.prototype = e), t; } var audioControllerFactory = (function () { function e(t) { (this.audios = []), (this.audioFactory = t), (this._volume = 1), (this._isMuted = !1); } return ( (e.prototype = { addAudio: function (r) { this.audios.push(r); }, pause: function () { var r, i = this.audios.length; for (r = 0; r < i; r += 1) this.audios[r].pause(); }, resume: function () { var r, i = this.audios.length; for (r = 0; r < i; r += 1) this.audios[r].resume(); }, setRate: function (r) { var i, s = this.audios.length; for (i = 0; i < s; i += 1) this.audios[i].setRate(r); }, createAudio: function (r) { return this.audioFactory ? this.audioFactory(r) : window.Howl ? new window.Howl({ src: [r] }) : { isPlaying: !1, play: function () { this.isPlaying = !0; }, seek: function () { this.isPlaying = !1; }, playing: function () {}, rate: function () {}, setVolume: function () {} }; }, setAudioFactory: function (r) { this.audioFactory = r; }, setVolume: function (r) { (this._volume = r), this._updateVolume(); }, mute: function () { (this._isMuted = !0), this._updateVolume(); }, unmute: function () { (this._isMuted = !1), this._updateVolume(); }, getVolume: function () { return this._volume; }, _updateVolume: function () { var r, i = this.audios.length; for (r = 0; r < i; r += 1) this.audios[r].volume(this._volume * (this._isMuted ? 0 : 1)); } }), function () { return new e(); } ); })(), createTypedArray = (function () { function e(r, i) { var s = 0, n = [], a; switch (r) { case 'int16': case 'uint8c': a = 1; break; default: a = 1.1; break; } for (s = 0; s < i; s += 1) n.push(a); return n; } function t(r, i) { return r === 'float32' ? new Float32Array(i) : r === 'int16' ? new Int16Array(i) : r === 'uint8c' ? new Uint8ClampedArray(i) : e(r, i); } return typeof Uint8ClampedArray == 'function' && typeof Float32Array == 'function' ? t : e; })(); function createSizedArray(e) { return Array.apply(null, { length: e }); } function _typeof$6(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof$6 = function (r) { return typeof r; }) : (_typeof$6 = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof$6(e) ); } var subframeEnabled = !0, expressionsPlugin = null, expressionsInterfaces = null, idPrefix$1 = '', isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), bmPow = Math.pow, bmSqrt = Math.sqrt, bmFloor = Math.floor, bmMax = Math.max, bmMin = Math.min, BMMath = {}; (function () { var e = [ 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'atan2', 'ceil', 'cbrt', 'expm1', 'clz32', 'cos', 'cosh', 'exp', 'floor', 'fround', 'hypot', 'imul', 'log', 'log1p', 'log2', 'log10', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc', 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2' ], t, r = e.length; for (t = 0; t < r; t += 1) BMMath[e[t]] = Math[e[t]]; })(), (BMMath.random = Math.random), (BMMath.abs = function (e) { var t = _typeof$6(e); if (t === 'object' && e.length) { var r = createSizedArray(e.length), i, s = e.length; for (i = 0; i < s; i += 1) r[i] = Math.abs(e[i]); return r; } return Math.abs(e); }); var defaultCurveSegments = 150, degToRads = Math.PI / 180, roundCorner = 0.5519; function styleDiv(e) { (e.style.position = 'absolute'), (e.style.top = 0), (e.style.left = 0), (e.style.display = 'block'), (e.style.transformOrigin = '0 0'), (e.style.webkitTransformOrigin = '0 0'), (e.style.backfaceVisibility = 'visible'), (e.style.webkitBackfaceVisibility = 'visible'), (e.style.transformStyle = 'preserve-3d'), (e.style.webkitTransformStyle = 'preserve-3d'), (e.style.mozTransformStyle = 'preserve-3d'); } function BMEnterFrameEvent(e, t, r, i) { (this.type = e), (this.currentTime = t), (this.totalTime = r), (this.direction = i < 0 ? -1 : 1); } function BMCompleteEvent(e, t) { (this.type = e), (this.direction = t < 0 ? -1 : 1); } function BMCompleteLoopEvent(e, t, r, i) { (this.type = e), (this.currentLoop = r), (this.totalLoops = t), (this.direction = i < 0 ? -1 : 1); } function BMSegmentStartEvent(e, t, r) { (this.type = e), (this.firstFrame = t), (this.totalFrames = r); } function BMDestroyEvent(e, t) { (this.type = e), (this.target = t); } function BMRenderFrameErrorEvent(e, t) { (this.type = 'renderFrameError'), (this.nativeError = e), (this.currentTime = t); } function BMConfigErrorEvent(e) { (this.type = 'configError'), (this.nativeError = e); } var createElementID = (function () { var e = 0; return function () { return (e += 1), idPrefix$1 + '__lottie_element_' + e; }; })(); function HSVtoRGB(e, t, r) { var i, s, n, a, o, l, c, g; switch ( ((a = Math.floor(e * 6)), (o = e * 6 - a), (l = r * (1 - t)), (c = r * (1 - o * t)), (g = r * (1 - (1 - o) * t)), a % 6) ) { case 0: (i = r), (s = g), (n = l); break; case 1: (i = c), (s = r), (n = l); break; case 2: (i = l), (s = r), (n = g); break; case 3: (i = l), (s = c), (n = r); break; case 4: (i = g), (s = l), (n = r); break; case 5: (i = r), (s = l), (n = c); break; } return [i, s, n]; } function RGBtoHSV(e, t, r) { var i = Math.max(e, t, r), s = Math.min(e, t, r), n = i - s, a, o = i === 0 ? 0 : n / i, l = i / 255; switch (i) { case s: a = 0; break; case e: (a = t - r + n * (t < r ? 6 : 0)), (a /= 6 * n); break; case t: (a = r - e + n * 2), (a /= 6 * n); break; case r: (a = e - t + n * 4), (a /= 6 * n); break; } return [a, o, l]; } function addSaturationToRGB(e, t) { var r = RGBtoHSV(e[0] * 255, e[1] * 255, e[2] * 255); return ( (r[1] += t), r[1] > 1 ? (r[1] = 1) : r[1] <= 0 && (r[1] = 0), HSVtoRGB(r[0], r[1], r[2]) ); } function addBrightnessToRGB(e, t) { var r = RGBtoHSV(e[0] * 255, e[1] * 255, e[2] * 255); return ( (r[2] += t), r[2] > 1 ? (r[2] = 1) : r[2] < 0 && (r[2] = 0), HSVtoRGB(r[0], r[1], r[2]) ); } function addHueToRGB(e, t) { var r = RGBtoHSV(e[0] * 255, e[1] * 255, e[2] * 255); return ( (r[0] += t / 360), r[0] > 1 ? (r[0] -= 1) : r[0] < 0 && (r[0] += 1), HSVtoRGB(r[0], r[1], r[2]) ); } var rgbToHex = (function () { var e = [], t, r; for (t = 0; t < 256; t += 1) (r = t.toString(16)), (e[t] = r.length === 1 ? '0' + r : r); return function (i, s, n) { return ( i < 0 && (i = 0), s < 0 && (s = 0), n < 0 && (n = 0), '#' + e[i] + e[s] + e[n] ); }; })(), setSubframeEnabled = function (t) { subframeEnabled = !!t; }, getSubframeEnabled = function () { return subframeEnabled; }, setExpressionsPlugin = function (t) { expressionsPlugin = t; }, getExpressionsPlugin = function () { return expressionsPlugin; }, setExpressionInterfaces = function (t) { expressionsInterfaces = t; }, getExpressionInterfaces = function () { return expressionsInterfaces; }, setDefaultCurveSegments = function (t) { defaultCurveSegments = t; }, getDefaultCurveSegments = function () { return defaultCurveSegments; }, setIdPrefix = function (t) { idPrefix$1 = t; }; function createNS(e) { return document.createElementNS(svgNS, e); } function _typeof$5(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof$5 = function (r) { return typeof r; }) : (_typeof$5 = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof$5(e) ); } var dataManager = (function () { var e = 1, t = [], r, i, s = { onmessage: function () {}, postMessage: function (P) { r({ data: P }); } }, n = { postMessage: function (P) { s.onmessage({ data: P }); } }; function a(p) { if (window.Worker && window.Blob && getWebWorker()) { var P = new Blob( ['var _workerSelf = self; self.onmessage = ', p.toString()], { type: 'text/javascript' } ), b = URL.createObjectURL(P); return new Worker(b); } return (r = p), s; } function o() { i || ((i = a(function (P) { function b() { function A(B, F) { var k, C, M = B.length, R, L, j, z; for (C = 0; C < M; C += 1) if (((k = B[C]), 'ks' in k && !k.completed)) { if (((k.completed = !0), k.hasMask)) { var H = k.masksProperties; for (L = H.length, R = 0; R < L; R += 1) if (H[R].pt.k.i) E(H[R].pt.k); else for (z = H[R].pt.k.length, j = 0; j < z; j += 1) H[R].pt.k[j].s && E(H[R].pt.k[j].s[0]), H[R].pt.k[j].e && E(H[R].pt.k[j].e[0]); } k.ty === 0 ? ((k.layers = m(k.refId, F)), A(k.layers, F)) : k.ty === 4 ? d(k.shapes) : k.ty === 5 && $(k); } } function u(B, F) { if (B) { var k = 0, C = B.length; for (k = 0; k < C; k += 1) B[k].t === 1 && ((B[k].data.layers = m(B[k].data.refId, F)), A(B[k].data.layers, F)); } } function f(B, F) { for (var k = 0, C = F.length; k < C; ) { if (F[k].id === B) return F[k]; k += 1; } return null; } function m(B, F) { var k = f(B, F); return k ? k.layers.__used ? JSON.parse(JSON.stringify(k.layers)) : ((k.layers.__used = !0), k.layers) : null; } function d(B) { var F, k = B.length, C, M; for (F = k - 1; F >= 0; F -= 1) if (B[F].ty === 'sh') if (B[F].ks.k.i) E(B[F].ks.k); else for (M = B[F].ks.k.length, C = 0; C < M; C += 1) B[F].ks.k[C].s && E(B[F].ks.k[C].s[0]), B[F].ks.k[C].e && E(B[F].ks.k[C].e[0]); else B[F].ty === 'gr' && d(B[F].it); } function E(B) { var F, k = B.i.length; for (F = 0; F < k; F += 1) (B.i[F][0] += B.v[F][0]), (B.i[F][1] += B.v[F][1]), (B.o[F][0] += B.v[F][0]), (B.o[F][1] += B.v[F][1]); } function T(B, F) { var k = F ? F.split('.') : [100, 100, 100]; return B[0] > k[0] ? !0 : k[0] > B[0] ? !1 : B[1] > k[1] ? !0 : k[1] > B[1] ? !1 : B[2] > k[2] ? !0 : k[2] > B[2] ? !1 : null; } var x = (function () { var B = [4, 4, 14]; function F(C) { var M = C.t.d; C.t.d = { k: [{ s: M, t: 0 }] }; } function k(C) { var M, R = C.length; for (M = 0; M < R; M += 1) C[M].ty === 5 && F(C[M]); } return function (C) { if (T(B, C.v) && (k(C.layers), C.assets)) { var M, R = C.assets.length; for (M = 0; M < R; M += 1) C.assets[M].layers && k(C.assets[M].layers); } }; })(), _ = (function () { var B = [4, 7, 99]; return function (F) { if (F.chars && !T(B, F.v)) { var k, C = F.chars.length; for (k = 0; k < C; k += 1) { var M = F.chars[k]; M.data && M.data.shapes && (d(M.data.shapes), (M.data.ip = 0), (M.data.op = 99999), (M.data.st = 0), (M.data.sr = 1), (M.data.ks = { p: { k: [0, 0], a: 0 }, s: { k: [100, 100], a: 0 }, a: { k: [0, 0], a: 0 }, r: { k: 0, a: 0 }, o: { k: 100, a: 0 } }), F.chars[k].t || (M.data.shapes.push({ ty: 'no' }), M.data.shapes[0].it.push({ p: { k: [0, 0], a: 0 }, s: { k: [100, 100], a: 0 }, a: { k: [0, 0], a: 0 }, r: { k: 0, a: 0 }, o: { k: 100, a: 0 }, sk: { k: 0, a: 0 }, sa: { k: 0, a: 0 }, ty: 'tr' }))); } } }; })(), I = (function () { var B = [5, 7, 15]; function F(C) { var M = C.t.p; typeof M.a == 'number' && (M.a = { a: 0, k: M.a }), typeof M.p == 'number' && (M.p = { a: 0, k: M.p }), typeof M.r == 'number' && (M.r = { a: 0, k: M.r }); } function k(C) { var M, R = C.length; for (M = 0; M < R; M += 1) C[M].ty === 5 && F(C[M]); } return function (C) { if (T(B, C.v) && (k(C.layers), C.assets)) { var M, R = C.assets.length; for (M = 0; M < R; M += 1) C.assets[M].layers && k(C.assets[M].layers); } }; })(), V = (function () { var B = [4, 1, 9]; function F(C) { var M, R = C.length, L, j; for (M = 0; M < R; M += 1) if (C[M].ty === 'gr') F(C[M].it); else if (C[M].ty === 'fl' || C[M].ty === 'st') if (C[M].c.k && C[M].c.k[0].i) for (j = C[M].c.k.length, L = 0; L < j; L += 1) C[M].c.k[L].s && ((C[M].c.k[L].s[0] /= 255), (C[M].c.k[L].s[1] /= 255), (C[M].c.k[L].s[2] /= 255), (C[M].c.k[L].s[3] /= 255)), C[M].c.k[L].e && ((C[M].c.k[L].e[0] /= 255), (C[M].c.k[L].e[1] /= 255), (C[M].c.k[L].e[2] /= 255), (C[M].c.k[L].e[3] /= 255)); else (C[M].c.k[0] /= 255), (C[M].c.k[1] /= 255), (C[M].c.k[2] /= 255), (C[M].c.k[3] /= 255); } function k(C) { var M, R = C.length; for (M = 0; M < R; M += 1) C[M].ty === 4 && F(C[M].shapes); } return function (C) { if (T(B, C.v) && (k(C.layers), C.assets)) { var M, R = C.assets.length; for (M = 0; M < R; M += 1) C.assets[M].layers && k(C.assets[M].layers); } }; })(), D = (function () { var B = [4, 4, 18]; function F(C) { var M, R = C.length, L, j; for (M = R - 1; M >= 0; M -= 1) if (C[M].ty === 'sh') if (C[M].ks.k.i) C[M].ks.k.c = C[M].closed; else for (j = C[M].ks.k.length, L = 0; L < j; L += 1) C[M].ks.k[L].s && (C[M].ks.k[L].s[0].c = C[M].closed), C[M].ks.k[L].e && (C[M].ks.k[L].e[0].c = C[M].closed); else C[M].ty === 'gr' && F(C[M].it); } function k(C) { var M, R, L = C.length, j, z, H, U; for (R = 0; R < L; R += 1) { if (((M = C[R]), M.hasMask)) { var q = M.masksProperties; for (z = q.length, j = 0; j < z; j += 1) if (q[j].pt.k.i) q[j].pt.k.c = q[j].cl; else for (U = q[j].pt.k.length, H = 0; H < U; H += 1) q[j].pt.k[H].s && (q[j].pt.k[H].s[0].c = q[j].cl), q[j].pt.k[H].e && (q[j].pt.k[H].e[0].c = q[j].cl); } M.ty === 4 && F(M.shapes); } } return function (C) { if (T(B, C.v) && (k(C.layers), C.assets)) { var M, R = C.assets.length; for (M = 0; M < R; M += 1) C.assets[M].layers && k(C.assets[M].layers); } }; })(); function N(B) { B.__complete || (V(B), x(B), _(B), I(B), D(B), A(B.layers, B.assets), u(B.chars, B.assets), (B.__complete = !0)); } function $(B) { B.t.a.length === 0 && 'm' in B.t.p; } var O = {}; return ( (O.completeData = N), (O.checkColors = V), (O.checkChars = _), (O.checkPathProperties = I), (O.checkShapes = D), (O.completeLayers = A), O ); } if ( (n.dataManager || (n.dataManager = b()), n.assetLoader || (n.assetLoader = (function () { function A(f) { var m = f.getResponseHeader('content-type'); return (m && f.responseType === 'json' && m.indexOf('json') !== -1) || (f.response && _typeof$5(f.response) === 'object') ? f.response : f.response && typeof f.response == 'string' ? JSON.parse(f.response) : f.responseText ? JSON.parse(f.responseText) : null; } function u(f, m, d, E) { var T, x = new XMLHttpRequest(); try { x.responseType = 'json'; } catch {} x.onreadystatechange = function () { if (x.readyState === 4) if (x.status === 200) (T = A(x)), d(T); else try { (T = A(x)), d(T); } catch (_) { E && E(_); } }; try { x.open(['G', 'E', 'T'].join(''), f, !0); } catch { x.open(['G', 'E', 'T'].join(''), m + '/' + f, !0); } x.send(); } return { load: u }; })()), P.data.type === 'loadAnimation') ) n.assetLoader.load( P.data.path, P.data.fullPath, function (A) { n.dataManager.completeData(A), n.postMessage({ id: P.data.id, payload: A, status: 'success' }); }, function () { n.postMessage({ id: P.data.id, status: 'error' }); } ); else if (P.data.type === 'complete') { var y = P.data.animation; n.dataManager.completeData(y), n.postMessage({ id: P.data.id, payload: y, status: 'success' }); } else P.data.type === 'loadData' && n.assetLoader.load( P.data.path, P.data.fullPath, function (A) { n.postMessage({ id: P.data.id, payload: A, status: 'success' }); }, function () { n.postMessage({ id: P.data.id, status: 'error' }); } ); })), (i.onmessage = function (p) { var P = p.data, b = P.id, y = t[b]; (t[b] = null), P.status === 'success' ? y.onComplete(P.payload) : y.onError && y.onError(); })); } function l(p, P) { e += 1; var b = 'processId_' + e; return (t[b] = { onComplete: p, onError: P }), b; } function c(p, P, b) { o(); var y = l(P, b); i.postMessage({ type: 'loadAnimation', path: p, fullPath: window.location.origin + window.location.pathname, id: y }); } function g(p, P, b) { o(); var y = l(P, b); i.postMessage({ type: 'loadData', path: p, fullPath: window.location.origin + window.location.pathname, id: y }); } function S(p, P, b) { o(); var y = l(P, b); i.postMessage({ type: 'complete', animation: p, id: y }); } return { loadAnimation: c, loadData: g, completeAnimation: S }; })(), ImagePreloader = (function () { var e = (function () { var u = createTag('canvas'); (u.width = 1), (u.height = 1); var f = u.getContext('2d'); return (f.fillStyle = 'rgba(0,0,0,0)'), f.fillRect(0, 0, 1, 1), u; })(); function t() { (this.loadedAssets += 1), this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages && this.imagesLoadedCb && this.imagesLoadedCb(null); } function r() { (this.loadedFootagesCount += 1), this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages && this.imagesLoadedCb && this.imagesLoadedCb(null); } function i(u, f, m) { var d = ''; if (u.e) d = u.p; else if (f) { var E = u.p; E.indexOf('images/') !== -1 && (E = E.split('/')[1]), (d = f + E); } else (d = m), (d += u.u ? u.u : ''), (d += u.p); return d; } function s(u) { var f = 0, m = setInterval( function () { var d = u.getBBox(); (d.width || f > 500) && (this._imageLoaded(), clearInterval(m)), (f += 1); }.bind(this), 50 ); } function n(u) { var f = i(u, this.assetsPath, this.path), m = createNS('image'); isSafari ? this.testImageLoaded(m) : m.addEventListener('load', this._imageLoaded, !1), m.addEventListener( 'error', function () { (d.img = e), this._imageLoaded(); }.bind(this), !1 ), m.setAttributeNS('http://www.w3.org/1999/xlink', 'href', f), this._elementHelper.append ? this._elementHelper.append(m) : this._elementHelper.appendChild(m); var d = { img: m, assetData: u }; return d; } function a(u) { var f = i(u, this.assetsPath, this.path), m = createTag('img'); (m.crossOrigin = 'anonymous'), m.addEventListener('load', this._imageLoaded, !1), m.addEventListener( 'error', function () { (d.img = e), this._imageLoaded(); }.bind(this), !1 ), (m.src = f); var d = { img: m, assetData: u }; return d; } function o(u) { var f = { assetData: u }, m = i(u, this.assetsPath, this.path); return ( dataManager.loadData( m, function (d) { (f.img = d), this._footageLoaded(); }.bind(this), function () { (f.img = {}), this._footageLoaded(); }.bind(this) ), f ); } function l(u, f) { this.imagesLoadedCb = f; var m, d = u.length; for (m = 0; m < d; m += 1) u[m].layers || (!u[m].t || u[m].t === 'seq' ? ((this.totalImages += 1), this.images.push(this._createImageData(u[m]))) : u[m].t === 3 && ((this.totalFootages += 1), this.images.push(this.createFootageData(u[m])))); } function c(u) { this.path = u || ''; } function g(u) { this.assetsPath = u || ''; } function S(u) { for (var f = 0, m = this.images.length; f < m; ) { if (this.images[f].assetData === u) return this.images[f].img; f += 1; } return null; } function p() { (this.imagesLoadedCb = null), (this.images.length = 0); } function P() { return this.totalImages === this.loadedAssets; } function b() { return this.totalFootages === this.loadedFootagesCount; } function y(u, f) { u === 'svg' ? ((this._elementHelper = f), (this._createImageData = this.createImageData.bind(this))) : (this._createImageData = this.createImgData.bind(this)); } function A() { (this._imageLoaded = t.bind(this)), (this._footageLoaded = r.bind(this)), (this.testImageLoaded = s.bind(this)), (this.createFootageData = o.bind(this)), (this.assetsPath = ''), (this.path = ''), (this.totalImages = 0), (this.totalFootages = 0), (this.loadedAssets = 0), (this.loadedFootagesCount = 0), (this.imagesLoadedCb = null), (this.images = []); } return ( (A.prototype = { loadAssets: l, setAssetsPath: g, setPath: c, loadedImages: P, loadedFootages: b, destroy: p, getAsset: S, createImgData: a, createImageData: n, imageLoaded: t, footageLoaded: r, setCacheType: y }), A ); })(); function BaseEvent() {} BaseEvent.prototype = { triggerEvent: function (t, r) { if (this._cbs[t]) for (var i = this._cbs[t], s = 0; s < i.length; s += 1) i[s](r); }, addEventListener: function (t, r) { return ( this._cbs[t] || (this._cbs[t] = []), this._cbs[t].push(r), function () { this.removeEventListener(t, r); }.bind(this) ); }, removeEventListener: function (t, r) { if (!r) this._cbs[t] = null; else if (this._cbs[t]) { for (var i = 0, s = this._cbs[t].length; i < s; ) this._cbs[t][i] === r && (this._cbs[t].splice(i, 1), (i -= 1), (s -= 1)), (i += 1); this._cbs[t].length || (this._cbs[t] = null); } } }; var markerParser = (function () { function e(t) { for ( var r = t.split(`\r `), i = {}, s, n = 0, a = 0; a < r.length; a += 1 ) (s = r[a].split(':')), s.length === 2 && ((i[s[0]] = s[1].trim()), (n += 1)); if (n === 0) throw new Error(); return i; } return function (t) { for (var r = [], i = 0; i < t.length; i += 1) { var s = t[i], n = { time: s.tm, duration: s.dr }; try { n.payload = JSON.parse(t[i].cm); } catch { try { n.payload = e(t[i].cm); } catch { n.payload = { name: t[i].cm }; } } r.push(n); } return r; }; })(), ProjectInterface = (function () { function e(t) { this.compositions.push(t); } return function () { function t(r) { for (var i = 0, s = this.compositions.length; i < s; ) { if ( this.compositions[i].data && this.compositions[i].data.nm === r ) return ( this.compositions[i].prepareFrame && this.compositions[i].data.xt && this.compositions[i].prepareFrame(this.currentFrame), this.compositions[i].compInterface ); i += 1; } return null; } return ( (t.compositions = []), (t.currentFrame = 0), (t.registerComposition = e), t ); }; })(), renderers = {}, registerRenderer = function (t, r) { renderers[t] = r; }; function getRenderer(e) { return renderers[e]; } function getRegisteredRenderer() { if (renderers.canvas) return 'canvas'; for (var e in renderers) if (renderers[e]) return e; return ''; } function _typeof$4(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof$4 = function (r) { return typeof r; }) : (_typeof$4 = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof$4(e) ); } var AnimationItem = function () { (this._cbs = []), (this.name = ''), (this.path = ''), (this.isLoaded = !1), (this.currentFrame = 0), (this.currentRawFrame = 0), (this.firstFrame = 0), (this.totalFrames = 0), (this.frameRate = 0), (this.frameMult = 0), (this.playSpeed = 1), (this.playDirection = 1), (this.playCount = 0), (this.animationData = {}), (this.assets = []), (this.isPaused = !0), (this.autoplay = !1), (this.loop = !0), (this.renderer = null), (this.animationID = createElementID()), (this.assetsPath = ''), (this.timeCompleted = 0), (this.segmentPos = 0), (this.isSubframeEnabled = getSubframeEnabled()), (this.segments = []), (this._idle = !0), (this._completedLoop = !1), (this.projectInterface = ProjectInterface()), (this.imagePreloader = new ImagePreloader()), (this.audioController = audioControllerFactory()), (this.markers = []), (this.configAnimation = this.configAnimation.bind(this)), (this.onSetupError = this.onSetupError.bind(this)), (this.onSegmentComplete = this.onSegmentComplete.bind(this)), (this.drawnFrameEvent = new BMEnterFrameEvent('drawnFrame', 0, 0, 0)); }; extendPrototype([BaseEvent], AnimationItem), (AnimationItem.prototype.setParams = function (e) { (e.wrapper || e.container) && (this.wrapper = e.wrapper || e.container); var t = 'svg'; e.animType ? (t = e.animType) : e.renderer && (t = e.renderer); var r = getRenderer(t); (this.renderer = new r(this, e.rendererSettings)), this.imagePreloader.setCacheType(t, this.renderer.globalData.defs), this.renderer.setProjectInterface(this.projectInterface), (this.animType = t), e.loop === '' || e.loop === null || e.loop === void 0 || e.loop === !0 ? (this.loop = !0) : e.loop === !1 ? (this.loop = !1) : (this.loop = parseInt(e.loop, 10)), (this.autoplay = 'autoplay' in e ? e.autoplay : !0), (this.name = e.name ? e.name : ''), (this.autoloadSegments = Object.prototype.hasOwnProperty.call( e, 'autoloadSegments' ) ? e.autoloadSegments : !0), (this.assetsPath = e.assetsPath), (this.initialSegment = e.initialSegment), e.audioFactory && this.audioController.setAudioFactory(e.audioFactory), e.animationData ? this.setupAnimation(e.animationData) : e.path && (e.path.lastIndexOf('\\') !== -1 ? (this.path = e.path.substr(0, e.path.lastIndexOf('\\') + 1)) : (this.path = e.path.substr(0, e.path.lastIndexOf('/') + 1)), (this.fileName = e.path.substr(e.path.lastIndexOf('/') + 1)), (this.fileName = this.fileName.substr( 0, this.fileName.lastIndexOf('.json') )), dataManager.loadAnimation( e.path, this.configAnimation, this.onSetupError )); }), (AnimationItem.prototype.onSetupError = function () { this.trigger('data_failed'); }), (AnimationItem.prototype.setupAnimation = function (e) { dataManager.completeAnimation(e, this.configAnimation); }), (AnimationItem.prototype.setData = function (e, t) { t && _typeof$4(t) !== 'object' && (t = JSON.parse(t)); var r = { wrapper: e, animationData: t }, i = e.attributes; (r.path = i.getNamedItem('data-animation-path') ? i.getNamedItem('data-animation-path').value : i.getNamedItem('data-bm-path') ? i.getNamedItem('data-bm-path').value : i.getNamedItem('bm-path') ? i.getNamedItem('bm-path').value : ''), (r.animType = i.getNamedItem('data-anim-type') ? i.getNamedItem('data-anim-type').value : i.getNamedItem('data-bm-type') ? i.getNamedItem('data-bm-type').value : i.getNamedItem('bm-type') ? i.getNamedItem('bm-type').value : i.getNamedItem('data-bm-renderer') ? i.getNamedItem('data-bm-renderer').value : i.getNamedItem('bm-renderer') ? i.getNamedItem('bm-renderer').value : getRegisteredRenderer() || 'canvas'); var s = i.getNamedItem('data-anim-loop') ? i.getNamedItem('data-anim-loop').value : i.getNamedItem('data-bm-loop') ? i.getNamedItem('data-bm-loop').value : i.getNamedItem('bm-loop') ? i.getNamedItem('bm-loop').value : ''; s === 'false' ? (r.loop = !1) : s === 'true' ? (r.loop = !0) : s !== '' && (r.loop = parseInt(s, 10)); var n = i.getNamedItem('data-anim-autoplay') ? i.getNamedItem('data-anim-autoplay').value : i.getNamedItem('data-bm-autoplay') ? i.getNamedItem('data-bm-autoplay').value : i.getNamedItem('bm-autoplay') ? i.getNamedItem('bm-autoplay').value : !0; (r.autoplay = n !== 'false'), (r.name = i.getNamedItem('data-name') ? i.getNamedItem('data-name').value : i.getNamedItem('data-bm-name') ? i.getNamedItem('data-bm-name').value : i.getNamedItem('bm-name') ? i.getNamedItem('bm-name').value : ''); var a = i.getNamedItem('data-anim-prerender') ? i.getNamedItem('data-anim-prerender').value : i.getNamedItem('data-bm-prerender') ? i.getNamedItem('data-bm-prerender').value : i.getNamedItem('bm-prerender') ? i.getNamedItem('bm-prerender').value : ''; a === 'false' && (r.prerender = !1), r.path ? this.setParams(r) : this.trigger('destroy'); }), (AnimationItem.prototype.includeLayers = function (e) { e.op > this.animationData.op && ((this.animationData.op = e.op), (this.totalFrames = Math.floor(e.op - this.animationData.ip))); var t = this.animationData.layers, r, i = t.length, s = e.layers, n, a = s.length; for (n = 0; n < a; n += 1) for (r = 0; r < i; ) { if (t[r].id === s[n].id) { t[r] = s[n]; break; } r += 1; } if ( ((e.chars || e.fonts) && (this.renderer.globalData.fontManager.addChars(e.chars), this.renderer.globalData.fontManager.addFonts( e.fonts, this.renderer.globalData.defs )), e.assets) ) for (i = e.assets.length, r = 0; r < i; r += 1) this.animationData.assets.push(e.assets[r]); (this.animationData.__complete = !1), dataManager.completeAnimation( this.animationData, this.onSegmentComplete ); }), (AnimationItem.prototype.onSegmentComplete = function (e) { this.animationData = e; var t = getExpressionsPlugin(); t && t.initExpressions(this), this.loadNextSegment(); }), (AnimationItem.prototype.loadNextSegment = function () { var e = this.animationData.segments; if (!e || e.length === 0 || !this.autoloadSegments) { this.trigger('data_ready'), (this.timeCompleted = this.totalFrames); return; } var t = e.shift(); this.timeCompleted = t.time * this.frameRate; var r = this.path + this.fileName + '_' + this.segmentPos + '.json'; (this.segmentPos += 1), dataManager.loadData( r, this.includeLayers.bind(this), function () { this.trigger('data_failed'); }.bind(this) ); }), (AnimationItem.prototype.loadSegments = function () { var e = this.animationData.segments; e || (this.timeCompleted = this.totalFrames), this.loadNextSegment(); }), (AnimationItem.prototype.imagesLoaded = function () { this.trigger('loaded_images'), this.checkLoaded(); }), (AnimationItem.prototype.preloadImages = function () { this.imagePreloader.setAssetsPath(this.assetsPath), this.imagePreloader.setPath(this.path), this.imagePreloader.loadAssets( this.animationData.assets, this.imagesLoaded.bind(this) ); }), (AnimationItem.prototype.configAnimation = function (e) { if (this.renderer) try { (this.animationData = e), this.initialSegment ? ((this.totalFrames = Math.floor( this.initialSegment[1] - this.initialSegment[0] )), (this.firstFrame = Math.round(this.initialSegment[0]))) : ((this.totalFrames = Math.floor( this.animationData.op - this.animationData.ip )), (this.firstFrame = Math.round(this.animationData.ip))), this.renderer.configAnimation(e), e.assets || (e.assets = []), (this.assets = this.animationData.assets), (this.frameRate = this.animationData.fr), (this.frameMult = this.animationData.fr / 1e3), this.renderer.searchExtraCompositions(e.assets), (this.markers = markerParser(e.markers || [])), this.trigger('config_ready'), this.preloadImages(), this.loadSegments(), this.updaFrameModifier(), this.waitForFontsLoaded(), this.isPaused && this.audioController.pause(); } catch (t) { this.triggerConfigError(t); } }), (AnimationItem.prototype.waitForFontsLoaded = function () { this.renderer && (this.renderer.globalData.fontManager.isLoaded ? this.checkLoaded() : setTimeout(this.waitForFontsLoaded.bind(this), 20)); }), (AnimationItem.prototype.checkLoaded = function () { if ( !this.isLoaded && this.renderer.globalData.fontManager.isLoaded && (this.imagePreloader.loadedImages() || this.renderer.rendererType !== 'canvas') && this.imagePreloader.loadedFootages() ) { this.isLoaded = !0; var e = getExpressionsPlugin(); e && e.initExpressions(this), this.renderer.initItems(), setTimeout( function () { this.trigger('DOMLoaded'); }.bind(this), 0 ), this.gotoFrame(), this.autoplay && this.play(); } }), (AnimationItem.prototype.resize = function (e, t) { var r = typeof e == 'number' ? e : void 0, i = typeof t == 'number' ? t : void 0; this.renderer.updateContainerSize(r, i); }), (AnimationItem.prototype.setSubframe = function (e) { this.isSubframeEnabled = !!e; }), (AnimationItem.prototype.gotoFrame = function () { (this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame), this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted && (this.currentFrame = this.timeCompleted), this.trigger('enterFrame'), this.renderFrame(), this.trigger('drawnFrame'); }), (AnimationItem.prototype.renderFrame = function () { if (!(this.isLoaded === !1 || !this.renderer)) try { this.renderer.renderFrame(this.currentFrame + this.firstFrame); } catch (e) { this.triggerRenderFrameError(e); } }), (AnimationItem.prototype.play = function (e) { (e && this.name !== e) || (this.isPaused === !0 && ((this.isPaused = !1), this.trigger('_pause'), this.audioController.resume(), this._idle && ((this._idle = !1), this.trigger('_active')))); }), (AnimationItem.prototype.pause = function (e) { (e && this.name !== e) || (this.isPaused === !1 && ((this.isPaused = !0), this.trigger('_play'), (this._idle = !0), this.trigger('_idle'), this.audioController.pause())); }), (AnimationItem.prototype.togglePause = function (e) { (e && this.name !== e) || (this.isPaused === !0 ? this.play() : this.pause()); }), (AnimationItem.prototype.stop = function (e) { (e && this.name !== e) || (this.pause(), (this.playCount = 0), (this._completedLoop = !1), this.setCurrentRawFrameValue(0)); }), (AnimationItem.prototype.getMarkerData = function (e) { for (var t, r = 0; r < this.markers.length; r += 1) if (((t = this.markers[r]), t.payload && t.payload.name === e)) return t; return null; }), (AnimationItem.prototype.goToAndStop = function (e, t, r) { if (!(r && this.name !== r)) { var i = Number(e); if (isNaN(i)) { var s = this.getMarkerData(e); s && this.goToAndStop(s.time, !0); } else t ? this.setCurrentRawFrameValue(e) : this.setCurrentRawFrameValue(e * this.frameModifier); this.pause(); } }), (AnimationItem.prototype.goToAndPlay = function (e, t, r) { if (!(r && this.name !== r)) { var i = Number(e); if (isNaN(i)) { var s = this.getMarkerData(e); s && (s.duration ? this.playSegments([s.time, s.time + s.duration], !0) : this.goToAndStop(s.time, !0)); } else this.goToAndStop(i, t, r); this.play(); } }), (AnimationItem.prototype.advanceTime = function (e) { if (!(this.isPaused === !0 || this.isLoaded === !1)) { var t = this.currentRawFrame + e * this.frameModifier, r = !1; t >= this.totalFrames - 1 && this.frameModifier > 0 ? !this.loop || this.playCount === this.loop ? this.checkSegments( t > this.totalFrames ? t % this.totalFrames : 0 ) || ((r = !0), (t = this.totalFrames - 1)) : t >= this.totalFrames ? ((this.playCount += 1), this.checkSegments(t % this.totalFrames) || (this.setCurrentRawFrameValue(t % this.totalFrames), (this._completedLoop = !0), this.trigger('loopComplete'))) : this.setCurrentRawFrameValue(t) : t < 0 ? this.checkSegments(t % this.totalFrames) || (this.loop && !(this.playCount-- <= 0 && this.loop !== !0) ? (this.setCurrentRawFrameValue( this.totalFrames + (t % this.totalFrames) ), this._completedLoop ? this.trigger('loopComplete') : (this._completedLoop = !0)) : ((r = !0), (t = 0))) : this.setCurrentRawFrameValue(t), r && (this.setCurrentRawFrameValue(t), this.pause(), this.trigger('complete')); } }), (AnimationItem.prototype.adjustSegment = function (e, t) { (this.playCount = 0), e[1] < e[0] ? (this.frameModifier > 0 && (this.playSpeed < 0 ? this.setSpeed(-this.playSpeed) : this.setDirection(-1)), (this.totalFrames = e[0] - e[1]), (this.timeCompleted = this.totalFrames), (this.firstFrame = e[1]), this.setCurrentRawFrameValue(this.totalFrames - 0.001 - t)) : e[1] > e[0] && (this.frameModifier < 0 && (this.playSpeed < 0 ? this.setSpeed(-this.playSpeed) : this.setDirection(1)), (this.totalFrames = e[1] - e[0]), (this.timeCompleted = this.totalFrames), (this.firstFrame = e[0]), this.setCurrentRawFrameValue(0.001 + t)), this.trigger('segmentStart'); }), (AnimationItem.prototype.setSegment = function (e, t) { var r = -1; this.isPaused && (this.currentRawFrame + this.firstFrame < e ? (r = e) : this.currentRawFrame + this.firstFrame > t && (r = t - e)), (this.firstFrame = e), (this.totalFrames = t - e), (this.timeCompleted = this.totalFrames), r !== -1 && this.goToAndStop(r, !0); }), (AnimationItem.prototype.playSegments = function (e, t) { if ((t && (this.segments.length = 0), _typeof$4(e[0]) === 'object')) { var r, i = e.length; for (r = 0; r < i; r += 1) this.segments.push(e[r]); } else this.segments.push(e); this.segments.length && t && this.adjustSegment(this.segments.shift(), 0), this.isPaused && this.play(); }), (AnimationItem.prototype.resetSegments = function (e) { (this.segments.length = 0), this.segments.push([this.animationData.ip, this.animationData.op]), e && this.checkSegments(0); }), (AnimationItem.prototype.checkSegments = function (e) { return this.segments.length ? (this.adjustSegment(this.segments.shift(), e), !0) : !1; }), (AnimationItem.prototype.destroy = function (e) { (e && this.name !== e) || !this.renderer || (this.renderer.destroy(), this.imagePreloader.destroy(), this.trigger('destroy'), (this._cbs = null), (this.onEnterFrame = null), (this.onLoopComplete = null), (this.onComplete = null), (this.onSegmentStart = null), (this.onDestroy = null), (this.renderer = null), (this.renderer = null), (this.imagePreloader = null), (this.projectInterface = null)); }), (AnimationItem.prototype.setCurrentRawFrameValue = function (e) { (this.currentRawFrame = e), this.gotoFrame(); }), (AnimationItem.prototype.setSpeed = function (e) { (this.playSpeed = e), this.updaFrameModifier(); }), (AnimationItem.prototype.setDirection = function (e) { (this.playDirection = e < 0 ? -1 : 1), this.updaFrameModifier(); }), (AnimationItem.prototype.setLoop = function (e) { this.loop = e; }), (AnimationItem.prototype.setVolume = function (e, t) { (t && this.name !== t) || this.audioController.setVolume(e); }), (AnimationItem.prototype.getVolume = function () { return this.audioController.getVolume(); }), (AnimationItem.prototype.mute = function (e) { (e && this.name !== e) || this.audioController.mute(); }), (AnimationItem.prototype.unmute = function (e) { (e && this.name !== e) || this.audioController.unmute(); }), (AnimationItem.prototype.updaFrameModifier = function () { (this.frameModifier = this.frameMult * this.playSpeed * this.playDirection), this.audioController.setRate(this.playSpeed * this.playDirection); }), (AnimationItem.prototype.getPath = function () { return this.path; }), (AnimationItem.prototype.getAssetsPath = function (e) { var t = ''; if (e.e) t = e.p; else if (this.assetsPath) { var r = e.p; r.indexOf('images/') !== -1 && (r = r.split('/')[1]), (t = this.assetsPath + r); } else (t = this.path), (t += e.u ? e.u : ''), (t += e.p); return t; }), (AnimationItem.prototype.getAssetData = function (e) { for (var t = 0, r = this.assets.length; t < r; ) { if (e === this.assets[t].id) return this.assets[t]; t += 1; } return null; }), (AnimationItem.prototype.hide = function () { this.renderer.hide(); }), (AnimationItem.prototype.show = function () { this.renderer.show(); }), (AnimationItem.prototype.getDuration = function (e) { return e ? this.totalFrames : this.totalFrames / this.frameRate; }), (AnimationItem.prototype.updateDocumentData = function (e, t, r) { try { var i = this.renderer.getElementByPath(e); i.updateDocumentData(t, r); } catch {} }), (AnimationItem.prototype.trigger = function (e) { if (this._cbs && this._cbs[e]) switch (e) { case 'enterFrame': this.triggerEvent( e, new BMEnterFrameEvent( e, this.currentFrame, this.totalFrames, this.frameModifier ) ); break; case 'drawnFrame': (this.drawnFrameEvent.currentTime = this.currentFrame), (this.drawnFrameEvent.totalTime = this.totalFrames), (this.drawnFrameEvent.direction = this.frameModifier), this.triggerEvent(e, this.drawnFrameEvent); break; case 'loopComplete': this.triggerEvent( e, new BMCompleteLoopEvent( e, this.loop, this.playCount, this.frameMult ) ); break; case 'complete': this.triggerEvent(e, new BMCompleteEvent(e, this.frameMult)); break; case 'segmentStart': this.triggerEvent( e, new BMSegmentStartEvent(e, this.firstFrame, this.totalFrames) ); break; case 'destroy': this.triggerEvent(e, new BMDestroyEvent(e, this)); break; default: this.triggerEvent(e); } e === 'enterFrame' && this.onEnterFrame && this.onEnterFrame.call( this, new BMEnterFrameEvent( e, this.currentFrame, this.totalFrames, this.frameMult ) ), e === 'loopComplete' && this.onLoopComplete && this.onLoopComplete.call( this, new BMCompleteLoopEvent( e, this.loop, this.playCount, this.frameMult ) ), e === 'complete' && this.onComplete && this.onComplete.call( this, new BMCompleteEvent(e, this.frameMult) ), e === 'segmentStart' && this.onSegmentStart && this.onSegmentStart.call( this, new BMSegmentStartEvent(e, this.firstFrame, this.totalFrames) ), e === 'destroy' && this.onDestroy && this.onDestroy.call(this, new BMDestroyEvent(e, this)); }), (AnimationItem.prototype.triggerRenderFrameError = function (e) { var t = new BMRenderFrameErrorEvent(e, this.currentFrame); this.triggerEvent('error', t), this.onError && this.onError.call(this, t); }), (AnimationItem.prototype.triggerConfigError = function (e) { var t = new BMConfigErrorEvent(e, this.currentFrame); this.triggerEvent('error', t), this.onError && this.onError.call(this, t); }); var animationManager = (function () { var e = {}, t = [], r = 0, i = 0, s = 0, n = !0, a = !1; function o(F) { for (var k = 0, C = F.target; k < i; ) t[k].animation === C && (t.splice(k, 1), (k -= 1), (i -= 1), C.isPaused || S()), (k += 1); } function l(F, k) { if (!F) return null; for (var C = 0; C < i; ) { if (t[C].elem === F && t[C].elem !== null) return t[C].animation; C += 1; } var M = new AnimationItem(); return p(M, F), M.setData(F, k), M; } function c() { var F, k = t.length, C = []; for (F = 0; F < k; F += 1) C.push(t[F].animation); return C; } function g() { (s += 1), V(); } function S() { s -= 1; } function p(F, k) { F.addEventListener('destroy', o), F.addEventListener('_active', g), F.addEventListener('_idle', S), t.push({ elem: k, animation: F }), (i += 1); } function P(F) { var k = new AnimationItem(); return p(k, null), k.setParams(F), k; } function b(F, k) { var C; for (C = 0; C < i; C += 1) t[C].animation.setSpeed(F, k); } function y(F, k) { var C; for (C = 0; C < i; C += 1) t[C].animation.setDirection(F, k); } function A(F) { var k; for (k = 0; k < i; k += 1) t[k].animation.play(F); } function u(F) { var k = F - r, C; for (C = 0; C < i; C += 1) t[C].animation.advanceTime(k); (r = F), s && !a ? window.requestAnimationFrame(u) : (n = !0); } function f(F) { (r = F), window.requestAnimationFrame(u); } function m(F) { var k; for (k = 0; k < i; k += 1) t[k].animation.pause(F); } function d(F, k, C) { var M; for (M = 0; M < i; M += 1) t[M].animation.goToAndStop(F, k, C); } function E(F) { var k; for (k = 0; k < i; k += 1) t[k].animation.stop(F); } function T(F) { var k; for (k = 0; k < i; k += 1) t[k].animation.togglePause(F); } function x(F) { var k; for (k = i - 1; k >= 0; k -= 1) t[k].animation.destroy(F); } function _(F, k, C) { var M = [].concat( [].slice.call(document.getElementsByClassName('lottie')), [].slice.call(document.getElementsByClassName('bodymovin')) ), R, L = M.length; for (R = 0; R < L; R += 1) C && M[R].setAttribute('data-bm-type', C), l(M[R], F); if (k && L === 0) { C || (C = 'svg'); var j = document.getElementsByTagName('body')[0]; j.innerText = ''; var z = createTag('div'); (z.style.width = '100%'), (z.style.height = '100%'), z.setAttribute('data-bm-type', C), j.appendChild(z), l(z, F); } } function I() { var F; for (F = 0; F < i; F += 1) t[F].animation.resize(); } function V() { !a && s && n && (window.requestAnimationFrame(f), (n = !1)); } function D() { a = !0; } function N() { (a = !1), V(); } function $(F, k) { var C; for (C = 0; C < i; C += 1) t[C].animation.setVolume(F, k); } function O(F) { var k; for (k = 0; k < i; k += 1) t[k].animation.mute(F); } function B(F) { var k; for (k = 0; k < i; k += 1) t[k].animation.unmute(F); } return ( (e.registerAnimation = l), (e.loadAnimation = P), (e.setSpeed = b), (e.setDirection = y), (e.play = A), (e.pause = m), (e.stop = E), (e.togglePause = T), (e.searchAnimations = _), (e.resize = I), (e.goToAndStop = d), (e.destroy = x), (e.freeze = D), (e.unfreeze = N), (e.setVolume = $), (e.mute = O), (e.unmute = B), (e.getRegisteredAnimations = c), e ); })(), BezierFactory = (function () { var e = {}; e.getBezierEasing = r; var t = {}; function r(f, m, d, E, T) { var x = T || ('bez_' + f + '_' + m + '_' + d + '_' + E).replace(/\./g, 'p'); if (t[x]) return t[x]; var _ = new u([f, m, d, E]); return (t[x] = _), _; } var i = 4, s = 0.001, n = 1e-7, a = 10, o = 11, l = 1 / (o - 1), c = typeof Float32Array == 'function'; function g(f, m) { return 1 - 3 * m + 3 * f; } function S(f, m) { return 3 * m - 6 * f; } function p(f) { return 3 * f; } function P(f, m, d) { return ((g(m, d) * f + S(m, d)) * f + p(m)) * f; } function b(f, m, d) { return 3 * g(m, d) * f * f + 2 * S(m, d) * f + p(m); } function y(f, m, d, E, T) { var x, _, I = 0; do (_ = m + (d - m) / 2), (x = P(_, E, T) - f), x > 0 ? (d = _) : (m = _); while (Math.abs(x) > n && ++I < a); return _; } function A(f, m, d, E) { for (var T = 0; T < i; ++T) { var x = b(m, d, E); if (x === 0) return m; var _ = P(m, d, E) - f; m -= _ / x; } return m; } function u(f) { (this._p = f), (this._mSampleValues = c ? new Float32Array(o) : new Array(o)), (this._precomputed = !1), (this.get = this.get.bind(this)); } return ( (u.prototype = { get: function (m) { var d = this._p[0], E = this._p[1], T = this._p[2], x = this._p[3]; return ( this._precomputed || this._precompute(), d === E && T === x ? m : m === 0 ? 0 : m === 1 ? 1 : P(this._getTForX(m), E, x) ); }, _precompute: function () { var m = this._p[0], d = this._p[1], E = this._p[2], T = this._p[3]; (this._precomputed = !0), (m !== d || E !== T) && this._calcSampleValues(); }, _calcSampleValues: function () { for (var m = this._p[0], d = this._p[2], E = 0; E < o; ++E) this._mSampleValues[E] = P(E * l, m, d); }, _getTForX: function (m) { for ( var d = this._p[0], E = this._p[2], T = this._mSampleValues, x = 0, _ = 1, I = o - 1; _ !== I && T[_] <= m; ++_ ) x += l; --_; var V = (m - T[_]) / (T[_ + 1] - T[_]), D = x + V * l, N = b(D, d, E); return N >= s ? A(m, D, d, E) : N === 0 ? D : y(m, x, x + l, d, E); } }), e ); })(), pooling = (function () { function e(t) { return t.concat(createSizedArray(t.length)); } return { double: e }; })(), poolFactory = (function () { return function (e, t, r) { var i = 0, s = e, n = createSizedArray(s), a = { newElement: o, release: l }; function o() { var c; return i ? ((i -= 1), (c = n[i])) : (c = t()), c; } function l(c) { i === s && ((n = pooling.double(n)), (s *= 2)), r && r(c), (n[i] = c), (i += 1); } return a; }; })(), bezierLengthPool = (function () { function e() { return { addedLength: 0, percents: createTypedArray('float32', getDefaultCurveSegments()), lengths: createTypedArray('float32', getDefaultCurveSegments()) }; } return poolFactory(8, e); })(), segmentsLengthPool = (function () { function e() { return { lengths: [], totalLength: 0 }; } function t(r) { var i, s = r.lengths.length; for (i = 0; i < s; i += 1) bezierLengthPool.release(r.lengths[i]); r.lengths.length = 0; } return poolFactory(8, e, t); })(); function bezFunction() { var e = Math; function t(p, P, b, y, A, u) { var f = p * y + P * A + b * u - A * y - u * p - b * P; return f > -0.001 && f < 0.001; } function r(p, P, b, y, A, u, f, m, d) { if (b === 0 && u === 0 && d === 0) return t(p, P, y, A, f, m); var E = e.sqrt(e.pow(y - p, 2) + e.pow(A - P, 2) + e.pow(u - b, 2)), T = e.sqrt(e.pow(f - p, 2) + e.pow(m - P, 2) + e.pow(d - b, 2)), x = e.sqrt(e.pow(f - y, 2) + e.pow(m - A, 2) + e.pow(d - u, 2)), _; return ( E > T ? E > x ? (_ = E - T - x) : (_ = x - T - E) : x > T ? (_ = x - T - E) : (_ = T - E - x), _ > -1e-4 && _ < 1e-4 ); } var i = (function () { return function (p, P, b, y) { var A = getDefaultCurveSegments(), u, f, m, d, E, T = 0, x, _ = [], I = [], V = bezierLengthPool.newElement(); for (m = b.length, u = 0; u < A; u += 1) { for (E = u / (A - 1), x = 0, f = 0; f < m; f += 1) (d = bmPow(1 - E, 3) * p[f] + 3 * bmPow(1 - E, 2) * E * b[f] + 3 * (1 - E) * bmPow(E, 2) * y[f] + bmPow(E, 3) * P[f]), (_[f] = d), I[f] !== null && (x += bmPow(_[f] - I[f], 2)), (I[f] = _[f]); x && ((x = bmSqrt(x)), (T += x)), (V.percents[u] = E), (V.lengths[u] = T); } return (V.addedLength = T), V; }; })(); function s(p) { var P = segmentsLengthPool.newElement(), b = p.c, y = p.v, A = p.o, u = p.i, f, m = p._length, d = P.lengths, E = 0; for (f = 0; f < m - 1; f += 1) (d[f] = i(y[f], y[f + 1], A[f], u[f + 1])), (E += d[f].addedLength); return ( b && m && ((d[f] = i(y[f], y[0], A[f], u[0])), (E += d[f].addedLength)), (P.totalLength = E), P ); } function n(p) { (this.segmentLength = 0), (this.points = new Array(p)); } function a(p, P) { (this.partialLength = p), (this.point = P); } var o = (function () { var p = {}; return function (P, b, y, A) { var u = ( P[0] + '_' + P[1] + '_' + b[0] + '_' + b[1] + '_' + y[0] + '_' + y[1] + '_' + A[0] + '_' + A[1] ).replace(/\./g, 'p'); if (!p[u]) { var f = getDefaultCurveSegments(), m, d, E, T, x, _ = 0, I, V, D = null; P.length === 2 && (P[0] !== b[0] || P[1] !== b[1]) && t(P[0], P[1], b[0], b[1], P[0] + y[0], P[1] + y[1]) && t(P[0], P[1], b[0], b[1], b[0] + A[0], b[1] + A[1]) && (f = 2); var N = new n(f); for (E = y.length, m = 0; m < f; m += 1) { for ( V = createSizedArray(E), x = m / (f - 1), I = 0, d = 0; d < E; d += 1 ) (T = bmPow(1 - x, 3) * P[d] + 3 * bmPow(1 - x, 2) * x * (P[d] + y[d]) + 3 * (1 - x) * bmPow(x, 2) * (b[d] + A[d]) + bmPow(x, 3) * b[d]), (V[d] = T), D !== null && (I += bmPow(V[d] - D[d], 2)); (I = bmSqrt(I)), (_ += I), (N.points[m] = new a(I, V)), (D = V); } (N.segmentLength = _), (p[u] = N); } return p[u]; }; })(); function l(p, P) { var b = P.percents, y = P.lengths, A = b.length, u = bmFloor((A - 1) * p), f = p * P.addedLength, m = 0; if (u === A - 1 || u === 0 || f === y[u]) return b[u]; for (var d = y[u] > f ? -1 : 1, E = !0; E; ) if ( (y[u] <= f && y[u + 1] > f ? ((m = (f - y[u]) / (y[u + 1] - y[u])), (E = !1)) : (u += d), u < 0 || u >= A - 1) ) { if (u === A - 1) return b[u]; E = !1; } return b[u] + (b[u + 1] - b[u]) * m; } function c(p, P, b, y, A, u) { var f = l(A, u), m = 1 - f, d = e.round( (m * m * m * p[0] + (f * m * m + m * f * m + m * m * f) * b[0] + (f * f * m + m * f * f + f * m * f) * y[0] + f * f * f * P[0]) * 1e3 ) / 1e3, E = e.round( (m * m * m * p[1] + (f * m * m + m * f * m + m * m * f) * b[1] + (f * f * m + m * f * f + f * m * f) * y[1] + f * f * f * P[1]) * 1e3 ) / 1e3; return [d, E]; } var g = createTypedArray('float32', 8); function S(p, P, b, y, A, u, f) { A < 0 ? (A = 0) : A > 1 && (A = 1); var m = l(A, f); u = u > 1 ? 1 : u; var d = l(u, f), E, T = p.length, x = 1 - m, _ = 1 - d, I = x * x * x, V = m * x * x * 3, D = m * m * x * 3, N = m * m * m, $ = x * x * _, O = m * x * _ + x * m * _ + x * x * d, B = m * m * _ + x * m * d + m * x * d, F = m * m * d, k = x * _ * _, C = m * _ * _ + x * d * _ + x * _ * d, M = m * d * _ + x * d * d + m * _ * d, R = m * d * d, L = _ * _ * _, j = d * _ * _ + _ * d * _ + _ * _ * d, z = d * d * _ + _ * d * d + d * _ * d, H = d * d * d; for (E = 0; E < T; E += 1) (g[E * 4] = e.round((I * p[E] + V * b[E] + D * y[E] + N * P[E]) * 1e3) / 1e3), (g[E * 4 + 1] = e.round(($ * p[E] + O * b[E] + B * y[E] + F * P[E]) * 1e3) / 1e3), (g[E * 4 + 2] = e.round((k * p[E] + C * b[E] + M * y[E] + R * P[E]) * 1e3) / 1e3), (g[E * 4 + 3] = e.round((L * p[E] + j * b[E] + z * y[E] + H * P[E]) * 1e3) / 1e3); return g; } return { getSegmentsLength: s, getNewSegment: S, getPointInSegment: c, buildBezierData: o, pointOnLine2D: t, pointOnLine3D: r }; } var bez = bezFunction(), initFrame = initialDefaultFrame, mathAbs = Math.abs; function interpolateValue(e, t) { var r = this.offsetTime, i; this.propType === 'multidimensional' && (i = createTypedArray('float32', this.pv.length)); for ( var s = t.lastIndex, n = s, a = this.keyframes.length - 1, o = !0, l, c, g; o; ) { if ( ((l = this.keyframes[n]), (c = this.keyframes[n + 1]), n === a - 1 && e >= c.t - r) ) { l.h && (l = c), (s = 0); break; } if (c.t - r > e) { s = n; break; } n < a - 1 ? (n += 1) : ((s = 0), (o = !1)); } g = this.keyframesMetadata[n] || {}; var S, p, P, b, y, A, u = c.t - r, f = l.t - r, m; if (l.to) { g.bezierData || (g.bezierData = bez.buildBezierData(l.s, c.s || l.e, l.to, l.ti)); var d = g.bezierData; if (e >= u || e < f) { var E = e >= u ? d.points.length - 1 : 0; for (p = d.points[E].point.length, S = 0; S < p; S += 1) i[S] = d.points[E].point[S]; } else { g.__fnct ? (A = g.__fnct) : ((A = BezierFactory.getBezierEasing( l.o.x, l.o.y, l.i.x, l.i.y, l.n ).get), (g.__fnct = A)), (P = A((e - f) / (u - f))); var T = d.segmentLength * P, x, _ = t.lastFrame < e && t._lastKeyframeIndex === n ? t._lastAddedLength : 0; for ( y = t.lastFrame < e && t._lastKeyframeIndex === n ? t._lastPoint : 0, o = !0, b = d.points.length; o; ) { if ( ((_ += d.points[y].partialLength), T === 0 || P === 0 || y === d.points.length - 1) ) { for (p = d.points[y].point.length, S = 0; S < p; S += 1) i[S] = d.points[y].point[S]; break; } else if (T >= _ && T < _ + d.points[y + 1].partialLength) { for ( x = (T - _) / d.points[y + 1].partialLength, p = d.points[y].point.length, S = 0; S < p; S += 1 ) i[S] = d.points[y].point[S] + (d.points[y + 1].point[S] - d.points[y].point[S]) * x; break; } y < b - 1 ? (y += 1) : (o = !1); } (t._lastPoint = y), (t._lastAddedLength = _ - d.points[y].partialLength), (t._lastKeyframeIndex = n); } } else { var I, V, D, N, $; if (((a = l.s.length), (m = c.s || l.e), this.sh && l.h !== 1)) if (e >= u) (i[0] = m[0]), (i[1] = m[1]), (i[2] = m[2]); else if (e <= f) (i[0] = l.s[0]), (i[1] = l.s[1]), (i[2] = l.s[2]); else { var O = createQuaternion(l.s), B = createQuaternion(m), F = (e - f) / (u - f); quaternionToEuler(i, slerp(O, B, F)); } else for (n = 0; n < a; n += 1) l.h !== 1 && (e >= u ? (P = 1) : e < f ? (P = 0) : (l.o.x.constructor === Array ? (g.__fnct || (g.__fnct = []), g.__fnct[n] ? (A = g.__fnct[n]) : ((I = l.o.x[n] === void 0 ? l.o.x[0] : l.o.x[n]), (V = l.o.y[n] === void 0 ? l.o.y[0] : l.o.y[n]), (D = l.i.x[n] === void 0 ? l.i.x[0] : l.i.x[n]), (N = l.i.y[n] === void 0 ? l.i.y[0] : l.i.y[n]), (A = BezierFactory.getBezierEasing(I, V, D, N).get), (g.__fnct[n] = A))) : g.__fnct ? (A = g.__fnct) : ((I = l.o.x), (V = l.o.y), (D = l.i.x), (N = l.i.y), (A = BezierFactory.getBezierEasing(I, V, D, N).get), (l.keyframeMetadata = A)), (P = A((e - f) / (u - f))))), (m = c.s || l.e), ($ = l.h === 1 ? l.s[n] : l.s[n] + (m[n] - l.s[n]) * P), this.propType === 'multidimensional' ? (i[n] = $) : (i = $); } return (t.lastIndex = s), i; } function slerp(e, t, r) { var i = [], s = e[0], n = e[1], a = e[2], o = e[3], l = t[0], c = t[1], g = t[2], S = t[3], p, P, b, y, A; return ( (P = s * l + n * c + a * g + o * S), P < 0 && ((P = -P), (l = -l), (c = -c), (g = -g), (S = -S)), 1 - P > 1e-6 ? ((p = Math.acos(P)), (b = Math.sin(p)), (y = Math.sin((1 - r) * p) / b), (A = Math.sin(r * p) / b)) : ((y = 1 - r), (A = r)), (i[0] = y * s + A * l), (i[1] = y * n + A * c), (i[2] = y * a + A * g), (i[3] = y * o + A * S), i ); } function quaternionToEuler(e, t) { var r = t[0], i = t[1], s = t[2], n = t[3], a = Math.atan2(2 * i * n - 2 * r * s, 1 - 2 * i * i - 2 * s * s), o = Math.asin(2 * r * i + 2 * s * n), l = Math.atan2(2 * r * n - 2 * i * s, 1 - 2 * r * r - 2 * s * s); (e[0] = a / degToRads), (e[1] = o / degToRads), (e[2] = l / degToRads); } function createQuaternion(e) { var t = e[0] * degToRads, r = e[1] * degToRads, i = e[2] * degToRads, s = Math.cos(t / 2), n = Math.cos(r / 2), a = Math.cos(i / 2), o = Math.sin(t / 2), l = Math.sin(r / 2), c = Math.sin(i / 2), g = s * n * a - o * l * c, S = o * l * a + s * n * c, p = o * n * a + s * l * c, P = s * l * a - o * n * c; return [S, p, P, g]; } function getValueAtCurrentTime() { var e = this.comp.renderedFrame - this.offsetTime, t = this.keyframes[0].t - this.offsetTime, r = this.keyframes[this.keyframes.length - 1].t - this.offsetTime; if ( !( e === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= r && e >= r) || (this._caching.lastFrame < t && e < t))) ) ) { this._caching.lastFrame >= e && ((this._caching._lastKeyframeIndex = -1), (this._caching.lastIndex = 0)); var i = this.interpolateValue(e, this._caching); this.pv = i; } return (this._caching.lastFrame = e), this.pv; } function setVValue(e) { var t; if (this.propType === 'unidimensional') (t = e * this.mult), mathAbs(this.v - t) > 1e-5 && ((this.v = t), (this._mdf = !0)); else for (var r = 0, i = this.v.length; r < i; ) (t = e[r] * this.mult), mathAbs(this.v[r] - t) > 1e-5 && ((this.v[r] = t), (this._mdf = !0)), (r += 1); } function processEffectsSequence() { if ( !( this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length ) ) { if (this.lock) { this.setVValue(this.pv); return; } (this.lock = !0), (this._mdf = this._isFirstFrame); var e, t = this.effectsSequence.length, r = this.kf ? this.pv : this.data.k; for (e = 0; e < t; e += 1) r = this.effectsSequence[e](r); this.setVValue(r), (this._isFirstFrame = !1), (this.lock = !1), (this.frameId = this.elem.globalData.frameId); } } function addEffect(e) { this.effectsSequence.push(e), this.container.addDynamicProperty(this); } function ValueProperty(e, t, r, i) { (this.propType = 'unidimensional'), (this.mult = r || 1), (this.data = t), (this.v = r ? t.k * r : t.k), (this.pv = t.k), (this._mdf = !1), (this.elem = e), (this.container = i), (this.comp = e.comp), (this.k = !1), (this.kf = !1), (this.vel = 0), (this.effectsSequence = []), (this._isFirstFrame = !0), (this.getValue = processEffectsSequence), (this.setVValue = setVValue), (this.addEffect = addEffect); } function MultiDimensionalProperty(e, t, r, i) { (this.propType = 'multidimensional'), (this.mult = r || 1), (this.data = t), (this._mdf = !1), (this.elem = e), (this.container = i), (this.comp = e.comp), (this.k = !1), (this.kf = !1), (this.frameId = -1); var s, n = t.k.length; for ( this.v = createTypedArray('float32', n), this.pv = createTypedArray('float32', n), this.vel = createTypedArray('float32', n), s = 0; s < n; s += 1 ) (this.v[s] = t.k[s] * this.mult), (this.pv[s] = t.k[s]); (this._isFirstFrame = !0), (this.effectsSequence = []), (this.getValue = processEffectsSequence), (this.setVValue = setVValue), (this.addEffect = addEffect); } function KeyframedValueProperty(e, t, r, i) { (this.propType = 'unidimensional'), (this.keyframes = t.k), (this.keyframesMetadata = []), (this.offsetTime = e.data.st), (this.frameId = -1), (this._caching = { lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1 }), (this.k = !0), (this.kf = !0), (this.data = t), (this.mult = r || 1), (this.elem = e), (this.container = i), (this.comp = e.comp), (this.v = initFrame), (this.pv = initFrame), (this._isFirstFrame = !0), (this.getValue = processEffectsSequence), (this.setVValue = setVValue), (this.interpolateValue = interpolateValue), (this.effectsSequence = [getValueAtCurrentTime.bind(this)]), (this.addEffect = addEffect); } function KeyframedMultidimensionalProperty(e, t, r, i) { this.propType = 'multidimensional'; var s, n = t.k.length, a, o, l, c; for (s = 0; s < n - 1; s += 1) t.k[s].to && t.k[s].s && t.k[s + 1] && t.k[s + 1].s && ((a = t.k[s].s), (o = t.k[s + 1].s), (l = t.k[s].to), (c = t.k[s].ti), ((a.length === 2 && !(a[0] === o[0] && a[1] === o[1]) && bez.pointOnLine2D( a[0], a[1], o[0], o[1], a[0] + l[0], a[1] + l[1] ) && bez.pointOnLine2D( a[0], a[1], o[0], o[1], o[0] + c[0], o[1] + c[1] )) || (a.length === 3 && !(a[0] === o[0] && a[1] === o[1] && a[2] === o[2]) && bez.pointOnLine3D( a[0], a[1], a[2], o[0], o[1], o[2], a[0] + l[0], a[1] + l[1], a[2] + l[2] ) && bez.pointOnLine3D( a[0], a[1], a[2], o[0], o[1], o[2], o[0] + c[0], o[1] + c[1], o[2] + c[2] ))) && ((t.k[s].to = null), (t.k[s].ti = null)), a[0] === o[0] && a[1] === o[1] && l[0] === 0 && l[1] === 0 && c[0] === 0 && c[1] === 0 && (a.length === 2 || (a[2] === o[2] && l[2] === 0 && c[2] === 0)) && ((t.k[s].to = null), (t.k[s].ti = null))); (this.effectsSequence = [getValueAtCurrentTime.bind(this)]), (this.data = t), (this.keyframes = t.k), (this.keyframesMetadata = []), (this.offsetTime = e.data.st), (this.k = !0), (this.kf = !0), (this._isFirstFrame = !0), (this.mult = r || 1), (this.elem = e), (this.container = i), (this.comp = e.comp), (this.getValue = processEffectsSequence), (this.setVValue = setVValue), (this.interpolateValue = interpolateValue), (this.frameId = -1); var g = t.k[0].s.length; for ( this.v = createTypedArray('float32', g), this.pv = createTypedArray('float32', g), s = 0; s < g; s += 1 ) (this.v[s] = initFrame), (this.pv[s] = initFrame); (this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', g) }), (this.addEffect = addEffect); } var PropertyFactory = (function () { function e(r, i, s, n, a) { i.sid && (i = r.globalData.slotManager.getProp(i)); var o; if (!i.k.length) o = new ValueProperty(r, i, n, a); else if (typeof i.k[0] == 'number') o = new MultiDimensionalProperty(r, i, n, a); else switch (s) { case 0: o = new KeyframedValueProperty(r, i, n, a); break; case 1: o = new KeyframedMultidimensionalProperty(r, i, n, a); break; } return o.effectsSequence.length && a.addDynamicProperty(o), o; } var t = { getProp: e }; return t; })(); function DynamicPropertyContainer() {} DynamicPropertyContainer.prototype = { addDynamicProperty: function (t) { this.dynamicProperties.indexOf(t) === -1 && (this.dynamicProperties.push(t), this.container.addDynamicProperty(this), (this._isAnimated = !0)); }, iterateDynamicProperties: function () { this._mdf = !1; var t, r = this.dynamicProperties.length; for (t = 0; t < r; t += 1) this.dynamicProperties[t].getValue(), this.dynamicProperties[t]._mdf && (this._mdf = !0); }, initDynamicPropertyContainer: function (t) { (this.container = t), (this.dynamicProperties = []), (this._mdf = !1), (this._isAnimated = !1); } }; var pointPool = (function () { function e() { return createTypedArray('float32', 2); } return poolFactory(8, e); })(); function ShapePath() { (this.c = !1), (this._length = 0), (this._maxLength = 8), (this.v = createSizedArray(this._maxLength)), (this.o = createSizedArray(this._maxLength)), (this.i = createSizedArray(this._maxLength)); } (ShapePath.prototype.setPathData = function (e, t) { (this.c = e), this.setLength(t); for (var r = 0; r < t; ) (this.v[r] = pointPool.newElement()), (this.o[r] = pointPool.newElement()), (this.i[r] = pointPool.newElement()), (r += 1); }), (ShapePath.prototype.setLength = function (e) { for (; this._maxLength < e; ) this.doubleArrayLength(); this._length = e; }), (ShapePath.prototype.doubleArrayLength = function () { (this.v = this.v.concat(createSizedArray(this._maxLength))), (this.i = this.i.concat(createSizedArray(this._maxLength))), (this.o = this.o.concat(createSizedArray(this._maxLength))), (this._maxLength *= 2); }), (ShapePath.prototype.setXYAt = function (e, t, r, i, s) { var n; switch ( ((this._length = Math.max(this._length, i + 1)), this._length >= this._maxLength && this.doubleArrayLength(), r) ) { case 'v': n = this.v; break; case 'i': n = this.i; break; case 'o': n = this.o; break; default: n = []; break; } (!n[i] || (n[i] && !s)) && (n[i] = pointPool.newElement()), (n[i][0] = e), (n[i][1] = t); }), (ShapePath.prototype.setTripleAt = function (e, t, r, i, s, n, a, o) { this.setXYAt(e, t, 'v', a, o), this.setXYAt(r, i, 'o', a, o), this.setXYAt(s, n, 'i', a, o); }), (ShapePath.prototype.reverse = function () { var e = new ShapePath(); e.setPathData(this.c, this._length); var t = this.v, r = this.o, i = this.i, s = 0; this.c && (e.setTripleAt( t[0][0], t[0][1], i[0][0], i[0][1], r[0][0], r[0][1], 0, !1 ), (s = 1)); var n = this._length - 1, a = this._length, o; for (o = s; o < a; o += 1) e.setTripleAt( t[n][0], t[n][1], i[n][0], i[n][1], r[n][0], r[n][1], o, !1 ), (n -= 1); return e; }), (ShapePath.prototype.length = function () { return this._length; }); var shapePool = (function () { function e() { return new ShapePath(); } function t(s) { var n = s._length, a; for (a = 0; a < n; a += 1) pointPool.release(s.v[a]), pointPool.release(s.i[a]), pointPool.release(s.o[a]), (s.v[a] = null), (s.i[a] = null), (s.o[a] = null); (s._length = 0), (s.c = !1); } function r(s) { var n = i.newElement(), a, o = s._length === void 0 ? s.v.length : s._length; for (n.setLength(o), n.c = s.c, a = 0; a < o; a += 1) n.setTripleAt( s.v[a][0], s.v[a][1], s.o[a][0], s.o[a][1], s.i[a][0], s.i[a][1], a ); return n; } var i = poolFactory(4, e, t); return (i.clone = r), i; })(); function ShapeCollection() { (this._length = 0), (this._maxLength = 4), (this.shapes = createSizedArray(this._maxLength)); } (ShapeCollection.prototype.addShape = function (e) { this._length === this._maxLength && ((this.shapes = this.shapes.concat( createSizedArray(this._maxLength) )), (this._maxLength *= 2)), (this.shapes[this._length] = e), (this._length += 1); }), (ShapeCollection.prototype.releaseShapes = function () { var e; for (e = 0; e < this._length; e += 1) shapePool.release(this.shapes[e]); this._length = 0; }); var shapeCollectionPool = (function () { var e = { newShapeCollection: s, release: n }, t = 0, r = 4, i = createSizedArray(r); function s() { var a; return t ? ((t -= 1), (a = i[t])) : (a = new ShapeCollection()), a; } function n(a) { var o, l = a._length; for (o = 0; o < l; o += 1) shapePool.release(a.shapes[o]); (a._length = 0), t === r && ((i = pooling.double(i)), (r *= 2)), (i[t] = a), (t += 1); } return e; })(), ShapePropertyFactory = (function () { var e = -999999; function t(u, f, m) { var d = m.lastIndex, E, T, x, _, I, V, D, N, $, O = this.keyframes; if (u < O[0].t - this.offsetTime) (E = O[0].s[0]), (x = !0), (d = 0); else if (u >= O[O.length - 1].t - this.offsetTime) (E = O[O.length - 1].s ? O[O.length - 1].s[0] : O[O.length - 2].e[0]), (x = !0); else { for ( var B = d, F = O.length - 1, k = !0, C, M, R; k && ((C = O[B]), (M = O[B + 1]), !(M.t - this.offsetTime > u)); ) B < F - 1 ? (B += 1) : (k = !1); if ( ((R = this.keyframesMetadata[B] || {}), (x = C.h === 1), (d = B), !x) ) { if (u >= M.t - this.offsetTime) N = 1; else if (u < C.t - this.offsetTime) N = 0; else { var L; R.__fnct ? (L = R.__fnct) : ((L = BezierFactory.getBezierEasing( C.o.x, C.o.y, C.i.x, C.i.y ).get), (R.__fnct = L)), (N = L( (u - (C.t - this.offsetTime)) / (M.t - this.offsetTime - (C.t - this.offsetTime)) )); } T = M.s ? M.s[0] : C.e[0]; } E = C.s[0]; } for ( V = f._length, D = E.i[0].length, m.lastIndex = d, _ = 0; _ < V; _ += 1 ) for (I = 0; I < D; I += 1) ($ = x ? E.i[_][I] : E.i[_][I] + (T.i[_][I] - E.i[_][I]) * N), (f.i[_][I] = $), ($ = x ? E.o[_][I] : E.o[_][I] + (T.o[_][I] - E.o[_][I]) * N), (f.o[_][I] = $), ($ = x ? E.v[_][I] : E.v[_][I] + (T.v[_][I] - E.v[_][I]) * N), (f.v[_][I] = $); } function r() { var u = this.comp.renderedFrame - this.offsetTime, f = this.keyframes[0].t - this.offsetTime, m = this.keyframes[this.keyframes.length - 1].t - this.offsetTime, d = this._caching.lastFrame; return ( (d !== e && ((d < f && u < f) || (d > m && u > m))) || ((this._caching.lastIndex = d < u ? this._caching.lastIndex : 0), this.interpolateShape(u, this.pv, this._caching)), (this._caching.lastFrame = u), this.pv ); } function i() { this.paths = this.localShapeCollection; } function s(u, f) { if (u._length !== f._length || u.c !== f.c) return !1; var m, d = u._length; for (m = 0; m < d; m += 1) if ( u.v[m][0] !== f.v[m][0] || u.v[m][1] !== f.v[m][1] || u.o[m][0] !== f.o[m][0] || u.o[m][1] !== f.o[m][1] || u.i[m][0] !== f.i[m][0] || u.i[m][1] !== f.i[m][1] ) return !1; return !0; } function n(u) { s(this.v, u) || ((this.v = shapePool.clone(u)), this.localShapeCollection.releaseShapes(), this.localShapeCollection.addShape(this.v), (this._mdf = !0), (this.paths = this.localShapeCollection)); } function a() { if (this.elem.globalData.frameId !== this.frameId) { if (!this.effectsSequence.length) { this._mdf = !1; return; } if (this.lock) { this.setVValue(this.pv); return; } (this.lock = !0), (this._mdf = !1); var u; this.kf ? (u = this.pv) : this.data.ks ? (u = this.data.ks.k) : (u = this.data.pt.k); var f, m = this.effectsSequence.length; for (f = 0; f < m; f += 1) u = this.effectsSequence[f](u); this.setVValue(u), (this.lock = !1), (this.frameId = this.elem.globalData.frameId); } } function o(u, f, m) { (this.propType = 'shape'), (this.comp = u.comp), (this.container = u), (this.elem = u), (this.data = f), (this.k = !1), (this.kf = !1), (this._mdf = !1); var d = m === 3 ? f.pt.k : f.ks.k; (this.v = shapePool.clone(d)), (this.pv = shapePool.clone(this.v)), (this.localShapeCollection = shapeCollectionPool.newShapeCollection()), (this.paths = this.localShapeCollection), this.paths.addShape(this.v), (this.reset = i), (this.effectsSequence = []); } function l(u) { this.effectsSequence.push(u), this.container.addDynamicProperty(this); } (o.prototype.interpolateShape = t), (o.prototype.getValue = a), (o.prototype.setVValue = n), (o.prototype.addEffect = l); function c(u, f, m) { (this.propType = 'shape'), (this.comp = u.comp), (this.elem = u), (this.container = u), (this.offsetTime = u.data.st), (this.keyframes = m === 3 ? f.pt.k : f.ks.k), (this.keyframesMetadata = []), (this.k = !0), (this.kf = !0); var d = this.keyframes[0].s[0].i.length; (this.v = shapePool.newElement()), this.v.setPathData(this.keyframes[0].s[0].c, d), (this.pv = shapePool.clone(this.v)), (this.localShapeCollection = shapeCollectionPool.newShapeCollection()), (this.paths = this.localShapeCollection), this.paths.addShape(this.v), (this.lastFrame = e), (this.reset = i), (this._caching = { lastFrame: e, lastIndex: 0 }), (this.effectsSequence = [r.bind(this)]); } (c.prototype.getValue = a), (c.prototype.interpolateShape = t), (c.prototype.setVValue = n), (c.prototype.addEffect = l); var g = (function () { var u = roundCorner; function f(m, d) { (this.v = shapePool.newElement()), this.v.setPathData(!0, 4), (this.localShapeCollection = shapeCollectionPool.newShapeCollection()), (this.paths = this.localShapeCollection), this.localShapeCollection.addShape(this.v), (this.d = d.d), (this.elem = m), (this.comp = m.comp), (this.frameId = -1), this.initDynamicPropertyContainer(m), (this.p = PropertyFactory.getProp(m, d.p, 1, 0, this)), (this.s = PropertyFactory.getProp(m, d.s, 1, 0, this)), this.dynamicProperties.length ? (this.k = !0) : ((this.k = !1), this.convertEllToPath()); } return ( (f.prototype = { reset: i, getValue: function () { this.elem.globalData.frameId !== this.frameId && ((this.frameId = this.elem.globalData.frameId), this.iterateDynamicProperties(), this._mdf && this.convertEllToPath()); }, convertEllToPath: function () { var d = this.p.v[0], E = this.p.v[1], T = this.s.v[0] / 2, x = this.s.v[1] / 2, _ = this.d !== 3, I = this.v; (I.v[0][0] = d), (I.v[0][1] = E - x), (I.v[1][0] = _ ? d + T : d - T), (I.v[1][1] = E), (I.v[2][0] = d), (I.v[2][1] = E + x), (I.v[3][0] = _ ? d - T : d + T), (I.v[3][1] = E), (I.i[0][0] = _ ? d - T * u : d + T * u), (I.i[0][1] = E - x), (I.i[1][0] = _ ? d + T : d - T), (I.i[1][1] = E - x * u), (I.i[2][0] = _ ? d + T * u : d - T * u), (I.i[2][1] = E + x), (I.i[3][0] = _ ? d - T : d + T), (I.i[3][1] = E + x * u), (I.o[0][0] = _ ? d + T * u : d - T * u), (I.o[0][1] = E - x), (I.o[1][0] = _ ? d + T : d - T), (I.o[1][1] = E + x * u), (I.o[2][0] = _ ? d - T * u : d + T * u), (I.o[2][1] = E + x), (I.o[3][0] = _ ? d - T : d + T), (I.o[3][1] = E - x * u); } }), extendPrototype([DynamicPropertyContainer], f), f ); })(), S = (function () { function u(f, m) { (this.v = shapePool.newElement()), this.v.setPathData(!0, 0), (this.elem = f), (this.comp = f.comp), (this.data = m), (this.frameId = -1), (this.d = m.d), this.initDynamicPropertyContainer(f), m.sy === 1 ? ((this.ir = PropertyFactory.getProp(f, m.ir, 0, 0, this)), (this.is = PropertyFactory.getProp( f, m.is, 0, 0.01, this )), (this.convertToPath = this.convertStarToPath)) : (this.convertToPath = this.convertPolygonToPath), (this.pt = PropertyFactory.getProp(f, m.pt, 0, 0, this)), (this.p = PropertyFactory.getProp(f, m.p, 1, 0, this)), (this.r = PropertyFactory.getProp( f, m.r, 0, degToRads, this )), (this.or = PropertyFactory.getProp(f, m.or, 0, 0, this)), (this.os = PropertyFactory.getProp(f, m.os, 0, 0.01, this)), (this.localShapeCollection = shapeCollectionPool.newShapeCollection()), this.localShapeCollection.addShape(this.v), (this.paths = this.localShapeCollection), this.dynamicProperties.length ? (this.k = !0) : ((this.k = !1), this.convertToPath()); } return ( (u.prototype = { reset: i, getValue: function () { this.elem.globalData.frameId !== this.frameId && ((this.frameId = this.elem.globalData.frameId), this.iterateDynamicProperties(), this._mdf && this.convertToPath()); }, convertStarToPath: function () { var m = Math.floor(this.pt.v) * 2, d = (Math.PI * 2) / m, E = !0, T = this.or.v, x = this.ir.v, _ = this.os.v, I = this.is.v, V = (2 * Math.PI * T) / (m * 2), D = (2 * Math.PI * x) / (m * 2), N, $, O, B, F = -Math.PI / 2; F += this.r.v; var k = this.data.d === 3 ? -1 : 1; for (this.v._length = 0, N = 0; N < m; N += 1) { ($ = E ? T : x), (O = E ? _ : I), (B = E ? V : D); var C = $ * Math.cos(F), M = $ * Math.sin(F), R = C === 0 && M === 0 ? 0 : M / Math.sqrt(C * C + M * M), L = C === 0 && M === 0 ? 0 : -C / Math.sqrt(C * C + M * M); (C += +this.p.v[0]), (M += +this.p.v[1]), this.v.setTripleAt( C, M, C - R * B * O * k, M - L * B * O * k, C + R * B * O * k, M + L * B * O * k, N, !0 ), (E = !E), (F += d * k); } }, convertPolygonToPath: function () { var m = Math.floor(this.pt.v), d = (Math.PI * 2) / m, E = this.or.v, T = this.os.v, x = (2 * Math.PI * E) / (m * 4), _, I = -Math.PI * 0.5, V = this.data.d === 3 ? -1 : 1; for ( I += this.r.v, this.v._length = 0, _ = 0; _ < m; _ += 1 ) { var D = E * Math.cos(I), N = E * Math.sin(I), $ = D === 0 && N === 0 ? 0 : N / Math.sqrt(D * D + N * N), O = D === 0 && N === 0 ? 0 : -D / Math.sqrt(D * D + N * N); (D += +this.p.v[0]), (N += +this.p.v[1]), this.v.setTripleAt( D, N, D - $ * x * T * V, N - O * x * T * V, D + $ * x * T * V, N + O * x * T * V, _, !0 ), (I += d * V); } (this.paths.length = 0), (this.paths[0] = this.v); } }), extendPrototype([DynamicPropertyContainer], u), u ); })(), p = (function () { function u(f, m) { (this.v = shapePool.newElement()), (this.v.c = !0), (this.localShapeCollection = shapeCollectionPool.newShapeCollection()), this.localShapeCollection.addShape(this.v), (this.paths = this.localShapeCollection), (this.elem = f), (this.comp = f.comp), (this.frameId = -1), (this.d = m.d), this.initDynamicPropertyContainer(f), (this.p = PropertyFactory.getProp(f, m.p, 1, 0, this)), (this.s = PropertyFactory.getProp(f, m.s, 1, 0, this)), (this.r = PropertyFactory.getProp(f, m.r, 0, 0, this)), this.dynamicProperties.length ? (this.k = !0) : ((this.k = !1), this.convertRectToPath()); } return ( (u.prototype = { convertRectToPath: function () { var m = this.p.v[0], d = this.p.v[1], E = this.s.v[0] / 2, T = this.s.v[1] / 2, x = bmMin(E, T, this.r.v), _ = x * (1 - roundCorner); (this.v._length = 0), this.d === 2 || this.d === 1 ? (this.v.setTripleAt( m + E, d - T + x, m + E, d - T + x, m + E, d - T + _, 0, !0 ), this.v.setTripleAt( m + E, d + T - x, m + E, d + T - _, m + E, d + T - x, 1, !0 ), x !== 0 ? (this.v.setTripleAt( m + E - x, d + T, m + E - x, d + T, m + E - _, d + T, 2, !0 ), this.v.setTripleAt( m - E + x, d + T, m - E + _, d + T, m - E + x, d + T, 3, !0 ), this.v.setTripleAt( m - E, d + T - x, m - E, d + T - x, m - E, d + T - _, 4, !0 ), this.v.setTripleAt( m - E, d - T + x, m - E, d - T + _, m - E, d - T + x, 5, !0 ), this.v.setTripleAt( m - E + x, d - T, m - E + x, d - T, m - E + _, d - T, 6, !0 ), this.v.setTripleAt( m + E - x, d - T, m + E - _, d - T, m + E - x, d - T, 7, !0 )) : (this.v.setTripleAt( m - E, d + T, m - E + _, d + T, m - E, d + T, 2 ), this.v.setTripleAt( m - E, d - T, m - E, d - T + _, m - E, d - T, 3 ))) : (this.v.setTripleAt( m + E, d - T + x, m + E, d - T + _, m + E, d - T + x, 0, !0 ), x !== 0 ? (this.v.setTripleAt( m + E - x, d - T, m + E - x, d - T, m + E - _, d - T, 1, !0 ), this.v.setTripleAt( m - E + x, d - T, m - E + _, d - T, m - E + x, d - T, 2, !0 ), this.v.setTripleAt( m - E, d - T + x, m - E, d - T + x, m - E, d - T + _, 3, !0 ), this.v.setTripleAt( m - E, d + T - x, m - E, d + T - _, m - E, d + T - x, 4, !0 ), this.v.setTripleAt( m - E + x, d + T, m - E + x, d + T, m - E + _, d + T, 5, !0 ), this.v.setTripleAt( m + E - x, d + T, m + E - _, d + T, m + E - x, d + T, 6, !0 ), this.v.setTripleAt( m + E, d + T - x, m + E, d + T - x, m + E, d + T - _, 7, !0 )) : (this.v.setTripleAt( m - E, d - T, m - E + _, d - T, m - E, d - T, 1, !0 ), this.v.setTripleAt( m - E, d + T, m - E, d + T - _, m - E, d + T, 2, !0 ), this.v.setTripleAt( m + E, d + T, m + E - _, d + T, m + E, d + T, 3, !0 ))); }, getValue: function () { this.elem.globalData.frameId !== this.frameId && ((this.frameId = this.elem.globalData.frameId), this.iterateDynamicProperties(), this._mdf && this.convertRectToPath()); }, reset: i }), extendPrototype([DynamicPropertyContainer], u), u ); })(); function P(u, f, m) { var d; if (m === 3 || m === 4) { var E = m === 3 ? f.pt : f.ks, T = E.k; T.length ? (d = new c(u, f, m)) : (d = new o(u, f, m)); } else m === 5 ? (d = new p(u, f)) : m === 6 ? (d = new g(u, f)) : m === 7 && (d = new S(u, f)); return d.k && u.addDynamicProperty(d), d; } function b() { return o; } function y() { return c; } var A = {}; return ( (A.getShapeProp = P), (A.getConstructorFunction = b), (A.getKeyframedConstructorFunction = y), A ); })(); /*! Transformation Matrix v2.0 (c) Epistemex 2014-2015 www.epistemex.com By Ken Fyrstenberg Contributions by leeoniya. License: MIT, header required. */ var Matrix = (function () { var e = Math.cos, t = Math.sin, r = Math.tan, i = Math.round; function s() { return ( (this.props[0] = 1), (this.props[1] = 0), (this.props[2] = 0), (this.props[3] = 0), (this.props[4] = 0), (this.props[5] = 1), (this.props[6] = 0), (this.props[7] = 0), (this.props[8] = 0), (this.props[9] = 0), (this.props[10] = 1), (this.props[11] = 0), (this.props[12] = 0), (this.props[13] = 0), (this.props[14] = 0), (this.props[15] = 1), this ); } function n(k) { if (k === 0) return this; var C = e(k), M = t(k); return this._t(C, -M, 0, 0, M, C, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } function a(k) { if (k === 0) return this; var C = e(k), M = t(k); return this._t(1, 0, 0, 0, 0, C, -M, 0, 0, M, C, 0, 0, 0, 0, 1); } function o(k) { if (k === 0) return this; var C = e(k), M = t(k); return this._t(C, 0, M, 0, 0, 1, 0, 0, -M, 0, C, 0, 0, 0, 0, 1); } function l(k) { if (k === 0) return this; var C = e(k), M = t(k); return this._t(C, -M, 0, 0, M, C, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } function c(k, C) { return this._t(1, C, k, 1, 0, 0); } function g(k, C) { return this.shear(r(k), r(C)); } function S(k, C) { var M = e(C), R = t(C); return this._t(M, R, 0, 0, -R, M, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) ._t(1, 0, 0, 0, r(k), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) ._t(M, -R, 0, 0, R, M, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } function p(k, C, M) { return ( !M && M !== 0 && (M = 1), k === 1 && C === 1 && M === 1 ? this : this._t(k, 0, 0, 0, 0, C, 0, 0, 0, 0, M, 0, 0, 0, 0, 1) ); } function P(k, C, M, R, L, j, z, H, U, q, ee, ie, te, Y, X, J) { return ( (this.props[0] = k), (this.props[1] = C), (this.props[2] = M), (this.props[3] = R), (this.props[4] = L), (this.props[5] = j), (this.props[6] = z), (this.props[7] = H), (this.props[8] = U), (this.props[9] = q), (this.props[10] = ee), (this.props[11] = ie), (this.props[12] = te), (this.props[13] = Y), (this.props[14] = X), (this.props[15] = J), this ); } function b(k, C, M) { return ( (M = M || 0), k !== 0 || C !== 0 || M !== 0 ? this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, k, C, M, 1) : this ); } function y(k, C, M, R, L, j, z, H, U, q, ee, ie, te, Y, X, J) { var G = this.props; if ( k === 1 && C === 0 && M === 0 && R === 0 && L === 0 && j === 1 && z === 0 && H === 0 && U === 0 && q === 0 && ee === 1 && ie === 0 ) return ( (G[12] = G[12] * k + G[15] * te), (G[13] = G[13] * j + G[15] * Y), (G[14] = G[14] * ee + G[15] * X), (G[15] *= J), (this._identityCalculated = !1), this ); var W = G[0], se = G[1], le = G[2], ne = G[3], re = G[4], ae = G[5], oe = G[6], K = G[7], he = G[8], ce = G[9], Z = G[10], pe = G[11], Q = G[12], ue = G[13], fe = G[14], de = G[15]; return ( (G[0] = W * k + se * L + le * U + ne * te), (G[1] = W * C + se * j + le * q + ne * Y), (G[2] = W * M + se * z + le * ee + ne * X), (G[3] = W * R + se * H + le * ie + ne * J), (G[4] = re * k + ae * L + oe * U + K * te), (G[5] = re * C + ae * j + oe * q + K * Y), (G[6] = re * M + ae * z + oe * ee + K * X), (G[7] = re * R + ae * H + oe * ie + K * J), (G[8] = he * k + ce * L + Z * U + pe * te), (G[9] = he * C + ce * j + Z * q + pe * Y), (G[10] = he * M + ce * z + Z * ee + pe * X), (G[11] = he * R + ce * H + Z * ie + pe * J), (G[12] = Q * k + ue * L + fe * U + de * te), (G[13] = Q * C + ue * j + fe * q + de * Y), (G[14] = Q * M + ue * z + fe * ee + de * X), (G[15] = Q * R + ue * H + fe * ie + de * J), (this._identityCalculated = !1), this ); } function A() { return ( this._identityCalculated || ((this._identity = !( this.props[0] !== 1 || this.props[1] !== 0 || this.props[2] !== 0 || this.props[3] !== 0 || this.props[4] !== 0 || this.props[5] !== 1 || this.props[6] !== 0 || this.props[7] !== 0 || this.props[8] !== 0 || this.props[9] !== 0 || this.props[10] !== 1 || this.props[11] !== 0 || this.props[12] !== 0 || this.props[13] !== 0 || this.props[14] !== 0 || this.props[15] !== 1 )), (this._identityCalculated = !0)), this._identity ); } function u(k) { for (var C = 0; C < 16; ) { if (k.props[C] !== this.props[C]) return !1; C += 1; } return !0; } function f(k) { var C; for (C = 0; C < 16; C += 1) k.props[C] = this.props[C]; return k; } function m(k) { var C; for (C = 0; C < 16; C += 1) this.props[C] = k[C]; } function d(k, C, M) { return { x: k * this.props[0] + C * this.props[4] + M * this.props[8] + this.props[12], y: k * this.props[1] + C * this.props[5] + M * this.props[9] + this.props[13], z: k * this.props[2] + C * this.props[6] + M * this.props[10] + this.props[14] }; } function E(k, C, M) { return ( k * this.props[0] + C * this.props[4] + M * this.props[8] + this.props[12] ); } function T(k, C, M) { return ( k * this.props[1] + C * this.props[5] + M * this.props[9] + this.props[13] ); } function x(k, C, M) { return ( k * this.props[2] + C * this.props[6] + M * this.props[10] + this.props[14] ); } function _() { var k = this.props[0] * this.props[5] - this.props[1] * this.props[4], C = this.props[5] / k, M = -this.props[1] / k, R = -this.props[4] / k, L = this.props[0] / k, j = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / k, z = -( this.props[0] * this.props[13] - this.props[1] * this.props[12] ) / k, H = new Matrix(); return ( (H.props[0] = C), (H.props[1] = M), (H.props[4] = R), (H.props[5] = L), (H.props[12] = j), (H.props[13] = z), H ); } function I(k) { var C = this.getInverseMatrix(); return C.applyToPointArray(k[0], k[1], k[2] || 0); } function V(k) { var C, M = k.length, R = []; for (C = 0; C < M; C += 1) R[C] = I(k[C]); return R; } function D(k, C, M) { var R = createTypedArray('float32', 6); if (this.isIdentity()) (R[0] = k[0]), (R[1] = k[1]), (R[2] = C[0]), (R[3] = C[1]), (R[4] = M[0]), (R[5] = M[1]); else { var L = this.props[0], j = this.props[1], z = this.props[4], H = this.props[5], U = this.props[12], q = this.props[13]; (R[0] = k[0] * L + k[1] * z + U), (R[1] = k[0] * j + k[1] * H + q), (R[2] = C[0] * L + C[1] * z + U), (R[3] = C[0] * j + C[1] * H + q), (R[4] = M[0] * L + M[1] * z + U), (R[5] = M[0] * j + M[1] * H + q); } return R; } function N(k, C, M) { var R; return ( this.isIdentity() ? (R = [k, C, M]) : (R = [ k * this.props[0] + C * this.props[4] + M * this.props[8] + this.props[12], k * this.props[1] + C * this.props[5] + M * this.props[9] + this.props[13], k * this.props[2] + C * this.props[6] + M * this.props[10] + this.props[14] ]), R ); } function $(k, C) { if (this.isIdentity()) return k + ',' + C; var M = this.props; return ( Math.round((k * M[0] + C * M[4] + M[12]) * 100) / 100 + ',' + Math.round((k * M[1] + C * M[5] + M[13]) * 100) / 100 ); } function O() { for (var k = 0, C = this.props, M = 'matrix3d(', R = 1e4; k < 16; ) (M += i(C[k] * R) / R), (M += k === 15 ? ')' : ','), (k += 1); return M; } function B(k) { var C = 1e4; return (k < 1e-6 && k > 0) || (k > -1e-6 && k < 0) ? i(k * C) / C : k; } function F() { var k = this.props, C = B(k[0]), M = B(k[1]), R = B(k[4]), L = B(k[5]), j = B(k[12]), z = B(k[13]); return ( 'matrix(' + C + ',' + M + ',' + R + ',' + L + ',' + j + ',' + z + ')' ); } return function () { (this.reset = s), (this.rotate = n), (this.rotateX = a), (this.rotateY = o), (this.rotateZ = l), (this.skew = g), (this.skewFromAxis = S), (this.shear = c), (this.scale = p), (this.setTransform = P), (this.translate = b), (this.transform = y), (this.applyToPoint = d), (this.applyToX = E), (this.applyToY = T), (this.applyToZ = x), (this.applyToPointArray = N), (this.applyToTriplePoints = D), (this.applyToPointStringified = $), (this.toCSS = O), (this.to2dCSS = F), (this.clone = f), (this.cloneFromProps = m), (this.equals = u), (this.inversePoints = V), (this.inversePoint = I), (this.getInverseMatrix = _), (this._t = this.transform), (this.isIdentity = A), (this._identity = !0), (this._identityCalculated = !1), (this.props = createTypedArray('float32', 16)), this.reset(); }; })(); function _typeof$3(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof$3 = function (r) { return typeof r; }) : (_typeof$3 = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof$3(e) ); } var lottie = {}; function setLocation(e) { setLocationHref(e); } function searchAnimations() { animationManager.searchAnimations(); } function setSubframeRendering(e) { setSubframeEnabled(e); } function setPrefix(e) { setIdPrefix(e); } function loadAnimation(e) { return animationManager.loadAnimation(e); } function setQuality(e) { if (typeof e == 'string') switch (e) { case 'high': setDefaultCurveSegments(200); break; default: case 'medium': setDefaultCurveSegments(50); break; case 'low': setDefaultCurveSegments(10); break; } else !isNaN(e) && e > 1 && setDefaultCurveSegments(e); } function inBrowser() { return typeof navigator < 'u'; } function installPlugin(e, t) { e === 'expressions' && setExpressionsPlugin(t); } function getFactory(e) { switch (e) { case 'propertyFactory': return PropertyFactory; case 'shapePropertyFactory': return ShapePropertyFactory; case 'matrix': return Matrix; default: return null; } } (lottie.play = animationManager.play), (lottie.pause = animationManager.pause), (lottie.setLocationHref = setLocation), (lottie.togglePause = animationManager.togglePause), (lottie.setSpeed = animationManager.setSpeed), (lottie.setDirection = animationManager.setDirection), (lottie.stop = animationManager.stop), (lottie.searchAnimations = searchAnimations), (lottie.registerAnimation = animationManager.registerAnimation), (lottie.loadAnimation = loadAnimation), (lottie.setSubframeRendering = setSubframeRendering), (lottie.resize = animationManager.resize), (lottie.goToAndStop = animationManager.goToAndStop), (lottie.destroy = animationManager.destroy), (lottie.setQuality = setQuality), (lottie.inBrowser = inBrowser), (lottie.installPlugin = installPlugin), (lottie.freeze = animationManager.freeze), (lottie.unfreeze = animationManager.unfreeze), (lottie.setVolume = animationManager.setVolume), (lottie.mute = animationManager.mute), (lottie.unmute = animationManager.unmute), (lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations), (lottie.useWebWorker = setWebWorker), (lottie.setIDPrefix = setPrefix), (lottie.__getFactory = getFactory), (lottie.version = '5.11.0'); function checkReady() { document.readyState === 'complete' && (clearInterval(readyStateCheckInterval), searchAnimations()); } function getQueryVariable(e) { for (var t = queryString.split('&'), r = 0; r < t.length; r += 1) { var i = t[r].split('='); if (decodeURIComponent(i[0]) == e) return decodeURIComponent(i[1]); } return null; } var queryString = ''; { var scripts = document.getElementsByTagName('script'), index = scripts.length - 1, myScript = scripts[index] || { src: '' }; (queryString = myScript.src ? myScript.src.replace(/^[^\?]+\??/, '') : ''), getQueryVariable('renderer'); } var readyStateCheckInterval = setInterval(checkReady, 100); try { _typeof$3(exports) !== 'object' && (window.bodymovin = lottie); } catch (e) {} var ShapeModifiers = (function () { var e = {}, t = {}; (e.registerModifier = r), (e.getModifier = i); function r(s, n) { t[s] || (t[s] = n); } function i(s, n, a) { return new t[s](n, a); } return e; })(); function ShapeModifier() {} (ShapeModifier.prototype.initModifierProperties = function () {}), (ShapeModifier.prototype.addShapeToModifier = function () {}), (ShapeModifier.prototype.addShape = function (e) { if (!this.closed) { e.sh.container.addDynamicProperty(e.sh); var t = { shape: e.sh, data: e, localShapeCollection: shapeCollectionPool.newShapeCollection() }; this.shapes.push(t), this.addShapeToModifier(t), this._isAnimated && e.setAsAnimated(); } }), (ShapeModifier.prototype.init = function (e, t) { (this.shapes = []), (this.elem = e), this.initDynamicPropertyContainer(e), this.initModifierProperties(e, t), (this.frameId = initialDefaultFrame), (this.closed = !1), (this.k = !1), this.dynamicProperties.length ? (this.k = !0) : this.getValue(!0); }), (ShapeModifier.prototype.processKeys = function () { this.elem.globalData.frameId !== this.frameId && ((this.frameId = this.elem.globalData.frameId), this.iterateDynamicProperties()); }), extendPrototype([DynamicPropertyContainer], ShapeModifier); function TrimModifier() {} extendPrototype([ShapeModifier], TrimModifier), (TrimModifier.prototype.initModifierProperties = function (e, t) { (this.s = PropertyFactory.getProp(e, t.s, 0, 0.01, this)), (this.e = PropertyFactory.getProp(e, t.e, 0, 0.01, this)), (this.o = PropertyFactory.getProp(e, t.o, 0, 0, this)), (this.sValue = 0), (this.eValue = 0), (this.getValue = this.processKeys), (this.m = t.m), (this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length); }), (TrimModifier.prototype.addShapeToModifier = function (e) { e.pathsData = []; }), (TrimModifier.prototype.calculateShapeEdges = function (e, t, r, i, s) { var n = []; t <= 1 ? n.push({ s: e, e: t }) : e >= 1 ? n.push({ s: e - 1, e: t - 1 }) : (n.push({ s: e, e: 1 }), n.push({ s: 0, e: t - 1 })); var a = [], o, l = n.length, c; for (o = 0; o < l; o += 1) if (((c = n[o]), !(c.e * s < i || c.s * s > i + r))) { var g, S; c.s * s <= i ? (g = 0) : (g = (c.s * s - i) / r), c.e * s >= i + r ? (S = 1) : (S = (c.e * s - i) / r), a.push([g, S]); } return a.length || a.push([0, 0]), a; }), (TrimModifier.prototype.releasePathsData = function (e) { var t, r = e.length; for (t = 0; t < r; t += 1) segmentsLengthPool.release(e[t]); return (e.length = 0), e; }), (TrimModifier.prototype.processShapes = function (e) { var t, r; if (this._mdf || e) { var i = (this.o.v % 360) / 360; if ( (i < 0 && (i += 1), this.s.v > 1 ? (t = 1 + i) : this.s.v < 0 ? (t = 0 + i) : (t = this.s.v + i), this.e.v > 1 ? (r = 1 + i) : this.e.v < 0 ? (r = 0 + i) : (r = this.e.v + i), t > r) ) { var s = t; (t = r), (r = s); } (t = Math.round(t * 1e4) * 1e-4), (r = Math.round(r * 1e4) * 1e-4), (this.sValue = t), (this.eValue = r); } else (t = this.sValue), (r = this.eValue); var n, a, o = this.shapes.length, l, c, g, S, p, P = 0; if (r === t) for (a = 0; a < o; a += 1) this.shapes[a].localShapeCollection.releaseShapes(), (this.shapes[a].shape._mdf = !0), (this.shapes[a].shape.paths = this.shapes[a].localShapeCollection), this._mdf && (this.shapes[a].pathsData.length = 0); else if ((r === 1 && t === 0) || (r === 0 && t === 1)) { if (this._mdf) for (a = 0; a < o; a += 1) (this.shapes[a].pathsData.length = 0), (this.shapes[a].shape._mdf = !0); } else { var b = [], y, A; for (a = 0; a < o; a += 1) if ( ((y = this.shapes[a]), !y.shape._mdf && !this._mdf && !e && this.m !== 2) ) y.shape.paths = y.localShapeCollection; else { if ( ((n = y.shape.paths), (c = n._length), (p = 0), !y.shape._mdf && y.pathsData.length) ) p = y.totalShapeLength; else { for ( g = this.releasePathsData(y.pathsData), l = 0; l < c; l += 1 ) (S = bez.getSegmentsLength(n.shapes[l])), g.push(S), (p += S.totalLength); (y.totalShapeLength = p), (y.pathsData = g); } (P += p), (y.shape._mdf = !0); } var u = t, f = r, m = 0, d; for (a = o - 1; a >= 0; a -= 1) if (((y = this.shapes[a]), y.shape._mdf)) { for ( A = y.localShapeCollection, A.releaseShapes(), this.m === 2 && o > 1 ? ((d = this.calculateShapeEdges( t, r, y.totalShapeLength, m, P )), (m += y.totalShapeLength)) : (d = [[u, f]]), c = d.length, l = 0; l < c; l += 1 ) { (u = d[l][0]), (f = d[l][1]), (b.length = 0), f <= 1 ? b.push({ s: y.totalShapeLength * u, e: y.totalShapeLength * f }) : u >= 1 ? b.push({ s: y.totalShapeLength * (u - 1), e: y.totalShapeLength * (f - 1) }) : (b.push({ s: y.totalShapeLength * u, e: y.totalShapeLength }), b.push({ s: 0, e: y.totalShapeLength * (f - 1) })); var E = this.addShapes(y, b[0]); if (b[0].s !== b[0].e) { if (b.length > 1) { var T = y.shape.paths.shapes[y.shape.paths._length - 1]; if (T.c) { var x = E.pop(); this.addPaths(E, A), (E = this.addShapes(y, b[1], x)); } else this.addPaths(E, A), (E = this.addShapes(y, b[1])); } this.addPaths(E, A); } } y.shape.paths = A; } } }), (TrimModifier.prototype.addPaths = function (e, t) { var r, i = e.length; for (r = 0; r < i; r += 1) t.addShape(e[r]); }), (TrimModifier.prototype.addSegment = function (e, t, r, i, s, n, a) { s.setXYAt(t[0], t[1], 'o', n), s.setXYAt(r[0], r[1], 'i', n + 1), a && s.setXYAt(e[0], e[1], 'v', n), s.setXYAt(i[0], i[1], 'v', n + 1); }), (TrimModifier.prototype.addSegmentFromArray = function (e, t, r, i) { t.setXYAt(e[1], e[5], 'o', r), t.setXYAt(e[2], e[6], 'i', r + 1), i && t.setXYAt(e[0], e[4], 'v', r), t.setXYAt(e[3], e[7], 'v', r + 1); }), (TrimModifier.prototype.addShapes = function (e, t, r) { var i = e.pathsData, s = e.shape.paths.shapes, n, a = e.shape.paths._length, o, l, c = 0, g, S, p, P, b = [], y, A = !0; for ( r ? ((S = r._length), (y = r._length)) : ((r = shapePool.newElement()), (S = 0), (y = 0)), b.push(r), n = 0; n < a; n += 1 ) { for ( p = i[n].lengths, r.c = s[n].c, l = s[n].c ? p.length : p.length + 1, o = 1; o < l; o += 1 ) if (((g = p[o - 1]), c + g.addedLength < t.s)) (c += g.addedLength), (r.c = !1); else if (c > t.e) { r.c = !1; break; } else t.s <= c && t.e >= c + g.addedLength ? (this.addSegment( s[n].v[o - 1], s[n].o[o - 1], s[n].i[o], s[n].v[o], r, S, A ), (A = !1)) : ((P = bez.getNewSegment( s[n].v[o - 1], s[n].v[o], s[n].o[o - 1], s[n].i[o], (t.s - c) / g.addedLength, (t.e - c) / g.addedLength, p[o - 1] )), this.addSegmentFromArray(P, r, S, A), (A = !1), (r.c = !1)), (c += g.addedLength), (S += 1); if (s[n].c && p.length) { if (((g = p[o - 1]), c <= t.e)) { var u = p[o - 1].addedLength; t.s <= c && t.e >= c + u ? (this.addSegment( s[n].v[o - 1], s[n].o[o - 1], s[n].i[0], s[n].v[0], r, S, A ), (A = !1)) : ((P = bez.getNewSegment( s[n].v[o - 1], s[n].v[0], s[n].o[o - 1], s[n].i[0], (t.s - c) / u, (t.e - c) / u, p[o - 1] )), this.addSegmentFromArray(P, r, S, A), (A = !1), (r.c = !1)); } else r.c = !1; (c += g.addedLength), (S += 1); } if ( (r._length && (r.setXYAt(r.v[y][0], r.v[y][1], 'i', y), r.setXYAt( r.v[r._length - 1][0], r.v[r._length - 1][1], 'o', r._length - 1 )), c > t.e) ) break; n < a - 1 && ((r = shapePool.newElement()), (A = !0), b.push(r), (S = 0)); } return b; }); function PuckerAndBloatModifier() {} extendPrototype([ShapeModifier], PuckerAndBloatModifier), (PuckerAndBloatModifier.prototype.initModifierProperties = function ( e, t ) { (this.getValue = this.processKeys), (this.amount = PropertyFactory.getProp(e, t.a, 0, null, this)), (this._isAnimated = !!this.amount.effectsSequence.length); }), (PuckerAndBloatModifier.prototype.processPath = function (e, t) { var r = t / 100, i = [0, 0], s = e._length, n = 0; for (n = 0; n < s; n += 1) (i[0] += e.v[n][0]), (i[1] += e.v[n][1]); (i[0] /= s), (i[1] /= s); var a = shapePool.newElement(); a.c = e.c; var o, l, c, g, S, p; for (n = 0; n < s; n += 1) (o = e.v[n][0] + (i[0] - e.v[n][0]) * r), (l = e.v[n][1] + (i[1] - e.v[n][1]) * r), (c = e.o[n][0] + (i[0] - e.o[n][0]) * -r), (g = e.o[n][1] + (i[1] - e.o[n][1]) * -r), (S = e.i[n][0] + (i[0] - e.i[n][0]) * -r), (p = e.i[n][1] + (i[1] - e.i[n][1]) * -r), a.setTripleAt(o, l, c, g, S, p, n); return a; }), (PuckerAndBloatModifier.prototype.processShapes = function (e) { var t, r, i = this.shapes.length, s, n, a = this.amount.v; if (a !== 0) { var o, l; for (r = 0; r < i; r += 1) { if ( ((o = this.shapes[r]), (l = o.localShapeCollection), !(!o.shape._mdf && !this._mdf && !e)) ) for ( l.releaseShapes(), o.shape._mdf = !0, t = o.shape.paths.shapes, n = o.shape.paths._length, s = 0; s < n; s += 1 ) l.addShape(this.processPath(t[s], a)); o.shape.paths = o.localShapeCollection; } } this.dynamicProperties.length || (this._mdf = !1); }); var TransformPropertyFactory = (function () { var e = [0, 0]; function t(l) { var c = this._mdf; this.iterateDynamicProperties(), (this._mdf = this._mdf || c), this.a && l.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), this.s && l.scale(this.s.v[0], this.s.v[1], this.s.v[2]), this.sk && l.skewFromAxis(-this.sk.v, this.sa.v), this.r ? l.rotate(-this.r.v) : l .rotateZ(-this.rz.v) .rotateY(this.ry.v) .rotateX(this.rx.v) .rotateZ(-this.or.v[2]) .rotateY(this.or.v[1]) .rotateX(this.or.v[0]), this.data.p.s ? this.data.p.z ? l.translate(this.px.v, this.py.v, -this.pz.v) : l.translate(this.px.v, this.py.v, 0) : l.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); } function r(l) { if (this.elem.globalData.frameId !== this.frameId) { if ( (this._isDirty && (this.precalculateMatrix(), (this._isDirty = !1)), this.iterateDynamicProperties(), this._mdf || l) ) { var c; if ( (this.v.cloneFromProps(this.pre.props), this.appliedTransformations < 1 && this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), this.appliedTransformations < 2 && this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]), this.sk && this.appliedTransformations < 3 && this.v.skewFromAxis(-this.sk.v, this.sa.v), this.r && this.appliedTransformations < 4 ? this.v.rotate(-this.r.v) : !this.r && this.appliedTransformations < 4 && this.v .rotateZ(-this.rz.v) .rotateY(this.ry.v) .rotateX(this.rx.v) .rotateZ(-this.or.v[2]) .rotateY(this.or.v[1]) .rotateX(this.or.v[0]), this.autoOriented) ) { var g, S; if ( ((c = this.elem.globalData.frameRate), this.p && this.p.keyframes && this.p.getValueAtTime) ) this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t ? ((g = this.p.getValueAtTime( (this.p.keyframes[0].t + 0.01) / c, 0 )), (S = this.p.getValueAtTime(this.p.keyframes[0].t / c, 0))) : this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t ? ((g = this.p.getValueAtTime( this.p.keyframes[this.p.keyframes.length - 1].t / c, 0 )), (S = this.p.getValueAtTime( (this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / c, 0 ))) : ((g = this.p.pv), (S = this.p.getValueAtTime( (this.p._caching.lastFrame + this.p.offsetTime - 0.01) / c, this.p.offsetTime ))); else if ( this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime ) { (g = []), (S = []); var p = this.px, P = this.py; p._caching.lastFrame + p.offsetTime <= p.keyframes[0].t ? ((g[0] = p.getValueAtTime( (p.keyframes[0].t + 0.01) / c, 0 )), (g[1] = P.getValueAtTime( (P.keyframes[0].t + 0.01) / c, 0 )), (S[0] = p.getValueAtTime(p.keyframes[0].t / c, 0)), (S[1] = P.getValueAtTime(P.keyframes[0].t / c, 0))) : p._caching.lastFrame + p.offsetTime >= p.keyframes[p.keyframes.length - 1].t ? ((g[0] = p.getValueAtTime( p.keyframes[p.keyframes.length - 1].t / c, 0 )), (g[1] = P.getValueAtTime( P.keyframes[P.keyframes.length - 1].t / c, 0 )), (S[0] = p.getValueAtTime( (p.keyframes[p.keyframes.length - 1].t - 0.01) / c, 0 )), (S[1] = P.getValueAtTime( (P.keyframes[P.keyframes.length - 1].t - 0.01) / c, 0 ))) : ((g = [p.pv, P.pv]), (S[0] = p.getValueAtTime( (p._caching.lastFrame + p.offsetTime - 0.01) / c, p.offsetTime )), (S[1] = P.getValueAtTime( (P._caching.lastFrame + P.offsetTime - 0.01) / c, P.offsetTime ))); } else (S = e), (g = S); this.v.rotate(-Math.atan2(g[1] - S[1], g[0] - S[0])); } this.data.p && this.data.p.s ? this.data.p.z ? this.v.translate(this.px.v, this.py.v, -this.pz.v) : this.v.translate(this.px.v, this.py.v, 0) : this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); } this.frameId = this.elem.globalData.frameId; } } function i() { if (!this.a.k) this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), (this.appliedTransformations = 1); else return; if (!this.s.effectsSequence.length) this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]), (this.appliedTransformations = 2); else return; if (this.sk) if ( !this.sk.effectsSequence.length && !this.sa.effectsSequence.length ) this.pre.skewFromAxis(-this.sk.v, this.sa.v), (this.appliedTransformations = 3); else return; this.r ? this.r.effectsSequence.length || (this.pre.rotate(-this.r.v), (this.appliedTransformations = 4)) : !this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length && (this.pre .rotateZ(-this.rz.v) .rotateY(this.ry.v) .rotateX(this.rx.v) .rotateZ(-this.or.v[2]) .rotateY(this.or.v[1]) .rotateX(this.or.v[0]), (this.appliedTransformations = 4)); } function s() {} function n(l) { this._addDynamicProperty(l), this.elem.addDynamicProperty(l), (this._isDirty = !0); } function a(l, c, g) { if ( ((this.elem = l), (this.frameId = -1), (this.propType = 'transform'), (this.data = c), (this.v = new Matrix()), (this.pre = new Matrix()), (this.appliedTransformations = 0), this.initDynamicPropertyContainer(g || l), c.p && c.p.s ? ((this.px = PropertyFactory.getProp(l, c.p.x, 0, 0, this)), (this.py = PropertyFactory.getProp(l, c.p.y, 0, 0, this)), c.p.z && (this.pz = PropertyFactory.getProp(l, c.p.z, 0, 0, this))) : (this.p = PropertyFactory.getProp( l, c.p || { k: [0, 0, 0] }, 1, 0, this )), c.rx) ) { if ( ((this.rx = PropertyFactory.getProp(l, c.rx, 0, degToRads, this)), (this.ry = PropertyFactory.getProp(l, c.ry, 0, degToRads, this)), (this.rz = PropertyFactory.getProp(l, c.rz, 0, degToRads, this)), c.or.k[0].ti) ) { var S, p = c.or.k.length; for (S = 0; S < p; S += 1) (c.or.k[S].to = null), (c.or.k[S].ti = null); } (this.or = PropertyFactory.getProp(l, c.or, 1, degToRads, this)), (this.or.sh = !0); } else this.r = PropertyFactory.getProp( l, c.r || { k: 0 }, 0, degToRads, this ); c.sk && ((this.sk = PropertyFactory.getProp(l, c.sk, 0, degToRads, this)), (this.sa = PropertyFactory.getProp(l, c.sa, 0, degToRads, this))), (this.a = PropertyFactory.getProp( l, c.a || { k: [0, 0, 0] }, 1, 0, this )), (this.s = PropertyFactory.getProp( l, c.s || { k: [100, 100, 100] }, 1, 0.01, this )), c.o ? (this.o = PropertyFactory.getProp(l, c.o, 0, 0.01, l)) : (this.o = { _mdf: !1, v: 1 }), (this._isDirty = !0), this.dynamicProperties.length || this.getValue(!0); } (a.prototype = { applyToMatrix: t, getValue: r, precalculateMatrix: i, autoOrient: s }), extendPrototype([DynamicPropertyContainer], a), (a.prototype.addDynamicProperty = n), (a.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty); function o(l, c, g) { return new a(l, c, g); } return { getTransformProperty: o }; })(); function RepeaterModifier() {} extendPrototype([ShapeModifier], RepeaterModifier), (RepeaterModifier.prototype.initModifierProperties = function (e, t) { (this.getValue = this.processKeys), (this.c = PropertyFactory.getProp(e, t.c, 0, null, this)), (this.o = PropertyFactory.getProp(e, t.o, 0, null, this)), (this.tr = TransformPropertyFactory.getTransformProperty( e, t.tr, this )), (this.so = PropertyFactory.getProp(e, t.tr.so, 0, 0.01, this)), (this.eo = PropertyFactory.getProp(e, t.tr.eo, 0, 0.01, this)), (this.data = t), this.dynamicProperties.length || this.getValue(!0), (this._isAnimated = !!this.dynamicProperties.length), (this.pMatrix = new Matrix()), (this.rMatrix = new Matrix()), (this.sMatrix = new Matrix()), (this.tMatrix = new Matrix()), (this.matrix = new Matrix()); }), (RepeaterModifier.prototype.applyTransforms = function ( e, t, r, i, s, n ) { var a = n ? -1 : 1, o = i.s.v[0] + (1 - i.s.v[0]) * (1 - s), l = i.s.v[1] + (1 - i.s.v[1]) * (1 - s); e.translate(i.p.v[0] * a * s, i.p.v[1] * a * s, i.p.v[2]), t.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]), t.rotate(-i.r.v * a * s), t.translate(i.a.v[0], i.a.v[1], i.a.v[2]), r.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]), r.scale(n ? 1 / o : o, n ? 1 / l : l), r.translate(i.a.v[0], i.a.v[1], i.a.v[2]); }), (RepeaterModifier.prototype.init = function (e, t, r, i) { for ( this.elem = e, this.arr = t, this.pos = r, this.elemsData = i, this._currentCopies = 0, this._elements = [], this._groups = [], this.frameId = -1, this.initDynamicPropertyContainer(e), this.initModifierProperties(e, t[r]); r > 0; ) (r -= 1), this._elements.unshift(t[r]); this.dynamicProperties.length ? (this.k = !0) : this.getValue(!0); }), (RepeaterModifier.prototype.resetElements = function (e) { var t, r = e.length; for (t = 0; t < r; t += 1) (e[t]._processed = !1), e[t].ty === 'gr' && this.resetElements(e[t].it); }), (RepeaterModifier.prototype.cloneElements = function (e) { var t = JSON.parse(JSON.stringify(e)); return this.resetElements(t), t; }), (RepeaterModifier.prototype.changeGroupRender = function (e, t) { var r, i = e.length; for (r = 0; r < i; r += 1) (e[r]._render = t), e[r].ty === 'gr' && this.changeGroupRender(e[r].it, t); }), (RepeaterModifier.prototype.processShapes = function (e) { var t, r, i, s, n, a = !1; if (this._mdf || e) { var o = Math.ceil(this.c.v); if (this._groups.length < o) { for (; this._groups.length < o; ) { var l = { it: this.cloneElements(this._elements), ty: 'gr' }; l.it.push({ a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [ { s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 } ] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr' }), this.arr.splice(0, 0, l), this._groups.splice(0, 0, l), (this._currentCopies += 1); } this.elem.reloadShapes(), (a = !0); } n = 0; var c; for (i = 0; i <= this._groups.length - 1; i += 1) { if ( ((c = n < o), (this._groups[i]._render = c), this.changeGroupRender(this._groups[i].it, c), !c) ) { var g = this.elemsData[i].it, S = g[g.length - 1]; S.transform.op.v !== 0 ? ((S.transform.op._mdf = !0), (S.transform.op.v = 0)) : (S.transform.op._mdf = !1); } n += 1; } this._currentCopies = o; var p = this.o.v, P = p % 1, b = p > 0 ? Math.floor(p) : Math.ceil(p), y = this.pMatrix.props, A = this.rMatrix.props, u = this.sMatrix.props; this.pMatrix.reset(), this.rMatrix.reset(), this.sMatrix.reset(), this.tMatrix.reset(), this.matrix.reset(); var f = 0; if (p > 0) { for (; f < b; ) this.applyTransforms( this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, !1 ), (f += 1); P && (this.applyTransforms( this.pMatrix, this.rMatrix, this.sMatrix, this.tr, P, !1 ), (f += P)); } else if (p < 0) { for (; f > b; ) this.applyTransforms( this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, !0 ), (f -= 1); P && (this.applyTransforms( this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -P, !0 ), (f -= P)); } (i = this.data.m === 1 ? 0 : this._currentCopies - 1), (s = this.data.m === 1 ? 1 : -1), (n = this._currentCopies); for (var m, d; n; ) { if ( ((t = this.elemsData[i].it), (r = t[t.length - 1].transform.mProps.v.props), (d = r.length), (t[t.length - 1].transform.mProps._mdf = !0), (t[t.length - 1].transform.op._mdf = !0), (t[t.length - 1].transform.op.v = this._currentCopies === 1 ? this.so.v : this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1))), f !== 0) ) { for ( ((i !== 0 && s === 1) || (i !== this._currentCopies - 1 && s === -1)) && this.applyTransforms( this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, !1 ), this.matrix.transform( A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9], A[10], A[11], A[12], A[13], A[14], A[15] ), this.matrix.transform( u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15] ), this.matrix.transform( y[0], y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9], y[10], y[11], y[12], y[13], y[14], y[15] ), m = 0; m < d; m += 1 ) r[m] = this.matrix.props[m]; this.matrix.reset(); } else for (this.matrix.reset(), m = 0; m < d; m += 1) r[m] = this.matrix.props[m]; (f += 1), (n -= 1), (i += s); } } else for (n = this._currentCopies, i = 0, s = 1; n; ) (t = this.elemsData[i].it), (r = t[t.length - 1].transform.mProps.v.props), (t[t.length - 1].transform.mProps._mdf = !1), (t[t.length - 1].transform.op._mdf = !1), (n -= 1), (i += s); return a; }), (RepeaterModifier.prototype.addShape = function () {}); function RoundCornersModifier() {} extendPrototype([ShapeModifier], RoundCornersModifier), (RoundCornersModifier.prototype.initModifierProperties = function ( e, t ) { (this.getValue = this.processKeys), (this.rd = PropertyFactory.getProp(e, t.r, 0, null, this)), (this._isAnimated = !!this.rd.effectsSequence.length); }), (RoundCornersModifier.prototype.processPath = function (e, t) { var r = shapePool.newElement(); r.c = e.c; var i, s = e._length, n, a, o, l, c, g, S = 0, p, P, b, y, A, u; for (i = 0; i < s; i += 1) (n = e.v[i]), (o = e.o[i]), (a = e.i[i]), n[0] === o[0] && n[1] === o[1] && n[0] === a[0] && n[1] === a[1] ? (i === 0 || i === s - 1) && !e.c ? (r.setTripleAt(n[0], n[1], o[0], o[1], a[0], a[1], S), (S += 1)) : (i === 0 ? (l = e.v[s - 1]) : (l = e.v[i - 1]), (c = Math.sqrt( Math.pow(n[0] - l[0], 2) + Math.pow(n[1] - l[1], 2) )), (g = c ? Math.min(c / 2, t) / c : 0), (A = n[0] + (l[0] - n[0]) * g), (p = A), (u = n[1] - (n[1] - l[1]) * g), (P = u), (b = p - (p - n[0]) * roundCorner), (y = P - (P - n[1]) * roundCorner), r.setTripleAt(p, P, b, y, A, u, S), (S += 1), i === s - 1 ? (l = e.v[0]) : (l = e.v[i + 1]), (c = Math.sqrt( Math.pow(n[0] - l[0], 2) + Math.pow(n[1] - l[1], 2) )), (g = c ? Math.min(c / 2, t) / c : 0), (b = n[0] + (l[0] - n[0]) * g), (p = b), (y = n[1] + (l[1] - n[1]) * g), (P = y), (A = p - (p - n[0]) * roundCorner), (u = P - (P - n[1]) * roundCorner), r.setTripleAt(p, P, b, y, A, u, S), (S += 1)) : (r.setTripleAt( e.v[i][0], e.v[i][1], e.o[i][0], e.o[i][1], e.i[i][0], e.i[i][1], S ), (S += 1)); return r; }), (RoundCornersModifier.prototype.processShapes = function (e) { var t, r, i = this.shapes.length, s, n, a = this.rd.v; if (a !== 0) { var o, l; for (r = 0; r < i; r += 1) { if ( ((o = this.shapes[r]), (l = o.localShapeCollection), !(!o.shape._mdf && !this._mdf && !e)) ) for ( l.releaseShapes(), o.shape._mdf = !0, t = o.shape.paths.shapes, n = o.shape.paths._length, s = 0; s < n; s += 1 ) l.addShape(this.processPath(t[s], a)); o.shape.paths = o.localShapeCollection; } } this.dynamicProperties.length || (this._mdf = !1); }); function floatEqual(e, t) { return Math.abs(e - t) * 1e5 <= Math.min(Math.abs(e), Math.abs(t)); } function floatZero(e) { return Math.abs(e) <= 1e-5; } function lerp(e, t, r) { return e * (1 - r) + t * r; } function lerpPoint(e, t, r) { return [lerp(e[0], t[0], r), lerp(e[1], t[1], r)]; } function quadRoots(e, t, r) { if (e === 0) return []; var i = t * t - 4 * e * r; if (i < 0) return []; var s = -t / (2 * e); if (i === 0) return [s]; var n = Math.sqrt(i) / (2 * e); return [s - n, s + n]; } function polynomialCoefficients(e, t, r, i) { return [ -e + 3 * t - 3 * r + i, 3 * e - 6 * t + 3 * r, -3 * e + 3 * t, e ]; } function singlePoint(e) { return new PolynomialBezier(e, e, e, e, !1); } function PolynomialBezier(e, t, r, i, s) { s && pointEqual(e, t) && (t = lerpPoint(e, i, 1 / 3)), s && pointEqual(r, i) && (r = lerpPoint(e, i, 2 / 3)); var n = polynomialCoefficients(e[0], t[0], r[0], i[0]), a = polynomialCoefficients(e[1], t[1], r[1], i[1]); (this.a = [n[0], a[0]]), (this.b = [n[1], a[1]]), (this.c = [n[2], a[2]]), (this.d = [n[3], a[3]]), (this.points = [e, t, r, i]); } (PolynomialBezier.prototype.point = function (e) { return [ ((this.a[0] * e + this.b[0]) * e + this.c[0]) * e + this.d[0], ((this.a[1] * e + this.b[1]) * e + this.c[1]) * e + this.d[1] ]; }), (PolynomialBezier.prototype.derivative = function (e) { return [ (3 * e * this.a[0] + 2 * this.b[0]) * e + this.c[0], (3 * e * this.a[1] + 2 * this.b[1]) * e + this.c[1] ]; }), (PolynomialBezier.prototype.tangentAngle = function (e) { var t = this.derivative(e); return Math.atan2(t[1], t[0]); }), (PolynomialBezier.prototype.normalAngle = function (e) { var t = this.derivative(e); return Math.atan2(t[0], t[1]); }), (PolynomialBezier.prototype.inflectionPoints = function () { var e = this.a[1] * this.b[0] - this.a[0] * this.b[1]; if (floatZero(e)) return []; var t = (-0.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1])) / e, r = t * t - ((1 / 3) * (this.b[1] * this.c[0] - this.b[0] * this.c[1])) / e; if (r < 0) return []; var i = Math.sqrt(r); return floatZero(i) ? i > 0 && i < 1 ? [t] : [] : [t - i, t + i].filter(function (s) { return s > 0 && s < 1; }); }), (PolynomialBezier.prototype.split = function (e) { if (e <= 0) return [singlePoint(this.points[0]), this]; if (e >= 1) return [this, singlePoint(this.points[this.points.length - 1])]; var t = lerpPoint(this.points[0], this.points[1], e), r = lerpPoint(this.points[1], this.points[2], e), i = lerpPoint(this.points[2], this.points[3], e), s = lerpPoint(t, r, e), n = lerpPoint(r, i, e), a = lerpPoint(s, n, e); return [ new PolynomialBezier(this.points[0], t, s, a, !0), new PolynomialBezier(a, n, i, this.points[3], !0) ]; }); function extrema(e, t) { var r = e.points[0][t], i = e.points[e.points.length - 1][t]; if (r > i) { var s = i; (i = r), (r = s); } for ( var n = quadRoots(3 * e.a[t], 2 * e.b[t], e.c[t]), a = 0; a < n.length; a += 1 ) if (n[a] > 0 && n[a] < 1) { var o = e.point(n[a])[t]; o < r ? (r = o) : o > i && (i = o); } return { min: r, max: i }; } (PolynomialBezier.prototype.bounds = function () { return { x: extrema(this, 0), y: extrema(this, 1) }; }), (PolynomialBezier.prototype.boundingBox = function () { var e = this.bounds(); return { left: e.x.min, right: e.x.max, top: e.y.min, bottom: e.y.max, width: e.x.max - e.x.min, height: e.y.max - e.y.min, cx: (e.x.max + e.x.min) / 2, cy: (e.y.max + e.y.min) / 2 }; }); function intersectData(e, t, r) { var i = e.boundingBox(); return { cx: i.cx, cy: i.cy, width: i.width, height: i.height, bez: e, t: (t + r) / 2, t1: t, t2: r }; } function splitData(e) { var t = e.bez.split(0.5); return [intersectData(t[0], e.t1, e.t), intersectData(t[1], e.t, e.t2)]; } function boxIntersect(e, t) { return ( Math.abs(e.cx - t.cx) * 2 < e.width + t.width && Math.abs(e.cy - t.cy) * 2 < e.height + t.height ); } function intersectsImpl(e, t, r, i, s, n) { if (boxIntersect(e, t)) { if ( r >= n || (e.width <= i && e.height <= i && t.width <= i && t.height <= i) ) { s.push([e.t, t.t]); return; } var a = splitData(e), o = splitData(t); intersectsImpl(a[0], o[0], r + 1, i, s, n), intersectsImpl(a[0], o[1], r + 1, i, s, n), intersectsImpl(a[1], o[0], r + 1, i, s, n), intersectsImpl(a[1], o[1], r + 1, i, s, n); } } (PolynomialBezier.prototype.intersections = function (e, t, r) { t === void 0 && (t = 2), r === void 0 && (r = 7); var i = []; return ( intersectsImpl( intersectData(this, 0, 1), intersectData(e, 0, 1), 0, t, i, r ), i ); }), (PolynomialBezier.shapeSegment = function (e, t) { var r = (t + 1) % e.length(); return new PolynomialBezier(e.v[t], e.o[t], e.i[r], e.v[r], !0); }), (PolynomialBezier.shapeSegmentInverted = function (e, t) { var r = (t + 1) % e.length(); return new PolynomialBezier(e.v[r], e.i[r], e.o[t], e.v[t], !0); }); function crossProduct(e, t) { return [ e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0] ]; } function lineIntersection(e, t, r, i) { var s = [e[0], e[1], 1], n = [t[0], t[1], 1], a = [r[0], r[1], 1], o = [i[0], i[1], 1], l = crossProduct(crossProduct(s, n), crossProduct(a, o)); return floatZero(l[2]) ? null : [l[0] / l[2], l[1] / l[2]]; } function polarOffset(e, t, r) { return [e[0] + Math.cos(t) * r, e[1] - Math.sin(t) * r]; } function pointDistance(e, t) { return Math.hypot(e[0] - t[0], e[1] - t[1]); } function pointEqual(e, t) { return floatEqual(e[0], t[0]) && floatEqual(e[1], t[1]); } function ZigZagModifier() {} extendPrototype([ShapeModifier], ZigZagModifier), (ZigZagModifier.prototype.initModifierProperties = function (e, t) { (this.getValue = this.processKeys), (this.amplitude = PropertyFactory.getProp(e, t.s, 0, null, this)), (this.frequency = PropertyFactory.getProp(e, t.r, 0, null, this)), (this.pointsType = PropertyFactory.getProp(e, t.pt, 0, null, this)), (this._isAnimated = this.amplitude.effectsSequence.length !== 0 || this.frequency.effectsSequence.length !== 0 || this.pointsType.effectsSequence.length !== 0); }); function setPoint(e, t, r, i, s, n, a) { var o = r - Math.PI / 2, l = r + Math.PI / 2, c = t[0] + Math.cos(r) * i * s, g = t[1] - Math.sin(r) * i * s; e.setTripleAt( c, g, c + Math.cos(o) * n, g - Math.sin(o) * n, c + Math.cos(l) * a, g - Math.sin(l) * a, e.length() ); } function getPerpendicularVector(e, t) { var r = [t[0] - e[0], t[1] - e[1]], i = -Math.PI * 0.5, s = [ Math.cos(i) * r[0] - Math.sin(i) * r[1], Math.sin(i) * r[0] + Math.cos(i) * r[1] ]; return s; } function getProjectingAngle(e, t) { var r = t === 0 ? e.length() - 1 : t - 1, i = (t + 1) % e.length(), s = e.v[r], n = e.v[i], a = getPerpendicularVector(s, n); return Math.atan2(0, 1) - Math.atan2(a[1], a[0]); } function zigZagCorner(e, t, r, i, s, n, a) { var o = getProjectingAngle(t, r), l = t.v[r % t._length], c = t.v[r === 0 ? t._length - 1 : r - 1], g = t.v[(r + 1) % t._length], S = n === 2 ? Math.sqrt(Math.pow(l[0] - c[0], 2) + Math.pow(l[1] - c[1], 2)) : 0, p = n === 2 ? Math.sqrt(Math.pow(l[0] - g[0], 2) + Math.pow(l[1] - g[1], 2)) : 0; setPoint( e, t.v[r % t._length], o, a, i, p / ((s + 1) * 2), S / ((s + 1) * 2) ); } function zigZagSegment(e, t, r, i, s, n) { for (var a = 0; a < i; a += 1) { var o = (a + 1) / (i + 1), l = s === 2 ? Math.sqrt( Math.pow(t.points[3][0] - t.points[0][0], 2) + Math.pow(t.points[3][1] - t.points[0][1], 2) ) : 0, c = t.normalAngle(o), g = t.point(o); setPoint(e, g, c, n, r, l / ((i + 1) * 2), l / ((i + 1) * 2)), (n = -n); } return n; } (ZigZagModifier.prototype.processPath = function (e, t, r, i) { var s = e._length, n = shapePool.newElement(); if (((n.c = e.c), e.c || (s -= 1), s === 0)) return n; var a = -1, o = PolynomialBezier.shapeSegment(e, 0); zigZagCorner(n, e, 0, t, r, i, a); for (var l = 0; l < s; l += 1) (a = zigZagSegment(n, o, t, r, i, -a)), l === s - 1 && !e.c ? (o = null) : (o = PolynomialBezier.shapeSegment(e, (l + 1) % s)), zigZagCorner(n, e, l + 1, t, r, i, a); return n; }), (ZigZagModifier.prototype.processShapes = function (e) { var t, r, i = this.shapes.length, s, n, a = this.amplitude.v, o = Math.max(0, Math.round(this.frequency.v)), l = this.pointsType.v; if (a !== 0) { var c, g; for (r = 0; r < i; r += 1) { if ( ((c = this.shapes[r]), (g = c.localShapeCollection), !(!c.shape._mdf && !this._mdf && !e)) ) for ( g.releaseShapes(), c.shape._mdf = !0, t = c.shape.paths.shapes, n = c.shape.paths._length, s = 0; s < n; s += 1 ) g.addShape(this.processPath(t[s], a, o, l)); c.shape.paths = c.localShapeCollection; } } this.dynamicProperties.length || (this._mdf = !1); }); function linearOffset(e, t, r) { var i = Math.atan2(t[0] - e[0], t[1] - e[1]); return [polarOffset(e, i, r), polarOffset(t, i, r)]; } function offsetSegment(e, t) { var r, i, s, n, a, o, l; (l = linearOffset(e.points[0], e.points[1], t)), (r = l[0]), (i = l[1]), (l = linearOffset(e.points[1], e.points[2], t)), (s = l[0]), (n = l[1]), (l = linearOffset(e.points[2], e.points[3], t)), (a = l[0]), (o = l[1]); var c = lineIntersection(r, i, s, n); c === null && (c = i); var g = lineIntersection(a, o, s, n); return g === null && (g = a), new PolynomialBezier(r, c, g, o); } function joinLines(e, t, r, i, s) { var n = t.points[3], a = r.points[0]; if (i === 3 || pointEqual(n, a)) return n; if (i === 2) { var o = -t.tangentAngle(1), l = -r.tangentAngle(0) + Math.PI, c = lineIntersection( n, polarOffset(n, o + Math.PI / 2, 100), a, polarOffset(a, o + Math.PI / 2, 100) ), g = c ? pointDistance(c, n) : pointDistance(n, a) / 2, S = polarOffset(n, o, 2 * g * roundCorner); return ( e.setXYAt(S[0], S[1], 'o', e.length() - 1), (S = polarOffset(a, l, 2 * g * roundCorner)), e.setTripleAt(a[0], a[1], a[0], a[1], S[0], S[1], e.length()), a ); } var p = pointEqual(n, t.points[2]) ? t.points[0] : t.points[2], P = pointEqual(a, r.points[1]) ? r.points[3] : r.points[1], b = lineIntersection(p, n, a, P); return b && pointDistance(b, n) < s ? (e.setTripleAt(b[0], b[1], b[0], b[1], b[0], b[1], e.length()), b) : n; } function getIntersection(e, t) { var r = e.intersections(t); return ( r.length && floatEqual(r[0][0], 1) && r.shift(), r.length ? r[0] : null ); } function pruneSegmentIntersection(e, t) { var r = e.slice(), i = t.slice(), s = getIntersection(e[e.length - 1], t[0]); return ( s && ((r[e.length - 1] = e[e.length - 1].split(s[0])[0]), (i[0] = t[0].split(s[1])[1])), e.length > 1 && t.length > 1 && ((s = getIntersection(e[0], t[t.length - 1])), s) ? [[e[0].split(s[0])[0]], [t[t.length - 1].split(s[1])[1]]] : [r, i] ); } function pruneIntersections(e) { for (var t, r = 1; r < e.length; r += 1) (t = pruneSegmentIntersection(e[r - 1], e[r])), (e[r - 1] = t[0]), (e[r] = t[1]); return ( e.length > 1 && ((t = pruneSegmentIntersection(e[e.length - 1], e[0])), (e[e.length - 1] = t[0]), (e[0] = t[1])), e ); } function offsetSegmentSplit(e, t) { var r = e.inflectionPoints(), i, s, n, a; if (r.length === 0) return [offsetSegment(e, t)]; if (r.length === 1 || floatEqual(r[1], 1)) return ( (n = e.split(r[0])), (i = n[0]), (s = n[1]), [offsetSegment(i, t), offsetSegment(s, t)] ); (n = e.split(r[0])), (i = n[0]); var o = (r[1] - r[0]) / (1 - r[0]); return ( (n = n[1].split(o)), (a = n[0]), (s = n[1]), [offsetSegment(i, t), offsetSegment(a, t), offsetSegment(s, t)] ); } function OffsetPathModifier() {} extendPrototype([ShapeModifier], OffsetPathModifier), (OffsetPathModifier.prototype.initModifierProperties = function (e, t) { (this.getValue = this.processKeys), (this.amount = PropertyFactory.getProp(e, t.a, 0, null, this)), (this.miterLimit = PropertyFactory.getProp(e, t.ml, 0, null, this)), (this.lineJoin = t.lj), (this._isAnimated = this.amount.effectsSequence.length !== 0); }), (OffsetPathModifier.prototype.processPath = function (e, t, r, i) { var s = shapePool.newElement(); s.c = e.c; var n = e.length(); e.c || (n -= 1); var a, o, l, c = []; for (a = 0; a < n; a += 1) (l = PolynomialBezier.shapeSegment(e, a)), c.push(offsetSegmentSplit(l, t)); if (!e.c) for (a = n - 1; a >= 0; a -= 1) (l = PolynomialBezier.shapeSegmentInverted(e, a)), c.push(offsetSegmentSplit(l, t)); c = pruneIntersections(c); var g = null, S = null; for (a = 0; a < c.length; a += 1) { var p = c[a]; for ( S && (g = joinLines(s, S, p[0], r, i)), S = p[p.length - 1], o = 0; o < p.length; o += 1 ) (l = p[o]), g && pointEqual(l.points[0], g) ? s.setXYAt( l.points[1][0], l.points[1][1], 'o', s.length() - 1 ) : s.setTripleAt( l.points[0][0], l.points[0][1], l.points[1][0], l.points[1][1], l.points[0][0], l.points[0][1], s.length() ), s.setTripleAt( l.points[3][0], l.points[3][1], l.points[3][0], l.points[3][1], l.points[2][0], l.points[2][1], s.length() ), (g = l.points[3]); } return c.length && joinLines(s, S, c[0][0], r, i), s; }), (OffsetPathModifier.prototype.processShapes = function (e) { var t, r, i = this.shapes.length, s, n, a = this.amount.v, o = this.miterLimit.v, l = this.lineJoin; if (a !== 0) { var c, g; for (r = 0; r < i; r += 1) { if ( ((c = this.shapes[r]), (g = c.localShapeCollection), !(!c.shape._mdf && !this._mdf && !e)) ) for ( g.releaseShapes(), c.shape._mdf = !0, t = c.shape.paths.shapes, n = c.shape.paths._length, s = 0; s < n; s += 1 ) g.addShape(this.processPath(t[s], a, l, o)); c.shape.paths = c.localShapeCollection; } } this.dynamicProperties.length || (this._mdf = !1); }); function getFontProperties(e) { for ( var t = e.fStyle ? e.fStyle.split(' ') : [], r = 'normal', i = 'normal', s = t.length, n, a = 0; a < s; a += 1 ) switch (((n = t[a].toLowerCase()), n)) { case 'italic': i = 'italic'; break; case 'bold': r = '700'; break; case 'black': r = '900'; break; case 'medium': r = '500'; break; case 'regular': case 'normal': r = '400'; break; case 'light': case 'thin': r = '200'; break; } return { style: i, weight: e.fWeight || r }; } var FontManager = (function () { var e = 5e3, t = { w: 0, size: 0, shapes: [], data: { shapes: [] } }, r = []; r = r.concat([ 2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403 ]); var i = ['d83cdffb', 'd83cdffc', 'd83cdffd', 'd83cdffe', 'd83cdfff'], s = [65039, 8205]; function n(d) { var E = d.split(','), T, x = E.length, _ = []; for (T = 0; T < x; T += 1) E[T] !== 'sans-serif' && E[T] !== 'monospace' && _.push(E[T]); return _.join(','); } function a(d, E) { var T = createTag('span'); T.setAttribute('aria-hidden', !0), (T.style.fontFamily = E); var x = createTag('span'); (x.innerText = 'giItT1WQy@!-/#'), (T.style.position = 'absolute'), (T.style.left = '-10000px'), (T.style.top = '-10000px'), (T.style.fontSize = '300px'), (T.style.fontVariant = 'normal'), (T.style.fontStyle = 'normal'), (T.style.fontWeight = 'normal'), (T.style.letterSpacing = '0'), T.appendChild(x), document.body.appendChild(T); var _ = x.offsetWidth; return ( (x.style.fontFamily = n(d) + ', ' + E), { node: x, w: _, parent: T } ); } function o() { var d, E = this.fonts.length, T, x, _ = E; for (d = 0; d < E; d += 1) this.fonts[d].loaded ? (_ -= 1) : this.fonts[d].fOrigin === 'n' || this.fonts[d].origin === 0 ? (this.fonts[d].loaded = !0) : ((T = this.fonts[d].monoCase.node), (x = this.fonts[d].monoCase.w), T.offsetWidth !== x ? ((_ -= 1), (this.fonts[d].loaded = !0)) : ((T = this.fonts[d].sansCase.node), (x = this.fonts[d].sansCase.w), T.offsetWidth !== x && ((_ -= 1), (this.fonts[d].loaded = !0))), this.fonts[d].loaded && (this.fonts[d].sansCase.parent.parentNode.removeChild( this.fonts[d].sansCase.parent ), this.fonts[d].monoCase.parent.parentNode.removeChild( this.fonts[d].monoCase.parent ))); _ !== 0 && Date.now() - this.initTime < e ? setTimeout(this.checkLoadedFontsBinded, 20) : setTimeout(this.setIsLoadedBinded, 10); } function l(d, E) { var T = document.body && E ? 'svg' : 'canvas', x, _ = getFontProperties(d); if (T === 'svg') { var I = createNS('text'); (I.style.fontSize = '100px'), I.setAttribute('font-family', d.fFamily), I.setAttribute('font-style', _.style), I.setAttribute('font-weight', _.weight), (I.textContent = '1'), d.fClass ? ((I.style.fontFamily = 'inherit'), I.setAttribute('class', d.fClass)) : (I.style.fontFamily = d.fFamily), E.appendChild(I), (x = I); } else { var V = new OffscreenCanvas(500, 500).getContext('2d'); (V.font = _.style + ' ' + _.weight + ' 100px ' + d.fFamily), (x = V); } function D(N) { return T === 'svg' ? ((x.textContent = N), x.getComputedTextLength()) : x.measureText(N).width; } return { measureText: D }; } function c(d, E) { if (!d) { this.isLoaded = !0; return; } if (this.chars) { (this.isLoaded = !0), (this.fonts = d.list); return; } if (!document.body) { (this.isLoaded = !0), d.list.forEach(function (F) { (F.helper = l(F)), (F.cache = {}); }), (this.fonts = d.list); return; } var T = d.list, x, _ = T.length, I = _; for (x = 0; x < _; x += 1) { var V = !0, D, N; if ( ((T[x].loaded = !1), (T[x].monoCase = a(T[x].fFamily, 'monospace')), (T[x].sansCase = a(T[x].fFamily, 'sans-serif')), !T[x].fPath) ) (T[x].loaded = !0), (I -= 1); else if (T[x].fOrigin === 'p' || T[x].origin === 3) { if ( ((D = document.querySelectorAll( 'style[f-forigin="p"][f-family="' + T[x].fFamily + '"], style[f-origin="3"][f-family="' + T[x].fFamily + '"]' )), D.length > 0 && (V = !1), V) ) { var $ = createTag('style'); $.setAttribute('f-forigin', T[x].fOrigin), $.setAttribute('f-origin', T[x].origin), $.setAttribute('f-family', T[x].fFamily), ($.type = 'text/css'), ($.innerText = '@font-face {font-family: ' + T[x].fFamily + "; font-style: normal; src: url('" + T[x].fPath + "');}"), E.appendChild($); } } else if (T[x].fOrigin === 'g' || T[x].origin === 1) { for ( D = document.querySelectorAll( 'link[f-forigin="g"], link[f-origin="1"]' ), N = 0; N < D.length; N += 1 ) D[N].href.indexOf(T[x].fPath) !== -1 && (V = !1); if (V) { var O = createTag('link'); O.setAttribute('f-forigin', T[x].fOrigin), O.setAttribute('f-origin', T[x].origin), (O.type = 'text/css'), (O.rel = 'stylesheet'), (O.href = T[x].fPath), document.body.appendChild(O); } } else if (T[x].fOrigin === 't' || T[x].origin === 2) { for ( D = document.querySelectorAll( 'script[f-forigin="t"], script[f-origin="2"]' ), N = 0; N < D.length; N += 1 ) T[x].fPath === D[N].src && (V = !1); if (V) { var B = createTag('link'); B.setAttribute('f-forigin', T[x].fOrigin), B.setAttribute('f-origin', T[x].origin), B.setAttribute('rel', 'stylesheet'), B.setAttribute('href', T[x].fPath), E.appendChild(B); } } (T[x].helper = l(T[x], E)), (T[x].cache = {}), this.fonts.push(T[x]); } I === 0 ? (this.isLoaded = !0) : setTimeout(this.checkLoadedFonts.bind(this), 100); } function g(d) { if (d) { this.chars || (this.chars = []); var E, T = d.length, x, _ = this.chars.length, I; for (E = 0; E < T; E += 1) { for (x = 0, I = !1; x < _; ) this.chars[x].style === d[E].style && this.chars[x].fFamily === d[E].fFamily && this.chars[x].ch === d[E].ch && (I = !0), (x += 1); I || (this.chars.push(d[E]), (_ += 1)); } } } function S(d, E, T) { for (var x = 0, _ = this.chars.length; x < _; ) { if ( this.chars[x].ch === d && this.chars[x].style === E && this.chars[x].fFamily === T ) return this.chars[x]; x += 1; } return ( ((typeof d == 'string' && d.charCodeAt(0) !== 13) || !d) && console && console.warn && !this._warned && ((this._warned = !0), console.warn( 'Missing character from exported characters list: ', d, E, T )), t ); } function p(d, E, T) { var x = this.getFontByName(E), _ = d.charCodeAt(0); if (!x.cache[_ + 1]) { var I = x.helper; if (d === ' ') { var V = I.measureText('|' + d + '|'), D = I.measureText('||'); x.cache[_ + 1] = (V - D) / 100; } else x.cache[_ + 1] = I.measureText(d) / 100; } return x.cache[_ + 1] * T; } function P(d) { for (var E = 0, T = this.fonts.length; E < T; ) { if (this.fonts[E].fName === d) return this.fonts[E]; E += 1; } return this.fonts[0]; } function b(d, E) { var T = d.toString(16) + E.toString(16); return i.indexOf(T) !== -1; } function y(d, E) { return E ? d === s[0] && E === s[1] : d === s[1]; } function A(d) { return r.indexOf(d) !== -1; } function u() { this.isLoaded = !0; } var f = function () { (this.fonts = []), (this.chars = null), (this.typekitLoaded = 0), (this.isLoaded = !1), (this._warned = !1), (this.initTime = Date.now()), (this.setIsLoadedBinded = this.setIsLoaded.bind(this)), (this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)); }; (f.isModifier = b), (f.isZeroWidthJoiner = y), (f.isCombinedCharacter = A); var m = { addChars: g, addFonts: c, getCharData: S, getFontByName: P, measureText: p, checkLoadedFonts: o, setIsLoaded: u }; return (f.prototype = m), f; })(); function SlotManager(e) { this.animationData = e; } SlotManager.prototype.getProp = function (e) { return this.animationData.slots && this.animationData.slots[e.sid] ? Object.assign(e, this.animationData.slots[e.sid].p) : e; }; function slotFactory(e) { return new SlotManager(e); } function RenderableElement() {} RenderableElement.prototype = { initRenderable: function () { (this.isInRange = !1), (this.hidden = !1), (this.isTransparent = !1), (this.renderableComponents = []); }, addRenderableComponent: function (t) { this.renderableComponents.indexOf(t) === -1 && this.renderableComponents.push(t); }, removeRenderableComponent: function (t) { this.renderableComponents.indexOf(t) !== -1 && this.renderableComponents.splice( this.renderableComponents.indexOf(t), 1 ); }, prepareRenderableFrame: function (t) { this.checkLayerLimits(t); }, checkTransparency: function () { this.finalTransform.mProp.o.v <= 0 ? !this.isTransparent && this.globalData.renderConfig.hideOnTransparent && ((this.isTransparent = !0), this.hide()) : this.isTransparent && ((this.isTransparent = !1), this.show()); }, checkLayerLimits: function (t) { this.data.ip - this.data.st <= t && this.data.op - this.data.st > t ? this.isInRange !== !0 && ((this.globalData._mdf = !0), (this._mdf = !0), (this.isInRange = !0), this.show()) : this.isInRange !== !1 && ((this.globalData._mdf = !0), (this.isInRange = !1), this.hide()); }, renderRenderable: function () { var t, r = this.renderableComponents.length; for (t = 0; t < r; t += 1) this.renderableComponents[t].renderFrame(this._isFirstFrame); }, sourceRectAtTime: function () { return { top: 0, left: 0, width: 100, height: 100 }; }, getLayerSize: function () { return this.data.ty === 5 ? { w: this.data.textData.width, h: this.data.textData.height } : { w: this.data.width, h: this.data.height }; } }; var getBlendMode = (function () { var e = { 0: 'source-over', 1: 'multiply', 2: 'screen', 3: 'overlay', 4: 'darken', 5: 'lighten', 6: 'color-dodge', 7: 'color-burn', 8: 'hard-light', 9: 'soft-light', 10: 'difference', 11: 'exclusion', 12: 'hue', 13: 'saturation', 14: 'color', 15: 'luminosity' }; return function (t) { return e[t] || ''; }; })(); function SliderEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 0, 0, r); } function AngleEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 0, 0, r); } function ColorEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 1, 0, r); } function PointEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 1, 0, r); } function LayerIndexEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 0, 0, r); } function MaskIndexEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 0, 0, r); } function CheckboxEffect(e, t, r) { this.p = PropertyFactory.getProp(t, e.v, 0, 0, r); } function NoValueEffect() { this.p = {}; } function EffectsManager(e, t) { var r = e.ef || []; this.effectElements = []; var i, s = r.length, n; for (i = 0; i < s; i += 1) (n = new GroupEffect(r[i], t)), this.effectElements.push(n); } function GroupEffect(e, t) { this.init(e, t); } extendPrototype([DynamicPropertyContainer], GroupEffect), (GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties), (GroupEffect.prototype.init = function (e, t) { (this.data = e), (this.effectElements = []), this.initDynamicPropertyContainer(t); var r, i = this.data.ef.length, s, n = this.data.ef; for (r = 0; r < i; r += 1) { switch (((s = null), n[r].ty)) { case 0: s = new SliderEffect(n[r], t, this); break; case 1: s = new AngleEffect(n[r], t, this); break; case 2: s = new ColorEffect(n[r], t, this); break; case 3: s = new PointEffect(n[r], t, this); break; case 4: case 7: s = new CheckboxEffect(n[r], t, this); break; case 10: s = new LayerIndexEffect(n[r], t, this); break; case 11: s = new MaskIndexEffect(n[r], t, this); break; case 5: s = new EffectsManager(n[r], t); break; default: s = new NoValueEffect(n[r]); break; } s && this.effectElements.push(s); } }); function BaseElement() {} BaseElement.prototype = { checkMasks: function () { if (!this.data.hasMask) return !1; for (var t = 0, r = this.data.masksProperties.length; t < r; ) { if ( this.data.masksProperties[t].mode !== 'n' && this.data.masksProperties[t].cl !== !1 ) return !0; t += 1; } return !1; }, initExpressions: function () { var t = getExpressionInterfaces(); if (t) { var r = t('layer'), i = t('effects'), s = t('shape'), n = t('text'), a = t('comp'); (this.layerInterface = r(this)), this.data.hasMask && this.maskManager && this.layerInterface.registerMaskInterface(this.maskManager); var o = i.createEffectsInterface(this, this.layerInterface); this.layerInterface.registerEffectsInterface(o), this.data.ty === 0 || this.data.xt ? (this.compInterface = a(this)) : this.data.ty === 4 ? ((this.layerInterface.shapeInterface = s( this.shapesData, this.itemsData, this.layerInterface )), (this.layerInterface.content = this.layerInterface.shapeInterface)) : this.data.ty === 5 && ((this.layerInterface.textInterface = n(this)), (this.layerInterface.text = this.layerInterface.textInterface)); } }, setBlendMode: function () { var t = getBlendMode(this.data.bm), r = this.baseElement || this.layerElement; r.style['mix-blend-mode'] = t; }, initBaseData: function (t, r, i) { (this.globalData = r), (this.comp = i), (this.data = t), (this.layerId = createElementID()), this.data.sr || (this.data.sr = 1), (this.effectsManager = new EffectsManager( this.data, this, this.dynamicProperties )); }, getType: function () { return this.type; }, sourceRectAtTime: function () {} }; function FrameElement() {} FrameElement.prototype = { initFrame: function () { (this._isFirstFrame = !1), (this.dynamicProperties = []), (this._mdf = !1); }, prepareProperties: function (t, r) { var i, s = this.dynamicProperties.length; for (i = 0; i < s; i += 1) (r || (this._isParent && this.dynamicProperties[i].propType === 'transform')) && (this.dynamicProperties[i].getValue(), this.dynamicProperties[i]._mdf && ((this.globalData._mdf = !0), (this._mdf = !0))); }, addDynamicProperty: function (t) { this.dynamicProperties.indexOf(t) === -1 && this.dynamicProperties.push(t); } }; function FootageElement(e, t, r) { this.initFrame(), this.initRenderable(), (this.assetData = t.getAssetData(e.refId)), (this.footageData = t.imageLoader.getAsset(this.assetData)), this.initBaseData(e, t, r); } (FootageElement.prototype.prepareFrame = function () {}), extendPrototype( [RenderableElement, BaseElement, FrameElement], FootageElement ), (FootageElement.prototype.getBaseElement = function () { return null; }), (FootageElement.prototype.renderFrame = function () {}), (FootageElement.prototype.destroy = function () {}), (FootageElement.prototype.initExpressions = function () { var e = getExpressionInterfaces(); if (e) { var t = e('footage'); this.layerInterface = t(this); } }), (FootageElement.prototype.getFootageData = function () { return this.footageData; }); function AudioElement(e, t, r) { this.initFrame(), this.initRenderable(), (this.assetData = t.getAssetData(e.refId)), this.initBaseData(e, t, r), (this._isPlaying = !1), (this._canPlay = !1); var i = this.globalData.getAssetsPath(this.assetData); (this.audio = this.globalData.audioController.createAudio(i)), (this._currentTime = 0), this.globalData.audioController.addAudio(this), (this._volumeMultiplier = 1), (this._volume = 1), (this._previousVolume = null), (this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this) : { _placeholder: !0 }), (this.lv = PropertyFactory.getProp( this, e.au && e.au.lv ? e.au.lv : { k: [100] }, 1, 0.01, this )); } (AudioElement.prototype.prepareFrame = function (e) { if ( (this.prepareRenderableFrame(e, !0), this.prepareProperties(e, !0), this.tm._placeholder) ) this._currentTime = e / this.data.sr; else { var t = this.tm.v; this._currentTime = t; } this._volume = this.lv.v[0]; var r = this._volume * this._volumeMultiplier; this._previousVolume !== r && ((this._previousVolume = r), this.audio.volume(r)); }), extendPrototype( [RenderableElement, BaseElement, FrameElement], AudioElement ), (AudioElement.prototype.renderFrame = function () { this.isInRange && this._canPlay && (this._isPlaying ? (!this.audio.playing() || Math.abs( this._currentTime / this.globalData.frameRate - this.audio.seek() ) > 0.1) && this.audio.seek(this._currentTime / this.globalData.frameRate) : (this.audio.play(), this.audio.seek(this._currentTime / this.globalData.frameRate), (this._isPlaying = !0))); }), (AudioElement.prototype.show = function () {}), (AudioElement.prototype.hide = function () { this.audio.pause(), (this._isPlaying = !1); }), (AudioElement.prototype.pause = function () { this.audio.pause(), (this._isPlaying = !1), (this._canPlay = !1); }), (AudioElement.prototype.resume = function () { this._canPlay = !0; }), (AudioElement.prototype.setRate = function (e) { this.audio.rate(e); }), (AudioElement.prototype.volume = function (e) { (this._volumeMultiplier = e), (this._previousVolume = e * this._volume), this.audio.volume(this._previousVolume); }), (AudioElement.prototype.getBaseElement = function () { return null; }), (AudioElement.prototype.destroy = function () {}), (AudioElement.prototype.sourceRectAtTime = function () {}), (AudioElement.prototype.initExpressions = function () {}); function BaseRenderer() {} (BaseRenderer.prototype.checkLayers = function (e) { var t, r = this.layers.length, i; for (this.completeLayers = !0, t = r - 1; t >= 0; t -= 1) this.elements[t] || ((i = this.layers[t]), i.ip - i.st <= e - this.layers[t].st && i.op - i.st > e - this.layers[t].st && this.buildItem(t)), (this.completeLayers = this.elements[t] ? this.completeLayers : !1); this.checkPendingElements(); }), (BaseRenderer.prototype.createItem = function (e) { switch (e.ty) { case 2: return this.createImage(e); case 0: return this.createComp(e); case 1: return this.createSolid(e); case 3: return this.createNull(e); case 4: return this.createShape(e); case 5: return this.createText(e); case 6: return this.createAudio(e); case 13: return this.createCamera(e); case 15: return this.createFootage(e); default: return this.createNull(e); } }), (BaseRenderer.prototype.createCamera = function () { throw new Error("You're using a 3d camera. Try the html renderer."); }), (BaseRenderer.prototype.createAudio = function (e) { return new AudioElement(e, this.globalData, this); }), (BaseRenderer.prototype.createFootage = function (e) { return new FootageElement(e, this.globalData, this); }), (BaseRenderer.prototype.buildAllItems = function () { var e, t = this.layers.length; for (e = 0; e < t; e += 1) this.buildItem(e); this.checkPendingElements(); }), (BaseRenderer.prototype.includeLayers = function (e) { this.completeLayers = !1; var t, r = e.length, i, s = this.layers.length; for (t = 0; t < r; t += 1) for (i = 0; i < s; ) { if (this.layers[i].id === e[t].id) { this.layers[i] = e[t]; break; } i += 1; } }), (BaseRenderer.prototype.setProjectInterface = function (e) { this.globalData.projectInterface = e; }), (BaseRenderer.prototype.initItems = function () { this.globalData.progressiveLoad || this.buildAllItems(); }), (BaseRenderer.prototype.buildElementParenting = function (e, t, r) { for ( var i = this.elements, s = this.layers, n = 0, a = s.length; n < a; ) s[n].ind == t && (!i[n] || i[n] === !0 ? (this.buildItem(n), this.addPendingElement(e)) : (r.push(i[n]), i[n].setAsParent(), s[n].parent !== void 0 ? this.buildElementParenting(e, s[n].parent, r) : e.setHierarchy(r))), (n += 1); }), (BaseRenderer.prototype.addPendingElement = function (e) { this.pendingElements.push(e); }), (BaseRenderer.prototype.searchExtraCompositions = function (e) { var t, r = e.length; for (t = 0; t < r; t += 1) if (e[t].xt) { var i = this.createComp(e[t]); i.initExpressions(), this.globalData.projectInterface.registerComposition(i); } }), (BaseRenderer.prototype.getElementById = function (e) { var t, r = this.elements.length; for (t = 0; t < r; t += 1) if (this.elements[t].data.ind === e) return this.elements[t]; return null; }), (BaseRenderer.prototype.getElementByPath = function (e) { var t = e.shift(), r; if (typeof t == 'number') r = this.elements[t]; else { var i, s = this.elements.length; for (i = 0; i < s; i += 1) if (this.elements[i].data.nm === t) { r = this.elements[i]; break; } } return e.length === 0 ? r : r.getElementByPath(e); }), (BaseRenderer.prototype.setupGlobalData = function (e, t) { (this.globalData.fontManager = new FontManager()), (this.globalData.slotManager = slotFactory(e)), this.globalData.fontManager.addChars(e.chars), this.globalData.fontManager.addFonts(e.fonts, t), (this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem)), (this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem)), (this.globalData.imageLoader = this.animationItem.imagePreloader), (this.globalData.audioController = this.animationItem.audioController), (this.globalData.frameId = 0), (this.globalData.frameRate = e.fr), (this.globalData.nm = e.nm), (this.globalData.compSize = { w: e.w, h: e.h }); }); function TransformElement() {} TransformElement.prototype = { initTransform: function () { (this.finalTransform = { mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty( this, this.data.ks, this ) : { o: 0 }, _matMdf: !1, _opMdf: !1, mat: new Matrix() }), this.data.ao && (this.finalTransform.mProp.autoOriented = !0), this.data.ty; }, renderTransform: function () { if ( ((this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame), (this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame), this.hierarchy) ) { var t, r = this.finalTransform.mat, i = 0, s = this.hierarchy.length; if (!this.finalTransform._matMdf) for (; i < s; ) { if (this.hierarchy[i].finalTransform.mProp._mdf) { this.finalTransform._matMdf = !0; break; } i += 1; } if (this.finalTransform._matMdf) for ( t = this.finalTransform.mProp.v.props, r.cloneFromProps(t), i = 0; i < s; i += 1 ) (t = this.hierarchy[i].finalTransform.mProp.v.props), r.transform( t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15] ); } }, globalToLocal: function (t) { var r = []; r.push(this.finalTransform); for (var i = !0, s = this.comp; i; ) s.finalTransform ? (s.data.hasMask && r.splice(0, 0, s.finalTransform), (s = s.comp)) : (i = !1); var n, a = r.length, o; for (n = 0; n < a; n += 1) (o = r[n].mat.applyToPointArray(0, 0, 0)), (t = [t[0] - o[0], t[1] - o[1], 0]); return t; }, mHelper: new Matrix() }; function MaskElement(e, t, r) { (this.data = e), (this.element = t), (this.globalData = r), (this.storedData = []), (this.masksProperties = this.data.masksProperties || []), (this.maskElement = null); var i = this.globalData.defs, s, n = this.masksProperties ? this.masksProperties.length : 0; (this.viewData = createSizedArray(n)), (this.solidPath = ''); var a, o = this.masksProperties, l = 0, c = [], g, S, p = createElementID(), P, b, y, A, u = 'clipPath', f = 'clip-path'; for (s = 0; s < n; s += 1) if ( (((o[s].mode !== 'a' && o[s].mode !== 'n') || o[s].inv || o[s].o.k !== 100 || o[s].o.x) && ((u = 'mask'), (f = 'mask')), (o[s].mode === 's' || o[s].mode === 'i') && l === 0 ? ((P = createNS('rect')), P.setAttribute('fill', '#ffffff'), P.setAttribute('width', this.element.comp.data.w || 0), P.setAttribute('height', this.element.comp.data.h || 0), c.push(P)) : (P = null), (a = createNS('path')), o[s].mode === 'n') ) (this.viewData[s] = { op: PropertyFactory.getProp( this.element, o[s].o, 0, 0.01, this.element ), prop: ShapePropertyFactory.getShapeProp(this.element, o[s], 3), elem: a, lastPath: '' }), i.appendChild(a); else { (l += 1), a.setAttribute('fill', o[s].mode === 's' ? '#000000' : '#ffffff'), a.setAttribute('clip-rule', 'nonzero'); var m; if ( (o[s].x.k !== 0 ? ((u = 'mask'), (f = 'mask'), (A = PropertyFactory.getProp( this.element, o[s].x, 0, null, this.element )), (m = createElementID()), (b = createNS('filter')), b.setAttribute('id', m), (y = createNS('feMorphology')), y.setAttribute('operator', 'erode'), y.setAttribute('in', 'SourceGraphic'), y.setAttribute('radius', '0'), b.appendChild(y), i.appendChild(b), a.setAttribute( 'stroke', o[s].mode === 's' ? '#000000' : '#ffffff' )) : ((y = null), (A = null)), (this.storedData[s] = { elem: a, x: A, expan: y, lastPath: '', lastOperator: '', filterId: m, lastRadius: 0 }), o[s].mode === 'i') ) { S = c.length; var d = createNS('g'); for (g = 0; g < S; g += 1) d.appendChild(c[g]); var E = createNS('mask'); E.setAttribute('mask-type', 'alpha'), E.setAttribute('id', p + '_' + l), E.appendChild(a), i.appendChild(E), d.setAttribute( 'mask', 'url(' + getLocationHref() + '#' + p + '_' + l + ')' ), (c.length = 0), c.push(d); } else c.push(a); o[s].inv && !this.solidPath && (this.solidPath = this.createLayerSolidPath()), (this.viewData[s] = { elem: a, lastPath: '', op: PropertyFactory.getProp( this.element, o[s].o, 0, 0.01, this.element ), prop: ShapePropertyFactory.getShapeProp(this.element, o[s], 3), invRect: P }), this.viewData[s].prop.k || this.drawPath(o[s], this.viewData[s].prop.v, this.viewData[s]); } for (this.maskElement = createNS(u), n = c.length, s = 0; s < n; s += 1) this.maskElement.appendChild(c[s]); l > 0 && (this.maskElement.setAttribute('id', p), this.element.maskedElement.setAttribute( f, 'url(' + getLocationHref() + '#' + p + ')' ), i.appendChild(this.maskElement)), this.viewData.length && this.element.addRenderableComponent(this); } (MaskElement.prototype.getMaskProperty = function (e) { return this.viewData[e].prop; }), (MaskElement.prototype.renderFrame = function (e) { var t = this.element.finalTransform.mat, r, i = this.masksProperties.length; for (r = 0; r < i; r += 1) if ( ((this.viewData[r].prop._mdf || e) && this.drawPath( this.masksProperties[r], this.viewData[r].prop.v, this.viewData[r] ), (this.viewData[r].op._mdf || e) && this.viewData[r].elem.setAttribute( 'fill-opacity', this.viewData[r].op.v ), this.masksProperties[r].mode !== 'n' && (this.viewData[r].invRect && (this.element.finalTransform.mProp._mdf || e) && this.viewData[r].invRect.setAttribute( 'transform', t.getInverseMatrix().to2dCSS() ), this.storedData[r].x && (this.storedData[r].x._mdf || e))) ) { var s = this.storedData[r].expan; this.storedData[r].x.v < 0 ? (this.storedData[r].lastOperator !== 'erode' && ((this.storedData[r].lastOperator = 'erode'), this.storedData[r].elem.setAttribute( 'filter', 'url(' + getLocationHref() + '#' + this.storedData[r].filterId + ')' )), s.setAttribute('radius', -this.storedData[r].x.v)) : (this.storedData[r].lastOperator !== 'dilate' && ((this.storedData[r].lastOperator = 'dilate'), this.storedData[r].elem.setAttribute('filter', null)), this.storedData[r].elem.setAttribute( 'stroke-width', this.storedData[r].x.v * 2 )); } }), (MaskElement.prototype.getMaskelement = function () { return this.maskElement; }), (MaskElement.prototype.createLayerSolidPath = function () { var e = 'M0,0 '; return ( (e += ' h' + this.globalData.compSize.w), (e += ' v' + this.globalData.compSize.h), (e += ' h-' + this.globalData.compSize.w), (e += ' v-' + this.globalData.compSize.h + ' '), e ); }), (MaskElement.prototype.drawPath = function (e, t, r) { var i = ' M' + t.v[0][0] + ',' + t.v[0][1], s, n; for (n = t._length, s = 1; s < n; s += 1) i += ' C' + t.o[s - 1][0] + ',' + t.o[s - 1][1] + ' ' + t.i[s][0] + ',' + t.i[s][1] + ' ' + t.v[s][0] + ',' + t.v[s][1]; if ( (t.c && n > 1 && (i += ' C' + t.o[s - 1][0] + ',' + t.o[s - 1][1] + ' ' + t.i[0][0] + ',' + t.i[0][1] + ' ' + t.v[0][0] + ',' + t.v[0][1]), r.lastPath !== i) ) { var a = ''; r.elem && (t.c && (a = e.inv ? this.solidPath + i : i), r.elem.setAttribute('d', a)), (r.lastPath = i); } }), (MaskElement.prototype.destroy = function () { (this.element = null), (this.globalData = null), (this.maskElement = null), (this.data = null), (this.masksProperties = null); }); var filtersFactory = (function () { var e = {}; (e.createFilter = t), (e.createAlphaToLuminanceFilter = r); function t(i, s) { var n = createNS('filter'); return ( n.setAttribute('id', i), s !== !0 && (n.setAttribute('filterUnits', 'objectBoundingBox'), n.setAttribute('x', '0%'), n.setAttribute('y', '0%'), n.setAttribute('width', '100%'), n.setAttribute('height', '100%')), n ); } function r() { var i = createNS('feColorMatrix'); return ( i.setAttribute('type', 'matrix'), i.setAttribute('color-interpolation-filters', 'sRGB'), i.setAttribute( 'values', '0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1' ), i ); } return e; })(), featureSupport = (function () { var e = { maskType: !0, svgLumaHidden: !0, offscreenCanvas: typeof OffscreenCanvas < 'u' }; return ( (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) && (e.maskType = !1), /firefox/i.test(navigator.userAgent) && (e.svgLumaHidden = !1), e ); })(), registeredEffects = {}, idPrefix = 'filter_result_'; function SVGEffects(e) { var t, r = 'SourceGraphic', i = e.data.ef ? e.data.ef.length : 0, s = createElementID(), n = filtersFactory.createFilter(s, !0), a = 0; this.filters = []; var o; for (t = 0; t < i; t += 1) { o = null; var l = e.data.ef[t].ty; if (registeredEffects[l]) { var c = registeredEffects[l].effect; (o = new c( n, e.effectsManager.effectElements[t], e, idPrefix + a, r )), (r = idPrefix + a), registeredEffects[l].countsAsEffect && (a += 1); } o && this.filters.push(o); } a && (e.globalData.defs.appendChild(n), e.layerElement.setAttribute( 'filter', 'url(' + getLocationHref() + '#' + s + ')' )), this.filters.length && e.addRenderableComponent(this); } SVGEffects.prototype.renderFrame = function (e) { var t, r = this.filters.length; for (t = 0; t < r; t += 1) this.filters[t].renderFrame(e); }; function registerEffect(e, t, r) { registeredEffects[e] = { effect: t, countsAsEffect: r }; } function SVGBaseElement() {} SVGBaseElement.prototype = { initRendererElement: function () { this.layerElement = createNS('g'); }, createContainerElements: function () { (this.matteElement = createNS('g')), (this.transformedElement = this.layerElement), (this.maskedElement = this.layerElement), (this._sizeChanged = !1); var t = null; if (this.data.td) { this.matteMasks = {}; var r = createNS('g'); r.setAttribute('id', this.layerId), r.appendChild(this.layerElement), (t = r), this.globalData.defs.appendChild(r); } else this.data.tt ? (this.matteElement.appendChild(this.layerElement), (t = this.matteElement), (this.baseElement = this.matteElement)) : (this.baseElement = this.layerElement); if ( (this.data.ln && this.layerElement.setAttribute('id', this.data.ln), this.data.cl && this.layerElement.setAttribute('class', this.data.cl), this.data.ty === 0 && !this.data.hd) ) { var i = createNS('clipPath'), s = createNS('path'); s.setAttribute( 'd', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z' ); var n = createElementID(); if ( (i.setAttribute('id', n), i.appendChild(s), this.globalData.defs.appendChild(i), this.checkMasks()) ) { var a = createNS('g'); a.setAttribute( 'clip-path', 'url(' + getLocationHref() + '#' + n + ')' ), a.appendChild(this.layerElement), (this.transformedElement = a), t ? t.appendChild(this.transformedElement) : (this.baseElement = this.transformedElement); } else this.layerElement.setAttribute( 'clip-path', 'url(' + getLocationHref() + '#' + n + ')' ); } this.data.bm !== 0 && this.setBlendMode(); }, renderElement: function () { this.finalTransform._matMdf && this.transformedElement.setAttribute( 'transform', this.finalTransform.mat.to2dCSS() ), this.finalTransform._opMdf && this.transformedElement.setAttribute( 'opacity', this.finalTransform.mProp.o.v ); }, destroyBaseElement: function () { (this.layerElement = null), (this.matteElement = null), this.maskManager.destroy(); }, getBaseElement: function () { return this.data.hd ? null : this.baseElement; }, createRenderableComponents: function () { (this.maskManager = new MaskElement( this.data, this, this.globalData )), (this.renderableEffectsManager = new SVGEffects(this)); }, getMatte: function (t) { if ( (this.matteMasks || (this.matteMasks = {}), !this.matteMasks[t]) ) { var r = this.layerId + '_' + t, i, s, n, a; if (t === 1 || t === 3) { var o = createNS('mask'); o.setAttribute('id', r), o.setAttribute('mask-type', t === 3 ? 'luminance' : 'alpha'), (n = createNS('use')), n.setAttributeNS( 'http://www.w3.org/1999/xlink', 'href', '#' + this.layerId ), o.appendChild(n), this.globalData.defs.appendChild(o), !featureSupport.maskType && t === 1 && (o.setAttribute('mask-type', 'luminance'), (i = createElementID()), (s = filtersFactory.createFilter(i)), this.globalData.defs.appendChild(s), s.appendChild(filtersFactory.createAlphaToLuminanceFilter()), (a = createNS('g')), a.appendChild(n), o.appendChild(a), a.setAttribute( 'filter', 'url(' + getLocationHref() + '#' + i + ')' )); } else if (t === 2) { var l = createNS('mask'); l.setAttribute('id', r), l.setAttribute('mask-type', 'alpha'); var c = createNS('g'); l.appendChild(c), (i = createElementID()), (s = filtersFactory.createFilter(i)); var g = createNS('feComponentTransfer'); g.setAttribute('in', 'SourceGraphic'), s.appendChild(g); var S = createNS('feFuncA'); S.setAttribute('type', 'table'), S.setAttribute('tableValues', '1.0 0.0'), g.appendChild(S), this.globalData.defs.appendChild(s); var p = createNS('rect'); p.setAttribute('width', this.comp.data.w), p.setAttribute('height', this.comp.data.h), p.setAttribute('x', '0'), p.setAttribute('y', '0'), p.setAttribute('fill', '#ffffff'), p.setAttribute('opacity', '0'), c.setAttribute( 'filter', 'url(' + getLocationHref() + '#' + i + ')' ), c.appendChild(p), (n = createNS('use')), n.setAttributeNS( 'http://www.w3.org/1999/xlink', 'href', '#' + this.layerId ), c.appendChild(n), featureSupport.maskType || (l.setAttribute('mask-type', 'luminance'), s.appendChild(filtersFactory.createAlphaToLuminanceFilter()), (a = createNS('g')), c.appendChild(p), a.appendChild(this.layerElement), c.appendChild(a)), this.globalData.defs.appendChild(l); } this.matteMasks[t] = r; } return this.matteMasks[t]; }, setMatte: function (t) { this.matteElement && this.matteElement.setAttribute( 'mask', 'url(' + getLocationHref() + '#' + t + ')' ); } }; function HierarchyElement() {} HierarchyElement.prototype = { initHierarchy: function () { (this.hierarchy = []), (this._isParent = !1), this.checkParenting(); }, setHierarchy: function (t) { this.hierarchy = t; }, setAsParent: function () { this._isParent = !0; }, checkParenting: function () { this.data.parent !== void 0 && this.comp.buildElementParenting(this, this.data.parent, []); } }; function RenderableDOMElement() {} (function () { var e = { initElement: function (r, i, s) { this.initFrame(), this.initBaseData(r, i, s), this.initTransform(r, i, s), this.initHierarchy(), this.initRenderable(), this.initRendererElement(), this.createContainerElements(), this.createRenderableComponents(), this.createContent(), this.hide(); }, hide: function () { if (!this.hidden && (!this.isInRange || this.isTransparent)) { var r = this.baseElement || this.layerElement; (r.style.display = 'none'), (this.hidden = !0); } }, show: function () { if (this.isInRange && !this.isTransparent) { if (!this.data.hd) { var r = this.baseElement || this.layerElement; r.style.display = 'block'; } (this.hidden = !1), (this._isFirstFrame = !0); } }, renderFrame: function () { this.data.hd || this.hidden || (this.renderTransform(), this.renderRenderable(), this.renderElement(), this.renderInnerContent(), this._isFirstFrame && (this._isFirstFrame = !1)); }, renderInnerContent: function () {}, prepareFrame: function (r) { (this._mdf = !1), this.prepareRenderableFrame(r), this.prepareProperties(r, this.isInRange), this.checkTransparency(); }, destroy: function () { (this.innerElem = null), this.destroyBaseElement(); } }; extendPrototype( [RenderableElement, createProxyFunction(e)], RenderableDOMElement ); })(); function IImageElement(e, t, r) { (this.assetData = t.getAssetData(e.refId)), this.assetData && this.assetData.sid && (this.assetData = t.slotManager.getProp(this.assetData)), this.initElement(e, t, r), (this.sourceRect = { top: 0, left: 0, width: this.assetData.w, height: this.assetData.h }); } extendPrototype( [ BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement ], IImageElement ), (IImageElement.prototype.createContent = function () { var e = this.globalData.getAssetsPath(this.assetData); (this.innerElem = createNS('image')), this.innerElem.setAttribute('width', this.assetData.w + 'px'), this.innerElem.setAttribute('height', this.assetData.h + 'px'), this.innerElem.setAttribute( 'preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio ), this.innerElem.setAttributeNS( 'http://www.w3.org/1999/xlink', 'href', e ), this.layerElement.appendChild(this.innerElem); }), (IImageElement.prototype.sourceRectAtTime = function () { return this.sourceRect; }); function ProcessedElement(e, t) { (this.elem = e), (this.pos = t); } function IShapeElement() {} IShapeElement.prototype = { addShapeToModifiers: function (t) { var r, i = this.shapeModifiers.length; for (r = 0; r < i; r += 1) this.shapeModifiers[r].addShape(t); }, isShapeInAnimatedModifiers: function (t) { for (var r = 0, i = this.shapeModifiers.length; r < i; ) if (this.shapeModifiers[r].isAnimatedWithShape(t)) return !0; return !1; }, renderModifiers: function () { if (this.shapeModifiers.length) { var t, r = this.shapes.length; for (t = 0; t < r; t += 1) this.shapes[t].sh.reset(); r = this.shapeModifiers.length; var i; for ( t = r - 1; t >= 0 && ((i = this.shapeModifiers[t].processShapes(this._isFirstFrame)), !i); t -= 1 ); } }, searchProcessedElement: function (t) { for (var r = this.processedElements, i = 0, s = r.length; i < s; ) { if (r[i].elem === t) return r[i].pos; i += 1; } return 0; }, addProcessedElement: function (t, r) { for (var i = this.processedElements, s = i.length; s; ) if (((s -= 1), i[s].elem === t)) { i[s].pos = r; return; } i.push(new ProcessedElement(t, r)); }, prepareFrame: function (t) { this.prepareRenderableFrame(t), this.prepareProperties(t, this.isInRange); } }; var lineCapEnum = { 1: 'butt', 2: 'round', 3: 'square' }, lineJoinEnum = { 1: 'miter', 2: 'round', 3: 'bevel' }; function SVGShapeData(e, t, r) { (this.caches = []), (this.styles = []), (this.transformers = e), (this.lStr = ''), (this.sh = r), (this.lvl = t), (this._isAnimated = !!r.k); for (var i = 0, s = e.length; i < s; ) { if (e[i].mProps.dynamicProperties.length) { this._isAnimated = !0; break; } i += 1; } } SVGShapeData.prototype.setAsAnimated = function () { this._isAnimated = !0; }; function SVGStyleData(e, t) { (this.data = e), (this.type = e.ty), (this.d = ''), (this.lvl = t), (this._mdf = !1), (this.closed = e.hd === !0), (this.pElem = createNS('path')), (this.msElem = null); } SVGStyleData.prototype.reset = function () { (this.d = ''), (this._mdf = !1); }; function DashProperty(e, t, r, i) { (this.elem = e), (this.frameId = -1), (this.dataProps = createSizedArray(t.length)), (this.renderer = r), (this.k = !1), (this.dashStr = ''), (this.dashArray = createTypedArray( 'float32', t.length ? t.length - 1 : 0 )), (this.dashoffset = createTypedArray('float32', 1)), this.initDynamicPropertyContainer(i); var s, n = t.length || 0, a; for (s = 0; s < n; s += 1) (a = PropertyFactory.getProp(e, t[s].v, 0, 0, this)), (this.k = a.k || this.k), (this.dataProps[s] = { n: t[s].n, p: a }); this.k || this.getValue(!0), (this._isAnimated = this.k); } (DashProperty.prototype.getValue = function (e) { if ( !(this.elem.globalData.frameId === this.frameId && !e) && ((this.frameId = this.elem.globalData.frameId), this.iterateDynamicProperties(), (this._mdf = this._mdf || e), this._mdf) ) { var t = 0, r = this.dataProps.length; for ( this.renderer === 'svg' && (this.dashStr = ''), t = 0; t < r; t += 1 ) this.dataProps[t].n !== 'o' ? this.renderer === 'svg' ? (this.dashStr += ' ' + this.dataProps[t].p.v) : (this.dashArray[t] = this.dataProps[t].p.v) : (this.dashoffset[0] = this.dataProps[t].p.v); } }), extendPrototype([DynamicPropertyContainer], DashProperty); function SVGStrokeStyleData(e, t, r) { this.initDynamicPropertyContainer(e), (this.getValue = this.iterateDynamicProperties), (this.o = PropertyFactory.getProp(e, t.o, 0, 0.01, this)), (this.w = PropertyFactory.getProp(e, t.w, 0, null, this)), (this.d = new DashProperty(e, t.d || {}, 'svg', this)), (this.c = PropertyFactory.getProp(e, t.c, 1, 255, this)), (this.style = r), (this._isAnimated = !!this._isAnimated); } extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData); function SVGFillStyleData(e, t, r) { this.initDynamicPropertyContainer(e), (this.getValue = this.iterateDynamicProperties), (this.o = PropertyFactory.getProp(e, t.o, 0, 0.01, this)), (this.c = PropertyFactory.getProp(e, t.c, 1, 255, this)), (this.style = r); } extendPrototype([DynamicPropertyContainer], SVGFillStyleData); function SVGNoStyleData(e, t, r) { this.initDynamicPropertyContainer(e), (this.getValue = this.iterateDynamicProperties), (this.style = r); } extendPrototype([DynamicPropertyContainer], SVGNoStyleData); function GradientProperty(e, t, r) { (this.data = t), (this.c = createTypedArray('uint8c', t.p * 4)); var i = t.k.k[0].s ? t.k.k[0].s.length - t.p * 4 : t.k.k.length - t.p * 4; (this.o = createTypedArray('float32', i)), (this._cmdf = !1), (this._omdf = !1), (this._collapsable = this.checkCollapsable()), (this._hasOpacity = i), this.initDynamicPropertyContainer(r), (this.prop = PropertyFactory.getProp(e, t.k, 1, null, this)), (this.k = this.prop.k), this.getValue(!0); } (GradientProperty.prototype.comparePoints = function (e, t) { for (var r = 0, i = this.o.length / 2, s; r < i; ) { if (((s = Math.abs(e[r * 4] - e[t * 4 + r * 2])), s > 0.01)) return !1; r += 1; } return !0; }), (GradientProperty.prototype.checkCollapsable = function () { if (this.o.length / 2 !== this.c.length / 4) return !1; if (this.data.k.k[0].s) for (var e = 0, t = this.data.k.k.length; e < t; ) { if (!this.comparePoints(this.data.k.k[e].s, this.data.p)) return !1; e += 1; } else if (!this.comparePoints(this.data.k.k, this.data.p)) return !1; return !0; }), (GradientProperty.prototype.getValue = function (e) { if ( (this.prop.getValue(), (this._mdf = !1), (this._cmdf = !1), (this._omdf = !1), this.prop._mdf || e) ) { var t, r = this.data.p * 4, i, s; for (t = 0; t < r; t += 1) (i = t % 4 === 0 ? 100 : 255), (s = Math.round(this.prop.v[t] * i)), this.c[t] !== s && ((this.c[t] = s), (this._cmdf = !e)); if (this.o.length) for (r = this.prop.v.length, t = this.data.p * 4; t < r; t += 1) (i = t % 2 === 0 ? 100 : 1), (s = t % 2 === 0 ? Math.round(this.prop.v[t] * 100) : this.prop.v[t]), this.o[t - this.data.p * 4] !== s && ((this.o[t - this.data.p * 4] = s), (this._omdf = !e)); this._mdf = !e; } }), extendPrototype([DynamicPropertyContainer], GradientProperty); function SVGGradientFillStyleData(e, t, r) { this.initDynamicPropertyContainer(e), (this.getValue = this.iterateDynamicProperties), this.initGradientData(e, t, r); } (SVGGradientFillStyleData.prototype.initGradientData = function ( e, t, r ) { (this.o = PropertyFactory.getProp(e, t.o, 0, 0.01, this)), (this.s = PropertyFactory.getProp(e, t.s, 1, null, this)), (this.e = PropertyFactory.getProp(e, t.e, 1, null, this)), (this.h = PropertyFactory.getProp(e, t.h || { k: 0 }, 0, 0.01, this)), (this.a = PropertyFactory.getProp( e, t.a || { k: 0 }, 0, degToRads, this )), (this.g = new GradientProperty(e, t.g, this)), (this.style = r), (this.stops = []), this.setGradientData(r.pElem, t), this.setGradientOpacity(t, r), (this._isAnimated = !!this._isAnimated); }), (SVGGradientFillStyleData.prototype.setGradientData = function (e, t) { var r = createElementID(), i = createNS(t.t === 1 ? 'linearGradient' : 'radialGradient'); i.setAttribute('id', r), i.setAttribute('spreadMethod', 'pad'), i.setAttribute('gradientUnits', 'userSpaceOnUse'); var s = [], n, a, o; for (o = t.g.p * 4, a = 0; a < o; a += 4) (n = createNS('stop')), i.appendChild(n), s.push(n); e.setAttribute( t.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + r + ')' ), (this.gf = i), (this.cst = s); }), (SVGGradientFillStyleData.prototype.setGradientOpacity = function ( e, t ) { if (this.g._hasOpacity && !this.g._collapsable) { var r, i, s, n = createNS('mask'), a = createNS('path'); n.appendChild(a); var o = createElementID(), l = createElementID(); n.setAttribute('id', l); var c = createNS(e.t === 1 ? 'linearGradient' : 'radialGradient'); c.setAttribute('id', o), c.setAttribute('spreadMethod', 'pad'), c.setAttribute('gradientUnits', 'userSpaceOnUse'), (s = e.g.k.k[0].s ? e.g.k.k[0].s.length : e.g.k.k.length); var g = this.stops; for (i = e.g.p * 4; i < s; i += 2) (r = createNS('stop')), r.setAttribute('stop-color', 'rgb(255,255,255)'), c.appendChild(r), g.push(r); a.setAttribute( e.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + o + ')' ), e.ty === 'gs' && (a.setAttribute('stroke-linecap', lineCapEnum[e.lc || 2]), a.setAttribute('stroke-linejoin', lineJoinEnum[e.lj || 2]), e.lj === 1 && a.setAttribute('stroke-miterlimit', e.ml)), (this.of = c), (this.ms = n), (this.ost = g), (this.maskId = l), (t.msElem = a); } }), extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData); function SVGGradientStrokeStyleData(e, t, r) { this.initDynamicPropertyContainer(e), (this.getValue = this.iterateDynamicProperties), (this.w = PropertyFactory.getProp(e, t.w, 0, null, this)), (this.d = new DashProperty(e, t.d || {}, 'svg', this)), this.initGradientData(e, t, r), (this._isAnimated = !!this._isAnimated); } extendPrototype( [SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData ); function ShapeGroupData() { (this.it = []), (this.prevViewData = []), (this.gr = createNS('g')); } function SVGTransformData(e, t, r) { (this.transform = { mProps: e, op: t, container: r }), (this.elements = []), (this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length); } var buildShapeString = function (t, r, i, s) { if (r === 0) return ''; var n = t.o, a = t.i, o = t.v, l, c = ' M' + s.applyToPointStringified(o[0][0], o[0][1]); for (l = 1; l < r; l += 1) c += ' C' + s.applyToPointStringified(n[l - 1][0], n[l - 1][1]) + ' ' + s.applyToPointStringified(a[l][0], a[l][1]) + ' ' + s.applyToPointStringified(o[l][0], o[l][1]); return ( i && r && ((c += ' C' + s.applyToPointStringified(n[l - 1][0], n[l - 1][1]) + ' ' + s.applyToPointStringified(a[0][0], a[0][1]) + ' ' + s.applyToPointStringified(o[0][0], o[0][1])), (c += 'z')), c ); }, SVGElementsRenderer = (function () { var e = new Matrix(), t = new Matrix(), r = { createRenderFunction: i }; function i(S) { switch (S.ty) { case 'fl': return o; case 'gf': return c; case 'gs': return l; case 'st': return g; case 'sh': case 'el': case 'rc': case 'sr': return a; case 'tr': return s; case 'no': return n; default: return null; } } function s(S, p, P) { (P || p.transform.op._mdf) && p.transform.container.setAttribute('opacity', p.transform.op.v), (P || p.transform.mProps._mdf) && p.transform.container.setAttribute( 'transform', p.transform.mProps.v.to2dCSS() ); } function n() {} function a(S, p, P) { var b, y, A, u, f, m, d = p.styles.length, E = p.lvl, T, x, _, I, V; for (m = 0; m < d; m += 1) { if (((u = p.sh._mdf || P), p.styles[m].lvl < E)) { for ( x = t.reset(), I = E - p.styles[m].lvl, V = p.transformers.length - 1; !u && I > 0; ) (u = p.transformers[V].mProps._mdf || u), (I -= 1), (V -= 1); if (u) for ( I = E - p.styles[m].lvl, V = p.transformers.length - 1; I > 0; ) (_ = p.transformers[V].mProps.v.props), x.transform( _[0], _[1], _[2], _[3], _[4], _[5], _[6], _[7], _[8], _[9], _[10], _[11], _[12], _[13], _[14], _[15] ), (I -= 1), (V -= 1); } else x = e; if (((T = p.sh.paths), (y = T._length), u)) { for (A = '', b = 0; b < y; b += 1) (f = T.shapes[b]), f && f._length && (A += buildShapeString(f, f._length, f.c, x)); p.caches[m] = A; } else A = p.caches[m]; (p.styles[m].d += S.hd === !0 ? '' : A), (p.styles[m]._mdf = u || p.styles[m]._mdf); } } function o(S, p, P) { var b = p.style; (p.c._mdf || P) && b.pElem.setAttribute( 'fill', 'rgb(' + bmFloor(p.c.v[0]) + ',' + bmFloor(p.c.v[1]) + ',' + bmFloor(p.c.v[2]) + ')' ), (p.o._mdf || P) && b.pElem.setAttribute('fill-opacity', p.o.v); } function l(S, p, P) { c(S, p, P), g(S, p, P); } function c(S, p, P) { var b = p.gf, y = p.g._hasOpacity, A = p.s.v, u = p.e.v; if (p.o._mdf || P) { var f = S.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity'; p.style.pElem.setAttribute(f, p.o.v); } if (p.s._mdf || P) { var m = S.t === 1 ? 'x1' : 'cx', d = m === 'x1' ? 'y1' : 'cy'; b.setAttribute(m, A[0]), b.setAttribute(d, A[1]), y && !p.g._collapsable && (p.of.setAttribute(m, A[0]), p.of.setAttribute(d, A[1])); } var E, T, x, _; if (p.g._cmdf || P) { E = p.cst; var I = p.g.c; for (x = E.length, T = 0; T < x; T += 1) (_ = E[T]), _.setAttribute('offset', I[T * 4] + '%'), _.setAttribute( 'stop-color', 'rgb(' + I[T * 4 + 1] + ',' + I[T * 4 + 2] + ',' + I[T * 4 + 3] + ')' ); } if (y && (p.g._omdf || P)) { var V = p.g.o; for ( p.g._collapsable ? (E = p.cst) : (E = p.ost), x = E.length, T = 0; T < x; T += 1 ) (_ = E[T]), p.g._collapsable || _.setAttribute('offset', V[T * 2] + '%'), _.setAttribute('stop-opacity', V[T * 2 + 1]); } if (S.t === 1) (p.e._mdf || P) && (b.setAttribute('x2', u[0]), b.setAttribute('y2', u[1]), y && !p.g._collapsable && (p.of.setAttribute('x2', u[0]), p.of.setAttribute('y2', u[1]))); else { var D; if ( ((p.s._mdf || p.e._mdf || P) && ((D = Math.sqrt( Math.pow(A[0] - u[0], 2) + Math.pow(A[1] - u[1], 2) )), b.setAttribute('r', D), y && !p.g._collapsable && p.of.setAttribute('r', D)), p.e._mdf || p.h._mdf || p.a._mdf || P) ) { D || (D = Math.sqrt( Math.pow(A[0] - u[0], 2) + Math.pow(A[1] - u[1], 2) )); var N = Math.atan2(u[1] - A[1], u[0] - A[0]), $ = p.h.v; $ >= 1 ? ($ = 0.99) : $ <= -1 && ($ = -0.99); var O = D * $, B = Math.cos(N + p.a.v) * O + A[0], F = Math.sin(N + p.a.v) * O + A[1]; b.setAttribute('fx', B), b.setAttribute('fy', F), y && !p.g._collapsable && (p.of.setAttribute('fx', B), p.of.setAttribute('fy', F)); } } } function g(S, p, P) { var b = p.style, y = p.d; y && (y._mdf || P) && y.dashStr && (b.pElem.setAttribute('stroke-dasharray', y.dashStr), b.pElem.setAttribute('stroke-dashoffset', y.dashoffset[0])), p.c && (p.c._mdf || P) && b.pElem.setAttribute( 'stroke', 'rgb(' + bmFloor(p.c.v[0]) + ',' + bmFloor(p.c.v[1]) + ',' + bmFloor(p.c.v[2]) + ')' ), (p.o._mdf || P) && b.pElem.setAttribute('stroke-opacity', p.o.v), (p.w._mdf || P) && (b.pElem.setAttribute('stroke-width', p.w.v), b.msElem && b.msElem.setAttribute('stroke-width', p.w.v)); } return r; })(); function SVGShapeElement(e, t, r) { (this.shapes = []), (this.shapesData = e.shapes), (this.stylesList = []), (this.shapeModifiers = []), (this.itemsData = []), (this.processedElements = []), (this.animatedContents = []), this.initElement(e, t, r), (this.prevViewData = []); } extendPrototype( [ BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement ], SVGShapeElement ), (SVGShapeElement.prototype.initSecondaryElement = function () {}), (SVGShapeElement.prototype.identityMatrix = new Matrix()), (SVGShapeElement.prototype.buildExpressionInterface = function () {}), (SVGShapeElement.prototype.createContent = function () { this.searchShapes( this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], !0 ), this.filterUniqueShapes(); }), (SVGShapeElement.prototype.filterUniqueShapes = function () { var e, t = this.shapes.length, r, i, s = this.stylesList.length, n, a = [], o = !1; for (i = 0; i < s; i += 1) { for ( n = this.stylesList[i], o = !1, a.length = 0, e = 0; e < t; e += 1 ) (r = this.shapes[e]), r.styles.indexOf(n) !== -1 && (a.push(r), (o = r._isAnimated || o)); a.length > 1 && o && this.setShapesAsAnimated(a); } }), (SVGShapeElement.prototype.setShapesAsAnimated = function (e) { var t, r = e.length; for (t = 0; t < r; t += 1) e[t].setAsAnimated(); }), (SVGShapeElement.prototype.createStyleElement = function (e, t) { var r, i = new SVGStyleData(e, t), s = i.pElem; if (e.ty === 'st') r = new SVGStrokeStyleData(this, e, i); else if (e.ty === 'fl') r = new SVGFillStyleData(this, e, i); else if (e.ty === 'gf' || e.ty === 'gs') { var n = e.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData; (r = new n(this, e, i)), this.globalData.defs.appendChild(r.gf), r.maskId && (this.globalData.defs.appendChild(r.ms), this.globalData.defs.appendChild(r.of), s.setAttribute( 'mask', 'url(' + getLocationHref() + '#' + r.maskId + ')' )); } else e.ty === 'no' && (r = new SVGNoStyleData(this, e, i)); return ( (e.ty === 'st' || e.ty === 'gs') && (s.setAttribute('stroke-linecap', lineCapEnum[e.lc || 2]), s.setAttribute('stroke-linejoin', lineJoinEnum[e.lj || 2]), s.setAttribute('fill-opacity', '0'), e.lj === 1 && s.setAttribute('stroke-miterlimit', e.ml)), e.r === 2 && s.setAttribute('fill-rule', 'evenodd'), e.ln && s.setAttribute('id', e.ln), e.cl && s.setAttribute('class', e.cl), e.bm && (s.style['mix-blend-mode'] = getBlendMode(e.bm)), this.stylesList.push(i), this.addToAnimatedContents(e, r), r ); }), (SVGShapeElement.prototype.createGroupElement = function (e) { var t = new ShapeGroupData(); return ( e.ln && t.gr.setAttribute('id', e.ln), e.cl && t.gr.setAttribute('class', e.cl), e.bm && (t.gr.style['mix-blend-mode'] = getBlendMode(e.bm)), t ); }), (SVGShapeElement.prototype.createTransformElement = function (e, t) { var r = TransformPropertyFactory.getTransformProperty(this, e, this), i = new SVGTransformData(r, r.o, t); return this.addToAnimatedContents(e, i), i; }), (SVGShapeElement.prototype.createShapeElement = function (e, t, r) { var i = 4; e.ty === 'rc' ? (i = 5) : e.ty === 'el' ? (i = 6) : e.ty === 'sr' && (i = 7); var s = ShapePropertyFactory.getShapeProp(this, e, i, this), n = new SVGShapeData(t, r, s); return ( this.shapes.push(n), this.addShapeToModifiers(n), this.addToAnimatedContents(e, n), n ); }), (SVGShapeElement.prototype.addToAnimatedContents = function (e, t) { for (var r = 0, i = this.animatedContents.length; r < i; ) { if (this.animatedContents[r].element === t) return; r += 1; } this.animatedContents.push({ fn: SVGElementsRenderer.createRenderFunction(e), element: t, data: e }); }), (SVGShapeElement.prototype.setElementStyles = function (e) { var t = e.styles, r, i = this.stylesList.length; for (r = 0; r < i; r += 1) this.stylesList[r].closed || t.push(this.stylesList[r]); }), (SVGShapeElement.prototype.reloadShapes = function () { this._isFirstFrame = !0; var e, t = this.itemsData.length; for (e = 0; e < t; e += 1) this.prevViewData[e] = this.itemsData[e]; for ( this.searchShapes( this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], !0 ), this.filterUniqueShapes(), t = this.dynamicProperties.length, e = 0; e < t; e += 1 ) this.dynamicProperties[e].getValue(); this.renderModifiers(); }), (SVGShapeElement.prototype.searchShapes = function ( e, t, r, i, s, n, a ) { var o = [].concat(n), l, c = e.length - 1, g, S, p = [], P = [], b, y, A; for (l = c; l >= 0; l -= 1) { if ( ((A = this.searchProcessedElement(e[l])), A ? (t[l] = r[A - 1]) : (e[l]._render = a), e[l].ty === 'fl' || e[l].ty === 'st' || e[l].ty === 'gf' || e[l].ty === 'gs' || e[l].ty === 'no') ) A ? (t[l].style.closed = !1) : (t[l] = this.createStyleElement(e[l], s)), e[l]._render && t[l].style.pElem.parentNode !== i && i.appendChild(t[l].style.pElem), p.push(t[l].style); else if (e[l].ty === 'gr') { if (!A) t[l] = this.createGroupElement(e[l]); else for (S = t[l].it.length, g = 0; g < S; g += 1) t[l].prevViewData[g] = t[l].it[g]; this.searchShapes( e[l].it, t[l].it, t[l].prevViewData, t[l].gr, s + 1, o, a ), e[l]._render && t[l].gr.parentNode !== i && i.appendChild(t[l].gr); } else e[l].ty === 'tr' ? (A || (t[l] = this.createTransformElement(e[l], i)), (b = t[l].transform), o.push(b)) : e[l].ty === 'sh' || e[l].ty === 'rc' || e[l].ty === 'el' || e[l].ty === 'sr' ? (A || (t[l] = this.createShapeElement(e[l], o, s)), this.setElementStyles(t[l])) : e[l].ty === 'tm' || e[l].ty === 'rd' || e[l].ty === 'ms' || e[l].ty === 'pb' || e[l].ty === 'zz' || e[l].ty === 'op' ? (A ? ((y = t[l]), (y.closed = !1)) : ((y = ShapeModifiers.getModifier(e[l].ty)), y.init(this, e[l]), (t[l] = y), this.shapeModifiers.push(y)), P.push(y)) : e[l].ty === 'rp' && (A ? ((y = t[l]), (y.closed = !0)) : ((y = ShapeModifiers.getModifier(e[l].ty)), (t[l] = y), y.init(this, e, l, t), this.shapeModifiers.push(y), (a = !1)), P.push(y)); this.addProcessedElement(e[l], l + 1); } for (c = p.length, l = 0; l < c; l += 1) p[l].closed = !0; for (c = P.length, l = 0; l < c; l += 1) P[l].closed = !0; }), (SVGShapeElement.prototype.renderInnerContent = function () { this.renderModifiers(); var e, t = this.stylesList.length; for (e = 0; e < t; e += 1) this.stylesList[e].reset(); for (this.renderShape(), e = 0; e < t; e += 1) (this.stylesList[e]._mdf || this._isFirstFrame) && (this.stylesList[e].msElem && (this.stylesList[e].msElem.setAttribute( 'd', this.stylesList[e].d ), (this.stylesList[e].d = 'M0 0' + this.stylesList[e].d)), this.stylesList[e].pElem.setAttribute( 'd', this.stylesList[e].d || 'M0 0' )); }), (SVGShapeElement.prototype.renderShape = function () { var e, t = this.animatedContents.length, r; for (e = 0; e < t; e += 1) (r = this.animatedContents[e]), (this._isFirstFrame || r.element._isAnimated) && r.data !== !0 && r.fn(r.data, r.element, this._isFirstFrame); }), (SVGShapeElement.prototype.destroy = function () { this.destroyBaseElement(), (this.shapesData = null), (this.itemsData = null); }); function LetterProps(e, t, r, i, s, n) { (this.o = e), (this.sw = t), (this.sc = r), (this.fc = i), (this.m = s), (this.p = n), (this._mdf = { o: !0, sw: !!t, sc: !!r, fc: !!i, m: !0, p: !0 }); } LetterProps.prototype.update = function (e, t, r, i, s, n) { (this._mdf.o = !1), (this._mdf.sw = !1), (this._mdf.sc = !1), (this._mdf.fc = !1), (this._mdf.m = !1), (this._mdf.p = !1); var a = !1; return ( this.o !== e && ((this.o = e), (this._mdf.o = !0), (a = !0)), this.sw !== t && ((this.sw = t), (this._mdf.sw = !0), (a = !0)), this.sc !== r && ((this.sc = r), (this._mdf.sc = !0), (a = !0)), this.fc !== i && ((this.fc = i), (this._mdf.fc = !0), (a = !0)), this.m !== s && ((this.m = s), (this._mdf.m = !0), (a = !0)), n.length && (this.p[0] !== n[0] || this.p[1] !== n[1] || this.p[4] !== n[4] || this.p[5] !== n[5] || this.p[12] !== n[12] || this.p[13] !== n[13]) && ((this.p = n), (this._mdf.p = !0), (a = !0)), a ); }; function TextProperty(e, t) { (this._frameId = initialDefaultFrame), (this.pv = ''), (this.v = ''), (this.kf = !1), (this._isFirstFrame = !0), (this._mdf = !1), t.d && t.d.sid && (t.d = e.globalData.slotManager.getProp(t.d)), (this.data = t), (this.elem = e), (this.comp = this.elem.comp), (this.keysIndex = 0), (this.canResize = !1), (this.minimumFontSize = 1), (this.effectsSequence = []), (this.currentData = { ascent: 0, boxWidth: this.defaultBoxWidth, f: '', fStyle: '', fWeight: '', fc: '', j: '', justifyOffset: '', l: [], lh: 0, lineWidths: [], ls: '', of: '', s: '', sc: '', sw: 0, t: 0, tr: 0, sz: 0, ps: null, fillColorAnim: !1, strokeColorAnim: !1, strokeWidthAnim: !1, yOffset: 0, finalSize: 0, finalText: [], finalLineHeight: 0, __complete: !1 }), this.copyData(this.currentData, this.data.d.k[0].s), this.searchProperty() || this.completeTextData(this.currentData); } (TextProperty.prototype.defaultBoxWidth = [0, 0]), (TextProperty.prototype.copyData = function (e, t) { for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); return e; }), (TextProperty.prototype.setCurrentData = function (e) { e.__complete || this.completeTextData(e), (this.currentData = e), (this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth), (this._mdf = !0); }), (TextProperty.prototype.searchProperty = function () { return this.searchKeyframes(); }), (TextProperty.prototype.searchKeyframes = function () { return ( (this.kf = this.data.d.k.length > 1), this.kf && this.addEffect(this.getKeyframeValue.bind(this)), this.kf ); }), (TextProperty.prototype.addEffect = function (e) { this.effectsSequence.push(e), this.elem.addDynamicProperty(this); }), (TextProperty.prototype.getValue = function (e) { if ( !( (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !e ) ) { this.currentData.t = this.data.d.k[this.keysIndex].s.t; var t = this.currentData, r = this.keysIndex; if (this.lock) { this.setCurrentData(this.currentData); return; } (this.lock = !0), (this._mdf = !1); var i, s = this.effectsSequence.length, n = e || this.data.d.k[this.keysIndex].s; for (i = 0; i < s; i += 1) r !== this.keysIndex ? (n = this.effectsSequence[i](n, n.t)) : (n = this.effectsSequence[i](this.currentData, n.t)); t !== n && this.setCurrentData(n), (this.v = this.currentData), (this.pv = this.v), (this.lock = !1), (this.frameId = this.elem.globalData.frameId); } }), (TextProperty.prototype.getKeyframeValue = function () { for ( var e = this.data.d.k, t = this.elem.comp.renderedFrame, r = 0, i = e.length; r <= i - 1 && !(r === i - 1 || e[r + 1].t > t); ) r += 1; return ( this.keysIndex !== r && (this.keysIndex = r), this.data.d.k[this.keysIndex].s ); }), (TextProperty.prototype.buildFinalText = function (e) { for (var t = [], r = 0, i = e.length, s, n, a = !1; r < i; ) (s = e.charCodeAt(r)), FontManager.isCombinedCharacter(s) ? (t[t.length - 1] += e.charAt(r)) : s >= 55296 && s <= 56319 ? ((n = e.charCodeAt(r + 1)), n >= 56320 && n <= 57343 ? (a || FontManager.isModifier(s, n) ? ((t[t.length - 1] += e.substr(r, 2)), (a = !1)) : t.push(e.substr(r, 2)), (r += 1)) : t.push(e.charAt(r))) : s > 56319 ? ((n = e.charCodeAt(r + 1)), FontManager.isZeroWidthJoiner(s, n) ? ((a = !0), (t[t.length - 1] += e.substr(r, 2)), (r += 1)) : t.push(e.charAt(r))) : FontManager.isZeroWidthJoiner(s) ? ((t[t.length - 1] += e.charAt(r)), (a = !0)) : t.push(e.charAt(r)), (r += 1); return t; }), (TextProperty.prototype.completeTextData = function (e) { e.__complete = !0; var t = this.elem.globalData.fontManager, r = this.data, i = [], s, n, a, o = 0, l, c = r.m.g, g = 0, S = 0, p = 0, P = [], b = 0, y = 0, A, u, f = t.getFontByName(e.f), m, d = 0, E = getFontProperties(f); (e.fWeight = E.weight), (e.fStyle = E.style), (e.finalSize = e.s), (e.finalText = this.buildFinalText(e.t)), (n = e.finalText.length), (e.finalLineHeight = e.lh); var T = (e.tr / 1e3) * e.finalSize, x; if (e.sz) for (var _ = !0, I = e.sz[0], V = e.sz[1], D, N; _; ) { (N = this.buildFinalText(e.t)), (D = 0), (b = 0), (n = N.length), (T = (e.tr / 1e3) * e.finalSize); var $ = -1; for (s = 0; s < n; s += 1) (x = N[s].charCodeAt(0)), (a = !1), N[s] === ' ' ? ($ = s) : (x === 13 || x === 3) && ((b = 0), (a = !0), (D += e.finalLineHeight || e.finalSize * 1.2)), t.chars ? ((m = t.getCharData(N[s], f.fStyle, f.fFamily)), (d = a ? 0 : (m.w * e.finalSize) / 100)) : (d = t.measureText(N[s], e.f, e.finalSize)), b + d > I && N[s] !== ' ' ? ($ === -1 ? (n += 1) : (s = $), (D += e.finalLineHeight || e.finalSize * 1.2), N.splice(s, $ === s ? 1 : 0, '\r'), ($ = -1), (b = 0)) : ((b += d), (b += T)); (D += (f.ascent * e.finalSize) / 100), this.canResize && e.finalSize > this.minimumFontSize && V < D ? ((e.finalSize -= 1), (e.finalLineHeight = (e.finalSize * e.lh) / e.s)) : ((e.finalText = N), (n = e.finalText.length), (_ = !1)); } (b = -T), (d = 0); var O = 0, B; for (s = 0; s < n; s += 1) if ( ((a = !1), (B = e.finalText[s]), (x = B.charCodeAt(0)), x === 13 || x === 3 ? ((O = 0), P.push(b), (y = b > y ? b : y), (b = -2 * T), (l = ''), (a = !0), (p += 1)) : (l = B), t.chars ? ((m = t.getCharData( B, f.fStyle, t.getFontByName(e.f).fFamily )), (d = a ? 0 : (m.w * e.finalSize) / 100)) : (d = t.measureText(l, e.f, e.finalSize)), B === ' ' ? (O += d + T) : ((b += d + T + O), (O = 0)), i.push({ l: d, an: d, add: g, n: a, anIndexes: [], val: l, line: p, animatorJustifyOffset: 0 }), c == 2) ) { if (((g += d), l === '' || l === ' ' || s === n - 1)) { for ((l === '' || l === ' ') && (g -= d); S <= s; ) (i[S].an = g), (i[S].ind = o), (i[S].extra = d), (S += 1); (o += 1), (g = 0); } } else if (c == 3) { if (((g += d), l === '' || s === n - 1)) { for (l === '' && (g -= d); S <= s; ) (i[S].an = g), (i[S].ind = o), (i[S].extra = d), (S += 1); (g = 0), (o += 1); } } else (i[o].ind = o), (i[o].extra = 0), (o += 1); if (((e.l = i), (y = b > y ? b : y), P.push(b), e.sz)) (e.boxWidth = e.sz[0]), (e.justifyOffset = 0); else switch (((e.boxWidth = y), e.j)) { case 1: e.justifyOffset = -e.boxWidth; break; case 2: e.justifyOffset = -e.boxWidth / 2; break; default: e.justifyOffset = 0; } e.lineWidths = P; var F = r.a, k, C; u = F.length; var M, R, L = []; for (A = 0; A < u; A += 1) { for ( k = F[A], k.a.sc && (e.strokeColorAnim = !0), k.a.sw && (e.strokeWidthAnim = !0), (k.a.fc || k.a.fh || k.a.fs || k.a.fb) && (e.fillColorAnim = !0), R = 0, M = k.s.b, s = 0; s < n; s += 1 ) (C = i[s]), (C.anIndexes[A] = R), ((M == 1 && C.val !== '') || (M == 2 && C.val !== '' && C.val !== ' ') || (M == 3 && (C.n || C.val == ' ' || s == n - 1)) || (M == 4 && (C.n || s == n - 1))) && (k.s.rn === 1 && L.push(R), (R += 1)); r.a[A].s.totalChars = R; var j = -1, z; if (k.s.rn === 1) for (s = 0; s < n; s += 1) (C = i[s]), j != C.anIndexes[A] && ((j = C.anIndexes[A]), (z = L.splice(Math.floor(Math.random() * L.length), 1)[0])), (C.anIndexes[A] = z); } (e.yOffset = e.finalLineHeight || e.finalSize * 1.2), (e.ls = e.ls || 0), (e.ascent = (f.ascent * e.finalSize) / 100); }), (TextProperty.prototype.updateDocumentData = function (e, t) { t = t === void 0 ? this.keysIndex : t; var r = this.copyData({}, this.data.d.k[t].s); (r = this.copyData(r, e)), (this.data.d.k[t].s = r), this.recalculate(t), this.setCurrentData(r), this.elem.addDynamicProperty(this); }), (TextProperty.prototype.recalculate = function (e) { var t = this.data.d.k[e].s; (t.__complete = !1), (this.keysIndex = 0), (this._isFirstFrame = !0), this.getValue(t); }), (TextProperty.prototype.canResizeFont = function (e) { (this.canResize = e), this.recalculate(this.keysIndex), this.elem.addDynamicProperty(this); }), (TextProperty.prototype.setMinimumFontSize = function (e) { (this.minimumFontSize = Math.floor(e) || 1), this.recalculate(this.keysIndex), this.elem.addDynamicProperty(this); }); var TextSelectorProp = (function () { var e = Math.max, t = Math.min, r = Math.floor; function i(n, a) { (this._currentTextLength = -1), (this.k = !1), (this.data = a), (this.elem = n), (this.comp = n.comp), (this.finalS = 0), (this.finalE = 0), this.initDynamicPropertyContainer(n), (this.s = PropertyFactory.getProp(n, a.s || { k: 0 }, 0, 0, this)), 'e' in a ? (this.e = PropertyFactory.getProp(n, a.e, 0, 0, this)) : (this.e = { v: 100 }), (this.o = PropertyFactory.getProp(n, a.o || { k: 0 }, 0, 0, this)), (this.xe = PropertyFactory.getProp( n, a.xe || { k: 0 }, 0, 0, this )), (this.ne = PropertyFactory.getProp( n, a.ne || { k: 0 }, 0, 0, this )), (this.sm = PropertyFactory.getProp( n, a.sm || { k: 100 }, 0, 0, this )), (this.a = PropertyFactory.getProp(n, a.a, 0, 0.01, this)), this.dynamicProperties.length || this.getValue(); } (i.prototype = { getMult: function (a) { this._currentTextLength !== this.elem.textProperty.currentData.l.length && this.getValue(); var o = 0, l = 0, c = 1, g = 1; this.ne.v > 0 ? (o = this.ne.v / 100) : (l = -this.ne.v / 100), this.xe.v > 0 ? (c = 1 - this.xe.v / 100) : (g = 1 + this.xe.v / 100); var S = BezierFactory.getBezierEasing(o, l, c, g).get, p = 0, P = this.finalS, b = this.finalE, y = this.data.sh; if (y === 2) b === P ? (p = a >= b ? 1 : 0) : (p = e(0, t(0.5 / (b - P) + (a - P) / (b - P), 1))), (p = S(p)); else if (y === 3) b === P ? (p = a >= b ? 0 : 1) : (p = 1 - e(0, t(0.5 / (b - P) + (a - P) / (b - P), 1))), (p = S(p)); else if (y === 4) b === P ? (p = 0) : ((p = e(0, t(0.5 / (b - P) + (a - P) / (b - P), 1))), p < 0.5 ? (p *= 2) : (p = 1 - 2 * (p - 0.5))), (p = S(p)); else if (y === 5) { if (b === P) p = 0; else { var A = b - P; a = t(e(0, a + 0.5 - P), b - P); var u = -A / 2 + a, f = A / 2; p = Math.sqrt(1 - (u * u) / (f * f)); } p = S(p); } else y === 6 ? (b === P ? (p = 0) : ((a = t(e(0, a + 0.5 - P), b - P)), (p = (1 + Math.cos(Math.PI + (Math.PI * 2 * a) / (b - P))) / 2)), (p = S(p))) : (a >= r(P) && (a - P < 0 ? (p = e(0, t(t(b, 1) - (P - a), 1))) : (p = e(0, t(b - a, 1)))), (p = S(p))); if (this.sm.v !== 100) { var m = this.sm.v * 0.01; m === 0 && (m = 1e-8); var d = 0.5 - m * 0.5; p < d ? (p = 0) : ((p = (p - d) / m), p > 1 && (p = 1)); } return p * this.a.v; }, getValue: function (a) { this.iterateDynamicProperties(), (this._mdf = a || this._mdf), (this._currentTextLength = this.elem.textProperty.currentData.l.length || 0), a && this.data.r === 2 && (this.e.v = this._currentTextLength); var o = this.data.r === 2 ? 1 : 100 / this.data.totalChars, l = this.o.v / o, c = this.s.v / o + l, g = this.e.v / o + l; if (c > g) { var S = c; (c = g), (g = S); } (this.finalS = c), (this.finalE = g); } }), extendPrototype([DynamicPropertyContainer], i); function s(n, a, o) { return new i(n, a); } return { getTextSelectorProp: s }; })(); function TextAnimatorDataProperty(e, t, r) { var i = { propType: !1 }, s = PropertyFactory.getProp, n = t.a; (this.a = { r: n.r ? s(e, n.r, 0, degToRads, r) : i, rx: n.rx ? s(e, n.rx, 0, degToRads, r) : i, ry: n.ry ? s(e, n.ry, 0, degToRads, r) : i, sk: n.sk ? s(e, n.sk, 0, degToRads, r) : i, sa: n.sa ? s(e, n.sa, 0, degToRads, r) : i, s: n.s ? s(e, n.s, 1, 0.01, r) : i, a: n.a ? s(e, n.a, 1, 0, r) : i, o: n.o ? s(e, n.o, 0, 0.01, r) : i, p: n.p ? s(e, n.p, 1, 0, r) : i, sw: n.sw ? s(e, n.sw, 0, 0, r) : i, sc: n.sc ? s(e, n.sc, 1, 0, r) : i, fc: n.fc ? s(e, n.fc, 1, 0, r) : i, fh: n.fh ? s(e, n.fh, 0, 0, r) : i, fs: n.fs ? s(e, n.fs, 0, 0.01, r) : i, fb: n.fb ? s(e, n.fb, 0, 0.01, r) : i, t: n.t ? s(e, n.t, 0, 0, r) : i }), (this.s = TextSelectorProp.getTextSelectorProp(e, t.s, r)), (this.s.t = t.s.t); } function TextAnimatorProperty(e, t, r) { (this._isFirstFrame = !0), (this._hasMaskedPath = !1), (this._frameId = -1), (this._textData = e), (this._renderType = t), (this._elem = r), (this._animatorsData = createSizedArray(this._textData.a.length)), (this._pathData = {}), (this._moreOptions = { alignment: {} }), (this.renderedLetters = []), (this.lettersChangedFlag = !1), this.initDynamicPropertyContainer(r); } (TextAnimatorProperty.prototype.searchProperties = function () { var e, t = this._textData.a.length, r, i = PropertyFactory.getProp; for (e = 0; e < t; e += 1) (r = this._textData.a[e]), (this._animatorsData[e] = new TextAnimatorDataProperty( this._elem, r, this )); this._textData.p && 'm' in this._textData.p ? ((this._pathData = { a: i(this._elem, this._textData.p.a, 0, 0, this), f: i(this._elem, this._textData.p.f, 0, 0, this), l: i(this._elem, this._textData.p.l, 0, 0, this), r: i(this._elem, this._textData.p.r, 0, 0, this), p: i(this._elem, this._textData.p.p, 0, 0, this), m: this._elem.maskManager.getMaskProperty(this._textData.p.m) }), (this._hasMaskedPath = !0)) : (this._hasMaskedPath = !1), (this._moreOptions.alignment = i( this._elem, this._textData.m.a, 1, 0, this )); }), (TextAnimatorProperty.prototype.getMeasures = function (e, t) { if ( ((this.lettersChangedFlag = t), !( !this._mdf && !this._isFirstFrame && !t && (!this._hasMaskedPath || !this._pathData.m._mdf) )) ) { this._isFirstFrame = !1; var r = this._moreOptions.alignment.v, i = this._animatorsData, s = this._textData, n = this.mHelper, a = this._renderType, o = this.renderedLetters.length, l, c, g, S, p = e.l, P, b, y, A, u, f, m, d, E, T, x, _, I, V, D; if (this._hasMaskedPath) { if ( ((D = this._pathData.m), !this._pathData.n || this._pathData._mdf) ) { var N = D.v; this._pathData.r.v && (N = N.reverse()), (P = { tLength: 0, segments: [] }), (S = N._length - 1); var $; for (_ = 0, g = 0; g < S; g += 1) ($ = bez.buildBezierData( N.v[g], N.v[g + 1], [N.o[g][0] - N.v[g][0], N.o[g][1] - N.v[g][1]], [ N.i[g + 1][0] - N.v[g + 1][0], N.i[g + 1][1] - N.v[g + 1][1] ] )), (P.tLength += $.segmentLength), P.segments.push($), (_ += $.segmentLength); (g = S), D.v.c && (($ = bez.buildBezierData( N.v[g], N.v[0], [N.o[g][0] - N.v[g][0], N.o[g][1] - N.v[g][1]], [N.i[0][0] - N.v[0][0], N.i[0][1] - N.v[0][1]] )), (P.tLength += $.segmentLength), P.segments.push($), (_ += $.segmentLength)), (this._pathData.pi = P); } if ( ((P = this._pathData.pi), (b = this._pathData.f.v), (m = 0), (f = 1), (A = 0), (u = !0), (T = P.segments), b < 0 && D.v.c) ) for ( P.tLength < Math.abs(b) && (b = -Math.abs(b) % P.tLength), m = T.length - 1, E = T[m].points, f = E.length - 1; b < 0; ) (b += E[f].partialLength), (f -= 1), f < 0 && ((m -= 1), (E = T[m].points), (f = E.length - 1)); (E = T[m].points), (d = E[f - 1]), (y = E[f]), (x = y.partialLength); } (S = p.length), (l = 0), (c = 0); var O = e.finalSize * 1.2 * 0.714, B = !0, F, k, C, M, R; M = i.length; var L, j = -1, z, H, U, q = b, ee = m, ie = f, te = -1, Y, X, J, G, W, se, le, ne, re = '', ae = this.defaultPropsArray, oe; if (e.j === 2 || e.j === 1) { var K = 0, he = 0, ce = e.j === 2 ? -0.5 : -1, Z = 0, pe = !0; for (g = 0; g < S; g += 1) if (p[g].n) { for (K && (K += he); Z < g; ) (p[Z].animatorJustifyOffset = K), (Z += 1); (K = 0), (pe = !0); } else { for (C = 0; C < M; C += 1) (F = i[C].a), F.t.propType && (pe && e.j === 2 && (he += F.t.v * ce), (k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), L.length ? (K += F.t.v * L[0] * ce) : (K += F.t.v * L * ce)); pe = !1; } for (K && (K += he); Z < g; ) (p[Z].animatorJustifyOffset = K), (Z += 1); } for (g = 0; g < S; g += 1) { if ((n.reset(), (Y = 1), p[g].n)) (l = 0), (c += e.yOffset), (c += B ? 1 : 0), (b = q), (B = !1), this._hasMaskedPath && ((m = ee), (f = ie), (E = T[m].points), (d = E[f - 1]), (y = E[f]), (x = y.partialLength), (A = 0)), (re = ''), (ne = ''), (se = ''), (oe = ''), (ae = this.defaultPropsArray); else { if (this._hasMaskedPath) { if (te !== p[g].line) { switch (e.j) { case 1: b += _ - e.lineWidths[p[g].line]; break; case 2: b += (_ - e.lineWidths[p[g].line]) / 2; break; } te = p[g].line; } j !== p[g].ind && (p[j] && (b += p[j].extra), (b += p[g].an / 2), (j = p[g].ind)), (b += r[0] * p[g].an * 0.005); var Q = 0; for (C = 0; C < M; C += 1) (F = i[C].a), F.p.propType && ((k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), L.length ? (Q += F.p.v[0] * L[0]) : (Q += F.p.v[0] * L)), F.a.propType && ((k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), L.length ? (Q += F.a.v[0] * L[0]) : (Q += F.a.v[0] * L)); for ( u = !0, this._pathData.a.v && ((b = p[0].an * 0.5 + ((_ - this._pathData.f.v - p[0].an * 0.5 - p[p.length - 1].an * 0.5) * j) / (S - 1)), (b += this._pathData.f.v)); u; ) A + x >= b + Q || !E ? ((I = (b + Q - A) / y.partialLength), (H = d.point[0] + (y.point[0] - d.point[0]) * I), (U = d.point[1] + (y.point[1] - d.point[1]) * I), n.translate( -r[0] * p[g].an * 0.005, -(r[1] * O) * 0.01 ), (u = !1)) : E && ((A += y.partialLength), (f += 1), f >= E.length && ((f = 0), (m += 1), T[m] ? (E = T[m].points) : D.v.c ? ((f = 0), (m = 0), (E = T[m].points)) : ((A -= y.partialLength), (E = null))), E && ((d = y), (y = E[f]), (x = y.partialLength))); (z = p[g].an / 2 - p[g].add), n.translate(-z, 0, 0); } else (z = p[g].an / 2 - p[g].add), n.translate(-z, 0, 0), n.translate(-r[0] * p[g].an * 0.005, -r[1] * O * 0.01, 0); for (C = 0; C < M; C += 1) (F = i[C].a), F.t.propType && ((k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), (l !== 0 || e.j !== 0) && (this._hasMaskedPath ? L.length ? (b += F.t.v * L[0]) : (b += F.t.v * L) : L.length ? (l += F.t.v * L[0]) : (l += F.t.v * L))); for ( e.strokeWidthAnim && (J = e.sw || 0), e.strokeColorAnim && (e.sc ? (X = [e.sc[0], e.sc[1], e.sc[2]]) : (X = [0, 0, 0])), e.fillColorAnim && e.fc && (G = [e.fc[0], e.fc[1], e.fc[2]]), C = 0; C < M; C += 1 ) (F = i[C].a), F.a.propType && ((k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), L.length ? n.translate( -F.a.v[0] * L[0], -F.a.v[1] * L[1], F.a.v[2] * L[2] ) : n.translate( -F.a.v[0] * L, -F.a.v[1] * L, F.a.v[2] * L )); for (C = 0; C < M; C += 1) (F = i[C].a), F.s.propType && ((k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), L.length ? n.scale( 1 + (F.s.v[0] - 1) * L[0], 1 + (F.s.v[1] - 1) * L[1], 1 ) : n.scale( 1 + (F.s.v[0] - 1) * L, 1 + (F.s.v[1] - 1) * L, 1 )); for (C = 0; C < M; C += 1) { if ( ((F = i[C].a), (k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), F.sk.propType && (L.length ? n.skewFromAxis(-F.sk.v * L[0], F.sa.v * L[1]) : n.skewFromAxis(-F.sk.v * L, F.sa.v * L)), F.r.propType && (L.length ? n.rotateZ(-F.r.v * L[2]) : n.rotateZ(-F.r.v * L)), F.ry.propType && (L.length ? n.rotateY(F.ry.v * L[1]) : n.rotateY(F.ry.v * L)), F.rx.propType && (L.length ? n.rotateX(F.rx.v * L[0]) : n.rotateX(F.rx.v * L)), F.o.propType && (L.length ? (Y += (F.o.v * L[0] - Y) * L[0]) : (Y += (F.o.v * L - Y) * L)), e.strokeWidthAnim && F.sw.propType && (L.length ? (J += F.sw.v * L[0]) : (J += F.sw.v * L)), e.strokeColorAnim && F.sc.propType) ) for (W = 0; W < 3; W += 1) L.length ? (X[W] += (F.sc.v[W] - X[W]) * L[0]) : (X[W] += (F.sc.v[W] - X[W]) * L); if (e.fillColorAnim && e.fc) { if (F.fc.propType) for (W = 0; W < 3; W += 1) L.length ? (G[W] += (F.fc.v[W] - G[W]) * L[0]) : (G[W] += (F.fc.v[W] - G[W]) * L); F.fh.propType && (L.length ? (G = addHueToRGB(G, F.fh.v * L[0])) : (G = addHueToRGB(G, F.fh.v * L))), F.fs.propType && (L.length ? (G = addSaturationToRGB(G, F.fs.v * L[0])) : (G = addSaturationToRGB(G, F.fs.v * L))), F.fb.propType && (L.length ? (G = addBrightnessToRGB(G, F.fb.v * L[0])) : (G = addBrightnessToRGB(G, F.fb.v * L))); } } for (C = 0; C < M; C += 1) (F = i[C].a), F.p.propType && ((k = i[C].s), (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)), this._hasMaskedPath ? L.length ? n.translate(0, F.p.v[1] * L[0], -F.p.v[2] * L[1]) : n.translate(0, F.p.v[1] * L, -F.p.v[2] * L) : L.length ? n.translate( F.p.v[0] * L[0], F.p.v[1] * L[1], -F.p.v[2] * L[2] ) : n.translate( F.p.v[0] * L, F.p.v[1] * L, -F.p.v[2] * L )); if ( (e.strokeWidthAnim && (se = J < 0 ? 0 : J), e.strokeColorAnim && (le = 'rgb(' + Math.round(X[0] * 255) + ',' + Math.round(X[1] * 255) + ',' + Math.round(X[2] * 255) + ')'), e.fillColorAnim && e.fc && (ne = 'rgb(' + Math.round(G[0] * 255) + ',' + Math.round(G[1] * 255) + ',' + Math.round(G[2] * 255) + ')'), this._hasMaskedPath) ) { if ( (n.translate(0, -e.ls), n.translate(0, r[1] * O * 0.01 + c, 0), this._pathData.p.v) ) { V = (y.point[1] - d.point[1]) / (y.point[0] - d.point[0]); var ue = (Math.atan(V) * 180) / Math.PI; y.point[0] < d.point[0] && (ue += 180), n.rotate((-ue * Math.PI) / 180); } n.translate(H, U, 0), (b -= r[0] * p[g].an * 0.005), p[g + 1] && j !== p[g + 1].ind && ((b += p[g].an / 2), (b += e.tr * 0.001 * e.finalSize)); } else { switch ( (n.translate(l, c, 0), e.ps && n.translate(e.ps[0], e.ps[1] + e.ascent, 0), e.j) ) { case 1: n.translate( p[g].animatorJustifyOffset + e.justifyOffset + (e.boxWidth - e.lineWidths[p[g].line]), 0, 0 ); break; case 2: n.translate( p[g].animatorJustifyOffset + e.justifyOffset + (e.boxWidth - e.lineWidths[p[g].line]) / 2, 0, 0 ); break; } n.translate(0, -e.ls), n.translate(z, 0, 0), n.translate(r[0] * p[g].an * 0.005, r[1] * O * 0.01, 0), (l += p[g].l + e.tr * 0.001 * e.finalSize); } a === 'html' ? (re = n.toCSS()) : a === 'svg' ? (re = n.to2dCSS()) : (ae = [ n.props[0], n.props[1], n.props[2], n.props[3], n.props[4], n.props[5], n.props[6], n.props[7], n.props[8], n.props[9], n.props[10], n.props[11], n.props[12], n.props[13], n.props[14], n.props[15] ]), (oe = Y); } o <= g ? ((R = new LetterProps(oe, se, le, ne, re, ae)), this.renderedLetters.push(R), (o += 1), (this.lettersChangedFlag = !0)) : ((R = this.renderedLetters[g]), (this.lettersChangedFlag = R.update(oe, se, le, ne, re, ae) || this.lettersChangedFlag)); } } }), (TextAnimatorProperty.prototype.getValue = function () { this._elem.globalData.frameId !== this._frameId && ((this._frameId = this._elem.globalData.frameId), this.iterateDynamicProperties()); }), (TextAnimatorProperty.prototype.mHelper = new Matrix()), (TextAnimatorProperty.prototype.defaultPropsArray = []), extendPrototype([DynamicPropertyContainer], TextAnimatorProperty); function ITextElement() {} (ITextElement.prototype.initElement = function (e, t, r) { (this.lettersChangedFlag = !0), this.initFrame(), this.initBaseData(e, t, r), (this.textProperty = new TextProperty( this, e.t, this.dynamicProperties )), (this.textAnimator = new TextAnimatorProperty( e.t, this.renderType, this )), this.initTransform(e, t, r), this.initHierarchy(), this.initRenderable(), this.initRendererElement(), this.createContainerElements(), this.createRenderableComponents(), this.createContent(), this.hide(), this.textAnimator.searchProperties(this.dynamicProperties); }), (ITextElement.prototype.prepareFrame = function (e) { (this._mdf = !1), this.prepareRenderableFrame(e), this.prepareProperties(e, this.isInRange), (this.textProperty._mdf || this.textProperty._isFirstFrame) && (this.buildNewText(), (this.textProperty._isFirstFrame = !1), (this.textProperty._mdf = !1)); }), (ITextElement.prototype.createPathShape = function (e, t) { var r, i = t.length, s, n = ''; for (r = 0; r < i; r += 1) t[r].ty === 'sh' && ((s = t[r].ks.k), (n += buildShapeString(s, s.i.length, !0, e))); return n; }), (ITextElement.prototype.updateDocumentData = function (e, t) { this.textProperty.updateDocumentData(e, t); }), (ITextElement.prototype.canResizeFont = function (e) { this.textProperty.canResizeFont(e); }), (ITextElement.prototype.setMinimumFontSize = function (e) { this.textProperty.setMinimumFontSize(e); }), (ITextElement.prototype.applyTextPropertiesToMatrix = function ( e, t, r, i, s ) { switch ( (e.ps && t.translate(e.ps[0], e.ps[1] + e.ascent, 0), t.translate(0, -e.ls, 0), e.j) ) { case 1: t.translate( e.justifyOffset + (e.boxWidth - e.lineWidths[r]), 0, 0 ); break; case 2: t.translate( e.justifyOffset + (e.boxWidth - e.lineWidths[r]) / 2, 0, 0 ); break; } t.translate(i, s, 0); }), (ITextElement.prototype.buildColor = function (e) { return ( 'rgb(' + Math.round(e[0] * 255) + ',' + Math.round(e[1] * 255) + ',' + Math.round(e[2] * 255) + ')' ); }), (ITextElement.prototype.emptyProp = new LetterProps()), (ITextElement.prototype.destroy = function () {}); var emptyShapeData = { shapes: [] }; function SVGTextLottieElement(e, t, r) { (this.textSpans = []), (this.renderType = 'svg'), this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement ], SVGTextLottieElement ), (SVGTextLottieElement.prototype.createContent = function () { this.data.singleShape && !this.globalData.fontManager.chars && (this.textContainer = createNS('text')); }), (SVGTextLottieElement.prototype.buildTextContents = function (e) { for (var t = 0, r = e.length, i = [], s = ''; t < r; ) e[t] === String.fromCharCode(13) || e[t] === String.fromCharCode(3) ? (i.push(s), (s = '')) : (s += e[t]), (t += 1); return i.push(s), i; }), (SVGTextLottieElement.prototype.buildShapeData = function (e, t) { if (e.shapes && e.shapes.length) { var r = e.shapes[0]; if (r.it) { var i = r.it[r.it.length - 1]; i.s && ((i.s.k[0] = t), (i.s.k[1] = t)); } } return e; }), (SVGTextLottieElement.prototype.buildNewText = function () { this.addDynamicProperty(this); var e, t, r = this.textProperty.currentData; (this.renderedLetters = createSizedArray(r ? r.l.length : 0)), r.fc ? this.layerElement.setAttribute('fill', this.buildColor(r.fc)) : this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)'), r.sc && (this.layerElement.setAttribute('stroke', this.buildColor(r.sc)), this.layerElement.setAttribute('stroke-width', r.sw)), this.layerElement.setAttribute('font-size', r.finalSize); var i = this.globalData.fontManager.getFontByName(r.f); if (i.fClass) this.layerElement.setAttribute('class', i.fClass); else { this.layerElement.setAttribute('font-family', i.fFamily); var s = r.fWeight, n = r.fStyle; this.layerElement.setAttribute('font-style', n), this.layerElement.setAttribute('font-weight', s); } this.layerElement.setAttribute('aria-label', r.t); var a = r.l || [], o = !!this.globalData.fontManager.chars; t = a.length; var l, c = this.mHelper, g = '', S = this.data.singleShape, p = 0, P = 0, b = !0, y = r.tr * 0.001 * r.finalSize; if (S && !o && !r.sz) { var A = this.textContainer, u = 'start'; switch (r.j) { case 1: u = 'end'; break; case 2: u = 'middle'; break; default: u = 'start'; break; } A.setAttribute('text-anchor', u), A.setAttribute('letter-spacing', y); var f = this.buildTextContents(r.finalText); for ( t = f.length, P = r.ps ? r.ps[1] + r.ascent : 0, e = 0; e < t; e += 1 ) (l = this.textSpans[e].span || createNS('tspan')), (l.textContent = f[e]), l.setAttribute('x', 0), l.setAttribute('y', P), (l.style.display = 'inherit'), A.appendChild(l), this.textSpans[e] || (this.textSpans[e] = { span: null, glyph: null }), (this.textSpans[e].span = l), (P += r.finalLineHeight); this.layerElement.appendChild(A); } else { var m = this.textSpans.length, d; for (e = 0; e < t; e += 1) { if ( (this.textSpans[e] || (this.textSpans[e] = { span: null, childSpan: null, glyph: null }), !o || !S || e === 0) ) { if ( ((l = m > e ? this.textSpans[e].span : createNS(o ? 'g' : 'text')), m <= e) ) { if ( (l.setAttribute('stroke-linecap', 'butt'), l.setAttribute('stroke-linejoin', 'round'), l.setAttribute('stroke-miterlimit', '4'), (this.textSpans[e].span = l), o) ) { var E = createNS('g'); l.appendChild(E), (this.textSpans[e].childSpan = E); } (this.textSpans[e].span = l), this.layerElement.appendChild(l); } l.style.display = 'inherit'; } if ( (c.reset(), S && (a[e].n && ((p = -y), (P += r.yOffset), (P += b ? 1 : 0), (b = !1)), this.applyTextPropertiesToMatrix(r, c, a[e].line, p, P), (p += a[e].l || 0), (p += y)), o) ) { d = this.globalData.fontManager.getCharData( r.finalText[e], i.fStyle, this.globalData.fontManager.getFontByName(r.f).fFamily ); var T; if (d.t === 1) T = new SVGCompElement(d.data, this.globalData, this); else { var x = emptyShapeData; d.data && d.data.shapes && (x = this.buildShapeData(d.data, r.finalSize)), (T = new SVGShapeElement(x, this.globalData, this)); } if (this.textSpans[e].glyph) { var _ = this.textSpans[e].glyph; this.textSpans[e].childSpan.removeChild(_.layerElement), _.destroy(); } (this.textSpans[e].glyph = T), (T._debug = !0), T.prepareFrame(0), T.renderFrame(), this.textSpans[e].childSpan.appendChild(T.layerElement), d.t === 1 && this.textSpans[e].childSpan.setAttribute( 'transform', 'scale(' + r.finalSize / 100 + ',' + r.finalSize / 100 + ')' ); } else S && l.setAttribute( 'transform', 'translate(' + c.props[12] + ',' + c.props[13] + ')' ), (l.textContent = a[e].val), l.setAttributeNS( 'http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve' ); } S && l && l.setAttribute('d', g); } for (; e < this.textSpans.length; ) (this.textSpans[e].span.style.display = 'none'), (e += 1); this._sizeChanged = !0; }), (SVGTextLottieElement.prototype.sourceRectAtTime = function () { if ( (this.prepareFrame(this.comp.renderedFrame - this.data.st), this.renderInnerContent(), this._sizeChanged) ) { this._sizeChanged = !1; var e = this.layerElement.getBBox(); this.bbox = { top: e.y, left: e.x, width: e.width, height: e.height }; } return this.bbox; }), (SVGTextLottieElement.prototype.getValue = function () { var e, t = this.textSpans.length, r; for ( this.renderedFrame = this.comp.renderedFrame, e = 0; e < t; e += 1 ) (r = this.textSpans[e].glyph), r && (r.prepareFrame(this.comp.renderedFrame - this.data.st), r._mdf && (this._mdf = !0)); }), (SVGTextLottieElement.prototype.renderInnerContent = function () { if ( (!this.data.singleShape || this._mdf) && (this.textAnimator.getMeasures( this.textProperty.currentData, this.lettersChangedFlag ), this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) ) { this._sizeChanged = !0; var e, t, r = this.textAnimator.renderedLetters, i = this.textProperty.currentData.l; t = i.length; var s, n, a; for (e = 0; e < t; e += 1) i[e].n || ((s = r[e]), (n = this.textSpans[e].span), (a = this.textSpans[e].glyph), a && a.renderFrame(), s._mdf.m && n.setAttribute('transform', s.m), s._mdf.o && n.setAttribute('opacity', s.o), s._mdf.sw && n.setAttribute('stroke-width', s.sw), s._mdf.sc && n.setAttribute('stroke', s.sc), s._mdf.fc && n.setAttribute('fill', s.fc)); } }); function ISolidElement(e, t, r) { this.initElement(e, t, r); } extendPrototype([IImageElement], ISolidElement), (ISolidElement.prototype.createContent = function () { var e = createNS('rect'); e.setAttribute('width', this.data.sw), e.setAttribute('height', this.data.sh), e.setAttribute('fill', this.data.sc), this.layerElement.appendChild(e); }); function NullElement(e, t, r) { this.initFrame(), this.initBaseData(e, t, r), this.initFrame(), this.initTransform(e, t, r), this.initHierarchy(); } (NullElement.prototype.prepareFrame = function (e) { this.prepareProperties(e, !0); }), (NullElement.prototype.renderFrame = function () {}), (NullElement.prototype.getBaseElement = function () { return null; }), (NullElement.prototype.destroy = function () {}), (NullElement.prototype.sourceRectAtTime = function () {}), (NullElement.prototype.hide = function () {}), extendPrototype( [BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement ); function SVGRendererBase() {} extendPrototype([BaseRenderer], SVGRendererBase), (SVGRendererBase.prototype.createNull = function (e) { return new NullElement(e, this.globalData, this); }), (SVGRendererBase.prototype.createShape = function (e) { return new SVGShapeElement(e, this.globalData, this); }), (SVGRendererBase.prototype.createText = function (e) { return new SVGTextLottieElement(e, this.globalData, this); }), (SVGRendererBase.prototype.createImage = function (e) { return new IImageElement(e, this.globalData, this); }), (SVGRendererBase.prototype.createSolid = function (e) { return new ISolidElement(e, this.globalData, this); }), (SVGRendererBase.prototype.configAnimation = function (e) { this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg'), this.svgElement.setAttribute( 'xmlns:xlink', 'http://www.w3.org/1999/xlink' ), this.renderConfig.viewBoxSize ? this.svgElement.setAttribute( 'viewBox', this.renderConfig.viewBoxSize ) : this.svgElement.setAttribute( 'viewBox', '0 0 ' + e.w + ' ' + e.h ), this.renderConfig.viewBoxOnly || (this.svgElement.setAttribute('width', e.w), this.svgElement.setAttribute('height', e.h), (this.svgElement.style.width = '100%'), (this.svgElement.style.height = '100%'), (this.svgElement.style.transform = 'translate3d(0,0,0)'), (this.svgElement.style.contentVisibility = this.renderConfig.contentVisibility)), this.renderConfig.width && this.svgElement.setAttribute('width', this.renderConfig.width), this.renderConfig.height && this.svgElement.setAttribute('height', this.renderConfig.height), this.renderConfig.className && this.svgElement.setAttribute( 'class', this.renderConfig.className ), this.renderConfig.id && this.svgElement.setAttribute('id', this.renderConfig.id), this.renderConfig.focusable !== void 0 && this.svgElement.setAttribute( 'focusable', this.renderConfig.focusable ), this.svgElement.setAttribute( 'preserveAspectRatio', this.renderConfig.preserveAspectRatio ), this.animationItem.wrapper.appendChild(this.svgElement); var t = this.globalData.defs; this.setupGlobalData(e, t), (this.globalData.progressiveLoad = this.renderConfig.progressiveLoad), (this.data = e); var r = createNS('clipPath'), i = createNS('rect'); i.setAttribute('width', e.w), i.setAttribute('height', e.h), i.setAttribute('x', 0), i.setAttribute('y', 0); var s = createElementID(); r.setAttribute('id', s), r.appendChild(i), this.layerElement.setAttribute( 'clip-path', 'url(' + getLocationHref() + '#' + s + ')' ), t.appendChild(r), (this.layers = e.layers), (this.elements = createSizedArray(e.layers.length)); }), (SVGRendererBase.prototype.destroy = function () { this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ''), (this.layerElement = null), (this.globalData.defs = null); var e, t = this.layers ? this.layers.length : 0; for (e = 0; e < t; e += 1) this.elements[e] && this.elements[e].destroy && this.elements[e].destroy(); (this.elements.length = 0), (this.destroyed = !0), (this.animationItem = null); }), (SVGRendererBase.prototype.updateContainerSize = function () {}), (SVGRendererBase.prototype.findIndexByInd = function (e) { var t = 0, r = this.layers.length; for (t = 0; t < r; t += 1) if (this.layers[t].ind === e) return t; return -1; }), (SVGRendererBase.prototype.buildItem = function (e) { var t = this.elements; if (!(t[e] || this.layers[e].ty === 99)) { t[e] = !0; var r = this.createItem(this.layers[e]); if ( ((t[e] = r), getExpressionsPlugin() && (this.layers[e].ty === 0 && this.globalData.projectInterface.registerComposition(r), r.initExpressions()), this.appendElementInPos(r, e), this.layers[e].tt) ) { var i = 'tp' in this.layers[e] ? this.findIndexByInd(this.layers[e].tp) : e - 1; if (i === -1) return; if (!this.elements[i] || this.elements[i] === !0) this.buildItem(i), this.addPendingElement(r); else { var s = t[i], n = s.getMatte(this.layers[e].tt); r.setMatte(n); } } } }), (SVGRendererBase.prototype.checkPendingElements = function () { for (; this.pendingElements.length; ) { var e = this.pendingElements.pop(); if ((e.checkParenting(), e.data.tt)) for (var t = 0, r = this.elements.length; t < r; ) { if (this.elements[t] === e) { var i = 'tp' in e.data ? this.findIndexByInd(e.data.tp) : t - 1, s = this.elements[i], n = s.getMatte(this.layers[t].tt); e.setMatte(n); break; } t += 1; } } }), (SVGRendererBase.prototype.renderFrame = function (e) { if (!(this.renderedFrame === e || this.destroyed)) { e === null ? (e = this.renderedFrame) : (this.renderedFrame = e), (this.globalData.frameNum = e), (this.globalData.frameId += 1), (this.globalData.projectInterface.currentFrame = e), (this.globalData._mdf = !1); var t, r = this.layers.length; for ( this.completeLayers || this.checkLayers(e), t = r - 1; t >= 0; t -= 1 ) (this.completeLayers || this.elements[t]) && this.elements[t].prepareFrame(e - this.layers[t].st); if (this.globalData._mdf) for (t = 0; t < r; t += 1) (this.completeLayers || this.elements[t]) && this.elements[t].renderFrame(); } }), (SVGRendererBase.prototype.appendElementInPos = function (e, t) { var r = e.getBaseElement(); if (r) { for (var i = 0, s; i < t; ) this.elements[i] && this.elements[i] !== !0 && this.elements[i].getBaseElement() && (s = this.elements[i].getBaseElement()), (i += 1); s ? this.layerElement.insertBefore(r, s) : this.layerElement.appendChild(r); } }), (SVGRendererBase.prototype.hide = function () { this.layerElement.style.display = 'none'; }), (SVGRendererBase.prototype.show = function () { this.layerElement.style.display = 'block'; }); function ICompElement() {} extendPrototype( [ BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement ], ICompElement ), (ICompElement.prototype.initElement = function (e, t, r) { this.initFrame(), this.initBaseData(e, t, r), this.initTransform(e, t, r), this.initRenderable(), this.initHierarchy(), this.initRendererElement(), this.createContainerElements(), this.createRenderableComponents(), (this.data.xt || !t.progressiveLoad) && this.buildAllItems(), this.hide(); }), (ICompElement.prototype.prepareFrame = function (e) { if ( ((this._mdf = !1), this.prepareRenderableFrame(e), this.prepareProperties(e, this.isInRange), !(!this.isInRange && !this.data.xt)) ) { if (this.tm._placeholder) this.renderedFrame = e / this.data.sr; else { var t = this.tm.v; t === this.data.op && (t = this.data.op - 1), (this.renderedFrame = t); } var r, i = this.elements.length; for ( this.completeLayers || this.checkLayers(this.renderedFrame), r = i - 1; r >= 0; r -= 1 ) (this.completeLayers || this.elements[r]) && (this.elements[r].prepareFrame( this.renderedFrame - this.layers[r].st ), this.elements[r]._mdf && (this._mdf = !0)); } }), (ICompElement.prototype.renderInnerContent = function () { var e, t = this.layers.length; for (e = 0; e < t; e += 1) (this.completeLayers || this.elements[e]) && this.elements[e].renderFrame(); }), (ICompElement.prototype.setElements = function (e) { this.elements = e; }), (ICompElement.prototype.getElements = function () { return this.elements; }), (ICompElement.prototype.destroyElements = function () { var e, t = this.layers.length; for (e = 0; e < t; e += 1) this.elements[e] && this.elements[e].destroy(); }), (ICompElement.prototype.destroy = function () { this.destroyElements(), this.destroyBaseElement(); }); function SVGCompElement(e, t, r) { (this.layers = e.layers), (this.supports3d = !0), (this.completeLayers = !1), (this.pendingElements = []), (this.elements = this.layers ? createSizedArray(this.layers.length) : []), this.initElement(e, t, r), (this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this) : { _placeholder: !0 }); } extendPrototype( [SVGRendererBase, ICompElement, SVGBaseElement], SVGCompElement ), (SVGCompElement.prototype.createComp = function (e) { return new SVGCompElement(e, this.globalData, this); }); function SVGRenderer(e, t) { (this.animationItem = e), (this.layers = null), (this.renderedFrame = -1), (this.svgElement = createNS('svg')); var r = ''; if (t && t.title) { var i = createNS('title'), s = createElementID(); i.setAttribute('id', s), (i.textContent = t.title), this.svgElement.appendChild(i), (r += s); } if (t && t.description) { var n = createNS('desc'), a = createElementID(); n.setAttribute('id', a), (n.textContent = t.description), this.svgElement.appendChild(n), (r += ' ' + a); } r && this.svgElement.setAttribute('aria-labelledby', r); var o = createNS('defs'); this.svgElement.appendChild(o); var l = createNS('g'); this.svgElement.appendChild(l), (this.layerElement = l), (this.renderConfig = { preserveAspectRatio: (t && t.preserveAspectRatio) || 'xMidYMid meet', imagePreserveAspectRatio: (t && t.imagePreserveAspectRatio) || 'xMidYMid slice', contentVisibility: (t && t.contentVisibility) || 'visible', progressiveLoad: (t && t.progressiveLoad) || !1, hideOnTransparent: !(t && t.hideOnTransparent === !1), viewBoxOnly: (t && t.viewBoxOnly) || !1, viewBoxSize: (t && t.viewBoxSize) || !1, className: (t && t.className) || '', id: (t && t.id) || '', focusable: t && t.focusable, filterSize: { width: (t && t.filterSize && t.filterSize.width) || '100%', height: (t && t.filterSize && t.filterSize.height) || '100%', x: (t && t.filterSize && t.filterSize.x) || '0%', y: (t && t.filterSize && t.filterSize.y) || '0%' }, width: t && t.width, height: t && t.height, runExpressions: !t || t.runExpressions === void 0 || t.runExpressions }), (this.globalData = { _mdf: !1, frameNum: -1, defs: o, renderConfig: this.renderConfig }), (this.elements = []), (this.pendingElements = []), (this.destroyed = !1), (this.rendererType = 'svg'); } extendPrototype([SVGRendererBase], SVGRenderer), (SVGRenderer.prototype.createComp = function (e) { return new SVGCompElement(e, this.globalData, this); }); function CVContextData() { (this.saved = []), (this.cArrPos = 0), (this.cTr = new Matrix()), (this.cO = 1); var e, t = 15; for ( this.savedOp = createTypedArray('float32', t), e = 0; e < t; e += 1 ) this.saved[e] = createTypedArray('float32', 16); this._length = t; } (CVContextData.prototype.duplicate = function () { var e = this._length * 2, t = this.savedOp; (this.savedOp = createTypedArray('float32', e)), this.savedOp.set(t); var r = 0; for (r = this._length; r < e; r += 1) this.saved[r] = createTypedArray('float32', 16); this._length = e; }), (CVContextData.prototype.reset = function () { (this.cArrPos = 0), this.cTr.reset(), (this.cO = 1); }), (CVContextData.prototype.popTransform = function () { var e = this.saved[this.cArrPos], t, r = this.cTr.props; for (t = 0; t < 16; t += 1) r[t] = e[t]; return e; }), (CVContextData.prototype.popOpacity = function () { var e = this.savedOp[this.cArrPos]; return (this.cO = e), e; }), (CVContextData.prototype.pop = function () { this.cArrPos -= 1; var e = this.popTransform(), t = this.popOpacity(); return { transform: e, opacity: t }; }), (CVContextData.prototype.push = function () { var e = this.cTr.props; this._length <= this.cArrPos && this.duplicate(); var t, r = this.saved[this.cArrPos]; for (t = 0; t < 16; t += 1) r[t] = e[t]; (this.savedOp[this.cArrPos] = this.cO), (this.cArrPos += 1); }), (CVContextData.prototype.getTransform = function () { return this.cTr; }), (CVContextData.prototype.getOpacity = function () { return this.cO; }), (CVContextData.prototype.setOpacity = function (e) { this.cO = e; }); function ShapeTransformManager() { (this.sequences = {}), (this.sequenceList = []), (this.transform_key_count = 0); } ShapeTransformManager.prototype = { addTransformSequence: function (t) { var r, i = t.length, s = '_'; for (r = 0; r < i; r += 1) s += t[r].transform.key + '_'; var n = this.sequences[s]; return ( n || ((n = { transforms: [].concat(t), finalTransform: new Matrix(), _mdf: !1 }), (this.sequences[s] = n), this.sequenceList.push(n)), n ); }, processSequence: function (t, r) { for (var i = 0, s = t.transforms.length, n = r; i < s && !r; ) { if (t.transforms[i].transform.mProps._mdf) { n = !0; break; } i += 1; } if (n) { var a; for (t.finalTransform.reset(), i = s - 1; i >= 0; i -= 1) (a = t.transforms[i].transform.mProps.v.props), t.finalTransform.transform( a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15] ); } t._mdf = n; }, processSequences: function (t) { var r, i = this.sequenceList.length; for (r = 0; r < i; r += 1) this.processSequence(this.sequenceList[r], t); }, getNewKey: function () { return ( (this.transform_key_count += 1), '_' + this.transform_key_count ); } }; var lumaLoader = function () { var t = '__lottie_element_luma_buffer', r = null, i = null, s = null; function n() { var l = createNS('svg'), c = createNS('filter'), g = createNS('feColorMatrix'); return ( c.setAttribute('id', t), g.setAttribute('type', 'matrix'), g.setAttribute('color-interpolation-filters', 'sRGB'), g.setAttribute( 'values', '0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0' ), c.appendChild(g), l.appendChild(c), l.setAttribute('id', t + '_svg'), featureSupport.svgLumaHidden && (l.style.display = 'none'), l ); } function a() { r || ((s = n()), document.body.appendChild(s), (r = createTag('canvas')), (i = r.getContext('2d')), (i.filter = 'url(#' + t + ')'), (i.fillStyle = 'rgba(0,0,0,0)'), i.fillRect(0, 0, 1, 1)); } function o(l) { return ( r || a(), (r.width = l.width), (r.height = l.height), (i.filter = 'url(#' + t + ')'), r ); } return { load: a, get: o }; }; function createCanvas(e, t) { if (featureSupport.offscreenCanvas) return new OffscreenCanvas(e, t); var r = createTag('canvas'); return (r.width = e), (r.height = t), r; } var assetLoader = (function () { return { loadLumaCanvas: lumaLoader.load, getLumaCanvas: lumaLoader.get, createCanvas }; })(); function CVEffects() {} CVEffects.prototype.renderFrame = function () {}; function CVMaskElement(e, t) { (this.data = e), (this.element = t), (this.masksProperties = this.data.masksProperties || []), (this.viewData = createSizedArray(this.masksProperties.length)); var r, i = this.masksProperties.length, s = !1; for (r = 0; r < i; r += 1) this.masksProperties[r].mode !== 'n' && (s = !0), (this.viewData[r] = ShapePropertyFactory.getShapeProp( this.element, this.masksProperties[r], 3 )); (this.hasMasks = s), s && this.element.addRenderableComponent(this); } (CVMaskElement.prototype.renderFrame = function () { if (this.hasMasks) { var e = this.element.finalTransform.mat, t = this.element.canvasContext, r, i = this.masksProperties.length, s, n, a; for (t.beginPath(), r = 0; r < i; r += 1) if (this.masksProperties[r].mode !== 'n') { this.masksProperties[r].inv && (t.moveTo(0, 0), t.lineTo(this.element.globalData.compSize.w, 0), t.lineTo( this.element.globalData.compSize.w, this.element.globalData.compSize.h ), t.lineTo(0, this.element.globalData.compSize.h), t.lineTo(0, 0)), (a = this.viewData[r].v), (s = e.applyToPointArray(a.v[0][0], a.v[0][1], 0)), t.moveTo(s[0], s[1]); var o, l = a._length; for (o = 1; o < l; o += 1) (n = e.applyToTriplePoints(a.o[o - 1], a.i[o], a.v[o])), t.bezierCurveTo(n[0], n[1], n[2], n[3], n[4], n[5]); (n = e.applyToTriplePoints(a.o[o - 1], a.i[0], a.v[0])), t.bezierCurveTo(n[0], n[1], n[2], n[3], n[4], n[5]); } this.element.globalData.renderer.save(!0), t.clip(); } }), (CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty), (CVMaskElement.prototype.destroy = function () { this.element = null; }); function CVBaseElement() {} var operationsMap = { 1: 'source-in', 2: 'source-out', 3: 'source-in', 4: 'source-out' }; (CVBaseElement.prototype = { createElements: function () {}, initRendererElement: function () {}, createContainerElements: function () { if (this.data.tt >= 1) { this.buffers = []; var t = this.globalData.canvasContext, r = assetLoader.createCanvas(t.canvas.width, t.canvas.height); this.buffers.push(r); var i = assetLoader.createCanvas(t.canvas.width, t.canvas.height); this.buffers.push(i), this.data.tt >= 3 && !document._isProxy && assetLoader.loadLumaCanvas(); } (this.canvasContext = this.globalData.canvasContext), (this.transformCanvas = this.globalData.transformCanvas), (this.renderableEffectsManager = new CVEffects()); }, createContent: function () {}, setBlendMode: function () { var t = this.globalData; if (t.blendMode !== this.data.bm) { t.blendMode = this.data.bm; var r = getBlendMode(this.data.bm); t.canvasContext.globalCompositeOperation = r; } }, createRenderableComponents: function () { this.maskManager = new CVMaskElement(this.data, this); }, hideElement: function () { !this.hidden && (!this.isInRange || this.isTransparent) && (this.hidden = !0); }, showElement: function () { this.isInRange && !this.isTransparent && ((this.hidden = !1), (this._isFirstFrame = !0), (this.maskManager._isFirstFrame = !0)); }, clearCanvas: function (t) { t.clearRect( this.transformCanvas.tx, this.transformCanvas.ty, this.transformCanvas.w * this.transformCanvas.sx, this.transformCanvas.h * this.transformCanvas.sy ); }, prepareLayer: function () { if (this.data.tt >= 1) { var t = this.buffers[0], r = t.getContext('2d'); this.clearCanvas(r), r.drawImage(this.canvasContext.canvas, 0, 0), (this.currentTransform = this.canvasContext.getTransform()), this.canvasContext.setTransform(1, 0, 0, 1, 0, 0), this.clearCanvas(this.canvasContext), this.canvasContext.setTransform(this.currentTransform); } }, exitLayer: function () { if (this.data.tt >= 1) { var t = this.buffers[1], r = t.getContext('2d'); this.clearCanvas(r), r.drawImage(this.canvasContext.canvas, 0, 0), this.canvasContext.setTransform(1, 0, 0, 1, 0, 0), this.clearCanvas(this.canvasContext), this.canvasContext.setTransform(this.currentTransform); var i = this.comp.getElementById( 'tp' in this.data ? this.data.tp : this.data.ind - 1 ); if ( (i.renderFrame(!0), this.canvasContext.setTransform(1, 0, 0, 1, 0, 0), this.data.tt >= 3 && !document._isProxy) ) { var s = assetLoader.getLumaCanvas(this.canvasContext.canvas), n = s.getContext('2d'); n.drawImage(this.canvasContext.canvas, 0, 0), this.clearCanvas(this.canvasContext), this.canvasContext.drawImage(s, 0, 0); } (this.canvasContext.globalCompositeOperation = operationsMap[this.data.tt]), this.canvasContext.drawImage(t, 0, 0), (this.canvasContext.globalCompositeOperation = 'destination-over'), this.canvasContext.drawImage(this.buffers[0], 0, 0), this.canvasContext.setTransform(this.currentTransform), (this.canvasContext.globalCompositeOperation = 'source-over'); } }, renderFrame: function (t) { if (!(this.hidden || this.data.hd) && !(this.data.td === 1 && !t)) { this.renderTransform(), this.renderRenderable(), this.setBlendMode(); var r = this.data.ty === 0; this.prepareLayer(), this.globalData.renderer.save(r), this.globalData.renderer.ctxTransform( this.finalTransform.mat.props ), this.globalData.renderer.ctxOpacity( this.finalTransform.mProp.o.v ), this.renderInnerContent(), this.globalData.renderer.restore(r), this.exitLayer(), this.maskManager.hasMasks && this.globalData.renderer.restore(!0), this._isFirstFrame && (this._isFirstFrame = !1); } }, destroy: function () { (this.canvasContext = null), (this.data = null), (this.globalData = null), this.maskManager.destroy(); }, mHelper: new Matrix() }), (CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement), (CVBaseElement.prototype.show = CVBaseElement.prototype.showElement); function CVShapeData(e, t, r, i) { (this.styledShapes = []), (this.tr = [0, 0, 0, 0, 0, 0]); var s = 4; t.ty === 'rc' ? (s = 5) : t.ty === 'el' ? (s = 6) : t.ty === 'sr' && (s = 7), (this.sh = ShapePropertyFactory.getShapeProp(e, t, s, e)); var n, a = r.length, o; for (n = 0; n < a; n += 1) r[n].closed || ((o = { transforms: i.addTransformSequence(r[n].transforms), trNodes: [] }), this.styledShapes.push(o), r[n].elements.push(o)); } CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated; function CVShapeElement(e, t, r) { (this.shapes = []), (this.shapesData = e.shapes), (this.stylesList = []), (this.itemsData = []), (this.prevViewData = []), (this.shapeModifiers = []), (this.processedElements = []), (this.transformsManager = new ShapeTransformManager()), this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement ], CVShapeElement ), (CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement), (CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: !1 }), (CVShapeElement.prototype.dashResetter = []), (CVShapeElement.prototype.createContent = function () { this.searchShapes( this.shapesData, this.itemsData, this.prevViewData, !0, [] ); }), (CVShapeElement.prototype.createStyleElement = function (e, t) { var r = { data: e, type: e.ty, preTransforms: this.transformsManager.addTransformSequence(t), transforms: [], elements: [], closed: e.hd === !0 }, i = {}; if ( (e.ty === 'fl' || e.ty === 'st' ? ((i.c = PropertyFactory.getProp(this, e.c, 1, 255, this)), i.c.k || (r.co = 'rgb(' + bmFloor(i.c.v[0]) + ',' + bmFloor(i.c.v[1]) + ',' + bmFloor(i.c.v[2]) + ')')) : (e.ty === 'gf' || e.ty === 'gs') && ((i.s = PropertyFactory.getProp(this, e.s, 1, null, this)), (i.e = PropertyFactory.getProp(this, e.e, 1, null, this)), (i.h = PropertyFactory.getProp( this, e.h || { k: 0 }, 0, 0.01, this )), (i.a = PropertyFactory.getProp( this, e.a || { k: 0 }, 0, degToRads, this )), (i.g = new GradientProperty(this, e.g, this))), (i.o = PropertyFactory.getProp(this, e.o, 0, 0.01, this)), e.ty === 'st' || e.ty === 'gs') ) { if ( ((r.lc = lineCapEnum[e.lc || 2]), (r.lj = lineJoinEnum[e.lj || 2]), e.lj == 1 && (r.ml = e.ml), (i.w = PropertyFactory.getProp(this, e.w, 0, null, this)), i.w.k || (r.wi = i.w.v), e.d) ) { var s = new DashProperty(this, e.d, 'canvas', this); (i.d = s), i.d.k || ((r.da = i.d.dashArray), (r.do = i.d.dashoffset[0])); } } else r.r = e.r === 2 ? 'evenodd' : 'nonzero'; return this.stylesList.push(r), (i.style = r), i; }), (CVShapeElement.prototype.createGroupElement = function () { var e = { it: [], prevViewData: [] }; return e; }), (CVShapeElement.prototype.createTransformElement = function (e) { var t = { transform: { opacity: 1, _opMdf: !1, key: this.transformsManager.getNewKey(), op: PropertyFactory.getProp(this, e.o, 0, 0.01, this), mProps: TransformPropertyFactory.getTransformProperty( this, e, this ) } }; return t; }), (CVShapeElement.prototype.createShapeElement = function (e) { var t = new CVShapeData( this, e, this.stylesList, this.transformsManager ); return this.shapes.push(t), this.addShapeToModifiers(t), t; }), (CVShapeElement.prototype.reloadShapes = function () { this._isFirstFrame = !0; var e, t = this.itemsData.length; for (e = 0; e < t; e += 1) this.prevViewData[e] = this.itemsData[e]; for ( this.searchShapes( this.shapesData, this.itemsData, this.prevViewData, !0, [] ), t = this.dynamicProperties.length, e = 0; e < t; e += 1 ) this.dynamicProperties[e].getValue(); this.renderModifiers(), this.transformsManager.processSequences(this._isFirstFrame); }), (CVShapeElement.prototype.addTransformToStyleList = function (e) { var t, r = this.stylesList.length; for (t = 0; t < r; t += 1) this.stylesList[t].closed || this.stylesList[t].transforms.push(e); }), (CVShapeElement.prototype.removeTransformFromStyleList = function () { var e, t = this.stylesList.length; for (e = 0; e < t; e += 1) this.stylesList[e].closed || this.stylesList[e].transforms.pop(); }), (CVShapeElement.prototype.closeStyles = function (e) { var t, r = e.length; for (t = 0; t < r; t += 1) e[t].closed = !0; }), (CVShapeElement.prototype.searchShapes = function (e, t, r, i, s) { var n, a = e.length - 1, o, l, c = [], g = [], S, p, P, b = [].concat(s); for (n = a; n >= 0; n -= 1) { if ( ((S = this.searchProcessedElement(e[n])), S ? (t[n] = r[S - 1]) : (e[n]._shouldRender = i), e[n].ty === 'fl' || e[n].ty === 'st' || e[n].ty === 'gf' || e[n].ty === 'gs') ) S ? (t[n].style.closed = !1) : (t[n] = this.createStyleElement(e[n], b)), c.push(t[n].style); else if (e[n].ty === 'gr') { if (!S) t[n] = this.createGroupElement(e[n]); else for (l = t[n].it.length, o = 0; o < l; o += 1) t[n].prevViewData[o] = t[n].it[o]; this.searchShapes(e[n].it, t[n].it, t[n].prevViewData, i, b); } else e[n].ty === 'tr' ? (S || ((P = this.createTransformElement(e[n])), (t[n] = P)), b.push(t[n]), this.addTransformToStyleList(t[n])) : e[n].ty === 'sh' || e[n].ty === 'rc' || e[n].ty === 'el' || e[n].ty === 'sr' ? S || (t[n] = this.createShapeElement(e[n])) : e[n].ty === 'tm' || e[n].ty === 'rd' || e[n].ty === 'pb' || e[n].ty === 'zz' || e[n].ty === 'op' ? (S ? ((p = t[n]), (p.closed = !1)) : ((p = ShapeModifiers.getModifier(e[n].ty)), p.init(this, e[n]), (t[n] = p), this.shapeModifiers.push(p)), g.push(p)) : e[n].ty === 'rp' && (S ? ((p = t[n]), (p.closed = !0)) : ((p = ShapeModifiers.getModifier(e[n].ty)), (t[n] = p), p.init(this, e, n, t), this.shapeModifiers.push(p), (i = !1)), g.push(p)); this.addProcessedElement(e[n], n + 1); } for ( this.removeTransformFromStyleList(), this.closeStyles(c), a = g.length, n = 0; n < a; n += 1 ) g[n].closed = !0; }), (CVShapeElement.prototype.renderInnerContent = function () { (this.transformHelper.opacity = 1), (this.transformHelper._opMdf = !1), this.renderModifiers(), this.transformsManager.processSequences(this._isFirstFrame), this.renderShape( this.transformHelper, this.shapesData, this.itemsData, !0 ); }), (CVShapeElement.prototype.renderShapeTransform = function (e, t) { (e._opMdf || t.op._mdf || this._isFirstFrame) && ((t.opacity = e.opacity), (t.opacity *= t.op.v), (t._opMdf = !0)); }), (CVShapeElement.prototype.drawLayer = function () { var e, t = this.stylesList.length, r, i, s, n, a, o, l = this.globalData.renderer, c = this.globalData.canvasContext, g, S; for (e = 0; e < t; e += 1) if ( ((S = this.stylesList[e]), (g = S.type), !( ((g === 'st' || g === 'gs') && S.wi === 0) || !S.data._shouldRender || S.coOp === 0 || this.globalData.currentGlobalAlpha === 0 )) ) { for ( l.save(), a = S.elements, g === 'st' || g === 'gs' ? ((c.strokeStyle = g === 'st' ? S.co : S.grd), (c.lineWidth = S.wi), (c.lineCap = S.lc), (c.lineJoin = S.lj), (c.miterLimit = S.ml || 0)) : (c.fillStyle = g === 'fl' ? S.co : S.grd), l.ctxOpacity(S.coOp), g !== 'st' && g !== 'gs' && c.beginPath(), l.ctxTransform(S.preTransforms.finalTransform.props), i = a.length, r = 0; r < i; r += 1 ) { for ( (g === 'st' || g === 'gs') && (c.beginPath(), S.da && (c.setLineDash(S.da), (c.lineDashOffset = S.do))), o = a[r].trNodes, n = o.length, s = 0; s < n; s += 1 ) o[s].t === 'm' ? c.moveTo(o[s].p[0], o[s].p[1]) : o[s].t === 'c' ? c.bezierCurveTo( o[s].pts[0], o[s].pts[1], o[s].pts[2], o[s].pts[3], o[s].pts[4], o[s].pts[5] ) : c.closePath(); (g === 'st' || g === 'gs') && (c.stroke(), S.da && c.setLineDash(this.dashResetter)); } g !== 'st' && g !== 'gs' && c.fill(S.r), l.restore(); } }), (CVShapeElement.prototype.renderShape = function (e, t, r, i) { var s, n = t.length - 1, a; for (a = e, s = n; s >= 0; s -= 1) t[s].ty === 'tr' ? ((a = r[s].transform), this.renderShapeTransform(e, a)) : t[s].ty === 'sh' || t[s].ty === 'el' || t[s].ty === 'rc' || t[s].ty === 'sr' ? this.renderPath(t[s], r[s]) : t[s].ty === 'fl' ? this.renderFill(t[s], r[s], a) : t[s].ty === 'st' ? this.renderStroke(t[s], r[s], a) : t[s].ty === 'gf' || t[s].ty === 'gs' ? this.renderGradientFill(t[s], r[s], a) : t[s].ty === 'gr' ? this.renderShape(a, t[s].it, r[s].it) : t[s].ty; i && this.drawLayer(); }), (CVShapeElement.prototype.renderStyledShape = function (e, t) { if (this._isFirstFrame || t._mdf || e.transforms._mdf) { var r = e.trNodes, i = t.paths, s, n, a, o = i._length; r.length = 0; var l = e.transforms.finalTransform; for (a = 0; a < o; a += 1) { var c = i.shapes[a]; if (c && c.v) { for (n = c._length, s = 1; s < n; s += 1) s === 1 && r.push({ t: 'm', p: l.applyToPointArray(c.v[0][0], c.v[0][1], 0) }), r.push({ t: 'c', pts: l.applyToTriplePoints(c.o[s - 1], c.i[s], c.v[s]) }); n === 1 && r.push({ t: 'm', p: l.applyToPointArray(c.v[0][0], c.v[0][1], 0) }), c.c && n && (r.push({ t: 'c', pts: l.applyToTriplePoints(c.o[s - 1], c.i[0], c.v[0]) }), r.push({ t: 'z' })); } } e.trNodes = r; } }), (CVShapeElement.prototype.renderPath = function (e, t) { if (e.hd !== !0 && e._shouldRender) { var r, i = t.styledShapes.length; for (r = 0; r < i; r += 1) this.renderStyledShape(t.styledShapes[r], t.sh); } }), (CVShapeElement.prototype.renderFill = function (e, t, r) { var i = t.style; (t.c._mdf || this._isFirstFrame) && (i.co = 'rgb(' + bmFloor(t.c.v[0]) + ',' + bmFloor(t.c.v[1]) + ',' + bmFloor(t.c.v[2]) + ')'), (t.o._mdf || r._opMdf || this._isFirstFrame) && (i.coOp = t.o.v * r.opacity); }), (CVShapeElement.prototype.renderGradientFill = function (e, t, r) { var i = t.style, s; if ( !i.grd || t.g._mdf || t.s._mdf || t.e._mdf || (e.t !== 1 && (t.h._mdf || t.a._mdf)) ) { var n = this.globalData.canvasContext, a = t.s.v, o = t.e.v; if (e.t === 1) s = n.createLinearGradient(a[0], a[1], o[0], o[1]); else { var l = Math.sqrt( Math.pow(a[0] - o[0], 2) + Math.pow(a[1] - o[1], 2) ), c = Math.atan2(o[1] - a[1], o[0] - a[0]), g = t.h.v; g >= 1 ? (g = 0.99) : g <= -1 && (g = -0.99); var S = l * g, p = Math.cos(c + t.a.v) * S + a[0], P = Math.sin(c + t.a.v) * S + a[1]; s = n.createRadialGradient(p, P, 0, a[0], a[1], l); } var b, y = e.g.p, A = t.g.c, u = 1; for (b = 0; b < y; b += 1) t.g._hasOpacity && t.g._collapsable && (u = t.g.o[b * 2 + 1]), s.addColorStop( A[b * 4] / 100, 'rgba(' + A[b * 4 + 1] + ',' + A[b * 4 + 2] + ',' + A[b * 4 + 3] + ',' + u + ')' ); i.grd = s; } i.coOp = t.o.v * r.opacity; }), (CVShapeElement.prototype.renderStroke = function (e, t, r) { var i = t.style, s = t.d; s && (s._mdf || this._isFirstFrame) && ((i.da = s.dashArray), (i.do = s.dashoffset[0])), (t.c._mdf || this._isFirstFrame) && (i.co = 'rgb(' + bmFloor(t.c.v[0]) + ',' + bmFloor(t.c.v[1]) + ',' + bmFloor(t.c.v[2]) + ')'), (t.o._mdf || r._opMdf || this._isFirstFrame) && (i.coOp = t.o.v * r.opacity), (t.w._mdf || this._isFirstFrame) && (i.wi = t.w.v); }), (CVShapeElement.prototype.destroy = function () { (this.shapesData = null), (this.globalData = null), (this.canvasContext = null), (this.stylesList.length = 0), (this.itemsData.length = 0); }); function CVTextElement(e, t, r) { (this.textSpans = []), (this.yOffset = 0), (this.fillColorAnim = !1), (this.strokeColorAnim = !1), (this.strokeWidthAnim = !1), (this.stroke = !1), (this.fill = !1), (this.justifyOffset = 0), (this.currentRender = null), (this.renderType = 'canvas'), (this.values = { fill: 'rgba(0,0,0,0)', stroke: 'rgba(0,0,0,0)', sWidth: 0, fValue: '' }), this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement ], CVTextElement ), (CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d')), (CVTextElement.prototype.buildNewText = function () { var e = this.textProperty.currentData; this.renderedLetters = createSizedArray(e.l ? e.l.length : 0); var t = !1; e.fc ? ((t = !0), (this.values.fill = this.buildColor(e.fc))) : (this.values.fill = 'rgba(0,0,0,0)'), (this.fill = t); var r = !1; e.sc && ((r = !0), (this.values.stroke = this.buildColor(e.sc)), (this.values.sWidth = e.sw)); var i = this.globalData.fontManager.getFontByName(e.f), s, n, a = e.l, o = this.mHelper; (this.stroke = r), (this.values.fValue = e.finalSize + 'px ' + this.globalData.fontManager.getFontByName(e.f).fFamily), (n = e.finalText.length); var l, c, g, S, p, P, b, y, A, u, f = this.data.singleShape, m = e.tr * 0.001 * e.finalSize, d = 0, E = 0, T = !0, x = 0; for (s = 0; s < n; s += 1) { (l = this.globalData.fontManager.getCharData( e.finalText[s], i.fStyle, this.globalData.fontManager.getFontByName(e.f).fFamily )), (c = (l && l.data) || {}), o.reset(), f && a[s].n && ((d = -m), (E += e.yOffset), (E += T ? 1 : 0), (T = !1)), (p = c.shapes ? c.shapes[0].it : []), (b = p.length), o.scale(e.finalSize / 100, e.finalSize / 100), f && this.applyTextPropertiesToMatrix(e, o, a[s].line, d, E), (A = createSizedArray(b - 1)); var _ = 0; for (P = 0; P < b; P += 1) if (p[P].ty === 'sh') { for ( S = p[P].ks.k.i.length, y = p[P].ks.k, u = [], g = 1; g < S; g += 1 ) g === 1 && u.push( o.applyToX(y.v[0][0], y.v[0][1], 0), o.applyToY(y.v[0][0], y.v[0][1], 0) ), u.push( o.applyToX(y.o[g - 1][0], y.o[g - 1][1], 0), o.applyToY(y.o[g - 1][0], y.o[g - 1][1], 0), o.applyToX(y.i[g][0], y.i[g][1], 0), o.applyToY(y.i[g][0], y.i[g][1], 0), o.applyToX(y.v[g][0], y.v[g][1], 0), o.applyToY(y.v[g][0], y.v[g][1], 0) ); u.push( o.applyToX(y.o[g - 1][0], y.o[g - 1][1], 0), o.applyToY(y.o[g - 1][0], y.o[g - 1][1], 0), o.applyToX(y.i[0][0], y.i[0][1], 0), o.applyToY(y.i[0][0], y.i[0][1], 0), o.applyToX(y.v[0][0], y.v[0][1], 0), o.applyToY(y.v[0][0], y.v[0][1], 0) ), (A[_] = u), (_ += 1); } f && ((d += a[s].l), (d += m)), this.textSpans[x] ? (this.textSpans[x].elem = A) : (this.textSpans[x] = { elem: A }), (x += 1); } }), (CVTextElement.prototype.renderInnerContent = function () { var e = this.canvasContext; (e.font = this.values.fValue), (e.lineCap = 'butt'), (e.lineJoin = 'miter'), (e.miterLimit = 4), this.data.singleShape || this.textAnimator.getMeasures( this.textProperty.currentData, this.lettersChangedFlag ); var t, r, i, s, n, a, o = this.textAnimator.renderedLetters, l = this.textProperty.currentData.l; r = l.length; var c, g = null, S = null, p = null, P, b; for (t = 0; t < r; t += 1) if (!l[t].n) { if ( ((c = o[t]), c && (this.globalData.renderer.save(), this.globalData.renderer.ctxTransform(c.p), this.globalData.renderer.ctxOpacity(c.o)), this.fill) ) { for ( c && c.fc ? g !== c.fc && ((g = c.fc), (e.fillStyle = c.fc)) : g !== this.values.fill && ((g = this.values.fill), (e.fillStyle = this.values.fill)), P = this.textSpans[t].elem, s = P.length, this.globalData.canvasContext.beginPath(), i = 0; i < s; i += 1 ) for ( b = P[i], a = b.length, this.globalData.canvasContext.moveTo(b[0], b[1]), n = 2; n < a; n += 6 ) this.globalData.canvasContext.bezierCurveTo( b[n], b[n + 1], b[n + 2], b[n + 3], b[n + 4], b[n + 5] ); this.globalData.canvasContext.closePath(), this.globalData.canvasContext.fill(); } if (this.stroke) { for ( c && c.sw ? p !== c.sw && ((p = c.sw), (e.lineWidth = c.sw)) : p !== this.values.sWidth && ((p = this.values.sWidth), (e.lineWidth = this.values.sWidth)), c && c.sc ? S !== c.sc && ((S = c.sc), (e.strokeStyle = c.sc)) : S !== this.values.stroke && ((S = this.values.stroke), (e.strokeStyle = this.values.stroke)), P = this.textSpans[t].elem, s = P.length, this.globalData.canvasContext.beginPath(), i = 0; i < s; i += 1 ) for ( b = P[i], a = b.length, this.globalData.canvasContext.moveTo(b[0], b[1]), n = 2; n < a; n += 6 ) this.globalData.canvasContext.bezierCurveTo( b[n], b[n + 1], b[n + 2], b[n + 3], b[n + 4], b[n + 5] ); this.globalData.canvasContext.closePath(), this.globalData.canvasContext.stroke(); } c && this.globalData.renderer.restore(); } }); function CVImageElement(e, t, r) { (this.assetData = t.getAssetData(e.refId)), (this.img = t.imageLoader.getAsset(this.assetData)), this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement ], CVImageElement ), (CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement), (CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame), (CVImageElement.prototype.createContent = function () { if ( this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height) ) { var e = createTag('canvas'); (e.width = this.assetData.w), (e.height = this.assetData.h); var t = e.getContext('2d'), r = this.img.width, i = this.img.height, s = r / i, n = this.assetData.w / this.assetData.h, a, o, l = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio; (s > n && l === 'xMidYMid slice') || (s < n && l !== 'xMidYMid slice') ? ((o = i), (a = o * n)) : ((a = r), (o = a / n)), t.drawImage( this.img, (r - a) / 2, (i - o) / 2, a, o, 0, 0, this.assetData.w, this.assetData.h ), (this.img = e); } }), (CVImageElement.prototype.renderInnerContent = function () { this.canvasContext.drawImage(this.img, 0, 0); }), (CVImageElement.prototype.destroy = function () { this.img = null; }); function CVSolidElement(e, t, r) { this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement ], CVSolidElement ), (CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement), (CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame), (CVSolidElement.prototype.renderInnerContent = function () { var e = this.canvasContext; (e.fillStyle = this.data.sc), e.fillRect(0, 0, this.data.sw, this.data.sh); }); function CanvasRendererBase(e, t) { (this.animationItem = e), (this.renderConfig = { clearCanvas: t && t.clearCanvas !== void 0 ? t.clearCanvas : !0, context: (t && t.context) || null, progressiveLoad: (t && t.progressiveLoad) || !1, preserveAspectRatio: (t && t.preserveAspectRatio) || 'xMidYMid meet', imagePreserveAspectRatio: (t && t.imagePreserveAspectRatio) || 'xMidYMid slice', contentVisibility: (t && t.contentVisibility) || 'visible', className: (t && t.className) || '', id: (t && t.id) || '' }), (this.renderConfig.dpr = (t && t.dpr) || 1), this.animationItem.wrapper && (this.renderConfig.dpr = (t && t.dpr) || window.devicePixelRatio || 1), (this.renderedFrame = -1), (this.globalData = { frameNum: -1, _mdf: !1, renderConfig: this.renderConfig, currentGlobalAlpha: -1 }), (this.contextData = new CVContextData()), (this.elements = []), (this.pendingElements = []), (this.transformMat = new Matrix()), (this.completeLayers = !1), (this.rendererType = 'canvas'); } extendPrototype([BaseRenderer], CanvasRendererBase), (CanvasRendererBase.prototype.createShape = function (e) { return new CVShapeElement(e, this.globalData, this); }), (CanvasRendererBase.prototype.createText = function (e) { return new CVTextElement(e, this.globalData, this); }), (CanvasRendererBase.prototype.createImage = function (e) { return new CVImageElement(e, this.globalData, this); }), (CanvasRendererBase.prototype.createSolid = function (e) { return new CVSolidElement(e, this.globalData, this); }), (CanvasRendererBase.prototype.createNull = SVGRenderer.prototype.createNull), (CanvasRendererBase.prototype.ctxTransform = function (e) { if ( !( e[0] === 1 && e[1] === 0 && e[4] === 0 && e[5] === 1 && e[12] === 0 && e[13] === 0 ) ) { if (!this.renderConfig.clearCanvas) { this.canvasContext.transform( e[0], e[1], e[4], e[5], e[12], e[13] ); return; } this.transformMat.cloneFromProps(e); var t = this.contextData.getTransform(), r = t.props; this.transformMat.transform( r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15] ), t.cloneFromProps(this.transformMat.props); var i = t.props; this.canvasContext.setTransform( i[0], i[1], i[4], i[5], i[12], i[13] ); } }), (CanvasRendererBase.prototype.ctxOpacity = function (e) { var t = this.contextData.getOpacity(); if (!this.renderConfig.clearCanvas) { (this.canvasContext.globalAlpha *= e < 0 ? 0 : e), (this.globalData.currentGlobalAlpha = t); return; } (t *= e < 0 ? 0 : e), this.contextData.setOpacity(t), this.globalData.currentGlobalAlpha !== t && ((this.canvasContext.globalAlpha = t), (this.globalData.currentGlobalAlpha = t)); }), (CanvasRendererBase.prototype.reset = function () { if (!this.renderConfig.clearCanvas) { this.canvasContext.restore(); return; } this.contextData.reset(); }), (CanvasRendererBase.prototype.save = function (e) { if (!this.renderConfig.clearCanvas) { this.canvasContext.save(); return; } e && this.canvasContext.save(), this.contextData.push(); }), (CanvasRendererBase.prototype.restore = function (e) { if (!this.renderConfig.clearCanvas) { this.canvasContext.restore(); return; } e && (this.canvasContext.restore(), (this.globalData.blendMode = 'source-over')); var t = this.contextData.pop(), r = t.transform, i = t.opacity; this.canvasContext.setTransform(r[0], r[1], r[4], r[5], r[12], r[13]), this.globalData.currentGlobalAlpha !== i && ((this.canvasContext.globalAlpha = i), (this.globalData.currentGlobalAlpha = i)); }), (CanvasRendererBase.prototype.configAnimation = function (e) { if (this.animationItem.wrapper) { this.animationItem.container = createTag('canvas'); var t = this.animationItem.container.style; (t.width = '100%'), (t.height = '100%'); var r = '0px 0px 0px'; (t.transformOrigin = r), (t.mozTransformOrigin = r), (t.webkitTransformOrigin = r), (t['-webkit-transform'] = r), (t.contentVisibility = this.renderConfig.contentVisibility), this.animationItem.wrapper.appendChild( this.animationItem.container ), (this.canvasContext = this.animationItem.container.getContext('2d')), this.renderConfig.className && this.animationItem.container.setAttribute( 'class', this.renderConfig.className ), this.renderConfig.id && this.animationItem.container.setAttribute( 'id', this.renderConfig.id ); } else this.canvasContext = this.renderConfig.context; (this.data = e), (this.layers = e.layers), (this.transformCanvas = { w: e.w, h: e.h, sx: 0, sy: 0, tx: 0, ty: 0 }), this.setupGlobalData(e, document.body), (this.globalData.canvasContext = this.canvasContext), (this.globalData.renderer = this), (this.globalData.isDashed = !1), (this.globalData.progressiveLoad = this.renderConfig.progressiveLoad), (this.globalData.transformCanvas = this.transformCanvas), (this.elements = createSizedArray(e.layers.length)), this.updateContainerSize(); }), (CanvasRendererBase.prototype.updateContainerSize = function (e, t) { this.reset(); var r, i; e ? ((r = e), (i = t), (this.canvasContext.canvas.width = r), (this.canvasContext.canvas.height = i)) : (this.animationItem.wrapper && this.animationItem.container ? ((r = this.animationItem.wrapper.offsetWidth), (i = this.animationItem.wrapper.offsetHeight)) : ((r = this.canvasContext.canvas.width), (i = this.canvasContext.canvas.height)), (this.canvasContext.canvas.width = r * this.renderConfig.dpr), (this.canvasContext.canvas.height = i * this.renderConfig.dpr)); var s, n; if ( this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1 ) { var a = this.renderConfig.preserveAspectRatio.split(' '), o = a[1] || 'meet', l = a[0] || 'xMidYMid', c = l.substr(0, 4), g = l.substr(4); (s = r / i), (n = this.transformCanvas.w / this.transformCanvas.h), (n > s && o === 'meet') || (n < s && o === 'slice') ? ((this.transformCanvas.sx = r / (this.transformCanvas.w / this.renderConfig.dpr)), (this.transformCanvas.sy = r / (this.transformCanvas.w / this.renderConfig.dpr))) : ((this.transformCanvas.sx = i / (this.transformCanvas.h / this.renderConfig.dpr)), (this.transformCanvas.sy = i / (this.transformCanvas.h / this.renderConfig.dpr))), c === 'xMid' && ((n < s && o === 'meet') || (n > s && o === 'slice')) ? (this.transformCanvas.tx = ((r - this.transformCanvas.w * (i / this.transformCanvas.h)) / 2) * this.renderConfig.dpr) : c === 'xMax' && ((n < s && o === 'meet') || (n > s && o === 'slice')) ? (this.transformCanvas.tx = (r - this.transformCanvas.w * (i / this.transformCanvas.h)) * this.renderConfig.dpr) : (this.transformCanvas.tx = 0), g === 'YMid' && ((n > s && o === 'meet') || (n < s && o === 'slice')) ? (this.transformCanvas.ty = ((i - this.transformCanvas.h * (r / this.transformCanvas.w)) / 2) * this.renderConfig.dpr) : g === 'YMax' && ((n > s && o === 'meet') || (n < s && o === 'slice')) ? (this.transformCanvas.ty = (i - this.transformCanvas.h * (r / this.transformCanvas.w)) * this.renderConfig.dpr) : (this.transformCanvas.ty = 0); } else this.renderConfig.preserveAspectRatio === 'none' ? ((this.transformCanvas.sx = r / (this.transformCanvas.w / this.renderConfig.dpr)), (this.transformCanvas.sy = i / (this.transformCanvas.h / this.renderConfig.dpr)), (this.transformCanvas.tx = 0), (this.transformCanvas.ty = 0)) : ((this.transformCanvas.sx = this.renderConfig.dpr), (this.transformCanvas.sy = this.renderConfig.dpr), (this.transformCanvas.tx = 0), (this.transformCanvas.ty = 0)); (this.transformCanvas.props = [ this.transformCanvas.sx, 0, 0, 0, 0, this.transformCanvas.sy, 0, 0, 0, 0, 1, 0, this.transformCanvas.tx, this.transformCanvas.ty, 0, 1 ]), this.ctxTransform(this.transformCanvas.props), this.canvasContext.beginPath(), this.canvasContext.rect( 0, 0, this.transformCanvas.w, this.transformCanvas.h ), this.canvasContext.closePath(), this.canvasContext.clip(), this.renderFrame(this.renderedFrame, !0); }), (CanvasRendererBase.prototype.destroy = function () { this.renderConfig.clearCanvas && this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ''); var e, t = this.layers ? this.layers.length : 0; for (e = t - 1; e >= 0; e -= 1) this.elements[e] && this.elements[e].destroy && this.elements[e].destroy(); (this.elements.length = 0), (this.globalData.canvasContext = null), (this.animationItem.container = null), (this.destroyed = !0); }), (CanvasRendererBase.prototype.renderFrame = function (e, t) { if ( !( (this.renderedFrame === e && this.renderConfig.clearCanvas === !0 && !t) || this.destroyed || e === -1 ) ) { (this.renderedFrame = e), (this.globalData.frameNum = e - this.animationItem._isFirstFrame), (this.globalData.frameId += 1), (this.globalData._mdf = !this.renderConfig.clearCanvas || t), (this.globalData.projectInterface.currentFrame = e); var r, i = this.layers.length; for ( this.completeLayers || this.checkLayers(e), r = 0; r < i; r += 1 ) (this.completeLayers || this.elements[r]) && this.elements[r].prepareFrame(e - this.layers[r].st); if (this.globalData._mdf) { for ( this.renderConfig.clearCanvas === !0 ? this.canvasContext.clearRect( 0, 0, this.transformCanvas.w, this.transformCanvas.h ) : this.save(), r = i - 1; r >= 0; r -= 1 ) (this.completeLayers || this.elements[r]) && this.elements[r].renderFrame(); this.renderConfig.clearCanvas !== !0 && this.restore(); } } }), (CanvasRendererBase.prototype.buildItem = function (e) { var t = this.elements; if (!(t[e] || this.layers[e].ty === 99)) { var r = this.createItem(this.layers[e], this, this.globalData); (t[e] = r), r.initExpressions(); } }), (CanvasRendererBase.prototype.checkPendingElements = function () { for (; this.pendingElements.length; ) { var e = this.pendingElements.pop(); e.checkParenting(); } }), (CanvasRendererBase.prototype.hide = function () { this.animationItem.container.style.display = 'none'; }), (CanvasRendererBase.prototype.show = function () { this.animationItem.container.style.display = 'block'; }); function CVCompElement(e, t, r) { (this.completeLayers = !1), (this.layers = e.layers), (this.pendingElements = []), (this.elements = createSizedArray(this.layers.length)), this.initElement(e, t, r), (this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this) : { _placeholder: !0 }); } extendPrototype( [CanvasRendererBase, ICompElement, CVBaseElement], CVCompElement ), (CVCompElement.prototype.renderInnerContent = function () { var e = this.canvasContext; e.beginPath(), e.moveTo(0, 0), e.lineTo(this.data.w, 0), e.lineTo(this.data.w, this.data.h), e.lineTo(0, this.data.h), e.lineTo(0, 0), e.clip(); var t, r = this.layers.length; for (t = r - 1; t >= 0; t -= 1) (this.completeLayers || this.elements[t]) && this.elements[t].renderFrame(); }), (CVCompElement.prototype.destroy = function () { var e, t = this.layers.length; for (e = t - 1; e >= 0; e -= 1) this.elements[e] && this.elements[e].destroy(); (this.layers = null), (this.elements = null); }), (CVCompElement.prototype.createComp = function (e) { return new CVCompElement(e, this.globalData, this); }); function CanvasRenderer(e, t) { (this.animationItem = e), (this.renderConfig = { clearCanvas: t && t.clearCanvas !== void 0 ? t.clearCanvas : !0, context: (t && t.context) || null, progressiveLoad: (t && t.progressiveLoad) || !1, preserveAspectRatio: (t && t.preserveAspectRatio) || 'xMidYMid meet', imagePreserveAspectRatio: (t && t.imagePreserveAspectRatio) || 'xMidYMid slice', contentVisibility: (t && t.contentVisibility) || 'visible', className: (t && t.className) || '', id: (t && t.id) || '', runExpressions: !t || t.runExpressions === void 0 || t.runExpressions }), (this.renderConfig.dpr = (t && t.dpr) || 1), this.animationItem.wrapper && (this.renderConfig.dpr = (t && t.dpr) || window.devicePixelRatio || 1), (this.renderedFrame = -1), (this.globalData = { frameNum: -1, _mdf: !1, renderConfig: this.renderConfig, currentGlobalAlpha: -1 }), (this.contextData = new CVContextData()), (this.elements = []), (this.pendingElements = []), (this.transformMat = new Matrix()), (this.completeLayers = !1), (this.rendererType = 'canvas'); } extendPrototype([CanvasRendererBase], CanvasRenderer), (CanvasRenderer.prototype.createComp = function (e) { return new CVCompElement(e, this.globalData, this); }); function HBaseElement() {} (HBaseElement.prototype = { checkBlendMode: function () {}, initRendererElement: function () { (this.baseElement = createTag(this.data.tg || 'div')), this.data.hasMask ? ((this.svgElement = createNS('svg')), (this.layerElement = createNS('g')), (this.maskedElement = this.layerElement), this.svgElement.appendChild(this.layerElement), this.baseElement.appendChild(this.svgElement)) : (this.layerElement = this.baseElement), styleDiv(this.baseElement); }, createContainerElements: function () { (this.renderableEffectsManager = new CVEffects()), (this.transformedElement = this.baseElement), (this.maskedElement = this.layerElement), this.data.ln && this.layerElement.setAttribute('id', this.data.ln), this.data.cl && this.layerElement.setAttribute('class', this.data.cl), this.data.bm !== 0 && this.setBlendMode(); }, renderElement: function () { var t = this.transformedElement ? this.transformedElement.style : {}; if (this.finalTransform._matMdf) { var r = this.finalTransform.mat.toCSS(); (t.transform = r), (t.webkitTransform = r); } this.finalTransform._opMdf && (t.opacity = this.finalTransform.mProp.o.v); }, renderFrame: function () { this.data.hd || this.hidden || (this.renderTransform(), this.renderRenderable(), this.renderElement(), this.renderInnerContent(), this._isFirstFrame && (this._isFirstFrame = !1)); }, destroy: function () { (this.layerElement = null), (this.transformedElement = null), this.matteElement && (this.matteElement = null), this.maskManager && (this.maskManager.destroy(), (this.maskManager = null)); }, createRenderableComponents: function () { this.maskManager = new MaskElement(this.data, this, this.globalData); }, addEffects: function () {}, setMatte: function () {} }), (HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement), (HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy), (HBaseElement.prototype.buildElementParenting = BaseRenderer.prototype.buildElementParenting); function HSolidElement(e, t, r) { this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement ], HSolidElement ), (HSolidElement.prototype.createContent = function () { var e; this.data.hasMask ? ((e = createNS('rect')), e.setAttribute('width', this.data.sw), e.setAttribute('height', this.data.sh), e.setAttribute('fill', this.data.sc), this.svgElement.setAttribute('width', this.data.sw), this.svgElement.setAttribute('height', this.data.sh)) : ((e = createTag('div')), (e.style.width = this.data.sw + 'px'), (e.style.height = this.data.sh + 'px'), (e.style.backgroundColor = this.data.sc)), this.layerElement.appendChild(e); }); function HShapeElement(e, t, r) { (this.shapes = []), (this.shapesData = e.shapes), (this.stylesList = []), (this.shapeModifiers = []), (this.itemsData = []), (this.processedElements = []), (this.animatedContents = []), (this.shapesContainer = createNS('g')), this.initElement(e, t, r), (this.prevViewData = []), (this.currentBBox = { x: 999999, y: -999999, h: 0, w: 0 }); } extendPrototype( [ BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement ], HShapeElement ), (HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent), (HShapeElement.prototype.createContent = function () { var e; if (((this.baseElement.style.fontSize = 0), this.data.hasMask)) this.layerElement.appendChild(this.shapesContainer), (e = this.svgElement); else { e = createNS('svg'); var t = this.comp.data ? this.comp.data : this.globalData.compSize; e.setAttribute('width', t.w), e.setAttribute('height', t.h), e.appendChild(this.shapesContainer), this.layerElement.appendChild(e); } this.searchShapes( this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], !0 ), this.filterUniqueShapes(), (this.shapeCont = e); }), (HShapeElement.prototype.getTransformedPoint = function (e, t) { var r, i = e.length; for (r = 0; r < i; r += 1) t = e[r].mProps.v.applyToPointArray(t[0], t[1], 0); return t; }), (HShapeElement.prototype.calculateShapeBoundingBox = function (e, t) { var r = e.sh.v, i = e.transformers, s, n = r._length, a, o, l, c; if (!(n <= 1)) { for (s = 0; s < n - 1; s += 1) (a = this.getTransformedPoint(i, r.v[s])), (o = this.getTransformedPoint(i, r.o[s])), (l = this.getTransformedPoint(i, r.i[s + 1])), (c = this.getTransformedPoint(i, r.v[s + 1])), this.checkBounds(a, o, l, c, t); r.c && ((a = this.getTransformedPoint(i, r.v[s])), (o = this.getTransformedPoint(i, r.o[s])), (l = this.getTransformedPoint(i, r.i[0])), (c = this.getTransformedPoint(i, r.v[0])), this.checkBounds(a, o, l, c, t)); } }), (HShapeElement.prototype.checkBounds = function (e, t, r, i, s) { this.getBoundsOfCurve(e, t, r, i); var n = this.shapeBoundingBox; (s.x = bmMin(n.left, s.x)), (s.xMax = bmMax(n.right, s.xMax)), (s.y = bmMin(n.top, s.y)), (s.yMax = bmMax(n.bottom, s.yMax)); }), (HShapeElement.prototype.shapeBoundingBox = { left: 0, right: 0, top: 0, bottom: 0 }), (HShapeElement.prototype.tempBoundingBox = { x: 0, xMax: 0, y: 0, yMax: 0, width: 0, height: 0 }), (HShapeElement.prototype.getBoundsOfCurve = function (e, t, r, i) { for ( var s = [ [e[0], i[0]], [e[1], i[1]] ], n, a, o, l, c, g, S, p = 0; p < 2; ++p ) (a = 6 * e[p] - 12 * t[p] + 6 * r[p]), (n = -3 * e[p] + 9 * t[p] - 9 * r[p] + 3 * i[p]), (o = 3 * t[p] - 3 * e[p]), (a |= 0), (n |= 0), (o |= 0), (n === 0 && a === 0) || (n === 0 ? ((l = -o / a), l > 0 && l < 1 && s[p].push(this.calculateF(l, e, t, r, i, p))) : ((c = a * a - 4 * o * n), c >= 0 && ((g = (-a + bmSqrt(c)) / (2 * n)), g > 0 && g < 1 && s[p].push(this.calculateF(g, e, t, r, i, p)), (S = (-a - bmSqrt(c)) / (2 * n)), S > 0 && S < 1 && s[p].push(this.calculateF(S, e, t, r, i, p))))); (this.shapeBoundingBox.left = bmMin.apply(null, s[0])), (this.shapeBoundingBox.top = bmMin.apply(null, s[1])), (this.shapeBoundingBox.right = bmMax.apply(null, s[0])), (this.shapeBoundingBox.bottom = bmMax.apply(null, s[1])); }), (HShapeElement.prototype.calculateF = function (e, t, r, i, s, n) { return ( bmPow(1 - e, 3) * t[n] + 3 * bmPow(1 - e, 2) * e * r[n] + 3 * (1 - e) * bmPow(e, 2) * i[n] + bmPow(e, 3) * s[n] ); }), (HShapeElement.prototype.calculateBoundingBox = function (e, t) { var r, i = e.length; for (r = 0; r < i; r += 1) e[r] && e[r].sh ? this.calculateShapeBoundingBox(e[r], t) : e[r] && e[r].it ? this.calculateBoundingBox(e[r].it, t) : e[r] && e[r].style && e[r].w && this.expandStrokeBoundingBox(e[r].w, t); }), (HShapeElement.prototype.expandStrokeBoundingBox = function (e, t) { var r = 0; if (e.keyframes) { for (var i = 0; i < e.keyframes.length; i += 1) { var s = e.keyframes[i].s; s > r && (r = s); } r *= e.mult; } else r = e.v * e.mult; (t.x -= r), (t.xMax += r), (t.y -= r), (t.yMax += r); }), (HShapeElement.prototype.currentBoxContains = function (e) { return ( this.currentBBox.x <= e.x && this.currentBBox.y <= e.y && this.currentBBox.width + this.currentBBox.x >= e.x + e.width && this.currentBBox.height + this.currentBBox.y >= e.y + e.height ); }), (HShapeElement.prototype.renderInnerContent = function () { if ( (this._renderShapeFrame(), !this.hidden && (this._isFirstFrame || this._mdf)) ) { var e = this.tempBoundingBox, t = 999999; if ( ((e.x = t), (e.xMax = -t), (e.y = t), (e.yMax = -t), this.calculateBoundingBox(this.itemsData, e), (e.width = e.xMax < e.x ? 0 : e.xMax - e.x), (e.height = e.yMax < e.y ? 0 : e.yMax - e.y), this.currentBoxContains(e)) ) return; var r = !1; if ( (this.currentBBox.w !== e.width && ((this.currentBBox.w = e.width), this.shapeCont.setAttribute('width', e.width), (r = !0)), this.currentBBox.h !== e.height && ((this.currentBBox.h = e.height), this.shapeCont.setAttribute('height', e.height), (r = !0)), r || this.currentBBox.x !== e.x || this.currentBBox.y !== e.y) ) { (this.currentBBox.w = e.width), (this.currentBBox.h = e.height), (this.currentBBox.x = e.x), (this.currentBBox.y = e.y), this.shapeCont.setAttribute( 'viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h ); var i = this.shapeCont.style, s = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)'; (i.transform = s), (i.webkitTransform = s); } } }); function HTextElement(e, t, r) { (this.textSpans = []), (this.textPaths = []), (this.currentBBox = { x: 999999, y: -999999, h: 0, w: 0 }), (this.renderType = 'svg'), (this.isMasked = !1), this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement ], HTextElement ), (HTextElement.prototype.createContent = function () { if (((this.isMasked = this.checkMasks()), this.isMasked)) { (this.renderType = 'svg'), (this.compW = this.comp.data.w), (this.compH = this.comp.data.h), this.svgElement.setAttribute('width', this.compW), this.svgElement.setAttribute('height', this.compH); var e = createNS('g'); this.maskedElement.appendChild(e), (this.innerElem = e); } else (this.renderType = 'html'), (this.innerElem = this.layerElement); this.checkParenting(); }), (HTextElement.prototype.buildNewText = function () { var e = this.textProperty.currentData; this.renderedLetters = createSizedArray(e.l ? e.l.length : 0); var t = this.innerElem.style, r = e.fc ? this.buildColor(e.fc) : 'rgba(0,0,0,0)'; (t.fill = r), (t.color = r), e.sc && ((t.stroke = this.buildColor(e.sc)), (t.strokeWidth = e.sw + 'px')); var i = this.globalData.fontManager.getFontByName(e.f); if (!this.globalData.fontManager.chars) if ( ((t.fontSize = e.finalSize + 'px'), (t.lineHeight = e.finalSize + 'px'), i.fClass) ) this.innerElem.className = i.fClass; else { t.fontFamily = i.fFamily; var s = e.fWeight, n = e.fStyle; (t.fontStyle = n), (t.fontWeight = s); } var a, o, l = e.l; o = l.length; var c, g, S, p = this.mHelper, P, b = '', y = 0; for (a = 0; a < o; a += 1) { if ( (this.globalData.fontManager.chars ? (this.textPaths[y] ? (c = this.textPaths[y]) : ((c = createNS('path')), c.setAttribute('stroke-linecap', lineCapEnum[1]), c.setAttribute('stroke-linejoin', lineJoinEnum[2]), c.setAttribute('stroke-miterlimit', '4')), this.isMasked || (this.textSpans[y] ? ((g = this.textSpans[y]), (S = g.children[0])) : ((g = createTag('div')), (g.style.lineHeight = 0), (S = createNS('svg')), S.appendChild(c), styleDiv(g)))) : this.isMasked ? (c = this.textPaths[y] ? this.textPaths[y] : createNS('text')) : this.textSpans[y] ? ((g = this.textSpans[y]), (c = this.textPaths[y])) : ((g = createTag('span')), styleDiv(g), (c = createTag('span')), styleDiv(c), g.appendChild(c)), this.globalData.fontManager.chars) ) { var A = this.globalData.fontManager.getCharData( e.finalText[a], i.fStyle, this.globalData.fontManager.getFontByName(e.f).fFamily ), u; if ( (A ? (u = A.data) : (u = null), p.reset(), u && u.shapes && u.shapes.length && ((P = u.shapes[0].it), p.scale(e.finalSize / 100, e.finalSize / 100), (b = this.createPathShape(p, P)), c.setAttribute('d', b)), this.isMasked) ) this.innerElem.appendChild(c); else { if ((this.innerElem.appendChild(g), u && u.shapes)) { document.body.appendChild(S); var f = S.getBBox(); S.setAttribute('width', f.width + 2), S.setAttribute('height', f.height + 2), S.setAttribute( 'viewBox', f.x - 1 + ' ' + (f.y - 1) + ' ' + (f.width + 2) + ' ' + (f.height + 2) ); var m = S.style, d = 'translate(' + (f.x - 1) + 'px,' + (f.y - 1) + 'px)'; (m.transform = d), (m.webkitTransform = d), (l[a].yOffset = f.y - 1); } else S.setAttribute('width', 1), S.setAttribute('height', 1); g.appendChild(S); } } else if ( ((c.textContent = l[a].val), c.setAttributeNS( 'http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve' ), this.isMasked) ) this.innerElem.appendChild(c); else { this.innerElem.appendChild(g); var E = c.style, T = 'translate3d(0,' + -e.finalSize / 1.2 + 'px,0)'; (E.transform = T), (E.webkitTransform = T); } this.isMasked ? (this.textSpans[y] = c) : (this.textSpans[y] = g), (this.textSpans[y].style.display = 'block'), (this.textPaths[y] = c), (y += 1); } for (; y < this.textSpans.length; ) (this.textSpans[y].style.display = 'none'), (y += 1); }), (HTextElement.prototype.renderInnerContent = function () { var e; if (this.data.singleShape) { if (!this._isFirstFrame && !this.lettersChangedFlag) return; if (this.isMasked && this.finalTransform._matMdf) { this.svgElement.setAttribute( 'viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH ), (e = this.svgElement.style); var t = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)'; (e.transform = t), (e.webkitTransform = t); } } if ( (this.textAnimator.getMeasures( this.textProperty.currentData, this.lettersChangedFlag ), !( !this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag )) ) { var r, i, s = 0, n = this.textAnimator.renderedLetters, a = this.textProperty.currentData.l; i = a.length; var o, l, c; for (r = 0; r < i; r += 1) a[r].n ? (s += 1) : ((l = this.textSpans[r]), (c = this.textPaths[r]), (o = n[s]), (s += 1), o._mdf.m && (this.isMasked ? l.setAttribute('transform', o.m) : ((l.style.webkitTransform = o.m), (l.style.transform = o.m))), (l.style.opacity = o.o), o.sw && o._mdf.sw && c.setAttribute('stroke-width', o.sw), o.sc && o._mdf.sc && c.setAttribute('stroke', o.sc), o.fc && o._mdf.fc && (c.setAttribute('fill', o.fc), (c.style.color = o.fc))); if ( this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf) ) { var g = this.innerElem.getBBox(); this.currentBBox.w !== g.width && ((this.currentBBox.w = g.width), this.svgElement.setAttribute('width', g.width)), this.currentBBox.h !== g.height && ((this.currentBBox.h = g.height), this.svgElement.setAttribute('height', g.height)); var S = 1; if ( this.currentBBox.w !== g.width + S * 2 || this.currentBBox.h !== g.height + S * 2 || this.currentBBox.x !== g.x - S || this.currentBBox.y !== g.y - S ) { (this.currentBBox.w = g.width + S * 2), (this.currentBBox.h = g.height + S * 2), (this.currentBBox.x = g.x - S), (this.currentBBox.y = g.y - S), this.svgElement.setAttribute( 'viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h ), (e = this.svgElement.style); var p = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)'; (e.transform = p), (e.webkitTransform = p); } } } }); function HCameraElement(e, t, r) { this.initFrame(), this.initBaseData(e, t, r), this.initHierarchy(); var i = PropertyFactory.getProp; if ( ((this.pe = i(this, e.pe, 0, 0, this)), e.ks.p.s ? ((this.px = i(this, e.ks.p.x, 1, 0, this)), (this.py = i(this, e.ks.p.y, 1, 0, this)), (this.pz = i(this, e.ks.p.z, 1, 0, this))) : (this.p = i(this, e.ks.p, 1, 0, this)), e.ks.a && (this.a = i(this, e.ks.a, 1, 0, this)), e.ks.or.k.length && e.ks.or.k[0].to) ) { var s, n = e.ks.or.k.length; for (s = 0; s < n; s += 1) (e.ks.or.k[s].to = null), (e.ks.or.k[s].ti = null); } (this.or = i(this, e.ks.or, 1, degToRads, this)), (this.or.sh = !0), (this.rx = i(this, e.ks.rx, 0, degToRads, this)), (this.ry = i(this, e.ks.ry, 0, degToRads, this)), (this.rz = i(this, e.ks.rz, 0, degToRads, this)), (this.mat = new Matrix()), (this._prevMat = new Matrix()), (this._isFirstFrame = !0), (this.finalTransform = { mProp: this }); } extendPrototype( [BaseElement, FrameElement, HierarchyElement], HCameraElement ), (HCameraElement.prototype.setup = function () { var e, t = this.comp.threeDElements.length, r, i, s; for (e = 0; e < t; e += 1) if (((r = this.comp.threeDElements[e]), r.type === '3d')) { (i = r.perspectiveElem.style), (s = r.container.style); var n = this.pe.v + 'px', a = '0px 0px 0px', o = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)'; (i.perspective = n), (i.webkitPerspective = n), (s.transformOrigin = a), (s.mozTransformOrigin = a), (s.webkitTransformOrigin = a), (i.transform = o), (i.webkitTransform = o); } }), (HCameraElement.prototype.createElements = function () {}), (HCameraElement.prototype.hide = function () {}), (HCameraElement.prototype.renderFrame = function () { var e = this._isFirstFrame, t, r; if (this.hierarchy) for (r = this.hierarchy.length, t = 0; t < r; t += 1) e = this.hierarchy[t].finalTransform.mProp._mdf || e; if ( e || this.pe._mdf || (this.p && this.p._mdf) || (this.px && (this.px._mdf || this.py._mdf || this.pz._mdf)) || this.rx._mdf || this.ry._mdf || this.rz._mdf || this.or._mdf || (this.a && this.a._mdf) ) { if ((this.mat.reset(), this.hierarchy)) for (r = this.hierarchy.length - 1, t = r; t >= 0; t -= 1) { var i = this.hierarchy[t].finalTransform.mProp; this.mat.translate(-i.p.v[0], -i.p.v[1], i.p.v[2]), this.mat .rotateX(-i.or.v[0]) .rotateY(-i.or.v[1]) .rotateZ(i.or.v[2]), this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v), this.mat.scale(1 / i.s.v[0], 1 / i.s.v[1], 1 / i.s.v[2]), this.mat.translate(i.a.v[0], i.a.v[1], i.a.v[2]); } if ( (this.p ? this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]) : this.mat.translate(-this.px.v, -this.py.v, this.pz.v), this.a) ) { var s; this.p ? (s = [ this.p.v[0] - this.a.v[0], this.p.v[1] - this.a.v[1], this.p.v[2] - this.a.v[2] ]) : (s = [ this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2] ]); var n = Math.sqrt( Math.pow(s[0], 2) + Math.pow(s[1], 2) + Math.pow(s[2], 2) ), a = [s[0] / n, s[1] / n, s[2] / n], o = Math.sqrt(a[2] * a[2] + a[0] * a[0]), l = Math.atan2(a[1], o), c = Math.atan2(a[0], -a[2]); this.mat.rotateY(c).rotateX(-l); } this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v), this.mat .rotateX(-this.or.v[0]) .rotateY(-this.or.v[1]) .rotateZ(this.or.v[2]), this.mat.translate( this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0 ), this.mat.translate(0, 0, this.pe.v); var g = !this._prevMat.equals(this.mat); if ((g || this.pe._mdf) && this.comp.threeDElements) { r = this.comp.threeDElements.length; var S, p, P; for (t = 0; t < r; t += 1) if (((S = this.comp.threeDElements[t]), S.type === '3d')) { if (g) { var b = this.mat.toCSS(); (P = S.container.style), (P.transform = b), (P.webkitTransform = b); } this.pe._mdf && ((p = S.perspectiveElem.style), (p.perspective = this.pe.v + 'px'), (p.webkitPerspective = this.pe.v + 'px')); } this.mat.clone(this._prevMat); } } this._isFirstFrame = !1; }), (HCameraElement.prototype.prepareFrame = function (e) { this.prepareProperties(e, !0); }), (HCameraElement.prototype.destroy = function () {}), (HCameraElement.prototype.getBaseElement = function () { return null; }); function HImageElement(e, t, r) { (this.assetData = t.getAssetData(e.refId)), this.initElement(e, t, r); } extendPrototype( [ BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement ], HImageElement ), (HImageElement.prototype.createContent = function () { var e = this.globalData.getAssetsPath(this.assetData), t = new Image(); this.data.hasMask ? ((this.imageElem = createNS('image')), this.imageElem.setAttribute('width', this.assetData.w + 'px'), this.imageElem.setAttribute('height', this.assetData.h + 'px'), this.imageElem.setAttributeNS( 'http://www.w3.org/1999/xlink', 'href', e ), this.layerElement.appendChild(this.imageElem), this.baseElement.setAttribute('width', this.assetData.w), this.baseElement.setAttribute('height', this.assetData.h)) : this.layerElement.appendChild(t), (t.crossOrigin = 'anonymous'), (t.src = e), this.data.ln && this.baseElement.setAttribute('id', this.data.ln); }); function HybridRendererBase(e, t) { (this.animationItem = e), (this.layers = null), (this.renderedFrame = -1), (this.renderConfig = { className: (t && t.className) || '', imagePreserveAspectRatio: (t && t.imagePreserveAspectRatio) || 'xMidYMid slice', hideOnTransparent: !(t && t.hideOnTransparent === !1), filterSize: { width: (t && t.filterSize && t.filterSize.width) || '400%', height: (t && t.filterSize && t.filterSize.height) || '400%', x: (t && t.filterSize && t.filterSize.x) || '-100%', y: (t && t.filterSize && t.filterSize.y) || '-100%' } }), (this.globalData = { _mdf: !1, frameNum: -1, renderConfig: this.renderConfig }), (this.pendingElements = []), (this.elements = []), (this.threeDElements = []), (this.destroyed = !1), (this.camera = null), (this.supports3d = !0), (this.rendererType = 'html'); } extendPrototype([BaseRenderer], HybridRendererBase), (HybridRendererBase.prototype.buildItem = SVGRenderer.prototype.buildItem), (HybridRendererBase.prototype.checkPendingElements = function () { for (; this.pendingElements.length; ) { var e = this.pendingElements.pop(); e.checkParenting(); } }), (HybridRendererBase.prototype.appendElementInPos = function (e, t) { var r = e.getBaseElement(); if (r) { var i = this.layers[t]; if (!i.ddd || !this.supports3d) if (this.threeDElements) this.addTo3dContainer(r, t); else { for (var s = 0, n, a, o; s < t; ) this.elements[s] && this.elements[s] !== !0 && this.elements[s].getBaseElement && ((a = this.elements[s]), (o = this.layers[s].ddd ? this.getThreeDContainerByPos(s) : a.getBaseElement()), (n = o || n)), (s += 1); n ? (!i.ddd || !this.supports3d) && this.layerElement.insertBefore(r, n) : (!i.ddd || !this.supports3d) && this.layerElement.appendChild(r); } else this.addTo3dContainer(r, t); } }), (HybridRendererBase.prototype.createShape = function (e) { return this.supports3d ? new HShapeElement(e, this.globalData, this) : new SVGShapeElement(e, this.globalData, this); }), (HybridRendererBase.prototype.createText = function (e) { return this.supports3d ? new HTextElement(e, this.globalData, this) : new SVGTextLottieElement(e, this.globalData, this); }), (HybridRendererBase.prototype.createCamera = function (e) { return ( (this.camera = new HCameraElement(e, this.globalData, this)), this.camera ); }), (HybridRendererBase.prototype.createImage = function (e) { return this.supports3d ? new HImageElement(e, this.globalData, this) : new IImageElement(e, this.globalData, this); }), (HybridRendererBase.prototype.createSolid = function (e) { return this.supports3d ? new HSolidElement(e, this.globalData, this) : new ISolidElement(e, this.globalData, this); }), (HybridRendererBase.prototype.createNull = SVGRenderer.prototype.createNull), (HybridRendererBase.prototype.getThreeDContainerByPos = function (e) { for (var t = 0, r = this.threeDElements.length; t < r; ) { if ( this.threeDElements[t].startPos <= e && this.threeDElements[t].endPos >= e ) return this.threeDElements[t].perspectiveElem; t += 1; } return null; }), (HybridRendererBase.prototype.createThreeDContainer = function (e, t) { var r = createTag('div'), i, s; styleDiv(r); var n = createTag('div'); if ((styleDiv(n), t === '3d')) { (i = r.style), (i.width = this.globalData.compSize.w + 'px'), (i.height = this.globalData.compSize.h + 'px'); var a = '50% 50%'; (i.webkitTransformOrigin = a), (i.mozTransformOrigin = a), (i.transformOrigin = a), (s = n.style); var o = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)'; (s.transform = o), (s.webkitTransform = o); } r.appendChild(n); var l = { container: n, perspectiveElem: r, startPos: e, endPos: e, type: t }; return this.threeDElements.push(l), l; }), (HybridRendererBase.prototype.build3dContainers = function () { var e, t = this.layers.length, r, i = ''; for (e = 0; e < t; e += 1) this.layers[e].ddd && this.layers[e].ty !== 3 ? (i !== '3d' && ((i = '3d'), (r = this.createThreeDContainer(e, '3d'))), (r.endPos = Math.max(r.endPos, e))) : (i !== '2d' && ((i = '2d'), (r = this.createThreeDContainer(e, '2d'))), (r.endPos = Math.max(r.endPos, e))); for (t = this.threeDElements.length, e = t - 1; e >= 0; e -= 1) this.resizerElem.appendChild( this.threeDElements[e].perspectiveElem ); }), (HybridRendererBase.prototype.addTo3dContainer = function (e, t) { for (var r = 0, i = this.threeDElements.length; r < i; ) { if (t <= this.threeDElements[r].endPos) { for (var s = this.threeDElements[r].startPos, n; s < t; ) this.elements[s] && this.elements[s].getBaseElement && (n = this.elements[s].getBaseElement()), (s += 1); n ? this.threeDElements[r].container.insertBefore(e, n) : this.threeDElements[r].container.appendChild(e); break; } r += 1; } }), (HybridRendererBase.prototype.configAnimation = function (e) { var t = createTag('div'), r = this.animationItem.wrapper, i = t.style; (i.width = e.w + 'px'), (i.height = e.h + 'px'), (this.resizerElem = t), styleDiv(t), (i.transformStyle = 'flat'), (i.mozTransformStyle = 'flat'), (i.webkitTransformStyle = 'flat'), this.renderConfig.className && t.setAttribute('class', this.renderConfig.className), r.appendChild(t), (i.overflow = 'hidden'); var s = createNS('svg'); s.setAttribute('width', '1'), s.setAttribute('height', '1'), styleDiv(s), this.resizerElem.appendChild(s); var n = createNS('defs'); s.appendChild(n), (this.data = e), this.setupGlobalData(e, s), (this.globalData.defs = n), (this.layers = e.layers), (this.layerElement = this.resizerElem), this.build3dContainers(), this.updateContainerSize(); }), (HybridRendererBase.prototype.destroy = function () { this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ''), (this.animationItem.container = null), (this.globalData.defs = null); var e, t = this.layers ? this.layers.length : 0; for (e = 0; e < t; e += 1) this.elements[e] && this.elements[e].destroy && this.elements[e].destroy(); (this.elements.length = 0), (this.destroyed = !0), (this.animationItem = null); }), (HybridRendererBase.prototype.updateContainerSize = function () { var e = this.animationItem.wrapper.offsetWidth, t = this.animationItem.wrapper.offsetHeight, r = e / t, i = this.globalData.compSize.w / this.globalData.compSize.h, s, n, a, o; i > r ? ((s = e / this.globalData.compSize.w), (n = e / this.globalData.compSize.w), (a = 0), (o = (t - this.globalData.compSize.h * (e / this.globalData.compSize.w)) / 2)) : ((s = t / this.globalData.compSize.h), (n = t / this.globalData.compSize.h), (a = (e - this.globalData.compSize.w * (t / this.globalData.compSize.h)) / 2), (o = 0)); var l = this.resizerElem.style; (l.webkitTransform = 'matrix3d(' + s + ',0,0,0,0,' + n + ',0,0,0,0,1,0,' + a + ',' + o + ',0,1)'), (l.transform = l.webkitTransform); }), (HybridRendererBase.prototype.renderFrame = SVGRenderer.prototype.renderFrame), (HybridRendererBase.prototype.hide = function () { this.resizerElem.style.display = 'none'; }), (HybridRendererBase.prototype.show = function () { this.resizerElem.style.display = 'block'; }), (HybridRendererBase.prototype.initItems = function () { if ((this.buildAllItems(), this.camera)) this.camera.setup(); else { var e = this.globalData.compSize.w, t = this.globalData.compSize.h, r, i = this.threeDElements.length; for (r = 0; r < i; r += 1) { var s = this.threeDElements[r].perspectiveElem.style; (s.webkitPerspective = Math.sqrt(Math.pow(e, 2) + Math.pow(t, 2)) + 'px'), (s.perspective = s.webkitPerspective); } } }), (HybridRendererBase.prototype.searchExtraCompositions = function (e) { var t, r = e.length, i = createTag('div'); for (t = 0; t < r; t += 1) if (e[t].xt) { var s = this.createComp(e[t], i, this.globalData.comp, null); s.initExpressions(), this.globalData.projectInterface.registerComposition(s); } }); function HCompElement(e, t, r) { (this.layers = e.layers), (this.supports3d = !e.hasMask), (this.completeLayers = !1), (this.pendingElements = []), (this.elements = this.layers ? createSizedArray(this.layers.length) : []), this.initElement(e, t, r), (this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this) : { _placeholder: !0 }); } extendPrototype( [HybridRendererBase, ICompElement, HBaseElement], HCompElement ), (HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements), (HCompElement.prototype.createContainerElements = function () { this._createBaseContainerElements(), this.data.hasMask ? (this.svgElement.setAttribute('width', this.data.w), this.svgElement.setAttribute('height', this.data.h), (this.transformedElement = this.baseElement)) : (this.transformedElement = this.layerElement); }), (HCompElement.prototype.addTo3dContainer = function (e, t) { for (var r = 0, i; r < t; ) this.elements[r] && this.elements[r].getBaseElement && (i = this.elements[r].getBaseElement()), (r += 1); i ? this.layerElement.insertBefore(e, i) : this.layerElement.appendChild(e); }), (HCompElement.prototype.createComp = function (e) { return this.supports3d ? new HCompElement(e, this.globalData, this) : new SVGCompElement(e, this.globalData, this); }); function HybridRenderer(e, t) { (this.animationItem = e), (this.layers = null), (this.renderedFrame = -1), (this.renderConfig = { className: (t && t.className) || '', imagePreserveAspectRatio: (t && t.imagePreserveAspectRatio) || 'xMidYMid slice', hideOnTransparent: !(t && t.hideOnTransparent === !1), filterSize: { width: (t && t.filterSize && t.filterSize.width) || '400%', height: (t && t.filterSize && t.filterSize.height) || '400%', x: (t && t.filterSize && t.filterSize.x) || '-100%', y: (t && t.filterSize && t.filterSize.y) || '-100%' }, runExpressions: !t || t.runExpressions === void 0 || t.runExpressions }), (this.globalData = { _mdf: !1, frameNum: -1, renderConfig: this.renderConfig }), (this.pendingElements = []), (this.elements = []), (this.threeDElements = []), (this.destroyed = !1), (this.camera = null), (this.supports3d = !0), (this.rendererType = 'html'); } extendPrototype([HybridRendererBase], HybridRenderer), (HybridRenderer.prototype.createComp = function (e) { return this.supports3d ? new HCompElement(e, this.globalData, this) : new SVGCompElement(e, this.globalData, this); }); var CompExpressionInterface = (function () { return function (e) { function t(r) { for (var i = 0, s = e.layers.length; i < s; ) { if (e.layers[i].nm === r || e.layers[i].ind === r) return e.elements[i].layerInterface; i += 1; } return null; } return ( Object.defineProperty(t, '_name', { value: e.data.nm }), (t.layer = t), (t.pixelAspect = 1), (t.height = e.data.h || e.globalData.compSize.h), (t.width = e.data.w || e.globalData.compSize.w), (t.pixelAspect = 1), (t.frameDuration = 1 / e.globalData.frameRate), (t.displayStartTime = 0), (t.numLayers = e.layers.length), t ); }; })(), Expressions = (function () { var e = {}; e.initExpressions = t; function t(r) { var i = 0, s = []; function n() { i += 1; } function a() { (i -= 1), i === 0 && l(); } function o(c) { s.indexOf(c) === -1 && s.push(c); } function l() { var c, g = s.length; for (c = 0; c < g; c += 1) s[c].release(); s.length = 0; } (r.renderer.compInterface = CompExpressionInterface(r.renderer)), r.renderer.globalData.projectInterface.registerComposition( r.renderer ), (r.renderer.globalData.pushExpression = n), (r.renderer.globalData.popExpression = a), (r.renderer.globalData.registerExpressionProperty = o); } return e; })(), MaskManagerInterface = (function () { function e(r, i) { (this._mask = r), (this._data = i); } Object.defineProperty(e.prototype, 'maskPath', { get: function () { return ( this._mask.prop.k && this._mask.prop.getValue(), this._mask.prop ); } }), Object.defineProperty(e.prototype, 'maskOpacity', { get: function () { return ( this._mask.op.k && this._mask.op.getValue(), this._mask.op.v * 100 ); } }); var t = function (i) { var s = createSizedArray(i.viewData.length), n, a = i.viewData.length; for (n = 0; n < a; n += 1) s[n] = new e(i.viewData[n], i.masksProperties[n]); var o = function (c) { for (n = 0; n < a; ) { if (i.masksProperties[n].nm === c) return s[n]; n += 1; } return null; }; return o; }; return t; })(), ExpressionPropertyInterface = (function () { var e = { pv: 0, v: 0, mult: 1 }, t = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 }; function r(a, o, l) { Object.defineProperty(a, 'velocity', { get: function () { return o.getVelocityAtTime(o.comp.currentFrame); } }), (a.numKeys = o.keyframes ? o.keyframes.length : 0), (a.key = function (c) { if (!a.numKeys) return 0; var g = ''; 's' in o.keyframes[c - 1] ? (g = o.keyframes[c - 1].s) : 'e' in o.keyframes[c - 2] ? (g = o.keyframes[c - 2].e) : (g = o.keyframes[c - 2].s); var S = l === 'unidimensional' ? new Number(g) : Object.assign({}, g); return ( (S.time = o.keyframes[c - 1].t / o.elem.comp.globalData.frameRate), (S.value = l === 'unidimensional' ? g[0] : g), S ); }), (a.valueAtTime = o.getValueAtTime), (a.speedAtTime = o.getSpeedAtTime), (a.velocityAtTime = o.getVelocityAtTime), (a.propertyGroup = o.propertyGroup); } function i(a) { (!a || !('pv' in a)) && (a = e); var o = 1 / a.mult, l = a.pv * o, c = new Number(l); return ( (c.value = l), r(c, a, 'unidimensional'), function () { return ( a.k && a.getValue(), (l = a.v * o), c.value !== l && ((c = new Number(l)), (c.value = l), r(c, a, 'unidimensional')), c ); } ); } function s(a) { (!a || !('pv' in a)) && (a = t); var o = 1 / a.mult, l = (a.data && a.data.l) || a.pv.length, c = createTypedArray('float32', l), g = createTypedArray('float32', l); return ( (c.value = g), r(c, a, 'multidimensional'), function () { a.k && a.getValue(); for (var S = 0; S < l; S += 1) (g[S] = a.v[S] * o), (c[S] = g[S]); return c; } ); } function n() { return e; } return function (a) { return a ? (a.propType === 'unidimensional' ? i(a) : s(a)) : n; }; })(), TransformExpressionInterface = (function () { return function (e) { function t(a) { switch (a) { case 'scale': case 'Scale': case 'ADBE Scale': case 6: return t.scale; case 'rotation': case 'Rotation': case 'ADBE Rotation': case 'ADBE Rotate Z': case 10: return t.rotation; case 'ADBE Rotate X': return t.xRotation; case 'ADBE Rotate Y': return t.yRotation; case 'position': case 'Position': case 'ADBE Position': case 2: return t.position; case 'ADBE Position_0': return t.xPosition; case 'ADBE Position_1': return t.yPosition; case 'ADBE Position_2': return t.zPosition; case 'anchorPoint': case 'AnchorPoint': case 'Anchor Point': case 'ADBE AnchorPoint': case 1: return t.anchorPoint; case 'opacity': case 'Opacity': case 11: return t.opacity; default: return null; } } Object.defineProperty(t, 'rotation', { get: ExpressionPropertyInterface(e.r || e.rz) }), Object.defineProperty(t, 'zRotation', { get: ExpressionPropertyInterface(e.rz || e.r) }), Object.defineProperty(t, 'xRotation', { get: ExpressionPropertyInterface(e.rx) }), Object.defineProperty(t, 'yRotation', { get: ExpressionPropertyInterface(e.ry) }), Object.defineProperty(t, 'scale', { get: ExpressionPropertyInterface(e.s) }); var r, i, s, n; return ( e.p ? (n = ExpressionPropertyInterface(e.p)) : ((r = ExpressionPropertyInterface(e.px)), (i = ExpressionPropertyInterface(e.py)), e.pz && (s = ExpressionPropertyInterface(e.pz))), Object.defineProperty(t, 'position', { get: function () { return e.p ? n() : [r(), i(), s ? s() : 0]; } }), Object.defineProperty(t, 'xPosition', { get: ExpressionPropertyInterface(e.px) }), Object.defineProperty(t, 'yPosition', { get: ExpressionPropertyInterface(e.py) }), Object.defineProperty(t, 'zPosition', { get: ExpressionPropertyInterface(e.pz) }), Object.defineProperty(t, 'anchorPoint', { get: ExpressionPropertyInterface(e.a) }), Object.defineProperty(t, 'opacity', { get: ExpressionPropertyInterface(e.o) }), Object.defineProperty(t, 'skew', { get: ExpressionPropertyInterface(e.sk) }), Object.defineProperty(t, 'skewAxis', { get: ExpressionPropertyInterface(e.sa) }), Object.defineProperty(t, 'orientation', { get: ExpressionPropertyInterface(e.or) }), t ); }; })(), LayerExpressionInterface = (function () { function e(c) { var g = new Matrix(); if (c !== void 0) { var S = this._elem.finalTransform.mProp.getValueAtTime(c); S.clone(g); } else { var p = this._elem.finalTransform.mProp; p.applyToMatrix(g); } return g; } function t(c, g) { var S = this.getMatrix(g); return ( (S.props[12] = 0), (S.props[13] = 0), (S.props[14] = 0), this.applyPoint(S, c) ); } function r(c, g) { var S = this.getMatrix(g); return this.applyPoint(S, c); } function i(c, g) { var S = this.getMatrix(g); return ( (S.props[12] = 0), (S.props[13] = 0), (S.props[14] = 0), this.invertPoint(S, c) ); } function s(c, g) { var S = this.getMatrix(g); return this.invertPoint(S, c); } function n(c, g) { if (this._elem.hierarchy && this._elem.hierarchy.length) { var S, p = this._elem.hierarchy.length; for (S = 0; S < p; S += 1) this._elem.hierarchy[S].finalTransform.mProp.applyToMatrix(c); } return c.applyToPointArray(g[0], g[1], g[2] || 0); } function a(c, g) { if (this._elem.hierarchy && this._elem.hierarchy.length) { var S, p = this._elem.hierarchy.length; for (S = 0; S < p; S += 1) this._elem.hierarchy[S].finalTransform.mProp.applyToMatrix(c); } return c.inversePoint(g); } function o(c) { var g = new Matrix(); if ( (g.reset(), this._elem.finalTransform.mProp.applyToMatrix(g), this._elem.hierarchy && this._elem.hierarchy.length) ) { var S, p = this._elem.hierarchy.length; for (S = 0; S < p; S += 1) this._elem.hierarchy[S].finalTransform.mProp.applyToMatrix(g); return g.inversePoint(c); } return g.inversePoint(c); } function l() { return [1, 1, 1, 1]; } return function (c) { var g; function S(y) { P.mask = new MaskManagerInterface(y, c); } function p(y) { P.effect = y; } function P(y) { switch (y) { case 'ADBE Root Vectors Group': case 'Contents': case 2: return P.shapeInterface; case 1: case 6: case 'Transform': case 'transform': case 'ADBE Transform Group': return g; case 4: case 'ADBE Effect Parade': case 'effects': case 'Effects': return P.effect; case 'ADBE Text Properties': return P.textInterface; default: return null; } } (P.getMatrix = e), (P.invertPoint = a), (P.applyPoint = n), (P.toWorld = r), (P.toWorldVec = t), (P.fromWorld = s), (P.fromWorldVec = i), (P.toComp = r), (P.fromComp = o), (P.sampleImage = l), (P.sourceRectAtTime = c.sourceRectAtTime.bind(c)), (P._elem = c), (g = TransformExpressionInterface(c.finalTransform.mProp)); var b = getDescriptor(g, 'anchorPoint'); return ( Object.defineProperties(P, { hasParent: { get: function () { return c.hierarchy.length; } }, parent: { get: function () { return c.hierarchy[0].layerInterface; } }, rotation: getDescriptor(g, 'rotation'), scale: getDescriptor(g, 'scale'), position: getDescriptor(g, 'position'), opacity: getDescriptor(g, 'opacity'), anchorPoint: b, anchor_point: b, transform: { get: function () { return g; } }, active: { get: function () { return c.isInRange; } } }), (P.startTime = c.data.st), (P.index = c.data.ind), (P.source = c.data.refId), (P.height = c.data.ty === 0 ? c.data.h : 100), (P.width = c.data.ty === 0 ? c.data.w : 100), (P.inPoint = c.data.ip / c.comp.globalData.frameRate), (P.outPoint = c.data.op / c.comp.globalData.frameRate), (P._name = c.data.nm), (P.registerMaskInterface = S), (P.registerEffectsInterface = p), P ); }; })(), propertyGroupFactory = (function () { return function (e, t) { return function (r) { return (r = r === void 0 ? 1 : r), r <= 0 ? e : t(r - 1); }; }; })(), PropertyInterface = (function () { return function (e, t) { var r = { _name: e }; function i(s) { return (s = s === void 0 ? 1 : s), s <= 0 ? r : t(s - 1); } return i; }; })(), EffectsExpressionInterface = (function () { var e = { createEffectsInterface: t }; function t(s, n) { if (s.effectsManager) { var a = [], o = s.data.ef, l, c = s.effectsManager.effectElements.length; for (l = 0; l < c; l += 1) a.push(r(o[l], s.effectsManager.effectElements[l], n, s)); var g = s.data.ef || [], S = function (P) { for (l = 0, c = g.length; l < c; ) { if (P === g[l].nm || P === g[l].mn || P === g[l].ix) return a[l]; l += 1; } return null; }; return ( Object.defineProperty(S, 'numProperties', { get: function () { return g.length; } }), S ); } return null; } function r(s, n, a, o) { function l(P) { for (var b = s.ef, y = 0, A = b.length; y < A; ) { if (P === b[y].nm || P === b[y].mn || P === b[y].ix) return b[y].ty === 5 ? g[y] : g[y](); y += 1; } throw new Error(); } var c = propertyGroupFactory(l, a), g = [], S, p = s.ef.length; for (S = 0; S < p; S += 1) s.ef[S].ty === 5 ? g.push( r( s.ef[S], n.effectElements[S], n.effectElements[S].propertyGroup, o ) ) : g.push(i(n.effectElements[S], s.ef[S].ty, o, c)); return ( s.mn === 'ADBE Color Control' && Object.defineProperty(l, 'color', { get: function () { return g[0](); } }), Object.defineProperties(l, { numProperties: { get: function () { return s.np; } }, _name: { value: s.nm }, propertyGroup: { value: c } }), (l.enabled = s.en !== 0), (l.active = l.enabled), l ); } function i(s, n, a, o) { var l = ExpressionPropertyInterface(s.p); function c() { return n === 10 ? a.comp.compInterface(s.p.v) : l(); } return ( s.p.setGroupProperty && s.p.setGroupProperty(PropertyInterface('', o)), c ); } return e; })(), ShapePathInterface = (function () { return function (t, r, i) { var s = r.sh; function n(o) { return o === 'Shape' || o === 'shape' || o === 'Path' || o === 'path' || o === 'ADBE Vector Shape' || o === 2 ? n.path : null; } var a = propertyGroupFactory(n, i); return ( s.setGroupProperty(PropertyInterface('Path', a)), Object.defineProperties(n, { path: { get: function () { return s.k && s.getValue(), s; } }, shape: { get: function () { return s.k && s.getValue(), s; } }, _name: { value: t.nm }, ix: { value: t.ix }, propertyIndex: { value: t.ix }, mn: { value: t.mn }, propertyGroup: { value: i } }), n ); }; })(), ShapeExpressionInterface = (function () { function e(b, y, A) { var u = [], f, m = b ? b.length : 0; for (f = 0; f < m; f += 1) b[f].ty === 'gr' ? u.push(r(b[f], y[f], A)) : b[f].ty === 'fl' ? u.push(i(b[f], y[f], A)) : b[f].ty === 'st' ? u.push(a(b[f], y[f], A)) : b[f].ty === 'tm' ? u.push(o(b[f], y[f], A)) : b[f].ty === 'tr' || (b[f].ty === 'el' ? u.push(c(b[f], y[f], A)) : b[f].ty === 'sr' ? u.push(g(b[f], y[f], A)) : b[f].ty === 'sh' ? u.push(ShapePathInterface(b[f], y[f], A)) : b[f].ty === 'rc' ? u.push(S(b[f], y[f], A)) : b[f].ty === 'rd' ? u.push(p(b[f], y[f], A)) : b[f].ty === 'rp' ? u.push(P(b[f], y[f], A)) : b[f].ty === 'gf' ? u.push(s(b[f], y[f], A)) : u.push(n(b[f], y[f]))); return u; } function t(b, y, A) { var u, f = function (E) { for (var T = 0, x = u.length; T < x; ) { if ( u[T]._name === E || u[T].mn === E || u[T].propertyIndex === E || u[T].ix === E || u[T].ind === E ) return u[T]; T += 1; } return typeof E == 'number' ? u[E - 1] : null; }; (f.propertyGroup = propertyGroupFactory(f, A)), (u = e(b.it, y.it, f.propertyGroup)), (f.numProperties = u.length); var m = l( b.it[b.it.length - 1], y.it[y.it.length - 1], f.propertyGroup ); return ( (f.transform = m), (f.propertyIndex = b.cix), (f._name = b.nm), f ); } function r(b, y, A) { var u = function (E) { switch (E) { case 'ADBE Vectors Group': case 'Contents': case 2: return u.content; default: return u.transform; } }; u.propertyGroup = propertyGroupFactory(u, A); var f = t(b, y, u.propertyGroup), m = l( b.it[b.it.length - 1], y.it[y.it.length - 1], u.propertyGroup ); return ( (u.content = f), (u.transform = m), Object.defineProperty(u, '_name', { get: function () { return b.nm; } }), (u.numProperties = b.np), (u.propertyIndex = b.ix), (u.nm = b.nm), (u.mn = b.mn), u ); } function i(b, y, A) { function u(f) { return f === 'Color' || f === 'color' ? u.color : f === 'Opacity' || f === 'opacity' ? u.opacity : null; } return ( Object.defineProperties(u, { color: { get: ExpressionPropertyInterface(y.c) }, opacity: { get: ExpressionPropertyInterface(y.o) }, _name: { value: b.nm }, mn: { value: b.mn } }), y.c.setGroupProperty(PropertyInterface('Color', A)), y.o.setGroupProperty(PropertyInterface('Opacity', A)), u ); } function s(b, y, A) { function u(f) { return f === 'Start Point' || f === 'start point' ? u.startPoint : f === 'End Point' || f === 'end point' ? u.endPoint : f === 'Opacity' || f === 'opacity' ? u.opacity : null; } return ( Object.defineProperties(u, { startPoint: { get: ExpressionPropertyInterface(y.s) }, endPoint: { get: ExpressionPropertyInterface(y.e) }, opacity: { get: ExpressionPropertyInterface(y.o) }, type: { get: function () { return 'a'; } }, _name: { value: b.nm }, mn: { value: b.mn } }), y.s.setGroupProperty(PropertyInterface('Start Point', A)), y.e.setGroupProperty(PropertyInterface('End Point', A)), y.o.setGroupProperty(PropertyInterface('Opacity', A)), u ); } function n() { function b() { return null; } return b; } function a(b, y, A) { var u = propertyGroupFactory(x, A), f = propertyGroupFactory(T, u); function m(_) { Object.defineProperty(T, b.d[_].nm, { get: ExpressionPropertyInterface(y.d.dataProps[_].p) }); } var d, E = b.d ? b.d.length : 0, T = {}; for (d = 0; d < E; d += 1) m(d), y.d.dataProps[d].p.setGroupProperty(f); function x(_) { return _ === 'Color' || _ === 'color' ? x.color : _ === 'Opacity' || _ === 'opacity' ? x.opacity : _ === 'Stroke Width' || _ === 'stroke width' ? x.strokeWidth : null; } return ( Object.defineProperties(x, { color: { get: ExpressionPropertyInterface(y.c) }, opacity: { get: ExpressionPropertyInterface(y.o) }, strokeWidth: { get: ExpressionPropertyInterface(y.w) }, dash: { get: function () { return T; } }, _name: { value: b.nm }, mn: { value: b.mn } }), y.c.setGroupProperty(PropertyInterface('Color', u)), y.o.setGroupProperty(PropertyInterface('Opacity', u)), y.w.setGroupProperty(PropertyInterface('Stroke Width', u)), x ); } function o(b, y, A) { function u(m) { return m === b.e.ix || m === 'End' || m === 'end' ? u.end : m === b.s.ix ? u.start : m === b.o.ix ? u.offset : null; } var f = propertyGroupFactory(u, A); return ( (u.propertyIndex = b.ix), y.s.setGroupProperty(PropertyInterface('Start', f)), y.e.setGroupProperty(PropertyInterface('End', f)), y.o.setGroupProperty(PropertyInterface('Offset', f)), (u.propertyIndex = b.ix), (u.propertyGroup = A), Object.defineProperties(u, { start: { get: ExpressionPropertyInterface(y.s) }, end: { get: ExpressionPropertyInterface(y.e) }, offset: { get: ExpressionPropertyInterface(y.o) }, _name: { value: b.nm } }), (u.mn = b.mn), u ); } function l(b, y, A) { function u(m) { return b.a.ix === m || m === 'Anchor Point' ? u.anchorPoint : b.o.ix === m || m === 'Opacity' ? u.opacity : b.p.ix === m || m === 'Position' ? u.position : b.r.ix === m || m === 'Rotation' || m === 'ADBE Vector Rotation' ? u.rotation : b.s.ix === m || m === 'Scale' ? u.scale : (b.sk && b.sk.ix === m) || m === 'Skew' ? u.skew : (b.sa && b.sa.ix === m) || m === 'Skew Axis' ? u.skewAxis : null; } var f = propertyGroupFactory(u, A); return ( y.transform.mProps.o.setGroupProperty( PropertyInterface('Opacity', f) ), y.transform.mProps.p.setGroupProperty( PropertyInterface('Position', f) ), y.transform.mProps.a.setGroupProperty( PropertyInterface('Anchor Point', f) ), y.transform.mProps.s.setGroupProperty( PropertyInterface('Scale', f) ), y.transform.mProps.r.setGroupProperty( PropertyInterface('Rotation', f) ), y.transform.mProps.sk && (y.transform.mProps.sk.setGroupProperty( PropertyInterface('Skew', f) ), y.transform.mProps.sa.setGroupProperty( PropertyInterface('Skew Angle', f) )), y.transform.op.setGroupProperty(PropertyInterface('Opacity', f)), Object.defineProperties(u, { opacity: { get: ExpressionPropertyInterface(y.transform.mProps.o) }, position: { get: ExpressionPropertyInterface(y.transform.mProps.p) }, anchorPoint: { get: ExpressionPropertyInterface(y.transform.mProps.a) }, scale: { get: ExpressionPropertyInterface(y.transform.mProps.s) }, rotation: { get: ExpressionPropertyInterface(y.transform.mProps.r) }, skew: { get: ExpressionPropertyInterface(y.transform.mProps.sk) }, skewAxis: { get: ExpressionPropertyInterface(y.transform.mProps.sa) }, _name: { value: b.nm } }), (u.ty = 'tr'), (u.mn = b.mn), (u.propertyGroup = A), u ); } function c(b, y, A) { function u(d) { return b.p.ix === d ? u.position : b.s.ix === d ? u.size : null; } var f = propertyGroupFactory(u, A); u.propertyIndex = b.ix; var m = y.sh.ty === 'tm' ? y.sh.prop : y.sh; return ( m.s.setGroupProperty(PropertyInterface('Size', f)), m.p.setGroupProperty(PropertyInterface('Position', f)), Object.defineProperties(u, { size: { get: ExpressionPropertyInterface(m.s) }, position: { get: ExpressionPropertyInterface(m.p) }, _name: { value: b.nm } }), (u.mn = b.mn), u ); } function g(b, y, A) { function u(d) { return b.p.ix === d ? u.position : b.r.ix === d ? u.rotation : b.pt.ix === d ? u.points : b.or.ix === d || d === 'ADBE Vector Star Outer Radius' ? u.outerRadius : b.os.ix === d ? u.outerRoundness : b.ir && (b.ir.ix === d || d === 'ADBE Vector Star Inner Radius') ? u.innerRadius : b.is && b.is.ix === d ? u.innerRoundness : null; } var f = propertyGroupFactory(u, A), m = y.sh.ty === 'tm' ? y.sh.prop : y.sh; return ( (u.propertyIndex = b.ix), m.or.setGroupProperty(PropertyInterface('Outer Radius', f)), m.os.setGroupProperty(PropertyInterface('Outer Roundness', f)), m.pt.setGroupProperty(PropertyInterface('Points', f)), m.p.setGroupProperty(PropertyInterface('Position', f)), m.r.setGroupProperty(PropertyInterface('Rotation', f)), b.ir && (m.ir.setGroupProperty(PropertyInterface('Inner Radius', f)), m.is.setGroupProperty(PropertyInterface('Inner Roundness', f))), Object.defineProperties(u, { position: { get: ExpressionPropertyInterface(m.p) }, rotation: { get: ExpressionPropertyInterface(m.r) }, points: { get: ExpressionPropertyInterface(m.pt) }, outerRadius: { get: ExpressionPropertyInterface(m.or) }, outerRoundness: { get: ExpressionPropertyInterface(m.os) }, innerRadius: { get: ExpressionPropertyInterface(m.ir) }, innerRoundness: { get: ExpressionPropertyInterface(m.is) }, _name: { value: b.nm } }), (u.mn = b.mn), u ); } function S(b, y, A) { function u(d) { return b.p.ix === d ? u.position : b.r.ix === d ? u.roundness : b.s.ix === d || d === 'Size' || d === 'ADBE Vector Rect Size' ? u.size : null; } var f = propertyGroupFactory(u, A), m = y.sh.ty === 'tm' ? y.sh.prop : y.sh; return ( (u.propertyIndex = b.ix), m.p.setGroupProperty(PropertyInterface('Position', f)), m.s.setGroupProperty(PropertyInterface('Size', f)), m.r.setGroupProperty(PropertyInterface('Rotation', f)), Object.defineProperties(u, { position: { get: ExpressionPropertyInterface(m.p) }, roundness: { get: ExpressionPropertyInterface(m.r) }, size: { get: ExpressionPropertyInterface(m.s) }, _name: { value: b.nm } }), (u.mn = b.mn), u ); } function p(b, y, A) { function u(d) { return b.r.ix === d || d === 'Round Corners 1' ? u.radius : null; } var f = propertyGroupFactory(u, A), m = y; return ( (u.propertyIndex = b.ix), m.rd.setGroupProperty(PropertyInterface('Radius', f)), Object.defineProperties(u, { radius: { get: ExpressionPropertyInterface(m.rd) }, _name: { value: b.nm } }), (u.mn = b.mn), u ); } function P(b, y, A) { function u(d) { return b.c.ix === d || d === 'Copies' ? u.copies : b.o.ix === d || d === 'Offset' ? u.offset : null; } var f = propertyGroupFactory(u, A), m = y; return ( (u.propertyIndex = b.ix), m.c.setGroupProperty(PropertyInterface('Copies', f)), m.o.setGroupProperty(PropertyInterface('Offset', f)), Object.defineProperties(u, { copies: { get: ExpressionPropertyInterface(m.c) }, offset: { get: ExpressionPropertyInterface(m.o) }, _name: { value: b.nm } }), (u.mn = b.mn), u ); } return function (b, y, A) { var u; function f(d) { if (typeof d == 'number') return (d = d === void 0 ? 1 : d), d === 0 ? A : u[d - 1]; for (var E = 0, T = u.length; E < T; ) { if (u[E]._name === d) return u[E]; E += 1; } return null; } function m() { return A; } return ( (f.propertyGroup = propertyGroupFactory(f, m)), (u = e(b, y, f.propertyGroup)), (f.numProperties = u.length), (f._name = 'Contents'), f ); }; })(), TextExpressionInterface = (function () { return function (e) { var t; function r(i) { switch (i) { case 'ADBE Text Document': return r.sourceText; default: return null; } } return ( Object.defineProperty(r, 'sourceText', { get: function () { e.textProperty.getValue(); var s = e.textProperty.currentData.t; return ( (!t || s !== t.value) && ((t = new String(s)), (t.value = s || new String(s)), Object.defineProperty(t, 'style', { get: function () { return { fillColor: e.textProperty.currentData.fc }; } })), t ); } }), r ); }; })(); function _typeof$2(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof$2 = function (r) { return typeof r; }) : (_typeof$2 = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof$2(e) ); } var FootageInterface = (function () { var e = function (i) { var s = '', n = i.getFootageData(); function a() { return (s = ''), (n = i.getFootageData()), o; } function o(l) { if (n[l]) return (s = l), (n = n[l]), _typeof$2(n) === 'object' ? o : n; var c = l.indexOf(s); if (c !== -1) { var g = parseInt(l.substr(c + s.length), 10); return (n = n[g]), _typeof$2(n) === 'object' ? o : n; } return ''; } return a; }, t = function (i) { function s(n) { return n === 'Outline' ? s.outlineInterface() : null; } return (s._name = 'Outline'), (s.outlineInterface = e(i)), s; }; return function (r) { function i(s) { return s === 'Data' ? i.dataInterface : null; } return (i._name = 'Data'), (i.dataInterface = t(r)), i; }; })(), interfaces = { layer: LayerExpressionInterface, effects: EffectsExpressionInterface, comp: CompExpressionInterface, shape: ShapeExpressionInterface, text: TextExpressionInterface, footage: FootageInterface }; function getInterface(e) { return interfaces[e] || null; } function _typeof$1(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof$1 = function (r) { return typeof r; }) : (_typeof$1 = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof$1(e) ); } function seedRandom(e, t) { var r = this, i = 256, s = 6, n = 52, a = 'random', o = t.pow(i, s), l = t.pow(2, n), c = l * 2, g = i - 1, S; function p(m, d, E) { var T = []; d = d === !0 ? { entropy: !0 } : d || {}; var x = A(y(d.entropy ? [m, f(e)] : m === null ? u() : m, 3), T), _ = new P(T), I = function () { for (var D = _.g(s), N = o, $ = 0; D < l; ) (D = (D + $) * i), (N *= i), ($ = _.g(1)); for (; D >= c; ) (D /= 2), (N /= 2), ($ >>>= 1); return (D + $) / N; }; return ( (I.int32 = function () { return _.g(4) | 0; }), (I.quick = function () { return _.g(4) / 4294967296; }), (I.double = I), A(f(_.S), e), ( d.pass || E || function (V, D, N, $) { return ( $ && ($.S && b($, _), (V.state = function () { return b(_, {}); })), N ? ((t[a] = V), D) : V ); } )(I, x, 'global' in d ? d.global : this == t, d.state) ); } t['seed' + a] = p; function P(m) { var d, E = m.length, T = this, x = 0, _ = (T.i = T.j = 0), I = (T.S = []); for (E || (m = [E++]); x < i; ) I[x] = x++; for (x = 0; x < i; x++) (I[x] = I[(_ = g & (_ + m[x % E] + (d = I[x])))]), (I[_] = d); T.g = function (V) { for (var D, N = 0, $ = T.i, O = T.j, B = T.S; V--; ) (D = B[($ = g & ($ + 1))]), (N = N * i + B[g & ((B[$] = B[(O = g & (O + D))]) + (B[O] = D))]); return (T.i = $), (T.j = O), N; }; } function b(m, d) { return (d.i = m.i), (d.j = m.j), (d.S = m.S.slice()), d; } function y(m, d) { var E = [], T = _typeof$1(m), x; if (d && T == 'object') for (x in m) try { E.push(y(m[x], d - 1)); } catch {} return E.length ? E : T == 'string' ? m : m + '\0'; } function A(m, d) { for (var E = m + '', T, x = 0; x < E.length; ) d[g & x] = g & ((T ^= d[g & x] * 19) + E.charCodeAt(x++)); return f(d); } function u() { try { var m = new Uint8Array(i); return (r.crypto || r.msCrypto).getRandomValues(m), f(m); } catch { var d = r.navigator, E = d && d.plugins; return [+new Date(), r, E, r.screen, f(e)]; } } function f(m) { return String.fromCharCode.apply(0, m); } A(t.random(), e); } function initialize$2(e) { seedRandom([], e); } var propTypes = { SHAPE: 'shape' }; function _typeof(e) { return ( typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol' ? (_typeof = function (r) { return typeof r; }) : (_typeof = function (r) { return r && typeof Symbol == 'function' && r.constructor === Symbol && r !== Symbol.prototype ? 'symbol' : typeof r; }), _typeof(e) ); } var ExpressionManager = (function () { var ob = {}, Math = BMMath, window = null, document = null, XMLHttpRequest = null, fetch = null, frames = null; initialize$2(BMMath); function $bm_isInstanceOfArray(e) { return e.constructor === Array || e.constructor === Float32Array; } function isNumerable(e, t) { return ( e === 'number' || e === 'boolean' || e === 'string' || t instanceof Number ); } function $bm_neg(e) { var t = _typeof(e); if (t === 'number' || t === 'boolean' || e instanceof Number) return -e; if ($bm_isInstanceOfArray(e)) { var r, i = e.length, s = []; for (r = 0; r < i; r += 1) s[r] = -e[r]; return s; } return e.propType ? e.v : -e; } var easeInBez = BezierFactory.getBezierEasing( 0.333, 0, 0.833, 0.833, 'easeIn' ).get, easeOutBez = BezierFactory.getBezierEasing( 0.167, 0.167, 0.667, 1, 'easeOut' ).get, easeInOutBez = BezierFactory.getBezierEasing( 0.33, 0, 0.667, 1, 'easeInOut' ).get; function sum(e, t) { var r = _typeof(e), i = _typeof(t); if ( r === 'string' || i === 'string' || (isNumerable(r, e) && isNumerable(i, t)) ) return e + t; if ($bm_isInstanceOfArray(e) && isNumerable(i, t)) return (e = e.slice(0)), (e[0] += t), e; if (isNumerable(r, e) && $bm_isInstanceOfArray(t)) return (t = t.slice(0)), (t[0] = e + t[0]), t; if ($bm_isInstanceOfArray(e) && $bm_isInstanceOfArray(t)) { for ( var s = 0, n = e.length, a = t.length, o = []; s < n || s < a; ) (typeof e[s] == 'number' || e[s] instanceof Number) && (typeof t[s] == 'number' || t[s] instanceof Number) ? (o[s] = e[s] + t[s]) : (o[s] = t[s] === void 0 ? e[s] : e[s] || t[s]), (s += 1); return o; } return 0; } var add = sum; function sub(e, t) { var r = _typeof(e), i = _typeof(t); if (isNumerable(r, e) && isNumerable(i, t)) return ( r === 'string' && (e = parseInt(e, 10)), i === 'string' && (t = parseInt(t, 10)), e - t ); if ($bm_isInstanceOfArray(e) && isNumerable(i, t)) return (e = e.slice(0)), (e[0] -= t), e; if (isNumerable(r, e) && $bm_isInstanceOfArray(t)) return (t = t.slice(0)), (t[0] = e - t[0]), t; if ($bm_isInstanceOfArray(e) && $bm_isInstanceOfArray(t)) { for ( var s = 0, n = e.length, a = t.length, o = []; s < n || s < a; ) (typeof e[s] == 'number' || e[s] instanceof Number) && (typeof t[s] == 'number' || t[s] instanceof Number) ? (o[s] = e[s] - t[s]) : (o[s] = t[s] === void 0 ? e[s] : e[s] || t[s]), (s += 1); return o; } return 0; } function mul(e, t) { var r = _typeof(e), i = _typeof(t), s; if (isNumerable(r, e) && isNumerable(i, t)) return e * t; var n, a; if ($bm_isInstanceOfArray(e) && isNumerable(i, t)) { for ( a = e.length, s = createTypedArray('float32', a), n = 0; n < a; n += 1 ) s[n] = e[n] * t; return s; } if (isNumerable(r, e) && $bm_isInstanceOfArray(t)) { for ( a = t.length, s = createTypedArray('float32', a), n = 0; n < a; n += 1 ) s[n] = e * t[n]; return s; } return 0; } function div(e, t) { var r = _typeof(e), i = _typeof(t), s; if (isNumerable(r, e) && isNumerable(i, t)) return e / t; var n, a; if ($bm_isInstanceOfArray(e) && isNumerable(i, t)) { for ( a = e.length, s = createTypedArray('float32', a), n = 0; n < a; n += 1 ) s[n] = e[n] / t; return s; } if (isNumerable(r, e) && $bm_isInstanceOfArray(t)) { for ( a = t.length, s = createTypedArray('float32', a), n = 0; n < a; n += 1 ) s[n] = e / t[n]; return s; } return 0; } function mod(e, t) { return ( typeof e == 'string' && (e = parseInt(e, 10)), typeof t == 'string' && (t = parseInt(t, 10)), e % t ); } var $bm_sum = sum, $bm_sub = sub, $bm_mul = mul, $bm_div = div, $bm_mod = mod; function clamp(e, t, r) { if (t > r) { var i = r; (r = t), (t = i); } return Math.min(Math.max(e, t), r); } function radiansToDegrees(e) { return e / degToRads; } var radians_to_degrees = radiansToDegrees; function degreesToRadians(e) { return e * degToRads; } var degrees_to_radians = radiansToDegrees, helperLengthArray = [0, 0, 0, 0, 0, 0]; function length(e, t) { if (typeof e == 'number' || e instanceof Number) return (t = t || 0), Math.abs(e - t); t || (t = helperLengthArray); var r, i = Math.min(e.length, t.length), s = 0; for (r = 0; r < i; r += 1) s += Math.pow(t[r] - e[r], 2); return Math.sqrt(s); } function normalize(e) { return div(e, length(e)); } function rgbToHsl(e) { var t = e[0], r = e[1], i = e[2], s = Math.max(t, r, i), n = Math.min(t, r, i), a, o, l = (s + n) / 2; if (s === n) (a = 0), (o = 0); else { var c = s - n; switch (((o = l > 0.5 ? c / (2 - s - n) : c / (s + n)), s)) { case t: a = (r - i) / c + (r < i ? 6 : 0); break; case r: a = (i - t) / c + 2; break; case i: a = (t - r) / c + 4; break; } a /= 6; } return [a, o, l, e[3]]; } function hue2rgb(e, t, r) { return ( r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e ); } function hslToRgb(e) { var t = e[0], r = e[1], i = e[2], s, n, a; if (r === 0) (s = i), (a = i), (n = i); else { var o = i < 0.5 ? i * (1 + r) : i + r - i * r, l = 2 * i - o; (s = hue2rgb(l, o, t + 1 / 3)), (n = hue2rgb(l, o, t)), (a = hue2rgb(l, o, t - 1 / 3)); } return [s, n, a, e[3]]; } function linear(e, t, r, i, s) { if ( ((i === void 0 || s === void 0) && ((i = t), (s = r), (t = 0), (r = 1)), r < t) ) { var n = r; (r = t), (t = n); } if (e <= t) return i; if (e >= r) return s; var a = r === t ? 0 : (e - t) / (r - t); if (!i.length) return i + (s - i) * a; var o, l = i.length, c = createTypedArray('float32', l); for (o = 0; o < l; o += 1) c[o] = i[o] + (s[o] - i[o]) * a; return c; } function random(e, t) { if ( (t === void 0 && (e === void 0 ? ((e = 0), (t = 1)) : ((t = e), (e = void 0))), t.length) ) { var r, i = t.length; e || (e = createTypedArray('float32', i)); var s = createTypedArray('float32', i), n = BMMath.random(); for (r = 0; r < i; r += 1) s[r] = e[r] + n * (t[r] - e[r]); return s; } e === void 0 && (e = 0); var a = BMMath.random(); return e + a * (t - e); } function createPath(e, t, r, i) { var s, n = e.length, a = shapePool.newElement(); a.setPathData(!!i, n); var o = [0, 0], l, c; for (s = 0; s < n; s += 1) (l = t && t[s] ? t[s] : o), (c = r && r[s] ? r[s] : o), a.setTripleAt( e[s][0], e[s][1], c[0] + e[s][0], c[1] + e[s][1], l[0] + e[s][0], l[1] + e[s][1], s, !0 ); return a; } function initiateExpression(elem, data, property) { function noOp(e) { return e; } if (!elem.globalData.renderConfig.runExpressions) return noOp; var val = data.x, needsVelocity = /velocity(?![\w\d])/.test(val), _needsRandom = val.indexOf('random') !== -1, elemType = elem.data.ty, transform, $bm_transform, content, effect, thisProperty = property; (thisProperty.valueAtTime = thisProperty.getValueAtTime), Object.defineProperty(thisProperty, 'value', { get: function () { return thisProperty.v; } }), (elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate), (elem.comp.displayStartTime = 0); var inPoint = elem.data.ip / elem.comp.globalData.frameRate, outPoint = elem.data.op / elem.comp.globalData.frameRate, width = elem.data.sw ? elem.data.sw : 0, height = elem.data.sh ? elem.data.sh : 0, name = elem.data.nm, loopIn, loop_in, loopOut, loop_out, smooth, toWorld, fromWorld, fromComp, toComp, fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp, mask, valueAtTime, velocityAtTime, scoped_bm_rt, expression_function = eval( '[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]' )[0], numKeys = property.kf ? data.k.length : 0, active = !this.data || this.data.hd !== !0, wiggle = function e(t, r) { var i, s, n = this.pv.length ? this.pv.length : 1, a = createTypedArray('float32', n); t = 5; var o = Math.floor(time * t); for (i = 0, s = 0; i < o; ) { for (s = 0; s < n; s += 1) a[s] += -r + r * 2 * BMMath.random(); i += 1; } var l = time * t, c = l - Math.floor(l), g = createTypedArray('float32', n); if (n > 1) { for (s = 0; s < n; s += 1) g[s] = this.pv[s] + a[s] + (-r + r * 2 * BMMath.random()) * c; return g; } return this.pv + a[0] + (-r + r * 2 * BMMath.random()) * c; }.bind(this); thisProperty.loopIn && ((loopIn = thisProperty.loopIn.bind(thisProperty)), (loop_in = loopIn)), thisProperty.loopOut && ((loopOut = thisProperty.loopOut.bind(thisProperty)), (loop_out = loopOut)), thisProperty.smooth && (smooth = thisProperty.smooth.bind(thisProperty)); function loopInDuration(e, t) { return loopIn(e, t, !0); } function loopOutDuration(e, t) { return loopOut(e, t, !0); } this.getValueAtTime && (valueAtTime = this.getValueAtTime.bind(this)), this.getVelocityAtTime && (velocityAtTime = this.getVelocityAtTime.bind(this)); var comp = elem.comp.globalData.projectInterface.bind( elem.comp.globalData.projectInterface ); function lookAt(e, t) { var r = [t[0] - e[0], t[1] - e[1], t[2] - e[2]], i = Math.atan2(r[0], Math.sqrt(r[1] * r[1] + r[2] * r[2])) / degToRads, s = -Math.atan2(r[1], r[2]) / degToRads; return [s, i, 0]; } function easeOut(e, t, r, i, s) { return applyEase(easeOutBez, e, t, r, i, s); } function easeIn(e, t, r, i, s) { return applyEase(easeInBez, e, t, r, i, s); } function ease(e, t, r, i, s) { return applyEase(easeInOutBez, e, t, r, i, s); } function applyEase(e, t, r, i, s, n) { s === void 0 ? ((s = r), (n = i)) : (t = (t - r) / (i - r)), t > 1 ? (t = 1) : t < 0 && (t = 0); var a = e(t); if ($bm_isInstanceOfArray(s)) { var o, l = s.length, c = createTypedArray('float32', l); for (o = 0; o < l; o += 1) c[o] = (n[o] - s[o]) * a + s[o]; return c; } return (n - s) * a + s; } function nearestKey(e) { var t, r = data.k.length, i, s; if (!data.k.length || typeof data.k[0] == 'number') (i = 0), (s = 0); else if ( ((i = -1), (e *= elem.comp.globalData.frameRate), e < data.k[0].t) ) (i = 1), (s = data.k[0].t); else { for (t = 0; t < r - 1; t += 1) if (e === data.k[t].t) { (i = t + 1), (s = data.k[t].t); break; } else if (e > data.k[t].t && e < data.k[t + 1].t) { e - data.k[t].t > data.k[t + 1].t - e ? ((i = t + 2), (s = data.k[t + 1].t)) : ((i = t + 1), (s = data.k[t].t)); break; } i === -1 && ((i = t + 1), (s = data.k[t].t)); } var n = {}; return ( (n.index = i), (n.time = s / elem.comp.globalData.frameRate), n ); } function key(e) { var t, r, i; if (!data.k.length || typeof data.k[0] == 'number') throw new Error('The property has no keyframe at index ' + e); (e -= 1), (t = { time: data.k[e].t / elem.comp.globalData.frameRate, value: [] }); var s = Object.prototype.hasOwnProperty.call(data.k[e], 's') ? data.k[e].s : data.k[e - 1].e; for (i = s.length, r = 0; r < i; r += 1) (t[r] = s[r]), (t.value[r] = s[r]); return t; } function framesToTime(e, t) { return t || (t = elem.comp.globalData.frameRate), e / t; } function timeToFrames(e, t) { return ( !e && e !== 0 && (e = time), t || (t = elem.comp.globalData.frameRate), e * t ); } function seedRandom(e) { BMMath.seedrandom(randSeed + e); } function sourceRectAtTime() { return elem.sourceRectAtTime(); } function substring(e, t) { return typeof value == 'string' ? t === void 0 ? value.substring(e) : value.substring(e, t) : ''; } function substr(e, t) { return typeof value == 'string' ? t === void 0 ? value.substr(e) : value.substr(e, t) : ''; } function posterizeTime(e) { (time = e === 0 ? 0 : Math.floor(time * e) / e), (value = valueAtTime(time)); } var time, velocity, value, text, textIndex, textTotal, selectorValue, index = elem.data.ind, hasParent = !!(elem.hierarchy && elem.hierarchy.length), parent, randSeed = Math.floor(Math.random() * 1e6), globalData = elem.globalData; function executeExpression(e) { return ( (value = e), this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector' ? value : (this.propType === 'textSelector' && ((textIndex = this.textIndex), (textTotal = this.textTotal), (selectorValue = this.selectorValue)), thisLayer || ((text = elem.layerInterface.text), (thisLayer = elem.layerInterface), (thisComp = elem.comp.compInterface), (toWorld = thisLayer.toWorld.bind(thisLayer)), (fromWorld = thisLayer.fromWorld.bind(thisLayer)), (fromComp = thisLayer.fromComp.bind(thisLayer)), (toComp = thisLayer.toComp.bind(thisLayer)), (mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null), (fromCompToSurface = fromComp)), transform || ((transform = elem.layerInterface( 'ADBE Transform Group' )), ($bm_transform = transform), transform && (anchorPoint = transform.anchorPoint)), elemType === 4 && !content && (content = thisLayer('ADBE Root Vectors Group')), effect || (effect = thisLayer(4)), (hasParent = !!(elem.hierarchy && elem.hierarchy.length)), hasParent && !parent && (parent = elem.hierarchy[0].layerInterface), (time = this.comp.renderedFrame / this.comp.globalData.frameRate), _needsRandom && seedRandom(randSeed + time), needsVelocity && (velocity = velocityAtTime(time)), expression_function(), (this.frameExpressionId = elem.globalData.frameId), (scoped_bm_rt = scoped_bm_rt.propType === propTypes.SHAPE ? scoped_bm_rt.v : scoped_bm_rt), scoped_bm_rt) ); } return ( (executeExpression.__preventDeadCodeRemoval = [ $bm_transform, anchorPoint, time, velocity, inPoint, outPoint, width, height, name, loop_in, loop_out, smooth, toComp, fromCompToSurface, toWorld, fromWorld, mask, position, rotation, scale, thisComp, numKeys, active, wiggle, loopInDuration, loopOutDuration, comp, lookAt, easeOut, easeIn, ease, nearestKey, key, text, textIndex, textTotal, selectorValue, framesToTime, timeToFrames, sourceRectAtTime, substring, substr, posterizeTime, index, globalData ]), executeExpression ); } return ( (ob.initiateExpression = initiateExpression), (ob.__preventDeadCodeRemoval = [ window, document, XMLHttpRequest, fetch, frames, $bm_neg, add, $bm_sum, $bm_sub, $bm_mul, $bm_div, $bm_mod, clamp, radians_to_degrees, degreesToRadians, degrees_to_radians, normalize, rgbToHsl, hslToRgb, linear, random, createPath ]), ob ); })(), expressionHelpers = (function () { function e(a, o, l) { o.x && ((l.k = !0), (l.x = !0), (l.initiateExpression = ExpressionManager.initiateExpression), l.effectsSequence.push(l.initiateExpression(a, o, l).bind(l))); } function t(a) { return ( (a *= this.elem.globalData.frameRate), (a -= this.offsetTime), a !== this._cachingAtTime.lastFrame && ((this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < a ? this._cachingAtTime.lastIndex : 0), (this._cachingAtTime.value = this.interpolateValue( a, this._cachingAtTime )), (this._cachingAtTime.lastFrame = a)), this._cachingAtTime.value ); } function r(a) { var o = -0.01, l = this.getValueAtTime(a), c = this.getValueAtTime(a + o), g = 0; if (l.length) { var S; for (S = 0; S < l.length; S += 1) g += Math.pow(c[S] - l[S], 2); g = Math.sqrt(g) * 100; } else g = 0; return g; } function i(a) { if (this.vel !== void 0) return this.vel; var o = -0.001, l = this.getValueAtTime(a), c = this.getValueAtTime(a + o), g; if (l.length) { g = createTypedArray('float32', l.length); var S; for (S = 0; S < l.length; S += 1) g[S] = (c[S] - l[S]) / o; } else g = (c - l) / o; return g; } function s() { return this.pv; } function n(a) { this.propertyGroup = a; } return { searchExpressions: e, getSpeedAtTime: r, getVelocityAtTime: i, getValueAtTime: t, getStaticValueAtTime: s, setGroupProperty: n }; })(); function addPropertyDecorator() { function e(p, P, b) { if (!this.k || !this.keyframes) return this.pv; p = p ? p.toLowerCase() : ''; var y = this.comp.renderedFrame, A = this.keyframes, u = A[A.length - 1].t; if (y <= u) return this.pv; var f, m; b ? (P ? (f = Math.abs(u - this.elem.comp.globalData.frameRate * P)) : (f = Math.max(0, u - this.elem.data.ip)), (m = u - f)) : ((!P || P > A.length - 1) && (P = A.length - 1), (m = A[A.length - 1 - P].t), (f = u - m)); var d, E, T; if (p === 'pingpong') { var x = Math.floor((y - m) / f); if (x % 2 !== 0) return this.getValueAtTime( (f - ((y - m) % f) + m) / this.comp.globalData.frameRate, 0 ); } else if (p === 'offset') { var _ = this.getValueAtTime(m / this.comp.globalData.frameRate, 0), I = this.getValueAtTime(u / this.comp.globalData.frameRate, 0), V = this.getValueAtTime( (((y - m) % f) + m) / this.comp.globalData.frameRate, 0 ), D = Math.floor((y - m) / f); if (this.pv.length) { for (T = new Array(_.length), E = T.length, d = 0; d < E; d += 1) T[d] = (I[d] - _[d]) * D + V[d]; return T; } return (I - _) * D + V; } else if (p === 'continue') { var N = this.getValueAtTime(u / this.comp.globalData.frameRate, 0), $ = this.getValueAtTime( (u - 0.001) / this.comp.globalData.frameRate, 0 ); if (this.pv.length) { for (T = new Array(N.length), E = T.length, d = 0; d < E; d += 1) T[d] = N[d] + ((N[d] - $[d]) * ((y - u) / this.comp.globalData.frameRate)) / 5e-4; return T; } return N + (N - $) * ((y - u) / 0.001); } return this.getValueAtTime( (((y - m) % f) + m) / this.comp.globalData.frameRate, 0 ); } function t(p, P, b) { if (!this.k) return this.pv; p = p ? p.toLowerCase() : ''; var y = this.comp.renderedFrame, A = this.keyframes, u = A[0].t; if (y >= u) return this.pv; var f, m; b ? (P ? (f = Math.abs(this.elem.comp.globalData.frameRate * P)) : (f = Math.max(0, this.elem.data.op - u)), (m = u + f)) : ((!P || P > A.length - 1) && (P = A.length - 1), (m = A[P].t), (f = m - u)); var d, E, T; if (p === 'pingpong') { var x = Math.floor((u - y) / f); if (x % 2 === 0) return this.getValueAtTime( (((u - y) % f) + u) / this.comp.globalData.frameRate, 0 ); } else if (p === 'offset') { var _ = this.getValueAtTime(u / this.comp.globalData.frameRate, 0), I = this.getValueAtTime(m / this.comp.globalData.frameRate, 0), V = this.getValueAtTime( (f - ((u - y) % f) + u) / this.comp.globalData.frameRate, 0 ), D = Math.floor((u - y) / f) + 1; if (this.pv.length) { for (T = new Array(_.length), E = T.length, d = 0; d < E; d += 1) T[d] = V[d] - (I[d] - _[d]) * D; return T; } return V - (I - _) * D; } else if (p === 'continue') { var N = this.getValueAtTime(u / this.comp.globalData.frameRate, 0), $ = this.getValueAtTime( (u + 0.001) / this.comp.globalData.frameRate, 0 ); if (this.pv.length) { for (T = new Array(N.length), E = T.length, d = 0; d < E; d += 1) T[d] = N[d] + ((N[d] - $[d]) * (u - y)) / 0.001; return T; } return N + ((N - $) * (u - y)) / 0.001; } return this.getValueAtTime( (f - (((u - y) % f) + u)) / this.comp.globalData.frameRate, 0 ); } function r(p, P) { if (!this.k) return this.pv; if (((p = (p || 0.4) * 0.5), (P = Math.floor(P || 5)), P <= 1)) return this.pv; var b = this.comp.renderedFrame / this.comp.globalData.frameRate, y = b - p, A = b + p, u = P > 1 ? (A - y) / (P - 1) : 1, f = 0, m = 0, d; this.pv.length ? (d = createTypedArray('float32', this.pv.length)) : (d = 0); for (var E; f < P; ) { if (((E = this.getValueAtTime(y + f * u)), this.pv.length)) for (m = 0; m < this.pv.length; m += 1) d[m] += E[m]; else d += E; f += 1; } if (this.pv.length) for (m = 0; m < this.pv.length; m += 1) d[m] /= P; else d /= P; return d; } function i(p) { this._transformCachingAtTime || (this._transformCachingAtTime = { v: new Matrix() }); var P = this._transformCachingAtTime.v; if ( (P.cloneFromProps(this.pre.props), this.appliedTransformations < 1) ) { var b = this.a.getValueAtTime(p); P.translate( -b[0] * this.a.mult, -b[1] * this.a.mult, b[2] * this.a.mult ); } if (this.appliedTransformations < 2) { var y = this.s.getValueAtTime(p); P.scale(y[0] * this.s.mult, y[1] * this.s.mult, y[2] * this.s.mult); } if (this.sk && this.appliedTransformations < 3) { var A = this.sk.getValueAtTime(p), u = this.sa.getValueAtTime(p); P.skewFromAxis(-A * this.sk.mult, u * this.sa.mult); } if (this.r && this.appliedTransformations < 4) { var f = this.r.getValueAtTime(p); P.rotate(-f * this.r.mult); } else if (!this.r && this.appliedTransformations < 4) { var m = this.rz.getValueAtTime(p), d = this.ry.getValueAtTime(p), E = this.rx.getValueAtTime(p), T = this.or.getValueAtTime(p); P.rotateZ(-m * this.rz.mult) .rotateY(d * this.ry.mult) .rotateX(E * this.rx.mult) .rotateZ(-T[2] * this.or.mult) .rotateY(T[1] * this.or.mult) .rotateX(T[0] * this.or.mult); } if (this.data.p && this.data.p.s) { var x = this.px.getValueAtTime(p), _ = this.py.getValueAtTime(p); if (this.data.p.z) { var I = this.pz.getValueAtTime(p); P.translate( x * this.px.mult, _ * this.py.mult, -I * this.pz.mult ); } else P.translate(x * this.px.mult, _ * this.py.mult, 0); } else { var V = this.p.getValueAtTime(p); P.translate( V[0] * this.p.mult, V[1] * this.p.mult, -V[2] * this.p.mult ); } return P; } function s() { return this.v.clone(new Matrix()); } var n = TransformPropertyFactory.getTransformProperty; TransformPropertyFactory.getTransformProperty = function (p, P, b) { var y = n(p, P, b); return ( y.dynamicProperties.length ? (y.getValueAtTime = i.bind(y)) : (y.getValueAtTime = s.bind(y)), (y.setGroupProperty = expressionHelpers.setGroupProperty), y ); }; var a = PropertyFactory.getProp; PropertyFactory.getProp = function (p, P, b, y, A) { var u = a(p, P, b, y, A); u.kf ? (u.getValueAtTime = expressionHelpers.getValueAtTime.bind(u)) : (u.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(u)), (u.setGroupProperty = expressionHelpers.setGroupProperty), (u.loopOut = e), (u.loopIn = t), (u.smooth = r), (u.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(u)), (u.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(u)), (u.numKeys = P.a === 1 ? P.k.length : 0), (u.propertyIndex = P.ix); var f = 0; return ( b !== 0 && (f = createTypedArray( 'float32', P.a === 1 ? P.k[0].s.length : P.k.length )), (u._cachingAtTime = { lastFrame: initialDefaultFrame, lastIndex: 0, value: f }), expressionHelpers.searchExpressions(p, P, u), u.k && A.addDynamicProperty(u), u ); }; function o(p) { return ( this._cachingAtTime || (this._cachingAtTime = { shapeValue: shapePool.clone(this.pv), lastIndex: 0, lastTime: initialDefaultFrame }), (p *= this.elem.globalData.frameRate), (p -= this.offsetTime), p !== this._cachingAtTime.lastTime && ((this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < p ? this._caching.lastIndex : 0), (this._cachingAtTime.lastTime = p), this.interpolateShape( p, this._cachingAtTime.shapeValue, this._cachingAtTime )), this._cachingAtTime.shapeValue ); } var l = ShapePropertyFactory.getConstructorFunction(), c = ShapePropertyFactory.getKeyframedConstructorFunction(); function g() {} (g.prototype = { vertices: function (P, b) { this.k && this.getValue(); var y = this.v; b !== void 0 && (y = this.getValueAtTime(b, 0)); var A, u = y._length, f = y[P], m = y.v, d = createSizedArray(u); for (A = 0; A < u; A += 1) P === 'i' || P === 'o' ? (d[A] = [f[A][0] - m[A][0], f[A][1] - m[A][1]]) : (d[A] = [f[A][0], f[A][1]]); return d; }, points: function (P) { return this.vertices('v', P); }, inTangents: function (P) { return this.vertices('i', P); }, outTangents: function (P) { return this.vertices('o', P); }, isClosed: function () { return this.v.c; }, pointOnPath: function (P, b) { var y = this.v; b !== void 0 && (y = this.getValueAtTime(b, 0)), this._segmentsLength || (this._segmentsLength = bez.getSegmentsLength(y)); for ( var A = this._segmentsLength, u = A.lengths, f = A.totalLength * P, m = 0, d = u.length, E = 0, T; m < d; ) { if (E + u[m].addedLength > f) { var x = m, _ = y.c && m === d - 1 ? 0 : m + 1, I = (f - E) / u[m].addedLength; T = bez.getPointInSegment( y.v[x], y.v[_], y.o[x], y.i[_], I, u[m] ); break; } else E += u[m].addedLength; m += 1; } return ( T || (T = y.c ? [y.v[0][0], y.v[0][1]] : [y.v[y._length - 1][0], y.v[y._length - 1][1]]), T ); }, vectorOnPath: function (P, b, y) { P == 1 ? (P = this.v.c) : P == 0 && (P = 0.999); var A = this.pointOnPath(P, b), u = this.pointOnPath(P + 0.001, b), f = u[0] - A[0], m = u[1] - A[1], d = Math.sqrt(Math.pow(f, 2) + Math.pow(m, 2)); if (d === 0) return [0, 0]; var E = y === 'tangent' ? [f / d, m / d] : [-m / d, f / d]; return E; }, tangentOnPath: function (P, b) { return this.vectorOnPath(P, b, 'tangent'); }, normalOnPath: function (P, b) { return this.vectorOnPath(P, b, 'normal'); }, setGroupProperty: expressionHelpers.setGroupProperty, getValueAtTime: expressionHelpers.getStaticValueAtTime }), extendPrototype([g], l), extendPrototype([g], c), (c.prototype.getValueAtTime = o), (c.prototype.initiateExpression = ExpressionManager.initiateExpression); var S = ShapePropertyFactory.getShapeProp; ShapePropertyFactory.getShapeProp = function (p, P, b, y, A) { var u = S(p, P, b, y, A); return ( (u.propertyIndex = P.ix), (u.lock = !1), b === 3 ? expressionHelpers.searchExpressions(p, P.pt, u) : b === 4 && expressionHelpers.searchExpressions(p, P.ks, u), u.k && p.addDynamicProperty(u), u ); }; } function initialize$1() { addPropertyDecorator(); } function addDecorator() { function e() { return this.data.d.x ? ((this.calculateExpression = ExpressionManager.initiateExpression.bind(this)( this.elem, this.data.d, this )), this.addEffect(this.getExpressionValue.bind(this)), !0) : null; } (TextProperty.prototype.getExpressionValue = function (t, r) { var i = this.calculateExpression(r); if (t.t !== i) { var s = {}; return ( this.copyData(s, t), (s.t = i.toString()), (s.__complete = !1), s ); } return t; }), (TextProperty.prototype.searchProperty = function () { var t = this.searchKeyframes(), r = this.searchExpressions(); return (this.kf = t || r), this.kf; }), (TextProperty.prototype.searchExpressions = e); } function initialize() { addDecorator(); } function SVGComposableEffect() {} SVGComposableEffect.prototype = { createMergeNode: function e(t, r) { var i = createNS('feMerge'); i.setAttribute('result', t); var s, n; for (n = 0; n < r.length; n += 1) (s = createNS('feMergeNode')), s.setAttribute('in', r[n]), i.appendChild(s), i.appendChild(s); return i; } }; var linearFilterValue = '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0'; function SVGTintFilter(e, t, r, i, s) { this.filterManager = t; var n = createNS('feColorMatrix'); n.setAttribute('type', 'matrix'), n.setAttribute('color-interpolation-filters', 'linearRGB'), n.setAttribute('values', linearFilterValue + ' 1 0'), (this.linearFilter = n), n.setAttribute('result', i + '_tint_1'), e.appendChild(n), (n = createNS('feColorMatrix')), n.setAttribute('type', 'matrix'), n.setAttribute('color-interpolation-filters', 'sRGB'), n.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0'), n.setAttribute('result', i + '_tint_2'), e.appendChild(n), (this.matrixFilter = n); var a = this.createMergeNode(i, [s, i + '_tint_1', i + '_tint_2']); e.appendChild(a); } extendPrototype([SVGComposableEffect], SVGTintFilter), (SVGTintFilter.prototype.renderFrame = function (e) { if (e || this.filterManager._mdf) { var t = this.filterManager.effectElements[0].p.v, r = this.filterManager.effectElements[1].p.v, i = this.filterManager.effectElements[2].p.v / 100; this.linearFilter.setAttribute( 'values', linearFilterValue + ' ' + i + ' 0' ), this.matrixFilter.setAttribute( 'values', r[0] - t[0] + ' 0 0 0 ' + t[0] + ' ' + (r[1] - t[1]) + ' 0 0 0 ' + t[1] + ' ' + (r[2] - t[2]) + ' 0 0 0 ' + t[2] + ' 0 0 0 1 0' ); } }); function SVGFillFilter(e, t, r, i) { this.filterManager = t; var s = createNS('feColorMatrix'); s.setAttribute('type', 'matrix'), s.setAttribute('color-interpolation-filters', 'sRGB'), s.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0'), s.setAttribute('result', i), e.appendChild(s), (this.matrixFilter = s); } SVGFillFilter.prototype.renderFrame = function (e) { if (e || this.filterManager._mdf) { var t = this.filterManager.effectElements[2].p.v, r = this.filterManager.effectElements[6].p.v; this.matrixFilter.setAttribute( 'values', '0 0 0 0 ' + t[0] + ' 0 0 0 0 ' + t[1] + ' 0 0 0 0 ' + t[2] + ' 0 0 0 ' + r + ' 0' ); } }; function SVGStrokeEffect(e, t, r) { (this.initialized = !1), (this.filterManager = t), (this.elem = r), (this.paths = []); } (SVGStrokeEffect.prototype.initialize = function () { var e = this.elem.layerElement.children || this.elem.layerElement.childNodes, t, r, i, s; for ( this.filterManager.effectElements[1].p.v === 1 ? ((s = this.elem.maskManager.masksProperties.length), (i = 0)) : ((i = this.filterManager.effectElements[0].p.v - 1), (s = i + 1)), r = createNS('g'), r.setAttribute('fill', 'none'), r.setAttribute('stroke-linecap', 'round'), r.setAttribute('stroke-dashoffset', 1), i; i < s; i += 1 ) (t = createNS('path')), r.appendChild(t), this.paths.push({ p: t, m: i }); if (this.filterManager.effectElements[10].p.v === 3) { var n = createNS('mask'), a = createElementID(); n.setAttribute('id', a), n.setAttribute('mask-type', 'alpha'), n.appendChild(r), this.elem.globalData.defs.appendChild(n); var o = createNS('g'); for ( o.setAttribute('mask', 'url(' + getLocationHref() + '#' + a + ')'); e[0]; ) o.appendChild(e[0]); this.elem.layerElement.appendChild(o), (this.masker = n), r.setAttribute('stroke', '#fff'); } else if ( this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2 ) { if (this.filterManager.effectElements[10].p.v === 2) for ( e = this.elem.layerElement.children || this.elem.layerElement.childNodes; e.length; ) this.elem.layerElement.removeChild(e[0]); this.elem.layerElement.appendChild(r), this.elem.layerElement.removeAttribute('mask'), r.setAttribute('stroke', '#fff'); } (this.initialized = !0), (this.pathMasker = r); }), (SVGStrokeEffect.prototype.renderFrame = function (e) { this.initialized || this.initialize(); var t, r = this.paths.length, i, s; for (t = 0; t < r; t += 1) if ( this.paths[t].m !== -1 && ((i = this.elem.maskManager.viewData[this.paths[t].m]), (s = this.paths[t].p), (e || this.filterManager._mdf || i.prop._mdf) && s.setAttribute('d', i.lastPath), e || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || i.prop._mdf) ) { var n; if ( this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100 ) { var a = Math.min( this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v ) * 0.01, o = Math.max( this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v ) * 0.01, l = s.getTotalLength(); n = '0 0 0 ' + l * a + ' '; var c = l * (o - a), g = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01, S = Math.floor(c / g), p; for (p = 0; p < S; p += 1) n += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' '; n += '0 ' + l * 10 + ' 0 0'; } else n = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01; s.setAttribute('stroke-dasharray', n); } if ( ((e || this.filterManager.effectElements[4].p._mdf) && this.pathMasker.setAttribute( 'stroke-width', this.filterManager.effectElements[4].p.v * 2 ), (e || this.filterManager.effectElements[6].p._mdf) && this.pathMasker.setAttribute( 'opacity', this.filterManager.effectElements[6].p.v ), (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) && (e || this.filterManager.effectElements[3].p._mdf)) ) { var P = this.filterManager.effectElements[3].p.v; this.pathMasker.setAttribute( 'stroke', 'rgb(' + bmFloor(P[0] * 255) + ',' + bmFloor(P[1] * 255) + ',' + bmFloor(P[2] * 255) + ')' ); } }); function SVGTritoneFilter(e, t, r, i) { this.filterManager = t; var s = createNS('feColorMatrix'); s.setAttribute('type', 'matrix'), s.setAttribute('color-interpolation-filters', 'linearRGB'), s.setAttribute( 'values', '0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' ), e.appendChild(s); var n = createNS('feComponentTransfer'); n.setAttribute('color-interpolation-filters', 'sRGB'), n.setAttribute('result', i), (this.matrixFilter = n); var a = createNS('feFuncR'); a.setAttribute('type', 'table'), n.appendChild(a), (this.feFuncR = a); var o = createNS('feFuncG'); o.setAttribute('type', 'table'), n.appendChild(o), (this.feFuncG = o); var l = createNS('feFuncB'); l.setAttribute('type', 'table'), n.appendChild(l), (this.feFuncB = l), e.appendChild(n); } SVGTritoneFilter.prototype.renderFrame = function (e) { if (e || this.filterManager._mdf) { var t = this.filterManager.effectElements[0].p.v, r = this.filterManager.effectElements[1].p.v, i = this.filterManager.effectElements[2].p.v, s = i[0] + ' ' + r[0] + ' ' + t[0], n = i[1] + ' ' + r[1] + ' ' + t[1], a = i[2] + ' ' + r[2] + ' ' + t[2]; this.feFuncR.setAttribute('tableValues', s), this.feFuncG.setAttribute('tableValues', n), this.feFuncB.setAttribute('tableValues', a); } }; function SVGProLevelsFilter(e, t, r, i) { this.filterManager = t; var s = this.filterManager.effectElements, n = createNS('feComponentTransfer'); (s[10].p.k || s[10].p.v !== 0 || s[11].p.k || s[11].p.v !== 1 || s[12].p.k || s[12].p.v !== 1 || s[13].p.k || s[13].p.v !== 0 || s[14].p.k || s[14].p.v !== 1) && (this.feFuncR = this.createFeFunc('feFuncR', n)), (s[17].p.k || s[17].p.v !== 0 || s[18].p.k || s[18].p.v !== 1 || s[19].p.k || s[19].p.v !== 1 || s[20].p.k || s[20].p.v !== 0 || s[21].p.k || s[21].p.v !== 1) && (this.feFuncG = this.createFeFunc('feFuncG', n)), (s[24].p.k || s[24].p.v !== 0 || s[25].p.k || s[25].p.v !== 1 || s[26].p.k || s[26].p.v !== 1 || s[27].p.k || s[27].p.v !== 0 || s[28].p.k || s[28].p.v !== 1) && (this.feFuncB = this.createFeFunc('feFuncB', n)), (s[31].p.k || s[31].p.v !== 0 || s[32].p.k || s[32].p.v !== 1 || s[33].p.k || s[33].p.v !== 1 || s[34].p.k || s[34].p.v !== 0 || s[35].p.k || s[35].p.v !== 1) && (this.feFuncA = this.createFeFunc('feFuncA', n)), (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) && (n.setAttribute('color-interpolation-filters', 'sRGB'), e.appendChild(n)), (s[3].p.k || s[3].p.v !== 0 || s[4].p.k || s[4].p.v !== 1 || s[5].p.k || s[5].p.v !== 1 || s[6].p.k || s[6].p.v !== 0 || s[7].p.k || s[7].p.v !== 1) && ((n = createNS('feComponentTransfer')), n.setAttribute('color-interpolation-filters', 'sRGB'), n.setAttribute('result', i), e.appendChild(n), (this.feFuncRComposed = this.createFeFunc('feFuncR', n)), (this.feFuncGComposed = this.createFeFunc('feFuncG', n)), (this.feFuncBComposed = this.createFeFunc('feFuncB', n))); } (SVGProLevelsFilter.prototype.createFeFunc = function (e, t) { var r = createNS(e); return r.setAttribute('type', 'table'), t.appendChild(r), r; }), (SVGProLevelsFilter.prototype.getTableValue = function (e, t, r, i, s) { for ( var n = 0, a = 256, o, l = Math.min(e, t), c = Math.max(e, t), g = Array.call(null, { length: a }), S, p = 0, P = s - i, b = t - e; n <= 256; ) (o = n / 256), o <= l ? (S = b < 0 ? s : i) : o >= c ? (S = b < 0 ? i : s) : (S = i + P * Math.pow((o - e) / b, 1 / r)), (g[p] = S), (p += 1), (n += 256 / (a - 1)); return g.join(' '); }), (SVGProLevelsFilter.prototype.renderFrame = function (e) { if (e || this.filterManager._mdf) { var t, r = this.filterManager.effectElements; this.feFuncRComposed && (e || r[3].p._mdf || r[4].p._mdf || r[5].p._mdf || r[6].p._mdf || r[7].p._mdf) && ((t = this.getTableValue( r[3].p.v, r[4].p.v, r[5].p.v, r[6].p.v, r[7].p.v )), this.feFuncRComposed.setAttribute('tableValues', t), this.feFuncGComposed.setAttribute('tableValues', t), this.feFuncBComposed.setAttribute('tableValues', t)), this.feFuncR && (e || r[10].p._mdf || r[11].p._mdf || r[12].p._mdf || r[13].p._mdf || r[14].p._mdf) && ((t = this.getTableValue( r[10].p.v, r[11].p.v, r[12].p.v, r[13].p.v, r[14].p.v )), this.feFuncR.setAttribute('tableValues', t)), this.feFuncG && (e || r[17].p._mdf || r[18].p._mdf || r[19].p._mdf || r[20].p._mdf || r[21].p._mdf) && ((t = this.getTableValue( r[17].p.v, r[18].p.v, r[19].p.v, r[20].p.v, r[21].p.v )), this.feFuncG.setAttribute('tableValues', t)), this.feFuncB && (e || r[24].p._mdf || r[25].p._mdf || r[26].p._mdf || r[27].p._mdf || r[28].p._mdf) && ((t = this.getTableValue( r[24].p.v, r[25].p.v, r[26].p.v, r[27].p.v, r[28].p.v )), this.feFuncB.setAttribute('tableValues', t)), this.feFuncA && (e || r[31].p._mdf || r[32].p._mdf || r[33].p._mdf || r[34].p._mdf || r[35].p._mdf) && ((t = this.getTableValue( r[31].p.v, r[32].p.v, r[33].p.v, r[34].p.v, r[35].p.v )), this.feFuncA.setAttribute('tableValues', t)); } }); function SVGDropShadowEffect(e, t, r, i, s) { var n = t.container.globalData.renderConfig.filterSize, a = t.data.fs || n; e.setAttribute('x', a.x || n.x), e.setAttribute('y', a.y || n.y), e.setAttribute('width', a.width || n.width), e.setAttribute('height', a.height || n.height), (this.filterManager = t); var o = createNS('feGaussianBlur'); o.setAttribute('in', 'SourceAlpha'), o.setAttribute('result', i + '_drop_shadow_1'), o.setAttribute('stdDeviation', '0'), (this.feGaussianBlur = o), e.appendChild(o); var l = createNS('feOffset'); l.setAttribute('dx', '25'), l.setAttribute('dy', '0'), l.setAttribute('in', i + '_drop_shadow_1'), l.setAttribute('result', i + '_drop_shadow_2'), (this.feOffset = l), e.appendChild(l); var c = createNS('feFlood'); c.setAttribute('flood-color', '#00ff00'), c.setAttribute('flood-opacity', '1'), c.setAttribute('result', i + '_drop_shadow_3'), (this.feFlood = c), e.appendChild(c); var g = createNS('feComposite'); g.setAttribute('in', i + '_drop_shadow_3'), g.setAttribute('in2', i + '_drop_shadow_2'), g.setAttribute('operator', 'in'), g.setAttribute('result', i + '_drop_shadow_4'), e.appendChild(g); var S = this.createMergeNode(i, [i + '_drop_shadow_4', s]); e.appendChild(S); } extendPrototype([SVGComposableEffect], SVGDropShadowEffect), (SVGDropShadowEffect.prototype.renderFrame = function (e) { if (e || this.filterManager._mdf) { if ( ((e || this.filterManager.effectElements[4].p._mdf) && this.feGaussianBlur.setAttribute( 'stdDeviation', this.filterManager.effectElements[4].p.v / 4 ), e || this.filterManager.effectElements[0].p._mdf) ) { var t = this.filterManager.effectElements[0].p.v; this.feFlood.setAttribute( 'flood-color', rgbToHex( Math.round(t[0] * 255), Math.round(t[1] * 255), Math.round(t[2] * 255) ) ); } if ( ((e || this.filterManager.effectElements[1].p._mdf) && this.feFlood.setAttribute( 'flood-opacity', this.filterManager.effectElements[1].p.v / 255 ), e || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) ) { var r = this.filterManager.effectElements[3].p.v, i = (this.filterManager.effectElements[2].p.v - 90) * degToRads, s = r * Math.cos(i), n = r * Math.sin(i); this.feOffset.setAttribute('dx', s), this.feOffset.setAttribute('dy', n); } } }); var _svgMatteSymbols = []; function SVGMatte3Effect(e, t, r) { (this.initialized = !1), (this.filterManager = t), (this.filterElem = e), (this.elem = r), (r.matteElement = createNS('g')), r.matteElement.appendChild(r.layerElement), r.matteElement.appendChild(r.transformedElement), (r.baseElement = r.matteElement); } (SVGMatte3Effect.prototype.findSymbol = function (e) { for (var t = 0, r = _svgMatteSymbols.length; t < r; ) { if (_svgMatteSymbols[t] === e) return _svgMatteSymbols[t]; t += 1; } return null; }), (SVGMatte3Effect.prototype.replaceInParent = function (e, t) { var r = e.layerElement.parentNode; if (r) { for ( var i = r.children, s = 0, n = i.length; s < n && i[s] !== e.layerElement; ) s += 1; var a; s <= n - 2 && (a = i[s + 1]); var o = createNS('use'); o.setAttribute('href', '#' + t), a ? r.insertBefore(o, a) : r.appendChild(o); } }), (SVGMatte3Effect.prototype.setElementAsMask = function (e, t) { if (!this.findSymbol(t)) { var r = createElementID(), i = createNS('mask'); i.setAttribute('id', t.layerId), i.setAttribute('mask-type', 'alpha'), _svgMatteSymbols.push(t); var s = e.globalData.defs; s.appendChild(i); var n = createNS('symbol'); n.setAttribute('id', r), this.replaceInParent(t, r), n.appendChild(t.layerElement), s.appendChild(n); var a = createNS('use'); a.setAttribute('href', '#' + r), i.appendChild(a), (t.data.hd = !1), t.show(); } e.setMatte(t.layerId); }), (SVGMatte3Effect.prototype.initialize = function () { for ( var e = this.filterManager.effectElements[0].p.v, t = this.elem.comp.elements, r = 0, i = t.length; r < i; ) t[r] && t[r].data.ind === e && this.setElementAsMask(this.elem, t[r]), (r += 1); this.initialized = !0; }), (SVGMatte3Effect.prototype.renderFrame = function () { this.initialized || this.initialize(); }); function SVGGaussianBlurEffect(e, t, r, i) { e.setAttribute('x', '-100%'), e.setAttribute('y', '-100%'), e.setAttribute('width', '300%'), e.setAttribute('height', '300%'), (this.filterManager = t); var s = createNS('feGaussianBlur'); s.setAttribute('result', i), e.appendChild(s), (this.feGaussianBlur = s); } return ( (SVGGaussianBlurEffect.prototype.renderFrame = function (e) { if (e || this.filterManager._mdf) { var t = 0.3, r = this.filterManager.effectElements[0].p.v * t, i = this.filterManager.effectElements[1].p.v, s = i == 3 ? 0 : r, n = i == 2 ? 0 : r; this.feGaussianBlur.setAttribute('stdDeviation', s + ' ' + n); var a = this.filterManager.effectElements[2].p.v == 1 ? 'wrap' : 'duplicate'; this.feGaussianBlur.setAttribute('edgeMode', a); } }), registerRenderer('canvas', CanvasRenderer), registerRenderer('html', HybridRenderer), registerRenderer('svg', SVGRenderer), ShapeModifiers.registerModifier('tm', TrimModifier), ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier), ShapeModifiers.registerModifier('rp', RepeaterModifier), ShapeModifiers.registerModifier('rd', RoundCornersModifier), ShapeModifiers.registerModifier('zz', ZigZagModifier), ShapeModifiers.registerModifier('op', OffsetPathModifier), setExpressionsPlugin(Expressions), setExpressionInterfaces(getInterface), initialize$1(), initialize(), registerEffect(20, SVGTintFilter, !0), registerEffect(21, SVGFillFilter, !0), registerEffect(22, SVGStrokeEffect, !1), registerEffect(23, SVGTritoneFilter, !0), registerEffect(24, SVGProLevelsFilter, !0), registerEffect(25, SVGDropShadowEffect, !0), registerEffect(28, SVGMatte3Effect, !1), registerEffect(29, SVGGaussianBlurEffect, !0), lottie ); }); })(lottie, lottieExports); const Lottie = lottieExports; var freeGlobal = typeof global == 'object' && global && global.Object === Object && global, freeGlobal$1 = freeGlobal, freeSelf = typeof self == 'object' && self && self.Object === Object && self, root = freeGlobal$1 || freeSelf || Function('return this')(), root$1 = root, Symbol$1 = root$1.Symbol, Symbol$2 = Symbol$1, objectProto$e = Object.prototype, hasOwnProperty$b = objectProto$e.hasOwnProperty, nativeObjectToString$1 = objectProto$e.toString, symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; function getRawTag(e) { var t = hasOwnProperty$b.call(e, symToStringTag$1), r = e[symToStringTag$1]; try { e[symToStringTag$1] = void 0; var i = !0; } catch {} var s = nativeObjectToString$1.call(e); return i && (t ? (e[symToStringTag$1] = r) : delete e[symToStringTag$1]), s; } var objectProto$d = Object.prototype, nativeObjectToString = objectProto$d.toString; function objectToString(e) { return nativeObjectToString.call(e); } var nullTag = '[object Null]', undefinedTag = '[object Undefined]', symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0; function baseGetTag(e) { return e == null ? e === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(e) ? getRawTag(e) : objectToString(e); } function isObjectLike(e) { return e != null && typeof e == 'object'; } var isArray$2 = Array.isArray, isArray$1$1 = isArray$2; function isObject$2(e) { var t = typeof e; return e != null && (t == 'object' || t == 'function'); } var asyncTag = '[object AsyncFunction]', funcTag$2 = '[object Function]', genTag$1 = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; function isFunction$2(e) { if (!isObject$2(e)) return !1; var t = baseGetTag(e); return t == funcTag$2 || t == genTag$1 || t == asyncTag || t == proxyTag; } var coreJsData = root$1['__core-js_shared__'], coreJsData$1 = coreJsData, maskSrcKey = (function () { var e = /[^.]+$/.exec( (coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO) || '' ); return e ? 'Symbol(src)_1.' + e : ''; })(); function isMasked(e) { return !!maskSrcKey && maskSrcKey in e; } var funcProto$1 = Function.prototype, funcToString$1 = funcProto$1.toString; function toSource(e) { if (e != null) { try { return funcToString$1.call(e); } catch {} try { return e + ''; } catch {} } return ''; } var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto = Function.prototype, objectProto$c = Object.prototype, funcToString = funcProto.toString, hasOwnProperty$a = objectProto$c.hasOwnProperty, reIsNative = RegExp( '^' + funcToString .call(hasOwnProperty$a) .replace(reRegExpChar, '\\$&') .replace( /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?' ) + '$' ); function baseIsNative(e) { if (!isObject$2(e) || isMasked(e)) return !1; var t = isFunction$2(e) ? reIsNative : reIsHostCtor; return t.test(toSource(e)); } function getValue(e, t) { return e == null ? void 0 : e[t]; } function getNative(e, t) { var r = getValue(e, t); return baseIsNative(r) ? r : void 0; } var WeakMap$1 = getNative(root$1, 'WeakMap'), WeakMap$1$1 = WeakMap$1, objectCreate = Object.create, baseCreate = (function () { function e() {} return function (t) { if (!isObject$2(t)) return {}; if (objectCreate) return objectCreate(t); e.prototype = t; var r = new e(); return (e.prototype = void 0), r; }; })(), baseCreate$1 = baseCreate; function copyArray(e, t) { var r = -1, i = e.length; for (t || (t = Array(i)); ++r < i; ) t[r] = e[r]; return t; } var defineProperty = (function () { try { var e = getNative(Object, 'defineProperty'); return e({}, '', {}), e; } catch {} })(), defineProperty$1 = defineProperty; function arrayEach(e, t) { for ( var r = -1, i = e == null ? 0 : e.length; ++r < i && t(e[r], r, e) !== !1; ); return e; } var MAX_SAFE_INTEGER$1 = 9007199254740991, reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(e, t) { var r = typeof e; return ( (t = t ?? MAX_SAFE_INTEGER$1), !!t && (r == 'number' || (r != 'symbol' && reIsUint.test(e))) && e > -1 && e % 1 == 0 && e < t ); } function baseAssignValue(e, t, r) { t == '__proto__' && defineProperty$1 ? defineProperty$1(e, t, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : (e[t] = r); } function eq(e, t) { return e === t || (e !== e && t !== t); } var objectProto$b = Object.prototype, hasOwnProperty$9 = objectProto$b.hasOwnProperty; function assignValue(e, t, r) { var i = e[t]; (!(hasOwnProperty$9.call(e, t) && eq(i, r)) || (r === void 0 && !(t in e))) && baseAssignValue(e, t, r); } function copyObject(e, t, r, i) { var s = !r; r || (r = {}); for (var n = -1, a = t.length; ++n < a; ) { var o = t[n], l = i ? i(r[o], e[o], o, r, e) : void 0; l === void 0 && (l = e[o]), s ? baseAssignValue(r, o, l) : assignValue(r, o, l); } return r; } var MAX_SAFE_INTEGER = 9007199254740991; function isLength(e) { return typeof e == 'number' && e > -1 && e % 1 == 0 && e <= MAX_SAFE_INTEGER; } function isArrayLike(e) { return e != null && isLength(e.length) && !isFunction$2(e); } var objectProto$a = Object.prototype; function isPrototype(e) { var t = e && e.constructor, r = (typeof t == 'function' && t.prototype) || objectProto$a; return e === r; } function baseTimes(e, t) { for (var r = -1, i = Array(e); ++r < e; ) i[r] = t(r); return i; } var argsTag$3 = '[object Arguments]'; function baseIsArguments(e) { return isObjectLike(e) && baseGetTag(e) == argsTag$3; } var objectProto$9 = Object.prototype, hasOwnProperty$8 = objectProto$9.hasOwnProperty, propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable, isArguments = baseIsArguments( (function () { return arguments; })() ) ? baseIsArguments : function (e) { return ( isObjectLike(e) && hasOwnProperty$8.call(e, 'callee') && !propertyIsEnumerable$1.call(e, 'callee') ); }, isArguments$1 = isArguments; function stubFalse() { return !1; } var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports, freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module, moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2, Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0, nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0, isBuffer = nativeIsBuffer || stubFalse, isBuffer$1 = isBuffer, argsTag$2 = '[object Arguments]', arrayTag$2 = '[object Array]', boolTag$3 = '[object Boolean]', dateTag$3 = '[object Date]', errorTag$2 = '[object Error]', funcTag$1 = '[object Function]', mapTag$5 = '[object Map]', numberTag$3 = '[object Number]', objectTag$3 = '[object Object]', regexpTag$3 = '[object RegExp]', setTag$5 = '[object Set]', stringTag$3 = '[object String]', weakMapTag$2 = '[object WeakMap]', arrayBufferTag$3 = '[object ArrayBuffer]', dataViewTag$4 = '[object DataView]', float32Tag$2 = '[object Float32Array]', float64Tag$2 = '[object Float64Array]', int8Tag$2 = '[object Int8Array]', int16Tag$2 = '[object Int16Array]', int32Tag$2 = '[object Int32Array]', uint8Tag$2 = '[object Uint8Array]', uint8ClampedTag$2 = '[object Uint8ClampedArray]', uint16Tag$2 = '[object Uint16Array]', uint32Tag$2 = '[object Uint32Array]', typedArrayTags = {}; typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = !0; typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = !1; function baseIsTypedArray(e) { return ( isObjectLike(e) && isLength(e.length) && !!typedArrayTags[baseGetTag(e)] ); } function baseUnary(e) { return function (t) { return e(t); }; } var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports, freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module, moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1, freeProcess = moduleExports$1 && freeGlobal$1.process, nodeUtil = (function () { try { var e = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types; return ( e || (freeProcess && freeProcess.binding && freeProcess.binding('util')) ); } catch {} })(), nodeUtil$1 = nodeUtil, nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray, isTypedArray$1 = isTypedArray, objectProto$8 = Object.prototype, hasOwnProperty$7 = objectProto$8.hasOwnProperty; function arrayLikeKeys(e, t) { var r = isArray$1$1(e), i = !r && isArguments$1(e), s = !r && !i && isBuffer$1(e), n = !r && !i && !s && isTypedArray$1(e), a = r || i || s || n, o = a ? baseTimes(e.length, String) : [], l = o.length; for (var c in e) (t || hasOwnProperty$7.call(e, c)) && !( a && (c == 'length' || (s && (c == 'offset' || c == 'parent')) || (n && (c == 'buffer' || c == 'byteLength' || c == 'byteOffset')) || isIndex(c, l)) ) && o.push(c); return o; } function overArg(e, t) { return function (r) { return e(t(r)); }; } var nativeKeys = overArg(Object.keys, Object), nativeKeys$1 = nativeKeys, objectProto$7 = Object.prototype, hasOwnProperty$6 = objectProto$7.hasOwnProperty; function baseKeys(e) { if (!isPrototype(e)) return nativeKeys$1(e); var t = []; for (var r in Object(e)) hasOwnProperty$6.call(e, r) && r != 'constructor' && t.push(r); return t; } function keys(e) { return isArrayLike(e) ? arrayLikeKeys(e) : baseKeys(e); } function nativeKeysIn(e) { var t = []; if (e != null) for (var r in Object(e)) t.push(r); return t; } var objectProto$6 = Object.prototype, hasOwnProperty$5 = objectProto$6.hasOwnProperty; function baseKeysIn(e) { if (!isObject$2(e)) return nativeKeysIn(e); var t = isPrototype(e), r = []; for (var i in e) (i == 'constructor' && (t || !hasOwnProperty$5.call(e, i))) || r.push(i); return r; } function keysIn(e) { return isArrayLike(e) ? arrayLikeKeys(e, !0) : baseKeysIn(e); } var nativeCreate = getNative(Object, 'create'), nativeCreate$1 = nativeCreate; function hashClear() { (this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {}), (this.size = 0); } function hashDelete(e) { var t = this.has(e) && delete this.__data__[e]; return (this.size -= t ? 1 : 0), t; } var HASH_UNDEFINED$2 = '__lodash_hash_undefined__', objectProto$5 = Object.prototype, hasOwnProperty$4 = objectProto$5.hasOwnProperty; function hashGet(e) { var t = this.__data__; if (nativeCreate$1) { var r = t[e]; return r === HASH_UNDEFINED$2 ? void 0 : r; } return hasOwnProperty$4.call(t, e) ? t[e] : void 0; } var objectProto$4 = Object.prototype, hasOwnProperty$3 = objectProto$4.hasOwnProperty; function hashHas(e) { var t = this.__data__; return nativeCreate$1 ? t[e] !== void 0 : hasOwnProperty$3.call(t, e); } var HASH_UNDEFINED$1 = '__lodash_hash_undefined__'; function hashSet(e, t) { var r = this.__data__; return ( (this.size += this.has(e) ? 0 : 1), (r[e] = nativeCreate$1 && t === void 0 ? HASH_UNDEFINED$1 : t), this ); } function Hash(e) { var t = -1, r = e == null ? 0 : e.length; for (this.clear(); ++t < r; ) { var i = e[t]; this.set(i[0], i[1]); } } Hash.prototype.clear = hashClear; Hash.prototype.delete = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; function listCacheClear() { (this.__data__ = []), (this.size = 0); } function assocIndexOf(e, t) { for (var r = e.length; r--; ) if (eq(e[r][0], t)) return r; return -1; } var arrayProto = Array.prototype, splice = arrayProto.splice; function listCacheDelete(e) { var t = this.__data__, r = assocIndexOf(t, e); if (r < 0) return !1; var i = t.length - 1; return r == i ? t.pop() : splice.call(t, r, 1), --this.size, !0; } function listCacheGet(e) { var t = this.__data__, r = assocIndexOf(t, e); return r < 0 ? void 0 : t[r][1]; } function listCacheHas(e) { return assocIndexOf(this.__data__, e) > -1; } function listCacheSet(e, t) { var r = this.__data__, i = assocIndexOf(r, e); return i < 0 ? (++this.size, r.push([e, t])) : (r[i][1] = t), this; } function ListCache(e) { var t = -1, r = e == null ? 0 : e.length; for (this.clear(); ++t < r; ) { var i = e[t]; this.set(i[0], i[1]); } } ListCache.prototype.clear = listCacheClear; ListCache.prototype.delete = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; var Map = getNative(root$1, 'Map'), Map$1 = Map; function mapCacheClear() { (this.size = 0), (this.__data__ = { hash: new Hash(), map: new (Map$1 || ListCache)(), string: new Hash() }); } function isKeyable(e) { var t = typeof e; return t == 'string' || t == 'number' || t == 'symbol' || t == 'boolean' ? e !== '__proto__' : e === null; } function getMapData(e, t) { var r = e.__data__; return isKeyable(t) ? r[typeof t == 'string' ? 'string' : 'hash'] : r.map; } function mapCacheDelete(e) { var t = getMapData(this, e).delete(e); return (this.size -= t ? 1 : 0), t; } function mapCacheGet(e) { return getMapData(this, e).get(e); } function mapCacheHas(e) { return getMapData(this, e).has(e); } function mapCacheSet(e, t) { var r = getMapData(this, e), i = r.size; return r.set(e, t), (this.size += r.size == i ? 0 : 1), this; } function MapCache(e) { var t = -1, r = e == null ? 0 : e.length; for (this.clear(); ++t < r; ) { var i = e[t]; this.set(i[0], i[1]); } } MapCache.prototype.clear = mapCacheClear; MapCache.prototype.delete = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; function arrayPush(e, t) { for (var r = -1, i = t.length, s = e.length; ++r < i; ) e[s + r] = t[r]; return e; } var getPrototype = overArg(Object.getPrototypeOf, Object), getPrototype$1 = getPrototype; function stackClear() { (this.__data__ = new ListCache()), (this.size = 0); } function stackDelete(e) { var t = this.__data__, r = t.delete(e); return (this.size = t.size), r; } function stackGet(e) { return this.__data__.get(e); } function stackHas(e) { return this.__data__.has(e); } var LARGE_ARRAY_SIZE = 200; function stackSet(e, t) { var r = this.__data__; if (r instanceof ListCache) { var i = r.__data__; if (!Map$1 || i.length < LARGE_ARRAY_SIZE - 1) return i.push([e, t]), (this.size = ++r.size), this; r = this.__data__ = new MapCache(i); } return r.set(e, t), (this.size = r.size), this; } function Stack(e) { var t = (this.__data__ = new ListCache(e)); this.size = t.size; } Stack.prototype.clear = stackClear; Stack.prototype.delete = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; function baseAssign(e, t) { return e && copyObject(t, keys(t), e); } function baseAssignIn(e, t) { return e && copyObject(t, keysIn(t), e); } var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports, freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, Buffer = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0; function cloneBuffer(e, t) { if (t) return e.slice(); var r = e.length, i = allocUnsafe ? allocUnsafe(r) : new e.constructor(r); return e.copy(i), i; } function arrayFilter(e, t) { for (var r = -1, i = e == null ? 0 : e.length, s = 0, n = []; ++r < i; ) { var a = e[r]; t(a, r, e) && (n[s++] = a); } return n; } function stubArray() { return []; } var objectProto$3 = Object.prototype, propertyIsEnumerable = objectProto$3.propertyIsEnumerable, nativeGetSymbols$1 = Object.getOwnPropertySymbols, getSymbols = nativeGetSymbols$1 ? function (e) { return e == null ? [] : ((e = Object(e)), arrayFilter(nativeGetSymbols$1(e), function (t) { return propertyIsEnumerable.call(e, t); })); } : stubArray, getSymbols$1 = getSymbols; function copySymbols(e, t) { return copyObject(e, getSymbols$1(e), t); } var nativeGetSymbols = Object.getOwnPropertySymbols, getSymbolsIn = nativeGetSymbols ? function (e) { for (var t = []; e; ) arrayPush(t, getSymbols$1(e)), (e = getPrototype$1(e)); return t; } : stubArray, getSymbolsIn$1 = getSymbolsIn; function copySymbolsIn(e, t) { return copyObject(e, getSymbolsIn$1(e), t); } function baseGetAllKeys(e, t, r) { var i = t(e); return isArray$1$1(e) ? i : arrayPush(i, r(e)); } function getAllKeys(e) { return baseGetAllKeys(e, keys, getSymbols$1); } function getAllKeysIn(e) { return baseGetAllKeys(e, keysIn, getSymbolsIn$1); } var DataView = getNative(root$1, 'DataView'), DataView$1 = DataView, Promise$1 = getNative(root$1, 'Promise'), Promise$2 = Promise$1, Set = getNative(root$1, 'Set'), Set$1 = Set, mapTag$4 = '[object Map]', objectTag$2 = '[object Object]', promiseTag = '[object Promise]', setTag$4 = '[object Set]', weakMapTag$1 = '[object WeakMap]', dataViewTag$3 = '[object DataView]', dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1$1), getTag = baseGetTag; ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3) || (Map$1 && getTag(new Map$1()) != mapTag$4) || (Promise$2 && getTag(Promise$2.resolve()) != promiseTag) || (Set$1 && getTag(new Set$1()) != setTag$4) || (WeakMap$1$1 && getTag(new WeakMap$1$1()) != weakMapTag$1)) && (getTag = function (e) { var t = baseGetTag(e), r = t == objectTag$2 ? e.constructor : void 0, i = r ? toSource(r) : ''; if (i) switch (i) { case dataViewCtorString: return dataViewTag$3; case mapCtorString: return mapTag$4; case promiseCtorString: return promiseTag; case setCtorString: return setTag$4; case weakMapCtorString: return weakMapTag$1; } return t; }); var getTag$1 = getTag, objectProto$2 = Object.prototype, hasOwnProperty$2 = objectProto$2.hasOwnProperty; function initCloneArray(e) { var t = e.length, r = new e.constructor(t); return ( t && typeof e[0] == 'string' && hasOwnProperty$2.call(e, 'index') && ((r.index = e.index), (r.input = e.input)), r ); } var Uint8Array$1 = root$1.Uint8Array, Uint8Array$1$1 = Uint8Array$1; function cloneArrayBuffer(e) { var t = new e.constructor(e.byteLength); return new Uint8Array$1$1(t).set(new Uint8Array$1$1(e)), t; } function cloneDataView(e, t) { var r = t ? cloneArrayBuffer(e.buffer) : e.buffer; return new e.constructor(r, e.byteOffset, e.byteLength); } var reFlags = /\w*$/; function cloneRegExp(e) { var t = new e.constructor(e.source, reFlags.exec(e)); return (t.lastIndex = e.lastIndex), t; } var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0; function cloneSymbol(e) { return symbolValueOf$1 ? Object(symbolValueOf$1.call(e)) : {}; } function cloneTypedArray(e, t) { var r = t ? cloneArrayBuffer(e.buffer) : e.buffer; return new e.constructor(r, e.byteOffset, e.length); } var boolTag$2 = '[object Boolean]', dateTag$2 = '[object Date]', mapTag$3 = '[object Map]', numberTag$2 = '[object Number]', regexpTag$2 = '[object RegExp]', setTag$3 = '[object Set]', stringTag$2 = '[object String]', symbolTag$2 = '[object Symbol]', arrayBufferTag$2 = '[object ArrayBuffer]', dataViewTag$2 = '[object DataView]', float32Tag$1 = '[object Float32Array]', float64Tag$1 = '[object Float64Array]', int8Tag$1 = '[object Int8Array]', int16Tag$1 = '[object Int16Array]', int32Tag$1 = '[object Int32Array]', uint8Tag$1 = '[object Uint8Array]', uint8ClampedTag$1 = '[object Uint8ClampedArray]', uint16Tag$1 = '[object Uint16Array]', uint32Tag$1 = '[object Uint32Array]'; function initCloneByTag(e, t, r) { var i = e.constructor; switch (t) { case arrayBufferTag$2: return cloneArrayBuffer(e); case boolTag$2: case dateTag$2: return new i(+e); case dataViewTag$2: return cloneDataView(e, r); case float32Tag$1: case float64Tag$1: case int8Tag$1: case int16Tag$1: case int32Tag$1: case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1: return cloneTypedArray(e, r); case mapTag$3: return new i(); case numberTag$2: case stringTag$2: return new i(e); case regexpTag$2: return cloneRegExp(e); case setTag$3: return new i(); case symbolTag$2: return cloneSymbol(e); } } function initCloneObject(e) { return typeof e.constructor == 'function' && !isPrototype(e) ? baseCreate$1(getPrototype$1(e)) : {}; } var mapTag$2 = '[object Map]'; function baseIsMap(e) { return isObjectLike(e) && getTag$1(e) == mapTag$2; } var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap, isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap, isMap$1 = isMap, setTag$2 = '[object Set]'; function baseIsSet(e) { return isObjectLike(e) && getTag$1(e) == setTag$2; } var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet, isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet, isSet$1 = isSet, CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4, argsTag$1 = '[object Arguments]', arrayTag$1 = '[object Array]', boolTag$1 = '[object Boolean]', dateTag$1 = '[object Date]', errorTag$1 = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag$1 = '[object Map]', numberTag$1 = '[object Number]', objectTag$1 = '[object Object]', regexpTag$1 = '[object RegExp]', setTag$1 = '[object Set]', stringTag$1 = '[object String]', symbolTag$1 = '[object Symbol]', weakMapTag = '[object WeakMap]', arrayBufferTag$1 = '[object ArrayBuffer]', dataViewTag$1 = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]', cloneableTags = {}; cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = !0; cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = !1; function baseClone(e, t, r, i, s, n) { var a, o = t & CLONE_DEEP_FLAG$1, l = t & CLONE_FLAT_FLAG, c = t & CLONE_SYMBOLS_FLAG$1; if ((r && (a = s ? r(e, i, s, n) : r(e)), a !== void 0)) return a; if (!isObject$2(e)) return e; var g = isArray$1$1(e); if (g) { if (((a = initCloneArray(e)), !o)) return copyArray(e, a); } else { var S = getTag$1(e), p = S == funcTag || S == genTag; if (isBuffer$1(e)) return cloneBuffer(e, o); if (S == objectTag$1 || S == argsTag$1 || (p && !s)) { if (((a = l || p ? {} : initCloneObject(e)), !o)) return l ? copySymbolsIn(e, baseAssignIn(a, e)) : copySymbols(e, baseAssign(a, e)); } else { if (!cloneableTags[S]) return s ? e : {}; a = initCloneByTag(e, S, o); } } n || (n = new Stack()); var P = n.get(e); if (P) return P; n.set(e, a), isSet$1(e) ? e.forEach(function (A) { a.add(baseClone(A, t, r, A, e, n)); }) : isMap$1(e) && e.forEach(function (A, u) { a.set(u, baseClone(A, t, r, u, e, n)); }); var b = c ? (l ? getAllKeysIn : getAllKeys) : l ? keysIn : keys, y = g ? void 0 : b(e); return ( arrayEach(y || e, function (A, u) { y && ((u = A), (A = e[u])), assignValue(a, u, baseClone(A, t, r, u, e, n)); }), a ); } var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; function cloneDeep$1(e) { return baseClone(e, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } var HASH_UNDEFINED = '__lodash_hash_undefined__'; function setCacheAdd(e) { return this.__data__.set(e, HASH_UNDEFINED), this; } function setCacheHas(e) { return this.__data__.has(e); } function SetCache(e) { var t = -1, r = e == null ? 0 : e.length; for (this.__data__ = new MapCache(); ++t < r; ) this.add(e[t]); } SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; function arraySome(e, t) { for (var r = -1, i = e == null ? 0 : e.length; ++r < i; ) if (t(e[r], r, e)) return !0; return !1; } function cacheHas(e, t) { return e.has(t); } var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2; function equalArrays(e, t, r, i, s, n) { var a = r & COMPARE_PARTIAL_FLAG$3, o = e.length, l = t.length; if (o != l && !(a && l > o)) return !1; var c = n.get(e), g = n.get(t); if (c && g) return c == t && g == e; var S = -1, p = !0, P = r & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0; for (n.set(e, t), n.set(t, e); ++S < o; ) { var b = e[S], y = t[S]; if (i) var A = a ? i(y, b, S, t, e, n) : i(b, y, S, e, t, n); if (A !== void 0) { if (A) continue; p = !1; break; } if (P) { if ( !arraySome(t, function (u, f) { if (!cacheHas(P, f) && (b === u || s(b, u, r, i, n))) return P.push(f); }) ) { p = !1; break; } } else if (!(b === y || s(b, y, r, i, n))) { p = !1; break; } } return n.delete(e), n.delete(t), p; } function mapToArray(e) { var t = -1, r = Array(e.size); return ( e.forEach(function (i, s) { r[++t] = [s, i]; }), r ); } function setToArray(e) { var t = -1, r = Array(e.size); return ( e.forEach(function (i) { r[++t] = i; }), r ); } var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2, boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; function equalByTag(e, t, r, i, s, n, a) { switch (r) { case dataViewTag: if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1; (e = e.buffer), (t = t.buffer); case arrayBufferTag: return !( e.byteLength != t.byteLength || !n(new Uint8Array$1$1(e), new Uint8Array$1$1(t)) ); case boolTag: case dateTag: case numberTag: return eq(+e, +t); case errorTag: return e.name == t.name && e.message == t.message; case regexpTag: case stringTag: return e == t + ''; case mapTag: var o = mapToArray; case setTag: var l = i & COMPARE_PARTIAL_FLAG$2; if ((o || (o = setToArray), e.size != t.size && !l)) return !1; var c = a.get(e); if (c) return c == t; (i |= COMPARE_UNORDERED_FLAG), a.set(e, t); var g = equalArrays(o(e), o(t), i, s, n, a); return a.delete(e), g; case symbolTag: if (symbolValueOf) return symbolValueOf.call(e) == symbolValueOf.call(t); } return !1; } var COMPARE_PARTIAL_FLAG$1 = 1, objectProto$1 = Object.prototype, hasOwnProperty$1 = objectProto$1.hasOwnProperty; function equalObjects(e, t, r, i, s, n) { var a = r & COMPARE_PARTIAL_FLAG$1, o = getAllKeys(e), l = o.length, c = getAllKeys(t), g = c.length; if (l != g && !a) return !1; for (var S = l; S--; ) { var p = o[S]; if (!(a ? p in t : hasOwnProperty$1.call(t, p))) return !1; } var P = n.get(e), b = n.get(t); if (P && b) return P == t && b == e; var y = !0; n.set(e, t), n.set(t, e); for (var A = a; ++S < l; ) { p = o[S]; var u = e[p], f = t[p]; if (i) var m = a ? i(f, u, p, t, e, n) : i(u, f, p, e, t, n); if (!(m === void 0 ? u === f || s(u, f, r, i, n) : m)) { y = !1; break; } A || (A = p == 'constructor'); } if (y && !A) { var d = e.constructor, E = t.constructor; d != E && 'constructor' in e && 'constructor' in t && !( typeof d == 'function' && d instanceof d && typeof E == 'function' && E instanceof E ) && (y = !1); } return n.delete(e), n.delete(t), y; } var COMPARE_PARTIAL_FLAG = 1, argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]', objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty; function baseIsEqualDeep(e, t, r, i, s, n) { var a = isArray$1$1(e), o = isArray$1$1(t), l = a ? arrayTag : getTag$1(e), c = o ? arrayTag : getTag$1(t); (l = l == argsTag ? objectTag : l), (c = c == argsTag ? objectTag : c); var g = l == objectTag, S = c == objectTag, p = l == c; if (p && isBuffer$1(e)) { if (!isBuffer$1(t)) return !1; (a = !0), (g = !1); } if (p && !g) return ( n || (n = new Stack()), a || isTypedArray$1(e) ? equalArrays(e, t, r, i, s, n) : equalByTag(e, t, l, r, i, s, n) ); if (!(r & COMPARE_PARTIAL_FLAG)) { var P = g && hasOwnProperty.call(e, '__wrapped__'), b = S && hasOwnProperty.call(t, '__wrapped__'); if (P || b) { var y = P ? e.value() : e, A = b ? t.value() : t; return n || (n = new Stack()), s(y, A, r, i, n); } } return p ? (n || (n = new Stack()), equalObjects(e, t, r, i, s, n)) : !1; } function baseIsEqual(e, t, r, i, s) { return e === t ? !0 : e == null || t == null || (!isObjectLike(e) && !isObjectLike(t)) ? e !== e && t !== t : baseIsEqualDeep(e, t, r, i, baseIsEqual, s); } function isEqual(e, t) { return baseIsEqual(e, t); } var _export_sfc = (e, t) => { const r = e.__vccOpts || e; for (const [i, s] of t) r[i] = s; return r; }; const _sfc_main = defineComponent({ props: { animationData: { type: Object, default: () => ({}) }, animationLink: { type: String, default: '' }, loop: { type: [Boolean, Number], default: !0 }, autoPlay: { type: Boolean, default: !0 }, width: { type: [Number, String], default: '100%' }, height: { type: [Number, String], default: '100%' }, speed: { type: Number, default: 1 }, delay: { type: Number, default: 0 }, direction: { type: String, default: 'forward' }, pauseOnHover: { type: Boolean, default: !1 }, playOnHover: { type: Boolean, default: !1 }, backgroundColor: { type: String, default: 'transparent' }, pauseAnimation: { type: Boolean, default: !1 }, renderer: { type: String, default: 'svg' }, rendererSettings: { type: Object, default: () => ({}) }, assetsPath: { type: String, default: '' } }, emits: { onComplete: null, onLoopComplete: null, onEnterFrame: null, onSegmentStart: null, onAnimationLoaded: null }, setup(e, { emit: t }) { let r = ref(null); const i = ref(''); let s = 1; const n = _ => document.querySelector(`[data-id="${_}"]`) !== null, a = async _ => { let I = e.autoPlay; e.playOnHover && (I = !1); let V = {}; if ( (isEqual(e.animationData, {}) === !1 && (V = cloneDeep$1(e.animationData)), e.animationLink != '') ) try { V = await (await fetch(e.animationLink)).json(); } catch ($) { console.error($); return; } let D = e.loop; typeof D == 'number' && D > 0 && (D = D - 1), e.delay > 0 && (I = !1); const N = { container: _, renderer: e.renderer, loop: D, autoplay: I, animationData: V, assetsPath: e.assetsPath }; isEqual(e.rendererSettings, {}) === !1 && (N.rendererSettings = e.rendererSettings), (r = Lottie.loadAnimation(N)), setTimeout(() => { (I = e.autoPlay), e.playOnHover ? r.pause() : I ? r.play() : r.pause(), t('onAnimationLoaded'); }, e.delay), r.setSpeed(e.speed), e.direction === 'reverse' && r.setDirection(-1), e.direction === 'normal' && r.setDirection(1), (e.pauseAnimation || e.playOnHover) && r.pause(), r.addEventListener('loopComplete', () => { e.direction === 'alternate' && (r.stop(), (s = s * -1), r.setDirection(s), r.play()), t('onLoopComplete'); }), r.addEventListener('complete', () => { t('onComplete'); }), r.addEventListener('enterFrame', () => { t('onEnterFrame'); }), r.addEventListener('segmentStart', () => { t('onSegmentStart'); }); }, o = computed(() => { let _ = e.width, I = e.height; return ( typeof e.width == 'number' && (_ = `${e.width}px`), typeof e.height == 'number' && (I = `${e.height}px`), { '--lottie-animation-container-width': _, '--lottie-animation-container-height': I, '--lottie-animation-container-background-color': e.backgroundColor } ); }), l = () => { r && e.pauseOnHover && r.pause(), r && e.playOnHover && r.play(); }, c = () => { r && e.pauseOnHover && r.play(), r && e.playOnHover && r.pause(); }; watch( () => e.pauseAnimation, () => { if ((e.pauseOnHover || e.playOnHover) && e.pauseAnimation) { console.error( 'If you are using pauseAnimation prop for Vue3-Lottie, please remove the props pauseOnHover and playOnHover' ); return; } r && (e.pauseAnimation ? r.pause() : r.play()); } ); const g = () => { r && r.play(); }, S = () => { r && r.pause(); }, p = () => { r && r.stop(); }, P = () => { r && r.destroy(); }, b = (_ = 1) => { if (_ <= 0) throw new Error('Speed must be greater than 0'); r && r.setSpeed(_); }, y = _ => { r && (_ === 'forward' ? r.setDirection(1) : _ === 'reverse' && r.setDirection(-1)); }, A = (_, I = !0) => { r && r.goToAndStop(_, I); }, u = (_, I = !0) => { r && r.goToAndPlay(_, I); }, f = (_, I = !1) => { r && r.playSegments(_, I); }, m = (_ = !0) => { r && r.setSubframe(_); }, d = (_ = !0) => { if (r) return r.getDuration(_); }, E = (_, I = 0) => { r && r.renderer.elements[I].updateDocumentData(_); }, T = _ => { for ( var I = '', V = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', D = V.length, N = 0; N < _; N++ ) I += V.charAt(Math.floor(Math.random() * D)); return I; }, x = _ => { if (e.pauseOnHover && e.playOnHover) throw new Error( 'You cannot set pauseOnHover and playOnHover for Vue3-Lottie at the same time.' ); if (e.animationLink === '' && isEqual(e.animationData, {})) throw new Error( 'You must provide either animationLink or animationData' ); const I = setInterval(() => { if (n(_)) { clearInterval(I); const V = document.querySelector(`[data-id="${_}" ]`); V && a(V); } }, 0); }; return ( onMounted(async () => { (i.value = T(20)), x(i.value); }), { elementid: i, hoverEnded: c, hoverStarted: l, getCurrentStyle: o, play: g, pause: S, stop: p, destroy: P, setSpeed: b, setDirection: y, goToAndStop: A, goToAndPlay: u, playSegments: f, setSubFrame: m, getDuration: d, updateDocumentData: E } ); } }), _hoisted_1 = ['data-id']; function _sfc_render(e, t, r, i, s, n) { return ( openBlock(), createElementBlock( 'div', { 'data-id': e.elementid, class: 'lottie-animation-container', style: normalizeStyle(e.getCurrentStyle), onMouseenter: t[0] || (t[0] = (...a) => e.hoverStarted && e.hoverStarted(...a)), onMouseleave: t[1] || (t[1] = (...a) => e.hoverEnded && e.hoverEnded(...a)) }, null, 44, _hoisted_1 ) ); } var Vue3Lottie = _export_sfc(_sfc_main, [['render', _sfc_render]]); const v = '5.7.1', fr = 60, ip = 0, op = 120, w = 2436, h = 1125, nm = '合成 1', ddd = 0, assets = [ { id: 'image_0', w: 195, h: 264, u: '', p: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAEICAYAAADiJ0BpAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAgAElEQVR4nO19ebxlRXXut85tGhBoZGjAhEkRISjJQ5QYYwjghBFiVMQ5xhiHRJOoz0jEiahIElEjUcOLmJ8xosGg4hRFoy2IedHggMg8NUQF6WZqmga6++4vf1StqlW19xnu1Hc3d31w+5yzd1WtqtprrqpzBFsh7r9p1aOmNzdHgTyK4AFosFKEKwksBxj+JwEBQMZa8TV+ZvwcitC0Hu+T4R6YmpFUj6bdXDYWCKVqurlwqgMBpCiby5CESEm37Kul30Ay8dwJ4C6Qt1HkFwJ+F4PBBZze8Vu7PubEu0bP8NKELHYHJgV5zbb3rb7p+U3D14H8VeWUNpMAaDE6K2Yu7xkilQABqJlV38dylmlrgUvXbT9HCeEQASI5om/luFQZJBqxXSPU9wrwiW22HZyx06/90U/qeV7K2CqE4d4bv/lETvOjIPcLPGe0YnzIlmktoymzgsgMXDGk3lbhyEyE+FlKZq6tQmwg1RcphbBi4lxO6Yf22/03n5H72U2/qq8W0sxPukNCRAjyzF1WLDtJDn7Z3TN+KA9A9FoYSA7uvXHV36Hha0jGZ0qjlZEYCqg1JFQtF0xh3Z7KrTB1Ev18v9DMlqnQwcTI9WKbNPdzHRbFIFkA2/S72syC1KZPU6+ir1cIyEBukin+7i6PftUlrQewxNBbYSA5dd/qVR9vmuYFACptnUppWWAEQ6s/39K2hnFSOXO9m9HbblVyY6p+FfSL/pdCVGvwFk3pErQ8ztpaJcEFYjxhi7cVh5B3NAMcu/tj//h7WMIYLHYHhuG+67/5wabhC0SykU9KGQTZGOZkDCBhGMG4IsosypjJpVDtGVyb2HJ8bwQkauGsXwNjMpMJdZJqkSQPIllzQ10aAGxKbW8Z1o5ZwgCUTCpENmDR/9xWsmDqglk6af7ynBDcZUA5f8MlH9l74gf0AEQvheG+6y94CgWvslpSH3jW2qVRSwyfHGuJz9q4R1Yb1zBuB1AKh7YZGCtbjczxtdXKFsPGBDmWSA1UXcj+fym0+Vq2GtX4C7cv98mOu7AuguKVbB684b6NH0vu6BJE74SB5KDB9JmdPJutf+vhZsVoNL7RuLF665MVDm1P/9quDyGmXijfJA2c6CczZoJXy9haTobQb/U19yG5fKjGb01L6gOGj19drMbQJ5545/f+4RmdpJcAeicM969e9WSCDy0UZx3UqpUoilRPHkhlWgKjnyrhqu7aBjKd2B9RsYjuEdnkivGvyBKJmKxSdmUK+qaDkv6xoiHJAtbJgi6Lp6ndYvwqLJLL2PoN+MethpYIeicMDfkiMDM9gOyGWLfEal4biCavIufgRdckigxOTrGqK5EagaEfGmhpasuU1j3SekE5s6JvGzArA7TjYNEOTJn258pdM+9UCEVymTLTlgXABvkgnnzXZWftiiWI3gkDIY/KcaiqNiRNHPzueBslk9qHqgo6+832ThV3GAHSEkVEa1yyIgtj1hMQ4wmtK8aNyf2yMQ3ytfgh6//abc+JAFPdLPYNGX/sH+P8xQk0bdZxB0FSNq/ffBCWIHonDALsnzS2ai7VakU8AHMtfJIoAS2NV/nrNigtV5CrBTvTj9Lft+1Y+mLoR+GwgXgqafR3R2BMNrGd1M12vKF1qgC7mLfW+I3VsePXPkUrMuDmh2MJonfCQDYPjm9aWn50Nig1ED+2Y4iy3bbjY7VuQT/6+9kqFKq9oFtbmYwcYHfkkQx9w9ySa4rmuYp2peyDukz1POkEVu3W0bW231C2a3VxCWDZYnegBdKY8rb2VyeiuB59eyFvIHDOsoF8FVNYvd203HE/sHIzmodLw+Ma4rkAVsLEEEXa0bTVzdRd7hGyBbBtitHySU6sIFRpV5Rt5uko4xzlf40ZYPqf6YveKuYpp45jWePKjVQ0SwT9E4aIFHzqBQFAzc6g1GoDWSeQkx904O7/KPKYTVVT6wBcB+B83rrqTetvX/9GkG9CNXaaf/WdqOtVeUidmaeakVKALIBkF8gyYR5X6UYBmcELK6IxQGWZugxgu0WjRlTf5CClIwRfeuinMDBrypRC1X+SylMG4/XLttnmuG33f/IV45qVPY5eD+Btd1/5pVVsNp8LYNfWYlSin42UdV0i0coqGQtQaNh0IX1K7lDy6xvkVeLch2SxxNyjbbMpLZi1AMx0bQq6a5tJaRW05PS4qXxAoncxQ7bipQtjbiEH0rhtsHzqSZMIgsVOBx+3ClNTzxBgY2LMFJgY+lDPJFyss0/xInT/j8YVRUxi3L6WpgdgV7XtXVqFkEnp3fJFrYiJbdSlKhb17D2NU4oyXT1cOuifMESXIQWPkrVe6coIZEpesv3+T71hNmRWHHT8RSJ4sy6IRf8n+92BROF324xM6Ir1+7U6UbB2lCgNvMtUqxFEmyVj9u1tfFAo72IvFVK7VJdLDH2TQco7rCTTT3PfjlmWEnonDDaoY8WYthSE39zhgGO/PBdaOxx84BkYyOrEmDCuielD4d9bB9v0qbAG2h4zE2btnkvWFi/RE2Xa/LkgRJtUsO22BbVFP1K3cUs9/vkCL3nPDrdd8N59eM0Z285bowuI3sUMlmlSvr4jozRo8ME505JHblx3xXkfIZtT1ZdXTZrWHqwboerfaPvk5kg7y5THk4NWm9fPYYf68pGokoDSByyTJ/qmzVDU7JCNbRVBu1pdlIF4XkQsuj4r3Hbh6Yc0wpcBPGHNXc2+kAZrfr4Jv7jgb34iIp9aubN8QH7tL+6ZG5WFQe8sA1BpZMsoESK4f/udB1+bD1qybPB5JMbMbkqbfr4fLuTsTKyUBYG5nmW07KpkN8WO2dZJlsMwei4cr1TWsgj0bTCtgmpK1ptm6+0eMwH56am1337fM9dc+J5vTKO5jGxeT3Lf1C4AAR9FTp966x2bL7v1gtMOmxWhBUbvhCGv2jI/NGaXARCwwQ2y11PnRbvs+PDjr4RgWqJZCNpWEk/nsw3Gv1cXxLCX2eVQuU9S8Fi2FA3UrUljluwmpnjEzIWNL2iFD9WuWeMyJSGMf7oto1yRL923SXH3D85Yufai009ee9FNNxDTn6XgmDTKZKDseQ5ABPsRPP+2C967zwxIbRH0Thjyfv7qoSWXoAHQ3Dx/9GRaiDVAdmFAI4TqK6E8j9B5niAJi3a5Y2GPiUtaYy4zRyqEWduX5znKcSRX0vh3KsDapTx/1uXMFqiS46FY+5/vO2Ltd07/+L33bPofEqcS3IdpEmK7JqjP5zlUMLFyMza+ZQJSWxS9ixkK/7jQU8YPH8j280oT3D47PcbVKAsVfahXbQUAparHkmmLFo0bkzJXlcbu6GhJHxX91K6xWHaUHY3ZY6HaXr2BDwB4zRnb3rZm03NJvIYNHxvkPlun5IaxQ9DiR5YDOHb4QBcHvRMGRWAuqR5uAIlfni86vOX8He6+bf3ORdYIVTCcVKYAbIyWLYWjVqt1mSRsLMtofZu1snJV3GMQuuLUnKVftC3ZRZL6tgmw1SXtsAu3X/yBfZv7mlet/cWmlwPYvRQ+pnnJFi+3L+pKUsckYNNoDNM7N6mHwmACvwQpNBjIfe67+ksP2+4Rx10/V2obbr/3t4sVY6qJz31Rk68xdGsfj2HE5FSpxlS2IVEeqGxng+wUFEwkdvwd+5iMK9llsVrbOGKdlFkqLDHRkLL2Pz/wRDTTr27ub36Xwikr61morVumY7IbHrPVs+svAMCmmcQj26LooTDUGkx9ZDETTWyGPBvAe+ZKa5rTJySatcuRyGe6dntD6zwBCN0iJ+ZaWTZLjU1lFvSz258ItM9RV4wsAJtyp2s3/TSonMrV9uNpPSHfSzQ7hqJN0b8ybrGC1Hb5kLpfbhOfUZS+BdG7ABrIJt/un2lpYvL/8tZVO86Fzn3XfO4AsHmRugm6X8HS1cRIrVXTfRvgAkgugxjvijZ1a7JCxo+umap4hXE3oO0Y7RwvWZdLX21mqm7fBu05UQCQQRA0pG7Pv2knWaj6PEcWntb4eioNvRQGAABLLad/ZqL33HDHPe+effMcbNrYfIjANimDBBQMZ7dEDD1PEF9qS1aUExhV3T7PYN0v6/okLatNSMWUdjyt8Nj4NeXAh2SMquupOuOep47x2+SAEcr8uYjCxtBffPRPGKqHrb4mkTW1ZjuapvnTe67+0itmQ+buKz5zesPmqTaDUq8eJ1+Xdp0jM4m6EFa7FulR7XP8SxbBWIWW+9E1/vSn7WbGCj0ZQ9+0FW7kOCanfc1Kf8Xkdg5y9dzXEDpISV9QjakW5P5Zh/4JQ0SYv7ynP2hGQINEIFxsmub/3X3FF/6K5ERj4Q2rtlt32Wc+jgavSxcr3zfQZ6av2tlsjst1TWCZI/yS+dN9dUMqoUNLBqAqQOmmHactpioDW9NAu1zlRrXptT+rRSiNWwd9IwQ6oDrD1Dl/PUJPhcEEqoKklbszKATAt62/6vPfv+eqLzxtmFDwmn/f9q7LP/PidRtuvxLgi5OvXrhHpYuSy2AMfXtf+912BlS721Xp7FcbrayammU9m2HK0mPopyuVi2Qsk7UixfiL+KMqo//R9NHOg8ZVVayTy6CiX6aF+4LeuW/rr/4KkwmHPnsaHqiY0Zh7AIDIGpBfB5rVgsEdIFcSPJDAk0DuZF0L1G2iahMo6FoBsarcugZQpuxo09ZLLl9BPzVYujBi5ESdxlSldI3S2GqXpBKi7PK1LVhJP9PtnqtKoPRfNkqwmq9Mf69j3tYr/utharXL743Xgfx0DOOVC2RcCeAFoYaePzYPtxIC80gTw6j2DuWyRcjGgylXWfr72pRxD1QromCN7GNbl8HGAMm1yG23VrjTXKm6aAtqHhqLFe50BiJ/SPXJbNiSAKa5KvvLoowhWAYeRpjC/a5V7sVG79ykFMwC2TQXSQm1yalGulw2hPQQAOtXZx2mDyS5uYVFsK6ZljIBQqffXrkRJm4o/HojRK0uG6bJ9FsNoGBKMa6e5eQu+iluMdmi2K6tXtK3tCWTtvurzAjSaEx9jTxGxS2Ljd4JQxGM6QU7cYbZyiyOlZn8ITFfvKzMZh9UHSymera95J603TPVsDnLk1tIQb+yuhGCwuWL1zPTFhOQykCFgyjHb6yJtUx512+mmcJY6zKpwY1zK3YiUj/N/LOaf6BT2+cumfHnSeoVeicMQNTKhmkBlBNoTH1ZK5ZhZtqcji1KtB4cqzpZwRr6xfOrdvIUWrR0ObS09aKG7jpN9Ief51DOrYZfCpfxzbX/efxV5seUU4Zt08909UKtsErhNuNCjj90drr2QS02eicMaaLU45D8GK3LZPPuydSnBjLjpW+XiH/ZKtTnCbR6zu6oP67ucJGvUReM+rClkBjSMIGxKolOYxnGuG+kGbPZSg51+bJVMMMvhcuMudiyUVsl7RbsdeNKoXSrsryE+esal1qOJASQjudUuV89Qe+EIfmxhiE1qi3OE9SaHShMeHafqn1FRQxg3lkXClkTpjSlaSfft/Qtt2QhLLJSiT6N4JQMovuFOs9zwJ6nqOgXvJWF0KYyi5SmiZCtK1O4qZW1KzcA1pbVzn+2REVWDGY8/TMM/csmtV0Nye9ZlrOTm0rZeAPlnJe6qO1GFA9Li7S4DlE2K/rSRd9aLJb0VYPSCmC9Cm4Yx85LFLRwuTF1bXuqsROrt+kDrc19Valy3EX1WjgAVuOpLVYX/T6hd5YBQPTxE3tm6wAkl8HGAOFy249O2rEVdxi3Ad1MkHxqq50TrSx82oAVCr2Wv0KGJpgtOle4R5a6pMa66FsrFYi1LYakXaWMOf8UAyR3syOYt+OP85XcU2MtSyuLDvpqCTvusS7ZD/TOMqgFsG6P3b4NdGnwzNx2sShp5vjgas2U7U5bS2V3Jm9QSy4cyv6hYIqyTWVqxkNBxrQkt2xU4BvaGDZ+wgwWiVFN/4JwSjl+0blCi6mt5dO+WDdn6PxLUT3HTEbYmVzDfqKXliFpcGW0lt9flYsf9OGqFswOlvXRDZ3sQbRcLiNFSYNTX2Ml/eIARWIYKd2uwrKZAVi/u14QNK1CNXhmdGVSbSsL0CjNXJq0HBcpzczANfmafjV/9fih44+WKQ/QjK5/QtFLYVCdrUyUGJq5BOprqgWNy9AKP1JRpuvqAnSZfBomy5qSqeHav1cXqcjfJ4Yz7Zs6rb6aem36xfBh08FgqYWHWs9i/DkjlxSGVPMnSR5abVFviNLv7n9yzTqsXp/QS2EAkCdXspZpmfRQEIGpcj11F+oYItxuPwgpXi1zxevR32+5VKbxQvAMneH0rRsUPtffjZT7ZX4fojSLxj0pKrTpF7nT8prKa4opjDXS+9bSdYHVu5aVTeSbzvp9QP9iBvuwVMtXDJSYMlkOG9DlvTqFb43Sjal95qJN4/60sztS0Ert6jWtbpmX0NaR2a9K+3bSKq1YiqFSu9mq2cP/2v3ijIKho0xfpF2LMUlJv4qNir1YHfOnma32/CNnt3poHXprGYpV6KSZsxtgkTVrro3atUB+EF3arW1vzKIXsnWyrk1BX2XYuMSFFhezL6fDurToGx40TZT9N32zlsyOoOynGX8RXFR9QrUKrdZ5yPxVRioJbqYTVYDktvuI/lkGID1YZtVtwoVSS9XZo/RvKqNaPnngsIffuzSY+t+WaYhMs5u+akq7Mm76bHpg3Y1O/95aOrVilr7pOJktYRnLaBmr5au2h8xfsm7GSNk4JxAePn/sasD0a5S7tZjon2Uw2k/Mwza3CjVq3RyBVGUiI0guK3UDMEyXC1T0c/14M7ZRlrHWq3B3kgbv3pHTaamSkOQ2Wxvh4r3i9yFsH61CsMOz5MTSF3Mtu6PWOpZjy4ytliPPP8vX4j5RP4M+oH+WIWrBlCLVQ/Cs89Rtv9u20dlmVp6Fj201fSjesSrLwu5AOabO66Mo01HOasciRrG+tXFPkrtlrIM6/mmu7MmxNMD4ml3GMn3b9e3mZvx2lmlGnoYvZbs04y8sqOknDP1asHuA3lmGNGkEyKblHxeLA4qk8aqHa+KGsnrpD+uNei9Ne41Am46Ma55nqTWTeUnuWCajurH28XP369+HKP17MYpVisvFnJCAmb8s3KPol8qlldJNJO082/Eb5WLnXy2CeU5Dt30sInonDDqppeJgYgDr61p/WzVk3VhSTvpv0nrmQUcu1BQmbFtWa2dujW8tfdtn60aYH2VEqXUL+rG+QPtiJqQrVgCTexTmwrpoKORX76vvnxiysgrDz3NoGbMuUisOmNSwEdTiRF+yJNJHL6mHblJiHBtEIzFFoWErJqF5b59LfCyFuRcIKDTV2/t0rIuQhCJqvXKfUQf9PJqkFS0j2eo6ZjF1WvRTz5GNUtGJmr5xuapxtV2rbiEtp1jK+VcfztC042m1Wyzm1cquH+idZVAXGsgPzfBAKtTeT2/cJ2U8o7lVsxXpPY1FkOsnzQWr7a3LJclC5f4YSxI6XclJZtiWVbBjliyoagyttcseW+3ClLtjkacs5fx1qrJV6Ph9iDjqliuZYhYjeDRzqPOXXDXzFZgap+jzGJHeXmz0ThhKBVy6MpaxOn/5xronkrdxFAtrrRgku2YpTRlfrVuW2ixikFIDJjNU+N25XnmeoByz0tJ6otbGMryxLqPPc1j3qN7XZcXUvEuuTimEzI1VAXBBPjN8LNV9nqOfXxGj6J2bVGQuhsG6HJVJt+YelTku2tT6DY1A6MPOaxJ1eet+hH5ogBzcLhuTZE1o2yw7kzVoKXytAJNlf1rjVyp2/Ch9/7LFdv2iXR3zEHemc/4T/W6LZZw0M5/9Qe8sg0LSP3Xmga0HDrQfKlAKiGkuuTJaRrVom4mMSZf0sXLftEyZNQJM8Fhbk0rbF1vUI53iUI7V5smt056Y8UvH+FtzYyyoGVadXUp9qayjdj8nGLRbxmLoGDDsPIf6hf1Cb4Uh+6PmC2/rwNYEtKleelUXBbAxgFHJLe2m1/O17JJYL0yq+8k9MjSsi2JjAEMoyUSR1dE4xo5X/W5U46/6bOWsoN9yuZCESntdQ9dWVDAzfbaeh9Xy6i7mDBOM1bME3DJMhNKbLc2w/ZaJIpmCDu0umSlydJrdluIXRNFtXXLgl7VnuXCUTE2ndaEKSGTI2Kjpf5vBC60bVGvl99fzhKSdrcItzxPYXun8dI9/IFhnLkb6+ccfhy2cFdbNtFkIezEP/UIvhSH741lLM/nMWcWQyBNrGLEVLFsthrrd7MnWJj/1A22tmu4X9LNblZkm+Sp19aQ9A/1kXkDz7d551Na0mDqWvuR22+M3LXWNv2TQNw4GchSAc0WwuWRoHUBpvYDsIhX0C99Ue+/CMCHaD9e4ofVDK/z4NPHWh7UNwD4gFO0nYTIMNxH9WKB+wJl+pNeRUpT0ymK8afwxCFBXq8wG2RZKVgv/shVDDKdvX8P9lUeefMGeR735OYPl2F8GeKeI/KI1ftN4Frx6/N30Tfa5N+hlNsmmTUvfPD9gtQoyELJprhkAl5DcAAQJp+Sf7pP4ABpR6RegARp1bwAMRNCgKSNHxBfGik3s20CAJh5SEUEDYiCD0F7DSB+7gzic5F7F2LL5ylZB3Q/182smq90rlJYiuW9Un15/TKucv8KNYWmBk0uXDRQAYPfHv+VnAN7Gyz79rltvvfo5Ar4akN9otSvmmQja5zkMnUjg550MsIjonTCodqpThuEhVl/WK/J9kcFLVvzqiZctRl8nwR3fO/NZDfkPAPawv+1stXHgoVKTFqvQquGZ909Zhq3bCg20nRFdtbfVbdQTPlfSoNcfeeJGAGcDOHvNhac+enrz5tcAeD6I7bJBZv4RRxpraS1xvD4gzhsxbYuCHrpJAUUQiZJhwrTLj1cM8PidHnlCbwUBAHY54lWf3QZTvwXw3mIRjKVWjR+S2bMui83ORDOSNH62LlX8US+wpDbQpp+JTDSmlUe++Qd7HfP2P3zQDsv3JnESBrI6WRXY52TGFccekwCXL1ux/OTJZnDLobfCYJlGH1bOrRPbYPCyqK16jxW//oqrReQdaceChV2Vlayv1V20wpIzNe0t1imu0HbrDI5Y+aD5Q0l/Bvn/Fb9+8m0PedIpf7vn0ThABoNnDAbytYGgDr5SmyHukR8OZPnxuz3ulHUTE9pC6J2bBFgBqLQYwjMeiKzZ4dATLl6s/s0Kg8GXsXnzaXY7Q86QxVcbA5hFwZS7l2w8UuRg/P2EDs2cnB99b6xL9q80tprZoX2RUxoAXwDwhTXffOdB4KaXNoJnCvFwggMBbqHwsoFMfWyPJ77jbBGZzARtYfROGHIwVgbNsMqTzZWL1b/ZYped97n69ttuSNo+Zb8sD9s4oQqaS7+7nVGzP0SSMgxUwULaYJrXXtBqQwPgqTmMc+Uxb70KwF8C+Evy01Nrv3PDg1Y+4aS7c4l3zqH1hUXvhCEHY5LSg1ZrRWF5xOL1cHa4484bDwQqYU/8rtZCzPuK55N1rDcsmveq7VXSxG4OrNYetE0jXNkNmx+InDgN4O6xBXuCXsYMumpbup7GOSD2vOeycw9bnN7NDpxujq1TqcV9k0FTza1uDQDjd+vH4b8P0ZVOtSv3qZ0ixs4BeNPfrzZaUPROGAjdPm1z7jFzYnKCmzZv+ih58TaL2NWJced/f/hhEJySkzwE2ahfksacgmEto7FDlTmymRnNAtmNfe3vUGqXSxYkLQNk+oPeccWWQe+GrcFg6xAITTAZ/ODD1l16zYXrrvjXXrtMt3/3w0+fnua3Se4AMeMxatmurXSe5zDp1tEruznOsOeobZiRDvVkf9TQD0KxVC1D72KGYq9QYdhZfIzlHoeNvPzOH599+YD4UUPcG+52PU0WL1omPPgGAwzCCrQt3yCrixaHNGV7kePYxHPJkN0AHt6Q+9eZxjgAWOFQt6Uc/xDYclWMYTNxxepa3aLWbxojEMYyL0H0ThhEhARj0qRMHwKAphjzQXNMgTi0IQ/NUWdO06TtDFJnaZC0LRC2YrQCUyHQ0DBIvTJu2mpyJiexs7o3sUshEcaU94cZV7IKQG5ftJlyN6xqcEs/9yuPPf8+gw2200Qbt0nnuIcbhrYgeucmAbxZGcBmWbr385v0a3xNK7PMQjRsP325YxRITrQykAqRlIyXBKHKBqW3sf8pFlCrwZJ5ad4n8vZanTFKWaGyf7aiHVMxfhtzVP0p0riBxj1YguihMMjqasUtatC4a6ZwLewCBIoAW5GyJAXTZCFT5m9ZDTFFjb9eaO+aEVUSbJamzulLLmK7mgNdtAsDKQYY9/sQdXUmpo9lbSrVHAgpxr8Ml2IJon/CIPwOKo2VGDo961L76aXWEU5jMVraG5ZRkBnGFLCp0EJ7VylQvdE6wpmaLIUwa2+grZ2RNH6x76jrPqvxY8j4K7PY1S4RKw/k3j12PfgKLEH0TxiWDf4JQPanJT/kcj9/1mjhk2Fm5IcrRamS6aR4rc5VMweSyuStOMHk+nO3jJtVUB5HP/ejGL8Zu6ASCqTlB2P90A7MzRs7f+3zHAIh/mVr2fM13+idMKw46IQrIfJV/aza12qx/M1tWdOmbQ6tYDPHFtmHNlYlMU739mhtM+f1kbdEmBNp9oipHspJbRsBSdobVisPsQB6LcVASDFMbaFK+qa+WtQUw0RXy1i7MGYByGbZsmUfmMnzeiChd8IAAMsFr6TI3WkV2mhmoO0bD9Ps2fbHckY71lq5y9Kw0p4jfx/CWLLklmg5bUPXTkxf602idoy5n5KE2FodmL5VoUoxJi1l2x6yE/a03Y48+fJWM0sEvRSG7R954k1TkJeLJvOtZi60eaVVrU+efPXMmDTasStWyP537XMbTd7hz2tsmtusBqSamerMmfMIhqbNapXnOZjbN/FO8Yocv7SzU5mWtSK2rIAXrRwcecqQR7Ik0EthAICdDj3xnCnI74OYznwhLfVnGaxBs5gAABImSURBVLvI0FiOTNuh27ozcHKTi1nrIZUVyWajuJYXvsRoWrQK55igkpbC/cuCWQTDRf9LobULb10HhVDXLw0GQKwaLN/+d+Toozd3TNCSQRd39ArrL/3Xp2xm81E03BsVcwLMz9wyGYHiiXdYhNbhehNYqgtt65bxCRDNU263I9uV3ieL0EE/DyDVS2OMzFyvT9R9yzxfJheK8VcWIbZPkGftIfv+mRz90vuwxNF7YQAAXvfpndet3/TXEHkpyW0Ds9jgUUqmSQFuZMJKQ5Y+vxWCwNB2D5Th4sS0liGzcNbBL+P/VSxTl6vaBczh+uQWiul/GSTb9nOyQMvbHFtWFFFxXD4lg1evPPqt3xo190sJW4UwKNZf+sk9N7H5kwHlhU3THICklQMk+c2lhrTasLXa2j44kF6tP5/udmhYjRvK9lEwJKp6Zbtd11LN1E6m331GQWwd05Zx4+4F+XVM4UN7HPmWr/f1xNliYasSBosNl3xi703EURAe0FBWCqdXArIcaMAGkBgNsbFatEl8Z4UoMH7TzdC652iAGM7nDXtNukzA/r5xsafP8lu12S/RaVL1FkMPrRPoDgA0rU2EQfwEuIvk2oHg5kbwX3vs/oiLl+oagsPhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOB4okHEFSK4EsFZEuAX64+g5SA4A7Bg/bhSR+xapH8v0vYhsXmhizyP5XZINyScuKLE5gOSxJK+Nf89b7P4oSP4ZyVXx71GL3Z9hILmc5Mb4d94E5Q9hxt9V7Zy4sL0t+nFX7MNd89XmshH31gE4Ir7/YwDfGNGxnQAcNce+XCIiN82i3g4ADojvV3QVILkzgCNn27EK/yEi905Q7kDkOdl5nmgvFLaJr1MTlJ0276cAgORhAM4G8CskHyoifzPP/dsiGCUMXwHwEwCPAvAMkg8RkZuHlN0fwBfm2JdXAPjIHNsYhodj7v1TPBTA6nlqa2tESxgA3AJgp/j+NJJXi8jntmy35o6hwiAiJPkeAP8cy70cwDu2VMdqRB9RzfhFIvLXi9WXrQ0kXwdgmKs7MO+PIPmlIeUuE5GT0CEMInIzyeMBfBshnvgEyceLyCVz7PoWxSjLAACfAvAuAPsAeDnJU0VkekydCwD8y4T0nwJgUj9TADw9vh/mphxM8pjq2m0AbgDwghFtvwyZWd4D4Icjyq4Z088+4v8gz90o7DGinLp6XZYBIvIjki9AUFgPAvCvJA8XkQ2z6O+iIAkDyUcCeHRHmUsQhGEdgD8iqYPbKCLndJS/QkQ+Ognx6MvPZ9D1uvhn8WUROQ5BsIf1wwbe54jI9+exTzMCySkEZpoJNorI/SPur0FQCF0QBDcXCErmliHlfh5fbfZo26IhkS9Gb+IkAAcD+ACCR7FVwFqG4wCMcj0OAXCm+XwngC5h2Bqxn3n/00XrRcARAP5zhnX+GsCbht0UkTcAeEPXPZLLAaggfUNEjh9Dy1rlLqF9K4AnIyhWkhyISDOmzV5gnJs0Z5A8DsH1AICTFziw+hcAF1bXJslQ7RtfNwG4dV579MCDdXtawiAim0i+EMBBIvL5cY2RvBnAXnPozwqSs1kDWyciRZbPCsPnAFw7poEdAZwV6/3XhERXIJhMYOFTjBeJyFnDbpJ8GoDdqsvbANglvl8P4IVD5vbnIvLNjja/DOBXOspbOv9GctTi1NNF5IqO6z8EcNmQOrsBeNqINhcEIjJNciOA5RjizonIlQCu3KIdmwfYVbyrAVw9qjDJk0yd94wq21O8E8DhI+7vguHB/9cAtIQBwC8jpFtH4SFj7i8fcv2cYTl7kodjjDBEDf1rY2jbtYVDSP7tmPIWB05Y/mIR+fSYMhvRtuqjcDRC36cBrJpBvd8EsH3XjYndpLiw9hfx4w+7tOQSxU+RtydYrEReBPwZysCzvr9QW12OB/DcGZR/GPIzngQPmbD8xwCME4bbReTJkxKOK88rANwzw3rXIYyzhZnEDG9ANv1bzCrEAG9n5FVSANg27pkCStdrJ3Pd4vYqJbwWwHMmIC/otga5QMhUtUDynwC8NH58ep1zJ/lhhJX9hQSxMIJm97RN0v4DJ4COJlmzFZcC+LcF61EbxyCshlscj+5A9/T4V+NQhNV0xf0i8q1xhEmO3cg4AruY97d33LfuyYJYBhF5PoDnd92LG+5WisgvZtouya8DeBKCi7J8a8kWjcNgXAGSDwLwCQTNPA3gDxd8l+AWBskjSL4q/u0xT83uat53CYOd+8VgpicCuIXkzST/ZIZ1dc1hCuU4AcxZiSwaJrEMpyNng04XkYtnSMM+9NlowJ8D+OQs6lncOeb+7wJ4c3z/A8xPelUtw0YRuafj/oJbhjH4/fi6F0avuHfB7lHbE8HtBACQfDiAz5N8L4CzxywG9gojhYHkq5H92isBnDILGtaHXzfTyiLyYwAvnAXdxYYKQ5dVAEphWDDLQHJvhB0EFssAPDO+vzWW+40xTU2LyPfi+5+b63ugTP8+DWGB9qMInsQ/z6Lbi4KhwkDyWQDOMJc+O8uDHDateMcs6o9E3EP/9vjxlSJy0XzTmCXGCcOWcpNeitEbLPfAZCveGxC2ywOlMOxZlfud+DoNYNimv16iUxhIPgFhf7p9YCeT3BXAn4vIxhnQWFBhQGC6Q+L7IsVJcmqCjYXzjpgBU8a5bUgxaxm2thjMLs6mNCXJ7ZHPcFwoIsPG3ku0hIHkbwL4IoDtOsq/CsCjSZ4gIv8zIQ0rDMO05EQgeSiA0xDOPXx5VCBPci8A15H8EYBTReTf50J7hphkzHbuF1Jgz0a5W+DpAP48vj8TwGcnbMf28Yr4eQrAI8z1o5D5Zus+z0DyWACfQV5m32De/whhK/ARAH5A8vki8h8T0Pil+Ho/SvM6GzwT4WE+HSEbMmoN4NkIfX88ZhGrzBF2lXvYtgS7brJgwiAi1wO4HgBIbgPgQ/HWzwC8YUhwP67N+0leC+AglMJgdyBvvcJA8rkIWxH0IZ2FsFfntfHzqwG8BOFE2u4Azif5VhF59xgaqiWvmgeX5ffi61qEcxOjoA/mFxjvE1vG3DSLftU4wrz/7pAyVhHNB81J8AqE46gA8JcqCDGdrJb+cyIyyVnynyAIw8Gxjd0AaL3/FpGZ7v5dSfKaGZRXl3jHGdarkwkJy4CQZ0dIX2qM8H4ReX1MjymmReSVJO8E8MZY9gmjqJLcE8CD48eujWgTg+S+AA6LH88bJVgkH2L6dt4Ei0J7m/eTun+j8FjzfpgwzLcAjgTJ/QCcGj/+F4L7pBDk/VG2X6PwPQTruwvJAxEUlbpIk7peFlMIx3NnisEs67Wg2ula5Fz3X4nIKcMqiMhJUSBOQtA0o/BM8/7S2XYy4sXm/WfGlH02smBPYq51o916EVk7suQYxAWnx8SPPxWRYa6hZbqZJCRm06cphIXTnRGe85/Pw1f/2C+IeDxyCn4DglcxU0xjZopoPwQhJoAbZ1BvbwxJHC0DABG5neT/RzCR7xvXmoicRvJTxhTegLA8DwRfVPFs837bGMwCwFtE5EsAzkU4SQeMsBxxv9Eb48c7MPqbOrZDcOkA4C6M2VsUocKweoKy43AQ8ga8YVYBKIVhoRemHobSin+12qZuV4yPJ9kV9H9cRF5rPv8QITmwK8JWHZ3Df5ylQlkjIuN2/yaYjXp3z7DeRBv1niciP+sq1AURWW3er0fFoDENe1T8uBbAdcjbiXeJ9W7CZIdvTkFmsPeLyCi34lTkFfNPjimrwqO58mFHI2eCx5n3o4RBtxE34/o4V4jINSTXICyACsp9UzW2GXJ/B/tBRBqS3wLwLAQFAASh3hq39gMozzNMLAgT4hmm/fMxy4wJyd2Rz9H+FN0b8RRHIQf8tyBvsRiFY5A143wIg10tH3UASv3rLfWNdK9BGRtZ7IS8u+BShC3XNbrc3G8gCIPiYyPcwmF4OcJcbMl52AEdazsLeezTMsVHMCKKHwURWRsPqXwcwJs7vsDrPxB2Zu4E4O+RY4U/FZFJFvnsNupxGaqRiIGkfsvGjQC+M6K4Wob1c6E5KUYdromJjlPix2smcZUjbJZuM4DiIBLJhwE4JLrEw/q1RVepRaTeAZ2wIMIQmVeZ4ocicgHJF42psw2Ah4nIVfU9Efk3klcD+HHHvetI/g9CWli/reE8ETm3g8xzELTQ5khzP+TtAzcC+Hy8/iwA3xeRG0nq6vYk+fhXIluZM8dksdTt2CLCMFfUq/kxKD/NFLlWRGrL+miEI68XAThhNtvFtyTmXRgig/29uTTpVw3uDeBKklei44sDhn0hVUyjnouQ0QBC0Ny5JbnjYb0e2ZJ8MJ7vfRmAf0TY3vy0uFFwLEhuC+AP4sf7MT6jon75uB21WwI2HtiP5OsRviRhH/N6FYDfNuXeC+BY8/lgko8TEesaaqD6BCxwxmw+MK/CENcCvon8oD875LuVuqDnCA7GhHljko9DSLPqKvcGAC8a8TWYtu7bAfxZ/HgPgLNiWvRYBAH5JQAXkvy9SQ4CIVgdPQn46VEZFZIrkK3Ygu7fIflQBDdy1/i3W8d7m9k6HN3nxNPCFslXIG/pAIK/vx1CvGYX7B4ZX6+d0GXtL0i+lxm/PqbsISRvMOV/Flcl9f6LzL0Xd9R/lrk/css2yQHDQZz7TZ2bST52VL1YV0i+jyXeYe5Pkfxnc+++6DaNanMnktfNYK6eZsr+U3XvN8y9huT0iD/FaSNoHcHZ4R6Sl5P8CskzSb4ktvdUhm/sVrye5NtMf3/b0L4sXj97WP9mCy7At3CPIzhWGBiY609J3mvK3sLsa2s5Kwz1t96B5PvN/cfU92OZFSRfy5LxSPJSBqs0bjyHkvx8VbeVCoxj+rAps5Hha2aGtfsxU/bbE/TjfFP+ZdU9KwyTYpQw7GbKbWJQGj8m+Q2SnyJ5Bsm/MWW+xpDBq9uZIvl2kptN2XfFezsyPHOSvIrk9iT3ZRAOMgrSfIJ9EwaSjyf5rerB3Eyy9T1CDBpFcTXJPyB5XPw7lUETkUHbP6iqewDJD5Bc18EIX2VwO0aN4zEkzzMPR/HOGYx/A8nf6ijzHFPmLoYMit7bPzLFrgzW4zCS55jy0wyHb2x7VhiuIPnFIX8XmnJDhSG2eVDsQ+dxTJJ7mrZaq/skf5nt5/yhqszx5t6VzAJ/77jnMxuwL8LAoG2+wja+wrB1uqutvVhaj2FobbVm0GI1LmZgxJHnuFlqPcVdJF87ql6sKyQ/WdU7zNzfm+Tt5v4Lq/pnjRnrX3XQtMJw0oi+HW7KjRSGCcY5VBhI/hLJteb+NMl3d807ydM6xrggJ93YI2EQlprpDpKvmaC9l3O0QFzKyr2K9Q5i8N1J8uskn9TV/hCahzL7uLczmPoHj6+Z6m9L8jux/mqS+5t7R5JcH+99vKPuiUPGuYHDGapXwhDvnxvv3cBw8GtUW+9kdqVuYYfLNR/gAgjDyG8xIPk2hAM9AHCciPzA3DsEYZHqQwhbJCbqVGTEX0H+cQsgrE7fCOD6Ybl5hi3m187mG7JJvhEhc/ZBEZnx2QaGvVHnIHwzyOrq3mMQvm36WBG5u7q3M8LB+50RthzfgbAt5SIR6fy2a4ZtLPorQ5eJSOf25DiPR8WPV4vI5TMdV0VTLfIqEXlTdX8lwhcKv7ke45D2DkZYY/h3EVmQ1DHz3qTWd6bOFnP6Sg+Sy2d4BNThmBcwxKVTCEcL5nQ8wOFwOBwOh8PhcDgcDofD4XA4HLPG/wL++QhYbLqZPgAAAABJRU5ErkJggg==', e: 1 }, { id: 'image_1', w: 1080, h: 3, u: '', p: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDgAAAAECAYAAABr549KAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAQPklEQVR4nO2bW44cx5WGvz8yq9gtkbQ1tmDIkAFiYMwDX7UBbcLrEbgebYIb0CsfBoJBwMIIguwZXXjprs44vx/ikpFZ1RQHMPykAJuVGXHucT0n44hfy7+12FZ/efZMfAE8gy+fPtVfAOp/z58/1+fAc+BzgEePxGfw4sVf9bSif318qD/X55fztXj5kidPnvDNt9/r0z/Bt99dF15/hPT9UQBp/lGaHnQZfj8dBPB/P74SH33ER8APP70SgKaD+A3o1Rs95jE/pzcFLxUcpbfl/c1c36faPgteI63vb4APlfT25iSA6wp7k05qcFdccaPSLk3idCeugNtU6Sehu9qedAROWsSptJ+U9IATpKTTXdLxAHdKOgBaFqGkOy2CIwctEgXvThJL1uFw4G7JkhbBAZRFhWFZxOGAliwkwQJKWiouwEFJzMAicSi/C0sxtKoOWWJemBeJQ1JrXlRokFPvG5HXsSIV2jlq3QytPQOEYEZacRYNtHIWU5UjF6ZT001SLkQKrUkrXsQqA6U+k5k0D7KFyBmYakXDmQjFKuM0jP1oPHLRbYe35QvQcBNZ1jQ2KdTEH+VkggivfACYReQzOHKls6GSBLn9Y6p2yVE1TcCG/gQRWgnWMklEVAQIvNONitfgmzxWkzGAFBWU0tZl6DLtbcZg51irCJImFdxo/1Z7jODyyn/TFNq8d/064k6W2DxO07Y9iI6dBrk71frQnyev/OPcnnH2UMvk0hcp3YPQGGZt9OmCJPZEpQv9+c4yzpX6HgHMWtvG310ZO6NVRWyrJG37fOy/Up/OaralaRqBOsC5+gOH9ywRVZhhBL0P+jjgEqSE3w34S/TSSs/2vn4cj+W3zd8YbLcRqeI3Wr8gx2iDcUxWW9ipyxQ7cc8oJ/kyv60GWPfY7HxKkOQiS9raZ6dCdP4rnR1XcrYvdeBa8k7+xGasJbvPmZxhqtCevdJs/M91DNutV7d9Je8tmil2nxLkyExMZMvjbElddnu1zSB/an23zuPETtZLfTHqCUCByVWeor49AUxTlSC8GZONd186qnxpqs/r+tNtlTNUvRvdsz7vsNHlal3ktI7VKdkZIKdhTo02Ks/TiLfh38Qe8G33+rzayGmVcaLwnRpgssvenVZchwHM1PHmFG62siczr3CVsqGcuDyF89JsM8MM3tgpDDPz1OgvcBde5vJuT4YFnDx3AWzugHmVyZ1/5VPEKHV3VUZgJlzFMY12k9dh5tk4fFd1Pxxm+1Rp2z558rHy9xzGs0+cOB5nc4LbQ/joMLfA8eCjZ5+4xT642/IYvnL4BiAOhfYt+Jh95aNvBn2uIpuro4nsjZ7xwPAaX1+ZN0AspT2uDK/hg8X8/BB/mE3cGeDRww/MT8DDxT/+CH5U6vkB/PihAT6qsH/P5df5seF7YvmNAeLjk/kf+OQPbw2f8s3fvmH55GMDPFneGuBr4M+nVwZ4ATx9+p/mK+Dnn/2c4p89Bz7//PvC/0vgxQvzRXXu+KL3q3T/+vtr+dcXbRzu9ynNKecLePYMvgC+fKp3OubAi+tzx/zlXBzwJwDzA3373T/0yR8/Ab6FdNR330Gaj9L0k2B1xouD/RE//PQ36T9+r98AP6XX0qtZpLeChyi91cOH8Or1JL2dxMNJenvbHPf0Nt3qmmvQSVLSjZK4PenqCm5vk0iTkHSlOxXnNOl0V54fqDjap1MSWsTxgFIk7iSUJak4xpJYFqGsRVM6QD14Zi06Fsf4kMUyI0UiSwtZM3N3rtWcP0UihzLSBGRJSJpz1jKHlGdR9+AJCYUySCFBVKc8isMkJ5iIcJpEqYtQdcQUFb/UF7xpmhThCudETGIKRRSchBQVHyRJStR2ORW+CCzZqTqHKSQlrAgEk1DlkSRZCSxkhZVSCkVYiUkoJCRcaRsVx1FClkIJWSSKDnIiJMsSStgiWW48HCJNRTaKnFiVJpJJCGEnqejiQIiKj0SFwbTASLgGHGpYBoNAzXEs9i3nyCRqnbGKh+jqKAqwcnE0Gq0yg1fnowcKAIdAuDrTogbXJGTjDlzajSksXbwGq/IPcBGZ5k80OdsbBg+Onlu9CHuArw1e8aNpg6Uib33tQrcgTDsXrbR6AKcdGJv9ql3UzmhlkHslusrZeseuJt3Yo/x6o+8eflV/ALBdTe069HfBTRqXLe1qaMImla4aAdTYVrm6bbfiuFkMrzoOtryg+14ul5Wnnd2q+dexdO5bNvac02tcPfLd8KvmbgRKN6jbcdV95a0N/oao+1joLdUYG3NUoLO+azpshnzlawmZrfoNSBdtuQ7ZLc0R5lyDOv629t/y25Bwnf8b2XQOWzgNdj3rlta3q601ot7Tv71xJ9Zm0Jzp1/n1cc34X1ejtY1khoW1tI0KDW3b50GfJpjHFa4Pm27zcbk9L7r4uFZcGvDrktbKao21B8UawelzW7buo3suY+8+1SV1lKrb1aA0LkV7+2mltVZXGQe6g/1dN7jNMrNyhbqc6EyVXuFB0DK1Rr0Y4UvdufrawfZ6b0EqPhsedTpXew/bzzjLBQSUg1eR0WO8ZJ2AG+HWBawu5tZ+W60TtEEONh8E3Om2Bg86n23/d75thRx4DjZJW7p9saj9MoowMBydtygzmjQ4/5Y2u1lqpyFc5U5NkK0OUgukbGypYROycNdl7MZy1Km7R5vPVQ411LbjVEQNNnSB3Q6/QQ65bUdmDblXvYbFUrJXeQ01vteDXB7w3bYaY4OTazSP1Ow/9r1to0Bysh3C2FHnUBQr2KQpJEdkSHJgmSRbDhY7TSmiHD6dqJE7K0hF9hK3VAlsJBkrqrBGKnFOO0pg1A4li4hwMtgp4TCRUnJyRJAM2SWQK5NwsYejjJvkEqSycxlPTlKAC2wZAU6O6LAk55xNarjJCZd3R2TsKSXnjFOFn5KCbJPsnGFKKRbK+0RypgSPphbMnMGOKAG4yfjOCzAzFZPZxor5avKyLODJnm3uCixzePZkKt0727Pr56spooRja8BqzuEWxLXNYQo7Sh+c4OiDbw9LlObwlY92ZN84fPUg/NZHXzmMj+bqle0HNYAU9vUD8yrb19kPP8x+9Qoc1z349Ojh4h/jQzsW88MP/PbxQ/PbO/O/8Pff3pl//A7XwFEsp/LbA0a/M8utX9Yh+mR56zFQRAsSwSZQxOefG74sQSKAv7xwiRF9wT5Y9D7lPT91/Fr+lWXRfiuuTvC8NIgRGoav8gAcpBYoAUm5BiEAhq+426/gLbhRv4xG6OLXwQtlmiYufmL7BfQS3NjIMLQWOdpXlXJAsAhKcEP1C63rF8ROZQZFCdyMDqMqsVTf2m9ADF+he0mWAkHlkyZB5V/4KlLZpVTCGGo7Yz2zq3ogdSeT1i/uSeGscFanULZ/9W21C9T3yvGktnNMAjZfibWeuO4JbmxWgdDKwZdcgaZDYd6OinYJ3Aw21iBn1d3IBWmQTUG9qTDoJaMWLAjQGty46Imcl0ZLTfbCpb6cnyAvELiv5QzSlKDVemwWa99X83f77OQf9E4l+Gb1MVnItpNTUUttcg5E+mmNzcPofN4v/vbV53VtLFwgYu/H34Z/HeOsf97pr2F+NHusWg14rn/a2Q+VwJylfhrtvoA4Wz9pzVt5KqV7dBn/9gZoqu7gLtrlMs02LqxhjKhMlTpHmo4Xcdv4O5PVbZyk9c/teQPX1bmgWnNsL8ei9vYYNOyRtPfD2TmmA6kSZPF+4p5JvI70zr4tvbyjN96ll3Yw2veBi01NUjnFFtu6fxBqI+vd/df6f9fe+tSuNHyx/R69Gr0N3Xv07/v9Fu7SyBjGnM9CBT2WcWGeXphLdVtounijV9dusJ13MqoQ8a6trBcbDQYdtjK/e1xfXD/Oagb3e0d4Azv2l0BK6z7hqGeG8dZeQiTVerZrYueyrhsedRz3m7b/nE2hy+v6RtOu2KUNIHT5SpVgF6Tf2Wa1Q3PXJUVdr2VJXs+DYRQezw11nd/OgX7OS/Q1sY0Q9aiGh/HZbTIouhnTQ4yw/mzm3AjbDqEtKjfA9n7RVndIIs7tWmejUhUs2tlUVgn3WDg6ZF08tufKQNFh+8cfqaxZVYaoUhWYcNszo35IXD8sdQUShK31xme9QTXsteVmlol2G3n0HquvEf3cszqXqWnP4HAOH1zVfIR6XfDecuat1ruk0/tsSCPPpnSn0z/uThOUU3vWFFLOIXJoUvG1yo1tyk1soEBLMJdLNXP9k7Qsud/Q1tJ8uJlfy7+vvN/A+LX8S0r/gltvwTx7VgJTX365pqc8f/7x5gbMV4/+W5/xGXwGvPhrwX8KX399np4yP/hQn/6p1H373bX4Y3ke01PgY9qNGLg/RUW1XlNJT+HxT/z8qqYltBSV12/FI85SVN6kWR98AHp7ozc39fnmVlxf8/bmpDE9BUCadAXcKIkb0PWd4Iqr0125WQMo3QkegO6k9uX+tIgH0NM/Tqm83y2CpLsl6XAALYtODUZJl9JTOMBhSVq0aObAUusgq6ScHJBygV2SOMwlrWTJXZ6ZrBKA+YXUlFaUtNTGXldTVC6mp0BNUanpKT3A1OqgpagsGupaegr0jailp2SVwFiu2J1lSGsES1tZOtt9SsSF1BRgs/lfTE3Z4hb+F1JUpjSkbtClRtrZYuqktukLVacYYSlXctsGTZT0m1wJTlKO4XpwwLRPMRl1amXcdINdWkr9HhUD/8ovZKVdqsc+PWWq+jduU8nbuLyWlxtY27qpBzmHS+NV3iGVprAvn2nq5XyV7IIyYlpay/hW6NNvQU8b/tv8hijRx67vHqoFPc/rU8VdbRpwzmbyZZtskBq8z+WMy1f+pQs2hWEc3MdoKBrn1yV5GG707xOEUhkQ7TCYUn++lL5wAbs+t1SVcUqsAK0+lvXQusk9+OW8lXeXLv97onf+PdnAlz/RvEdqyMiv5VTs0EebEambuaeKtK7oqSvv4O72hTou8xvfZ3mdZxBkEhOWPeof0VIldsZLieY7v5f+Z6kSiZRGbarsiXMDeJ8aU2TqYMneZt+kjV2d7a08aWfANQSXWnpJSoZM5Pa86alKYrhN0Pj7PB2lfvVlX59J7hkRdTFLljtUKvYnjakrlBsLbZ/qPNJZX6Se/lOFy2OocUix2CBpczskB0zthsQ0DWkNsEnv2KSoDO9AsrzNhGv09jQq/55xs5XNQ0rOxET5Ul745RG223vl1VNVSl4L/GKqSktVWnw5VSXt7JDXNJVmo3nGy4rT0lRKCgn0NJWZ+r1x8gwsU5RxsZS7B8xzE6vSCjPNkKlpKiVFpcEtlPSiZZrM8v9MVZnnloFS6oZUFTjZntY0lXkyS0lTubPNPBmHD7bhgKn1wGFuNw9mw4mTZx8BjuWWABH2MYxr+olnw225PdDSVKLcGOAGbo4Fzi43AUqayg320VcPcrlNAGzSVGqKymtnf8CHXExR4SGuOC1NxbEYHuO8+H1SVIDLaSpAS1X55m+wfPLaT3jCy5cvefLpH0r7n1+ZF9s0la/4is9+/q/LNxDuuX3wa5rKv6/8EycY65bo+YM2AAAAAElFTkSuQmCC', e: 1 } ], layers = [ { ddd: 0, ind: 1, ty: 2, nm: '加载视频@3x.png', cl: 'png', refId: 'image_0', sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 0, k: 0, ix: 10 }, p: { a: 0, k: [1218, 562, 0], ix: 2 }, a: { a: 0, k: [97.5, 132, 0], ix: 1 }, s: { a: 0, k: [100, 100, 100], ix: 6 } }, ao: 0, ip: 0, op: 300, st: 0, bm: 0 }, { ddd: 0, ind: 2, ty: 2, nm: '进度条@3x.png', cl: 'png', refId: 'image_1', sr: 1, ks: { o: { a: 1, k: [ { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 60, s: [100], e: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 61, s: [0], e: [0] }, { t: 120 } ], ix: 11 }, r: { a: 0, k: 0, ix: 10 }, p: { a: 0, k: [678, 587.5, 0], ix: 2 }, a: { a: 0, k: [0, 1.5, 0], ix: 1 }, s: { a: 1, k: [ { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 0, s: [0, 100, 100], e: [100, 100, 100] }, { t: 60 } ], ix: 6 } }, ao: 0, ip: 0, op: 300, st: 0, bm: 0 }, { ddd: 0, ind: 3, ty: 2, nm: '进度条@3x.png', cl: 'png', refId: 'image_1', sr: 1, ks: { o: { a: 1, k: [ { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 0, s: [0], e: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 60, s: [0], e: [100] }, { t: 61 } ], ix: 11 }, r: { a: 0, k: 0, ix: 10 }, p: { a: 0, k: [1758, 589, 0], ix: 2 }, a: { a: 0, k: [1080, 3, 0], ix: 1 }, s: { a: 1, k: [ { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 60, s: [100, 100, 100], e: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 61, s: [100, 100, 100], e: [0, 100, 100] }, { t: 120 } ], ix: 6 } }, ao: 0, ip: 0, op: 300, st: 0, bm: 0 } ], markers = [], playLoadData = { v, fr, ip, op, w, h, nm, ddd, assets, layers, markers }; function _defineProperty$1(e, t, r) { return ( (t = _toPropertyKey(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : (e[t] = r), e ); } function _toPrimitive(e, t) { if (typeof e != 'object' || e === null) return e; var r = e[Symbol.toPrimitive]; if (r !== void 0) { var i = r.call(e, t || 'default'); if (typeof i != 'object') return i; throw new TypeError('@@toPrimitive must return a primitive value.'); } return (t === 'string' ? String : Number)(e); } function _toPropertyKey(e) { var t = _toPrimitive(e, 'string'); return typeof t == 'symbol' ? t : String(t); } function _classCallCheck(e, t) { if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function'); } function _defineProperties(e, t) { for (var r = 0; r < t.length; r++) { var i = t[r]; (i.enumerable = i.enumerable || !1), (i.configurable = !0), 'value' in i && (i.writable = !0), Object.defineProperty(e, i.key, i); } } function _createClass(e, t, r) { return ( t && _defineProperties(e.prototype, t), r && _defineProperties(e, r), e ); } function _defineProperty(e, t, r) { return ( t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : (e[t] = r), e ); } function ownKeys(e, t) { var r = Object.keys(e); if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(e); t && (i = i.filter(function (s) { return Object.getOwnPropertyDescriptor(e, s).enumerable; })), r.push.apply(r, i); } return r; } function _objectSpread2(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t] != null ? arguments[t] : {}; t % 2 ? ownKeys(Object(r), !0).forEach(function (i) { _defineProperty(e, i, r[i]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys(Object(r)).forEach(function (i) { Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(r, i)); }); } return e; } var defaults$1 = { addCSS: !0, thumbWidth: 15, watch: !0 }; function matches$1(e, t) { return function () { return Array.from(document.querySelectorAll(t)).includes(this); }.call(e, t); } function trigger(e, t) { if (e && t) { var r = new Event(t, { bubbles: !0 }); e.dispatchEvent(r); } } var getConstructor$1 = function (e) { return e != null ? e.constructor : null; }, instanceOf$1 = function (e, t) { return !!(e && t && e instanceof t); }, isNullOrUndefined$1 = function (e) { return e == null; }, isObject$1 = function (e) { return getConstructor$1(e) === Object; }, isNumber$1 = function (e) { return getConstructor$1(e) === Number && !Number.isNaN(e); }, isString$1 = function (e) { return getConstructor$1(e) === String; }, isBoolean$1 = function (e) { return getConstructor$1(e) === Boolean; }, isFunction$1 = function (e) { return getConstructor$1(e) === Function; }, isArray$1 = function (e) { return Array.isArray(e); }, isNodeList$1 = function (e) { return instanceOf$1(e, NodeList); }, isElement$1 = function (e) { return instanceOf$1(e, Element); }, isEvent$1 = function (e) { return instanceOf$1(e, Event); }, isEmpty$1 = function (e) { return ( isNullOrUndefined$1(e) || ((isString$1(e) || isArray$1(e) || isNodeList$1(e)) && !e.length) || (isObject$1(e) && !Object.keys(e).length) ); }, is$1 = { nullOrUndefined: isNullOrUndefined$1, object: isObject$1, number: isNumber$1, string: isString$1, boolean: isBoolean$1, function: isFunction$1, array: isArray$1, nodeList: isNodeList$1, element: isElement$1, event: isEvent$1, empty: isEmpty$1 }; function getDecimalPlaces(e) { var t = ''.concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); return t ? Math.max(0, (t[1] ? t[1].length : 0) - (t[2] ? +t[2] : 0)) : 0; } function round(e, t) { if (1 > t) { var r = getDecimalPlaces(t); return parseFloat(e.toFixed(r)); } return Math.round(e / t) * t; } var RangeTouch = (function () { function e(t, r) { _classCallCheck(this, e), is$1.element(t) ? (this.element = t) : is$1.string(t) && (this.element = document.querySelector(t)), is$1.element(this.element) && is$1.empty(this.element.rangeTouch) && ((this.config = _objectSpread2({}, defaults$1, {}, r)), this.init()); } return ( _createClass( e, [ { key: 'init', value: function () { e.enabled && (this.config.addCSS && ((this.element.style.userSelect = 'none'), (this.element.style.webKitUserSelect = 'none'), (this.element.style.touchAction = 'manipulation')), this.listeners(!0), (this.element.rangeTouch = this)); } }, { key: 'destroy', value: function () { e.enabled && (this.config.addCSS && ((this.element.style.userSelect = ''), (this.element.style.webKitUserSelect = ''), (this.element.style.touchAction = '')), this.listeners(!1), (this.element.rangeTouch = null)); } }, { key: 'listeners', value: function (t) { var r = this, i = t ? 'addEventListener' : 'removeEventListener'; ['touchstart', 'touchmove', 'touchend'].forEach(function (s) { r.element[i]( s, function (n) { return r.set(n); }, !1 ); }); } }, { key: 'get', value: function (t) { if (!e.enabled || !is$1.event(t)) return null; var r, i = t.target, s = t.changedTouches[0], n = parseFloat(i.getAttribute('min')) || 0, a = parseFloat(i.getAttribute('max')) || 100, o = parseFloat(i.getAttribute('step')) || 1, l = i.getBoundingClientRect(), c = ((100 / l.width) * (this.config.thumbWidth / 2)) / 100; return ( 0 > (r = (100 / l.width) * (s.clientX - l.left)) ? (r = 0) : 100 < r && (r = 100), 50 > r ? (r -= (100 - 2 * r) * c) : 50 < r && (r += 2 * (r - 50) * c), n + round((r / 100) * (a - n), o) ); } }, { key: 'set', value: function (t) { e.enabled && is$1.event(t) && !t.target.disabled && (t.preventDefault(), (t.target.value = this.get(t)), trigger(t.target, t.type === 'touchend' ? 'change' : 'input')); } } ], [ { key: 'setup', value: function (t) { var r = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, i = null; if ( (is$1.empty(t) || is$1.string(t) ? (i = Array.from( document.querySelectorAll( is$1.string(t) ? t : 'input[type="range"]' ) )) : is$1.element(t) ? (i = [t]) : is$1.nodeList(t) ? (i = Array.from(t)) : is$1.array(t) && (i = t.filter(is$1.element)), is$1.empty(i)) ) return null; var s = _objectSpread2({}, defaults$1, {}, r); if (is$1.string(t) && s.watch) { var n = new MutationObserver(function (a) { Array.from(a).forEach(function (o) { Array.from(o.addedNodes).forEach(function (l) { is$1.element(l) && matches$1(l, t) && new e(l, s); }); }); }); n.observe(document.body, { childList: !0, subtree: !0 }); } return i.map(function (a) { return new e(a, r); }); } }, { key: 'enabled', get: function () { return 'ontouchstart' in document.documentElement; } } ] ), e ); })(); const getConstructor = e => (e != null ? e.constructor : null), instanceOf = (e, t) => !!(e && t && e instanceof t), isNullOrUndefined = e => e == null, isObject = e => getConstructor(e) === Object, isNumber = e => getConstructor(e) === Number && !Number.isNaN(e), isString = e => getConstructor(e) === String, isBoolean = e => getConstructor(e) === Boolean, isFunction = e => typeof e == 'function', isArray = e => Array.isArray(e), isWeakMap = e => instanceOf(e, WeakMap), isNodeList = e => instanceOf(e, NodeList), isTextNode = e => getConstructor(e) === Text, isEvent = e => instanceOf(e, Event), isKeyboardEvent = e => instanceOf(e, KeyboardEvent), isCue = e => instanceOf(e, window.TextTrackCue) || instanceOf(e, window.VTTCue), isTrack = e => instanceOf(e, TextTrack) || (!isNullOrUndefined(e) && isString(e.kind)), isPromise = e => instanceOf(e, Promise) && isFunction(e.then), isElement = e => e !== null && typeof e == 'object' && e.nodeType === 1 && typeof e.style == 'object' && typeof e.ownerDocument == 'object', isEmpty = e => isNullOrUndefined(e) || ((isString(e) || isArray(e) || isNodeList(e)) && !e.length) || (isObject(e) && !Object.keys(e).length), isUrl = e => { if (instanceOf(e, window.URL)) return !0; if (!isString(e)) return !1; let t = e; (e.startsWith('http://') && e.startsWith('https://')) || (t = `http://${e}`); try { return !isEmpty(new URL(t).hostname); } catch { return !1; } }; var is = { nullOrUndefined: isNullOrUndefined, object: isObject, number: isNumber, string: isString, boolean: isBoolean, function: isFunction, array: isArray, weakMap: isWeakMap, nodeList: isNodeList, element: isElement, textNode: isTextNode, event: isEvent, keyboardEvent: isKeyboardEvent, cue: isCue, track: isTrack, promise: isPromise, url: isUrl, empty: isEmpty }; const transitionEndEvent = (() => { const e = document.createElement('span'), t = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' }, r = Object.keys(t).find(i => e.style[i] !== void 0); return !!is.string(r) && t[r]; })(); function repaint(e, t) { setTimeout(() => { try { (e.hidden = !0), e.offsetHeight, (e.hidden = !1); } catch {} }, t); } const isIE = !!window.document.documentMode, isEdge = /Edge/g.test(navigator.userAgent), isWebKit = 'WebkitAppearance' in document.documentElement.style && !/Edge/g.test(navigator.userAgent), isIPhone = /iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1, isIPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1, isIos = /iPad|iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1; var browser = { isIE, isEdge, isWebKit, isIPhone, isIPadOS, isIos }; function cloneDeep(e) { return JSON.parse(JSON.stringify(e)); } function getDeep(e, t) { return t.split('.').reduce((r, i) => r && r[i], e); } function extend(e = {}, ...t) { if (!t.length) return e; const r = t.shift(); return is.object(r) ? (Object.keys(r).forEach(i => { is.object(r[i]) ? (Object.keys(e).includes(i) || Object.assign(e, { [i]: {} }), extend(e[i], r[i])) : Object.assign(e, { [i]: r[i] }); }), extend(e, ...t)) : e; } function wrap(e, t) { const r = e.length ? e : [e]; Array.from(r) .reverse() .forEach((i, s) => { const n = s > 0 ? t.cloneNode(!0) : t, a = i.parentNode, o = i.nextSibling; n.appendChild(i), o ? a.insertBefore(n, o) : a.appendChild(n); }); } function setAttributes(e, t) { is.element(e) && !is.empty(t) && Object.entries(t) .filter(([, r]) => !is.nullOrUndefined(r)) .forEach(([r, i]) => e.setAttribute(r, i)); } function createElement(e, t, r) { const i = document.createElement(e); return ( is.object(t) && setAttributes(i, t), is.string(r) && (i.innerText = r), i ); } function insertAfter(e, t) { is.element(e) && is.element(t) && t.parentNode.insertBefore(e, t.nextSibling); } function insertElement(e, t, r, i) { is.element(t) && t.appendChild(createElement(e, r, i)); } function removeElement(e) { is.nodeList(e) || is.array(e) ? Array.from(e).forEach(removeElement) : is.element(e) && is.element(e.parentNode) && e.parentNode.removeChild(e); } function emptyElement(e) { if (!is.element(e)) return; let { length: t } = e.childNodes; for (; t > 0; ) e.removeChild(e.lastChild), (t -= 1); } function replaceElement(e, t) { return is.element(t) && is.element(t.parentNode) && is.element(e) ? (t.parentNode.replaceChild(e, t), e) : null; } function getAttributesFromSelector(e, t) { if (!is.string(e) || is.empty(e)) return {}; const r = {}, i = extend({}, t); return ( e.split(',').forEach(s => { const n = s.trim(), a = n.replace('.', ''), o = n.replace(/[[\]]/g, '').split('='), [l] = o, c = o.length > 1 ? o[1].replace(/["']/g, '') : ''; switch (n.charAt(0)) { case '.': is.string(i.class) ? (r.class = `${i.class} ${a}`) : (r.class = a); break; case '#': r.id = n.replace('#', ''); break; case '[': r[l] = c; } }), extend(i, r) ); } function toggleHidden(e, t) { if (!is.element(e)) return; let r = t; is.boolean(r) || (r = !e.hidden), (e.hidden = r); } function toggleClass(e, t, r) { if (is.nodeList(e)) return Array.from(e).map(i => toggleClass(i, t, r)); if (is.element(e)) { let i = 'toggle'; return ( r !== void 0 && (i = r ? 'add' : 'remove'), e.classList[i](t), e.classList.contains(t) ); } return !1; } function hasClass(e, t) { return is.element(e) && e.classList.contains(t); } function matches(e, t) { const { prototype: r } = Element; return ( r.matches || r.webkitMatchesSelector || r.mozMatchesSelector || r.msMatchesSelector || function () { return Array.from(document.querySelectorAll(t)).includes(this); } ).call(e, t); } function closest$1(e, t) { const { prototype: r } = Element; return ( r.closest || function () { let i = this; do { if (matches.matches(i, t)) return i; i = i.parentElement || i.parentNode; } while (i !== null && i.nodeType === 1); return null; } ).call(e, t); } function getElements(e) { return this.elements.container.querySelectorAll(e); } function getElement(e) { return this.elements.container.querySelector(e); } function setFocus(e = null, t = !1) { is.element(e) && e.focus({ preventScroll: !0, focusVisible: t }); } const defaultCodecs = { 'audio/ogg': 'vorbis', 'audio/wav': '1', 'video/webm': 'vp8, vorbis', 'video/mp4': 'avc1.42E01E, mp4a.40.2', 'video/ogg': 'theora' }, support = { audio: 'canPlayType' in document.createElement('audio'), video: 'canPlayType' in document.createElement('video'), check(e, t) { const r = support[e] || t !== 'html5'; return { api: r, ui: r && support.rangeInput }; }, pip: !( browser.isIPhone || (!is.function(createElement('video').webkitSetPresentationMode) && (!document.pictureInPictureEnabled || createElement('video').disablePictureInPicture)) ), airplay: is.function(window.WebKitPlaybackTargetAvailabilityEvent), playsinline: 'playsInline' in document.createElement('video'), mime(e) { if (is.empty(e)) return !1; const [t] = e.split('/'); let r = e; if (!this.isHTML5 || t !== this.type) return !1; Object.keys(defaultCodecs).includes(r) && (r += `; codecs="${defaultCodecs[e]}"`); try { return !!(r && this.media.canPlayType(r).replace(/no/, '')); } catch { return !1; } }, textTracks: 'textTracks' in document.createElement('video'), rangeInput: (() => { const e = document.createElement('input'); return (e.type = 'range'), e.type === 'range'; })(), touch: 'ontouchstart' in document.documentElement, transitions: transitionEndEvent !== !1, reducedMotion: 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches }, supportsPassiveListeners = (() => { let e = !1; try { const t = Object.defineProperty({}, 'passive', { get: () => ((e = !0), null) }); window.addEventListener('test', null, t), window.removeEventListener('test', null, t); } catch {} return e; })(); function toggleListener(e, t, r, i = !1, s = !0, n = !1) { if (!e || !('addEventListener' in e) || is.empty(t) || !is.function(r)) return; const a = t.split(' '); let o = n; supportsPassiveListeners && (o = { passive: s, capture: n }), a.forEach(l => { this && this.eventListeners && i && this.eventListeners.push({ element: e, type: l, callback: r, options: o }), e[i ? 'addEventListener' : 'removeEventListener'](l, r, o); }); } function on(e, t = '', r, i = !0, s = !1) { toggleListener.call(this, e, t, r, !0, i, s); } function off(e, t = '', r, i = !0, s = !1) { toggleListener.call(this, e, t, r, !1, i, s); } function once(e, t = '', r, i = !0, s = !1) { const n = (...a) => { off(e, t, n, i, s), r.apply(this, a); }; toggleListener.call(this, e, t, n, !0, i, s); } function triggerEvent(e, t = '', r = !1, i = {}) { if (!is.element(e) || is.empty(t)) return; const s = new CustomEvent(t, { bubbles: r, detail: { ...i, plyr: this } }); e.dispatchEvent(s); } function unbindListeners() { this && this.eventListeners && (this.eventListeners.forEach(e => { const { element: t, type: r, callback: i, options: s } = e; t.removeEventListener(r, i, s); }), (this.eventListeners = [])); } function ready() { return new Promise(e => this.ready ? setTimeout(e, 0) : on.call(this, this.elements.container, 'ready', e) ).then(() => {}); } function silencePromise(e) { is.promise(e) && e.then(null, () => {}); } function dedupe(e) { return is.array(e) ? e.filter((t, r) => e.indexOf(t) === r) : e; } function closest(e, t) { return is.array(e) && e.length ? e.reduce((r, i) => (Math.abs(i - t) < Math.abs(r - t) ? i : r)) : null; } function supportsCSS(e) { return !(!window || !window.CSS) && window.CSS.supports(e); } const standardRatios = [ [1, 1], [4, 3], [3, 4], [5, 4], [4, 5], [3, 2], [2, 3], [16, 10], [10, 16], [16, 9], [9, 16], [21, 9], [9, 21], [32, 9], [9, 32] ].reduce((e, [t, r]) => ({ ...e, [t / r]: [t, r] }), {}); function validateAspectRatio(e) { return is.array(e) || (is.string(e) && e.includes(':')) ? (is.array(e) ? e : e.split(':')).map(Number).every(is.number) : !1; } function reduceAspectRatio(e) { if (!is.array(e) || !e.every(is.number)) return null; const [t, r] = e, i = (n, a) => (a === 0 ? n : i(a, n % a)), s = i(t, r); return [t / s, r / s]; } function getAspectRatio(e) { const t = i => (validateAspectRatio(i) ? i.split(':').map(Number) : null); let r = t(e); if ( (r === null && (r = t(this.config.ratio)), r === null && !is.empty(this.embed) && is.array(this.embed.ratio) && ({ ratio: r } = this.embed), r === null && this.isHTML5) ) { const { videoWidth: i, videoHeight: s } = this.media; r = [i, s]; } return reduceAspectRatio(r); } function setAspectRatio(e) { if (!this.isVideo) return {}; const { wrapper: t } = this.elements, r = getAspectRatio.call(this, e); if (!is.array(r)) return {}; const [i, s] = reduceAspectRatio(r), n = (100 / i) * s; if ( (supportsCSS(`aspect-ratio: ${i}/${s}`) ? (t.style.aspectRatio = `${i}/${s}`) : (t.style.paddingBottom = `${n}%`), this.isVimeo && !this.config.vimeo.premium && this.supported.ui) ) { const a = (100 / this.media.offsetWidth) * parseInt(window.getComputedStyle(this.media).paddingBottom, 10), o = (a - n) / (a / 50); this.fullscreen.active ? (t.style.paddingBottom = null) : (this.media.style.transform = `translateY(-${o}%)`); } else this.isHTML5 && t.classList.add(this.config.classNames.videoFixedRatio); return { padding: n, ratio: r }; } function roundAspectRatio(e, t, r = 0.05) { const i = e / t, s = closest(Object.keys(standardRatios), i); return Math.abs(s - i) <= r ? standardRatios[s] : [e, t]; } function getViewportSize() { return [ Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0), Math.max( document.documentElement.clientHeight || 0, window.innerHeight || 0 ) ]; } const html5 = { getSources() { return this.isHTML5 ? Array.from(this.media.querySelectorAll('source')).filter(e => { const t = e.getAttribute('type'); return !!is.empty(t) || support.mime.call(this, t); }) : []; }, getQualityOptions() { return this.config.quality.forced ? this.config.quality.options : html5.getSources .call(this) .map(e => Number(e.getAttribute('size'))) .filter(Boolean); }, setup() { if (!this.isHTML5) return; const e = this; (e.options.speed = e.config.speed.options), is.empty(this.config.ratio) || setAspectRatio.call(e), Object.defineProperty(e.media, 'quality', { get() { const t = html5.getSources .call(e) .find(r => r.getAttribute('src') === e.source); return t && Number(t.getAttribute('size')); }, set(t) { if (e.quality !== t) { if ( e.config.quality.forced && is.function(e.config.quality.onChange) ) e.config.quality.onChange(t); else { const r = html5.getSources .call(e) .find(l => Number(l.getAttribute('size')) === t); if (!r) return; const { currentTime: i, paused: s, preload: n, readyState: a, playbackRate: o } = e.media; (e.media.src = r.getAttribute('src')), (n !== 'none' || a) && (e.once('loadedmetadata', () => { (e.speed = o), (e.currentTime = i), s || silencePromise(e.play()); }), e.media.load()); } triggerEvent.call(e, e.media, 'qualitychange', !1, { quality: t }); } } }); }, cancelRequests() { this.isHTML5 && (removeElement(html5.getSources.call(this)), this.media.setAttribute('src', this.config.blankVideo), this.media.load(), this.debug.log('Cancelled network requests')); } }; function generateId(e) { return `${e}-${Math.floor(1e4 * Math.random())}`; } function format(e, ...t) { return is.empty(e) ? e : e.toString().replace(/{(\d+)}/g, (r, i) => t[i].toString()); } function getPercentage(e, t) { return e === 0 || t === 0 || Number.isNaN(e) || Number.isNaN(t) ? 0 : ((e / t) * 100).toFixed(2); } const replaceAll = (e = '', t = '', r = '') => e.replace( new RegExp( t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'), 'g' ), r.toString() ), toTitleCase = (e = '') => e .toString() .replace( /\w\S*/g, t => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase() ); function toPascalCase(e = '') { let t = e.toString(); return ( (t = replaceAll(t, '-', ' ')), (t = replaceAll(t, '_', ' ')), (t = toTitleCase(t)), replaceAll(t, ' ', '') ); } function toCamelCase(e = '') { let t = e.toString(); return (t = toPascalCase(t)), t.charAt(0).toLowerCase() + t.slice(1); } function stripHTML(e) { const t = document.createDocumentFragment(), r = document.createElement('div'); return t.appendChild(r), (r.innerHTML = e), t.firstChild.innerText; } function getHTML(e) { const t = document.createElement('div'); return t.appendChild(e), t.innerHTML; } const resources = { pip: 'PIP', airplay: 'AirPlay', html5: 'HTML5', vimeo: 'Vimeo', youtube: 'YouTube' }, i18n = { get(e = '', t = {}) { if (is.empty(e) || is.empty(t)) return ''; let r = getDeep(t.i18n, e); if (is.empty(r)) return Object.keys(resources).includes(e) ? resources[e] : ''; const i = { '{seektime}': t.seekTime, '{title}': t.title }; return ( Object.entries(i).forEach(([s, n]) => { r = replaceAll(r, s, n); }), r ); } }; class Storage { constructor(t) { _defineProperty$1(this, 'get', r => { if (!Storage.supported || !this.enabled) return null; const i = window.localStorage.getItem(this.key); if (is.empty(i)) return null; const s = JSON.parse(i); return is.string(r) && r.length ? s[r] : s; }), _defineProperty$1(this, 'set', r => { if (!Storage.supported || !this.enabled || !is.object(r)) return; let i = this.get(); is.empty(i) && (i = {}), extend(i, r); try { window.localStorage.setItem(this.key, JSON.stringify(i)); } catch {} }), (this.enabled = t.config.storage.enabled), (this.key = t.config.storage.key); } static get supported() { try { if (!('localStorage' in window)) return !1; const t = '___test'; return ( window.localStorage.setItem(t, t), window.localStorage.removeItem(t), !0 ); } catch { return !1; } } } function fetch$1(e, t = 'text') { return new Promise((r, i) => { try { const s = new XMLHttpRequest(); if (!('withCredentials' in s)) return; s.addEventListener('load', () => { if (t === 'text') try { r(JSON.parse(s.responseText)); } catch { r(s.responseText); } else r(s.response); }), s.addEventListener('error', () => { throw new Error(s.status); }), s.open('GET', e, !0), (s.responseType = t), s.send(); } catch (s) { i(s); } }); } function loadSprite(e, t) { if (!is.string(e)) return; const r = 'cache', i = is.string(t); let s = !1; const n = () => document.getElementById(t) !== null, a = (o, l) => { (o.innerHTML = l), (i && n()) || document.body.insertAdjacentElement('afterbegin', o); }; if (!i || !n()) { const o = Storage.supported, l = document.createElement('div'); if ((l.setAttribute('hidden', ''), i && l.setAttribute('id', t), o)) { const c = window.localStorage.getItem(`${r}-${t}`); if (((s = c !== null), s)) { const g = JSON.parse(c); a(l, g.content); } } fetch$1(e) .then(c => { if (!is.empty(c)) { if (o) try { window.localStorage.setItem( `${r}-${t}`, JSON.stringify({ content: c }) ); } catch {} a(l, c); } }) .catch(() => {}); } } const getHours = e => Math.trunc((e / 60 / 60) % 60, 10), getMinutes = e => Math.trunc((e / 60) % 60, 10), getSeconds = e => Math.trunc(e % 60, 10); function formatTime(e = 0, t = !1, r = !1) { if (!is.number(e)) return formatTime(void 0, t, r); const i = o => `0${o}`.slice(-2); let s = getHours(e); const n = getMinutes(e), a = getSeconds(e); return ( (s = t || s > 0 ? `${s}:` : ''), `${r && e > 0 ? '-' : ''}${s}${i(n)}:${i(a)}` ); } const controls$2 = { getIconUrl() { const e = new URL(this.config.iconUrl, window.location), t = window.location.host ? window.location.host : window.top.location.host, r = e.host !== t || (browser.isIE && !window.svg4everybody); return { url: this.config.iconUrl, cors: r }; }, findElements() { try { return ( (this.elements.controls = getElement.call( this, this.config.selectors.controls.wrapper )), (this.elements.buttons = { play: getElements.call(this, this.config.selectors.buttons.play), pause: getElement.call(this, this.config.selectors.buttons.pause), restart: getElement.call(this, this.config.selectors.buttons.restart), rewind: getElement.call(this, this.config.selectors.buttons.rewind), fastForward: getElement.call( this, this.config.selectors.buttons.fastForward ), mute: getElement.call(this, this.config.selectors.buttons.mute), pip: getElement.call(this, this.config.selectors.buttons.pip), airplay: getElement.call(this, this.config.selectors.buttons.airplay), settings: getElement.call( this, this.config.selectors.buttons.settings ), captions: getElement.call( this, this.config.selectors.buttons.captions ), fullscreen: getElement.call( this, this.config.selectors.buttons.fullscreen ) }), (this.elements.progress = getElement.call( this, this.config.selectors.progress )), (this.elements.inputs = { seek: getElement.call(this, this.config.selectors.inputs.seek), volume: getElement.call(this, this.config.selectors.inputs.volume) }), (this.elements.display = { buffer: getElement.call(this, this.config.selectors.display.buffer), currentTime: getElement.call( this, this.config.selectors.display.currentTime ), duration: getElement.call( this, this.config.selectors.display.duration ) }), is.element(this.elements.progress) && (this.elements.display.seekTooltip = this.elements.progress.querySelector( `.${this.config.classNames.tooltip}` )), !0 ); } catch (e) { return ( this.debug.warn( 'It looks like there is a problem with your custom controls HTML', e ), this.toggleNativeControls(!0), !1 ); } }, createIcon(e, t) { const r = 'http://www.w3.org/2000/svg', i = controls$2.getIconUrl.call(this), s = `${i.cors ? '' : i.url}#${this.config.iconPrefix}`, n = document.createElementNS(r, 'svg'); setAttributes(n, extend(t, { 'aria-hidden': 'true', focusable: 'false' })); const a = document.createElementNS(r, 'use'), o = `${s}-${e}`; return ( 'href' in a && a.setAttributeNS('http://www.w3.org/1999/xlink', 'href', o), a.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', o), n.appendChild(a), n ); }, createLabel(e, t = {}) { const r = i18n.get(e, this.config); return createElement( 'span', { ...t, class: [t.class, this.config.classNames.hidden] .filter(Boolean) .join(' ') }, r ); }, createBadge(e) { if (is.empty(e)) return null; const t = createElement('span', { class: this.config.classNames.menu.value }); return ( t.appendChild( createElement('span', { class: this.config.classNames.menu.badge }, e) ), t ); }, createButton(e, t) { const r = extend({}, t); let i = toCamelCase(e); const s = { element: 'button', toggle: !1, label: null, icon: null, labelPressed: null, iconPressed: null }; switch ( (['element', 'icon', 'label'].forEach(a => { Object.keys(r).includes(a) && ((s[a] = r[a]), delete r[a]); }), s.element !== 'button' || Object.keys(r).includes('type') || (r.type = 'button'), Object.keys(r).includes('class') ? r.class.split(' ').some(a => a === this.config.classNames.control) || extend(r, { class: `${r.class} ${this.config.classNames.control}` }) : (r.class = this.config.classNames.control), e) ) { case 'play': (s.toggle = !0), (s.label = 'play'), (s.labelPressed = 'pause'), (s.icon = 'play'), (s.iconPressed = 'pause'); break; case 'mute': (s.toggle = !0), (s.label = 'mute'), (s.labelPressed = 'unmute'), (s.icon = 'volume'), (s.iconPressed = 'muted'); break; case 'captions': (s.toggle = !0), (s.label = 'enableCaptions'), (s.labelPressed = 'disableCaptions'), (s.icon = 'captions-off'), (s.iconPressed = 'captions-on'); break; case 'fullscreen': (s.toggle = !0), (s.label = 'enterFullscreen'), (s.labelPressed = 'exitFullscreen'), (s.icon = 'enter-fullscreen'), (s.iconPressed = 'exit-fullscreen'); break; case 'play-large': (r.class += ` ${this.config.classNames.control}--overlaid`), (i = 'play'), (s.label = 'play'), (s.icon = 'play'); break; default: is.empty(s.label) && (s.label = i), is.empty(s.icon) && (s.icon = e); } const n = createElement(s.element); return ( s.toggle ? (n.appendChild( controls$2.createIcon.call(this, s.iconPressed, { class: 'icon--pressed' }) ), n.appendChild( controls$2.createIcon.call(this, s.icon, { class: 'icon--not-pressed' }) ), n.appendChild( controls$2.createLabel.call(this, s.labelPressed, { class: 'label--pressed' }) ), n.appendChild( controls$2.createLabel.call(this, s.label, { class: 'label--not-pressed' }) )) : (n.appendChild(controls$2.createIcon.call(this, s.icon)), n.appendChild(controls$2.createLabel.call(this, s.label))), extend(r, getAttributesFromSelector(this.config.selectors.buttons[i], r)), setAttributes(n, r), i === 'play' ? (is.array(this.elements.buttons[i]) || (this.elements.buttons[i] = []), this.elements.buttons[i].push(n)) : (this.elements.buttons[i] = n), n ); }, createRange(e, t) { const r = createElement( 'input', extend( getAttributesFromSelector(this.config.selectors.inputs[e]), { type: 'range', min: 0, max: 100, step: 0.01, value: 0, autocomplete: 'off', role: 'slider', 'aria-label': i18n.get(e, this.config), 'aria-valuemin': 0, 'aria-valuemax': 100, 'aria-valuenow': 0 }, t ) ); return ( (this.elements.inputs[e] = r), controls$2.updateRangeFill.call(this, r), RangeTouch.setup(r), r ); }, createProgress(e, t) { const r = createElement( 'progress', extend( getAttributesFromSelector(this.config.selectors.display[e]), { min: 0, max: 100, value: 0, role: 'progressbar', 'aria-hidden': !0 }, t ) ); if (e !== 'volume') { r.appendChild(createElement('span', null, '0')); const i = { played: 'played', buffer: 'buffered' }[e], s = i ? i18n.get(i, this.config) : ''; r.innerText = `% ${s.toLowerCase()}`; } return (this.elements.display[e] = r), r; }, createTime(e, t) { const r = getAttributesFromSelector(this.config.selectors.display[e], t), i = createElement( 'div', extend(r, { class: `${r.class ? r.class : ''} ${ this.config.classNames.display.time } `.trim(), 'aria-label': i18n.get(e, this.config), role: 'timer' }), '00:00' ); return (this.elements.display[e] = i), i; }, bindMenuItemShortcuts(e, t) { on.call( this, e, 'keydown keyup', r => { if ( ![' ', 'ArrowUp', 'ArrowDown', 'ArrowRight'].includes(r.key) || (r.preventDefault(), r.stopPropagation(), r.type === 'keydown') ) return; const i = matches(e, '[role="menuitemradio"]'); if (!i && [' ', 'ArrowRight'].includes(r.key)) controls$2.showMenuPanel.call(this, t, !0); else { let s; r.key !== ' ' && (r.key === 'ArrowDown' || (i && r.key === 'ArrowRight') ? ((s = e.nextElementSibling), is.element(s) || (s = e.parentNode.firstElementChild)) : ((s = e.previousElementSibling), is.element(s) || (s = e.parentNode.lastElementChild)), setFocus.call(this, s, !0)); } }, !1 ), on.call(this, e, 'keyup', r => { r.key === 'Return' && controls$2.focusFirstMenuItem.call(this, null, !0); }); }, createMenuItem({ value: e, list: t, type: r, title: i, badge: s = null, checked: n = !1 }) { const a = getAttributesFromSelector(this.config.selectors.inputs[r]), o = createElement( 'button', extend(a, { type: 'button', role: 'menuitemradio', class: `${this.config.classNames.control} ${ a.class ? a.class : '' }`.trim(), 'aria-checked': n, value: e }) ), l = createElement('span'); (l.innerHTML = i), is.element(s) && l.appendChild(s), o.appendChild(l), Object.defineProperty(o, 'checked', { enumerable: !0, get: () => o.getAttribute('aria-checked') === 'true', set(c) { c && Array.from(o.parentNode.children) .filter(g => matches(g, '[role="menuitemradio"]')) .forEach(g => g.setAttribute('aria-checked', 'false')), o.setAttribute('aria-checked', c ? 'true' : 'false'); } }), this.listeners.bind( o, 'click keyup', c => { if (!is.keyboardEvent(c) || c.key === ' ') { switch ( (c.preventDefault(), c.stopPropagation(), (o.checked = !0), r) ) { case 'language': this.currentTrack = Number(e); break; case 'quality': this.quality = e; break; case 'speed': this.speed = parseFloat(e); } controls$2.showMenuPanel.call(this, 'home', is.keyboardEvent(c)); } }, r, !1 ), controls$2.bindMenuItemShortcuts.call(this, o, r), t.appendChild(o); }, formatTime(e = 0, t = !1) { return is.number(e) ? formatTime(e, getHours(this.duration) > 0, t) : e; }, updateTimeDisplay(e = null, t = 0, r = !1) { is.element(e) && is.number(t) && (e.innerText = controls$2.formatTime(t, r)); }, updateVolume() { this.supported.ui && (is.element(this.elements.inputs.volume) && controls$2.setRange.call( this, this.elements.inputs.volume, this.muted ? 0 : this.volume ), is.element(this.elements.buttons.mute) && (this.elements.buttons.mute.pressed = this.muted || this.volume === 0)); }, setRange(e, t = 0) { is.element(e) && ((e.value = t), controls$2.updateRangeFill.call(this, e)); }, updateProgress(e) { if (!this.supported.ui || !is.event(e)) return; let t = 0; const r = (i, s) => { const n = is.number(s) ? s : 0, a = is.element(i) ? i : this.elements.display.buffer; if (is.element(a)) { a.value = n; const o = a.getElementsByTagName('span')[0]; is.element(o) && (o.childNodes[0].nodeValue = n); } }; if (e) switch (e.type) { case 'timeupdate': case 'seeking': case 'seeked': (t = getPercentage(this.currentTime, this.duration)), e.type === 'timeupdate' && controls$2.setRange.call(this, this.elements.inputs.seek, t); break; case 'playing': case 'progress': r(this.elements.display.buffer, 100 * this.buffered); } }, updateRangeFill(e) { const t = is.event(e) ? e.target : e; if (is.element(t) && t.getAttribute('type') === 'range') { if (matches(t, this.config.selectors.inputs.seek)) { t.setAttribute('aria-valuenow', this.currentTime); const r = controls$2.formatTime(this.currentTime), i = controls$2.formatTime(this.duration), s = i18n.get('seekLabel', this.config); t.setAttribute( 'aria-valuetext', s.replace('{currentTime}', r).replace('{duration}', i) ); } else if (matches(t, this.config.selectors.inputs.volume)) { const r = 100 * t.value; t.setAttribute('aria-valuenow', r), t.setAttribute('aria-valuetext', `${r.toFixed(1)}%`); } else t.setAttribute('aria-valuenow', t.value); (browser.isWebKit || browser.isIPadOS) && t.style.setProperty('--value', (t.value / t.max) * 100 + '%'); } }, updateSeekTooltip(e) { var t, r; if ( !this.config.tooltips.seek || !is.element(this.elements.inputs.seek) || !is.element(this.elements.display.seekTooltip) || this.duration === 0 ) return; const i = this.elements.display.seekTooltip, s = `${this.config.classNames.tooltip}--visible`, n = g => toggleClass(i, s, g); if (this.touch) return void n(!1); let a = 0; const o = this.elements.progress.getBoundingClientRect(); if (is.event(e)) a = (100 / o.width) * (e.pageX - o.left); else { if (!hasClass(i, s)) return; a = parseFloat(i.style.left, 10); } a < 0 ? (a = 0) : a > 100 && (a = 100); const l = (this.duration / 100) * a; i.innerText = controls$2.formatTime(l); const c = (t = this.config.markers) === null || t === void 0 || (r = t.points) === null || r === void 0 ? void 0 : r.find(({ time: g }) => g === Math.round(l)); c && i.insertAdjacentHTML('afterbegin', `${c.label}
`), (i.style.left = `${a}%`), is.event(e) && ['mouseenter', 'mouseleave'].includes(e.type) && n(e.type === 'mouseenter'); }, timeUpdate(e) { const t = !is.element(this.elements.display.duration) && this.config.invertTime; controls$2.updateTimeDisplay.call( this, this.elements.display.currentTime, t ? this.duration - this.currentTime : this.currentTime, t ), (e && e.type === 'timeupdate' && this.media.seeking) || controls$2.updateProgress.call(this, e); }, durationUpdate() { if (!this.supported.ui || (!this.config.invertTime && this.currentTime)) return; if (this.duration >= 2 ** 32) return ( toggleHidden(this.elements.display.currentTime, !0), void toggleHidden(this.elements.progress, !0) ); is.element(this.elements.inputs.seek) && this.elements.inputs.seek.setAttribute('aria-valuemax', this.duration); const e = is.element(this.elements.display.duration); !e && this.config.displayDuration && this.paused && controls$2.updateTimeDisplay.call( this, this.elements.display.currentTime, this.duration ), e && controls$2.updateTimeDisplay.call( this, this.elements.display.duration, this.duration ), this.config.markers.enabled && controls$2.setMarkers.call(this), controls$2.updateSeekTooltip.call(this); }, toggleMenuButton(e, t) { toggleHidden(this.elements.settings.buttons[e], !t); }, updateSetting(e, t, r) { const i = this.elements.settings.panels[e]; let s = null, n = t; if (e === 'captions') s = this.currentTrack; else { if ( ((s = is.empty(r) ? this[e] : r), is.empty(s) && (s = this.config[e].default), !is.empty(this.options[e]) && !this.options[e].includes(s)) ) return void this.debug.warn(`Unsupported value of '${s}' for ${e}`); if (!this.config[e].options.includes(s)) return void this.debug.warn(`Disabled value of '${s}' for ${e}`); } if ( (is.element(n) || (n = i && i.querySelector('[role="menu"]')), !is.element(n)) ) return; this.elements.settings.buttons[e].querySelector( `.${this.config.classNames.menu.value}` ).innerHTML = controls$2.getLabel.call(this, e, s); const a = n && n.querySelector(`[value="${s}"]`); is.element(a) && (a.checked = !0); }, getLabel(e, t) { switch (e) { case 'speed': return t === 1 ? i18n.get('normal', this.config) : `${t}×`; case 'quality': if (is.number(t)) { const r = i18n.get(`qualityLabel.${t}`, this.config); return r.length ? r : `${t}p`; } return toTitleCase(t); case 'captions': return captions.getLabel.call(this); default: return null; } }, setQualityMenu(e) { if (!is.element(this.elements.settings.panels.quality)) return; const t = 'quality', r = this.elements.settings.panels.quality.querySelector('[role="menu"]'); is.array(e) && (this.options.quality = dedupe(e).filter(n => this.config.quality.options.includes(n) )); const i = !is.empty(this.options.quality) && this.options.quality.length > 1; if ( (controls$2.toggleMenuButton.call(this, t, i), emptyElement(r), controls$2.checkMenu.call(this), !i) ) return; const s = n => { const a = i18n.get(`qualityBadge.${n}`, this.config); return a.length ? controls$2.createBadge.call(this, a) : null; }; this.options.quality .sort((n, a) => { const o = this.config.quality.options; return o.indexOf(n) > o.indexOf(a) ? 1 : -1; }) .forEach(n => { controls$2.createMenuItem.call(this, { value: n, list: r, type: t, title: controls$2.getLabel.call(this, 'quality', n), badge: s(n) }); }), controls$2.updateSetting.call(this, t, r); }, setCaptionsMenu() { if (!is.element(this.elements.settings.panels.captions)) return; const e = 'captions', t = this.elements.settings.panels.captions.querySelector('[role="menu"]'), r = captions.getTracks.call(this), i = !!r.length; if ( (controls$2.toggleMenuButton.call(this, e, i), emptyElement(t), controls$2.checkMenu.call(this), !i) ) return; const s = r.map((n, a) => ({ value: a, checked: this.captions.toggled && this.currentTrack === a, title: captions.getLabel.call(this, n), badge: n.language && controls$2.createBadge.call(this, n.language.toUpperCase()), list: t, type: 'language' })); s.unshift({ value: -1, checked: !this.captions.toggled, title: i18n.get('disabled', this.config), list: t, type: 'language' }), s.forEach(controls$2.createMenuItem.bind(this)), controls$2.updateSetting.call(this, e, t); }, setSpeedMenu() { if (!is.element(this.elements.settings.panels.speed)) return; const e = 'speed', t = this.elements.settings.panels.speed.querySelector('[role="menu"]'); this.options.speed = this.options.speed.filter( i => i >= this.minimumSpeed && i <= this.maximumSpeed ); const r = !is.empty(this.options.speed) && this.options.speed.length > 1; controls$2.toggleMenuButton.call(this, e, r), emptyElement(t), controls$2.checkMenu.call(this), r && (this.options.speed.forEach(i => { controls$2.createMenuItem.call(this, { value: i, list: t, type: e, title: controls$2.getLabel.call(this, 'speed', i) }); }), controls$2.updateSetting.call(this, e, t)); }, checkMenu() { const { buttons: e } = this.elements.settings, t = !is.empty(e) && Object.values(e).some(r => !r.hidden); toggleHidden(this.elements.settings.menu, !t); }, focusFirstMenuItem(e, t = !1) { if (this.elements.settings.popup.hidden) return; let r = e; is.element(r) || (r = Object.values(this.elements.settings.panels).find(s => !s.hidden)); const i = r.querySelector('[role^="menuitem"]'); setFocus.call(this, i, t); }, toggleMenu(e) { const { popup: t } = this.elements.settings, r = this.elements.buttons.settings; if (!is.element(t) || !is.element(r)) return; const { hidden: i } = t; let s = i; if (is.boolean(e)) s = e; else if (is.keyboardEvent(e) && e.key === 'Escape') s = !1; else if (is.event(e)) { const n = is.function(e.composedPath) ? e.composedPath()[0] : e.target, a = t.contains(n); if (a || (!a && e.target !== r && s)) return; } r.setAttribute('aria-expanded', s), toggleHidden(t, !s), toggleClass(this.elements.container, this.config.classNames.menu.open, s), s && is.keyboardEvent(e) ? controls$2.focusFirstMenuItem.call(this, null, !0) : s || i || setFocus.call(this, r, is.keyboardEvent(e)); }, getMenuSize(e) { const t = e.cloneNode(!0); (t.style.position = 'absolute'), (t.style.opacity = 0), t.removeAttribute('hidden'), e.parentNode.appendChild(t); const r = t.scrollWidth, i = t.scrollHeight; return removeElement(t), { width: r, height: i }; }, showMenuPanel(e = '', t = !1) { const r = this.elements.container.querySelector( `#plyr-settings-${this.id}-${e}` ); if (!is.element(r)) return; const i = r.parentNode, s = Array.from(i.children).find(n => !n.hidden); if (support.transitions && !support.reducedMotion) { (i.style.width = `${s.scrollWidth}px`), (i.style.height = `${s.scrollHeight}px`); const n = controls$2.getMenuSize.call(this, r), a = o => { o.target === i && ['width', 'height'].includes(o.propertyName) && ((i.style.width = ''), (i.style.height = ''), off.call(this, i, transitionEndEvent, a)); }; on.call(this, i, transitionEndEvent, a), (i.style.width = `${n.width}px`), (i.style.height = `${n.height}px`); } toggleHidden(s, !0), toggleHidden(r, !1), controls$2.focusFirstMenuItem.call(this, r, t); }, setDownloadUrl() { const e = this.elements.buttons.download; is.element(e) && e.setAttribute('href', this.download); }, create(e) { const { bindMenuItemShortcuts: t, createButton: r, createProgress: i, createRange: s, createTime: n, setQualityMenu: a, setSpeedMenu: o, showMenuPanel: l } = controls$2; (this.elements.controls = null), is.array(this.config.controls) && this.config.controls.includes('play-large') && this.elements.container.appendChild(r.call(this, 'play-large')); const c = createElement( 'div', getAttributesFromSelector(this.config.selectors.controls.wrapper) ); this.elements.controls = c; const g = { class: 'plyr__controls__item' }; return ( dedupe( is.array(this.config.controls) ? this.config.controls : [] ).forEach(S => { if ( (S === 'restart' && c.appendChild(r.call(this, 'restart', g)), S === 'rewind' && c.appendChild(r.call(this, 'rewind', g)), S === 'play' && c.appendChild(r.call(this, 'play', g)), S === 'fast-forward' && c.appendChild(r.call(this, 'fast-forward', g)), S === 'progress') ) { const p = createElement('div', { class: `${g.class} plyr__progress__container` }), P = createElement( 'div', getAttributesFromSelector(this.config.selectors.progress) ); if ( (P.appendChild(s.call(this, 'seek', { id: `plyr-seek-${e.id}` })), P.appendChild(i.call(this, 'buffer')), this.config.tooltips.seek) ) { const b = createElement( 'span', { class: this.config.classNames.tooltip }, '00:00' ); P.appendChild(b), (this.elements.display.seekTooltip = b); } (this.elements.progress = P), p.appendChild(this.elements.progress), c.appendChild(p); } if ( (S === 'current-time' && c.appendChild(n.call(this, 'currentTime', g)), S === 'duration' && c.appendChild(n.call(this, 'duration', g)), S === 'mute' || S === 'volume') ) { let { volume: p } = this.elements; if ( ((is.element(p) && c.contains(p)) || ((p = createElement( 'div', extend({}, g, { class: `${g.class} plyr__volume`.trim() }) )), (this.elements.volume = p), c.appendChild(p)), S === 'mute' && p.appendChild(r.call(this, 'mute')), S === 'volume' && !browser.isIos && !browser.isIPadOS) ) { const P = { max: 1, step: 0.05, value: this.config.volume }; p.appendChild( s.call(this, 'volume', extend(P, { id: `plyr-volume-${e.id}` })) ); } } if ( (S === 'captions' && c.appendChild(r.call(this, 'captions', g)), S === 'settings' && !is.empty(this.config.settings)) ) { const p = createElement( 'div', extend({}, g, { class: `${g.class} plyr__menu`.trim(), hidden: '' }) ); p.appendChild( r.call(this, 'settings', { 'aria-haspopup': !0, 'aria-controls': `plyr-settings-${e.id}`, 'aria-expanded': !1 }) ); const P = createElement('div', { class: 'plyr__menu__container', id: `plyr-settings-${e.id}`, hidden: '' }), b = createElement('div'), y = createElement('div', { id: `plyr-settings-${e.id}-home` }), A = createElement('div', { role: 'menu' }); y.appendChild(A), b.appendChild(y), (this.elements.settings.panels.home = y), this.config.settings.forEach(u => { const f = createElement( 'button', extend( getAttributesFromSelector( this.config.selectors.buttons.settings ), { type: 'button', class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`, role: 'menuitem', 'aria-haspopup': !0, hidden: '' } ) ); t.call(this, f, u), on.call(this, f, 'click', () => { l.call(this, u, !1); }); const m = createElement('span', null, i18n.get(u, this.config)), d = createElement('span', { class: this.config.classNames.menu.value }); (d.innerHTML = e[u]), m.appendChild(d), f.appendChild(m), A.appendChild(f); const E = createElement('div', { id: `plyr-settings-${e.id}-${u}`, hidden: '' }), T = createElement('button', { type: 'button', class: `${this.config.classNames.control} ${this.config.classNames.control}--back` }); T.appendChild( createElement( 'span', { 'aria-hidden': !0 }, i18n.get(u, this.config) ) ), T.appendChild( createElement( 'span', { class: this.config.classNames.hidden }, i18n.get('menuBack', this.config) ) ), on.call( this, E, 'keydown', x => { x.key === 'ArrowLeft' && (x.preventDefault(), x.stopPropagation(), l.call(this, 'home', !0)); }, !1 ), on.call(this, T, 'click', () => { l.call(this, 'home', !1); }), E.appendChild(T), E.appendChild(createElement('div', { role: 'menu' })), b.appendChild(E), (this.elements.settings.buttons[u] = f), (this.elements.settings.panels[u] = E); }), P.appendChild(b), p.appendChild(P), c.appendChild(p), (this.elements.settings.popup = P), (this.elements.settings.menu = p); } if ( (S === 'pip' && support.pip && c.appendChild(r.call(this, 'pip', g)), S === 'airplay' && support.airplay && c.appendChild(r.call(this, 'airplay', g)), S === 'download') ) { const p = extend({}, g, { element: 'a', href: this.download, target: '_blank' }); this.isHTML5 && (p.download = ''); const { download: P } = this.config.urls; !is.url(P) && this.isEmbed && extend(p, { icon: `logo-${this.provider}`, label: this.provider }), c.appendChild(r.call(this, 'download', p)); } S === 'fullscreen' && c.appendChild(r.call(this, 'fullscreen', g)); }), this.isHTML5 && a.call(this, html5.getQualityOptions.call(this)), o.call(this), c ); }, inject() { if (this.config.loadSprite) { const s = controls$2.getIconUrl.call(this); s.cors && loadSprite(s.url, 'sprite-plyr'); } this.id = Math.floor(1e4 * Math.random()); let e = null; this.elements.controls = null; const t = { id: this.id, seektime: this.config.seekTime, title: this.config.title }; let r = !0; is.function(this.config.controls) && (this.config.controls = this.config.controls.call(this, t)), this.config.controls || (this.config.controls = []), is.element(this.config.controls) || is.string(this.config.controls) ? (e = this.config.controls) : ((e = controls$2.create.call(this, { id: this.id, seektime: this.config.seekTime, speed: this.speed, quality: this.quality, captions: captions.getLabel.call(this) })), (r = !1)); let i; if ( (r && is.string(this.config.controls) && (e = (s => { let n = s; return ( Object.entries(t).forEach(([a, o]) => { n = replaceAll(n, `{${a}}`, o); }), n ); })(e)), is.string(this.config.selectors.controls.container) && (i = document.querySelector(this.config.selectors.controls.container)), is.element(i) || (i = this.elements.container), i[is.element(e) ? 'insertAdjacentElement' : 'insertAdjacentHTML']( 'afterbegin', e ), is.element(this.elements.controls) || controls$2.findElements.call(this), !is.empty(this.elements.buttons)) ) { const s = n => { const a = this.config.classNames.controlPressed; n.setAttribute('aria-pressed', 'false'), Object.defineProperty(n, 'pressed', { configurable: !0, enumerable: !0, get: () => hasClass(n, a), set(o = !1) { toggleClass(n, a, o), n.setAttribute('aria-pressed', o ? 'true' : 'false'); } }); }; Object.values(this.elements.buttons) .filter(Boolean) .forEach(n => { is.array(n) || is.nodeList(n) ? Array.from(n).filter(Boolean).forEach(s) : s(n); }); } if ((browser.isEdge && repaint(i), this.config.tooltips.controls)) { const { classNames: s, selectors: n } = this.config, a = `${n.controls.wrapper} ${n.labels} .${s.hidden}`, o = getElements.call(this, a); Array.from(o).forEach(l => { toggleClass(l, this.config.classNames.hidden, !1), toggleClass(l, this.config.classNames.tooltip, !0); }); } }, setMediaMetadata() { try { 'mediaSession' in navigator && (navigator.mediaSession.metadata = new window.MediaMetadata({ title: this.config.mediaMetadata.title, artist: this.config.mediaMetadata.artist, album: this.config.mediaMetadata.album, artwork: this.config.mediaMetadata.artwork })); } catch {} }, setMarkers() { var e, t; if (!this.duration || this.elements.markers) return; const r = (e = this.config.markers) === null || e === void 0 || (t = e.points) === null || t === void 0 ? void 0 : t.filter(({ time: l }) => l > 0 && l < this.duration); if (r == null || !r.length) return; const i = document.createDocumentFragment(), s = document.createDocumentFragment(); let n = null; const a = `${this.config.classNames.tooltip}--visible`, o = l => toggleClass(n, a, l); r.forEach(l => { const c = createElement( 'span', { class: this.config.classNames.marker }, '' ), g = (l.time / this.duration) * 100 + '%'; n && (c.addEventListener('mouseenter', () => { l.label || ((n.style.left = g), (n.innerHTML = l.label), o(!0)); }), c.addEventListener('mouseleave', () => { o(!1); })), c.addEventListener('click', () => { this.currentTime = l.time; }), (c.style.left = g), s.appendChild(c); }), i.appendChild(s), this.config.tooltips.seek || ((n = createElement( 'span', { class: this.config.classNames.tooltip }, '' )), i.appendChild(n)), (this.elements.markers = { points: s, tip: n }), this.elements.progress.appendChild(i); } }; function parseUrl(e, t = !0) { let r = e; if (t) { const i = document.createElement('a'); (i.href = r), (r = i.href); } try { return new URL(r); } catch { return null; } } function buildUrlParams(e) { const t = new URLSearchParams(); return ( is.object(e) && Object.entries(e).forEach(([r, i]) => { t.set(r, i); }), t ); } const captions = { setup() { if (!this.supported.ui) return; if ( !this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks) ) return void ( is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions') && controls$2.setCaptionsMenu.call(this) ); if ( (is.element(this.elements.captions) || ((this.elements.captions = createElement( 'div', getAttributesFromSelector(this.config.selectors.captions) )), this.elements.captions.setAttribute('dir', 'auto'), insertAfter(this.elements.captions, this.elements.wrapper)), browser.isIE && window.URL) ) { const i = this.media.querySelectorAll('track'); Array.from(i).forEach(s => { const n = s.getAttribute('src'), a = parseUrl(n); a !== null && a.hostname !== window.location.href.hostname && ['http:', 'https:'].includes(a.protocol) && fetch$1(n, 'blob') .then(o => { s.setAttribute('src', window.URL.createObjectURL(o)); }) .catch(() => { removeElement(s); }); }); } const e = dedupe( ( navigator.languages || [ navigator.language || navigator.userLanguage || 'en' ] ).map(i => i.split('-')[0]) ); let t = ( this.storage.get('language') || this.config.captions.language || 'auto' ).toLowerCase(); t === 'auto' && ([t] = e); let r = this.storage.get('captions'); if ( (is.boolean(r) || ({ active: r } = this.config.captions), Object.assign(this.captions, { toggled: !1, active: r, language: t, languages: e }), this.isHTML5) ) { const i = this.config.captions.update ? 'addtrack removetrack' : 'removetrack'; on.call(this, this.media.textTracks, i, captions.update.bind(this)); } setTimeout(captions.update.bind(this), 0); }, update() { const e = captions.getTracks.call(this, !0), { active: t, language: r, meta: i, currentTrackNode: s } = this.captions, n = !!e.find(a => a.language === r); this.isHTML5 && this.isVideo && e .filter(a => !i.get(a)) .forEach(a => { this.debug.log('Track added', a), i.set(a, { default: a.mode === 'showing' }), a.mode === 'showing' && (a.mode = 'hidden'), on.call(this, a, 'cuechange', () => captions.updateCues.call(this) ); }), ((n && this.language !== r) || !e.includes(s)) && (captions.setLanguage.call(this, r), captions.toggle.call(this, t && n)), this.elements && toggleClass( this.elements.container, this.config.classNames.captions.enabled, !is.empty(e) ), is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions') && controls$2.setCaptionsMenu.call(this); }, toggle(e, t = !0) { if (!this.supported.ui) return; const { toggled: r } = this.captions, i = this.config.classNames.captions.active, s = is.nullOrUndefined(e) ? !r : e; if (s !== r) { if ( (t || ((this.captions.active = s), this.storage.set({ captions: s })), !this.language && s && !t) ) { const n = captions.getTracks.call(this), a = captions.findTrack.call( this, [this.captions.language, ...this.captions.languages], !0 ); return ( (this.captions.language = a.language), void captions.set.call(this, n.indexOf(a)) ); } this.elements.buttons.captions && (this.elements.buttons.captions.pressed = s), toggleClass(this.elements.container, i, s), (this.captions.toggled = s), controls$2.updateSetting.call(this, 'captions'), triggerEvent.call( this, this.media, s ? 'captionsenabled' : 'captionsdisabled' ); } setTimeout(() => { s && this.captions.toggled && (this.captions.currentTrackNode.mode = 'hidden'); }); }, set(e, t = !0) { const r = captions.getTracks.call(this); if (e !== -1) if (is.number(e)) if (e in r) { if (this.captions.currentTrack !== e) { this.captions.currentTrack = e; const i = r[e], { language: s } = i || {}; (this.captions.currentTrackNode = i), controls$2.updateSetting.call(this, 'captions'), t || ((this.captions.language = s), this.storage.set({ language: s })), this.isVimeo && this.embed.enableTextTrack(s), triggerEvent.call(this, this.media, 'languagechange'); } captions.toggle.call(this, !0, t), this.isHTML5 && this.isVideo && captions.updateCues.call(this); } else this.debug.warn('Track not found', e); else this.debug.warn('Invalid caption argument', e); else captions.toggle.call(this, !1, t); }, setLanguage(e, t = !0) { if (!is.string(e)) return void this.debug.warn('Invalid language argument', e); const r = e.toLowerCase(); this.captions.language = r; const i = captions.getTracks.call(this), s = captions.findTrack.call(this, [r]); captions.set.call(this, i.indexOf(s), t); }, getTracks(e = !1) { return Array.from((this.media || {}).textTracks || []) .filter(t => !this.isHTML5 || e || this.captions.meta.has(t)) .filter(t => ['captions', 'subtitles'].includes(t.kind)); }, findTrack(e, t = !1) { const r = captions.getTracks.call(this), i = a => Number((this.captions.meta.get(a) || {}).default), s = Array.from(r).sort((a, o) => i(o) - i(a)); let n; return ( e.every(a => ((n = s.find(o => o.language === a)), !n)), n || (t ? s[0] : void 0) ); }, getCurrentTrack() { return captions.getTracks.call(this)[this.currentTrack]; }, getLabel(e) { let t = e; return ( !is.track(t) && support.textTracks && this.captions.toggled && (t = captions.getCurrentTrack.call(this)), is.track(t) ? is.empty(t.label) ? is.empty(t.language) ? i18n.get('enabled', this.config) : e.language.toUpperCase() : t.label : i18n.get('disabled', this.config) ); }, updateCues(e) { if (!this.supported.ui) return; if (!is.element(this.elements.captions)) return void this.debug.warn('No captions element to render to'); if (!is.nullOrUndefined(e) && !Array.isArray(e)) return void this.debug.warn('updateCues: Invalid input', e); let t = e; if (!t) { const i = captions.getCurrentTrack.call(this); t = Array.from((i || {}).activeCues || []) .map(s => s.getCueAsHTML()) .map(getHTML); } const r = t.map(i => i.trim()).join(` `); if (r !== this.elements.captions.innerHTML) { emptyElement(this.elements.captions); const i = createElement( 'span', getAttributesFromSelector(this.config.selectors.caption) ); (i.innerHTML = r), this.elements.captions.appendChild(i), triggerEvent.call(this, this.media, 'cuechange'); } } }, defaults = { enabled: !0, title: '', debug: !1, autoplay: !1, autopause: !0, playsinline: !0, seekTime: 10, volume: 1, muted: !1, duration: null, displayDuration: !0, invertTime: !0, toggleInvert: !0, ratio: null, clickToPlay: !0, hideControls: !0, resetOnEnd: !1, disableContextMenu: !0, loadSprite: !0, iconPrefix: 'plyr', iconUrl: 'https://cdn.plyr.io/3.7.8/plyr.svg', blankVideo: 'https://cdn.plyr.io/static/blank.mp4', quality: { default: 576, options: [4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240], forced: !1, onChange: null }, loop: { active: !1 }, speed: { selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4] }, keyboard: { focused: !0, global: !1 }, tooltips: { controls: !1, seek: !0 }, captions: { active: !1, language: 'auto', update: !1 }, fullscreen: { enabled: !0, fallback: !0, iosNative: !1 }, storage: { enabled: !0, key: 'plyr' }, controls: [ 'play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen' ], settings: ['captions', 'quality', 'speed'], i18n: { restart: 'Restart', rewind: 'Rewind {seektime}s', play: 'Play', pause: 'Pause', fastForward: 'Forward {seektime}s', seek: 'Seek', seekLabel: '{currentTime} of {duration}', played: 'Played', buffered: 'Buffered', currentTime: 'Current time', duration: 'Duration', volume: 'Volume', mute: 'Mute', unmute: 'Unmute', enableCaptions: 'Enable captions', disableCaptions: 'Disable captions', download: 'Download', enterFullscreen: 'Enter fullscreen', exitFullscreen: 'Exit fullscreen', frameTitle: 'Player for {title}', captions: 'Captions', settings: 'Settings', pip: 'PIP', menuBack: 'Go back to previous menu', speed: 'Speed', normal: 'Normal', quality: 'Quality', loop: 'Loop', start: 'Start', end: 'End', all: 'All', reset: 'Reset', disabled: 'Disabled', enabled: 'Enabled', advertisement: 'Ad', qualityBadge: { 2160: '4K', 1440: 'HD', 1080: 'HD', 720: 'HD', 576: 'SD', 480: 'SD' } }, urls: { download: null, vimeo: { sdk: 'https://player.vimeo.com/api/player.js', iframe: 'https://player.vimeo.com/video/{0}?{1}', api: 'https://vimeo.com/api/oembed.json?url={0}' }, youtube: { sdk: 'https://www.youtube.com/iframe_api', api: 'https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}' }, googleIMA: { sdk: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js' } }, listeners: { seek: null, play: null, pause: null, restart: null, rewind: null, fastForward: null, mute: null, volume: null, captions: null, download: null, fullscreen: null, pip: null, airplay: null, speed: null, quality: null, loop: null, language: null }, events: [ 'ended', 'progress', 'stalled', 'playing', 'waiting', 'canplay', 'canplaythrough', 'loadstart', 'loadeddata', 'loadedmetadata', 'timeupdate', 'volumechange', 'play', 'pause', 'error', 'seeking', 'seeked', 'emptied', 'ratechange', 'cuechange', 'download', 'enterfullscreen', 'exitfullscreen', 'captionsenabled', 'captionsdisabled', 'languagechange', 'controlshidden', 'controlsshown', 'ready', 'statechange', 'qualitychange', 'adsloaded', 'adscontentpause', 'adscontentresume', 'adstarted', 'adsmidpoint', 'adscomplete', 'adsallcomplete', 'adsimpression', 'adsclick' ], selectors: { editable: 'input, textarea, select, [contenteditable]', container: '.plyr', controls: { container: null, wrapper: '.plyr__controls' }, labels: '[data-plyr]', buttons: { play: '[data-plyr="play"]', pause: '[data-plyr="pause"]', restart: '[data-plyr="restart"]', rewind: '[data-plyr="rewind"]', fastForward: '[data-plyr="fast-forward"]', mute: '[data-plyr="mute"]', captions: '[data-plyr="captions"]', download: '[data-plyr="download"]', fullscreen: '[data-plyr="fullscreen"]', pip: '[data-plyr="pip"]', airplay: '[data-plyr="airplay"]', settings: '[data-plyr="settings"]', loop: '[data-plyr="loop"]' }, inputs: { seek: '[data-plyr="seek"]', volume: '[data-plyr="volume"]', speed: '[data-plyr="speed"]', language: '[data-plyr="language"]', quality: '[data-plyr="quality"]' }, display: { currentTime: '.plyr__time--current', duration: '.plyr__time--duration', buffer: '.plyr__progress__buffer', loop: '.plyr__progress__loop', volume: '.plyr__volume--display' }, progress: '.plyr__progress', captions: '.plyr__captions', caption: '.plyr__caption' }, classNames: { type: 'plyr--{0}', provider: 'plyr--{0}', video: 'plyr__video-wrapper', embed: 'plyr__video-embed', videoFixedRatio: 'plyr__video-wrapper--fixed-ratio', embedContainer: 'plyr__video-embed__container', poster: 'plyr__poster', posterEnabled: 'plyr__poster-enabled', ads: 'plyr__ads', control: 'plyr__control', controlPressed: 'plyr__control--pressed', playing: 'plyr--playing', paused: 'plyr--paused', stopped: 'plyr--stopped', loading: 'plyr--loading', hover: 'plyr--hover', tooltip: 'plyr__tooltip', cues: 'plyr__cues', marker: 'plyr__progress__marker', hidden: 'plyr__sr-only', hideControls: 'plyr--hide-controls', isTouch: 'plyr--is-touch', uiSupported: 'plyr--full-ui', noTransition: 'plyr--no-transition', display: { time: 'plyr__time' }, menu: { value: 'plyr__menu__value', badge: 'plyr__badge', open: 'plyr--menu-open' }, captions: { enabled: 'plyr--captions-enabled', active: 'plyr--captions-active' }, fullscreen: { enabled: 'plyr--fullscreen-enabled', fallback: 'plyr--fullscreen-fallback' }, pip: { supported: 'plyr--pip-supported', active: 'plyr--pip-active' }, airplay: { supported: 'plyr--airplay-supported', active: 'plyr--airplay-active' }, previewThumbnails: { thumbContainer: 'plyr__preview-thumb', thumbContainerShown: 'plyr__preview-thumb--is-shown', imageContainer: 'plyr__preview-thumb__image-container', timeContainer: 'plyr__preview-thumb__time-container', scrubbingContainer: 'plyr__preview-scrubbing', scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown' } }, attributes: { embed: { provider: 'data-plyr-provider', id: 'data-plyr-embed-id', hash: 'data-plyr-embed-hash' } }, ads: { enabled: !1, publisherId: '', tagUrl: '' }, previewThumbnails: { enabled: !1, src: '' }, vimeo: { byline: !1, portrait: !1, title: !1, speed: !0, transparent: !1, customControls: !0, referrerPolicy: null, premium: !1 }, youtube: { rel: 0, showinfo: 0, iv_load_policy: 3, modestbranding: 1, customControls: !0, noCookie: !1 }, mediaMetadata: { title: '', artist: '', album: '', artwork: [] }, markers: { enabled: !1, points: [] } }, pip = { active: 'picture-in-picture', inactive: 'inline' }, providers = { html5: 'html5', youtube: 'youtube', vimeo: 'vimeo' }, types = { audio: 'audio', video: 'video' }; function getProviderByUrl(e) { return /^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test( e ) ? providers.youtube : /^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e) ? providers.vimeo : null; } const noop = () => {}; class Console { constructor(t = !1) { (this.enabled = window.console && t), this.enabled && this.log('Debugging enabled'); } get log() { return this.enabled ? Function.prototype.bind.call(console.log, console) : noop; } get warn() { return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop; } get error() { return this.enabled ? Function.prototype.bind.call(console.error, console) : noop; } } class Fullscreen { constructor(t) { _defineProperty$1(this, 'onChange', () => { if (!this.supported) return; const r = this.player.elements.buttons.fullscreen; is.element(r) && (r.pressed = this.active); const i = this.target === this.player.media ? this.target : this.player.elements.container; triggerEvent.call( this.player, i, this.active ? 'enterfullscreen' : 'exitfullscreen', !0 ); }), _defineProperty$1(this, 'toggleFallback', (r = !1) => { if ( (r ? (this.scrollPosition = { x: window.scrollX ?? 0, y: window.scrollY ?? 0 }) : window.scrollTo(this.scrollPosition.x, this.scrollPosition.y), (document.body.style.overflow = r ? 'hidden' : ''), toggleClass( this.target, this.player.config.classNames.fullscreen.fallback, r ), browser.isIos) ) { let i = document.head.querySelector('meta[name="viewport"]'); const s = 'viewport-fit=cover'; i || ((i = document.createElement('meta')), i.setAttribute('name', 'viewport')); const n = is.string(i.content) && i.content.includes(s); r ? ((this.cleanupViewport = !n), n || (i.content += `,${s}`)) : this.cleanupViewport && (i.content = i.content .split(',') .filter(a => a.trim() !== s) .join(',')); } this.onChange(); }), _defineProperty$1(this, 'trapFocus', r => { if ( browser.isIos || browser.isIPadOS || !this.active || r.key !== 'Tab' ) return; const i = document.activeElement, s = getElements.call( this.player, 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]' ), [n] = s, a = s[s.length - 1]; i !== a || r.shiftKey ? i === n && r.shiftKey && (a.focus(), r.preventDefault()) : (n.focus(), r.preventDefault()); }), _defineProperty$1(this, 'update', () => { if (this.supported) { let r; (r = this.forceFallback ? 'Fallback (forced)' : Fullscreen.nativeSupported ? 'Native' : 'Fallback'), this.player.debug.log(`${r} fullscreen enabled`); } else this.player.debug.log( 'Fullscreen not supported and fallback disabled' ); toggleClass( this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.supported ); }), _defineProperty$1(this, 'enter', () => { this.supported && (browser.isIos && this.player.config.fullscreen.iosNative ? this.player.isVimeo ? this.player.embed.requestFullscreen() : this.target.webkitEnterFullscreen() : !Fullscreen.nativeSupported || this.forceFallback ? this.toggleFallback(!0) : this.prefix ? is.empty(this.prefix) || this.target[`${this.prefix}Request${this.property}`]() : this.target.requestFullscreen({ navigationUI: 'hide' })); }), _defineProperty$1(this, 'exit', () => { if (this.supported) if (browser.isIos && this.player.config.fullscreen.iosNative) this.player.isVimeo ? this.player.embed.exitFullscreen() : this.target.webkitEnterFullscreen(), silencePromise(this.player.play()); else if (!Fullscreen.nativeSupported || this.forceFallback) this.toggleFallback(!1); else if (this.prefix) { if (!is.empty(this.prefix)) { const r = this.prefix === 'moz' ? 'Cancel' : 'Exit'; document[`${this.prefix}${r}${this.property}`](); } } else (document.cancelFullScreen || document.exitFullscreen).call( document ); }), _defineProperty$1(this, 'toggle', () => { this.active ? this.exit() : this.enter(); }), (this.player = t), (this.prefix = Fullscreen.prefix), (this.property = Fullscreen.property), (this.scrollPosition = { x: 0, y: 0 }), (this.forceFallback = t.config.fullscreen.fallback === 'force'), (this.player.elements.fullscreen = t.config.fullscreen.container && closest$1( this.player.elements.container, t.config.fullscreen.container )), on.call( this.player, document, this.prefix === 'ms' ? 'MSFullscreenChange' : `${this.prefix}fullscreenchange`, () => { this.onChange(); } ), on.call(this.player, this.player.elements.container, 'dblclick', r => { (is.element(this.player.elements.controls) && this.player.elements.controls.contains(r.target)) || this.player.listeners.proxy(r, this.toggle, 'fullscreen'); }), on.call(this, this.player.elements.container, 'keydown', r => this.trapFocus(r) ), this.update(); } static get nativeSupported() { return !!( document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled ); } get useNative() { return Fullscreen.nativeSupported && !this.forceFallback; } static get prefix() { if (is.function(document.exitFullscreen)) return ''; let t = ''; return ( ['webkit', 'moz', 'ms'].some( r => !( !is.function(document[`${r}ExitFullscreen`]) && !is.function(document[`${r}CancelFullScreen`]) ) && ((t = r), !0) ), t ); } static get property() { return this.prefix === 'moz' ? 'FullScreen' : 'Fullscreen'; } get supported() { return [ this.player.config.fullscreen.enabled, this.player.isVideo, Fullscreen.nativeSupported || this.player.config.fullscreen.fallback, !this.player.isYouTube || Fullscreen.nativeSupported || !browser.isIos || (this.player.config.playsinline && !this.player.config.fullscreen.iosNative) ].every(Boolean); } get active() { if (!this.supported) return !1; if (!Fullscreen.nativeSupported || this.forceFallback) return hasClass( this.target, this.player.config.classNames.fullscreen.fallback ); const t = this.prefix ? this.target.getRootNode()[`${this.prefix}${this.property}Element`] : this.target.getRootNode().fullscreenElement; return t && t.shadowRoot ? t === this.target.getRootNode().host : t === this.target; } get target() { return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.fullscreen ?? this.player.elements.container; } } function loadImage(e, t = 1) { return new Promise((r, i) => { const s = new Image(), n = () => { delete s.onload, delete s.onerror, (s.naturalWidth >= t ? r : i)(s); }; Object.assign(s, { onload: n, onerror: n, src: e }); }); } const ui = { addStyleHook() { toggleClass( this.elements.container, this.config.selectors.container.replace('.', ''), !0 ), toggleClass( this.elements.container, this.config.classNames.uiSupported, this.supported.ui ); }, toggleNativeControls(e = !1) { e && this.isHTML5 ? this.media.setAttribute('controls', '') : this.media.removeAttribute('controls'); }, build() { if ((this.listeners.media(), !this.supported.ui)) return ( this.debug.warn(`Basic support only for ${this.provider} ${this.type}`), void ui.toggleNativeControls.call(this, !0) ); is.element(this.elements.controls) || (controls$2.inject.call(this), this.listeners.controls()), ui.toggleNativeControls.call(this), this.isHTML5 && captions.setup.call(this), (this.volume = null), (this.muted = null), (this.loop = null), (this.quality = null), (this.speed = null), controls$2.updateVolume.call(this), controls$2.timeUpdate.call(this), controls$2.durationUpdate.call(this), ui.checkPlaying.call(this), toggleClass( this.elements.container, this.config.classNames.pip.supported, support.pip && this.isHTML5 && this.isVideo ), toggleClass( this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5 ), toggleClass( this.elements.container, this.config.classNames.isTouch, this.touch ), (this.ready = !0), setTimeout(() => { triggerEvent.call(this, this.media, 'ready'); }, 0), ui.setTitle.call(this), this.poster && ui.setPoster.call(this, this.poster, !1).catch(() => {}), this.config.duration && controls$2.durationUpdate.call(this), this.config.mediaMetadata && controls$2.setMediaMetadata.call(this); }, setTitle() { let e = i18n.get('play', this.config); if ( (is.string(this.config.title) && !is.empty(this.config.title) && (e += `, ${this.config.title}`), Array.from(this.elements.buttons.play || []).forEach(t => { t.setAttribute('aria-label', e); }), this.isEmbed) ) { const t = getElement.call(this, 'iframe'); if (!is.element(t)) return; const r = is.empty(this.config.title) ? 'video' : this.config.title, i = i18n.get('frameTitle', this.config); t.setAttribute('title', i.replace('{title}', r)); } }, togglePoster(e) { toggleClass( this.elements.container, this.config.classNames.posterEnabled, e ); }, setPoster(e, t = !0) { return t && this.poster ? Promise.reject(new Error('Poster already set')) : (this.media.setAttribute('data-poster', e), this.elements.poster.removeAttribute('hidden'), ready .call(this) .then(() => loadImage(e)) .catch(r => { throw (e === this.poster && ui.togglePoster.call(this, !1), r); }) .then(() => { if (e !== this.poster) throw new Error('setPoster cancelled by later call to setPoster'); }) .then( () => ( Object.assign(this.elements.poster.style, { backgroundImage: `url('${e}')`, backgroundSize: '' }), ui.togglePoster.call(this, !0), e ) )); }, checkPlaying(e) { toggleClass( this.elements.container, this.config.classNames.playing, this.playing ), toggleClass( this.elements.container, this.config.classNames.paused, this.paused ), toggleClass( this.elements.container, this.config.classNames.stopped, this.stopped ), Array.from(this.elements.buttons.play || []).forEach(t => { Object.assign(t, { pressed: this.playing }), t.setAttribute( 'aria-label', i18n.get(this.playing ? 'pause' : 'play', this.config) ); }), (is.event(e) && e.type === 'timeupdate') || ui.toggleControls.call(this); }, checkLoading(e) { (this.loading = ['stalled', 'waiting'].includes(e.type)), clearTimeout(this.timers.loading), (this.timers.loading = setTimeout( () => { toggleClass( this.elements.container, this.config.classNames.loading, this.loading ), ui.toggleControls.call(this); }, this.loading ? 250 : 0 )); }, toggleControls(e) { const { controls: t } = this.elements; if (t && this.config.hideControls) { const r = this.touch && this.lastSeekTime + 2e3 > Date.now(); this.toggleControls( !!(e || this.loading || this.paused || t.pressed || t.hover || r) ); } }, migrateStyles() { Object.values({ ...this.media.style }) .filter(e => !is.empty(e) && is.string(e) && e.startsWith('--plyr')) .forEach(e => { this.elements.container.style.setProperty( e, this.media.style.getPropertyValue(e) ), this.media.style.removeProperty(e); }), is.empty(this.media.style) && this.media.removeAttribute('style'); } }; class Listeners { constructor(t) { _defineProperty$1(this, 'firstTouch', () => { const { player: r } = this, { elements: i } = r; (r.touch = !0), toggleClass(i.container, r.config.classNames.isTouch, !0); }), _defineProperty$1(this, 'global', (r = !0) => { const { player: i } = this; i.config.keyboard.global && toggleListener.call( i, window, 'keydown keyup', this.handleKey, r, !1 ), toggleListener.call(i, document.body, 'click', this.toggleMenu, r), once.call(i, document.body, 'touchstart', this.firstTouch); }), _defineProperty$1(this, 'container', () => { const { player: r } = this, { config: i, elements: s, timers: n } = r; !i.keyboard.global && i.keyboard.focused && on.call(r, s.container, 'keydown keyup', this.handleKey, !1), on.call( r, s.container, 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen', l => { const { controls: c } = s; c && l.type === 'enterfullscreen' && ((c.pressed = !1), (c.hover = !1)); let g = 0; ['touchstart', 'touchmove', 'mousemove'].includes(l.type) && (ui.toggleControls.call(r, !0), (g = r.touch ? 3e3 : 2e3)), clearTimeout(n.controls), (n.controls = setTimeout( () => ui.toggleControls.call(r, !1), g )); } ); const a = () => { if (!r.isVimeo || r.config.vimeo.premium) return; const l = s.wrapper, { active: c } = r.fullscreen, [g, S] = getAspectRatio.call(r), p = supportsCSS(`aspect-ratio: ${g} / ${S}`); if (!c) return void (p ? ((l.style.width = null), (l.style.height = null)) : ((l.style.maxWidth = null), (l.style.margin = null))); const [P, b] = getViewportSize(), y = P / b > g / S; p ? ((l.style.width = y ? 'auto' : '100%'), (l.style.height = y ? '100%' : 'auto')) : ((l.style.maxWidth = y ? (b / S) * g + 'px' : null), (l.style.margin = y ? '0 auto' : null)); }, o = () => { clearTimeout(n.resized), (n.resized = setTimeout(a, 50)); }; on.call(r, s.container, 'enterfullscreen exitfullscreen', l => { const { target: c } = r.fullscreen; c === s.container && ((!r.isEmbed && is.empty(r.config.ratio)) || (a(), (l.type === 'enterfullscreen' ? on : off).call( r, window, 'resize', o ))); }); }), _defineProperty$1(this, 'media', () => { const { player: r } = this, { elements: i } = r; if ( (on.call(r, r.media, 'timeupdate seeking seeked', n => controls$2.timeUpdate.call(r, n) ), on.call(r, r.media, 'durationchange loadeddata loadedmetadata', n => controls$2.durationUpdate.call(r, n) ), on.call(r, r.media, 'ended', () => { r.isHTML5 && r.isVideo && r.config.resetOnEnd && (r.restart(), r.pause()); }), on.call(r, r.media, 'progress playing seeking seeked', n => controls$2.updateProgress.call(r, n) ), on.call(r, r.media, 'volumechange', n => controls$2.updateVolume.call(r, n) ), on.call( r, r.media, 'playing play pause ended emptied timeupdate', n => ui.checkPlaying.call(r, n) ), on.call(r, r.media, 'waiting canplay seeked playing', n => ui.checkLoading.call(r, n) ), r.supported.ui && r.config.clickToPlay && !r.isAudio) ) { const n = getElement.call(r, `.${r.config.classNames.video}`); if (!is.element(n)) return; on.call(r, i.container, 'click', a => { ([i.container, n].includes(a.target) || n.contains(a.target)) && ((r.touch && r.config.hideControls) || (r.ended ? (this.proxy(a, r.restart, 'restart'), this.proxy( a, () => { silencePromise(r.play()); }, 'play' )) : this.proxy( a, () => { silencePromise(r.togglePlay()); }, 'play' ))); }); } r.supported.ui && r.config.disableContextMenu && on.call( r, i.wrapper, 'contextmenu', n => { n.preventDefault(); }, !1 ), on.call(r, r.media, 'volumechange', () => { r.storage.set({ volume: r.volume, muted: r.muted }); }), on.call(r, r.media, 'ratechange', () => { controls$2.updateSetting.call(r, 'speed'), r.storage.set({ speed: r.speed }); }), on.call(r, r.media, 'qualitychange', n => { controls$2.updateSetting.call(r, 'quality', null, n.detail.quality); }), on.call(r, r.media, 'ready qualitychange', () => { controls$2.setDownloadUrl.call(r); }); const s = r.config.events.concat(['keyup', 'keydown']).join(' '); on.call(r, r.media, s, n => { let { detail: a = {} } = n; n.type === 'error' && (a = r.media.error), triggerEvent.call(r, i.container, n.type, !0, a); }); }), _defineProperty$1(this, 'proxy', (r, i, s) => { const { player: n } = this, a = n.config.listeners[s]; let o = !0; is.function(a) && (o = a.call(n, r)), o !== !1 && is.function(i) && i.call(n, r); }), _defineProperty$1(this, 'bind', (r, i, s, n, a = !0) => { const { player: o } = this, l = o.config.listeners[n], c = is.function(l); on.call(o, r, i, g => this.proxy(g, s, n), a && !c); }), _defineProperty$1(this, 'controls', () => { const { player: r } = this, { elements: i } = r, s = browser.isIE ? 'change' : 'input'; if ( (i.buttons.play && Array.from(i.buttons.play).forEach(n => { this.bind( n, 'click', () => { silencePromise(r.togglePlay()); }, 'play' ); }), this.bind(i.buttons.restart, 'click', r.restart, 'restart'), this.bind( i.buttons.rewind, 'click', () => { (r.lastSeekTime = Date.now()), r.rewind(); }, 'rewind' ), this.bind( i.buttons.fastForward, 'click', () => { (r.lastSeekTime = Date.now()), r.forward(); }, 'fastForward' ), this.bind( i.buttons.mute, 'click', () => { r.muted = !r.muted; }, 'mute' ), this.bind(i.buttons.captions, 'click', () => r.toggleCaptions()), this.bind( i.buttons.download, 'click', () => { triggerEvent.call(r, r.media, 'download'); }, 'download' ), this.bind( i.buttons.fullscreen, 'click', () => { r.fullscreen.toggle(); }, 'fullscreen' ), this.bind( i.buttons.pip, 'click', () => { r.pip = 'toggle'; }, 'pip' ), this.bind(i.buttons.airplay, 'click', r.airplay, 'airplay'), this.bind( i.buttons.settings, 'click', n => { n.stopPropagation(), n.preventDefault(), controls$2.toggleMenu.call(r, n); }, null, !1 ), this.bind( i.buttons.settings, 'keyup', n => { [' ', 'Enter'].includes(n.key) && (n.key !== 'Enter' ? (n.preventDefault(), n.stopPropagation(), controls$2.toggleMenu.call(r, n)) : controls$2.focusFirstMenuItem.call(r, null, !0)); }, null, !1 ), this.bind(i.settings.menu, 'keydown', n => { n.key === 'Escape' && controls$2.toggleMenu.call(r, n); }), this.bind(i.inputs.seek, 'mousedown mousemove', n => { const a = i.progress.getBoundingClientRect(), o = (100 / a.width) * (n.pageX - a.left); n.currentTarget.setAttribute('seek-value', o); }), this.bind( i.inputs.seek, 'mousedown mouseup keydown keyup touchstart touchend', n => { const a = n.currentTarget, o = 'play-on-seeked'; if ( is.keyboardEvent(n) && !['ArrowLeft', 'ArrowRight'].includes(n.key) ) return; r.lastSeekTime = Date.now(); const l = a.hasAttribute(o), c = ['mouseup', 'touchend', 'keyup'].includes(n.type); l && c ? (a.removeAttribute(o), silencePromise(r.play())) : !c && r.playing && (a.setAttribute(o, ''), r.pause()); } ), browser.isIos) ) { const n = getElements.call(r, 'input[type="range"]'); Array.from(n).forEach(a => this.bind(a, s, o => repaint(o.target))); } this.bind( i.inputs.seek, s, n => { const a = n.currentTarget; let o = a.getAttribute('seek-value'); is.empty(o) && (o = a.value), a.removeAttribute('seek-value'), (r.currentTime = (o / a.max) * r.duration); }, 'seek' ), this.bind(i.progress, 'mouseenter mouseleave mousemove', n => controls$2.updateSeekTooltip.call(r, n) ), this.bind(i.progress, 'mousemove touchmove', n => { const { previewThumbnails: a } = r; a && a.loaded && a.startMove(n); }), this.bind(i.progress, 'mouseleave touchend click', () => { const { previewThumbnails: n } = r; n && n.loaded && n.endMove(!1, !0); }), this.bind(i.progress, 'mousedown touchstart', n => { const { previewThumbnails: a } = r; a && a.loaded && a.startScrubbing(n); }), this.bind(i.progress, 'mouseup touchend', n => { const { previewThumbnails: a } = r; a && a.loaded && a.endScrubbing(n); }), browser.isWebKit && Array.from(getElements.call(r, 'input[type="range"]')).forEach( n => { this.bind(n, 'input', a => controls$2.updateRangeFill.call(r, a.target) ); } ), r.config.toggleInvert && !is.element(i.display.duration) && this.bind(i.display.currentTime, 'click', () => { r.currentTime !== 0 && ((r.config.invertTime = !r.config.invertTime), controls$2.timeUpdate.call(r)); }), this.bind( i.inputs.volume, s, n => { r.volume = n.target.value; }, 'volume' ), this.bind(i.controls, 'mouseenter mouseleave', n => { i.controls.hover = !r.touch && n.type === 'mouseenter'; }), i.fullscreen && Array.from(i.fullscreen.children) .filter(n => !n.contains(i.container)) .forEach(n => { this.bind(n, 'mouseenter mouseleave', a => { i.controls && (i.controls.hover = !r.touch && a.type === 'mouseenter'); }); }), this.bind( i.controls, 'mousedown mouseup touchstart touchend touchcancel', n => { i.controls.pressed = ['mousedown', 'touchstart'].includes(n.type); } ), this.bind(i.controls, 'focusin', () => { const { config: n, timers: a } = r; toggleClass(i.controls, n.classNames.noTransition, !0), ui.toggleControls.call(r, !0), setTimeout(() => { toggleClass(i.controls, n.classNames.noTransition, !1); }, 0); const o = this.touch ? 3e3 : 4e3; clearTimeout(a.controls), (a.controls = setTimeout(() => ui.toggleControls.call(r, !1), o)); }), this.bind( i.inputs.volume, 'wheel', n => { const a = n.webkitDirectionInvertedFromDevice, [o, l] = [n.deltaX, -n.deltaY].map(S => (a ? -S : S)), c = Math.sign(Math.abs(o) > Math.abs(l) ? o : l); r.increaseVolume(c / 50); const { volume: g } = r.media; ((c === 1 && g < 1) || (c === -1 && g > 0)) && n.preventDefault(); }, 'volume', !1 ); }), (this.player = t), (this.lastKey = null), (this.focusTimer = null), (this.lastKeyDown = null), (this.handleKey = this.handleKey.bind(this)), (this.toggleMenu = this.toggleMenu.bind(this)), (this.firstTouch = this.firstTouch.bind(this)); } handleKey(t) { const { player: r } = this, { elements: i } = r, { key: s, type: n, altKey: a, ctrlKey: o, metaKey: l, shiftKey: c } = t, g = n === 'keydown', S = g && s === this.lastKey; if (!(a || o || l || c) && s) { if (g) { const P = document.activeElement; if (is.element(P)) { const { editable: b } = r.config.selectors, { seek: y } = i.inputs; if ( (P !== y && matches(P, b)) || (t.key === ' ' && matches(P, 'button, [role^="menuitem"]')) ) return; } switch ( ([ ' ', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'c', 'f', 'k', 'l', 'm' ].includes(s) && (t.preventDefault(), t.stopPropagation()), s) ) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': S || ((p = parseInt(s, 10)), (r.currentTime = (r.duration / 10) * p)); break; case ' ': case 'k': S || silencePromise(r.togglePlay()); break; case 'ArrowUp': r.increaseVolume(0.1); break; case 'ArrowDown': r.decreaseVolume(0.1); break; case 'm': S || (r.muted = !r.muted); break; case 'ArrowRight': r.forward(); break; case 'ArrowLeft': r.rewind(); break; case 'f': r.fullscreen.toggle(); break; case 'c': S || r.toggleCaptions(); break; case 'l': r.loop = !r.loop; } s === 'Escape' && !r.fullscreen.usingNative && r.fullscreen.active && r.fullscreen.toggle(), (this.lastKey = s); } else this.lastKey = null; var p; } } toggleMenu(t) { controls$2.toggleMenu.call(this.player, t); } } function createCommonjsModule(e, t) { return e((t = { exports: {} }), t.exports), t.exports; } var loadjs_umd = createCommonjsModule(function (e, t) { e.exports = (function () { var r = function () {}, i = {}, s = {}, n = {}; function a(p, P) { p = p.push ? p : [p]; var b, y, A, u = [], f = p.length, m = f; for ( b = function (d, E) { E.length && u.push(d), --m || P(u); }; f--; ) (y = p[f]), (A = s[y]) ? b(y, A) : (n[y] = n[y] || []).push(b); } function o(p, P) { if (p) { var b = n[p]; if (((s[p] = P), b)) for (; b.length; ) b[0](p, P), b.splice(0, 1); } } function l(p, P) { p.call && (p = { success: p }), P.length ? (p.error || r)(P) : (p.success || r)(p); } function c(p, P, b, y) { var A, u, f = document, m = b.async, d = (b.numRetries || 0) + 1, E = b.before || r, T = p.replace(/[\?|#].*$/, ''), x = p.replace(/^(css|img)!/, ''); (y = y || 0), /(^css!|\.css$)/.test(T) ? (((u = f.createElement('link')).rel = 'stylesheet'), (u.href = x), (A = 'hideFocus' in u) && u.relList && ((A = 0), (u.rel = 'preload'), (u.as = 'style'))) : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(T) ? ((u = f.createElement('img')).src = x) : (((u = f.createElement('script')).src = p), (u.async = m === void 0 || m)), (u.onload = u.onerror = u.onbeforeload = function (_) { var I = _.type[0]; if (A) try { u.sheet.cssText.length || (I = 'e'); } catch (V) { V.code != 18 && (I = 'e'); } if (I == 'e') { if ((y += 1) < d) return c(p, P, b, y); } else if (u.rel == 'preload' && u.as == 'style') return (u.rel = 'stylesheet'); P(p, I, _.defaultPrevented); }), E(p, u) !== !1 && f.head.appendChild(u); } function g(p, P, b) { var y, A, u = (p = p.push ? p : [p]).length, f = u, m = []; for ( y = function (d, E, T) { if ((E == 'e' && m.push(d), E == 'b')) { if (!T) return; m.push(d); } --u || P(m); }, A = 0; A < f; A++ ) c(p[A], y, b); } function S(p, P, b) { var y, A; if ((P && P.trim && (y = P), (A = (y ? b : P) || {}), y)) { if (y in i) throw 'LoadJS'; i[y] = !0; } function u(f, m) { g( p, function (d) { l(A, d), f && l({ success: f, error: m }, d), o(y, d); }, A ); } if (A.returnPromise) return new Promise(u); u(); } return ( (S.ready = function (p, P) { return ( a(p, function (b) { l(P, b); }), S ); }), (S.done = function (p) { o(p, []); }), (S.reset = function () { (i = {}), (s = {}), (n = {}); }), (S.isDefined = function (p) { return p in i; }), S ); })(); }); function loadScript(e) { return new Promise((t, r) => { loadjs_umd(e, { success: t, error: r }); }); } function parseId$1(e) { return is.empty(e) ? null : is.number(Number(e)) ? e : e.match(/^.*(vimeo.com\/|video\/)(\d+).*/) ? RegExp.$2 : e; } function parseHash(e) { const t = e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/); return t && t.length === 5 ? t[4] : null; } function assurePlaybackState$1(e) { e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0), this.media.paused === e && ((this.media.paused = !e), triggerEvent.call(this, this.media, e ? 'play' : 'pause')); } const vimeo = { setup() { const e = this; toggleClass(e.elements.wrapper, e.config.classNames.embed, !0), (e.options.speed = e.config.speed.options), setAspectRatio.call(e), is.object(window.Vimeo) ? vimeo.ready.call(e) : loadScript(e.config.urls.vimeo.sdk) .then(() => { vimeo.ready.call(e); }) .catch(t => { e.debug.warn('Vimeo SDK (player.js) failed to load', t); }); }, ready() { const e = this, t = e.config.vimeo, { premium: r, referrerPolicy: i, ...s } = t; let n = e.media.getAttribute('src'), a = ''; is.empty(n) ? ((n = e.media.getAttribute(e.config.attributes.embed.id)), (a = e.media.getAttribute(e.config.attributes.embed.hash))) : (a = parseHash(n)); const o = a ? { h: a } : {}; r && Object.assign(s, { controls: !1, sidedock: !1 }); const l = buildUrlParams({ loop: e.config.loop.active, autoplay: e.autoplay, muted: e.muted, gesture: 'media', playsinline: e.config.playsinline, ...o, ...s }), c = parseId$1(n), g = createElement('iframe'), S = format(e.config.urls.vimeo.iframe, c, l); if ( (g.setAttribute('src', S), g.setAttribute('allowfullscreen', ''), g.setAttribute( 'allow', [ 'autoplay', 'fullscreen', 'picture-in-picture', 'encrypted-media', 'accelerometer', 'gyroscope' ].join('; ') ), is.empty(i) || g.setAttribute('referrerPolicy', i), r || !t.customControls) ) g.setAttribute('data-poster', e.poster), (e.media = replaceElement(g, e.media)); else { const f = createElement('div', { class: e.config.classNames.embedContainer, 'data-poster': e.poster }); f.appendChild(g), (e.media = replaceElement(f, e.media)); } t.customControls || fetch$1(format(e.config.urls.vimeo.api, S)).then(f => { !is.empty(f) && f.thumbnail_url && ui.setPoster.call(e, f.thumbnail_url).catch(() => {}); }), (e.embed = new window.Vimeo.Player(g, { autopause: e.config.autopause, muted: e.muted })), (e.media.paused = !0), (e.media.currentTime = 0), e.supported.ui && e.embed.disableTextTrack(), (e.media.play = () => ( assurePlaybackState$1.call(e, !0), e.embed.play() )), (e.media.pause = () => ( assurePlaybackState$1.call(e, !1), e.embed.pause() )), (e.media.stop = () => { e.pause(), (e.currentTime = 0); }); let { currentTime: p } = e.media; Object.defineProperty(e.media, 'currentTime', { get: () => p, set(f) { const { embed: m, media: d, paused: E, volume: T } = e, x = E && !m.hasPlayed; (d.seeking = !0), triggerEvent.call(e, d, 'seeking'), Promise.resolve(x && m.setVolume(0)) .then(() => m.setCurrentTime(f)) .then(() => x && m.pause()) .then(() => x && m.setVolume(T)) .catch(() => {}); } }); let P = e.config.speed.selected; Object.defineProperty(e.media, 'playbackRate', { get: () => P, set(f) { e.embed .setPlaybackRate(f) .then(() => { (P = f), triggerEvent.call(e, e.media, 'ratechange'); }) .catch(() => { e.options.speed = [1]; }); } }); let { volume: b } = e.config; Object.defineProperty(e.media, 'volume', { get: () => b, set(f) { e.embed.setVolume(f).then(() => { (b = f), triggerEvent.call(e, e.media, 'volumechange'); }); } }); let { muted: y } = e.config; Object.defineProperty(e.media, 'muted', { get: () => y, set(f) { const m = !!is.boolean(f) && f; e.embed.setMuted(!!m || e.config.muted).then(() => { (y = m), triggerEvent.call(e, e.media, 'volumechange'); }); } }); let A, { loop: u } = e.config; Object.defineProperty(e.media, 'loop', { get: () => u, set(f) { const m = is.boolean(f) ? f : e.config.loop.active; e.embed.setLoop(m).then(() => { u = m; }); } }), e.embed .getVideoUrl() .then(f => { (A = f), controls$2.setDownloadUrl.call(e); }) .catch(f => { this.debug.warn(f); }), Object.defineProperty(e.media, 'currentSrc', { get: () => A }), Object.defineProperty(e.media, 'ended', { get: () => e.currentTime === e.duration }), Promise.all([e.embed.getVideoWidth(), e.embed.getVideoHeight()]).then( f => { const [m, d] = f; (e.embed.ratio = roundAspectRatio(m, d)), setAspectRatio.call(this); } ), e.embed.setAutopause(e.config.autopause).then(f => { e.config.autopause = f; }), e.embed.getVideoTitle().then(f => { (e.config.title = f), ui.setTitle.call(this); }), e.embed.getCurrentTime().then(f => { (p = f), triggerEvent.call(e, e.media, 'timeupdate'); }), e.embed.getDuration().then(f => { (e.media.duration = f), triggerEvent.call(e, e.media, 'durationchange'); }), e.embed.getTextTracks().then(f => { (e.media.textTracks = f), captions.setup.call(e); }), e.embed.on('cuechange', ({ cues: f = [] }) => { const m = f.map(d => stripHTML(d.text)); captions.updateCues.call(e, m); }), e.embed.on('loaded', () => { e.embed.getPaused().then(f => { assurePlaybackState$1.call(e, !f), f || triggerEvent.call(e, e.media, 'playing'); }), is.element(e.embed.element) && e.supported.ui && e.embed.element.setAttribute('tabindex', -1); }), e.embed.on('bufferstart', () => { triggerEvent.call(e, e.media, 'waiting'); }), e.embed.on('bufferend', () => { triggerEvent.call(e, e.media, 'playing'); }), e.embed.on('play', () => { assurePlaybackState$1.call(e, !0), triggerEvent.call(e, e.media, 'playing'); }), e.embed.on('pause', () => { assurePlaybackState$1.call(e, !1); }), e.embed.on('timeupdate', f => { (e.media.seeking = !1), (p = f.seconds), triggerEvent.call(e, e.media, 'timeupdate'); }), e.embed.on('progress', f => { (e.media.buffered = f.percent), triggerEvent.call(e, e.media, 'progress'), parseInt(f.percent, 10) === 1 && triggerEvent.call(e, e.media, 'canplaythrough'), e.embed.getDuration().then(m => { m !== e.media.duration && ((e.media.duration = m), triggerEvent.call(e, e.media, 'durationchange')); }); }), e.embed.on('seeked', () => { (e.media.seeking = !1), triggerEvent.call(e, e.media, 'seeked'); }), e.embed.on('ended', () => { (e.media.paused = !0), triggerEvent.call(e, e.media, 'ended'); }), e.embed.on('error', f => { (e.media.error = f), triggerEvent.call(e, e.media, 'error'); }), t.customControls && setTimeout(() => ui.build.call(e), 0); } }; function parseId(e) { return is.empty(e) ? null : e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/) ? RegExp.$2 : e; } function assurePlaybackState(e) { e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0), this.media.paused === e && ((this.media.paused = !e), triggerEvent.call(this, this.media, e ? 'play' : 'pause')); } function getHost(e) { return e.noCookie ? 'https://www.youtube-nocookie.com' : window.location.protocol === 'http:' ? 'http://www.youtube.com' : void 0; } const youtube = { setup() { if ( (toggleClass(this.elements.wrapper, this.config.classNames.embed, !0), is.object(window.YT) && is.function(window.YT.Player)) ) youtube.ready.call(this); else { const e = window.onYouTubeIframeAPIReady; (window.onYouTubeIframeAPIReady = () => { is.function(e) && e(), youtube.ready.call(this); }), loadScript(this.config.urls.youtube.sdk).catch(t => { this.debug.warn('YouTube API failed to load', t); }); } }, getTitle(e) { fetch$1(format(this.config.urls.youtube.api, e)) .then(t => { if (is.object(t)) { const { title: r, height: i, width: s } = t; (this.config.title = r), ui.setTitle.call(this), (this.embed.ratio = roundAspectRatio(s, i)); } setAspectRatio.call(this); }) .catch(() => { setAspectRatio.call(this); }); }, ready() { const e = this, t = e.config.youtube, r = e.media && e.media.getAttribute('id'); if (!is.empty(r) && r.startsWith('youtube-')) return; let i = e.media.getAttribute('src'); is.empty(i) && (i = e.media.getAttribute(this.config.attributes.embed.id)); const s = parseId(i), n = createElement('div', { id: generateId(e.provider), 'data-poster': t.customControls ? e.poster : void 0 }); if (((e.media = replaceElement(n, e.media)), t.customControls)) { const a = o => `https://i.ytimg.com/vi/${s}/${o}default.jpg`; loadImage(a('maxres'), 121) .catch(() => loadImage(a('sd'), 121)) .catch(() => loadImage(a('hq'))) .then(o => ui.setPoster.call(e, o.src)) .then(o => { o.includes('maxres') || (e.elements.poster.style.backgroundSize = 'cover'); }) .catch(() => {}); } e.embed = new window.YT.Player(e.media, { videoId: s, host: getHost(t), playerVars: extend( {}, { autoplay: e.config.autoplay ? 1 : 0, hl: e.config.hl, controls: e.supported.ui && t.customControls ? 0 : 1, disablekb: 1, playsinline: e.config.playsinline && !e.config.fullscreen.iosNative ? 1 : 0, cc_load_policy: e.captions.active ? 1 : 0, cc_lang_pref: e.config.captions.language, widget_referrer: window ? window.location.href : null }, t ), events: { onError(a) { if (!e.media.error) { const o = a.data, l = { 2: 'The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.', 5: 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.', 100: 'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.', 101: 'The owner of the requested video does not allow it to be played in embedded players.', 150: 'The owner of the requested video does not allow it to be played in embedded players.' }[o] || 'An unknown error occurred'; (e.media.error = { code: o, message: l }), triggerEvent.call(e, e.media, 'error'); } }, onPlaybackRateChange(a) { const o = a.target; (e.media.playbackRate = o.getPlaybackRate()), triggerEvent.call(e, e.media, 'ratechange'); }, onReady(a) { if (is.function(e.media.play)) return; const o = a.target; youtube.getTitle.call(e, s), (e.media.play = () => { assurePlaybackState.call(e, !0), o.playVideo(); }), (e.media.pause = () => { assurePlaybackState.call(e, !1), o.pauseVideo(); }), (e.media.stop = () => { o.stopVideo(); }), (e.media.duration = o.getDuration()), (e.media.paused = !0), (e.media.currentTime = 0), Object.defineProperty(e.media, 'currentTime', { get: () => Number(o.getCurrentTime()), set(S) { e.paused && !e.embed.hasPlayed && e.embed.mute(), (e.media.seeking = !0), triggerEvent.call(e, e.media, 'seeking'), o.seekTo(S); } }), Object.defineProperty(e.media, 'playbackRate', { get: () => o.getPlaybackRate(), set(S) { o.setPlaybackRate(S); } }); let { volume: l } = e.config; Object.defineProperty(e.media, 'volume', { get: () => l, set(S) { (l = S), o.setVolume(100 * l), triggerEvent.call(e, e.media, 'volumechange'); } }); let { muted: c } = e.config; Object.defineProperty(e.media, 'muted', { get: () => c, set(S) { const p = is.boolean(S) ? S : c; (c = p), o[p ? 'mute' : 'unMute'](), o.setVolume(100 * l), triggerEvent.call(e, e.media, 'volumechange'); } }), Object.defineProperty(e.media, 'currentSrc', { get: () => o.getVideoUrl() }), Object.defineProperty(e.media, 'ended', { get: () => e.currentTime === e.duration }); const g = o.getAvailablePlaybackRates(); (e.options.speed = g.filter(S => e.config.speed.options.includes(S) )), e.supported.ui && t.customControls && e.media.setAttribute('tabindex', -1), triggerEvent.call(e, e.media, 'timeupdate'), triggerEvent.call(e, e.media, 'durationchange'), clearInterval(e.timers.buffering), (e.timers.buffering = setInterval(() => { (e.media.buffered = o.getVideoLoadedFraction()), (e.media.lastBuffered === null || e.media.lastBuffered < e.media.buffered) && triggerEvent.call(e, e.media, 'progress'), (e.media.lastBuffered = e.media.buffered), e.media.buffered === 1 && (clearInterval(e.timers.buffering), triggerEvent.call(e, e.media, 'canplaythrough')); }, 200)), t.customControls && setTimeout(() => ui.build.call(e), 50); }, onStateChange(a) { const o = a.target; switch ( (clearInterval(e.timers.playing), e.media.seeking && [1, 2].includes(a.data) && ((e.media.seeking = !1), triggerEvent.call(e, e.media, 'seeked')), a.data) ) { case -1: triggerEvent.call(e, e.media, 'timeupdate'), (e.media.buffered = o.getVideoLoadedFraction()), triggerEvent.call(e, e.media, 'progress'); break; case 0: assurePlaybackState.call(e, !1), e.media.loop ? (o.stopVideo(), o.playVideo()) : triggerEvent.call(e, e.media, 'ended'); break; case 1: t.customControls && !e.config.autoplay && e.media.paused && !e.embed.hasPlayed ? e.media.pause() : (assurePlaybackState.call(e, !0), triggerEvent.call(e, e.media, 'playing'), (e.timers.playing = setInterval(() => { triggerEvent.call(e, e.media, 'timeupdate'); }, 50)), e.media.duration !== o.getDuration() && ((e.media.duration = o.getDuration()), triggerEvent.call(e, e.media, 'durationchange'))); break; case 2: e.muted || e.embed.unMute(), assurePlaybackState.call(e, !1); break; case 3: triggerEvent.call(e, e.media, 'waiting'); } triggerEvent.call(e, e.elements.container, 'statechange', !1, { code: a.data }); } } }); } }, media = { setup() { this.media ? (toggleClass( this.elements.container, this.config.classNames.type.replace('{0}', this.type), !0 ), toggleClass( this.elements.container, this.config.classNames.provider.replace('{0}', this.provider), !0 ), this.isEmbed && toggleClass( this.elements.container, this.config.classNames.type.replace('{0}', 'video'), !0 ), this.isVideo && ((this.elements.wrapper = createElement('div', { class: this.config.classNames.video })), wrap(this.media, this.elements.wrapper), (this.elements.poster = createElement('div', { class: this.config.classNames.poster })), this.elements.wrapper.appendChild(this.elements.poster)), this.isHTML5 ? html5.setup.call(this) : this.isYouTube ? youtube.setup.call(this) : this.isVimeo && vimeo.setup.call(this)) : this.debug.warn('No media element found!'); } }; class Ads { constructor(t) { _defineProperty$1(this, 'load', () => { this.enabled && (is.object(window.google) && is.object(window.google.ima) ? this.ready() : loadScript(this.player.config.urls.googleIMA.sdk) .then(() => { this.ready(); }) .catch(() => { this.trigger( 'error', new Error('Google IMA SDK failed to load') ); })); }), _defineProperty$1(this, 'ready', () => { var r; this.enabled || ((r = this).manager && r.manager.destroy(), r.elements.displayContainer && r.elements.displayContainer.destroy(), r.elements.container.remove()), this.startSafetyTimer(12e3, 'ready()'), this.managerPromise.then(() => { this.clearSafetyTimer('onAdsManagerLoaded()'); }), this.listeners(), this.setupIMA(); }), _defineProperty$1(this, 'setupIMA', () => { (this.elements.container = createElement('div', { class: this.player.config.classNames.ads })), this.player.elements.container.appendChild(this.elements.container), google.ima.settings.setVpaidMode( google.ima.ImaSdkSettings.VpaidMode.ENABLED ), google.ima.settings.setLocale(this.player.config.ads.language), google.ima.settings.setDisableCustomPlaybackForIOS10Plus( this.player.config.playsinline ), (this.elements.displayContainer = new google.ima.AdDisplayContainer( this.elements.container, this.player.media )), (this.loader = new google.ima.AdsLoader( this.elements.displayContainer )), this.loader.addEventListener( google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, r => this.onAdsManagerLoaded(r), !1 ), this.loader.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, r => this.onAdError(r), !1 ), this.requestAds(); }), _defineProperty$1(this, 'requestAds', () => { const { container: r } = this.player.elements; try { const i = new google.ima.AdsRequest(); (i.adTagUrl = this.tagUrl), (i.linearAdSlotWidth = r.offsetWidth), (i.linearAdSlotHeight = r.offsetHeight), (i.nonLinearAdSlotWidth = r.offsetWidth), (i.nonLinearAdSlotHeight = r.offsetHeight), (i.forceNonLinearFullSlot = !1), i.setAdWillPlayMuted(!this.player.muted), this.loader.requestAds(i); } catch (i) { this.onAdError(i); } }), _defineProperty$1(this, 'pollCountdown', (r = !1) => { if (!r) return ( clearInterval(this.countdownTimer), void this.elements.container.removeAttribute('data-badge-text') ); this.countdownTimer = setInterval(() => { const i = formatTime(Math.max(this.manager.getRemainingTime(), 0)), s = `${i18n.get('advertisement', this.player.config)} - ${i}`; this.elements.container.setAttribute('data-badge-text', s); }, 100); }), _defineProperty$1(this, 'onAdsManagerLoaded', r => { if (!this.enabled) return; const i = new google.ima.AdsRenderingSettings(); (i.restoreCustomPlaybackStateOnAdBreakComplete = !0), (i.enablePreloading = !0), (this.manager = r.getAdsManager(this.player, i)), (this.cuePoints = this.manager.getCuePoints()), this.manager.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, s => this.onAdError(s) ), Object.keys(google.ima.AdEvent.Type).forEach(s => { this.manager.addEventListener(google.ima.AdEvent.Type[s], n => this.onAdEvent(n) ); }), this.trigger('loaded'); }), _defineProperty$1(this, 'addCuePoints', () => { is.empty(this.cuePoints) || this.cuePoints.forEach(r => { if (r !== 0 && r !== -1 && r < this.player.duration) { const i = this.player.elements.progress; if (is.element(i)) { const s = (100 / this.player.duration) * r, n = createElement('span', { class: this.player.config.classNames.cues }); (n.style.left = `${s.toString()}%`), i.appendChild(n); } } }); }), _defineProperty$1(this, 'onAdEvent', r => { const { container: i } = this.player.elements, s = r.getAd(), n = r.getAdData(); switch ( ((a => { triggerEvent.call( this.player, this.player.media, `ads${a.replace(/_/g, '').toLowerCase()}` ); })(r.type), r.type) ) { case google.ima.AdEvent.Type.LOADED: this.trigger('loaded'), this.pollCountdown(!0), s.isLinear() || ((s.width = i.offsetWidth), (s.height = i.offsetHeight)); break; case google.ima.AdEvent.Type.STARTED: this.manager.setVolume(this.player.volume); break; case google.ima.AdEvent.Type.ALL_ADS_COMPLETED: this.player.ended ? this.loadAds() : this.loader.contentComplete(); break; case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED: this.pauseContent(); break; case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED: this.pollCountdown(), this.resumeContent(); break; case google.ima.AdEvent.Type.LOG: n.adError && this.player.debug.warn( `Non-fatal ad error: ${n.adError.getMessage()}` ); } }), _defineProperty$1(this, 'onAdError', r => { this.cancel(), this.player.debug.warn('Ads error', r); }), _defineProperty$1(this, 'listeners', () => { const { container: r } = this.player.elements; let i; this.player.on('canplay', () => { this.addCuePoints(); }), this.player.on('ended', () => { this.loader.contentComplete(); }), this.player.on('timeupdate', () => { i = this.player.currentTime; }), this.player.on('seeked', () => { const s = this.player.currentTime; is.empty(this.cuePoints) || this.cuePoints.forEach((n, a) => { i < n && n < s && (this.manager.discardAdBreak(), this.cuePoints.splice(a, 1)); }); }), window.addEventListener('resize', () => { this.manager && this.manager.resize( r.offsetWidth, r.offsetHeight, google.ima.ViewMode.NORMAL ); }); }), _defineProperty$1(this, 'play', () => { const { container: r } = this.player.elements; this.managerPromise || this.resumeContent(), this.managerPromise .then(() => { this.manager.setVolume(this.player.volume), this.elements.displayContainer.initialize(); try { this.initialized || (this.manager.init( r.offsetWidth, r.offsetHeight, google.ima.ViewMode.NORMAL ), this.manager.start()), (this.initialized = !0); } catch (i) { this.onAdError(i); } }) .catch(() => {}); }), _defineProperty$1(this, 'resumeContent', () => { (this.elements.container.style.zIndex = ''), (this.playing = !1), silencePromise(this.player.media.play()); }), _defineProperty$1(this, 'pauseContent', () => { (this.elements.container.style.zIndex = 3), (this.playing = !0), this.player.media.pause(); }), _defineProperty$1(this, 'cancel', () => { this.initialized && this.resumeContent(), this.trigger('error'), this.loadAds(); }), _defineProperty$1(this, 'loadAds', () => { this.managerPromise .then(() => { this.manager && this.manager.destroy(), (this.managerPromise = new Promise(r => { this.on('loaded', r), this.player.debug.log(this.manager); })), (this.initialized = !1), this.requestAds(); }) .catch(() => {}); }), _defineProperty$1(this, 'trigger', (r, ...i) => { const s = this.events[r]; is.array(s) && s.forEach(n => { is.function(n) && n.apply(this, i); }); }), _defineProperty$1( this, 'on', (r, i) => ( is.array(this.events[r]) || (this.events[r] = []), this.events[r].push(i), this ) ), _defineProperty$1(this, 'startSafetyTimer', (r, i) => { this.player.debug.log(`Safety timer invoked from: ${i}`), (this.safetyTimer = setTimeout(() => { this.cancel(), this.clearSafetyTimer('startSafetyTimer()'); }, r)); }), _defineProperty$1(this, 'clearSafetyTimer', r => { is.nullOrUndefined(this.safetyTimer) || (this.player.debug.log(`Safety timer cleared from: ${r}`), clearTimeout(this.safetyTimer), (this.safetyTimer = null)); }), (this.player = t), (this.config = t.config.ads), (this.playing = !1), (this.initialized = !1), (this.elements = { container: null, displayContainer: null }), (this.manager = null), (this.loader = null), (this.cuePoints = null), (this.events = {}), (this.safetyTimer = null), (this.countdownTimer = null), (this.managerPromise = new Promise((r, i) => { this.on('loaded', r), this.on('error', i); })), this.load(); } get enabled() { const { config: t } = this; return ( this.player.isHTML5 && this.player.isVideo && t.enabled && (!is.empty(t.publisherId) || is.url(t.tagUrl)) ); } get tagUrl() { const { config: t } = this; return is.url(t.tagUrl) ? t.tagUrl : `https://go.aniview.com/api/adserver6/vast/?${buildUrlParams({ AV_PUBLISHERID: '58c25bb0073ef448b1087ad6', AV_CHANNELID: '5a0458dc28a06145e4519d21', AV_URL: window.location.hostname, cb: Date.now(), AV_WIDTH: 640, AV_HEIGHT: 480, AV_CDIM2: t.publisherId })}`; } } function clamp(e = 0, t = 0, r = 255) { return Math.min(Math.max(e, t), r); } const parseVtt = e => { const t = []; return ( e.split(/\r\n\r\n|\n\n|\r\r/).forEach(r => { const i = {}; r.split(/\r\n|\n|\r/).forEach(s => { if (is.number(i.startTime)) { if (!is.empty(s.trim()) && is.empty(i.text)) { const n = s.trim().split('#xywh='); ([i.text] = n), n[1] && ([i.x, i.y, i.w, i.h] = n[1].split(',')); } } else { const n = s.match( /([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/ ); n && ((i.startTime = 60 * Number(n[1] || 0) * 60 + 60 * Number(n[2]) + Number(n[3]) + +`0.${n[4]}`), (i.endTime = 60 * Number(n[6] || 0) * 60 + 60 * Number(n[7]) + Number(n[8]) + +`0.${n[9]}`)); } }), i.text && t.push(i); }), t ); }, fitRatio = (e, t) => { const r = {}; return ( e > t.width / t.height ? ((r.width = t.width), (r.height = (1 / e) * t.width)) : ((r.height = t.height), (r.width = e * t.height)), r ); }; class PreviewThumbnails { constructor(t) { _defineProperty$1(this, 'load', () => { this.player.elements.display.seekTooltip && (this.player.elements.display.seekTooltip.hidden = this.enabled), this.enabled && this.getThumbnails().then(() => { this.enabled && (this.render(), this.determineContainerAutoSizing(), this.listeners(), (this.loaded = !0)); }); }), _defineProperty$1( this, 'getThumbnails', () => new Promise(r => { const { src: i } = this.player.config.previewThumbnails; if (is.empty(i)) throw new Error('Missing previewThumbnails.src config attribute'); const s = () => { this.thumbnails.sort((n, a) => n.height - a.height), this.player.debug.log('Preview thumbnails', this.thumbnails), r(); }; if (is.function(i)) i(n => { (this.thumbnails = n), s(); }); else { const n = (is.string(i) ? [i] : i).map(a => this.getThumbnail(a)); Promise.all(n).then(s); } }) ), _defineProperty$1( this, 'getThumbnail', r => new Promise(i => { fetch$1(r).then(s => { const n = { frames: parseVtt(s), height: null, urlPrefix: '' }; n.frames[0].text.startsWith('/') || n.frames[0].text.startsWith('http://') || n.frames[0].text.startsWith('https://') || (n.urlPrefix = r.substring(0, r.lastIndexOf('/') + 1)); const a = new Image(); (a.onload = () => { (n.height = a.naturalHeight), (n.width = a.naturalWidth), this.thumbnails.push(n), i(); }), (a.src = n.urlPrefix + n.frames[0].text); }); }) ), _defineProperty$1(this, 'startMove', r => { if ( this.loaded && is.event(r) && ['touchmove', 'mousemove'].includes(r.type) && this.player.media.duration ) { if (r.type === 'touchmove') this.seekTime = this.player.media.duration * (this.player.elements.inputs.seek.value / 100); else { var i, s; const n = this.player.elements.progress.getBoundingClientRect(), a = (100 / n.width) * (r.pageX - n.left); (this.seekTime = this.player.media.duration * (a / 100)), this.seekTime < 0 && (this.seekTime = 0), this.seekTime > this.player.media.duration - 1 && (this.seekTime = this.player.media.duration - 1), (this.mousePosX = r.pageX), (this.elements.thumb.time.innerText = formatTime(this.seekTime)); const o = (i = this.player.config.markers) === null || i === void 0 || (s = i.points) === null || s === void 0 ? void 0 : s.find(({ time: l }) => l === Math.round(this.seekTime)); o && this.elements.thumb.time.insertAdjacentHTML( 'afterbegin', `${o.label}
` ); } this.showImageAtCurrentTime(); } }), _defineProperty$1(this, 'endMove', () => { this.toggleThumbContainer(!1, !0); }), _defineProperty$1(this, 'startScrubbing', r => { (is.nullOrUndefined(r.button) || r.button === !1 || r.button === 0) && ((this.mouseDown = !0), this.player.media.duration && (this.toggleScrubbingContainer(!0), this.toggleThumbContainer(!1, !0), this.showImageAtCurrentTime())); }), _defineProperty$1(this, 'endScrubbing', () => { (this.mouseDown = !1), Math.ceil(this.lastTime) === Math.ceil(this.player.media.currentTime) ? this.toggleScrubbingContainer(!1) : once.call(this.player, this.player.media, 'timeupdate', () => { this.mouseDown || this.toggleScrubbingContainer(!1); }); }), _defineProperty$1(this, 'listeners', () => { this.player.on('play', () => { this.toggleThumbContainer(!1, !0); }), this.player.on('seeked', () => { this.toggleThumbContainer(!1); }), this.player.on('timeupdate', () => { this.lastTime = this.player.media.currentTime; }); }), _defineProperty$1(this, 'render', () => { (this.elements.thumb.container = createElement('div', { class: this.player.config.classNames.previewThumbnails.thumbContainer })), (this.elements.thumb.imageContainer = createElement('div', { class: this.player.config.classNames.previewThumbnails.imageContainer })), this.elements.thumb.container.appendChild( this.elements.thumb.imageContainer ); const r = createElement('div', { class: this.player.config.classNames.previewThumbnails.timeContainer }); (this.elements.thumb.time = createElement('span', {}, '00:00')), r.appendChild(this.elements.thumb.time), this.elements.thumb.imageContainer.appendChild(r), is.element(this.player.elements.progress) && this.player.elements.progress.appendChild( this.elements.thumb.container ), (this.elements.scrubbing.container = createElement('div', { class: this.player.config.classNames.previewThumbnails.scrubbingContainer })), this.player.elements.wrapper.appendChild( this.elements.scrubbing.container ); }), _defineProperty$1(this, 'destroy', () => { this.elements.thumb.container && this.elements.thumb.container.remove(), this.elements.scrubbing.container && this.elements.scrubbing.container.remove(); }), _defineProperty$1(this, 'showImageAtCurrentTime', () => { this.mouseDown ? this.setScrubbingContainerSize() : this.setThumbContainerSizeAndPos(); const r = this.thumbnails[0].frames.findIndex( n => this.seekTime >= n.startTime && this.seekTime <= n.endTime ), i = r >= 0; let s = 0; this.mouseDown || this.toggleThumbContainer(i), i && (this.thumbnails.forEach((n, a) => { this.loadedImages.includes(n.frames[r].text) && (s = a); }), r !== this.showingThumb && ((this.showingThumb = r), this.loadImage(s))); }), _defineProperty$1(this, 'loadImage', (r = 0) => { const i = this.showingThumb, s = this.thumbnails[r], { urlPrefix: n } = s, a = s.frames[i], o = s.frames[i].text, l = n + o; if ( this.currentImageElement && this.currentImageElement.dataset.filename === o ) this.showImage(this.currentImageElement, a, r, i, o, !1), (this.currentImageElement.dataset.index = i), this.removeOldImages(this.currentImageElement); else { this.loadingImage && this.usingSprites && (this.loadingImage.onload = null); const c = new Image(); (c.src = l), (c.dataset.index = i), (c.dataset.filename = o), (this.showingThumbFilename = o), this.player.debug.log(`Loading image: ${l}`), (c.onload = () => this.showImage(c, a, r, i, o, !0)), (this.loadingImage = c), this.removeOldImages(c); } }), _defineProperty$1(this, 'showImage', (r, i, s, n, a, o = !0) => { this.player.debug.log( `Showing thumb: ${a}. num: ${n}. qual: ${s}. newimg: ${o}` ), this.setImageSizeAndOffset(r, i), o && (this.currentImageContainer.appendChild(r), (this.currentImageElement = r), this.loadedImages.includes(a) || this.loadedImages.push(a)), this.preloadNearby(n, !0) .then(this.preloadNearby(n, !1)) .then(this.getHigherQuality(s, r, i, a)); }), _defineProperty$1(this, 'removeOldImages', r => { Array.from(this.currentImageContainer.children).forEach(i => { if (i.tagName.toLowerCase() !== 'img') return; const s = this.usingSprites ? 500 : 1e3; if (i.dataset.index !== r.dataset.index && !i.dataset.deleting) { i.dataset.deleting = !0; const { currentImageContainer: n } = this; setTimeout(() => { n.removeChild(i), this.player.debug.log(`Removing thumb: ${i.dataset.filename}`); }, s); } }); }), _defineProperty$1( this, 'preloadNearby', (r, i = !0) => new Promise(s => { setTimeout(() => { const n = this.thumbnails[0].frames[r].text; if (this.showingThumbFilename === n) { let a; a = i ? this.thumbnails[0].frames.slice(r) : this.thumbnails[0].frames.slice(0, r).reverse(); let o = !1; a.forEach(l => { const c = l.text; if (c !== n && !this.loadedImages.includes(c)) { (o = !0), this.player.debug.log(`Preloading thumb filename: ${c}`); const { urlPrefix: g } = this.thumbnails[0], S = g + c, p = new Image(); (p.src = S), (p.onload = () => { this.player.debug.log(`Preloaded thumb filename: ${c}`), this.loadedImages.includes(c) || this.loadedImages.push(c), s(); }); } }), o || s(); } }, 300); }) ), _defineProperty$1(this, 'getHigherQuality', (r, i, s, n) => { if (r < this.thumbnails.length - 1) { let a = i.naturalHeight; this.usingSprites && (a = s.h), a < this.thumbContainerHeight && setTimeout(() => { this.showingThumbFilename === n && (this.player.debug.log( `Showing higher quality thumb for: ${n}` ), this.loadImage(r + 1)); }, 300); } }), _defineProperty$1(this, 'toggleThumbContainer', (r = !1, i = !1) => { const s = this.player.config.classNames.previewThumbnails.thumbContainerShown; this.elements.thumb.container.classList.toggle(s, r), !r && i && ((this.showingThumb = null), (this.showingThumbFilename = null)); }), _defineProperty$1(this, 'toggleScrubbingContainer', (r = !1) => { const i = this.player.config.classNames.previewThumbnails .scrubbingContainerShown; this.elements.scrubbing.container.classList.toggle(i, r), r || ((this.showingThumb = null), (this.showingThumbFilename = null)); }), _defineProperty$1(this, 'determineContainerAutoSizing', () => { (this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) && (this.sizeSpecifiedInCSS = !0); }), _defineProperty$1(this, 'setThumbContainerSizeAndPos', () => { const { imageContainer: r } = this.elements.thumb; if (this.sizeSpecifiedInCSS) { if (r.clientHeight > 20 && r.clientWidth < 20) { const i = Math.floor(r.clientHeight * this.thumbAspectRatio); r.style.width = `${i}px`; } else if (r.clientHeight < 20 && r.clientWidth > 20) { const i = Math.floor(r.clientWidth / this.thumbAspectRatio); r.style.height = `${i}px`; } } else { const i = Math.floor( this.thumbContainerHeight * this.thumbAspectRatio ); (r.style.height = `${this.thumbContainerHeight}px`), (r.style.width = `${i}px`); } this.setThumbContainerPos(); }), _defineProperty$1(this, 'setThumbContainerPos', () => { const r = this.player.elements.progress.getBoundingClientRect(), i = this.player.elements.container.getBoundingClientRect(), { container: s } = this.elements.thumb, n = i.left - r.left + 10, a = i.right - r.left - s.clientWidth - 10, o = this.mousePosX - r.left - s.clientWidth / 2, l = clamp(o, n, a); (s.style.left = `${l}px`), s.style.setProperty('--preview-arrow-offset', o - l + 'px'); }), _defineProperty$1(this, 'setScrubbingContainerSize', () => { const { width: r, height: i } = fitRatio(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight }); (this.elements.scrubbing.container.style.width = `${r}px`), (this.elements.scrubbing.container.style.height = `${i}px`); }), _defineProperty$1(this, 'setImageSizeAndOffset', (r, i) => { if (!this.usingSprites) return; const s = this.thumbContainerHeight / i.h; (r.style.height = r.naturalHeight * s + 'px'), (r.style.width = r.naturalWidth * s + 'px'), (r.style.left = `-${i.x * s}px`), (r.style.top = `-${i.y * s}px`); }), (this.player = t), (this.thumbnails = []), (this.loaded = !1), (this.lastMouseMoveTime = Date.now()), (this.mouseDown = !1), (this.loadedImages = []), (this.elements = { thumb: {}, scrubbing: {} }), this.load(); } get enabled() { return ( this.player.isHTML5 && this.player.isVideo && this.player.config.previewThumbnails.enabled ); } get currentImageContainer() { return this.mouseDown ? this.elements.scrubbing.container : this.elements.thumb.imageContainer; } get usingSprites() { return Object.keys(this.thumbnails[0].frames[0]).includes('w'); } get thumbAspectRatio() { return this.usingSprites ? this.thumbnails[0].frames[0].w / this.thumbnails[0].frames[0].h : this.thumbnails[0].width / this.thumbnails[0].height; } get thumbContainerHeight() { if (this.mouseDown) { const { height: t } = fitRatio(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight }); return t; } return this.sizeSpecifiedInCSS ? this.elements.thumb.imageContainer.clientHeight : Math.floor(this.player.media.clientWidth / this.thumbAspectRatio / 4); } get currentImageElement() { return this.mouseDown ? this.currentScrubbingImageElement : this.currentThumbnailImageElement; } set currentImageElement(t) { this.mouseDown ? (this.currentScrubbingImageElement = t) : (this.currentThumbnailImageElement = t); } } const source = { insertElements(e, t) { is.string(t) ? insertElement(e, this.media, { src: t }) : is.array(t) && t.forEach(r => { insertElement(e, this.media, r); }); }, change(e) { getDeep(e, 'sources.length') ? (html5.cancelRequests.call(this), this.destroy.call( this, () => { (this.options.quality = []), removeElement(this.media), (this.media = null), is.element(this.elements.container) && this.elements.container.removeAttribute('class'); const { sources: t, type: r } = e, [{ provider: i = providers.html5, src: s }] = t, n = i === 'html5' ? r : 'div', a = i === 'html5' ? {} : { src: s }; Object.assign(this, { provider: i, type: r, supported: support.check(r, i, this.config.playsinline), media: createElement(n, a) }), this.elements.container.appendChild(this.media), is.boolean(e.autoplay) && (this.config.autoplay = e.autoplay), this.isHTML5 && (this.config.crossorigin && this.media.setAttribute('crossorigin', ''), this.config.autoplay && this.media.setAttribute('autoplay', ''), is.empty(e.poster) || (this.poster = e.poster), this.config.loop.active && this.media.setAttribute('loop', ''), this.config.muted && this.media.setAttribute('muted', ''), this.config.playsinline && this.media.setAttribute('playsinline', '')), ui.addStyleHook.call(this), this.isHTML5 && source.insertElements.call(this, 'source', t), (this.config.title = e.title), media.setup.call(this), this.isHTML5 && Object.keys(e).includes('tracks') && source.insertElements.call(this, 'track', e.tracks), (this.isHTML5 || (this.isEmbed && !this.supported.ui)) && ui.build.call(this), this.isHTML5 && this.media.load(), is.empty(e.previewThumbnails) || (Object.assign( this.config.previewThumbnails, e.previewThumbnails ), this.previewThumbnails && this.previewThumbnails.loaded && (this.previewThumbnails.destroy(), (this.previewThumbnails = null)), this.config.previewThumbnails.enabled && (this.previewThumbnails = new PreviewThumbnails(this))), this.fullscreen.update(); }, !0 )) : this.debug.warn('Invalid source format'); } }; class Plyr { constructor(t, r) { if ( (_defineProperty$1(this, 'play', () => is.function(this.media.play) ? (this.ads && this.ads.enabled && this.ads.managerPromise .then(() => this.ads.play()) .catch(() => silencePromise(this.media.play())), this.media.play()) : null ), _defineProperty$1(this, 'pause', () => this.playing && is.function(this.media.pause) ? this.media.pause() : null ), _defineProperty$1(this, 'togglePlay', o => (is.boolean(o) ? o : !this.playing) ? this.play() : this.pause() ), _defineProperty$1(this, 'stop', () => { this.isHTML5 ? (this.pause(), this.restart()) : is.function(this.media.stop) && this.media.stop(); }), _defineProperty$1(this, 'restart', () => { this.currentTime = 0; }), _defineProperty$1(this, 'rewind', o => { this.currentTime -= is.number(o) ? o : this.config.seekTime; }), _defineProperty$1(this, 'forward', o => { this.currentTime += is.number(o) ? o : this.config.seekTime; }), _defineProperty$1(this, 'increaseVolume', o => { const l = this.media.muted ? 0 : this.volume; this.volume = l + (is.number(o) ? o : 0); }), _defineProperty$1(this, 'decreaseVolume', o => { this.increaseVolume(-o); }), _defineProperty$1(this, 'airplay', () => { support.airplay && this.media.webkitShowPlaybackTargetPicker(); }), _defineProperty$1(this, 'toggleControls', o => { if (this.supported.ui && !this.isAudio) { const l = hasClass( this.elements.container, this.config.classNames.hideControls ), c = o === void 0 ? void 0 : !o, g = toggleClass( this.elements.container, this.config.classNames.hideControls, c ); if ( (g && is.array(this.config.controls) && this.config.controls.includes('settings') && !is.empty(this.config.settings) && controls$2.toggleMenu.call(this, !1), g !== l) ) { const S = g ? 'controlshidden' : 'controlsshown'; triggerEvent.call(this, this.media, S); } return !g; } return !1; }), _defineProperty$1(this, 'on', (o, l) => { on.call(this, this.elements.container, o, l); }), _defineProperty$1(this, 'once', (o, l) => { once.call(this, this.elements.container, o, l); }), _defineProperty$1(this, 'off', (o, l) => { off(this.elements.container, o, l); }), _defineProperty$1(this, 'destroy', (o, l = !1) => { if (!this.ready) return; const c = () => { (document.body.style.overflow = ''), (this.embed = null), l ? (Object.keys(this.elements).length && (removeElement(this.elements.buttons.play), removeElement(this.elements.captions), removeElement(this.elements.controls), removeElement(this.elements.wrapper), (this.elements.buttons.play = null), (this.elements.captions = null), (this.elements.controls = null), (this.elements.wrapper = null)), is.function(o) && o()) : (unbindListeners.call(this), html5.cancelRequests.call(this), replaceElement(this.elements.original, this.elements.container), triggerEvent.call( this, this.elements.original, 'destroyed', !0 ), is.function(o) && o.call(this.elements.original), (this.ready = !1), setTimeout(() => { (this.elements = null), (this.media = null); }, 200)); }; this.stop(), clearTimeout(this.timers.loading), clearTimeout(this.timers.controls), clearTimeout(this.timers.resized), this.isHTML5 ? (ui.toggleNativeControls.call(this, !0), c()) : this.isYouTube ? (clearInterval(this.timers.buffering), clearInterval(this.timers.playing), this.embed !== null && is.function(this.embed.destroy) && this.embed.destroy(), c()) : this.isVimeo && (this.embed !== null && this.embed.unload().then(c), setTimeout(c, 200)); }), _defineProperty$1(this, 'supports', o => support.mime.call(this, o)), (this.timers = {}), (this.ready = !1), (this.loading = !1), (this.failed = !1), (this.touch = support.touch), (this.media = t), is.string(this.media) && (this.media = document.querySelectorAll(this.media)), ((window.jQuery && this.media instanceof jQuery) || is.nodeList(this.media) || is.array(this.media)) && (this.media = this.media[0]), (this.config = extend( {}, defaults, Plyr.defaults, r || {}, (() => { try { return JSON.parse(this.media.getAttribute('data-plyr-config')); } catch { return {}; } })() )), (this.elements = { container: null, fullscreen: null, captions: null, buttons: {}, display: {}, progress: {}, inputs: {}, settings: { popup: null, menu: null, panels: {}, buttons: {} } }), (this.captions = { active: null, currentTrack: -1, meta: new WeakMap() }), (this.fullscreen = { active: !1 }), (this.options = { speed: [], quality: [] }), (this.debug = new Console(this.config.debug)), this.debug.log('Config', this.config), this.debug.log('Support', support), is.nullOrUndefined(this.media) || !is.element(this.media)) ) return void this.debug.error('Setup failed: no suitable element passed'); if (this.media.plyr) return void this.debug.warn('Target already setup'); if (!this.config.enabled) return void this.debug.error('Setup failed: disabled by config'); if (!support.check().api) return void this.debug.error('Setup failed: no support'); const i = this.media.cloneNode(!0); (i.autoplay = !1), (this.elements.original = i); const s = this.media.tagName.toLowerCase(); let n = null, a = null; switch (s) { case 'div': if (((n = this.media.querySelector('iframe')), is.element(n))) { if ( ((a = parseUrl(n.getAttribute('src'))), (this.provider = getProviderByUrl(a.toString())), (this.elements.container = this.media), (this.media = n), (this.elements.container.className = ''), a.search.length) ) { const o = ['1', 'true']; o.includes(a.searchParams.get('autoplay')) && (this.config.autoplay = !0), o.includes(a.searchParams.get('loop')) && (this.config.loop.active = !0), this.isYouTube ? ((this.config.playsinline = o.includes( a.searchParams.get('playsinline') )), (this.config.youtube.hl = a.searchParams.get('hl'))) : (this.config.playsinline = !0); } } else (this.provider = this.media.getAttribute( this.config.attributes.embed.provider )), this.media.removeAttribute(this.config.attributes.embed.provider); if ( is.empty(this.provider) || !Object.values(providers).includes(this.provider) ) return void this.debug.error('Setup failed: Invalid provider'); this.type = types.video; break; case 'video': case 'audio': (this.type = s), (this.provider = providers.html5), this.media.hasAttribute('crossorigin') && (this.config.crossorigin = !0), this.media.hasAttribute('autoplay') && (this.config.autoplay = !0), (this.media.hasAttribute('playsinline') || this.media.hasAttribute('webkit-playsinline')) && (this.config.playsinline = !0), this.media.hasAttribute('muted') && (this.config.muted = !0), this.media.hasAttribute('loop') && (this.config.loop.active = !0); break; default: return void this.debug.error('Setup failed: unsupported type'); } (this.supported = support.check(this.type, this.provider)), this.supported.api ? ((this.eventListeners = []), (this.listeners = new Listeners(this)), (this.storage = new Storage(this)), (this.media.plyr = this), is.element(this.elements.container) || ((this.elements.container = createElement('div')), wrap(this.media, this.elements.container)), ui.migrateStyles.call(this), ui.addStyleHook.call(this), media.setup.call(this), this.config.debug && on.call( this, this.elements.container, this.config.events.join(' '), o => { this.debug.log(`event: ${o.type}`); } ), (this.fullscreen = new Fullscreen(this)), (this.isHTML5 || (this.isEmbed && !this.supported.ui)) && ui.build.call(this), this.listeners.container(), this.listeners.global(), this.config.ads.enabled && (this.ads = new Ads(this)), this.isHTML5 && this.config.autoplay && this.once('canplay', () => silencePromise(this.play())), (this.lastSeekTime = 0), this.config.previewThumbnails.enabled && (this.previewThumbnails = new PreviewThumbnails(this))) : this.debug.error('Setup failed: no support'); } get isHTML5() { return this.provider === providers.html5; } get isEmbed() { return this.isYouTube || this.isVimeo; } get isYouTube() { return this.provider === providers.youtube; } get isVimeo() { return this.provider === providers.vimeo; } get isVideo() { return this.type === types.video; } get isAudio() { return this.type === types.audio; } get playing() { return !!(this.ready && !this.paused && !this.ended); } get paused() { return !!this.media.paused; } get stopped() { return !!(this.paused && this.currentTime === 0); } get ended() { return !!this.media.ended; } set currentTime(t) { if (!this.duration) return; const r = is.number(t) && t > 0; (this.media.currentTime = r ? Math.min(t, this.duration) : 0), this.debug.log(`Seeking to ${this.currentTime} seconds`); } get currentTime() { return Number(this.media.currentTime); } get buffered() { const { buffered: t } = this.media; return is.number(t) ? t : t && t.length && this.duration > 0 ? t.end(0) / this.duration : 0; } get seeking() { return !!this.media.seeking; } get duration() { const t = parseFloat(this.config.duration), r = (this.media || {}).duration, i = is.number(r) && r !== 1 / 0 ? r : 0; return t || i; } set volume(t) { let r = t; is.string(r) && (r = Number(r)), is.number(r) || (r = this.storage.get('volume')), is.number(r) || ({ volume: r } = this.config), r > 1 && (r = 1), r < 0 && (r = 0), (this.config.volume = r), (this.media.volume = r), !is.empty(t) && this.muted && r > 0 && (this.muted = !1); } get volume() { return Number(this.media.volume); } set muted(t) { let r = t; is.boolean(r) || (r = this.storage.get('muted')), is.boolean(r) || (r = this.config.muted), (this.config.muted = r), (this.media.muted = r); } get muted() { return !!this.media.muted; } get hasAudio() { return ( !this.isHTML5 || !!this.isAudio || !!this.media.mozHasAudio || !!this.media.webkitAudioDecodedByteCount || !!(this.media.audioTracks && this.media.audioTracks.length) ); } set speed(t) { let r = null; is.number(t) && (r = t), is.number(r) || (r = this.storage.get('speed')), is.number(r) || (r = this.config.speed.selected); const { minimumSpeed: i, maximumSpeed: s } = this; (r = clamp(r, i, s)), (this.config.speed.selected = r), setTimeout(() => { this.media && (this.media.playbackRate = r); }, 0); } get speed() { return Number(this.media.playbackRate); } get minimumSpeed() { return this.isYouTube ? Math.min(...this.options.speed) : this.isVimeo ? 0.5 : 0.0625; } get maximumSpeed() { return this.isYouTube ? Math.max(...this.options.speed) : this.isVimeo ? 2 : 16; } set quality(t) { const r = this.config.quality, i = this.options.quality; if (!i.length) return; let s = [ !is.empty(t) && Number(t), this.storage.get('quality'), r.selected, r.default ].find(is.number), n = !0; if (!i.includes(s)) { const a = closest(i, s); this.debug.warn(`Unsupported quality option: ${s}, using ${a} instead`), (s = a), (n = !1); } (r.selected = s), (this.media.quality = s), n && this.storage.set({ quality: s }); } get quality() { return this.media.quality; } set loop(t) { const r = is.boolean(t) ? t : this.config.loop.active; (this.config.loop.active = r), (this.media.loop = r); } get loop() { return !!this.media.loop; } set source(t) { source.change.call(this, t); } get source() { return this.media.currentSrc; } get download() { const { download: t } = this.config.urls; return is.url(t) ? t : this.source; } set download(t) { is.url(t) && ((this.config.urls.download = t), controls$2.setDownloadUrl.call(this)); } set poster(t) { this.isVideo ? ui.setPoster.call(this, t, !1).catch(() => {}) : this.debug.warn('Poster can only be set for video'); } get poster() { return this.isVideo ? this.media.getAttribute('poster') || this.media.getAttribute('data-poster') : null; } get ratio() { if (!this.isVideo) return null; const t = reduceAspectRatio(getAspectRatio.call(this)); return is.array(t) ? t.join(':') : t; } set ratio(t) { this.isVideo ? is.string(t) && validateAspectRatio(t) ? ((this.config.ratio = reduceAspectRatio(t)), setAspectRatio.call(this)) : this.debug.error(`Invalid aspect ratio specified (${t})`) : this.debug.warn('Aspect ratio can only be set for video'); } set autoplay(t) { this.config.autoplay = is.boolean(t) ? t : this.config.autoplay; } get autoplay() { return !!this.config.autoplay; } toggleCaptions(t) { captions.toggle.call(this, t, !1); } set currentTrack(t) { captions.set.call(this, t, !1), captions.setup.call(this); } get currentTrack() { const { toggled: t, currentTrack: r } = this.captions; return t ? r : -1; } set language(t) { captions.setLanguage.call(this, t, !1); } get language() { return (captions.getCurrentTrack.call(this) || {}).language; } set pip(t) { if (!support.pip) return; const r = is.boolean(t) ? t : !this.pip; is.function(this.media.webkitSetPresentationMode) && this.media.webkitSetPresentationMode(r ? pip.active : pip.inactive), is.function(this.media.requestPictureInPicture) && (!this.pip && r ? this.media.requestPictureInPicture() : this.pip && !r && document.exitPictureInPicture()); } get pip() { return support.pip ? is.empty(this.media.webkitPresentationMode) ? this.media === document.pictureInPictureElement : this.media.webkitPresentationMode === pip.active : null; } setPreviewThumbnails(t) { this.previewThumbnails && this.previewThumbnails.loaded && (this.previewThumbnails.destroy(), (this.previewThumbnails = null)), Object.assign(this.config.previewThumbnails, t), this.config.previewThumbnails.enabled && (this.previewThumbnails = new PreviewThumbnails(this)); } static supported(t, r) { return support.check(t, r); } static loadSprite(t, r) { return loadSprite(t, r); } static setup(t, r = {}) { let i = null; return ( is.string(t) ? (i = Array.from(document.querySelectorAll(t))) : is.nodeList(t) ? (i = Array.from(t)) : is.array(t) && (i = t.filter(is.element)), is.empty(i) ? null : i.map(s => new Plyr(s, r)) ); } } Plyr.defaults = cloneDeep(defaults); const videoWrap = '_videoWrap_xntkj_1', controls$1 = '_controls_xntkj_19', time$1 = '_time_xntkj_27', line$1 = '_line_xntkj_36', slider$1 = '_slider_xntkj_43', actions$1 = '_actions_xntkj_54', actionWrap$1 = '_actionWrap_xntkj_62', actionBtn$1 = '_actionBtn_xntkj_65', playIcon = '_playIcon_xntkj_80', btnPlay = '_btnPlay_xntkj_83', btnPause = '_btnPause_xntkj_86', loopBtn = '_loopBtn_xntkj_93', styles$6 = { videoWrap, controls: controls$1, time: time$1, line: line$1, slider: slider$1, actions: actions$1, actionWrap: actionWrap$1, actionBtn: actionBtn$1, playIcon, btnPlay, btnPause, loopBtn }, iconplay = '' + new URL('icon-pause-5efb540a.svg', import.meta.url).href, iconpause = '' + new URL('icon-play-f01e3616.svg', import.meta.url).href, iconReplay$1 = '' + new URL('icon-replay-06435dc9.svg', import.meta.url).href, VideoPlay = defineComponent({ name: 'video-play', props: { item: { type: Object, default: () => ({}) }, isEmtry: { type: Boolean, default: !1 } }, emits: ['loadedmetadata', 'togglePlay', 'ended', 'reset'], setup(e, { emit: t, expose: r }) { const { item: i, isEmtry: s } = toRefs(e), n = ref(), a = ref(), o = 'v' + Date.now() + Math.floor(Math.random() * 100), l = 'play' + Date.now() + Math.floor(Math.random() * 100), c = 'replay' + Date.now() + Math.floor(Math.random() * 100), g = A => { var u; (u = a.value) == null || u.toggleControls(A); }, S = A => { var u; A.stopPropagation(), (u = a.value) == null || u.togglePlay(); }, p = () => { !document.getElementById(c) || !a.value || a.value.restart(); }, P = () => { var A, u, f; (A = document.getElementById(o)) == null || A.addEventListener('click', m => { m.stopPropagation(), t('reset'); }), (u = document.getElementById(l)) == null || u.addEventListener('click', S), (f = document.getElementById(c)) == null || f.addEventListener('click', p); }, b = A => { const u = document.getElementById(l); u && (A == 'play' ? (u.classList.remove(styles$6.btnPause), u.classList.add(styles$6.btnPlay)) : (u.classList.remove(styles$6.btnPlay), u.classList.add(styles$6.btnPause))); }, y = `
00:00
/
00:00
% buffered 00:00
`; return ( onMounted(() => { (a.value = new Plyr(n.value, { autoplay: !0, controls: y, autopause: !0, ratio: '16:9', hideControls: !1, clickToPlay: !1, fullscreen: { enabled: !1, fallback: !1, iosNative: !1 } })), a.value && (a.value.on('play', () => { var A; a.value && ((a.value.muted = !1), (a.value.volume = 1)), !i.value.autoPlay && !i.value.isprepare && a.value && (console.log(a.value), a.value.pause()), b(''), t('togglePlay', (A = a.value) == null ? void 0 : A.paused); }), a.value.on('pause', () => { var A; b('play'), t('togglePlay', (A = a.value) == null ? void 0 : A.paused); }), a.value.on('ended', () => { t('ended'), b('play'); }), a.value.once('loadedmetadata', () => { b('play'), i.value.autoPlay && a.value && a.value.play(), t('loadedmetadata', a.value); }), nextTick(() => { P(); })); }), r({ changePlayBtn: b, toggleHideControl: g }), () => createVNode('div', { class: styles$6.videoWrap }, [ createVNode( 'video', { style: { width: '100%', height: '100%' }, src: s.value ? '' : i.value.content, ref: n, playsinline: 'false' }, null ) ]) ); } }), pen = '_pen_frc2u_1', open = '_open_frc2u_9', whiteboard = '_whiteboard_frc2u_12', hide = '_hide_frc2u_15', iframe = '_iframe_frc2u_18', dely = '_dely_frc2u_24', rightItem = '_rightItem_frc2u_27', img = '_img_frc2u_39', styles$5 = { pen, open, whiteboard, hide, iframe, dely, rightItem, img }, Pen = defineComponent({ name: 'pen-page', props: { show: { type: Boolean, default: !1 }, type: { type: String, default: 'pen' }, close: { type: Function, default: () => ({}) } }, setup(e) { const { show: t, type: r } = toRefs(e), i = ref(!0), s = (/(localhost|192)/.test(location.host), 'https://test.lexiaoya.cn/whiteboard-noCollab'); return () => createVNode( 'div', { class: [ styles$5.pen, r.value === 'whiteboard' ? styles$5.whiteboard : '', i.value ? styles$5.dely : '', t.value ? styles$5.open : styles$5.hide ] }, [ createVNode( 'iframe', { class: styles$5.iframe, frameborder: '0', width: '100vw', height: '100vh', src: s, onLoad: () => { i.value = !1; } }, null ), createVNode( 'div', { class: styles$5.rightItem, onClick: () => e.close() }, [ createVNode( 'svg', { width: '22px', height: '20px', viewBox: '0 0 22 20' }, [ createVNode( 'path', { transform: 'translate(-1.000000, -2.000000)', fill: '#FFFFFF', d: 'M13,2 C13.5522847,2 14,2.44771525 14,3 C14,3.51283584 13.6139598,3.93550716 13.1166211,3.99327227 L13,4 L3,4 L3,20 L13,20 C13.5128358,20 13.9355072,20.3860402 13.9932723,20.8833789 L14,21 C14,21.5128358 13.6139598,21.9355072 13.1166211,21.9932723 L13,22 L2,22 C1.48716416,22 1.06449284,21.6139598 1.00672773,21.1166211 L1,21 L1,3 C1,2.48716416 1.38604019,2.06449284 1.88337887,2.00672773 L2,2 L13,2 Z M17.7071068,7.05025253 L21.9497475,11.2928932 L21.9497475,11.2928932 C22.3402718,11.6834175 22.3402718,12.3165825 21.9497475,12.7071068 L17.7071068,16.9497475 C17.3165825,17.3402718 16.6834175,17.3402718 16.2928932,16.9497475 C15.9023689,16.5592232 15.9023689,15.9260582 16.2928932,15.5355339 L18.828,12.999 L9.29368112,13 C8.74139637,13 8.29368112,12.5522847 8.29368112,12 C8.29368112,11.4871642 8.67972131,11.0644928 9.17706,11.0067277 L9.29368112,11 L18.827,10.999 L16.2928932,8.46446609 C15.9023689,8.0739418 15.9023689,7.44077682 16.2928932,7.05025253 C16.6834175,6.65972824 17.3165825,6.65972824 17.7071068,7.05025253 Z' }, null ) ] ) ] ) ] ); } }), audioWrap = '_audioWrap_1fqhr_1', audioContainer = '_audioContainer_1fqhr_6', audio = '_audio_1fqhr_1', tempVudio = '_tempVudio_1fqhr_22', controls = '_controls_1fqhr_34', time = '_time_1fqhr_48', line = '_line_1fqhr_57', actions = '_actions_1fqhr_64', actionWrap = '_actionWrap_1fqhr_72', actionBtn = '_actionBtn_1fqhr_75', iconReplay = '_iconReplay_1fqhr_86', slider = '_slider_1fqhr_95', sectionAnimate = '_sectionAnimate_1fqhr_103', styles$4 = { audioWrap, audioContainer, audio, tempVudio, controls, time, line, actions, actionWrap, actionBtn, iconReplay, slider, sectionAnimate }; var vudioExports = {}, vudio = { get exports() { return vudioExports; }, set exports(e) { vudioExports = e; } }; (function (e, t) { (function (r) { e.exports = r(); })(function () { var r = { effect: 'waveform', accuracy: 128, width: 256, height: 100, waveform: { maxHeight: 80, minHeight: 1, spacing: 1, color: '#f00', shadowBlur: 0, shadowColor: '#f00', fadeSide: !0, horizontalAlign: 'center', verticalAlign: 'middle', prettify: !0 }, lighting: { maxHeight: 80, lineWidth: 0, color: '#f00', shadowBlur: 0, shadowColor: '#f00', fadeSide: !0, horizontalAlign: 'center', verticalAlign: 'middle' } }; function i(n, a, o) { if ( [ '[object HTMLAudioSource]', '[object HTMLAudioElement]', '[object MediaStream]' ].indexOf(Object.prototype.toString.call(n)) === -1 ) throw new TypeError('Invaild Audio Source'); if (Object.prototype.toString.call(a) !== '[object HTMLCanvasElement]') throw new TypeError('Invaild Canvas Element'); (this.audioSrc = n), (this.canvasEle = a), (this.option = s(r, o)), (this.meta = {}), (this.stat = 0), (this.freqByteData = null), this.__init(); } function s() { var n = {}; return ( Array.prototype.forEach.call(arguments, function (a) { var o; for (o in a) Object.prototype.hasOwnProperty.call(a, o) && (Object.prototype.toString.call(a[o]) === '[object Object]' ? (n[o] = s(n[o], a[o])) : (n[o] = a[o])); }), n ); } return ( (i.prototype = { __init: function () { var n = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)(), a = Object.prototype.toString.call(this.audioSrc) !== '[object MediaStream]' ? n.createMediaElementSource(this.audioSrc) : n.createMediaStreamSource(this.audioSrc), o = window.devicePixelRatio || 1; (this.analyser = n.createAnalyser()), (this.meta.spr = n.sampleRate), a.connect(this.analyser), (this.analyser.fftSize = this.option.accuracy * 2), this.analyser.connect(n.destination), (this.freqByteData = new Uint8Array( this.analyser.frequencyBinCount )), (this.context2d = this.canvasEle.getContext('2d')), (this.width = this.option.width), (this.height = this.option.height), (this.context2d.canvas.width = this.width * o), (this.context2d.canvas.height = this.height * o), this.context2d.scale(o, o); }, __rebuildData: function (n, a) { var o; return ( a === 'center' ? (o = [].concat( Array.from(n) .reverse() .splice(this.option.accuracy / 2, this.option.accuracy / 2), Array.from(n).splice(0, this.option.accuracy / 2) )) : a === 'left' ? (o = n) : a === 'right' ? (o = Array.from(n).reverse()) : (o = [].concat( Array.from(n) .reverse() .splice(this.option.accuracy / 2, this.option.accuracy / 2), Array.from(n).splice(0, this.option.accuracy / 2) )), o ); }, __animate: function () { this.stat === 1 && (this.analyser.getByteFrequencyData(this.freqByteData), typeof this.__effects()[this.option.effect] == 'function' && this.__effects()[this.option.effect](this.freqByteData), requestAnimationFrame(this.__animate.bind(this))); }, __testFrame: function () { this.analyser.getByteFrequencyData(this.freqByteData), typeof this.__effects()[this.option.effect] == 'function' && this.__effects()[this.option.effect](this.freqByteData); }, __effects: function () { var n = this; return { lighting: function (a) { var o = n.option.lighting, l = n.__rebuildData(a, o.horizontalAlign), c = o.maxHeight / 2, g = !0, S, p; o.horizontalAlign, n.context2d.clearRect(0, 0, n.width, n.height), (n.context2d.lineWidth = o.lineWidth), (n.context2d.strokeStyle = o.color), n.context2d.beginPath(), l.forEach(function (P, b) { (S = (n.width / n.option.accuracy) * b), (p = (P / 256) * c), o.verticalAlign === 'middle' ? (p = (n.height - P) / 2 - c / 2) : o.verticalAlign === 'bottom' ? (p = n.height - P) : o.verticalAlign === 'top' ? (p = P) : (p = (n.height - P) / 2 - c / 2), g ? (n.context2d.moveTo(S, p), (g = !1)) : n.context2d.lineTo(S, p); }), n.context2d.stroke(); }, waveform: function (a) { var o = n.option.waveform, l = o.fadeSide, c = o.prettify, g = n.__rebuildData(a, o.horizontalAlign), S, p, P, b, y, A, u, f; o.horizontalAlign !== 'center' && ((l = !1), (c = !1)), n.context2d.clearRect(0, 0, n.width, n.height), g.forEach(function (m, d) { (p = (n.width - n.option.accuracy * o.spacing) / n.option.accuracy), (b = d * (p + o.spacing)), o.spacing !== 1 && (b += o.spacing / 2), c ? d <= n.option.accuracy / 2 ? (S = (1 - (n.option.accuracy / 2 - 1 - d) / (n.option.accuracy / 2)) * o.maxHeight) : (S = (1 - (d - n.option.accuracy / 2) / (n.option.accuracy / 2)) * o.maxHeight) : (S = o.maxHeight), (P = (m / 256) * S), (P = P < o.minHeight ? o.minHeight : P), o.verticalAlign === 'middle' ? (y = (n.height - P) / 2) : o.verticalAlign === 'top' ? (y = 0) : o.verticalAlign === 'bottom' ? (y = n.height - P) : (y = (n.height - P) / 2), (A = o.color), A instanceof Array ? ((u = n.context2d.createLinearGradient(b, y, b, y + P)), A.forEach(function (E, T) { E instanceof Array ? ((f = E[0]), (E = E[1])) : T === 0 || T === A.length - 1 ? (f = T / (A.length - 1)) : (f = T / A.length + 0.5 / A.length), u.addColorStop(f, E); }), (n.context2d.fillStyle = u)) : (n.context2d.fillStyle = A), o.shadowBlur > 0 && ((n.context2d.shadowBlur = o.shadowBlur), (n.context2d.shadowColor = o.shadowColor)), l ? d <= n.option.accuracy / 2 ? (n.context2d.globalAlpha = 1 - (n.option.accuracy / 2 - 1 - d) / (n.option.accuracy / 2)) : (n.context2d.globalAlpha = 1 - (d - n.option.accuracy / 2) / (n.option.accuracy / 2)) : (n.context2d.globalAlpha = 1), n.context2d.fillRect(b, y, p, P); }); } }; }, dance: function () { return this.stat === 0 && ((this.stat = 1), this.__animate()), this; }, pause: function () { return (this.stat = 0), this; }, setOption: function (n) { this.option = s(this.option, n); } }), i ); }); })(vudio); const Vudio = vudioExports, tickMp3 = '' + new URL('tick-b5f22461.mp3', import.meta.url).href, AudioPay = defineComponent({ name: 'audio-play', props: { item: { type: Object, default: () => ({}) }, isEmtry: { type: Boolean, default: !1 } }, emits: ['loadedmetadata', 'togglePlay', 'ended', 'reset'], setup(e, { emit: t, expose: r }) { const i = reactive({ paused: !0, currentTimeNum: 0, currentTime: '00:00', durationNum: 0, duration: '00:00', showBar: !0, afterMa3: !0 }), s = ref(), n = ref(); let a = null; const o = y => { y == null || y.stopPropagation(), n.value.paused ? (l(n.value, s.value), n.value.play(), (i.afterMa3 = !1)) : n.value.pause(), (i.paused = n.value.paused), t('togglePlay', i.paused); }, l = (y, A) => { a || ((a = new Vudio(y, A, { effect: 'waveform', accuracy: 256, width: 1024, height: 600, waveform: { maxHeight: 200, color: [ [0, '#44D1FF'], [0.5, '#44D1FF'], [0.5, '#198CFE'], [1, '#198CFE'] ], prettify: !1 } })), a.dance()); }, c = y => { if (y > 0) { const A = Math.floor(y / 60), u = y % 60; return (A < 10 ? '0' + A : A) + ':' + (u < 10 ? '0' + u : u); } else return '00:00'; }, g = y => { i.showBar = y; }, S = () => { n.value && (n.value.currentTime = 0); }; let p = null; const P = ref(), b = ref(); return ( nextTick(() => { (p = new Vudio(b.value, P.value, { effect: 'waveform', accuracy: 256, width: 1024, height: 600, waveform: { maxHeight: 200, color: [ [0, '#44D1FF'], [0.5, '#44D1FF'], [0.5, '#198CFE'], [1, '#198CFE'] ], prettify: !1 } })), p.dance(); }), r({ toggleHideControl: g }), () => createVNode('div', { class: styles$4.audioWrap }, [ createVNode('div', { class: styles$4.audioContainer }, [ createVNode( 'audio', { ref: n, crossorigin: 'anonymous', src: e.item.content + '?time=1', onEnded: () => { (i.paused = !0), t('ended'); }, onTimeupdate: () => { var y; (i.currentTime = c( Math.round( ((y = n.value) == null ? void 0 : y.currentTime) || 0 ) )), (i.currentTimeNum = n.value.currentTime); }, onLoadedmetadata: () => { (i.duration = c(Math.round(n.value.duration))), (i.durationNum = n.value.duration), e.item.autoPlay && n.value && n.value.play(), (n.value.stop = () => { n.value.pause(), (i.paused = !0), t('togglePlay', i.paused); }), (n.value.onPlay = () => { n.value.play(), (i.paused = !1), l(n.value, s.value), t('togglePlay', i.paused); }), t('loadedmetadata', n.value); } }, null ), createVNode('canvas', { ref: s }, null), i.afterMa3 && createVNode('div', { class: styles$4.tempVudio }, [ createVNode('audio', { ref: b, src: tickMp3 }, null), createVNode('canvas', { ref: P }, null) ]) ]), createVNode( 'div', { class: [ styles$4.controls, i.showBar ? '' : styles$4.sectionAnimate ], onClick: y => { y.stopPropagation(), t('reset'); } }, [ createVNode('div', { class: styles$4.actions }, [ createVNode('div', { class: styles$4.actionWrap }, [ createVNode( 'button', { class: styles$4.actionBtn, onClick: o }, [ i.paused ? createVNode( 'img', { class: styles$4.playIcon, src: iconplay }, null ) : createVNode( 'img', { class: styles$4.playIcon, src: iconpause }, null ) ] ) ]), createVNode('div', { class: styles$4.time }, [ createVNode( 'div', { class: 'plyr__time plyr__time--current', 'aria-label': 'Current time' }, [i.currentTime] ), createVNode('span', { class: styles$4.line }, [ createTextVNode('/') ]), createVNode( 'div', { class: 'plyr__time plyr__time--duration', 'aria-label': 'Duration' }, [i.duration] ) ]) ]), createVNode('div', { class: styles$4.slider }, [ createVNode( NSlider, { value: i.currentTimeNum, step: 0.01, max: i.durationNum, tooltip: !1, 'onUpdate:value': y => { (n.value.currentTime = y), (i.currentTimeNum = y), (i.currentTime = c(Math.round(y || 0))); } }, null ) ]), createVNode('div', { class: styles$4.actions }, [ createVNode('div', { class: styles$4.actionWrap }, [ createVNode( 'button', { class: styles$4.iconReplay, onClick: S }, [createVNode('img', { src: iconReplay$1 }, null)] ) ]) ]) ] ) ]) ); } }), trainSettings = '_trainSettings_1ohlb_1', trainBtnGroup = '_trainBtnGroup_1ohlb_1', searchGroup$1 = '_searchGroup_1ohlb_9', datetime = '_datetime_1ohlb_13', trainList = '_trainList_1ohlb_43', trainEditModal = '_trainEditModal_1ohlb_53', selectMusicModal = '_selectMusicModal_1ohlb_56', styles$3 = { trainSettings, trainBtnGroup, searchGroup: searchGroup$1, datetime, trainList, trainEditModal, selectMusicModal }, trainType = '_trainType_45ce3_1', title = '_title_45ce3_13', btn = '_btn_45ce3_28', preview = '_preview_45ce3_70', previewBtn = '_previewBtn_45ce3_84', type = '_type_45ce3_100', operation = '_operation_45ce3_113', evaluationType = '_evaluationType_45ce3_122', styles$2 = { trainType, 'train-header': '_train-header_45ce3_8', title, 'title-tag': '_title-tag_45ce3_20', 'title-text': '_title-text_45ce3_25', btn, 'train-content': '_train-content_45ce3_53', preview, previewBtn, 'train-footer': '_train-footer_45ce3_95', type, operation, evaluationType }, pTag = '' + new URL('p-tag-c1dd923a.svg', import.meta.url).href, eTag = '' + new URL('e-tag-41ad6d7f.svg', import.meta.url).href, pEdit = '' + new URL('p-edit-4f706e0f.svg', import.meta.url).href, eEdit = '' + new URL('e-edit-27c28498.svg', import.meta.url).href, iconPause = '' + new URL('icon-pause-70c10a79.svg', import.meta.url).href, pDelete = '' + new URL('p-delete-f451a434.svg', import.meta.url).href, eDelete = '' + new URL('e-delete-50e50a8c.svg', import.meta.url).href; function _isSlot$2(e) { return ( typeof e == 'function' || (Object.prototype.toString.call(e) === '[object Object]' && !isVNode(e)) ); } const TrainType = defineComponent({ name: 'train-type', props: { item: { type: Object, default: () => ({}) } }, emits: ['click', 'delete', 'edit'], setup(e, { emit: t }) { useUserStore(); const r = useDialog(), i = () => { const n = r.warning({ title: '提示', content: '您确定是否删除?', positiveText: '确定', negativeText: '取消', onPositiveClick: () => { (n.loading = !0), t('delete', e.item); } }); }, s = () => { const n = 'https://dev.kt.colexiu.com/instrument?platform=pc&modelType=practise'; window.open(n, '_blank'); }; return () => { let n; return createVNode( 'div', { class: [ styles$2.trainType, e.item.type === 'evaluation' ? styles$2.evaluationType : '' ], onClick: () => t('click', e.item) }, [ createVNode('div', { class: styles$2['train-header'] }, [ createVNode('div', { class: styles$2.title }, [ createVNode( 'img', { src: e.item.type === 'evaluation' ? eTag : pTag, class: styles$2['title-tag'] }, null ), createVNode( NEllipsis, { class: styles$2['title-text'] }, { default: () => [e.item.name] } ) ]), createVNode( NButton, { class: styles$2.btn, round: !0, onClick: s }, { default: () => [ e.item.type === 'evaluation' ? '评测模式' : '练习模式', createVNode('img', { src: iconPause }, null) ] } ) ]), createVNode('div', { class: styles$2['train-content'] }, [ createVNode( NImage, { src: e.item.src, previewDisabled: !0, objectFit: 'cover' }, null ), createVNode('div', { class: styles$2.preview }, [ createVNode( NButton, { strong: !0, secondary: !0, class: styles$2.previewBtn, onClick: s }, { default: () => [createTextVNode('预览')] } ) ]) ]), createVNode('div', { class: styles$2['train-footer'] }, [ createVNode( NSpace, { class: styles$2.type }, _isSlot$2( (n = e.item.typeList.map(a => createVNode( NTag, null, _isSlot$2(a) ? a : { default: () => [a] } ) )) ) ? n : { default: () => [n] } ), createVNode( NSpace, { size: 6 }, { default: () => [ createVNode( resolveComponent('n-button'), { quaternary: !0, class: styles$2.operation, onClick: a => { a.stopPropagation(), t('edit', e.item); } }, { default: () => [ createVNode( 'img', { src: e.item.type === 'evaluation' ? eEdit : pEdit }, null ) ] } ), createVNode( resolveComponent('n-button'), { quaternary: !0, class: styles$2.operation, onClick: a => { a.stopPropagation(), i(); } }, { default: () => [ createVNode( 'img', { src: e.item.type === 'evaluation' ? eDelete : pDelete }, null ) ] } ) ] } ) ]) ] ); }; } }), trainUpdate = '_trainUpdate_gry8i_1', updateBtnGroup = '_updateBtnGroup_gry8i_4', active = '_active_gry8i_16', styles$1 = { trainUpdate, updateBtnGroup, switch: '_switch_gry8i_12', active }, TrainUpdate = defineComponent({ name: 'train-update', emits: ['close'], setup(e, { emit: t }) { const r = reactive({ type: 'practice', minScore: null, maxScore: null, difficulty: '1' }); return () => createVNode('div', { class: styles$1.trainUpdate }, [ createVNode( NForm, { labelAlign: 'left', labelPlacement: 'left' }, { default: () => [ createVNode( NFormItem, { label: '训练方式', path: 'type' }, { default: () => [ createVNode(NSpace, null, { default: () => [ createVNode( NButton, { secondary: !0, class: [ styles$1.switch, r.type === 'practice' ? styles$1.active : '' ], onClick: () => (r.type = 'practice') }, { default: () => [createTextVNode('练习')] } ), createVNode( NButton, { secondary: !0, class: [ styles$1.switch, r.type === 'evaluation' ? styles$1.active : '' ], onClick: () => (r.type = 'evaluation') }, { default: () => [createTextVNode('评测')] } ) ] }) ] } ), r.type === 'practice' && createVNode(Fragment, null, [ createVNode( NFormItem, { label: '练习小节', path: 'minScore' }, { default: () => [ createVNode( NInputNumber, { value: r.minScore, 'onUpdate:value': [ i => (r.minScore = i), () => { r.maxScore = null; } ], showButton: !1, min: 0, max: 99, placeholder: '最小练习小节', style: { width: '46%' } }, null ), createVNode( 'div', { style: { display: 'flex', alignItems: 'center', lineHeight: '1', marginTop: '-2px', margin: '-2px 4% 0 4%' } }, [createTextVNode('-')] ), createVNode( NInputNumber, { value: r.maxScore, 'onUpdate:value': i => (r.maxScore = i), showButton: !1, min: r.minScore || 0, max: 99, placeholder: '最大练习小节', style: { width: '46%' } }, null ) ] } ), createVNode( NFormItem, { label: '练习速度' }, { default: () => [ createVNode( NInputNumber, { min: 0, showButton: !1, style: { width: '100%' } }, null ) ] } ), createVNode( NFormItem, { label: '练习时长' }, { default: () => [ createVNode(NInputGroup, null, { default: () => [ createVNode(NInput, null, null), createVNode(NInputGroupLabel, null, { default: () => [createTextVNode('分钟')] }) ] }) ] } ) ]), r.type === 'evaluation' && createVNode(Fragment, null, [ createVNode( NFormItem, { label: '评测难度', path: 'type' }, { default: () => [ createVNode(NSpace, null, { default: () => [ createVNode( NButton, { secondary: !0, class: [ styles$1.switch, r.difficulty === '1' ? styles$1.active : '' ], onClick: () => (r.difficulty = '1') }, { default: () => [createTextVNode('入门级')] } ), createVNode( NButton, { secondary: !0, class: [ styles$1.switch, r.difficulty === '2' ? styles$1.active : '' ], onClick: () => (r.difficulty = '2') }, { default: () => [createTextVNode('进阶级')] } ), createVNode( NButton, { secondary: !0, class: [ styles$1.switch, r.difficulty === '3' ? styles$1.active : '' ], onClick: () => (r.difficulty = '3') }, { default: () => [createTextVNode('大师级')] } ) ] }) ] } ), createVNode( NFormItem, { label: '评测速度' }, { default: () => [ createVNode(NInputGroup, null, { default: () => [ createVNode(NInput, null, null), createVNode(NInputGroupLabel, null, { default: () => [createTextVNode('分钟')] }) ] }) ] } ), createVNode( NFormItem, { label: '合格分数' }, { default: () => [ createVNode(NInputGroup, null, { default: () => [ createVNode(NInput, null, null), createVNode(NInputGroupLabel, null, { default: () => [createTextVNode('分')] }) ] }) ] } ) ]), createVNode( NSpace, { class: styles$1.updateBtnGroup }, { default: () => [ createVNode( NButton, { strong: !0, type: 'default', round: !0, onClick: () => t('close') }, { default: () => [createTextVNode('取消')] } ), createVNode( NButton, { strong: !0, type: 'primary', round: !0, onClick: () => t('close') }, { default: () => [createTextVNode('确认')] } ) ] } ) ] } ) ]); } }), selectMusic = '_selectMusic_1akyv_1', close = '_close_1akyv_30', listContainer = '_listContainer_1akyv_37', list = '_list_1akyv_37', searchGroup = '_searchGroup_1akyv_50', inputSearch = '_inputSearch_1akyv_72', styles = { selectMusic, close, listContainer, list, searchGroup, inputSearch }, SearchGroup = defineComponent({ name: 'search-group', setup() { return ( ref(!1), reactive({ search: '' }), () => createVNode('div', { class: styles.searchGroup }, [ createVNode( NForm, { labelAlign: 'left', labelPlacement: 'left' }, { default: () => [ createVNode( NFormItem, { label: '教材:' }, { default: () => [ createVNode(NSpace, null, { default: () => [ createVNode( NButton, { secondary: !0, strong: !0, type: 'primary', focusable: !1 }, { default: () => [createTextVNode('全部')] } ), createVNode( NButton, { quaternary: !0, focusable: !1 }, { default: () => [createTextVNode('人教版')] } ), createVNode( NButton, { quaternary: !0, focusable: !1 }, { default: () => [createTextVNode('声部训练')] } ), createVNode( NButton, { quaternary: !0, focusable: !1 }, { default: () => [createTextVNode('小曲目')] } ), createVNode( NButton, { quaternary: !0, focusable: !1 }, { default: () => [createTextVNode('考级曲目')] } ) ] }) ] } ), createVNode( NFormItem, { label: '乐器:' }, { default: () => [ createVNode(NSpace, null, { default: () => [ createVNode( NButton, { secondary: !0, strong: !0, type: 'primary' }, { default: () => [createTextVNode('全部')] } ), createVNode( NButton, { quaternary: !0, focusable: !1, type: 'default' }, { default: () => [createTextVNode('竖笛')] } ), createVNode( NButton, { quaternary: !0, focusable: !1, type: 'default' }, { default: () => [createTextVNode('排萧')] } ), createVNode( NButton, { quaternary: !0, focusable: !1, type: 'default' }, { default: () => [createTextVNode('口风琴')] } ), createVNode( NButton, { quaternary: !0, focusable: !1, type: 'default' }, { default: () => [createTextVNode('陶笛')] } ), createVNode( NButton, { quaternary: !0, focusable: !1, type: 'default' }, { default: () => [createTextVNode('葫芦丝')] } ) ] }) ] } ) ] } ), createVNode( TheSearch, { class: styles.inputSearch, round: !0 }, null ) ]) ); } }), SelectMusic = defineComponent({ name: 'select-music', emits: ['select'], setup(e, { emit: t }) { const r = reactive({ list: [], height: '100%' }); return ( (() => { const s = listData.rows || []; console.log(s); const n = []; s.forEach((a, o) => { o <= 10 && n.push({ id: a.id, type: 'MUSIC', title: a.musicSheetName, url: a.fixedTone ? a.fixedTone.split(',')[0] : '', isCollect: !(o % 3), isSelected: !(o % 4) }); }), (r.list = n || []); })(), () => createVNode('div', { class: styles.selectMusic }, [ createVNode( NTabs, { animated: !0, defaultValue: 'shareResources', paneClass: styles.paneTitle, justifyContent: 'center', paneWrapperClass: styles.paneWrapperContainer }, { default: () => [ createVNode( NTabPane, { name: 'shareResources', tab: '选择曲目' }, { default: () => [ createVNode(SearchGroup, null, null), createVNode( NScrollbar, { class: styles.listContainer }, { default: () => [ createVNode('div', { class: styles.list }, [ r.list.map(s => createVNode( CardType, { isShowAdd: !0, item: s, onAdd: n => t('select', n) }, null ) ) ]) ] } ) ] } ) ] } ) ]) ); } }); function _isSlot$1(e) { return ( typeof e == 'function' || (Object.prototype.toString.call(e) === '[object Object]' && !isVNode(e)) ); } const TrainSettings = defineComponent({ name: 'train-settings', emits: ['close'], setup(e, { emit: t }) { const r = reactive({ editStatus: !1, selectMusicStatus: !1 }), i = [ { id: 22078, src: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675770786664-1.png', type: 'practice', name: '彩虹岛', typeList: ['1-12小节', '速度90', '20分钟'] }, { id: 22048, src: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675839970286-1.png', type: 'evaluation', name: '彩云追月', typeList: ['入门级', '全部小节', '速度90', '20分钟'] } ]; return () => { let s; return createVNode('div', { class: styles$3.trainSettings }, [ createVNode('div', { class: styles$3.searchGroup }, [ createVNode( NButton, { onClick: () => (r.selectMusicStatus = !0) }, { default: () => [createTextVNode('添加训练')] } ), createVNode('div', { class: styles$3.datetime }, [ createVNode('label', null, [createTextVNode('截止时间:')]), createVNode( NDatePicker, { style: { width: '200px' }, 'value-format': 'yyyy-MM-dd', type: 'date', clearable: !0, placeholder: '请选择截止日期' }, null ) ]) ]), createVNode( NScrollbar, { class: styles$3.trainList }, _isSlot$1( (s = i.map(n => createVNode( TrainType, { item: n, onEdit: () => { console.log('edit'), (r.editStatus = !0); } }, null ) )) ) ? s : { default: () => [s] } ), createVNode( NSpace, { class: styles$3.trainBtnGroup }, { default: () => [ createVNode( NButton, { strong: !0, type: 'default', round: !0, onClick: () => t('close') }, { default: () => [createTextVNode('取消布置')] } ), createVNode( NButton, { strong: !0, type: 'primary', round: !0 }, { default: () => [createTextVNode('立即布置')] } ) ] } ), createVNode( NModal, { show: r.editStatus, 'onUpdate:show': n => (r.editStatus = n), class: ['modalTitle background', styles$3.trainEditModal], preset: 'card', title: '训练设置' }, { default: () => [ createVNode( TrainUpdate, { onClose: () => (r.editStatus = !1) }, null ) ] } ), createVNode( NModal, { show: r.selectMusicStatus, 'onUpdate:show': n => (r.selectMusicStatus = n), class: ['modalTitle', styles$3.selectMusicModal], preset: 'card', title: '选择曲目' }, { default: () => [ createVNode( SelectMusic, { onSelect: () => { (r.selectMusicStatus = !1), (r.editStatus = !0); } }, null ) ] } ) ]); }; } }); function _isSlot(e) { return ( typeof e == 'function' || (Object.prototype.toString.call(e) === '[object Object]' && !isVNode(e)) ); } const index = defineComponent({ name: 'CoursewarePlay', setup() { const e = useMessage(), t = reactive({ width: '100vw' }), r = () => { const I = Math.min(screen.width, screen.height), V = Math.max(screen.width, screen.height), D = I * (16 / 9); if (D > V) { t.width = '100vw'; return; } else t.width = D + 'px'; }, i = (I = 0) => { r(); }; i(), onUnmounted(() => { i(1); }); const s = reactive({ detail: null, knowledgePointList: [], itemList: [], showHead: !0, isCourse: !1, isRecordPlay: !1, videoRefs: {}, audioRefs: {}, modelAttendStatus: !1, modelTrainStatus: !1 }), n = reactive({ isAutoPlay: !0, nowTime: 0, model: !0, isAnimation: !0, videoBtns: !0, currentTime: 0, duration: 0, timer: null, item: null }), a = async () => { (s.knowledgePointList = [ { id: '1', name: '其多列', title: '其多列', type: 'VIDEO', content: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844560120.mp4', url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844640957.png' }, { id: '5', name: '歌曲表演 大鹿', title: '歌曲表演 大鹿', type: 'SONG', content: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/1686819360752.mp3', url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687916228530.png' }, { id: '2', name: '其多列', title: '其多列', type: 'IMG', content: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1688007481564.jpg', url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1688007481564.jpg' }, { id: '4', name: '歌曲 其多列', title: '其多列', type: 'MUSIC', content: '43541', url: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-first/1687847690372-1.png' } ]), (s.itemList = s.knowledgePointList.map(I => ({ ...I, iframeRef: null, videoEle: null, audioEle: null, autoPlay: !1, isprepare: !1, isRender: !1 }))); }, o = I => { var V; ((V = I.data) == null ? void 0 : V.api) === 'headerTogge' && (n.model = I.data.show || I.data.playState != 'play'); }; onMounted(() => { a(); }); const l = reactive({ open: !1, activeIndex: 0, toolOpen: !1 }), c = () => { var I, V; for (let D = 0; D < s.itemList.length; D++) { const N = s.itemList[D]; N.type === 'VIDEO' && N.videoEle && N.videoEle.stop(), N.type === 'SONG' && N.audioEle && N.audioEle.stop(), N.type === 'MUSIC' && ((V = (I = N.iframeRef) == null ? void 0 : I.contentWindow) == null || V.postMessage({ api: 'setPlayState' }, '*')); } }, g = I => { const V = s.itemList.findIndex(D => D.id == I); V > -1 && f(V); }, S = () => { clearTimeout(n.timer), e.destroyAll(), (n.timer = setTimeout(() => { (n.model = !1), Object.values(s.videoRefs).map(I => I.toggleHideControl(!1)), Object.values(s.audioRefs).map(I => I.toggleHideControl(!1)); }, 4e3)); }, p = () => { clearTimeout(n.timer), e.destroyAll(), (n.model = !1), Object.values(s.videoRefs).map(I => I.toggleHideControl(!1)), Object.values(s.audioRefs).map(I => I.toggleHideControl(!1)); }, P = (I = !0) => { (n.model = I), Object.values(s.videoRefs).map(V => V.toggleHideControl(I)), Object.values(s.audioRefs).map(V => V.toggleHideControl(I)); }, b = I => { if (I && I.type === 'VIDEO') { const V = I.videoEle; V && (V.paused ? (e.destroyAll(), V.play()) : (e.warning('已暂停'), V.pause())); } }; ref(-4); const y = ref(3), A = [ { prev: { transform: 'translate3d(0, 0, -800px) rotateX(180deg)' }, next: { transform: 'translate3d(0, 0, -800px) rotateX(-180deg)' } }, { prev: { transform: 'translate3d(-100%, 0, -800px)' }, next: { transform: 'translate3d(100%, 0, -800px)' } }, { prev: { transform: 'translate3d(-50%, 0, -800px) rotateY(80deg)' }, next: { transform: 'translate3d(50%, 0, -800px) rotateY(-80deg)' } }, { prev: { transform: 'translate3d(-100%, 0, -800px) rotateY(-120deg)' }, next: { transform: 'translate3d(100%, 0, -800px) rotateY(120deg)' } }, { prev: { transform: 'translate3d(-50%, 50%, -800px) rotateZ(-14deg)', opacity: 0 }, next: { transform: 'translate3d(50%, 50%, -800px) rotateZ(14deg)', opacity: 0 } }, { prev: { transform: 'translateZ(-800px) rotate3d(0, -1, 0, 90deg)', opacity: 0 }, next: { transform: 'translateZ(-800px) rotate3d(0, 1, 0, 90deg)', opacity: 0 }, current: { transitionDelay: '700ms' } } ], u = ref(), f = I => { l.activeIndex != I && (c(), clearTimeout(u.value), m(l.activeIndex, I), (l.activeIndex = I), (u.value = setTimeout( () => { const V = s.itemList[I]; V && (V.type == 'MUSIC' && (n.model = !0), V.type === 'SONG' && (clearTimeout(n.timer), e.destroyAll()), V.type === 'VIDEO' && (clearTimeout(n.timer), e.destroyAll())); }, n.isAnimation ? 800 : 0 ))); }, m = (I, V) => { const D = s.itemList[I], N = s.itemList[V]; if (N) { if (N.knowledgePointId != D.knowledgePointId) { n.isAnimation = !0; return; } const $ = D.videoEle, O = N.videoEle; ($ && $.duration < 8 && I < V) || (O && O.duration < 8 && I > V) ? (n.isAnimation = !1) : (n.isAnimation = !0); } else n.isAnimation = !((D == null ? void 0 : D.adviseStudyTimeSecond) < 8); }, d = I => { f(I === 'up' ? l.activeIndex - 1 : l.activeIndex + 1); }, E = () => { var V, D; const I = s.itemList[l.activeIndex]; (I == null ? void 0 : I.type) == 'VIDEO' && !((V = I.videoEle) != null && V.paused) && S(), (I == null ? void 0 : I.type) == 'SONG' && !((D = I.audioEle) != null && D.paused) && S(); }; document.body.addEventListener('keyup', I => { if (I.code === 'ArrowUp') { if (l.activeIndex === 0) return; d('up'); } else if (I.code === 'ArrowDown') { if (l.activeIndex === s.itemList.length - 1) return; d('down'); } }); const T = reactive({ type: '', penShow: !1 }), x = I => { var D, N; const V = s.itemList[l.activeIndex]; switch ( (V.type === 'VIDEO' && V.videoEle && V.videoEle.pause(), V.type === 'SONG' && V.audioEle && V.audioEle.stop(), V.type === 'MUSIC' && ((N = (D = V.iframeRef) == null ? void 0 : D.contentWindow) == null || N.postMessage({ api: 'setPlayState' }, '*')), p(), (l.toolOpen = !1), (T.type = I.type), I.type) ) { case 'pen': T.penShow = !0; break; case 'whiteboard': T.penShow = !0; } }, _ = () => { (T.type = 'init'), P(); }; return ( onMounted(() => { window.addEventListener('message', o); }), () => { let I; return createVNode( 'div', { id: 'playContent', class: styles$8.playContent }, [ createVNode( 'div', { onClick: () => { clearTimeout(n.timer), (n.model = !n.model), Object.values(s.videoRefs).map(V => V.toggleHideControl(n.model) ), Object.values(s.audioRefs).map(V => V.toggleHideControl(n.model) ); } }, [ createVNode( 'div', { class: styles$8.coursewarePlay, style: { width: t.width }, onClick: V => { V.stopPropagation(), S(); } }, [ createVNode('div', { class: styles$8.wraps }, [ s.itemList.map((V, D) => { const N = V.isRender || Math.abs(l.activeIndex - D) < 2, $ = Math.abs(l.activeIndex - D) > 4; return ( N && (V.isRender = !0), N ? createVNode( 'div', { key: 'index' + D, class: [ styles$8.itemDiv, l.activeIndex === D && styles$8.itemActive, n.isAnimation && styles$8.acitveAnimation, Math.abs(l.activeIndex - D) < 2 ? styles$8.show : styles$8.hide ], style: D < l.activeIndex ? A[y.value].prev : D > l.activeIndex ? A[y.value].next : {}, onClick: O => { if ( (O.stopPropagation(), clearTimeout(n.timer), Date.now() - n.nowTime < 300) ) { b(V); return; } (n.nowTime = Date.now()), (n.timer = setTimeout(() => { (n.model = !n.model), Object.values(s.videoRefs).map(B => B.toggleHideControl(n.model) ), Object.values(s.audioRefs).map(B => B.toggleHideControl(n.model) ), n.model && S(); }, 300)); } }, [ V.type === 'VIDEO' ? createVNode(Fragment, null, [ createVNode( VideoPlay, { ref: O => (s.videoRefs[D] = O), item: V, isEmtry: $, onLoadedmetadata: O => { (V.videoEle = O), (V.isprepare = !0); }, onTogglePlay: O => { (V.autoPlay = !1), O || l.open ? clearTimeout(n.timer) : S(); }, onEnded: () => { const O = l.activeIndex + 1; O < s.itemList.length && f(O); }, onReset: () => { var O; ((O = V.videoEle) != null && O.paused) || S(); } }, null ), createVNode( Transition, { name: 'van-fade' }, { default: () => [ !V.isprepare && createVNode( 'div', { class: styles$8.loadWrap }, [ createVNode( Vue3Lottie, { animationData: playLoadData }, null ) ] ) ] } ) ]) : V.type === 'IMG' ? createVNode( 'img', { src: V.content }, null ) : V.type === 'SONG' ? createVNode( AudioPay, { item: V, ref: O => (s.audioRefs[D] = O), onLoadedmetadata: O => { (V.audioEle = O), (V.isprepare = !0); }, onTogglePlay: O => { (V.autoPlay = !1), O || l.open ? clearTimeout(n.timer) : S(); }, onEnded: () => { const O = l.activeIndex + 1; O < s.itemList.length && f(O); }, onReset: () => { var O; ((O = V.audioEle) != null && O.paused) || S(); } }, null ) : createVNode( MusicScore, { activeModel: n.model, 'data-vid': V.id, music: V, onSetIframe: O => { V.iframeRef = O; } }, null ) ] ) : null ); }) ]), createVNode( Transition, { name: 'right' }, { default: () => [ n.model && createVNode( 'div', { class: styles$8.rightFixedBtns, onClick: V => { V.stopPropagation(), clearTimeout(n.timer); } }, [ createVNode( 'div', { class: [ styles$8.fullBtn, l.activeIndex === 0 ? styles$8.btnsDisabled : '' ], onClick: () => { l.activeIndex !== 0 && d('up'); } }, [createVNode('img', { src: iconUp }, null)] ), createVNode( 'div', { class: [styles$8.fullBtn, styles$8.point], onClick: () => (l.open = !0) }, [createVNode('img', { src: iconMenu }, null)] ), createVNode( 'div', { class: [ styles$8.fullBtn, l.activeIndex === s.itemList.length - 1 ? styles$8.btnsDisabled : '' ], onClick: () => { l.activeIndex !== s.itemList.length - 1 && d('down'); } }, [createVNode('img', { src: iconDown }, null)] ) ] ) ] } ) ] ) ] ), createVNode( 'div', { class: [ styles$8.assignHomework, n.model ? '' : styles$8.sectionAnimateUp ], onClick: () => (s.modelAttendStatus = !0) }, [createVNode('img', { src: iconAssignHomework }, null)] ), createVNode( 'div', { class: [ styles$8.switchDisplaySection, n.model ? '' : styles$8.sectionAnimate ] }, [ createVNode( NTooltip, { trigger: 'hover' }, { trigger: () => createVNode( 'div', { class: styles$8.displayBtn, onClick: () => x({ type: 'pen', icon: iconNote, name: '批注' }) }, [createVNode('img', { src: iconNote }, null)] ), default: () => '批注' } ), createVNode( NTooltip, { trigger: 'hover' }, { trigger: () => createVNode( 'div', { class: styles$8.displayBtn, onClick: () => x({ type: 'whiteboard', icon: iconWhiteboard, name: '白板' }) }, [createVNode('img', { src: iconWhiteboard }, null)] ), default: () => '白板' } ) ] ), createVNode( NDrawer, { show: l.open, 'onUpdate:show': V => (l.open = V), class: styles$8.drawerContainer, onAfterLeave: E, showMask: !1 }, { default: () => [ createVNode( NDrawerContent, { title: '资源列表', closable: !0 }, _isSlot( (I = s.knowledgePointList.map((V, D) => createVNode( CardType, { item: V, isActive: l.activeIndex === D, isCollect: !1, onClick: N => { (l.open = !1), g(N.id); } }, null ) )) ) ? I : { default: () => [I] } ) ] } ), T.penShow && createVNode( Pen, { show: T.type === 'pen' || T.type === 'whiteboard', type: T.type, close: () => _() }, null ), createVNode( NModal, { show: s.modelAttendStatus, 'onUpdate:show': V => (s.modelAttendStatus = V), preset: 'card', class: styles$8.attendClassModal, title: '课后训练' }, { default: () => [ createVNode('div', { class: styles$8.modelAttendContent }, [ createTextVNode('本节课已设置课后训练,是否布置?') ]), createVNode( NSpace, { class: styles$8.modelAttendBtnGroup }, { default: () => [ createVNode( NButton, { type: 'default', round: !0, onClick: () => { (s.modelAttendStatus = !1), window.close(); } }, { default: () => [createTextVNode('暂不布置')] } ), createVNode( NButton, { type: 'primary', round: !0, onClick: () => { (s.modelTrainStatus = !0), (s.modelAttendStatus = !1); } }, { default: () => [createTextVNode('布置')] } ) ] } ) ] } ), createVNode( NModal, { show: s.modelTrainStatus, 'onUpdate:show': V => (s.modelTrainStatus = V), preset: 'card', class: [styles$8.attendClassModal, styles$8.trainClassModal], title: '训练设置' }, { default: () => [ createVNode( TrainSettings, { onClose: () => (s.modelTrainStatus = !1) }, null ) ] } ) ] ); } ); } }); export { index as default };