1"undefined" != typeof navigator && 2 (function (t, e) { 3 "object" == typeof exports && "undefined" != typeof module 4 ? (module.exports = e()) 5 : "function" == typeof define && define.amd 6 ? define(e) 7 : ((t = 8 "undefined" != typeof globalThis ? globalThis : t || self).lottie = 9 e()); 10 })(this, function () { 11 "use strict"; 12 var svgNS = "http://www.w3.org/2000/svg", 13 locationHref = "", 14 _useWebWorker = !1, 15 initialDefaultFrame = -999999, 16 setWebWorker = function (t) { 17 _useWebWorker = !!t; 18 }, 19 getWebWorker = function () { 20 return _useWebWorker; 21 }, 22 setLocationHref = function (t) { 23 locationHref = t; 24 }, 25 getLocationHref = function () { 26 return locationHref; 27 }; 28 function createTag(t) { 29 return document.createElement(t); 30 } 31 function extendPrototype(t, e) { 32 var r, 33 i, 34 s = t.length; 35 for (r = 0; r < s; r += 1) 36 for (var a in (i = t[r].prototype)) 37 Object.prototype.hasOwnProperty.call(i, a) && (e.prototype[a] = i[a]); 38 } 39 function getDescriptor(t, e) { 40 return Object.getOwnPropertyDescriptor(t, e); 41 } 42 function createProxyFunction(t) { 43 function e() {} 44 return (e.prototype = t), e; 45 } 46 var audioControllerFactory = (function () { 47 function t(t) { 48 (this.audios = []), 49 (this.audioFactory = t), 50 (this._volume = 1), 51 (this._isMuted = !1); 52 } 53 return ( 54 (t.prototype = { 55 addAudio: function (t) { 56 this.audios.push(t); 57 }, 58 pause: function () { 59 var t, 60 e = this.audios.length; 61 for (t = 0; t < e; t += 1) this.audios[t].pause(); 62 }, 63 resume: function () { 64 var t, 65 e = this.audios.length; 66 for (t = 0; t < e; t += 1) this.audios[t].resume(); 67 }, 68 setRate: function (t) { 69 var e, 70 r = this.audios.length; 71 for (e = 0; e < r; e += 1) this.audios[e].setRate(t); 72 }, 73 createAudio: function (t) { 74 return this.audioFactory 75 ? this.audioFactory(t) 76 : window.Howl 77 ? new window.Howl({ src: [t] }) 78 : { 79 isPlaying: !1, 80 play: function () { 81 this.isPlaying = !0; 82 }, 83 seek: function () { 84 this.isPlaying = !1; 85 }, 86 playing: function () {}, 87 rate: function () {}, 88 setVolume: function () {}, 89 }; 90 }, 91 setAudioFactory: function (t) { 92 this.audioFactory = t; 93 }, 94 setVolume: function (t) { 95 (this._volume = t), this._updateVolume(); 96 }, 97 mute: function () { 98 (this._isMuted = !0), this._updateVolume(); 99 }, 100 unmute: function () { 101 (this._isMuted = !1), this._updateVolume(); 102 }, 103 getVolume: function () { 104 return this._volume; 105 }, 106 _updateVolume: function () { 107 var t, 108 e = this.audios.length; 109 for (t = 0; t < e; t += 1) 110 this.audios[t].volume(this._volume * (this._isMuted ? 0 : 1)); 111 }, 112 }), 113 function () { 114 return new t(); 115 } 116 ); 117 })(), 118 createTypedArray = (function () { 119 function t(t, e) { 120 var r, 121 i = 0, 122 s = []; 123 switch (t) { 124 case "int16": 125 case "uint8c": 126 r = 1; 127 break; 128 default: 129 r = 1.1; 130 } 131 for (i = 0; i < e; i += 1) s.push(r); 132 return s; 133 } 134 return "function" == typeof Uint8ClampedArray && 135 "function" == typeof Float32Array 136 ? function (e, r) { 137 return "float32" === e 138 ? new Float32Array(r) 139 : "int16" === e 140 ? new Int16Array(r) 141 : "uint8c" === e 142 ? new Uint8ClampedArray(r) 143 : t(e, r); 144 } 145 : t; 146 })(); 147 function createSizedArray(t) { 148 return Array.apply(null, { length: t }); 149 } 150 function _typeof$6(t) { 151 return ( 152 (_typeof$6 = 153 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 154 ? function (t) { 155 return typeof t; 156 } 157 : function (t) { 158 return t && 159 "function" == typeof Symbol && 160 t.constructor === Symbol && 161 t !== Symbol.prototype 162 ? "symbol" 163 : typeof t; 164 }), 165 _typeof$6(t) 166 ); 167 } 168 var subframeEnabled = !0, 169 expressionsPlugin = null, 170 expressionsInterfaces = null, 171 idPrefix$1 = "", 172 isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), 173 _shouldRoundValues = !1, 174 bmPow = Math.pow, 175 bmSqrt = Math.sqrt, 176 bmFloor = Math.floor, 177 bmMax = Math.max, 178 bmMin = Math.min, 179 BMMath = {}; 180 function ProjectInterface$1() { 181 return {}; 182 } 183 !(function () { 184 var t, 185 e = [ 186 "abs", 187 "acos", 188 "acosh", 189 "asin", 190 "asinh", 191 "atan", 192 "atanh", 193 "atan2", 194 "ceil", 195 "cbrt", 196 "expm1", 197 "clz32", 198 "cos", 199 "cosh", 200 "exp", 201 "floor", 202 "fround", 203 "hypot", 204 "imul", 205 "log", 206 "log1p", 207 "log2", 208 "log10", 209 "max", 210 "min", 211 "pow", 212 "random", 213 "round", 214 "sign", 215 "sin", 216 "sinh", 217 "sqrt", 218 "tan", 219 "tanh", 220 "trunc", 221 "E", 222 "LN10", 223 "LN2", 224 "LOG10E", 225 "LOG2E", 226 "PI", 227 "SQRT1_2", 228 "SQRT2", 229 ], 230 r = e.length; 231 for (t = 0; t < r; t += 1) BMMath[e[t]] = Math[e[t]]; 232 })(), 233 (BMMath.random = Math.random), 234 (BMMath.abs = function (t) { 235 if ("object" === _typeof$6(t) && t.length) { 236 var e, 237 r = createSizedArray(t.length), 238 i = t.length; 239 for (e = 0; e < i; e += 1) r[e] = Math.abs(t[e]); 240 return r; 241 } 242 return Math.abs(t); 243 }); 244 var defaultCurveSegments = 150, 245 degToRads = Math.PI / 180, 246 roundCorner = 0.5519; 247 function roundValues(t) { 248 _shouldRoundValues = !!t; 249 } 250 function bmRnd(t) { 251 return _shouldRoundValues ? Math.round(t) : t; 252 } 253 function styleDiv(t) { 254 (t.style.position = "absolute"), 255 (t.style.top = 0), 256 (t.style.left = 0), 257 (t.style.display = "block"), 258 (t.style.transformOrigin = "0 0"), 259 (t.style.webkitTransformOrigin = "0 0"), 260 (t.style.backfaceVisibility = "visible"), 261 (t.style.webkitBackfaceVisibility = "visible"), 262 (t.style.transformStyle = "preserve-3d"), 263 (t.style.webkitTransformStyle = "preserve-3d"), 264 (t.style.mozTransformStyle = "preserve-3d"); 265 } 266 function BMEnterFrameEvent(t, e, r, i) {
267 (this.type = t), 268 (this.currentTime = e), 269 (this.totalTime = r), 270 (this.direction = i < 0 ? -1 : 1); 271 } 272 function BMCompleteEvent(t, e) { 273 (this.type = t), (this.direction = e < 0 ? -1 : 1); 274 } 275 function BMCompleteLoopEvent(t, e, r, i) { 276 (this.type = t), 277 (this.currentLoop = r), 278 (this.totalLoops = e), 279 (this.direction = i < 0 ? -1 : 1); 280 } 281 function BMSegmentStartEvent(t, e, r) { 282 (this.type = t), (this.firstFrame = e), (this.totalFrames = r); 283 } 284 function BMDestroyEvent(t, e) { 285 (this.type = t), (this.target = e); 286 } 287 function BMRenderFrameErrorEvent(t, e) { 288 (this.type = "renderFrameError"), 289 (this.nativeError = t), 290 (this.currentTime = e); 291 } 292 function BMConfigErrorEvent(t) { 293 (this.type = "configError"), (this.nativeError = t); 294 } 295 function BMAnimationConfigErrorEvent(t, e) { 296 (this.type = t), (this.nativeError = e); 297 } 298 var createElementID = 299 ((_count = 0), 300 function () { 301 return idPrefix$1 + "__lottie_element_" + (_count += 1); 302 }), 303 _count; 304 function HSVtoRGB(t, e, r) { 305 var i, s, a, n, o, h, l, p; 306 switch ( 307 ((h = r * (1 - e)), 308 (l = r * (1 - (o = 6 * t - (n = Math.floor(6 * t))) * e)), 309 (p = r * (1 - (1 - o) * e)), 310 n % 6) 311 ) { 312 case 0: 313 (i = r), (s = p), (a = h); 314 break; 315 case 1: 316 (i = l), (s = r), (a = h); 317 break; 318 case 2: 319 (i = h), (s = r), (a = p); 320 break; 321 case 3: 322 (i = h), (s = l), (a = r); 323 break; 324 case 4: 325 (i = p), (s = h), (a = r); 326 break; 327 case 5: 328 (i = r), (s = h), (a = l); 329 } 330 return [i, s, a]; 331 } 332 function RGBtoHSV(t, e, r) { 333 var i, 334 s = Math.max(t, e, r), 335 a = Math.min(t, e, r), 336 n = s - a, 337 o = 0 === s ? 0 : n / s, 338 h = s / 255; 339 switch (s) { 340 case a: 341 i = 0; 342 break; 343 case t: 344 (i = e - r + n * (e < r ? 6 : 0)), (i /= 6 * n); 345 break; 346 case e: 347 (i = r - t + 2 * n), (i /= 6 * n); 348 break; 349 case r: 350 (i = t - e + 4 * n), (i /= 6 * n); 351 } 352 return [i, o, h]; 353 } 354 function addSaturationToRGB(t, e) { 355 var r = RGBtoHSV(255 * t[0], 255 * t[1], 255 * t[2]); 356 return ( 357 (r[1] += e), 358 r[1] > 1 ? (r[1] = 1) : r[1] <= 0 && (r[1] = 0), 359 HSVtoRGB(r[0], r[1], r[2]) 360 ); 361 } 362 function addBrightnessToRGB(t, e) { 363 var r = RGBtoHSV(255 * t[0], 255 * t[1], 255 * t[2]); 364 return ( 365 (r[2] += e), 366 r[2] > 1 ? (r[2] = 1) : r[2] < 0 && (r[2] = 0), 367 HSVtoRGB(r[0], r[1], r[2]) 368 ); 369 } 370 function addHueToRGB(t, e) { 371 var r = RGBtoHSV(255 * t[0], 255 * t[1], 255 * t[2]); 372 return ( 373 (r[0] += e / 360), 374 r[0] > 1 ? (r[0] -= 1) : r[0] < 0 && (r[0] += 1), 375 HSVtoRGB(r[0], r[1], r[2]) 376 ); 377 } 378 var rgbToHex = (function () { 379 var t, 380 e, 381 r = []; 382 for (t = 0; t < 256; t += 1) 383 (e = t.toString(16)), (r[t] = 1 === e.length ? "0" + e : e); 384 return function (t, e, i) { 385 return ( 386 t < 0 && (t = 0), 387 e < 0 && (e = 0), 388 i < 0 && (i = 0), 389 "#" + r[t] + r[e] + r[i] 390 ); 391 }; 392 })(), 393 setSubframeEnabled = function (t) { 394 subframeEnabled = !!t; 395 }, 396 getSubframeEnabled = function () { 397 return subframeEnabled; 398 }, 399 setExpressionsPlugin = function (t) { 400 expressionsPlugin = t; 401 }, 402 getExpressionsPlugin = function () { 403 return expressionsPlugin; 404 }, 405 setExpressionInterfaces = function (t) { 406 expressionsInterfaces = t; 407 }, 408 getExpressionInterfaces = function () { 409 return expressionsInterfaces; 410 }, 411 setDefaultCurveSegments = function (t) { 412 defaultCurveSegments = t; 413 }, 414 getDefaultCurveSegments = function () { 415 return defaultCurveSegments; 416 }, 417 setIdPrefix = function (t) { 418 idPrefix$1 = t; 419 }, 420 getIdPrefix = function () { 421 return idPrefix$1; 422 }; 423 function createNS(t) { 424 return document.createElementNS(svgNS, t); 425 } 426 function _typeof$5(t) { 427 return ( 428 (_typeof$5 = 429 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 430 ? function (t) { 431 return typeof t; 432 } 433 : function (t) { 434 return t && 435 "function" == typeof Symbol && 436 t.constructor === Symbol && 437 t !== Symbol.prototype 438 ? "symbol" 439 : typeof t; 440 }), 441 _typeof$5(t) 442 ); 443 } 444 var dataManager = (function () { 445 var t, 446 e, 447 r = 1, 448 i = [], 449 s = { 450 onmessage: function () {}, 451 postMessage: function (e) { 452 t({ data: e }); 453 }, 454 }, 455 a = { 456 postMessage: function (t) { 457 s.onmessage({ data: t }); 458 }, 459 }; 460 function n() { 461 e || 462 ((e = (function (e) { 463 if (window.Worker && window.Blob && getWebWorker()) { 464 var r = new Blob( 465 ["var _workerSelf = self; self.onmessage = ", e.toString()], 466 { type: "text/javascript" } 467 ), 468 i = URL.createObjectURL(r); 469 return new Worker(i); 470 } 471 return (t = e), s; 472 })(function (t) { 473 if ( 474 (a.dataManager || 475 (a.dataManager = (function () { 476 function t(s, a) { 477 var n, 478 o, 479 h, 480 l, 481 p, 482 m, 483 c = s.length; 484 for (o = 0; o < c; o += 1) 485 if ("ks" in (n = s[o]) && !n.completed) { 486 if (((n.completed = !0), n.hasMask)) { 487 var d = n.masksProperties;
488 for (l = d.length, h = 0; h < l; h += 1) 489 if (d[h].pt.k.i) i(d[h].pt.k); 490 else 491 for (m = d[h].pt.k.length, p = 0; p < m; p += 1) 492 d[h].pt.k[p].s && i(d[h].pt.k[p].s[0]), 493 d[h].pt.k[p].e && i(d[h].pt.k[p].e[0]); 494 } 495 0 === n.ty 496 ? ((n.layers = e(n.refId, a)), t(n.layers, a)) 497 : 4 === n.ty 498 ? r(n.shapes) 499 : 5 === n.ty && f(n); 500 } 501 } 502 function e(t, e) { 503 var r = (function (t, e) { 504 for (var r = 0, i = e.length; r < i; ) { 505 if (e[r].id === t) return e[r]; 506 r += 1; 507 } 508 return null; 509 })(t, e); 510 return r 511 ? r.layers.__used 512 ? JSON.parse(JSON.stringify(r.layers)) 513 : ((r.layers.__used = !0), r.layers) 514 : null; 515 } 516 function r(t) { 517 var e, s, a; 518 for (e = t.length - 1; e >= 0; e -= 1) 519 if ("sh" === t[e].ty) 520 if (t[e].ks.k.i) i(t[e].ks.k); 521 else 522 for (a = t[e].ks.k.length, s = 0; s < a; s += 1) 523 t[e].ks.k[s].s && i(t[e].ks.k[s].s[0]), 524 t[e].ks.k[s].e && i(t[e].ks.k[s].e[0]); 525 else "gr" === t[e].ty && r(t[e].it); 526 } 527 function i(t) { 528 var e, 529 r = t.i.length; 530 for (e = 0; e < r; e += 1) 531 (t.i[e][0] += t.v[e][0]), 532 (t.i[e][1] += t.v[e][1]), 533 (t.o[e][0] += t.v[e][0]), 534 (t.o[e][1] += t.v[e][1]); 535 } 536 function s(t, e) { 537 var r = e ? e.split(".") : [100, 100, 100]; 538 return ( 539 t[0] > r[0] || 540 (!(r[0] > t[0]) && 541 (t[1] > r[1] || 542 (!(r[1] > t[1]) && 543 (t[2] > r[2] || (!(r[2] > t[2]) && null))))) 544 ); 545 } 546 var a, 547 n = (function () { 548 var t = [4, 4, 14]; 549 function e(t) { 550 var e, 551 r, 552 i, 553 s = t.length; 554 for (e = 0; e < s; e += 1) 555 5 === t[e].ty && 556 ((i = void 0), 557 (i = (r = t[e]).t.d), 558 (r.t.d = { k: [{ s: i, t: 0 }] })); 559 } 560 return function (r) { 561 if (s(t, r.v) && (e(r.layers), r.assets)) { 562 var i, 563 a = r.assets.length; 564 for (i = 0; i < a; i += 1) 565 r.assets[i].layers && e(r.assets[i].layers); 566 } 567 }; 568 })(), 569 o = 570 ((a = [4, 7, 99]), 571 function (t) { 572 if (t.chars && !s(a, t.v)) { 573 var e, 574 i = t.chars.length; 575 for (e = 0; e < i; e += 1) { 576 var n = t.chars[e]; 577 n.data && 578 n.data.shapes && 579 (r(n.data.shapes), 580 (n.data.ip = 0), 581 (n.data.op = 99999), 582 (n.data.st = 0), 583 (n.data.sr = 1), 584 (n.data.ks = { 585 p: { k: [0, 0], a: 0 }, 586 s: { k: [100, 100], a: 0 }, 587 a: { k: [0, 0], a: 0 }, 588 r: { k: 0, a: 0 }, 589 o: { k: 100, a: 0 }, 590 }), 591 t.chars[e].t || 592 (n.data.shapes.push({ ty: "no" }), 593 n.data.shapes[0].it.push({ 594 p: { k: [0, 0], a: 0 }, 595 s: { k: [100, 100], a: 0 }, 596 a: { k: [0, 0], a: 0 }, 597 r: { k: 0, a: 0 }, 598 o: { k: 100, a: 0 }, 599 sk: { k: 0, a: 0 }, 600 sa: { k: 0, a: 0 }, 601 ty: "tr", 602 }))); 603 } 604 } 605 }), 606 h = (function () { 607 var t = [5, 7, 15]; 608 function e(t) { 609 var e, 610 r, 611 i = t.length; 612 for (e = 0; e < i; e += 1) 613 5 === t[e].ty && 614 ((r = void 0), 615 "number" == typeof (r = t[e].t.p).a && 616 (r.a = { a: 0, k: r.a }), 617 "number" == typeof r.p && 618 (r.p = { a: 0, k: r.p }), 619 "number" == typeof r.r && 620 (r.r = { a: 0, k: r.r })); 621 } 622 return function (r) { 623 if (s(t, r.v) && (e(r.layers), r.assets)) { 624 var i, 625 a = r.assets.length; 626 for (i = 0; i < a; i += 1) 627 r.assets[i].layers && e(r.assets[i].layers); 628 } 629 }; 630 })(), 631 l = (function () { 632 var t = [4, 1, 9]; 633 function e(t) { 634 var r, 635 i, 636 s, 637 a = t.length; 638 for (r = 0; r < a; r += 1) 639 if ("gr" === t[r].ty) e(t[r].it); 640 else if ("fl" === t[r].ty || "st" === t[r].ty) 641 if (t[r].c.k && t[r].c.k[0].i) 642 for (s = t[r].c.k.length, i = 0; i < s; i += 1) 643 t[r].c.k[i].s && 644 ((t[r].c.k[i].s[0] /= 255), 645 (t[r].c.k[i].s[1] /= 255), 646 (t[r].c.k[i].s[2] /= 255), 647 (t[r].c.k[i].s[3] /= 255)), 648 t[r].c.k[i].e && 649 ((t[r].c.k[i].e[0] /= 255), 650 (t[r].c.k[i].e[1] /= 255), 651 (t[r].c.k[i].e[2] /= 255), 652 (t[r].c.k[i].e[3] /= 255)); 653 else 654 (t[r].c.k[0] /= 255), 655 (t[r].c.k[1] /= 255), 656 (t[r].c.k[2] /= 255), 657 (t[r].c.k[3] /= 255); 658 } 659 function r(t) { 660 var r, 661 i = t.length; 662 for (r = 0; r < i; r += 1) 663 4 === t[r].ty && e(t[r].shapes); 664 } 665 return function (e) {
666 if (s(t, e.v) && (r(e.layers), e.assets)) { 667 var i, 668 a = e.assets.length; 669 for (i = 0; i < a; i += 1) 670 e.assets[i].layers && r(e.assets[i].layers); 671 } 672 }; 673 })(), 674 p = (function () { 675 var t = [4, 4, 18]; 676 function e(t) { 677 var r, i, s; 678 for (r = t.length - 1; r >= 0; r -= 1) 679 if ("sh" === t[r].ty) 680 if (t[r].ks.k.i) t[r].ks.k.c = t[r].closed; 681 else 682 for (s = t[r].ks.k.length, i = 0; i < s; i += 1) 683 t[r].ks.k[i].s && 684 (t[r].ks.k[i].s[0].c = t[r].closed), 685 t[r].ks.k[i].e && 686 (t[r].ks.k[i].e[0].c = t[r].closed); 687 else "gr" === t[r].ty && e(t[r].it); 688 } 689 function r(t) { 690 var r, 691 i, 692 s, 693 a, 694 n, 695 o, 696 h = t.length; 697 for (i = 0; i < h; i += 1) { 698 if ((r = t[i]).hasMask) { 699 var l = r.masksProperties; 700 for (a = l.length, s = 0; s < a; s += 1) 701 if (l[s].pt.k.i) l[s].pt.k.c = l[s].cl; 702 else 703 for ( 704 o = l[s].pt.k.length, n = 0; 705 n < o; 706 n += 1 707 ) 708 l[s].pt.k[n].s && 709 (l[s].pt.k[n].s[0].c = l[s].cl), 710 l[s].pt.k[n].e && 711 (l[s].pt.k[n].e[0].c = l[s].cl); 712 } 713 4 === r.ty && e(r.shapes); 714 } 715 } 716 return function (e) { 717 if (s(t, e.v) && (r(e.layers), e.assets)) { 718 var i, 719 a = e.assets.length; 720 for (i = 0; i < a; i += 1) 721 e.assets[i].layers && r(e.assets[i].layers); 722 } 723 }; 724 })(); 725 function f(t) { 726 0 === t.t.a.length && t.t.p; 727 } 728 var m = { 729 completeData: function (r) { 730 r.__complete || 731 (l(r), 732 n(r), 733 o(r), 734 h(r), 735 p(r), 736 t(r.layers, r.assets), 737 (function (r, i) { 738 if (r) { 739 var s = 0, 740 a = r.length; 741 for (s = 0; s < a; s += 1) 742 1 === r[s].t && 743 ((r[s].data.layers = e(r[s].data.refId, i)), 744 t(r[s].data.layers, i)); 745 } 746 })(r.chars, r.assets), 747 (r.__complete = !0)); 748 }, 749 }; 750 return ( 751 (m.checkColors = l), 752 (m.checkChars = o), 753 (m.checkPathProperties = h), 754 (m.checkShapes = p), 755 (m.completeLayers = t), 756 m 757 ); 758 })()), 759 a.assetLoader || 760 (a.assetLoader = (function () { 761 function t(t) { 762 var e = t.getResponseHeader("content-type"); 763 return (e && 764 "json" === t.responseType && 765 -1 !== e.indexOf("json")) || 766 (t.response && "object" === _typeof$5(t.response)) 767 ? t.response 768 : t.response && "string" == typeof t.response 769 ? JSON.parse(t.response) 770 : t.responseText 771 ? JSON.parse(t.responseText) 772 : null; 773 } 774 return { 775 load: function (e, r, i, s) { 776 var a, 777 n = new XMLHttpRequest(); 778 try { 779 n.responseType = "json"; 780 } catch (t) {} 781 n.onreadystatechange = function () { 782 if (4 === n.readyState) 783 if (200 === n.status) (a = t(n)), i(a); 784 else 785 try { 786 (a = t(n)), i(a); 787 } catch (t) { 788 s && s(t); 789 } 790 }; 791 try { 792 n.open(["G", "E", "T"].join(""), e, !0); 793 } catch (t) { 794 n.open(["G", "E", "T"].join(""), r + "/"
794+ e, !0); 795 } 796 n.send(); 797 }, 798 }; 799 })()), 800 "loadAnimation" === t.data.type) 801 ) 802 a.assetLoader.load( 803 t.data.path, 804 t.data.fullPath, 805 function (e) { 806 a.dataManager.completeData(e), 807 a.postMessage({ 808 id: t.data.id, 809 payload: e, 810 status: "success", 811 }); 812 }, 813 function () { 814 a.postMessage({ id: t.data.id, status: "error" }); 815 } 816 ); 817 else if ("complete" === t.data.type) { 818 var e = t.data.animation; 819 a.dataManager.completeData(e), 820 a.postMessage({ 821 id: t.data.id, 822 payload: e, 823 status: "success", 824 }); 825 } else 826 "loadData" === t.data.type && 827 a.assetLoader.load( 828 t.data.path, 829 t.data.fullPath, 830 function (e) { 831 a.postMessage({ 832 id: t.data.id, 833 payload: e, 834 status: "success", 835 }); 836 }, 837 function () { 838 a.postMessage({ id: t.data.id, status: "error" }); 839 } 840 ); 841 })), 842 (e.onmessage = function (t) { 843 var e = t.data, 844 r = e.id, 845 s = i[r]; 846 (i[r] = null), 847 "success" === e.status 848 ? s.onComplete(e.payload) 849 : s.onError && s.onError(); 850 })); 851 } 852 function o(t, e) { 853 var s = "processId_" + (r += 1); 854 return (i[s] = { onComplete: t, onError: e }), s; 855 } 856 return { 857 loadAnimation: function (t, r, i) { 858 n(); 859 var s = o(r, i); 860 e.postMessage({ 861 type: "loadAnimation", 862 path: t, 863 fullPath: window.location.origin + window.location.pathname, 864 id: s, 865 }); 866 }, 867 loadData: function (t, r, i) { 868 n(); 869 var s = o(r, i); 870 e.postMessage({ 871 type: "loadData", 872 path: t, 873 fullPath: window.location.origin + window.location.pathname, 874 id: s, 875 }); 876 }, 877 completeAnimation: function (t, r, i) { 878 n(); 879 var s = o(r, i); 880 e.postMessage({ type: "complete", animation: t, id: s }); 881 }, 882 }; 883 })(), 884 ImagePreloader = (function () { 885 var t = (function () { 886 var t = createTag("canvas"); 887 (t.width = 1), (t.height = 1); 888 var e = t.getContext("2d"); 889 return (e.fillStyle = "rgba(0,0,0,0)"), e.fillRect(0, 0, 1, 1), t; 890 })(); 891 function e() { 892 (this.loadedAssets += 1), 893 this.loadedAssets === this.totalImages && 894 this.loadedFootagesCount === this.totalFootages && 895 this.imagesLoadedCb && 896 this.imagesLoadedCb(null); 897 } 898 function r() { 899 (this.loadedFootagesCount += 1), 900 this.loadedAssets === this.totalImages && 901 this.loadedFootagesCount === this.totalFootages && 902 this.imagesLoadedCb && 903 this.imagesLoadedCb(null); 904 } 905 function i(t, e, r) { 906 var i = ""; 907 if (t.e) i = t.p; 908 else if (e) { 909 var s = t.p; 910 -1 !== s.indexOf("images/") && (s = s.split("/")[1]), (i = e + s); 911 } else (i = r), (i += t.u ? t.u : ""), (i += t.p); 912 return i; 913 } 914 function s(t) { 915 var e = 0, 916 r = setInterval( 917 function () { 918 (t.getBBox().width || e > 500) && 919 (this._imageLoaded(), clearInterval(r)), 920 (e += 1); 921 }.bind(this), 922 50 923 ); 924 } 925 function a(t) { 926 var e = { assetData: t }, 927 r = i(t, this.assetsPath, this.path); 928 return ( 929 dataManager.loadData( 930 r, 931 function (t) { 932 (e.img = t), this._footageLoaded(); 933 }.bind(this), 934 function () { 935 (e.img = {}), this._footageLoaded(); 936 }.bind(this) 937 ), 938 e 939 ); 940 } 941 function n() { 942 (this._imageLoaded = e.bind(this)), 943 (this._footageLoaded = r.bind(this)), 944 (this.testImageLoaded = s.bind(this)), 945 (this.createFootageData = a.bind(this)), 946 (this.assetsPath = ""), 947 (this.path = ""), 948 (this.totalImages = 0), 949 (this.totalFootages = 0), 950 (this.loadedAssets = 0), 951 (this.loadedFootagesCount = 0), 952 (this.imagesLoadedCb = null), 953 (this.images = []); 954 } 955 return ( 956 (n.prototype = { 957 loadAssets: function (t, e) { 958 var r; 959 this.imagesLoadedCb = e; 960 var i = t.length; 961 for (r = 0; r < i; r += 1) 962 t[r].layers || 963 (t[r].t && "seq" !== t[r].t 964 ? 3 === t[r].t && 965 ((this.totalFootages += 1), 966 this.images.push(this.createFootageData(t[r]))) 967 : ((this.totalImages += 1), 968 this.images.push(this._createImageData(t[r])))); 969 }, 970 setAssetsPath: function (t) { 971 this.assetsPath = t || ""; 972 }, 973 setPath: function (t) { 974 this.path = t || ""; 975 }, 976 loadedImages: function () { 977 return this.totalImages === this.loadedAssets; 978 }, 979 loadedFootages: function () { 980 return this.totalFootages === this.loadedFootagesCount; 981 }, 982 destroy: function () { 983 (this.imagesLoadedCb = null), (this.images.length = 0); 984 }, 985 getAsset: function (t) { 986 for (var e = 0, r = this.images.length; e < r; ) { 987 if (this.images[e].assetData === t) return this.images[e].img; 988 e += 1; 989 } 990 return null; 991 }, 992 createImgData: function (e) { 993 var r = i(e, this.assetsPath, this.path), 994 s = createTag("img"); 995 (s.crossOrigin = "anonymous"), 996 s.addEventListener("load", this._imageLoaded, !1), 997 s.addEventListener( 998 "error", 999 function () { 1000 (a.img = t), this._imageLoaded(); 1001 }.bind(this), 1002 !1 1003 ), 1004 (s.src = r); 1005 var a = { img: s, assetData: e }; 1006 return a; 1007 }, 1008 createImageData: function (e) { 1009 var r = i(e, this.assetsPath, this.path), 1010 s = createNS("image"); 1011 isSafari 1012 ? this.testImageLoaded(s) 1013 : s.addEventListener("load", this._imageLoaded, !1), 1014 s.addEventListener( 1015 "error", 1016 function () { 1017 (a.img = t), this._imageLoaded(); 1018 }.bind(this), 1019 !1 1020 ), 1021 s.setAttributeNS("http://www.w3.org/1999/xlink", "href", r), 1022 this._elementHelper.append 1023 ? this._elementHelper.append(s) 1024 : this._elementHelper.appendChild(s); 1025 var a = { img: s, assetData: e }; 1026 return a; 1027 }, 1028 imageLoaded: e, 1029 footageLoaded: r,
1030 setCacheType: function (t, e) { 1031 "svg" === t 1032 ? ((this._elementHelper = e), 1033 (this._createImageData = this.createImageData.bind(this))) 1034 : (this._createImageData = this.createImgData.bind(this)); 1035 }, 1036 }), 1037 n 1038 ); 1039 })(); 1040 function BaseEvent() {} 1041 BaseEvent.prototype = { 1042 triggerEvent: function (t, e) { 1043 if (this._cbs[t]) 1044 for (var r = this._cbs[t], i = 0; i < r.length; i += 1) r[i](e); 1045 }, 1046 addEventListener: function (t, e) { 1047 return ( 1048 this._cbs[t] || (this._cbs[t] = []), 1049 this._cbs[t].push(e), 1050 function () { 1051 this.removeEventListener(t, e); 1052 }.bind(this) 1053 ); 1054 }, 1055 removeEventListener: function (t, e) { 1056 if (e) { 1057 if (this._cbs[t]) { 1058 for (var r = 0, i = this._cbs[t].length; r < i; ) 1059 this._cbs[t][r] === e && 1060 (this._cbs[t].splice(r, 1), (r -= 1), (i -= 1)), 1061 (r += 1); 1062 this._cbs[t].length || (this._cbs[t] = null); 1063 } 1064 } else this._cbs[t] = null; 1065 }, 1066 }; 1067 var markerParser = (function () { 1068 function t(t) { 1069 for ( 1070 var e, r = t.split("\r\n"), i = {}, s = 0, a = 0; 1071 a < r.length; 1072 a += 1 1073 ) 1074 2 === (e = r[a].split(":")).length && 1075 ((i[e[0]] = e[1].trim()), (s += 1)); 1076 if (0 === s) throw new Error(); 1077 return i; 1078 } 1079 return function (e) { 1080 for (var r = [], i = 0; i < e.length; i += 1) { 1081 var s = e[i], 1082 a = { time: s.tm, duration: s.dr }; 1083 try { 1084 a.payload = JSON.parse(e[i].cm); 1085 } catch (r) { 1086 try { 1087 a.payload = t(e[i].cm); 1088 } catch (t) { 1089 a.payload = { name: e[i].cm }; 1090 } 1091 } 1092 r.push(a); 1093 } 1094 return r; 1095 }; 1096 })(), 1097 ProjectInterface = (function () { 1098 function t(t) { 1099 this.compositions.push(t); 1100 } 1101 return function () { 1102 function e(t) { 1103 for (var e = 0, r = this.compositions.length; e < r; ) { 1104 if ( 1105 this.compositions[e].data && 1106 this.compositions[e].data.nm === t 1107 ) 1108 return ( 1109 this.compositions[e].prepareFrame && 1110 this.compositions[e].data.xt && 1111 this.compositions[e].prepareFrame(this.currentFrame), 1112 this.compositions[e].compInterface 1113 ); 1114 e += 1; 1115 } 1116 return null; 1117 } 1118 return ( 1119 (e.compositions = []), 1120 (e.currentFrame = 0), 1121 (e.registerComposition = t), 1122 e 1123 ); 1124 }; 1125 })(), 1126 renderers = {}, 1127 registerRenderer = function (t, e) { 1128 renderers[t] = e; 1129 }; 1130 function getRenderer(t) { 1131 return renderers[t]; 1132 } 1133 function _typeof$4(t) { 1134 return ( 1135 (_typeof$4 = 1136 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 1137 ? function (t) { 1138 return typeof t; 1139 } 1140 : function (t) { 1141 return t && 1142 "function" == typeof Symbol && 1143 t.constructor === Symbol && 1144 t !== Symbol.prototype 1145 ? "symbol" 1146 : typeof t; 1147 }), 1148 _typeof$4(t) 1149 ); 1150 } 1151 var AnimationItem = function () { 1152 (this._cbs = []), 1153 (this.name = ""), 1154 (this.path = ""), 1155 (this.isLoaded = !1), 1156 (this.currentFrame = 0), 1157 (this.currentRawFrame = 0), 1158 (this.firstFrame = 0), 1159 (this.totalFrames = 0), 1160 (this.frameRate = 0), 1161 (this.frameMult = 0), 1162 (this.playSpeed = 1), 1163 (this.playDirection = 1), 1164 (this.playCount = 0), 1165 (this.animationData = {}), 1166 (this.assets = []), 1167 (this.isPaused = !0), 1168 (this.autoplay = !1), 1169 (this.loop = !0), 1170 (this.renderer = null), 1171 (this.animationID = createElementID()), 1172 (this.assetsPath = ""), 1173 (this.timeCompleted = 0), 1174 (this.segmentPos = 0), 1175 (this.isSubframeEnabled = getSubframeEnabled()), 1176 (this.segments = []), 1177 (this._idle = !0), 1178 (this._completedLoop = !1), 1179 (this.projectInterface = ProjectInterface()), 1180 (this.imagePreloader = new ImagePreloader()), 1181 (this.audioController = audioControllerFactory()), 1182 (this.markers = []), 1183 (this.configAnimation = this.configAnimation.bind(this)), 1184 (this.onSetupError = this.onSetupError.bind(this)), 1185 (this.onSegmentComplete = this.onSegmentComplete.bind(this)), 1186 (this.drawnFrameEvent = new BMEnterFrameEvent("drawnFrame", 0, 0, 0)); 1187 }; 1188 extendPrototype([BaseEvent], AnimationItem), 1189 (AnimationItem.prototype.setParams = function (t) { 1190 (t.wrapper || t.container) && (this.wrapper = t.wrapper || t.container); 1191 var e = "svg"; 1192 t.animType ? (e = t.animType) : t.renderer && (e = t.renderer); 1193 var r = getRenderer(e); 1194 (this.renderer = new r(this, t.rendererSettings)), 1195 this.imagePreloader.setCacheType(e, this.renderer.globalData.defs), 1196 this.renderer.setProjectInterface(this.projectInterface), 1197 (this.animType = e), 1198 "" === t.loop || null === t.loop || void 0 === t.loop || !0 === t.loop 1199 ? (this.loop = !0) 1200 : !1 === t.loop 1201 ? (this.loop = !1) 1202 : (this.loop = parseInt(t.loop, 10)), 1203 (this.autoplay = !("autoplay" in t) || t.autoplay), 1204 (this.name = t.name ? t.name : ""), 1205 (this.autoloadSegments = 1206 !Object.prototype.hasOwnProperty.call(t, "autoloadSegments") || 1207 t.autoloadSegments), 1208 (this.assetsPath = t.assetsPath), 1209 (this.initialSegment = t.initialSegment), 1210 t.audioFactory && 1211 this.audioController.setAudioFactory(t.audioFactory), 1212 t.animationData 1213 ? this.setupAnimation(t.animationData) 1214 : t.path && 1215 (-1 !== t.path.lastIndexOf("\\") 1216 ? (this.path = t.path.substr(0, t.path.lastIndexOf("\\") + 1)) 1217 : (this.path = t.path.substr(0, t.path.lastIndexOf("/") + 1)), 1218 (this.fileName = t.path.substr(t.path.lastIndexOf("/") + 1)), 1219 (this.fileName = this.fileName.substr( 1220 0, 1221 this.fileName.lastIndexOf(".json") 1222 )), 1223 dataManager.loadAnimation( 1224 t.path, 1225 this.configAnimation, 1226 this.onSetupError 1227 )); 1228 }), 1229 (AnimationItem.prototype.onSetupError = function () { 1230 this.trigger("data_failed"); 1231 }), 1232 (AnimationItem.prototype.setupAnimation = function (t) { 1233 dataManager.completeAnimation(t, this.configAnimation); 1234 }), 1235 (AnimationItem.prototype.setData = function (t, e) { 1236 e && "object" !== _typeof$4(e) && (e = JSON.parse(e)); 1237 var r = { wrapper: t, animationData: e }, 1238 i = t.attributes; 1239 (r.path = i.getNamedItem("data-animation-path") 1240 ? i.getNamedItem("data-animation-path").value 1241 : i.getNamedItem("data-bm-path") 1242 ? i.getNamedItem("data-bm-path").value 1243 : i.getNamedItem("bm-path") 1244 ? i.getNamedItem("bm-path").value 1245 : ""), 1246 (r.animType = i.getNamedItem("data-anim-type") 1247 ? i.getNamedItem("data-anim-type").value 1248 : i.getNamedItem("data-bm-type") 1249 ? i.getNamedItem("data-bm-type").value 1250 : i.getNamedItem("bm-type") 1251 ? i.getNamedItem("bm-type").value 1252 : i.getNamedItem("data-bm-renderer") 1253 ? i.getNamedItem("data-bm-renderer").value 1254 : i.getNamedItem("bm-renderer") 1255 ? i.getNamedItem("bm-renderer").value 1256 : "canvas"); 1257 var s = i.getNamedItem("data-anim-loop") 1258 ? i.getNamedItem("data-anim-loop").value 1259 : i.getNamedItem("data-bm-loop") 1260 ? i.getNamedItem("data-bm-loop").value 1261 : i.getNamedItem("bm-loop") 1262 ? i.getNamedItem("bm-loop").value 1263 : ""; 1264 "false" === s 1265 ? (r.loop = !1) 1266 : "true" === s 1267 ? (r.loop = !0) 1268 : "" !== s && (r.loop = parseInt(s, 10));
1269 var a = i.getNamedItem("data-anim-autoplay") 1270 ? i.getNamedItem("data-anim-autoplay").value 1271 : i.getNamedItem("data-bm-autoplay") 1272 ? i.getNamedItem("data-bm-autoplay").value 1273 : !i.getNamedItem("bm-autoplay") || 1274 i.getNamedItem("bm-autoplay").value; 1275 (r.autoplay = "false" !== a), 1276 (r.name = i.getNamedItem("data-name") 1277 ? i.getNamedItem("data-name").value 1278 : i.getNamedItem("data-bm-name") 1279 ? i.getNamedItem("data-bm-name").value 1280 : i.getNamedItem("bm-name") 1281 ? i.getNamedItem("bm-name").value 1282 : ""), 1283 "false" === 1284 (i.getNamedItem("data-anim-prerender") 1285 ? i.getNamedItem("data-anim-prerender").value 1286 : i.getNamedItem("data-bm-prerender") 1287 ? i.getNamedItem("data-bm-prerender").value 1288 : i.getNamedItem("bm-prerender") 1289 ? i.getNamedItem("bm-prerender").value 1290 : "") && (r.prerender = !1), 1291 this.setParams(r); 1292 }), 1293 (AnimationItem.prototype.includeLayers = function (t) { 1294 t.op > this.animationData.op && 1295 ((this.animationData.op = t.op), 1296 (this.totalFrames = Math.floor(t.op - this.animationData.ip))); 1297 var e, 1298 r, 1299 i = this.animationData.layers, 1300 s = i.length, 1301 a = t.layers, 1302 n = a.length; 1303 for (r = 0; r < n; r += 1) 1304 for (e = 0; e < s; ) { 1305 if (i[e].id === a[r].id) { 1306 i[e] = a[r]; 1307 break; 1308 } 1309 e += 1; 1310 } 1311 if ( 1312 ((t.chars || t.fonts) && 1313 (this.renderer.globalData.fontManager.addChars(t.chars), 1314 this.renderer.globalData.fontManager.addFonts( 1315 t.fonts, 1316 this.renderer.globalData.defs 1317 )), 1318 t.assets) 1319 ) 1320 for (s = t.assets.length, e = 0; e < s; e += 1) 1321 this.animationData.assets.push(t.assets[e]); 1322 (this.animationData.__complete = !1), 1323 dataManager.completeAnimation( 1324 this.animationData, 1325 this.onSegmentComplete 1326 ); 1327 }), 1328 (AnimationItem.prototype.onSegmentComplete = function (t) { 1329 this.animationData = t; 1330 var e = getExpressionsPlugin(); 1331 e && e.initExpressions(this), this.loadNextSegment(); 1332 }), 1333 (AnimationItem.prototype.loadNextSegment = function () { 1334 var t = this.animationData.segments; 1335 if (!t || 0 === t.length || !this.autoloadSegments) 1336 return ( 1337 this.trigger("data_ready"), 1338 void (this.timeCompleted = this.totalFrames) 1339 ); 1340 var e = t.shift(); 1341 this.timeCompleted = e.time * this.frameRate; 1342 var r = this.path + this.fileName + "_" + this.segmentPos + ".json"; 1343 (this.segmentPos += 1), 1344 dataManager.loadData( 1345 r, 1346 this.includeLayers.bind(this), 1347 function () { 1348 this.trigger("data_failed"); 1349 }.bind(this) 1350 ); 1351 }), 1352 (AnimationItem.prototype.loadSegments = function () { 1353 this.animationData.segments || (this.timeCompleted = this.totalFrames), 1354 this.loadNextSegment(); 1355 }), 1356 (AnimationItem.prototype.imagesLoaded = function () { 1357 this.trigger("loaded_images"), this.checkLoaded(); 1358 }), 1359 (AnimationItem.prototype.preloadImages = function () { 1360 this.imagePreloader.setAssetsPath(this.assetsPath), 1361 this.imagePreloader.setPath(this.path), 1362 this.imagePreloader.loadAssets( 1363 this.animationData.assets, 1364 this.imagesLoaded.bind(this) 1365 ); 1366 }), 1367 (AnimationItem.prototype.configAnimation = function (t) { 1368 if (this.renderer) 1369 try { 1370 (this.animationData = t), 1371 this.initialSegment 1372 ? ((this.totalFrames = Math.floor( 1373 this.initialSegment[1] - this.initialSegment[0] 1374 )), 1375 (this.firstFrame = Math.round(this.initialSegment[0]))) 1376 : ((this.totalFrames = Math.floor( 1377 this.animationData.op - this.animationData.ip 1378 )), 1379 (this.firstFrame = Math.round(this.animationData.ip))), 1380 this.renderer.configAnimation(t), 1381 t.assets || (t.assets = []), 1382 (this.assets = this.animationData.assets), 1383 (this.frameRate = this.animationData.fr), 1384 (this.frameMult = this.animationData.fr / 1e3), 1385 this.renderer.searchExtraCompositions(t.assets), 1386 (this.markers = markerParser(t.markers || [])), 1387 this.trigger("config_ready"), 1388 this.preloadImages(), 1389 this.loadSegments(), 1390 this.updaFrameModifier(), 1391 this.waitForFontsLoaded(), 1392 this.isPaused && this.audioController.pause(); 1393 } catch (t) { 1394 this.triggerConfigError(t); 1395 } 1396 }), 1397 (AnimationItem.prototype.waitForFontsLoaded = function () { 1398 this.renderer && 1399 (this.renderer.globalData.fontManager.isLoaded 1400 ? this.checkLoaded() 1401 : setTimeout(this.waitForFontsLoaded.bind(this), 20)); 1402 }), 1403 (AnimationItem.prototype.checkLoaded = function () { 1404 if ( 1405 !this.isLoaded && 1406 this.renderer.globalData.fontManager.isLoaded && 1407 (this.imagePreloader.loadedImages() || 1408 "canvas" !== this.renderer.rendererType) && 1409 this.imagePreloader.loadedFootages() 1410 ) { 1411 this.isLoaded = !0; 1412 var t = getExpressionsPlugin(); 1413 t && t.initExpressions(this), 1414 this.renderer.initItems(), 1415 setTimeout( 1416 function () { 1417 this.trigger("DOMLoaded"); 1418 }.bind(this), 1419 0 1420 ), 1421 this.gotoFrame(), 1422 this.autoplay && this.play(); 1423 } 1424 }), 1425 (AnimationItem.prototype.resize = function (t, e) { 1426 var r = "number" == typeof t ? t : void 0, 1427 i = "number" == typeof e ? e : void 0; 1428 this.renderer.updateContainerSize(r, i); 1429 }), 1430 (AnimationItem.prototype.setSubframe = function (t) { 1431 this.isSubframeEnabled = !!t; 1432 }), 1433 (AnimationItem.prototype.gotoFrame = function () { 1434 (this.currentFrame = this.isSubframeEnabled 1435 ? this.currentRawFrame 1436 : ~~this.currentRawFrame), 1437 this.timeCompleted !== this.totalFrames && 1438 this.currentFrame > this.timeCompleted && 1439 (this.currentFrame = this.timeCompleted), 1440 this.trigger("enterFrame"), 1441 this.renderFrame(), 1442 this.trigger("drawnFrame"); 1443 }), 1444 (AnimationItem.prototype.renderFrame = function () { 1445 if (!1 !== this.isLoaded && this.renderer) 1446 try { 1447 this.renderer.renderFrame(this.currentFrame + this.firstFrame); 1448 } catch (t) {
1449 this.triggerRenderFrameError(t); 1450 } 1451 }), 1452 (AnimationItem.prototype.play = function (t) { 1453 (t && this.name !== t) || 1454 (!0 === this.isPaused && 1455 ((this.isPaused = !1), 1456 this.trigger("_pause"), 1457 this.audioController.resume(), 1458 this._idle && ((this._idle = !1), this.trigger("_active")))); 1459 }), 1460 (AnimationItem.prototype.pause = function (t) { 1461 (t && this.name !== t) || 1462 (!1 === this.isPaused && 1463 ((this.isPaused = !0), 1464 this.trigger("_play"), 1465 (this._idle = !0), 1466 this.trigger("_idle"), 1467 this.audioController.pause())); 1468 }), 1469 (AnimationItem.prototype.togglePause = function (t) { 1470 (t && this.name !== t) || 1471 (!0 === this.isPaused ? this.play() : this.pause()); 1472 }), 1473 (AnimationItem.prototype.stop = function (t) { 1474 (t && this.name !== t) || 1475 (this.pause(), 1476 (this.playCount = 0), 1477 (this._completedLoop = !1), 1478 this.setCurrentRawFrameValue(0)); 1479 }), 1480 (AnimationItem.prototype.getMarkerData = function (t) { 1481 for (var e, r = 0; r < this.markers.length; r += 1) 1482 if ((e = this.markers[r]).payload && e.payload.name === t) return e; 1483 return null; 1484 }), 1485 (AnimationItem.prototype.goToAndStop = function (t, e, r) { 1486 if (!r || this.name === r) { 1487 var i = Number(t); 1488 if (isNaN(i)) { 1489 var s = this.getMarkerData(t); 1490 s && this.goToAndStop(s.time, !0); 1491 } else 1492 e 1493 ? this.setCurrentRawFrameValue(t) 1494 : this.setCurrentRawFrameValue(t * this.frameModifier); 1495 this.pause(); 1496 } 1497 }), 1498 (AnimationItem.prototype.goToAndPlay = function (t, e, r) { 1499 if (!r || this.name === r) { 1500 var i = Number(t); 1501 if (isNaN(i)) { 1502 var s = this.getMarkerData(t); 1503 s && 1504 (s.duration 1505 ? this.playSegments([s.time, s.time + s.duration], !0) 1506 : this.goToAndStop(s.time, !0)); 1507 } else this.goToAndStop(i, e, r); 1508 this.play(); 1509 } 1510 }), 1511 (AnimationItem.prototype.advanceTime = function (t) { 1512 if (!0 !== this.isPaused && !1 !== this.isLoaded) { 1513 var e = this.currentRawFrame + t * this.frameModifier, 1514 r = !1; 1515 e >= this.totalFrames - 1 && this.frameModifier > 0 1516 ? this.loop && this.playCount !== this.loop 1517 ? e >= this.totalFrames 1518 ? ((this.playCount += 1), 1519 this.checkSegments(e % this.totalFrames) || 1520 (this.setCurrentRawFrameValue(e % this.totalFrames), 1521 (this._completedLoop = !0), 1522 this.trigger("loopComplete"))) 1523 : this.setCurrentRawFrameValue(e) 1524 : this.checkSegments( 1525 e > this.totalFrames ? e % this.totalFrames : 0 1526 ) || ((r = !0), (e = this.totalFrames - 1)) 1527 : e < 0 1528 ? this.checkSegments(e % this.totalFrames) || 1529 (!this.loop || (this.playCount-- <= 0 && !0 !== this.loop) 1530 ? ((r = !0), (e = 0)) 1531 : (this.setCurrentRawFrameValue( 1532 this.totalFrames + (e % this.totalFrames) 1533 ), 1534 this._completedLoop 1535 ? this.trigger("loopComplete") 1536 : (this._completedLoop = !0))) 1537 : this.setCurrentRawFrameValue(e), 1538 r && 1539 (this.setCurrentRawFrameValue(e), 1540 this.pause(), 1541 this.trigger("complete")); 1542 } 1543 }), 1544 (AnimationItem.prototype.adjustSegment = function (t, e) { 1545 (this.playCount = 0), 1546 t[1] < t[0] 1547 ? (this.frameModifier > 0 && 1548 (this.playSpeed < 0 1549 ? this.setSpeed(-this.playSpeed) 1550 : this.setDirection(-1)), 1551 (this.totalFrames = t[0] - t[1]), 1552 (this.timeCompleted = this.totalFrames), 1553 (this.firstFrame = t[1]),
1554 this.setCurrentRawFrameValue(this.totalFrames - 0.001 - e)) 1555 : t[1] > t[0] && 1556 (this.frameModifier < 0 && 1557 (this.playSpeed < 0 1558 ? this.setSpeed(-this.playSpeed) 1559 : this.setDirection(1)), 1560 (this.totalFrames = t[1] - t[0]), 1561 (this.timeCompleted = this.totalFrames), 1562 (this.firstFrame = t[0]), 1563 this.setCurrentRawFrameValue(0.001 + e)), 1564 this.trigger("segmentStart"); 1565 }), 1566 (AnimationItem.prototype.setSegment = function (t, e) { 1567 var r = -1; 1568 this.isPaused && 1569 (this.currentRawFrame + this.firstFrame < t 1570 ? (r = t) 1571 : this.currentRawFrame + this.firstFrame > e && (r = e - t)), 1572 (this.firstFrame = t), 1573 (this.totalFrames = e - t), 1574 (this.timeCompleted = this.totalFrames), 1575 -1 !== r && this.goToAndStop(r, !0); 1576 }), 1577 (AnimationItem.prototype.playSegments = function (t, e) { 1578 if ((e && (this.segments.length = 0), "object" === _typeof$4(t[0]))) { 1579 var r, 1580 i = t.length; 1581 for (r = 0; r < i; r += 1) this.segments.push(t[r]); 1582 } else this.segments.push(t); 1583 this.segments.length && 1584 e && 1585 this.adjustSegment(this.segments.shift(), 0), 1586 this.isPaused && this.play(); 1587 }), 1588 (AnimationItem.prototype.resetSegments = function (t) { 1589 (this.segments.length = 0), 1590 this.segments.push([this.animationData.ip, this.animationData.op]), 1591 t && this.checkSegments(0); 1592 }), 1593 (AnimationItem.prototype.checkSegments = function (t) { 1594 return ( 1595 !!this.segments.length && 1596 (this.adjustSegment(this.segments.shift(), t), !0) 1597 ); 1598 }), 1599 (AnimationItem.prototype.destroy = function (t) { 1600 (t && this.name !== t) || 1601 !this.renderer || 1602 (this.renderer.destroy(), 1603 this.imagePreloader.destroy(), 1604 this.trigger("destroy"), 1605 (this._cbs = null), 1606 (this.onEnterFrame = null), 1607 (this.onLoopComplete = null), 1608 (this.onComplete = null), 1609 (this.onSegmentStart = null), 1610 (this.onDestroy = null), 1611 (this.renderer = null), 1612 (this.renderer = null), 1613 (this.imagePreloader = null), 1614 (this.projectInterface = null)); 1615 }), 1616 (AnimationItem.prototype.setCurrentRawFrameValue = function (t) { 1617 (this.currentRawFrame = t), this.gotoFrame(); 1618 }), 1619 (AnimationItem.prototype.setSpeed = function (t) { 1620 (this.playSpeed = t), this.updaFrameModifier(); 1621 }), 1622 (AnimationItem.prototype.setDirection = function (t) { 1623 (this.playDirection = t < 0 ? -1 : 1), this.updaFrameModifier(); 1624 }), 1625 (AnimationItem.prototype.setVolume = function (t, e) { 1626 (e && this.name !== e) || this.audioController.setVolume(t); 1627 }), 1628 (AnimationItem.prototype.getVolume = function () { 1629 return this.audioController.getVolume(); 1630 }), 1631 (AnimationItem.prototype.mute = function (t) { 1632 (t && this.name !== t) || this.audioController.mute(); 1633 }), 1634 (AnimationItem.prototype.unmute = function (t) { 1635 (t && this.name !== t) || this.audioController.unmute(); 1636 }), 1637 (AnimationItem.prototype.updaFrameModifier = function () { 1638 (this.frameModifier = 1639 this.frameMult * this.playSpeed * this.playDirection), 1640 this.audioController.setRate(this.playSpeed * this.playDirection); 1641 }), 1642 (AnimationItem.prototype.getPath = function () { 1643 return this.path; 1644 }), 1645 (AnimationItem.prototype.getAssetsPath = function (t) { 1646 var e = ""; 1647 if (t.e) e = t.p; 1648 else if (this.assetsPath) { 1649 var r = t.p; 1650 -1 !== r.indexOf("images/") && (r = r.split("/")[1]), 1651 (e = this.assetsPath + r); 1652 } else (e = this.path), (e += t.u ? t.u : ""), (e += t.p); 1653 return e; 1654 }), 1655 (AnimationItem.prototype.getAssetData = function (t) { 1656 for (var e = 0, r = this.assets.length; e < r; ) {
1657 if (t === this.assets[e].id) return this.assets[e]; 1658 e += 1; 1659 } 1660 return null; 1661 }), 1662 (AnimationItem.prototype.hide = function () { 1663 this.renderer.hide(); 1664 }), 1665 (AnimationItem.prototype.show = function () { 1666 this.renderer.show(); 1667 }), 1668 (AnimationItem.prototype.getDuration = function (t) { 1669 return t ? this.totalFrames : this.totalFrames / this.frameRate; 1670 }), 1671 (AnimationItem.prototype.updateDocumentData = function (t, e, r) { 1672 try { 1673 this.renderer.getElementByPath(t).updateDocumentData(e, r); 1674 } catch (t) {} 1675 }), 1676 (AnimationItem.prototype.trigger = function (t) { 1677 if (this._cbs && this._cbs[t]) 1678 switch (t) { 1679 case "enterFrame": 1680 this.triggerEvent( 1681 t, 1682 new BMEnterFrameEvent( 1683 t, 1684 this.currentFrame, 1685 this.totalFrames, 1686 this.frameModifier 1687 ) 1688 ); 1689 break; 1690 case "drawnFrame": 1691 (this.drawnFrameEvent.currentTime = this.currentFrame), 1692 (this.drawnFrameEvent.totalTime = this.totalFrames), 1693 (this.drawnFrameEvent.direction = this.frameModifier), 1694 this.triggerEvent(t, this.drawnFrameEvent); 1695 break; 1696 case "loopComplete": 1697 this.triggerEvent( 1698 t, 1699 new BMCompleteLoopEvent( 1700 t, 1701 this.loop, 1702 this.playCount, 1703 this.frameMult 1704 ) 1705 ); 1706 break; 1707 case "complete": 1708 this.triggerEvent(t, new BMCompleteEvent(t, this.frameMult)); 1709 break; 1710 case "segmentStart": 1711 this.triggerEvent( 1712 t, 1713 new BMSegmentStartEvent(t, this.firstFrame, this.totalFrames) 1714 ); 1715 break; 1716 case "destroy": 1717 this.triggerEvent(t, new BMDestroyEvent(t, this)); 1718 break; 1719 default: 1720 this.triggerEvent(t); 1721 } 1722 "enterFrame" === t && 1723 this.onEnterFrame && 1724 this.onEnterFrame.call( 1725 this, 1726 new BMEnterFrameEvent( 1727 t, 1728 this.currentFrame, 1729 this.totalFrames, 1730 this.frameMult 1731 ) 1732 ), 1733 "loopComplete" === t && 1734 this.onLoopComplete && 1735 this.onLoopComplete.call( 1736 this, 1737 new BMCompleteLoopEvent( 1738 t, 1739 this.loop, 1740 this.playCount, 1741 this.frameMult 1742 ) 1743 ), 1744 "complete" === t && 1745 this.onComplete && 1746 this.onComplete.call(this, new BMCompleteEvent(t, this.frameMult)), 1747 "segmentStart" === t && 1748 this.onSegmentStart && 1749 this.onSegmentStart.call( 1750 this, 1751 new BMSegmentStartEvent(t, this.firstFrame, this.totalFrames) 1752 ), 1753 "destroy" === t && 1754 this.onDestroy && 1755 this.onDestroy.call(this, new BMDestroyEvent(t, this)); 1756 }), 1757 (AnimationItem.prototype.triggerRenderFrameError = function (t) { 1758 var e = new BMRenderFrameErrorEvent(t, this.currentFrame); 1759 this.triggerEvent("error", e), 1760 this.onError && this.onError.call(this, e); 1761 }), 1762 (AnimationItem.prototype.triggerConfigError = function (t) { 1763 var e = new BMConfigErrorEvent(t, this.currentFrame); 1764 this.triggerEvent("error", e), 1765 this.onError && this.onError.call(this, e); 1766 }); 1767 var animationManager = (function () { 1768 var t = {}, 1769 e = [], 1770 r = 0, 1771 i = 0, 1772 s = 0, 1773 a = !0, 1774 n = !1; 1775 function o(t) { 1776 for (var r = 0, s = t.target; r < i; ) 1777 e[r].animation === s && 1778 (e.splice(r, 1), (r -= 1), (i -= 1), s.isPaused || p()), 1779 (r += 1); 1780 } 1781 function h(t, r) { 1782 if (!t) return null; 1783 for (var s = 0; s < i; ) { 1784 if (e[s].elem === t && null !== e[s].elem) return e[s].animation; 1785 s += 1; 1786 } 1787 var a = new AnimationItem(); 1788 return f(a, t), a.setData(t, r), a; 1789 } 1790 function l() { 1791 (s += 1), d(); 1792 } 1793 function p() { 1794 s -= 1; 1795 } 1796 function f(t, r) { 1797 t.addEventListener("destroy", o), 1798 t.addEventListener("_active", l), 1799 t.addEventListener("_idle", p), 1800 e.push({ elem: r, animation: t }), 1801 (i += 1); 1802 } 1803 function m(t) { 1804 var o, 1805 h = t - r; 1806 for (o = 0; o < i; o += 1) e[o].animation.advanceTime(h); 1807 (r = t), s && !n ? window.requestAnimationFrame(m) : (a = !0);
1808 } 1809 function c(t) { 1810 (r = t), window.requestAnimationFrame(m); 1811 } 1812 function d() { 1813 !n && s && a && (window.requestAnimationFrame(c), (a = !1)); 1814 } 1815 return ( 1816 (t.registerAnimation = h), 1817 (t.loadAnimation = function (t) { 1818 var e = new AnimationItem(); 1819 return f(e, null), e.setParams(t), e; 1820 }), 1821 (t.setSpeed = function (t, r) { 1822 var s; 1823 for (s = 0; s < i; s += 1) e[s].animation.setSpeed(t, r); 1824 }), 1825 (t.setDirection = function (t, r) { 1826 var s; 1827 for (s = 0; s < i; s += 1) e[s].animation.setDirection(t, r); 1828 }), 1829 (t.play = function (t) { 1830 var r; 1831 for (r = 0; r < i; r += 1) e[r].animation.play(t); 1832 }), 1833 (t.pause = function (t) { 1834 var r; 1835 for (r = 0; r < i; r += 1) e[r].animation.pause(t); 1836 }), 1837 (t.stop = function (t) { 1838 var r; 1839 for (r = 0; r < i; r += 1) e[r].animation.stop(t); 1840 }), 1841 (t.togglePause = function (t) { 1842 var r; 1843 for (r = 0; r < i; r += 1) e[r].animation.togglePause(t); 1844 }), 1845 (t.searchAnimations = function (t, e, r) { 1846 var i, 1847 s = [].concat( 1848 [].slice.call(document.getElementsByClassName("lottie")), 1849 [].slice.call(document.getElementsByClassName("bodymovin")) 1850 ), 1851 a = s.length; 1852 for (i = 0; i < a; i += 1) 1853 r && s[i].setAttribute("data-bm-type", r), h(s[i], t); 1854 if (e && 0 === a) { 1855 r || (r = "svg"); 1856 var n = document.getElementsByTagName("body")[0]; 1857 n.innerText = ""; 1858 var o = createTag("div"); 1859 (o.style.width = "100%"), 1860 (o.style.height = "100%"), 1861 o.setAttribute("data-bm-type", r), 1862 n.appendChild(o), 1863 h(o, t); 1864 } 1865 }), 1866 (t.resize = function () { 1867 var t; 1868 for (t = 0; t < i; t += 1) e[t].animation.resize(); 1869 }), 1870 (t.goToAndStop = function (t, r, s) { 1871 var a; 1872 for (a = 0; a < i; a += 1) e[a].animation.goToAndStop(t, r, s); 1873 }), 1874 (t.destroy = function (t) { 1875 var r; 1876 for (r = i - 1; r >= 0; r -= 1) e[r].animation.destroy(t); 1877 }), 1878 (t.freeze = function () { 1879 n = !0; 1880 }), 1881 (t.unfreeze = function () { 1882 (n = !1), d(); 1883 }), 1884 (t.setVolume = function (t, r) { 1885 var s; 1886 for (s = 0; s < i; s += 1) e[s].animation.setVolume(t, r); 1887 }), 1888 (t.mute = function (t) { 1889 var r; 1890 for (r = 0; r < i; r += 1) e[r].animation.mute(t); 1891 }), 1892 (t.unmute = function (t) { 1893 var r; 1894 for (r = 0; r < i; r += 1) e[r].animation.unmute(t); 1895 }), 1896 (t.getRegisteredAnimations = function () { 1897 var t, 1898 r = e.length, 1899 i = []; 1900 for (t = 0; t < r; t += 1) i.push(e[t].animation); 1901 return i; 1902 }), 1903 t 1904 ); 1905 })(), 1906 BezierFactory = (function () { 1907 var t = { 1908 getBezierEasing: function (t, r, i, s, a) { 1909 var n = 1910 a || 1911 ("bez_" + t + "_" + r + "_" + i + "_" + s).replace(/\./g, "p"); 1912 if (e[n]) return e[n]; 1913 var o = new l([t, r, i, s]); 1914 return (e[n] = o), o; 1915 }, 1916 }, 1917 e = {}; 1918 var r = 0.1, 1919 i = "function" == typeof Float32Array; 1920 function s(t, e) { 1921 return 1 - 3 * e + 3 * t; 1922 } 1923 function a(t, e) { 1924 return 3 * e - 6 * t; 1925 } 1926 function n(t) { 1927 return 3 * t; 1928 } 1929 function o(t, e, r) { 1930 return ((s(e, r) * t + a(e, r)) * t + n(e)) * t; 1931 } 1932 function h(t, e, r) { 1933 return 3 * s(e, r) * t * t + 2 * a(e, r) * t + n(e); 1934 } 1935 function l(t) { 1936 (this._p = t), 1937 (this._mSampleValues = i ? new Float32Array(11) : new Array(11)), 1938 (this._precomputed = !1), 1939 (this.get = this.get.bind(this)); 1940 } 1941 return ( 1942 (l.prototype = { 1943 get: function (t) { 1944 var e = this._p[0], 1945 r = this._p[1], 1946 i = this._p[2], 1947 s = this._p[3]; 1948 return ( 1949 this._precomputed || this._precompute(), 1950 e === r && i === s 1951 ? t 1952 : 0 === t 1953 ? 0 1954 : 1 === t 1955 ? 1 1956 : o(this._getTForX(t), r, s) 1957 ); 1958 }, 1959 _precompute: function () { 1960 var t = this._p[0], 1961 e = this._p[1], 1962 r = this._p[2], 1963 i = this._p[3]; 1964 (this._precomputed = !0), 1965 (t === e && r === i) || this._calcSampleValues();
1966 }, 1967 _calcSampleValues: function () { 1968 for (var t = this._p[0], e = this._p[2], i = 0; i < 11; ++i) 1969 this._mSampleValues[i] = o(i * r, t, e); 1970 }, 1971 _getTForX: function (t) { 1972 for ( 1973 var e = this._p[0], 1974 i = this._p[2], 1975 s = this._mSampleValues, 1976 a = 0, 1977 n = 1; 1978 10 !== n && s[n] <= t; 1979 ++n 1980 ) 1981 a += r; 1982 var l = a + ((t - s[--n]) / (s[n + 1] - s[n])) * r, 1983 p = h(l, e, i); 1984 return p >= 0.001 1985 ? (function (t, e, r, i) { 1986 for (var s = 0; s < 4; ++s) { 1987 var a = h(e, r, i); 1988 if (0 === a) return e; 1989 e -= (o(e, r, i) - t) / a; 1990 } 1991 return e; 1992 })(t, l, e, i) 1993 : 0 === p 1994 ? l 1995 : (function (t, e, r, i, s) { 1996 var a, 1997 n, 1998 h = 0; 1999 do { 2000 (a = o((n = e + (r - e) / 2), i, s) - t) > 0 2001 ? (r = n) 2002 : (e = n); 2003 } while (Math.abs(a) > 1e-7 && ++h < 10); 2004 return n; 2005 })(t, a, a + r, e, i); 2006 }, 2007 }), 2008 t 2009 ); 2010 })(), 2011 pooling = { 2012 double: function (t) { 2013 return t.concat(createSizedArray(t.length)); 2014 }, 2015 }, 2016 poolFactory = function (t, e, r) { 2017 var i = 0, 2018 s = t, 2019 a = createSizedArray(s); 2020 return { 2021 newElement: function () { 2022 return i ? a[(i -= 1)] : e(); 2023 }, 2024 release: function (t) { 2025 i === s && ((a = pooling.double(a)), (s *= 2)), 2026 r && r(t), 2027 (a[i] = t), 2028 (i += 1); 2029 }, 2030 }; 2031 }, 2032 bezierLengthPool = poolFactory(8, function () { 2033 return { 2034 addedLength: 0, 2035 percents: createTypedArray("float32", getDefaultCurveSegments()), 2036 lengths: createTypedArray("float32", getDefaultCurveSegments()), 2037 }; 2038 }), 2039 segmentsLengthPool = poolFactory( 2040 8, 2041 function () { 2042 return { lengths: [], totalLength: 0 }; 2043 }, 2044 function (t) { 2045 var e, 2046 r = t.lengths.length; 2047 for (e = 0; e < r; e += 1) bezierLengthPool.release(t.lengths[e]); 2048 t.lengths.length = 0; 2049 } 2050 ); 2051 function bezFunction() { 2052 var t = Math; 2053 function e(t, e, r, i, s, a) { 2054 var n = t * i + e * s + r * a - s * i - a * t - r * e; 2055 return n > -0.001 && n < 0.001; 2056 } 2057 var r = function (t, e, r, i) { 2058 var s, 2059 a, 2060 n, 2061 o, 2062 h, 2063 l, 2064 p = getDefaultCurveSegments(), 2065 f = 0, 2066 m = [], 2067 c = [], 2068 d = bezierLengthPool.newElement(); 2069 for (n = r.length, s = 0; s < p; s += 1) { 2070 for (h = s / (p - 1), l = 0, a = 0; a < n; a += 1) 2071 (o = 2072 bmPow(1 - h, 3) * t[a] + 2073 3 * bmPow(1 - h, 2) * h * r[a] + 2074 3 * (1 - h) * bmPow(h, 2) * i[a] + 2075 bmPow(h, 3) * e[a]), 2076 (m[a] = o), 2077 null !== c[a] && (l += bmPow(m[a] - c[a], 2)), 2078 (c[a] = m[a]); 2079 l && (f += l = bmSqrt(l)), (d.percents[s] = h), (d.lengths[s] = f); 2080 } 2081 return (d.addedLength = f), d; 2082 }; 2083 function i(t) { 2084 (this.segmentLength = 0), (this.points = new Array(t)); 2085 } 2086 function s(t, e) { 2087 (this.partialLength = t), (this.point = e); 2088 } 2089 var a, 2090 n = 2091 ((a = {}), 2092 function (t, r, n, o) { 2093 var h = ( 2094 t[0] + 2095 "_" + 2096 t[1] + 2097 "_" + 2098 r[0] + 2099 "_" + 2100 r[1] + 2101 "_" + 2102 n[0] + 2103 "_" + 2104 n[1] + 2105 "_" + 2106 o[0] + 2107 "_" + 2108 o[1] 2109 ).replace(/\./g, "p"); 2110 if (!a[h]) { 2111 var l, 2112 p, 2113 f, 2114 m, 2115 c, 2116 d, 2117 u, 2118 y = getDefaultCurveSegments(), 2119 g = 0, 2120 v = null; 2121 2 === t.length && 2122 (t[0] !== r[0] || t[1] !== r[1]) && 2123 e(t[0], t[1], r[0], r[1], t[0] + n[0], t[1] + n[1]) && 2124 e(t[0], t[1], r[0], r[1], r[0] + o[0], r[1] + o[1]) && 2125 (y = 2); 2126 var b = new i(y); 2127 for (f = n.length, l = 0; l < y; l += 1) { 2128 for ( 2129 u = createSizedArray(f), c = l / (y - 1), d = 0, p = 0; 2130 p < f; 2131 p += 1 2132 ) 2133 (m = 2134 bmPow(1 - c, 3) * t[p] + 2135 3 * bmPow(1 - c, 2) * c * (t[p] + n[p]) + 2136 3 * (1 - c) * bmPow(c, 2) * (r[p] + o[p]) + 2137 bmPow(c, 3) * r[p]), 2138 (u[p] = m), 2139 null !== v && (d += bmPow(u[p] - v[p], 2));
2140 (g += d = bmSqrt(d)), (b.points[l] = new s(d, u)), (v = u); 2141 } 2142 (b.segmentLength = g), (a[h] = b); 2143 } 2144 return a[h]; 2145 }); 2146 function o(t, e) { 2147 var r = e.percents, 2148 i = e.lengths, 2149 s = r.length, 2150 a = bmFloor((s - 1) * t), 2151 n = t * e.addedLength, 2152 o = 0; 2153 if (a === s - 1 || 0 === a || n === i[a]) return r[a]; 2154 for (var h = i[a] > n ? -1 : 1, l = !0; l; ) 2155 if ( 2156 (i[a] <= n && i[a + 1] > n 2157 ? ((o = (n - i[a]) / (i[a + 1] - i[a])), (l = !1)) 2158 : (a += h), 2159 a < 0 || a >= s - 1) 2160 ) { 2161 if (a === s - 1) return r[a]; 2162 l = !1; 2163 } 2164 return r[a] + (r[a + 1] - r[a]) * o; 2165 } 2166 var h = createTypedArray("float32", 8); 2167 return { 2168 getSegmentsLength: function (t) { 2169 var e, 2170 i = segmentsLengthPool.newElement(), 2171 s = t.c, 2172 a = t.v, 2173 n = t.o, 2174 o = t.i, 2175 h = t._length, 2176 l = i.lengths, 2177 p = 0; 2178 for (e = 0; e < h - 1; e += 1) 2179 (l[e] = r(a[e], a[e + 1], n[e], o[e + 1])), (p += l[e].addedLength); 2180 return ( 2181 s && 2182 h && 2183 ((l[e] = r(a[e], a[0], n[e], o[0])), (p += l[e].addedLength)), 2184 (i.totalLength = p), 2185 i 2186 ); 2187 }, 2188 getNewSegment: function (e, r, i, s, a, n, l) { 2189 a < 0 ? (a = 0) : a > 1 && (a = 1); 2190 var p, 2191 f = o(a, l), 2192 m = o((n = n > 1 ? 1 : n), l), 2193 c = e.length, 2194 d = 1 - f, 2195 u = 1 - m, 2196 y = d * d * d, 2197 g = f * d * d * 3, 2198 v = f * f * d * 3, 2199 b = f * f * f, 2200 P = d * d * u, 2201 x = f * d * u + d * f * u + d * d * m, 2202 E = f * f * u + d * f * m + f * d * m, 2203 S = f * f * m, 2204 _ = d * u * u, 2205 C = f * u * u + d * m * u + d * u * m, 2206 A = f * m * u + d * m * m + f * u * m, 2207 M = f * m * m, 2208 T = u * u * u, 2209 D = m * u * u + u * m * u + u * u * m, 2210 k = m * m * u + u * m * m + m * u * m, 2211 F = m * m * m; 2212 for (p = 0; p < c; p += 1) 2213 (h[4 * p] = 2214 t.round(1e3 * (y * e[p] + g * i[p] + v * s[p] + b * r[p])) / 1e3), 2215 (h[4 * p + 1] = 2216 t.round(1e3 * (P * e[p] + x * i[p] + E * s[p] + S * r[p])) / 2217 1e3), 2218 (h[4 * p + 2] = 2219 t.round(1e3 * (_ * e[p] + C * i[p] + A * s[p] + M * r[p])) / 2220 1e3), 2221 (h[4 * p + 3] = 2222 t.round(1e3 * (T * e[p] + D * i[p] + k * s[p] + F * r[p])) / 2223 1e3); 2224 return h; 2225 }, 2226 getPointInSegment: function (e, r, i, s, a, n) { 2227 var h = o(a, n), 2228 l = 1 - h; 2229 return [ 2230 t.round( 2231 1e3 * 2232 (l * l * l * e[0] + 2233 (h * l * l + l * h * l + l * l * h) * i[0] + 2234 (h * h * l + l * h * h + h * l * h) * s[0] + 2235 h * h * h * r[0]) 2236 ) / 1e3, 2237 t.round( 2238 1e3 * 2239 (l * l * l * e[1] + 2240 (h * l * l + l * h * l + l * l * h) * i[1] + 2241 (h * h * l + l * h * h + h * l * h) * s[1] + 2242 h * h * h * r[1]) 2243 ) / 1e3, 2244 ]; 2245 }, 2246 buildBezierData: n, 2247 pointOnLine2D: e, 2248 pointOnLine3D: function (r, i, s, a, n, o, h, l, p) { 2249 if (0 === s && 0 === o && 0 === p) return e(r, i, a, n, h, l); 2250 var f, 2251 m = t.sqrt(t.pow(a - r, 2) + t.pow(n - i, 2) + t.pow(o - s, 2)), 2252 c = t.sqrt(t.pow(h - r, 2) + t.pow(l - i, 2) + t.pow(p - s, 2)), 2253 d = t.sqrt(t.pow(h - a, 2) + t.pow(l - n, 2) + t.pow(p - o, 2)); 2254 return ( 2255 (f = 2256 m > c 2257 ? m > d 2258 ? m - c - d 2259 : d - c - m 2260 : d > c 2261 ? d - c - m 2262 : c - m - d) > -1e-4 && f < 1e-4 2263 ); 2264 }, 2265 }; 2266 } 2267 var bez = bezFunction(), 2268 PropertyFactory = (function () { 2269 var t = initialDefaultFrame, 2270 e = Math.abs; 2271 function r(t, e) { 2272 var r, 2273 s = this.offsetTime; 2274 "multidimensional" === this.propType && 2275 (r = createTypedArray("float32", this.pv.length)); 2276 for ( 2277 var a, 2278 n, 2279 o, 2280 h, 2281 l, 2282 p, 2283 f, 2284 m, 2285 c, 2286 d = e.lastIndex, 2287 u = d, 2288 y = this.keyframes.length - 1, 2289 g = !0; 2290 g; 2291 2292 ) { 2293 if ( 2294 ((a = this.keyframes[u]), 2295 (n = this.keyframes[u + 1]), 2296 u === y - 1 && t >= n.t - s) 2297 ) { 2298 a.h && (a = n), (d = 0); 2299 break; 2300 } 2301 if (n.t - s > t) { 2302 d = u; 2303 break; 2304 } 2305 u < y - 1 ? (u += 1) : ((d = 0), (g = !1)); 2306 } 2307 o = this.keyframesMetadata[u] || {}; 2308 var v, 2309 b, 2310 P, 2311 x, 2312 E, 2313 S, 2314 _, 2315 C, 2316 A, 2317 M, 2318 T = n.t - s, 2319 D = a.t - s; 2320 if (a.to) { 2321 o.bezierData || 2322 (o.bezierData = bez.buildBezierData(a.s, n.s || a.e, a.to, a.ti)); 2323 var k = o.bezierData; 2324 if (t >= T || t < D) { 2325 var F = t >= T ? k.points.length - 1 : 0;
2326 for (l = k.points[F].point.length, h = 0; h < l; h += 1) 2327 r[h] = k.points[F].point[h]; 2328 } else { 2329 o.__fnct 2330 ? (c = o.__fnct) 2331 : ((c = BezierFactory.getBezierEasing( 2332 a.o.x, 2333 a.o.y, 2334 a.i.x, 2335 a.i.y, 2336 a.n 2337 ).get), 2338 (o.__fnct = c)), 2339 (p = c((t - D) / (T - D))); 2340 var w, 2341 I = k.segmentLength * p, 2342 B = 2343 e.lastFrame < t && e._lastKeyframeIndex === u 2344 ? e._lastAddedLength 2345 : 0; 2346 for ( 2347 m = 2348 e.lastFrame < t && e._lastKeyframeIndex === u 2349 ? e._lastPoint 2350 : 0, 2351 g = !0, 2352 f = k.points.length; 2353 g; 2354 2355 ) { 2356 if ( 2357 ((B += k.points[m].partialLength), 2358 0 === I || 0 === p || m === k.points.length - 1) 2359 ) { 2360 for (l = k.points[m].point.length, h = 0; h < l; h += 1) 2361 r[h] = k.points[m].point[h]; 2362 break; 2363 } 2364 if (I >= B && I < B + k.points[m + 1].partialLength) { 2365 for ( 2366 w = (I - B) / k.points[m + 1].partialLength, 2367 l = k.points[m].point.length, 2368 h = 0; 2369 h < l; 2370 h += 1 2371 ) 2372 r[h] = 2373 k.points[m].point[h] + 2374 (k.points[m + 1].point[h] - k.points[m].point[h]) * w; 2375 break; 2376 } 2377 m < f - 1 ? (m += 1) : (g = !1); 2378 } 2379 (e._lastPoint = m), 2380 (e._lastAddedLength = B - k.points[m].partialLength), 2381 (e._lastKeyframeIndex = u); 2382 } 2383 } else { 2384 var V, R, L, z, G; 2385 if (((y = a.s.length), (v = n.s || a.e), this.sh && 1 !== a.h)) 2386 if (t >= T) (r[0] = v[0]), (r[1] = v[1]), (r[2] = v[2]); 2387 else if (t <= D) 2388 (r[0] = a.s[0]), (r[1] = a.s[1]), (r[2] = a.s[2]); 2389 else { 2390 var O = i(a.s), 2391 N = i(v); 2392 (b = r), 2393 (P = (function (t, e, r) { 2394 var i, 2395 s, 2396 a, 2397 n, 2398 o, 2399 h = [], 2400 l = t[0], 2401 p = t[1], 2402 f = t[2], 2403 m = t[3], 2404 c = e[0], 2405 d = e[1], 2406 u = e[2], 2407 y = e[3]; 2408 return ( 2409 (s = l * c + p * d + f * u + m * y) < 0 && 2410 ((s = -s), (c = -c), (d = -d), (u = -u), (y = -y)), 2411 1 - s > 1e-6 2412 ? ((i = Math.acos(s)), 2413 (a = Math.sin(i)), 2414 (n = Math.sin((1 - r) * i) / a), 2415 (o = Math.sin(r * i) / a)) 2416 : ((n = 1 - r), (o = r)), 2417 (h[0] = n * l + o * c), 2418 (h[1] = n * p + o * d), 2419 (h[2] = n * f + o * u), 2420 (h[3] = n * m + o * y), 2421 h 2422 ); 2423 })(O, N, (t - D) / (T - D))), 2424 (x = P[0]), 2425 (E = P[1]), 2426 (S = P[2]), 2427 (_ = P[3]), 2428 (C = Math.atan2( 2429 2 * E * _ - 2 * x * S, 2430 1 - 2 * E * E - 2 * S * S 2431 )), 2432 (A = Math.asin(2 * x * E + 2 * S * _)), 2433 (M = Math.atan2( 2434 2 * x * _ - 2 * E * S, 2435 1 - 2 * x * x - 2 * S * S 2436 )), 2437 (b[0] = C / degToRads), 2438 (b[1] = A / degToRads), 2439 (b[2] = M / degToRads); 2440 } 2441 else 2442 for (u = 0; u < y; u += 1) 2443 1 !== a.h && 2444 (t >= T 2445 ? (p = 1) 2446 : t < D 2447 ? (p = 0) 2448 : (a.o.x.constructor === Array 2449 ? (o.__fnct || (o.__fnct = []), 2450 o.__fnct[u] 2451 ? (c = o.__fnct[u]) 2452 : ((V = void 0 === a.o.x[u] ? a.o.x[0] : a.o.x[u]), 2453 (R = void 0 === a.o.y[u] ? a.o.y[0] : a.o.y[u]), 2454 (L = void 0 === a.i.x[u] ? a.i.x[0] : a.i.x[u]), 2455 (z = void 0 === a.i.y[u] ? a.i.y[0] : a.i.y[u]), 2456 (c = BezierFactory.getBezierEasing( 2457 V, 2458 R, 2459 L, 2460 z 2461 ).get), 2462 (o.__fnct[u] = c))) 2463 : o.__fnct 2464 ? (c = o.__fnct) 2465 : ((V = a.o.x), 2466 (R = a.o.y), 2467 (L = a.i.x), 2468 (z = a.i.y), 2469 (c = BezierFactory.getBezierEasing(V, R, L, z).get), 2470 (a.keyframeMetadata = c)), 2471 (p = c((t - D) / (T - D))))), 2472 (v = n.s || a.e), 2473 (G = 1 === a.h ? a.s[u] : a.s[u] + (v[u] - a.s[u]) * p), 2474 "multidimensional" === this.propType ? (r[u] = G)
2474: (r = G); 2475 } 2476 return (e.lastIndex = d), r; 2477 } 2478 function i(t) { 2479 var e = t[0] * degToRads, 2480 r = t[1] * degToRads, 2481 i = t[2] * degToRads, 2482 s = Math.cos(e / 2), 2483 a = Math.cos(r / 2), 2484 n = Math.cos(i / 2), 2485 o = Math.sin(e / 2), 2486 h = Math.sin(r / 2), 2487 l = Math.sin(i / 2); 2488 return [ 2489 o * h * n + s * a * l, 2490 o * a * n + s * h * l, 2491 s * h * n - o * a * l, 2492 s * a * n - o * h * l, 2493 ]; 2494 } 2495 function s() { 2496 var e = this.comp.renderedFrame - this.offsetTime, 2497 r = this.keyframes[0].t - this.offsetTime, 2498 i = this.keyframes[this.keyframes.length - 1].t - this.offsetTime; 2499 if ( 2500 !( 2501 e === this._caching.lastFrame || 2502 (this._caching.lastFrame !== t && 2503 ((this._caching.lastFrame >= i && e >= i) || 2504 (this._caching.lastFrame < r && e < r))) 2505 ) 2506 ) { 2507 this._caching.lastFrame >= e && 2508 ((this._caching._lastKeyframeIndex = -1), 2509 (this._caching.lastIndex = 0)); 2510 var s = this.interpolateValue(e, this._caching); 2511 this.pv = s; 2512 } 2513 return (this._caching.lastFrame = e), this.pv; 2514 } 2515 function a(t) { 2516 var r; 2517 if ("unidimensional" === this.propType) 2518 (r = t * this.mult), 2519 e(this.v - r) > 1e-5 && ((this.v = r), (this._mdf = !0)); 2520 else 2521 for (var i = 0, s = this.v.length; i < s; ) 2522 (r = t[i] * this.mult), 2523 e(this.v[i] - r) > 1e-5 && ((this.v[i] = r), (this._mdf = !0)), 2524 (i += 1); 2525 } 2526 function n() { 2527 if ( 2528 this.elem.globalData.frameId !== this.frameId && 2529 this.effectsSequence.length 2530 ) 2531 if (this.lock) this.setVValue(this.pv); 2532 else { 2533 var t; 2534 (this.lock = !0), (this._mdf = this._isFirstFrame); 2535 var e = this.effectsSequence.length, 2536 r = this.kf ? this.pv : this.data.k; 2537 for (t = 0; t < e; t += 1) r = this.effectsSequence[t](r); 2538 this.setVValue(r), 2539 (this._isFirstFrame = !1), 2540 (this.lock = !1), 2541 (this.frameId = this.elem.globalData.frameId); 2542 } 2543 } 2544 function o(t) { 2545 this.effectsSequence.push(t), this.container.addDynamicProperty(this); 2546 } 2547 function h(t, e, r, i) { 2548 (this.propType = "unidimensional"), 2549 (this.mult = r || 1), 2550 (this.data = e), 2551 (this.v = r ? e.k * r : e.k), 2552 (this.pv = e.k), 2553 (this._mdf = !1), 2554 (this.elem = t), 2555 (this.container = i), 2556 (this.comp = t.comp), 2557 (this.k = !1), 2558 (this.kf = !1), 2559 (this.vel = 0), 2560 (this.effectsSequence = []), 2561 (this._isFirstFrame = !0), 2562 (this.getValue = n), 2563 (this.setVValue = a), 2564 (this.addEffect = o); 2565 } 2566 function l(t, e, r, i) { 2567 var s; 2568 (this.propType = "multidimensional"), 2569 (this.mult = r || 1), 2570 (this.data = e), 2571 (this._mdf = !1), 2572 (this.elem = t), 2573 (this.container = i), 2574 (this.comp = t.comp), 2575 (this.k = !1), 2576 (this.kf = !1), 2577 (this.frameId = -1); 2578 var h = e.k.length; 2579 for ( 2580 this.v = createTypedArray("float32", h), 2581 this.pv = createTypedArray("float32", h), 2582 this.vel = createTypedArray("float32", h), 2583 s = 0; 2584 s < h; 2585 s += 1 2586 ) 2587 (this.v[s] = e.k[s] * this.mult), (this.pv[s] = e.k[s]); 2588 (this._isFirstFrame = !0), 2589 (this.effectsSequence = []), 2590 (this.getValue = n), 2591 (this.setVValue = a), 2592 (this.addEffect = o); 2593 } 2594 function p(e, i, h, l) { 2595 (this.propType = "unidimensional"), 2596 (this.keyframes = i.k), 2597 (this.keyframesMetadata = []), 2598 (this.offsetTime = e.data.st), 2599 (this.frameId = -1), 2600 (this._caching = { 2601 lastFrame: t, 2602 lastIndex: 0, 2603 value: 0, 2604 _lastKeyframeIndex: -1, 2605 }), 2606 (this.k = !0), 2607 (this.kf = !0), 2608 (this.data = i), 2609 (this.mult = h || 1), 2610 (this.elem = e), 2611 (this.container = l), 2612 (this.comp = e.comp), 2613 (this.v = t), 2614 (this.pv = t), 2615 (this._isFirstFrame = !0), 2616 (this.getValue = n), 2617 (this.setVValue = a), 2618 (this.interpolateValue = r), 2619 (this.effectsSequence = [s.bind(this)]), 2620 (this.addEffect = o); 2621 } 2622 function f(e, i, h, l) { 2623 var p; 2624 this.propType = "multidimensional"; 2625 var f, 2626 m, 2627 c, 2628 d, 2629 u = i.k.length; 2630 for (p = 0; p < u - 1; p += 1) 2631 i.k[p].to && 2632 i.k[p].s && 2633 i.k[p + 1] && 2634 i.k[p + 1].s && 2635 ((f = i.k[p].s), 2636 (m = i.k[p + 1].s), 2637 (c = i.k[p].to), 2638 (d = i.k[p].ti), 2639 ((2 === f.length && 2640 (f[0] !== m[0] || f[1] !== m[1]) && 2641 bez.pointOnLine2D( 2642 f[0], 2643 f[1], 2644 m[0], 2645 m[1], 2646 f[0] + c[0], 2647 f[1] + c[1] 2648 ) && 2649 bez.pointOnLine2D( 2650 f[0], 2651 f[1], 2652 m[0], 2653 m[1], 2654 m[0] + d[0], 2655 m[1] + d[1] 2656 )) || 2657 (3 === f.length && 2658 (f[0] !== m[0] || f[1] !== m[1] || f[2] !== m[2]) && 2659 bez.pointOnLine3D( 2660 f[0], 2661 f[1], 2662 f[2], 2663 m[0], 2664 m[1], 2665 m[2], 2666 f[0] + c[0], 2667 f[1] + c[1], 2668 f[2] + c[2] 2669 ) && 2670 bez.pointOnLine3D( 2671 f[0], 2672 f[1], 2673 f[2], 2674 m[0], 2675 m[1], 2676 m[2], 2677 m[0] + d[0], 2678 m[1] + d[1], 2679 m[2] + d[2] 2680 ))) && 2681 ((i.k[p].to = null), (i.k[p].ti = null)), 2682 f[0] === m[0] && 2683 f[1] === m[1] && 2684 0 === c[0] && 2685 0 === c[1] && 2686 0 === d[0] && 2687 0 === d[1] && 2688 (2 === f.length || 2689 (f[2] === m[2] && 0 === c[2] && 0 === d[2])) && 2690 ((i.k[p].to = null), (i.k[p].ti = null))); 2691 (this.effectsSequence = [s.bind(this)]), 2692 (this.data = i), 2693 (this.keyframes = i.k), 2694 (this.keyframesMetadata = []), 2695 (this.offsetTime = e.data.st), 2696 (this.k = !0), 2697 (this.kf = !0), 2698 (this._isFirstFrame = !0), 2699 (this.mult = h || 1), 2700 (this.elem = e), 2701 (this.container = l), 2702 (this.comp = e.comp), 2703 (this.getValue = n), 2704 (this.setVValue = a), 2705 (this.interpolateValue = r), 2706 (this.frameId = -1); 2707 var y = i.k[0].s.length; 2708 for ( 2709 this.v = createTypedArray("float32", y), 2710 this.pv = createTypedArray("float32", y), 2711 p = 0; 2712 p < y; 2713 p += 1 2714 ) 2715 (this.v[p] = t), (this.pv[p] = t); 2716 (this._caching = { 2717 lastFrame: t, 2718 lastIndex: 0, 2719 value: createTypedArray("float32", y), 2720 }), 2721 (this.addEffect = o); 2722 } 2723 return { 2724 getProp: function (t, e, r, i, s) { 2725 var a; 2726 if (e.k.length) 2727 if ("number" == typeof e.k[0]) a = new l(t, e, i, s); 2728 else 2729 switch (r) { 2730 case 0: 2731 a = new p(t, e, i, s); 2732 break; 2733 case 1: 2734 a = new f(t, e, i, s); 2735 } 2736 else a = new h(t, e, i, s); 2737 return a.effectsSequence.length && s.addDynamicProperty(a), a; 2738 }, 2739 }; 2740 })(); 2741 function DynamicPropertyContainer() {} 2742 DynamicPropertyContainer.prototype = { 2743 addDynamicProperty: function (t) { 2744 -1 === this.dynamicProperties.indexOf(t) && 2745 (this.dynamicProperties.push(t), 2746 this.container.addDynamicProperty(this), 2747 (this._isAnimated = !0)); 2748 }, 2749 iterateDynamicProperties: function () { 2750 var t; 2751 this._mdf = !1; 2752 var e = this.dynamicProperties.length; 2753 for (t = 0; t < e; t += 1) 2754 this.dynamicProperties[t].getValue(), 2755 this.dynamicProperties[t]._mdf && (this._mdf = !0); 2756 }, 2757 initDynamicPropertyContainer: function (t) { 2758 (this.container = t), 2759 (this.dynamicProperties = []), 2760 (this._mdf = !1), 2761 (this._isAnimated = !1); 2762 }, 2763 }; 2764 var pointPool = poolFactory(8, function () { 2765 return createTypedArray("float32", 2); 2766 });
2767 function ShapePath() { 2768 (this.c = !1), 2769 (this._length = 0), 2770 (this._maxLength = 8), 2771 (this.v = createSizedArray(this._maxLength)), 2772 (this.o = createSizedArray(this._maxLength)), 2773 (this.i = createSizedArray(this._maxLength)); 2774 } 2775 (ShapePath.prototype.setPathData = function (t, e) { 2776 (this.c = t), this.setLength(e); 2777 for (var r = 0; r < e; ) 2778 (this.v[r] = pointPool.newElement()), 2779 (this.o[r] = pointPool.newElement()), 2780 (this.i[r] = pointPool.newElement()), 2781 (r += 1); 2782 }), 2783 (ShapePath.prototype.setLength = function (t) { 2784 for (; this._maxLength < t; ) this.doubleArrayLength(); 2785 this._length = t; 2786 }), 2787 (ShapePath.prototype.doubleArrayLength = function () { 2788 (this.v = this.v.concat(createSizedArray(this._maxLength))), 2789 (this.i = this.i.concat(createSizedArray(this._maxLength))), 2790 (this.o = this.o.concat(createSizedArray(this._maxLength))), 2791 (this._maxLength *= 2); 2792 }), 2793 (ShapePath.prototype.setXYAt = function (t, e, r, i, s) { 2794 var a; 2795 switch ( 2796 ((this._length = Math.max(this._length, i + 1)), 2797 this._length >
2797= this._maxLength && this.doubleArrayLength(), 2798 r) 2799 ) { 2800 case "v": 2801 a = this.v; 2802 break; 2803 case "i": 2804 a = this.i; 2805 break; 2806 case "o": 2807 a = this.o; 2808 break; 2809 default: 2810 a = []; 2811 } 2812 (!a[i] || (a[i] && !s)) && (a[i] = pointPool.newElement()), 2813 (a[i][0] = t), 2814 (a[i][1] = e); 2815 }), 2816 (ShapePath.prototype.setTripleAt = function (t, e, r, i, s, a, n, o) { 2817 this.setXYAt(t, e, "v", n, o), 2818 this.setXYAt(r, i, "o", n, o), 2819 this.setXYAt(s, a, "i", n, o); 2820 }), 2821 (ShapePath.prototype.reverse = function () { 2822 var t = new ShapePath(); 2823 t.setPathData(this.c, this._length); 2824 var e = this.v, 2825 r = this.o, 2826 i = this.i, 2827 s = 0; 2828 this.c && 2829 (t.setTripleAt( 2830 e[0][0], 2831 e[0][1], 2832 i[0][0], 2833 i[0][1], 2834 r[0][0], 2835 r[0][1], 2836 0, 2837 !1 2838 ), 2839 (s = 1)); 2840 var a, 2841 n = this._length - 1, 2842 o = this._length; 2843 for (a = s; a < o; a += 1) 2844 t.setTripleAt( 2845 e[n][0], 2846 e[n][1], 2847 i[n][0], 2848 i[n][1], 2849 r[n][0], 2850 r[n][1], 2851 a, 2852 !1 2853 ), 2854 (n -= 1); 2855 return t; 2856 }), 2857 (ShapePath.prototype.length = function () { 2858 return this._length; 2859 }); 2860 var shapePool = 2861 ((factory = poolFactory( 2862 4, 2863 function () { 2864 return new ShapePath(); 2865 }, 2866 function (t) { 2867 var e, 2868 r = t._length; 2869 for (e = 0; e < r; e += 1) 2870 pointPool.release(t.v[e]), 2871 pointPool.release(t.i[e]), 2872 pointPool.release(t.o[e]), 2873 (t.v[e] = null), 2874 (t.i[e] = null), 2875 (t.o[e] = null); 2876 (t._length = 0), (t.c = !1); 2877 } 2878 )), 2879 (factory.clone = function (t) { 2880 var e, 2881 r = factory.newElement(), 2882 i = void 0 === t._length ? t.v.length : t._length; 2883 for (r.setLength(i), r.c = t.c, e = 0; e < i; e += 1) 2884 r.setTripleAt( 2885 t.v[e][0], 2886 t.v[e][1], 2887 t.o[e][0], 2888 t.o[e][1], 2889 t.i[e][0], 2890 t.i[e][1], 2891 e 2892 ); 2893 return r; 2894 }), 2895 factory), 2896 factory; 2897 function ShapeCollection() { 2898 (this._length = 0), 2899 (this._maxLength = 4), 2900 (this.shapes = createSizedArray(this._maxLength)); 2901 } 2902 (ShapeCollection.prototype.addShape = function (t) { 2903 this._length === this._maxLength && 2904 ((this.shapes = this.shapes.concat(createSizedArray(this._maxLength))), 2905 (this._maxLength *= 2)), 2906 (this.shapes[this._length] = t), 2907 (this._length += 1); 2908 }), 2909 (ShapeCollection.prototype.releaseShapes = function () { 2910 var t; 2911 for (t = 0; t < this._length; t += 1) shapePool.release(this.shapes[t]); 2912 this._length = 0; 2913 }); 2914 var shapeCollectionPool = 2915 ((ob = { 2916 newShapeCollection: function () { 2917 return _length ? pool[(_length -= 1)] : new ShapeCollection(); 2918 }, 2919 release: function (t) { 2920 var e, 2921 r = t._length; 2922 for (e = 0; e < r; e += 1) shapePool.release(t.shapes[e]); 2923 (t._length = 0), 2924 _length === _maxLength && 2925 ((pool = pooling.double(pool)), (_maxLength *= 2)), 2926 (pool[_length] = t), 2927 (_length += 1); 2928 }, 2929 }), 2930 (_length = 0), 2931 (_maxLength = 4), 2932 (pool = createSizedArray(_maxLength)), 2933 ob), 2934 ob, 2935 _length, 2936 _maxLength, 2937 pool, 2938 ShapePropertyFactory = (function () { 2939 var t = -999999; 2940 function e(t, e, r) { 2941 var i, 2942 s, 2943 a, 2944 n, 2945 o, 2946 h, 2947 l, 2948 p, 2949 f, 2950 m = r.lastIndex, 2951 c = this.keyframes; 2952 if (t < c[0].t - this.offsetTime) (i = c[0].s[0]), (a = !0), (m = 0); 2953 else if (t >= c[c.length - 1].t - this.offsetTime) 2954 (i = c[c.length - 1].s 2955 ? c[c.length - 1].s[0] 2956 : c[c.length - 2].e[0]), 2957 (a = !0);
2958 else { 2959 for ( 2960 var d, u, y, g = m, v = c.length - 1, b = !0; 2961 b && ((d = c[g]), !((u = c[g + 1]).t - this.offsetTime > t)); 2962 2963 ) 2964 g < v - 1 ? (g += 1) : (b = !1); 2965 if ( 2966 ((y = this.keyframesMetadata[g] || {}), (m = g), !(a = 1 === d.h)) 2967 ) { 2968 if (t >= u.t - this.offsetTime) p = 1; 2969 else if (t < d.t - this.offsetTime) p = 0; 2970 else { 2971 var P; 2972 y.__fnct 2973 ? (P = y.__fnct) 2974 : ((P = BezierFactory.getBezierEasing( 2975 d.o.x, 2976 d.o.y, 2977 d.i.x, 2978 d.i.y 2979 ).get), 2980 (y.__fnct = P)), 2981 (p = P( 2982 (t - (d.t - this.offsetTime)) / 2983 (u.t - this.offsetTime - (d.t - this.offsetTime)) 2984 )); 2985 } 2986 s = u.s ? u.s[0] : d.e[0]; 2987 } 2988 i = d.s[0]; 2989 } 2990 for ( 2991 h = e._length, l = i.i[0].length, r.lastIndex = m, n = 0; 2992 n < h; 2993 n += 1 2994 ) 2995 for (o = 0; o < l; o += 1) 2996 (f = a ? i.i[n][o] : i.i[n][o] + (s.i[n][o] - i.i[n][o]) * p), 2997 (e.i[n][o] = f), 2998 (f = a ? i.o[n][o] : i.o[n][o] + (s.o[n][o] - i.o[n][o]) * p), 2999 (e.o[n][o] = f), 3000 (f = a ? i.v[n][o] : i.v[n][o] + (s.v[n][o] - i.v[n][o]) * p), 3001 (e.v[n][o] = f); 3002 } 3003 function r() { 3004 var e = this.comp.renderedFrame - this.offsetTime, 3005 r = this.keyframes[0].t - this.offsetTime, 3006 i = this.keyframes[this.keyframes.length - 1].t - this.offsetTime, 3007 s = this._caching.lastFrame; 3008 return ( 3009 (s !== t && ((s < r && e < r) || (s > i && e > i))) || 3010 ((this._caching.lastIndex = s < e ? this._caching.lastIndex : 0), 3011 this.interpolateShape(e, this.pv, this._caching)), 3012 (this._caching.lastFrame = e), 3013 this.pv 3014 ); 3015 } 3016 function i() { 3017 this.paths = this.localShapeCollection; 3018 } 3019 function s(t) { 3020 (function (t, e) { 3021 if (t._length !== e._length || t.c !== e.c) return !1; 3022 var r, 3023 i = t._length; 3024 for (r = 0; r < i; r += 1) 3025 if ( 3026 t.v[r][0] !== e.v[r][0] || 3027 t.v[r][1] !== e.v[r][1] || 3028 t.o[r][0] !== e.o[r][0] || 3029 t.o[r][1] !== e.o[r][1] || 3030 t.i[r][0] !== e.i[r][0] || 3031 t.i[r][1] !== e.i[r][1] 3032 ) 3033 return !1; 3034 return !0; 3035 })(this.v, t) || 3036 ((this.v = shapePool.clone(t)), 3037 this.localShapeCollection.releaseShapes(), 3038 this.localShapeCollection.addShape(this.v), 3039 (this._mdf = !0), 3040 (this.paths = this.localShapeCollection)); 3041 } 3042 function a() { 3043 if (this.elem.globalData.frameId !== this.frameId) 3044 if (this.effectsSequence.length) 3045 if (this.lock) this.setVValue(this.pv); 3046 else { 3047 var t, e; 3048 (this.lock = !0), 3049 (this._mdf = !1), 3050 (t = this.kf 3051 ? this.pv 3052 : this.data.ks 3053 ? this.data.ks.k 3054 : this.data.pt.k); 3055 var r = this.effectsSequence.length; 3056 for (e = 0; e < r; e += 1) t = this.effectsSequence[e](t); 3057 this.setVValue(t), 3058 (this.lock = !1), 3059 (this.frameId = this.elem.globalData.frameId); 3060 } 3061 else this._mdf = !1; 3062 } 3063 function n(t, e, r) { 3064 (this.propType = "shape"), 3065 (this.comp = t.comp), 3066 (this.container = t), 3067 (this.elem = t), 3068 (this.data = e), 3069 (this.k = !1), 3070 (this.kf = !1), 3071 (this._mdf = !1);
3072 var s = 3 === r ? e.pt.k : e.ks.k; 3073 (this.v = shapePool.clone(s)), 3074 (this.pv = shapePool.clone(this.v)), 3075 (this.localShapeCollection = 3076 shapeCollectionPool.newShapeCollection()), 3077 (this.paths = this.localShapeCollection), 3078 this.paths.addShape(this.v), 3079 (this.reset = i), 3080 (this.effectsSequence = []); 3081 } 3082 function o(t) { 3083 this.effectsSequence.push(t), this.container.addDynamicProperty(this); 3084 } 3085 function h(e, s, a) { 3086 (this.propType = "shape"), 3087 (this.comp = e.comp), 3088 (this.elem = e), 3089 (this.container = e), 3090 (this.offsetTime = e.data.st), 3091 (this.keyframes = 3 === a ? s.pt.k : s.ks.k), 3092 (this.keyframesMetadata = []), 3093 (this.k = !0), 3094 (this.kf = !0); 3095 var n = this.keyframes[0].s[0].i.length; 3096 (this.v = shapePool.newElement()), 3097 this.v.setPathData(this.keyframes[0].s[0].c, n), 3098 (this.pv = shapePool.clone(this.v)), 3099 (this.localShapeCollection = 3100 shapeCollectionPool.newShapeCollection()), 3101 (this.paths = this.localShapeCollection), 3102 this.paths.addShape(this.v), 3103 (this.lastFrame = t), 3104 (this.reset = i), 3105 (this._caching = { lastFrame: t, lastIndex: 0 }), 3106 (this.effectsSequence = [r.bind(this)]); 3107 } 3108 (n.prototype.interpolateShape = e), 3109 (n.prototype.getValue = a), 3110 (n.prototype.setVValue = s), 3111 (n.prototype.addEffect = o), 3112 (h.prototype.getValue = a), 3113 (h.prototype.interpolateShape = e), 3114 (h.prototype.setVValue = s), 3115 (h.prototype.addEffect = o); 3116 var l = (function () { 3117 var t = roundCorner; 3118 function e(t, e) { 3119 (this.v = shapePool.newElement()), 3120 this.v.setPathData(!0, 4), 3121 (this.localShapeCollection = 3122 shapeCollectionPool.newShapeCollection()), 3123 (this.paths = this.localShapeCollection), 3124 this.localShapeCollection.addShape(this.v), 3125 (this.d = e.d), 3126 (this.elem = t), 3127 (this.comp = t.comp), 3128 (this.frameId = -1), 3129 this.initDynamicPropertyContainer(t), 3130 (this.p = PropertyFactory.getProp(t, e.p, 1, 0, this)), 3131 (this.s = PropertyFactory.getProp(t, e.s, 1, 0, this)), 3132 this.dynamicProperties.length 3133 ? (this.k = !0) 3134 : ((this.k = !1), this.convertEllToPath()); 3135 } 3136 return ( 3137 (e.prototype = { 3138 reset: i, 3139 getValue: function () { 3140 this.elem.globalData.frameId !== this.frameId && 3141 ((this.frameId = this.elem.globalData.frameId), 3142 this.iterateDynamicProperties(), 3143 this._mdf && this.convertEllToPath()); 3144 }, 3145 convertEllToPath: function () { 3146 var e = this.p.v[0], 3147 r = this.p.v[1], 3148 i = this.s.v[0] / 2, 3149 s = this.s.v[1] / 2, 3150 a = 3 !== this.d, 3151 n = this.v; 3152 (n.v[0][0] = e), 3153 (n.v[0][1] = r - s), 3154 (n.v[1][0] = a ? e + i : e - i), 3155 (n.v[1][1] = r), 3156 (n.v[2][0] = e), 3157 (n.v[2][1] = r + s), 3158 (n.v[3][0] = a ? e - i : e + i), 3159 (n.v[3][1] = r), 3160 (n.i[0][0] = a ? e - i * t : e + i * t), 3161 (n.i[0][1] = r - s), 3162 (n.i[1][0] = a ? e + i : e - i), 3163 (n.i[1][1] = r - s * t), 3164 (n.i[2][0] = a ? e + i * t : e - i * t), 3165 (n.i[2][1] = r + s), 3166 (n.i[3][0] = a ? e - i : e + i), 3167 (n.i[3][1] = r + s * t), 3168 (n.o[0][0] = a ? e + i * t : e - i * t), 3169 (n.o[0][1] = r - s), 3170 (n.o[1][0] = a ? e + i : e - i), 3171 (n.o[1][1] = r + s * t), 3172 (n.o[2][0] = a ? e - i * t : e + i * t), 3173 (n.o[2][1] = r + s), 3174 (n.o[3][0] = a ? e - i : e + i), 3175 (n.o[3][1] = r - s * t); 3176 }, 3177 }), 3178 extendPrototype([DynamicPropertyContainer], e), 3179 e 3180 ); 3181 })(), 3182 p = (function () { 3183 function t(t, e) { 3184 (this.v = shapePool.newElement()), 3185 this.v.setPathData(!0, 0), 3186 (this.elem = t), 3187 (this.comp = t.comp), 3188 (this.data = e), 3189 (this.frameId = -1), 3190 (this.d = e.d), 3191 this.initDynamicPropertyContainer(t), 3192 1 === e.sy 3193 ? ((this.ir = PropertyFactory.getProp(t, e.ir, 0, 0, this)), 3194 (this.is = PropertyFactory.getProp(t, e.is, 0, 0.01, this)), 3195 (this.convertToPath = this.convertStarToPath)) 3196 : (this.convertToPath = this.convertPolygonToPath), 3197 (this.pt = PropertyFactory.getProp(t, e.pt, 0, 0, this)), 3198 (this.p = PropertyFactory.getProp(t, e.p, 1, 0, this)), 3199 (this.r = PropertyFactory.getProp(t, e.r, 0, degToRads, this)), 3200 (this.or = PropertyFactory.getProp(t, e.or, 0, 0, this)), 3201 (this.os = PropertyFactory.getProp(t, e.os, 0, 0.01, this)), 3202 (this.localShapeCollection = 3203 shapeCollectionPool.newShapeCollection()), 3204 this.localShapeCollection.addShape(this.v), 3205 (this.paths = this.localShapeCollection), 3206 this.dynamicProperties.length 3207 ? (this.k = !0) 3208 : ((this.k = !1), this.convertToPath()); 3209 } 3210 return ( 3211 (t.prototype = { 3212 reset: i, 3213 getValue: function () { 3214 this.elem.globalData.frameId !== this.frameId && 3215 ((this.frameId = this.elem.globalData.frameId), 3216 this.iterateDynamicProperties(), 3217 this._mdf && this.convertToPath()); 3218 }, 3219 convertStarToPath: function () { 3220 var t, 3221 e, 3222 r, 3223 i, 3224 s = 2 * Math.floor(this.pt.v), 3225 a = (2 * Math.PI) / s, 3226 n = !0, 3227 o = this.or.v, 3228 h = this.ir.v, 3229 l = this.os.v, 3230 p = this.is.v, 3231 f = (2 * Math.PI * o) / (2 * s), 3232 m = (2 * Math.PI * h) / (2 * s), 3233 c = -Math.PI / 2; 3234 c += this.r.v; 3235 var d = 3 === this.data.d ? -1 : 1; 3236 for (this.v._length = 0, t = 0; t < s; t += 1) { 3237 (r = n ? l : p), (i = n ? f : m); 3238 var u = (e = n ? o : h) * Math.cos(c), 3239 y = e * Math.sin(c), 3240 g = 0 === u && 0 === y ? 0 : y / Math.sqrt(u * u + y * y), 3241 v = 3242 0 === u && 0 === y ? 0 : -u / Math.sqrt(u * u + y * y); 3243 (u += +this.p.v[0]), 3244 (y += +this.p.v[1]), 3245 this.v.setTripleAt( 3246 u, 3247 y, 3248 u - g * i * r * d, 3249 y - v * i * r * d, 3250 u + g * i * r * d, 3251 y + v * i * r * d, 3252 t, 3253 !0 3254 ), 3255 (n = !n), 3256 (c += a * d); 3257 } 3258 }, 3259 convertPolygonToPath: function () { 3260 var t, 3261 e = Math.floor(this.pt.v), 3262 r = (2 * Math.PI) / e, 3263 i = this.or.v, 3264 s = this.os.v, 3265 a = (2 * Math.PI * i) / (4 * e), 3266 n = 0.5 * -Math.PI, 3267 o = 3 === this.data.d ? -1 : 1; 3268 for ( 3269 n += this.r.v, this.v._length = 0, t = 0; 3270 t < e; 3271 t += 1 3272 ) { 3273 var h = i * Math.cos(n), 3274 l = i * Math.sin(n), 3275 p = 0 === h && 0 === l ? 0 : l / Math.sqrt(h * h + l * l), 3276 f = 3277 0 === h && 0 === l ? 0 : -h / Math.sqrt(h * h + l * l); 3278 (h += +this.p.v[0]), 3279 (l += +this.p.v[1]), 3280 this.v.setTripleAt( 3281 h, 3282 l, 3283 h - p * a * s * o, 3284 l - f * a * s * o, 3285 h + p * a * s * o, 3286 l + f * a * s * o, 3287 t, 3288 !0 3289 ), 3290 (n += r * o); 3291 } 3292 (this.paths.length = 0), (this.paths[0] = this.v); 3293 }, 3294 }), 3295 extendPrototype([DynamicPropertyContainer], t), 3296 t 3297 ); 3298 })(), 3299 f = (function () { 3300 function t(t, e) { 3301 (this.v = shapePool.newElement()), 3302 (this.v.c = !0), 3303 (this.localShapeCollection = 3304 shapeCollectionPool.newShapeCollection()), 3305 this.localShapeCollection.addShape(this.v), 3306 (this.paths = this.localShapeCollection), 3307 (this.elem = t), 3308 (this.comp = t.comp), 3309 (this.frameId = -1), 3310 (this.d = e.d), 3311 this.initDynamicPropertyContainer(t), 3312 (this.p = PropertyFactory.getProp(t, e.p, 1, 0, this)), 3313 (this.s = PropertyFactory.getProp(t, e.s, 1, 0, this)), 3314 (this.r = PropertyFactory.getProp(t, e.r, 0, 0, this)), 3315 this.dynamicProperties.length 3316 ? (this.k = !0) 3317 : ((this.k = !1), this.convertRectToPath()); 3318 } 3319 return ( 3320 (t.prototype = { 3321 convertRectToPath: function () { 3322 var t = this.p.v[0], 3323 e = this.p.v[1], 3324 r = this.s.v[0] / 2, 3325 i = this.s.v[1] / 2, 3326 s = bmMin(r, i, this.r.v), 3327 a = s * (1 - roundCorner); 3328 (this.v._length = 0), 3329 2 === this.d || 1 === this.d 3330 ? (this.v.setTripleAt( 3331 t + r, 3332 e - i + s, 3333 t + r, 3334 e - i + s, 3335 t + r, 3336 e - i + a, 3337 0, 3338 !0 3339 ), 3340 this.v.setTripleAt( 3341 t + r, 3342 e + i - s, 3343 t + r, 3344 e + i - a, 3345 t + r, 3346 e + i - s, 3347 1, 3348 !0 3349 ), 3350 0 !== s 3351 ? (this.v.setTripleAt( 3352 t + r - s, 3353 e + i, 3354 t + r - s, 3355 e + i, 3356 t + r - a, 3357 e + i, 3358 2, 3359 !0 3360 ), 3361 this.v.setTripleAt( 3362 t - r + s, 3363 e + i, 3364 t - r + a, 3365 e + i, 3366 t - r + s, 3367 e + i, 3368 3, 3369 !0 3370 ), 3371 this.v.setTripleAt( 3372 t - r, 3373 e + i - s, 3374 t - r, 3375 e + i - s, 3376 t - r, 3377 e + i - a, 3378 4, 3379 !0 3380 ), 3381 this.v.setTripleAt( 3382 t - r, 3383 e - i + s, 3384 t - r, 3385 e - i + a, 3386 t - r, 3387 e - i + s, 3388 5, 3389 !0 3390 ), 3391 this.v.setTripleAt( 3392 t - r + s, 3393 e - i, 3394 t - r + s, 3395 e - i, 3396 t - r + a, 3397 e - i, 3398 6, 3399 !0 3400 ), 3401 this.v.setTripleAt( 3402 t + r - s, 3403 e - i, 3404 t + r - a, 3405 e - i, 3406 t + r - s, 3407 e - i, 3408 7, 3409 !0 3410 )) 3411 : (this.v.setTripleAt( 3412 t - r, 3413 e + i, 3414 t - r + a, 3415 e + i, 3416 t - r, 3417 e + i, 3418 2 3419 ), 3420 this.v.setTripleAt( 3421 t - r, 3422 e - i, 3423 t - r, 3424 e - i + a, 3425 t - r, 3426 e - i, 3427 3 3428 ))) 3429 : (this.v.setTripleAt( 3430 t + r, 3431 e - i + s, 3432 t + r, 3433 e - i + a, 3434 t + r, 3435 e - i + s, 3436 0, 3437 !0 3438 ), 3439 0 !== s 3440 ? (this.v.setTripleAt( 3441 t + r - s, 3442 e - i, 3443 t + r - s, 3444 e - i, 3445 t + r - a, 3446 e - i, 3447 1, 3448 !0 3449 ), 3450 this.v.setTripleAt( 3451 t - r + s, 3452 e - i, 3453 t - r + a, 3454 e - i, 3455 t - r + s, 3456 e - i, 3457 2, 3458 !0 3459 ), 3460 this.v.setTripleAt( 3461 t - r, 3462 e - i + s, 3463 t - r, 3464 e - i + s, 3465 t -
3465r, 3466 e - i + a, 3467 3, 3468 !0 3469 ), 3470 this.v.setTripleAt( 3471 t - r, 3472 e + i - s, 3473 t - r, 3474 e + i - a, 3475 t - r, 3476 e + i - s, 3477 4, 3478 !0 3479 ), 3480 this.v.setTripleAt( 3481 t - r + s, 3482 e + i, 3483 t - r + s, 3484 e + i, 3485 t - r + a, 3486 e + i, 3487 5, 3488 !0 3489 ), 3490 this.v.setTripleAt( 3491 t + r - s, 3492 e + i, 3493 t + r - a, 3494 e + i, 3495 t + r - s, 3496 e + i, 3497 6, 3498 !0 3499 ), 3500 this.v.setTripleAt( 3501 t + r, 3502 e + i - s, 3503 t + r, 3504 e + i - s, 3505 t + r, 3506 e + i - a, 3507 7, 3508 !0 3509 )) 3510 : (this.v.setTripleAt( 3511 t - r, 3512 e - i, 3513 t - r + a, 3514 e - i, 3515 t - r, 3516 e - i, 3517 1, 3518 !0 3519 ), 3520 this.v.setTripleAt( 3521 t - r, 3522 e + i, 3523 t - r, 3524 e + i - a, 3525 t - r, 3526 e + i, 3527 2, 3528 !0 3529 ), 3530 this.v.setTripleAt( 3531 t + r, 3532 e + i, 3533 t + r - a, 3534 e + i, 3535 t + r, 3536 e + i, 3537 3, 3538 !0 3539 ))); 3540 }, 3541 getValue: function () { 3542 this.elem.globalData.frameId !== this.frameId && 3543 ((this.frameId = this.elem.globalData.frameId), 3544 this.iterateDynamicProperties(), 3545 this._mdf && this.convertRectToPath()); 3546 }, 3547 reset: i, 3548 }), 3549 extendPrototype([DynamicPropertyContainer], t), 3550 t 3551 ); 3552 })(); 3553 var m = { 3554 getShapeProp: function (t, e, r) { 3555 var i; 3556 return ( 3557 3 === r || 4 === r 3558 ? (i = (3 === r ? e.pt : e.ks).k.length 3559 ? new h(t, e, r) 3560 : new n(t, e, r)) 3561 : 5 === r 3562 ? (i = new f(t, e)) 3563 : 6 === r 3564 ? (i = new l(t, e)) 3565 : 7 === r && (i = new p(t, e)), 3566 i.k && t.addDynamicProperty(i), 3567 i 3568 ); 3569 }, 3570 getConstructorFunction: function () { 3571 return n; 3572 }, 3573 getKeyframedConstructorFunction: function () { 3574 return h; 3575 }, 3576 }; 3577 return m; 3578 })(), 3579 Matrix = (function () {
3580 var t = Math.cos, 3581 e = Math.sin, 3582 r = Math.tan, 3583 i = Math.round; 3584 function s() { 3585 return ( 3586 (this.props[0] = 1), 3587 (this.props[1] = 0), 3588 (this.props[2] = 0), 3589 (this.props[3] = 0), 3590 (this.props[4] = 0), 3591 (this.props[5] = 1), 3592 (this.props[6] = 0), 3593 (this.props[7] = 0), 3594 (this.props[8] = 0), 3595 (this.props[9] = 0), 3596 (this.props[10] = 1), 3597 (this.props[11] = 0), 3598 (this.props[12] = 0), 3599 (this.props[13] = 0), 3600 (this.props[14] = 0), 3601 (this.props[15] = 1), 3602 this 3603 ); 3604 } 3605 function a(r) { 3606 if (0 === r) return this; 3607 var i = t(r), 3608 s = e(r); 3609 return this._t(i, -s, 0, 0, s, i, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 3610 } 3611 function n(r) { 3612 if (0 === r) return this; 3613 var i = t(r), 3614 s = e(r); 3615 return this._t(1, 0, 0, 0, 0, i, -s, 0, 0, s, i, 0, 0, 0, 0, 1); 3616 } 3617 function o(r) { 3618 if (0 === r) return this; 3619 var i = t(r), 3620 s = e(r); 3621 return this._t(i, 0, s, 0, 0, 1, 0, 0, -s, 0, i, 0, 0, 0, 0, 1); 3622 } 3623 function h(r) { 3624 if (0 === r) return this; 3625 var i = t(r), 3626 s = e(r); 3627 return this._t(i, -s, 0, 0, s, i, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 3628 } 3629 function l(t, e) { 3630 return this._t(1, e, t, 1, 0, 0); 3631 } 3632 function p(t, e) { 3633 return this.shear(r(t), r(e)); 3634 } 3635 function f(i, s) { 3636 var a = t(s), 3637 n = e(s); 3638 return this._t(a, n, 0, 0, -n, a, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) 3639 ._t(1, 0, 0, 0, r(i), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) 3640 ._t(a, -n, 0, 0, n, a, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 3641 } 3642 function m(t, e, r) { 3643 return ( 3644 r || 0 === r || (r = 1), 3645 1 === t && 1 === e && 1 === r 3646 ? this 3647 : this._t(t, 0, 0, 0, 0, e, 0, 0, 0, 0, r, 0, 0, 0, 0, 1) 3648 ); 3649 } 3650 function c(t, e, r, i, s, a, n, o, h, l, p, f, m, c, d, u) { 3651 return ( 3652 (this.props[0] = t), 3653 (this.props[1] = e), 3654 (this.props[2] = r), 3655 (this.props[3] = i), 3656 (this.props[4] = s), 3657 (this.props[5] = a), 3658 (this.props[6] = n), 3659 (this.props[7] = o), 3660 (this.props[8] = h), 3661 (this.props[9] = l), 3662 (this.props[10] = p), 3663 (this.props[11] = f), 3664 (this.props[12] = m), 3665 (this.props[13] = c), 3666 (this.props[14] = d), 3667 (this.props[15] = u), 3668 this 3669 ); 3670 } 3671 function d(t, e, r) { 3672 return ( 3673 (r = r || 0), 3674 0 !== t || 0 !== e || 0 !== r 3675 ? this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t, e, r, 1) 3676 : this 3677 ); 3678 } 3679 function u(t, e, r, i, s, a, n, o, h, l, p, f, m, c, d, u) { 3680 var y = this.props; 3681 if ( 3682 1 === t && 3683 0 === e && 3684 0 === r && 3685 0 === i && 3686 0 === s && 3687 1 === a && 3688 0 === n && 3689 0 === o && 3690 0 === h && 3691 0 === l && 3692 1 === p && 3693 0 === f 3694 ) 3695 return ( 3696 (y[12] = y[12] * t + y[15] * m), 3697 (y[13] = y[13] * a + y[15] * c), 3698 (y[14] = y[14] * p + y[15] * d), 3699 (y[15] *= u), 3700 (this._identityCalculated = !1), 3701 this 3702 ); 3703 var g = y[0], 3704 v = y[1], 3705 b = y[2], 3706 P = y[3], 3707 x = y[4], 3708 E = y[5], 3709 S = y[6], 3710 _ = y[7], 3711 C = y[8], 3712 A = y[9], 3713 M = y[10], 3714 T = y[11], 3715 D = y[12], 3716 k = y[13], 3717 F = y[14], 3718 w = y[15]; 3719 return ( 3720 (y[0] = g * t + v * s + b * h + P * m), 3721 (y[1] = g * e + v * a + b * l + P * c), 3722 (y[2] = g * r + v * n + b * p + P * d), 3723 (y[3] = g * i + v * o + b * f + P * u), 3724 (y[4] = x * t + E * s + S * h + _ * m), 3725 (y[5] = x * e + E * a + S * l + _ * c), 3726 (y[6] = x * r + E * n + S * p + _ * d), 3727 (y[7] = x * i + E * o + S * f + _ * u), 3728 (y[8] = C * t + A * s + M * h + T * m), 3729 (y[9] = C * e + A * a + M * l + T * c), 3730 (y[10] = C * r + A * n + M * p + T * d), 3731 (y[11] = C * i + A * o + M * f + T * u), 3732 (y[12] = D * t + k * s + F * h + w * m), 3733 (y[13] = D * e + k * a + F * l + w * c), 3734 (y[14] = D * r + k * n + F * p + w * d), 3735 (y[15] = D * i + k * o + F * f + w * u), 3736 (this._identityCalculated = !1), 3737 this 3738 ); 3739 } 3740 function y() { 3741 return ( 3742 this._identityCalculated || 3743 ((this._identity = !( 3744 1 !== this.props[0] || 3745 0 !== this.props[1] || 3746 0 !== this.props[2] || 3747 0 !== this.props[3] || 3748 0 !== this.props[4] || 3749 1 !== this.props[5] || 3750 0 !== this.props[6] || 3751 0 !== this.props[7] || 3752 0 !== this.props[8] || 3753 0 !== this.props[9] || 3754 1 !== this.props[10] || 3755 0 !== this.props[11] || 3756 0 !== this.props[12] || 3757 0 !== this.props[13] || 3758 0 !== this.props[14] || 3759 1 !== this.props[15] 3760 )), 3761 (this._identityCalculated = !0)), 3762 this._identity 3763 ); 3764 } 3765 function g(t) { 3766 for (var e = 0; e < 16; ) { 3767 if (t.props[e] !== this.props[e]) return !1; 3768 e += 1; 3769 } 3770 return !0; 3771 } 3772 function v(t) { 3773 var e; 3774 for (e = 0; e < 16; e += 1) t.props[e] = this.props[e]; 3775 return t; 3776 } 3777 function b(t) { 3778 var e; 3779 for (e = 0; e < 16; e += 1) this.props[e] = t[e]; 3780 } 3781 function P(t, e, r) { 3782 return { 3783 x: 3784 t * this.props[0] + 3785 e * this.props[4] + 3786 r * this.props[8] + 3787 this.props[12], 3788 y: 3789 t * this.props[1] + 3790 e * this.props[5] + 3791 r * this.props[9] + 3792 this.props[13], 3793 z: 3794 t * this.props[2] + 3795 e * this.props[6] + 3796 r * this.props[10] + 3797 this.props[14], 3798 }; 3799 } 3800 function x(t, e, r) { 3801 return ( 3802 t * this.props[0] + 3803 e * this.props[4] + 3804 r * this.props[8] + 3805 this.props[12] 3806 ); 3807 } 3808 function E(t, e, r) { 3809 return ( 3810 t * this.props[1] + 3811 e * this.props[5] + 3812 r * this.props[9] + 3813 this.props[13] 3814 ); 3815 } 3816 function S(t, e, r) { 3817 return ( 3818 t * this.props[2] + 3819 e * this.props[6] + 3820 r * this.props[10] + 3821 this.props[14] 3822 ); 3823 } 3824 function _() { 3825 var t = this.props[0] * this.props[5] - this.props[1] * this.props[4], 3826 e = this.props[5] / t, 3827 r = -this.props[1] / t, 3828 i = -this.props[4] / t, 3829 s = this.props[0] / t, 3830 a = 3831 (this.props[4] * this.props[13] - 3832 this.props[5] * this.props[12]) / 3833 t, 3834 n = 3835 -( 3836 this.props[0] * this.props[13] - 3837 this.props[1] * this.props[12] 3838 ) / t, 3839 o = new Matrix(); 3840 return ( 3841 (o.props[0] = e), 3842 (o.props[1] = r), 3843 (o.props[4] = i), 3844 (o.props[5] = s), 3845 (o.props[12] = a), 3846 (o.props[13] = n), 3847 o 3848 ); 3849 } 3850 function C(t) { 3851 return this.getInverseMatrix().applyToPointArray( 3852 t[0], 3853 t[1], 3854 t[2] || 0 3855 ); 3856 } 3857 function A(t) { 3858 var e, 3859 r = t.length, 3860 i = []; 3861 for (e = 0; e < r; e += 1) i[e] = C(t[e]); 3862 return i; 3863 } 3864 function M(t, e, r) { 3865 var i = createTypedArray("float32", 6); 3866 if (this.isIdentity()) 3867 (i[0] = t[0]), 3868 (i[1] = t[1]), 3869 (i[2] = e[0]), 3870 (i[3] = e[1]), 3871 (i[4] = r[0]), 3872 (i[5] = r[1]); 3873 else { 3874 var s = this.props[0], 3875 a = this.props[1], 3876 n = this.props[4], 3877 o = this.props[5], 3878 h = this.props[12], 3879 l = this.props[13]; 3880 (i[0] = t[0] * s + t[1] * n + h), 3881 (i[1] = t[0] * a + t[1] * o + l), 3882 (i[2] = e[0] * s + e[1] * n + h), 3883 (i[3] = e[0] * a + e[1] * o + l), 3884 (i[4] = r[0] * s + r[1] * n + h), 3885 (i[5] = r[0] * a + r[1] * o + l); 3886 } 3887 return i; 3888 } 3889 function T(t, e, r) { 3890 return this.isIdentity() 3891 ? [t, e, r] 3892 : [ 3893 t * this.props[0] + 3894 e * this.props[4] + 3895 r * this.props[8] + 3896 this.props[12], 3897 t * this.props[1] + 3898 e * this.props[5] + 3899 r * this.props[9] + 3900 this.props[13], 3901 t * this.props[2] + 3902 e * this.props[6] + 3903 r * this.props[10] + 3904 this.props[14], 3905 ]; 3906 } 3907 function D(t, e) { 3908 if (this.isIdentity()) return t + "," + e; 3909 var r = this.props; 3910 return ( 3911 Math.round(100 * (t * r[0] + e * r[4] + r[12])) / 100 + 3912 "," + 3913 Math.round(100 * (t * r[1] + e * r[5] + r[13])) / 100 3914 ); 3915 } 3916 function k() { 3917 for (var t = 0, e = this.props, r = "matrix3d("; t < 16; ) 3918 (r += i(1e4 * e[t]) / 1e4), (r += 15 === t ? ")" : ","), (t += 1); 3919 return r; 3920 } 3921 function F(t) { 3922 return (t < 1e-6 && t > 0) || (t > -1e-6 && t < 0) 3923 ? i(1e4 * t) / 1e4 3924 : t; 3925 } 3926 function w() { 3927 var t = this.props; 3928 return (
3929 "matrix(" + 3930 F(t[0]) + 3931 "," + 3932 F(t[1]) + 3933 "," + 3934 F(t[4]) + 3935 "," + 3936 F(t[5]) + 3937 "," + 3938 F(t[12]) + 3939 "," + 3940 F(t[13]) + 3941 ")" 3942 ); 3943 } 3944 return function () { 3945 (this.reset = s), 3946 (this.rotate = a), 3947 (this.rotateX = n), 3948 (this.rotateY = o), 3949 (this.rotateZ = h), 3950 (this.skew = p), 3951 (this.skewFromAxis = f), 3952 (this.shear = l), 3953 (this.scale = m), 3954 (this.setTransform = c), 3955 (this.translate = d), 3956 (this.transform = u), 3957 (this.applyToPoint = P), 3958 (this.applyToX = x), 3959 (this.applyToY = E), 3960 (this.applyToZ = S), 3961 (this.applyToPointArray = T), 3962 (this.applyToTriplePoints = M), 3963 (this.applyToPointStringified = D), 3964 (this.toCSS = k), 3965 (this.to2dCSS = w), 3966 (this.clone = v), 3967 (this.cloneFromProps = b), 3968 (this.equals = g), 3969 (this.inversePoints = A), 3970 (this.inversePoint = C), 3971 (this.getInverseMatrix = _), 3972 (this._t = this.transform), 3973 (this.isIdentity = y), 3974 (this._identity = !0), 3975 (this._identityCalculated = !1), 3976 (this.props = createTypedArray("float32", 16)), 3977 this.reset(); 3978 }; 3979 })(); 3980 function _typeof$3(t) { 3981 return ( 3982 (_typeof$3 = 3983 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 3984 ? function (t) { 3985 return typeof t; 3986 } 3987 : function (t) { 3988 return t && 3989 "function" == typeof Symbol && 3990 t.constructor === Symbol && 3991 t !== Symbol.prototype 3992 ? "symbol" 3993 : typeof t; 3994 }), 3995 _typeof$3(t) 3996 ); 3997 } 3998 var lottie = {}, 3999 standalone = "__[STANDALONE]__", 4000 animationData = "__[ANIMATIONDATA]__", 4001 renderer = ""; 4002 function setLocation(t) { 4003 setLocationHref(t); 4004 } 4005 function searchAnimations() { 4006 !0 === standalone 4007 ? animationManager.searchAnimations(animationData, standalone, renderer) 4008 : animationManager.searchAnimations(); 4009 } 4010 function setSubframeRendering(t) { 4011 setSubframeEnabled(t); 4012 } 4013 function setPrefix(t) { 4014 setIdPrefix(t); 4015 } 4016 function loadAnimation(t) { 4017 return ( 4018 !0 === standalone && (t.animationData = JSON.parse(animationData)), 4019 animationManager.loadAnimation(t) 4020 ); 4021 } 4022 function setQuality(t) { 4023 if ("string" == typeof t) 4024 switch (t) { 4025 case "high": 4026 setDefaultCurveSegments(200); 4027 break; 4028 default: 4029 case "medium": 4030 setDefaultCurveSegments(50); 4031 break; 4032 case "low": 4033 setDefaultCurveSegments(10); 4034 } 4035 else !isNaN(t) && t > 1 && setDefaultCurveSegments(t); 4036 getDefaultCurveSegments() >= 50 ? roundValues(!1) : roundValues(!0); 4037 } 4038 function inBrowser() { 4039 return "undefined" != typeof navigator; 4040 } 4041 function installPlugin(t, e) { 4042 "expressions" === t && setExpressionsPlugin(e); 4043 } 4044 function getFactory(t) { 4045 switch (t) { 4046 case "propertyFactory": 4047 return PropertyFactory; 4048 case "shapePropertyFactory": 4049 return ShapePropertyFactory; 4050 case "matrix": 4051 return Matrix; 4052 default: 4053 return null; 4054 } 4055 } 4056 function checkReady() { 4057 "complete" === document.readyState && 4058 (clearInterval(readyStateCheckInterval), searchAnimations()); 4059 } 4060 function getQueryVariable(t) { 4061 for (var e = queryString.split("&"), r = 0; r < e.length; r += 1) { 4062 var i = e[r].split("="); 4063 if (decodeURIComponent(i[0]) == t) return decodeURIComponent(i[1]); 4064 } 4065 return null; 4066 } 4067 (lottie.play = animationManager.play), 4068 (lottie.pause = animationManager.pause), 4069 (lottie.setLocationHref = setLocation), 4070 (lottie.togglePause = animationManager.togglePause), 4071 (lottie.setSpeed = animationManager.setSpeed), 4072 (lottie.setDirection = animationManager.setDirection), 4073 (lottie.stop = animationManager.stop), 4074 (lottie.searchAnimations = searchAnimations), 4075 (lottie.registerAnimation = animationManager.registerAnimation), 4076 (lottie.loadAnimation = loadAnimation), 4077 (lottie.setSubframeRendering = setSubframeRendering), 4078 (lottie.resize = animationManager.resize), 4079 (lottie.goToAndStop = animationManager.goToAndStop), 4080 (lottie.destroy = animationManager.destroy), 4081 (lottie.setQuality = setQuality), 4082 (lottie.inBrowser = inBrowser), 4083 (lottie.installPlugin = installPlugin), 4084 (lottie.freeze = animationManager.freeze), 4085 (lottie.unfreeze = animationManager.unfreeze), 4086 (lottie.setVolume = animationManager.setVolume), 4087 (lottie.mute = animationManager.mute), 4088 (lottie.unmute = animationManager.unmute), 4089 (lottie.getRegisteredAnimations = 4090 animationManager.getRegisteredAnimations), 4091 (lottie.useWebWorker = setWebWorker), 4092 (lottie.setIDPrefix = setPrefix), 4093 (lottie.__getFactory = getFactory), 4094 (lottie.version = "5.10.1"); 4095 var queryString = ""; 4096 if (standalone) { 4097 var scripts = document.getElementsByTagName("script"), 4098 index = scripts.length - 1, 4099 myScript = scripts[index] || { src: "" }; 4100 (queryString = myScript.src 4101 ? myScript.src.replace(/^[^\?]+\??/, "") 4102 : ""), 4103 (renderer = getQueryVariable("renderer")); 4104 } 4105 var readyStateCheckInterval = setInterval(checkReady, 100); 4106 try { 4107 ("object" === 4108 ("undefined" == typeof exports ? "undefined" : _typeof$3(exports)) && 4109 "undefined" != typeof module) || 4110 ("function" == typeof define && define.amd) || 4111 (window.bodymovin = lottie); 4112 } catch (t) {} 4113 var ShapeModifiers = (function () { 4114 var t = {}, 4115 e = {}; 4116 return ( 4117 (t.registerModifier = function (t, r) { 4118 e[t] || (e[t] = r); 4119 }), 4120 (t.getModifier = function (t, r, i) { 4121 return new e[t](r, i); 4122 }), 4123 t 4124 ); 4125 })(); 4126 function ShapeModifier() {} 4127 function TrimModifier() {} 4128 function PuckerAndBloatModifier() {} 4129 (ShapeModifier.prototype.initModifierProperties = function () {}), 4130 (ShapeModifier.prototype.addShapeToModifier = function () {}), 4131 (ShapeModifier.prototype.addShape = function (t) { 4132 if (!this.closed) {
4133 t.sh.container.addDynamicProperty(t.sh); 4134 var e = { 4135 shape: t.sh, 4136 data: t, 4137 localShapeCollection: shapeCollectionPool.newShapeCollection(), 4138 }; 4139 this.shapes.push(e), 4140 this.addShapeToModifier(e), 4141 this._isAnimated && t.setAsAnimated(); 4142 } 4143 }), 4144 (ShapeModifier.prototype.init = function (t, e) { 4145 (this.shapes = []), 4146 (this.elem = t), 4147 this.initDynamicPropertyContainer(t), 4148 this.initModifierProperties(t, e), 4149 (this.frameId = initialDefaultFrame), 4150 (this.closed = !1), 4151 (this.k = !1), 4152 this.dynamicProperties.length ? (this.k = !0) : this.getValue(!0); 4153 }), 4154 (ShapeModifier.prototype.processKeys = function () { 4155 this.elem.globalData.frameId !== this.frameId && 4156 ((this.frameId = this.elem.globalData.frameId), 4157 this.iterateDynamicProperties()); 4158 }), 4159 extendPrototype([DynamicPropertyContainer], ShapeModifier), 4160 extendPrototype([ShapeModifier], TrimModifier), 4161 (TrimModifier.prototype.initModifierProperties = function (t, e) { 4162 (this.s = PropertyFactory.getProp(t, e.s, 0, 0.01, this)), 4163 (this.e = PropertyFactory.getProp(t, e.e, 0, 0.01, this)), 4164 (this.o = PropertyFactory.getProp(t, e.o, 0, 0, this)), 4165 (this.sValue = 0), 4166 (this.eValue = 0), 4167 (this.getValue = this.processKeys), 4168 (this.m = e.m), 4169 (this._isAnimated = 4170 !!this.s.effectsSequence.length || 4171 !!this.e.effectsSequence.length || 4172 !!this.o.effectsSequence.length); 4173 }), 4174 (TrimModifier.prototype.addShapeToModifier = function (t) { 4175 t.pathsData = []; 4176 }), 4177 (TrimModifier.prototype.calculateShapeEdges = function (t, e, r, i, s) { 4178 var a = []; 4179 e <= 1 4180 ? a.push({ s: t, e: e }) 4181 : t >= 1 4182 ? a.push({ s: t - 1, e: e - 1 }) 4183 : (a.push({ s: t, e: 1 }), a.push({ s: 0, e: e - 1 })); 4184 var n, 4185 o, 4186 h = [], 4187 l = a.length; 4188 for (n = 0; n < l; n += 1) { 4189 var p, f; 4190 if (!((o = a[n]).e * s < i || o.s * s > i + r)) 4191 (p = o.s * s <= i ? 0 : (o.s * s - i) / r), 4192 (f = o.e * s >= i + r ? 1 : (o.e * s - i) / r), 4193 h.push([p, f]); 4194 } 4195 return h.length || h.push([0, 0]), h; 4196 }), 4197 (TrimModifier.prototype.releasePathsData = function (t) { 4198 var e, 4199 r = t.length; 4200 for (e = 0; e < r; e += 1) segmentsLengthPool.release(t[e]); 4201 return (t.length = 0), t; 4202 }), 4203 (TrimModifier.prototype.processShapes = function (t) { 4204 var e, r, i, s; 4205 if (this._mdf || t) { 4206 var a = (this.o.v % 360) / 360; 4207 if ( 4208 (a < 0 && (a += 1), 4209 (e = this.s.v > 1 ? 1 + a : this.s.v < 0 ? 0 + a : this.s.v + a) > 4210 (r = this.e.v > 1 ? 1 + a : this.e.v < 0 ? 0 + a : this.e.v + a)) 4211 ) { 4212 var n = e; 4213 (e = r), (r = n); 4214 } 4215 (e = 1e-4 * Math.round(1e4 * e)), 4216 (r = 1e-4 * Math.round(1e4 * r)), 4217 (this.sValue = e), 4218 (this.eValue = r); 4219 } else (e = this.sValue), (r = this.eValue); 4220 var o, 4221 h, 4222 l, 4223 p, 4224 f, 4225 m = this.shapes.length, 4226 c = 0; 4227 if (r === e) 4228 for (s = 0; s < m; s += 1) 4229 this.shapes[s].localShapeCollection.releaseShapes(), 4230 (this.shapes[s].shape._mdf = !0), 4231 (this.shapes[s].shape.paths = 4232 this.shapes[s].localShapeCollection), 4233 this._mdf && (this.shapes[s].pathsData.length = 0); 4234 else if ((1 === r && 0 === e) || (0 === r && 1 === e)) { 4235 if (this._mdf) 4236 for (s = 0; s < m; s += 1) 4237 (this.shapes[s].pathsData.length = 0), 4238 (this.shapes[s].shape._mdf = !0); 4239 } else { 4240 var d, 4241 u, 4242 y = []; 4243 for (s = 0; s < m; s += 1) 4244 if ( 4245 (d = this.shapes[s]).shape._mdf || 4246 this._mdf || 4247 t || 4248 2 === this.m 4249 ) { 4250 if ( 4251 ((h = (i = d.shape.paths)._length), 4252 (f = 0), 4253 !d.shape._mdf && d.pathsData.length) 4254 ) 4255 f = d.totalShapeLength; 4256 else { 4257 for ( 4258 l = this.releasePathsData(d.pathsData), o = 0; 4259 o < h; 4260 o += 1 4261 ) 4262 (p = bez.getSegmentsLength(i.shapes[o])), 4263 l.push(p), 4264 (f += p.totalLength); 4265 (d.totalShapeLength = f), (d.pathsData = l); 4266 } 4267 (c += f), (d.shape._mdf = !0); 4268 } else d.shape.paths = d.localShapeCollection; 4269 var g, 4270 v = e, 4271 b = r, 4272 P = 0; 4273 for (s = m - 1; s >= 0; s -= 1) 4274 if ((d = this.shapes[s]).shape._mdf) { 4275 for ( 4276 (u = d.localShapeCollection).releaseShapes(), 4277 2 === this.m && m > 1 4278 ? ((g = this.calculateShapeEdges( 4279 e, 4280 r, 4281 d.totalShapeLength, 4282 P, 4283 c 4284 )), 4285 (P += d.totalShapeLength)) 4286 : (g = [[v, b]]), 4287 h = g.length, 4288 o = 0; 4289 o < h; 4290 o += 1 4291 ) { 4292 (v = g[o][0]), 4293 (b = g[o][1]), 4294 (y.length = 0), 4295 b <= 1 4296 ? y.push({ 4297 s: d.totalShapeLength * v, 4298 e: d.totalShapeLength * b, 4299 }) 4300 : v >= 1 4301 ? y.push({ 4302 s: d.totalShapeLength * (v - 1), 4303 e: d.totalShapeLength * (b - 1), 4304 }) 4305 : (y.push({ 4306 s: d.totalShapeLength * v, 4307 e: d.totalShapeLength, 4308 }), 4309 y.push({ s: 0, e: d.totalShapeLength * (b - 1) })); 4310 var x = this.addShapes(d, y[0]); 4311 if (y[0].s !== y[0].e) { 4312 if (y.length > 1) 4313 if (d.shape.paths.shapes[d.shape.paths._length - 1].c) { 4314 var E = x.pop(); 4315 this.addPaths(x, u), (x = this.addShapes(d, y[1], E)); 4316 } else this.addPaths(x, u), (x = this.addShapes(d, y[1])); 4317 this.addPaths(x, u); 4318 } 4319 } 4320 d.shape.paths = u; 4321 } 4322 } 4323 }), 4324 (TrimModifier.prototype.addPaths = function (t, e) { 4325 var r, 4326 i = t.length; 4327 for (r = 0; r < i; r += 1) e.addShape(t[r]); 4328 }), 4329 (TrimModifier.prototype.addSegment = function (t, e, r, i, s, a, n) { 4330 s.setXYAt(e[0], e[1], "o", a), 4331 s.setXYAt(r[0], r[1], "i", a + 1), 4332 n && s.setXYAt(t[0], t[1], "v", a), 4333 s.setXYAt(i[0], i[1], "v", a + 1); 4334 }), 4335 (TrimModifier.prototype.addSegmentFromArray = function (t, e, r, i) { 4336 e.setXYAt(t[1], t[5], "o", r), 4337 e.setXYAt(t[2], t[6], "i", r + 1), 4338 i && e.setXYAt(t[0], t[4], "v", r), 4339 e.setXYAt(t[3], t[7], "v", r + 1); 4340 }), 4341 (TrimModifier.prototype.addShapes = function (t, e, r) { 4342 var i, 4343 s, 4344 a, 4345 n, 4346 o, 4347 h, 4348 l, 4349 p, 4350 f = t.pathsData, 4351 m = t.shape.paths.shapes, 4352 c = t.shape.paths._length, 4353 d = 0, 4354 u = [], 4355 y = !0; 4356 for ( 4357 r 4358 ? ((o = r._length), (p = r._length)) 4359 : ((r = shapePool.newElement()), (o = 0), (p = 0)), 4360 u.push(r), 4361 i = 0; 4362 i < c; 4363 i += 1 4364 ) { 4365 for ( 4366 h = f[i].lengths, 4367 r.c = m[i].c, 4368 a = m[i].c ? h.length : h.length + 1, 4369 s = 1; 4370 s < a; 4371 s += 1 4372 ) 4373 if (d + (n = h[s - 1]).addedLength < e.s) 4374 (d += n.addedLength), (r.c = !1); 4375 else { 4376 if (d > e.e) { 4377 r.c = !1; 4378 break; 4379 } 4380 e.s <= d && e.e >= d + n.addedLength 4381 ? (this.addSegment( 4382 m[i].v[s - 1], 4383 m[i].o[s - 1], 4384 m[i].i[s], 4385 m[i].v[s], 4386 r, 4387 o, 4388 y 4389 ), 4390 (y = !1)) 4391 : ((l = bez.getNewSegment( 4392 m[i].v[s - 1], 4393 m[i].v[s], 4394 m[i].o[s - 1], 4395 m[i].i[s], 4396 (e.s - d) / n.addedLength, 4397 (e.e - d) / n.addedLength, 4398 h[s - 1] 4399 )), 4400 this.addSegmentFromArray(l, r, o, y), 4401 (y = !1), 4402 (r.c = !1)), 4403 (d += n.addedLength), 4404 (o += 1); 4405 } 4406 if (m[i].c && h.length) { 4407 if (((n = h[s - 1]), d <= e.e)) { 4408 var g = h[s - 1].addedLength; 4409 e.s <= d && e.e >= d + g 4410 ? (this.addSegment( 4411 m[i].v[s - 1], 4412 m[i].o[s - 1], 4413 m[i].i[0], 4414 m[i].v[0], 4415 r, 4416 o, 4417 y 4418 ), 4419 (y = !1)) 4420 : ((l = bez.getNewSegment( 4421 m[i].v[s - 1], 4422 m[i].v[0], 4423 m[i].o[s - 1], 4424 m[i].i[0], 4425 (e.s - d) / g, 4426 (e.e - d) / g, 4427 h[s - 1] 4428 )), 4429 this.addSegmentFromArray(l, r, o, y), 4430 (y = !1), 4431 (r.c = !1)); 4432 } else r.c = !1; 4433 (d += n.addedLength), (o += 1); 4434 } 4435 if ( 4436 (r._length && 4437 (r.setXYAt(r.v[p][0], r.v[p][1], "i", p), 4438 r.setXYAt( 4439 r.v[r._length - 1][0], 4440 r.v[r._length - 1][1], 4441 "o", 4442 r._length - 1 4443 )), 4444 d > e.e) 4445 ) 4446 break; 4447 i < c - 1 && 4448 ((r = shapePool.newElement()), (y = !0), u.push(r), (o = 0)); 4449 } 4450 return u; 4451 }), 4452 extendPrototype([ShapeModifier], PuckerAndBloatModifier), 4453 (PuckerAndBloatModifier.prototype.initModifierProperties = function ( 4454 t, 4455 e 4456 ) { 4457 (this.getValue = this.processKeys), 4458 (this.amount = PropertyFactory.getProp(t, e.a, 0, null, this)), 4459 (this._isAnimated = !!this.amount.effectsSequence.length); 4460 }), 4461 (PuckerAndBloatModifier.prototype.processPath = function (t, e) { 4462 var r = e / 100, 4463 i = [0, 0], 4464 s = t._length, 4465 a = 0; 4466 for (a = 0; a < s; a += 1) (i[0] += t.v[a][0]), (i[1] += t.v[a][1]);
4467 (i[0] /= s), (i[1] /= s); 4468 var n, 4469 o, 4470 h, 4471 l, 4472 p, 4473 f, 4474 m = shapePool.newElement(); 4475 for (m.c = t.c, a = 0; a < s; a += 1) 4476 (n = t.v[a][0] + (i[0] - t.v[a][0]) * r), 4477 (o = t.v[a][1] + (i[1] - t.v[a][1]) * r), 4478 (h = t.o[a][0] + (i[0] - t.o[a][0]) * -r), 4479 (l = t.o[a][1] + (i[1] - t.o[a][1]) * -r), 4480 (p = t.i[a][0] + (i[0] - t.i[a][0]) * -r), 4481 (f = t.i[a][1] + (i[1] - t.i[a][1]) * -r), 4482 m.setTripleAt(n, o, h, l, p, f, a); 4483 return m; 4484 }), 4485 (PuckerAndBloatModifier.prototype.processShapes = function (t) { 4486 var e, 4487 r, 4488 i, 4489 s, 4490 a, 4491 n, 4492 o = this.shapes.length, 4493 h = this.amount.v; 4494 if (0 !== h) 4495 for (r = 0; r < o; r += 1) { 4496 if ( 4497 ((n = (a = this.shapes[r]).localShapeCollection), 4498 a.shape._mdf || this._mdf || t) 4499 ) 4500 for ( 4501 n.releaseShapes(), 4502 a.shape._mdf = !0, 4503 e = a.shape.paths.shapes, 4504 s = a.shape.paths._length, 4505 i = 0; 4506 i < s; 4507 i += 1 4508 ) 4509 n.addShape(this.processPath(e[i], h)); 4510 a.shape.paths = a.localShapeCollection; 4511 } 4512 this.dynamicProperties.length || (this._mdf = !1);
4513 }); 4514 var TransformPropertyFactory = (function () { 4515 var t = [0, 0]; 4516 function e(t, e, r) { 4517 if ( 4518 ((this.elem = t), 4519 (this.frameId = -1), 4520 (this.propType = "transform"), 4521 (this.data = e), 4522 (this.v = new Matrix()), 4523 (this.pre = new Matrix()), 4524 (this.appliedTransformations = 0), 4525 this.initDynamicPropertyContainer(r || t), 4526 e.p && e.p.s 4527 ? ((this.px = PropertyFactory.getProp(t, e.p.x, 0, 0, this)), 4528 (this.py = PropertyFactory.getProp(t, e.p.y, 0, 0, this)), 4529 e.p.z && 4530 (this.pz = PropertyFactory.getProp(t, e.p.z, 0, 0, this))) 4531 : (this.p = PropertyFactory.getProp( 4532 t, 4533 e.p || { k: [0, 0, 0] }, 4534 1, 4535 0, 4536 this 4537 )), 4538 e.rx) 4539 ) { 4540 if ( 4541 ((this.rx = PropertyFactory.getProp(t, e.rx, 0, degToRads, this)), 4542 (this.ry = PropertyFactory.getProp(t, e.ry, 0, degToRads, this)), 4543 (this.rz = PropertyFactory.getProp(t, e.rz, 0, degToRads, this)), 4544 e.or.k[0].ti) 4545 ) { 4546 var i, 4547 s = e.or.k.length; 4548 for (i = 0; i < s; i += 1) 4549 (e.or.k[i].to = null), (e.or.k[i].ti = null); 4550 } 4551 (this.or = PropertyFactory.getProp(t, e.or, 1, degToRads, this)), 4552 (this.or.sh = !0); 4553 } else 4554 this.r = PropertyFactory.getProp( 4555 t, 4556 e.r || { k: 0 }, 4557 0, 4558 degToRads, 4559 this 4560 ); 4561 e.sk && 4562 ((this.sk = PropertyFactory.getProp(t, e.sk, 0, degToRads, this)), 4563 (this.sa = PropertyFactory.getProp(t, e.sa, 0, degToRads, this))), 4564 (this.a = PropertyFactory.getProp( 4565 t, 4566 e.a || { k: [0, 0, 0] }, 4567 1, 4568 0, 4569 this 4570 )), 4571 (this.s = PropertyFactory.getProp( 4572 t, 4573 e.s || { k: [100, 100, 100] }, 4574 1, 4575 0.01, 4576 this 4577 )), 4578 e.o 4579 ? (this.o = PropertyFactory.getProp(t, e.o, 0, 0.01, t)) 4580 : (this.o = { _mdf: !1, v: 1 }), 4581 (this._isDirty = !0), 4582 this.dynamicProperties.length || this.getValue(!0); 4583 } 4584 return ( 4585 (e.prototype = { 4586 applyToMatrix: function (t) { 4587 var e = this._mdf; 4588 this.iterateDynamicProperties(), 4589 (this._mdf = this._mdf || e), 4590 this.a && t.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), 4591 this.s && t.scale(this.s.v[0], this.s.v[1], this.s.v[2]), 4592 this.sk && t.skewFromAxis(-this.sk.v, this.sa.v), 4593 this.r 4594 ? t.rotate(-this.r.v) 4595 : t 4596 .rotateZ(-this.rz.v) 4597 .rotateY(this.ry.v) 4598 .rotateX(this.rx.v) 4599 .rotateZ(-this.or.v[2]) 4600 .rotateY(this.or.v[1]) 4601 .rotateX(this.or.v[0]), 4602 this.data.p.s 4603 ? this.data.p.z 4604 ? t.translate(this.px.v, this.py.v, -this.pz.v) 4605 : t.translate(this.px.v, this.py.v, 0) 4606 : t.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); 4607 }, 4608 getValue: function (e) { 4609 if (this.elem.globalData.frameId !== this.frameId) { 4610 if ( 4611 (this._isDirty && 4612 (this.precalculateMatrix(), (this._isDirty = !1)), 4613 this.iterateDynamicProperties(), 4614 this._mdf || e) 4615 ) { 4616 var r; 4617 if ( 4618 (this.v.cloneFromProps(this.pre.props), 4619 this.appliedTransformations < 1 && 4620 this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), 4621 this.appliedTransformations < 2 && 4622 this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]), 4623 this.sk && 4624 this.appliedTransformations < 3 && 4625 this.v.skewFromAxis(-this.sk.v, this.sa.v), 4626 this.r && this.appliedTransformations < 4 4627 ? this.v.rotate(-this.r.v) 4628 : !this.r && 4629 this.appliedTransformations < 4 && 4630 this.v 4631 .rotateZ(-this.rz.v) 4632 .rotateY(this.ry.v) 4633 .rotateX(this.rx.v) 4634 .rotateZ(-this.or.v[2]) 4635 .rotateY(this.or.v[1]) 4636 .rotateX(this.or.v[0]),
4637 this.autoOriented) 4638 ) { 4639 var i, s; 4640 if ( 4641 ((r = this.elem.globalData.frameRate), 4642 this.p && this.p.keyframes && this.p.getValueAtTime) 4643 ) 4644 this.p._caching.lastFrame + this.p.offsetTime <= 4645 this.p.keyframes[0].t 4646 ? ((i = this.p.getValueAtTime( 4647 (this.p.keyframes[0].t + 0.01) / r, 4648 0 4649 )), 4650 (s = this.p.getValueAtTime( 4651 this.p.keyframes[0].t / r, 4652 0 4653 ))) 4654 : this.p._caching.lastFrame + this.p.offsetTime >= 4655 this.p.keyframes[this.p.keyframes.length - 1].t 4656 ? ((i = this.p.getValueAtTime( 4657 this.p.keyframes[this.p.keyframes.length - 1].t / r, 4658 0 4659 )), 4660 (s = this.p.getValueAtTime( 4661 (this.p.keyframes[this.p.keyframes.length - 1].t - 4662 0.05) / 4663 r, 4664 0 4665 ))) 4666 : ((i = this.p.pv), 4667 (s = this.p.getValueAtTime( 4668 (this.p._caching.lastFrame + 4669 this.p.offsetTime - 4670 0.01) / 4671 r, 4672 this.p.offsetTime 4673 ))); 4674 else if ( 4675 this.px && 4676 this.px.keyframes && 4677 this.py.keyframes && 4678 this.px.getValueAtTime && 4679 this.py.getValueAtTime 4680 ) { 4681 (i = []), (s = []); 4682 var a = this.px, 4683 n = this.py; 4684 a._caching.lastFrame + a.offsetTime <= a.keyframes[0].t 4685 ? ((i[0] = a.getValueAtTime( 4686 (a.keyframes[0].t + 0.01) / r, 4687 0 4688 )), 4689 (i[1] = n.getValueAtTime( 4690 (n.keyframes[0].t + 0.01) / r, 4691 0 4692 )), 4693 (s[0] = a.getValueAtTime(a.keyframes[0].t / r, 0)), 4694 (s[1] = n.getValueAtTime(n.keyframes[0].t / r, 0))) 4695 : a._caching.lastFrame + a.offsetTime >= 4696 a.keyframes[a.keyframes.length - 1].t 4697 ? ((i[0] = a.getValueAtTime( 4698 a.keyframes[a.keyframes.length - 1].t / r, 4699 0 4700 )), 4701 (i[1] = n.getValueAtTime( 4702 n.keyframes[n.keyframes.length - 1].t / r, 4703 0 4704 )), 4705 (s[0] = a.getValueAtTime( 4706 (a.keyframes[a.keyframes.length - 1].t - 0.01) / r, 4707 0 4708 )), 4709 (s[1] = n.getValueAtTime( 4710 (n.keyframes[n.keyframes.length - 1].t - 0.01) / r, 4711 0 4712 ))) 4713 : ((i = [a.pv, n.pv]), 4714 (s[0] = a.getValueAtTime( 4715 (a._caching.lastFrame + a.offsetTime - 0.01) / r, 4716 a.offsetTime 4717 )), 4718 (s[1] = n.getValueAtTime( 4719 (n._caching.lastFrame + n.offsetTime - 0.01) / r, 4720 n.offsetTime 4721 ))); 4722 } else i = s = t; 4723 this.v.rotate(-Math.atan2(i[1] - s[1], i[0] - s[0])); 4724 } 4725 this.data.p && this.data.p.s 4726 ? this.data.p.z 4727 ? this.v.translate(this.px.v, this.py.v, -this.pz.v) 4728 : this.v.translate(this.px.v, this.py.v, 0) 4729 : this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); 4730 } 4731 this.frameId = this.elem.globalData.frameId; 4732 } 4733 }, 4734 precalculateMatrix: function () { 4735 if ( 4736 !this.a.k && 4737 (this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), 4738 (this.appliedTransformations = 1), 4739 !this.s.effectsSequence.length) 4740 ) { 4741 if ( 4742 (this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]), 4743 (this.appliedTransformations = 2), 4744 this.sk) 4745 ) { 4746 if ( 4747 this.sk.effectsSequence.length || 4748 this.sa.effectsSequence.length 4749 ) 4750 return; 4751 this.pre.skewFromAxis(-this.sk.v, this.sa.v), 4752 (this.appliedTransformations = 3); 4753 } 4754 this.r 4755 ? this.r.effectsSequence.length || 4756 (this.pre.rotate(-this.r.v), 4757 (this.appliedTransformations = 4)) 4758 : this.rz.effectsSequence.length || 4759 this.ry.effectsSequence.length || 4760 this.rx.effectsSequence.length || 4761 this.or.effectsSequence.length || 4762 (this.pre 4763 .rotateZ(-this.rz.v) 4764 .rotateY(this.ry.v) 4765 .rotateX(this.rx.v) 4766 .rotateZ(-this.or.v[2]) 4767 .rotateY(this.or.v[1]) 4768 .rotateX(this.or.v[0]), 4769 (this.appliedTransformations = 4));
4770 } 4771 }, 4772 autoOrient: function () {}, 4773 }), 4774 extendPrototype([DynamicPropertyContainer], e), 4775 (e.prototype.addDynamicProperty = function (t) { 4776 this._addDynamicProperty(t), 4777 this.elem.addDynamicProperty(t), 4778 (this._isDirty = !0); 4779 }), 4780 (e.prototype._addDynamicProperty = 4781 DynamicPropertyContainer.prototype.addDynamicProperty), 4782 { 4783 getTransformProperty: function (t, r, i) { 4784 return new e(t, r, i); 4785 }, 4786 } 4787 ); 4788 })(); 4789 function RepeaterModifier() {} 4790 function RoundCornersModifier() {} 4791 function floatEqual(t, e) { 4792 return 1e5 * Math.abs(t - e) <= Math.min(Math.abs(t), Math.abs(e)); 4793 } 4794 function floatZero(t) { 4795 return Math.abs(t) <= 1e-5; 4796 } 4797 function lerp(t, e, r) { 4798 return t * (1 - r) + e * r; 4799 } 4800 function lerpPoint(t, e, r) { 4801 return [lerp(t[0], e[0], r), lerp(t[1], e[1], r)]; 4802 } 4803 function quadRoots(t, e, r) { 4804 if (0 === t) return []; 4805 var i = e * e - 4 * t * r; 4806 if (i < 0) return []; 4807 var s = -e / (2 * t); 4808 if (0 === i) return [s]; 4809 var a = Math.sqrt(i) / (2 * t); 4810 return [s - a, s + a]; 4811 } 4812 function polynomialCoefficients(t, e, r, i) { 4813 return [3 * e - t - 3 * r + i, 3 * t - 6 * e + 3 * r, -3 * t + 3 * e, t]; 4814 } 4815 function singlePoint(t) { 4816 return new PolynomialBezier(t, t, t, t, !1); 4817 } 4818 function PolynomialBezier(t, e, r, i, s) { 4819 s && pointEqual(t, e) && (e = lerpPoint(t, i, 1 / 3)), 4820 s && pointEqual(r, i) && (r = lerpPoint(t, i, 2 / 3)); 4821 var a = polynomialCoefficients(t[0], e[0], r[0], i[0]), 4822 n = polynomialCoefficients(t[1], e[1], r[1], i[1]); 4823 (this.a = [a[0], n[0]]), 4824 (this.b = [a[1], n[1]]), 4825 (this.c = [a[2], n[2]]), 4826 (this.d = [a[3], n[3]]), 4827 (this.points = [t, e, r, i]); 4828 } 4829 function extrema(t, e) { 4830 var r = t.points[0][e], 4831 i = t.points[t.points.length - 1][e]; 4832 if (r > i) { 4833 var s = i; 4834 (i = r), (r = s); 4835 } 4836 for ( 4837 var a = quadRoots(3 * t.a[e], 2 * t.b[e], t.c[e]), n = 0; 4838 n < a.length; 4839 n += 1 4840 ) 4841 if (a[n] > 0 && a[n] < 1) { 4842 var o = t.point(a[n])[e]; 4843 o < r ? (r = o) : o > i && (i = o); 4844 } 4845 return { min: r, max: i }; 4846 } 4847 function intersectData(t, e, r) { 4848 var i = t.boundingBox(); 4849 return { 4850 cx: i.cx, 4851 cy: i.cy, 4852 width: i.width, 4853 height: i.height, 4854 bez: t, 4855 t: (e + r) / 2, 4856 t1: e, 4857 t2: r, 4858 }; 4859 } 4860 function splitData(t) { 4861 var e = t.bez.split(0.5); 4862 return [intersectData(e[0], t.t1, t.t), intersectData(e[1], t.t, t.t2)]; 4863 } 4864 function boxIntersect(t, e) { 4865 return ( 4866 2 * Math.abs(t.cx - e.cx) < t.width + e.width && 4867 2 * Math.abs(t.cy - e.cy) < t.height + e.height 4868 ); 4869 } 4870 function intersectsImpl(t, e, r, i, s, a) { 4871 if (boxIntersect(t, e)) 4872 if ( 4873 r >= a || 4874 (t.width <= i && t.height <= i && e.width <= i && e.height <= i) 4875 ) 4876 s.push([t.t, e.t]); 4877 else { 4878 var n = splitData(t), 4879 o = splitData(e); 4880 intersectsImpl(n[0], o[0], r + 1, i, s, a), 4881 intersectsImpl(n[0], o[1], r + 1, i, s, a), 4882 intersectsImpl(n[1], o[0], r + 1, i, s, a), 4883 intersectsImpl(n[1], o[1], r + 1, i, s, a); 4884 } 4885 } 4886 function crossProduct(t, e) { 4887 return [ 4888 t[1] * e[2] - t[2] * e[1], 4889 t[2] * e[0] - t[0] * e[2], 4890 t[0] * e[1] - t[1] * e[0], 4891 ]; 4892 } 4893 function lineIntersection(t, e, r, i) { 4894 var s = [t[0], t[1], 1], 4895 a = [e[0], e[1], 1], 4896 n = [r[0], r[1], 1], 4897 o = [i[0], i[1], 1], 4898 h = crossProduct(crossProduct(s, a), crossProduct(n, o)); 4899 return floatZero(h[2]) ? null : [h[0] / h[2], h[1] / h[2]]; 4900 } 4901 function polarOffset(t, e, r) {
4902 return [t[0] + Math.cos(e) * r, t[1] - Math.sin(e) * r]; 4903 } 4904 function pointDistance(t, e) { 4905 return Math.hypot(t[0] - e[0], t[1] - e[1]); 4906 } 4907 function pointEqual(t, e) { 4908 return floatEqual(t[0], e[0]) && floatEqual(t[1], e[1]); 4909 } 4910 function ZigZagModifier() {} 4911 function setPoint(t, e, r, i, s, a, n) { 4912 var o = r - Math.PI / 2, 4913 h = r + Math.PI / 2, 4914 l = e[0] + Math.cos(r) * i * s, 4915 p = e[1] - Math.sin(r) * i * s; 4916 t.setTripleAt( 4917 l, 4918 p, 4919 l + Math.cos(o) * a, 4920 p - Math.sin(o) * a, 4921 l + Math.cos(h) * n, 4922 p - Math.sin(h) * n, 4923 t.length() 4924 ); 4925 } 4926 function getPerpendicularVector(t, e) { 4927 var r = [e[0] - t[0], e[1] - t[1]], 4928 i = 0.5 * -Math.PI; 4929 return [ 4930 Math.cos(i) * r[0] - Math.sin(i) * r[1], 4931 Math.sin(i) * r[0] + Math.cos(i) * r[1], 4932 ]; 4933 } 4934 function getProjectingAngle(t, e) { 4935 var r = 0 === e ? t.length() - 1 : e - 1, 4936 i = (e + 1) % t.length(), 4937 s = getPerpendicularVector(t.v[r], t.v[i]); 4938 return Math.atan2(0, 1) - Math.atan2(s[1], s[0]); 4939 } 4940 function zigZagCorner(t, e, r, i, s, a, n) { 4941 var o = getProjectingAngle(e, r), 4942 h = e.v[r % e._length], 4943 l = e.v[0 === r ? e._length - 1 : r - 1], 4944 p = e.v[(r + 1) % e._length], 4945 f = 4946 2 === a 4947 ? Math.sqrt(Math.pow(h[0] - l[0], 2) + Math.pow(h[1] - l[1], 2)) 4948 : 0, 4949 m = 4950 2 === a 4951 ? Math.sqrt(Math.pow(h[0] - p[0], 2) + Math.pow(h[1] - p[1], 2)) 4952 : 0; 4953 setPoint( 4954 t, 4955 e.v[r % e._length], 4956 o, 4957 n, 4958 i, 4959 m / (2 * (s + 1)), 4960 f / (2 * (s + 1)), 4961 a 4962 ); 4963 } 4964 function zigZagSegment(t, e, r, i, s, a) { 4965 for (var n = 0; n < i; n += 1) { 4966 var o = (n + 1) / (i + 1), 4967 h = 4968 2 === s 4969 ? Math.sqrt( 4970 Math.pow(e.points[3][0] - e.points[0][0], 2) + 4971 Math.pow(e.points[3][1] - e.points[0][1], 2) 4972 ) 4973 : 0, 4974 l = e.normalAngle(o); 4975 setPoint( 4976 t, 4977 e.point(o), 4978 l, 4979 a, 4980 r, 4981 h / (2 * (i + 1)), 4982 h / (2 * (i + 1)), 4983 s 4984 ), 4985 (a = -a); 4986 } 4987 return a; 4988 } 4989 function linearOffset(t, e, r) { 4990 var i = Math.atan2(e[0] - t[0], e[1] - t[1]); 4991 return [polarOffset(t, i, r), polarOffset(e, i, r)]; 4992 } 4993 function offsetSegment(t, e) { 4994 var r, i, s, a, n, o, h; 4995 (r = (h = linearOffset(t.points[0], t.points[1], e))[0]), 4996 (i = h[1]), 4997 (s = (h = linearOffset(t.points[1], t.points[2], e))[0]), 4998 (a = h[1]), 4999 (n = (h = linearOffset(t.points[2], t.points[3], e))[0]), 5000 (o = h[1]); 5001 var l = lineIntersection(r, i, s, a); 5002 null === l && (l = i); 5003 var p = lineIntersection(n, o, s, a); 5004 return null === p && (p = n), new PolynomialBezier(r, l, p, o); 5005 } 5006 function joinLines(t, e, r, i, s) { 5007 var a = e.points[3], 5008 n = r.points[0]; 5009 if (3 === i) return a; 5010 if (pointEqual(a, n)) return a; 5011 if (2 === i) { 5012 var o = -e.tangentAngle(1), 5013 h = -r.tangentAngle(0) + Math.PI, 5014 l = lineIntersection( 5015 a, 5016 polarOffset(a, o + Math.PI / 2, 100), 5017 n, 5018 polarOffset(n, o + Math.PI / 2, 100) 5019 ), 5020 p = l ? pointDistance(l, a) : pointDistance(a, n) / 2, 5021 f = polarOffset(a, o, 2 * p * roundCorner); 5022 return ( 5023 t.setXYAt(f[0], f[1], "o", t.length() - 1), 5024 (f = polarOffset(n, h, 2 * p * roundCorner)), 5025 t.setTripleAt(n[0], n[1], n[0], n[1], f[0], f[1], t.length()), 5026 n 5027 ); 5028 } 5029 var m = lineIntersection( 5030 pointEqual(a, e.points[2]) ? e.points[0] : e.points[2], 5031 a, 5032 n, 5033 pointEqual(n, r.points[1]) ? r.points[3] : r.points[1] 5034 ); 5035 return m && pointDistance(m, a) < s 5036 ? (t.setTripleAt(m[0], m[1], m[0], m[1], m[0], m[1], t.length()), m) 5037 : a; 5038 } 5039 function getIntersection(t, e) { 5040 var r = t.intersections(e); 5041 return ( 5042 r.length && floatEqual(r[0][0], 1) && r.shift(), r.length ? r[0] : null 5043 ); 5044 } 5045 function pruneSegmentIntersection(t, e) { 5046 var r = t.slice(), 5047 i = e.slice(), 5048 s = getIntersection(t[t.length - 1], e[0]); 5049 return ( 5050 s && 5051 ((r[t.length - 1] = t[t.length - 1].split(s[0])[0]), 5052 (i[0] = e[0].split(s[1])[1])), 5053 t.length > 1 && 5054 e.length > 1 && 5055 (s = getIntersection(t[0], e[e.length - 1])) 5056 ? [[t[0].split(s[0])[0]], [e[e.length - 1].split(s[1])[1]]] 5057 : [r, i] 5058 ); 5059 } 5060 function pruneIntersections(t) { 5061 for (var e, r = 1; r < t.length; r += 1) 5062 (e = pruneSegmentIntersection(t[r - 1], t[r])), 5063 (t[r - 1] = e[0]), 5064 (t[r] = e[1]); 5065 return ( 5066 t.length > 1 && 5067 ((e = pruneSegmentIntersection(t[t.length - 1], t[0])), 5068 (t[t.length - 1] = e[0]), 5069 (t[0] = e[1])), 5070 t 5071 ); 5072 } 5073 function offsetSegmentSplit(t, e) { 5074 var r, 5075 i, 5076 s, 5077 a, 5078 n = t.inflectionPoints();
5079 if (0 === n.length) return [offsetSegment(t, e)]; 5080 if (1 === n.length || floatEqual(n[1], 1)) 5081 return ( 5082 (r = (s = t.split(n[0]))[0]), 5083 (i = s[1]), 5084 [offsetSegment(r, e), offsetSegment(i, e)] 5085 ); 5086 r = (s = t.split(n[0]))[0]; 5087 var o = (n[1] - n[0]) / (1 - n[0]); 5088 return ( 5089 (a = (s = s[1].split(o))[0]), 5090 (i = s[1]), 5091 [offsetSegment(r, e), offsetSegment(a, e), offsetSegment(i, e)] 5092 ); 5093 } 5094 function OffsetPathModifier() {} 5095 function getFontProperties(t) { 5096 for ( 5097 var e = t.fStyle ? t.fStyle.split(" ") : [], 5098 r = "normal", 5099 i = "normal", 5100 s = e.length, 5101 a = 0; 5102 a < s; 5103 a += 1 5104 ) 5105 switch (e[a].toLowerCase()) { 5106 case "italic": 5107 i = "italic"; 5108 break; 5109 case "bold": 5110 r = "700"; 5111 break; 5112 case "black": 5113 r = "900"; 5114 break; 5115 case "medium": 5116 r = "500"; 5117 break; 5118 case "regular": 5119 case "normal": 5120 r = "400"; 5121 break; 5122 case "light": 5123 case "thin": 5124 r = "200"; 5125 } 5126 return { style: i, weight: t.fWeight || r }; 5127 } 5128 extendPrototype([ShapeModifier], RepeaterModifier), 5129 (RepeaterModifier.prototype.initModifierProperties = function (t, e) { 5130 (this.getValue = this.processKeys), 5131 (this.c = PropertyFactory.getProp(t, e.c, 0, null, this)), 5132 (this.o = PropertyFactory.getProp(t, e.o, 0, null, this)), 5133 (this.tr = TransformPropertyFactory.getTransformProperty( 5134 t, 5135 e.tr, 5136 this 5137 )), 5138 (this.so = PropertyFactory.getProp(t, e.tr.so, 0, 0.01, this)), 5139 (this.eo = PropertyFactory.getProp(t, e.tr.eo, 0, 0.01, this)), 5140 (this.data = e), 5141 this.dynamicProperties.length || this.getValue(!0), 5142 (this._isAnimated = !!this.dynamicProperties.length), 5143 (this.pMatrix = new Matrix()), 5144 (this.rMatrix = new Matrix()), 5145 (this.sMatrix = new Matrix()), 5146 (this.tMatrix = new Matrix()), 5147 (this.matrix = new Matrix()); 5148 }), 5149 (RepeaterModifier.prototype.applyTransforms = function ( 5150 t, 5151 e, 5152 r, 5153 i, 5154 s, 5155 a 5156 ) { 5157 var n = a ? -1 : 1, 5158 o = i.s.v[0] + (1 - i.s.v[0]) * (1 - s), 5159 h = i.s.v[1] + (1 - i.s.v[1]) * (1 - s); 5160 t.translate(i.p.v[0] * n * s, i.p.v[1] * n * s, i.p.v[2]), 5161 e.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]), 5162 e.rotate(-i.r.v * n * s), 5163 e.translate(i.a.v[0], i.a.v[1], i.a.v[2]), 5164 r.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]), 5165 r.scale(a ? 1 / o : o, a ? 1 / h : h), 5166 r.translate(i.a.v[0], i.a.v[1], i.a.v[2]); 5167 }), 5168 (RepeaterModifier.prototype.init = function (t, e, r, i) { 5169 for ( 5170 this.elem = t, 5171 this.arr = e, 5172 this.pos = r, 5173 this.elemsData = i, 5174 this._currentCopies = 0, 5175 this._elements = [], 5176 this._groups = [], 5177 this.frameId = -1, 5178 this.initDynamicPropertyContainer(t), 5179 this.initModifierProperties(t, e[r]); 5180 r > 0; 5181 5182 ) 5183 (r -= 1), this._elements.unshift(e[r]); 5184 this.dynamicProperties.length ? (this.k = !0) : this.getValue(!0); 5185 }), 5186 (RepeaterModifier.prototype.resetElements = function (t) { 5187 var e, 5188 r = t.length; 5189 for (e = 0; e < r; e += 1) 5190 (t[e]._processed = !1), 5191 "gr" === t[e].ty && this.resetElements(t[e].it); 5192 }), 5193 (RepeaterModifier.prototype.cloneElements = function (t) { 5194 var e = JSON.parse(JSON.stringify(t)); 5195 return this.resetElements(e), e; 5196 }), 5197 (RepeaterModifier.prototype.changeGroupRender = function (t, e) { 5198 var r, 5199 i = t.length; 5200 for (r = 0; r < i; r += 1) 5201 (t[r]._render = e), 5202 "gr" === t[r].ty && this.changeGroupRender(t[r].it, e); 5203 }), 5204 (RepeaterModifier.prototype.processShapes = function (t) { 5205 var e, 5206 r, 5207 i, 5208 s, 5209 a, 5210 n = !1; 5211 if (this._mdf || t) { 5212 var o, 5213 h = Math.ceil(this.c.v); 5214 if (this._groups.length < h) { 5215 for (; this._groups.length < h; ) { 5216 var l = { it: this.cloneElements(this._elements), ty: "gr" }; 5217 l.it.push({ 5218 a: { a: 0, ix: 1, k: [0, 0] }, 5219 nm: "Transform", 5220 o: { a: 0, ix: 7, k: 100 }, 5221 p: { a: 0, ix: 2, k: [0, 0] }, 5222 r: { 5223 a: 1, 5224 ix: 6, 5225 k: [ 5226 { s: 0, e: 0, t: 0 }, 5227 { s: 0, e: 0, t: 1 }, 5228 ], 5229 }, 5230 s: { a: 0, ix: 3, k: [100, 100] }, 5231 sa: { a: 0, ix: 5, k: 0 }, 5232 sk: { a: 0, ix: 4, k: 0 }, 5233 ty: "tr", 5234 }), 5235 this.arr.splice(0, 0, l), 5236 this._groups.splice(0, 0, l), 5237 (this._currentCopies += 1); 5238 } 5239 this.elem.reloadShapes(), (n = !0);
5240 } 5241 for (a = 0, i = 0; i <= this._groups.length - 1; i += 1) { 5242 if ( 5243 ((o = a < h), 5244 (this._groups[i]._render = o), 5245 this.changeGroupRender(this._groups[i].it, o), 5246 !o) 5247 ) { 5248 var p = this.elemsData[i].it, 5249 f = p[p.length - 1]; 5250 0 !== f.transform.op.v 5251 ? ((f.transform.op._mdf = !0), (f.transform.op.v = 0)) 5252 : (f.transform.op._mdf = !1); 5253 } 5254 a += 1; 5255 } 5256 this._currentCopies = h; 5257 var m = this.o.v, 5258 c = m % 1, 5259 d = m > 0 ? Math.floor(m) : Math.ceil(m), 5260 u = this.pMatrix.props, 5261 y = this.rMatrix.props, 5262 g = this.sMatrix.props; 5263 this.pMatrix.reset(), 5264 this.rMatrix.reset(), 5265 this.sMatrix.reset(), 5266 this.tMatrix.reset(), 5267 this.matrix.reset(); 5268 var v, 5269 b, 5270 P = 0; 5271 if (m > 0) { 5272 for (; P < d; ) 5273 this.applyTransforms( 5274 this.pMatrix, 5275 this.rMatrix, 5276 this.sMatrix, 5277 this.tr, 5278 1, 5279 !1 5280 ), 5281 (P += 1); 5282 c && 5283 (this.applyTransforms( 5284 this.pMatrix, 5285 this.rMatrix, 5286 this.sMatrix, 5287 this.tr, 5288 c, 5289 !1 5290 ), 5291 (P += c)); 5292 } else if (m < 0) { 5293 for (; P > d; ) 5294 this.applyTransforms( 5295 this.pMatrix, 5296 this.rMatrix, 5297 this.sMatrix, 5298 this.tr, 5299 1, 5300 !0 5301 ), 5302 (P -= 1); 5303 c && 5304 (this.applyTransforms( 5305 this.pMatrix, 5306 this.rMatrix, 5307 this.sMatrix, 5308 this.tr, 5309 -c, 5310 !0 5311 ), 5312 (P -= c)); 5313 } 5314 for ( 5315 i = 1 === this.data.m ? 0 : this._currentCopies - 1, 5316 s = 1 === this.data.m ? 1 : -1, 5317 a = this._currentCopies; 5318 a; 5319 5320 ) { 5321 if ( 5322 ((b = (r = (e = this.elemsData[i].it)[e.length - 1].transform 5323 .mProps.v.props).length), 5324 (e[e.length - 1].transform.mProps._mdf = !0), 5325 (e[e.length - 1].transform.op._mdf = !0), 5326 (e[e.length - 1].transform.op.v = 5327 1 === this._currentCopies 5328 ? this.so.v 5329 : this.so.v + 5330 (this.eo.v - this.so.v) * (i / (this._currentCopies - 1))), 5331 0 !== P) 5332 ) { 5333 for ( 5334 ((0 !== i && 1 === s) || 5335 (i !== this._currentCopies - 1 && -1 === s)) && 5336 this.applyTransforms( 5337 this.pMatrix, 5338 this.rMatrix, 5339 this.sMatrix, 5340 this.tr, 5341 1, 5342 !1 5343 ), 5344 this.matrix.transform( 5345 y[0], 5346 y[1], 5347 y[2], 5348 y[3], 5349 y[4], 5350 y[5], 5351 y[6], 5352 y[7], 5353 y[8], 5354 y[9], 5355 y[10], 5356 y[11], 5357 y[12], 5358 y[13], 5359 y[14], 5360 y[15] 5361 ), 5362 this.matrix.transform( 5363 g[0], 5364 g[1], 5365 g[2], 5366 g[3], 5367 g[4], 5368 g[5], 5369 g[6], 5370 g[7], 5371 g[8], 5372 g[9], 5373 g[10], 5374 g[11], 5375 g[12], 5376 g[13], 5377 g[14], 5378 g[15] 5379 ), 5380 this.matrix.transform( 5381 u[0], 5382 u[1], 5383 u[2], 5384 u[3], 5385 u[4], 5386 u[5], 5387 u[6], 5388 u[7], 5389 u[8], 5390 u[9], 5391 u[10], 5392 u[11], 5393 u[12], 5394 u[13], 5395 u[14], 5396 u[15] 5397 ), 5398 v = 0; 5399 v < b; 5400 v += 1 5401 ) 5402 r[v] = this.matrix.props[v]; 5403 this.matrix.reset(); 5404 } else 5405 for (this.matrix.reset(), v = 0; v < b; v += 1) 5406 r[v] = this.matrix.props[v]; 5407 (P += 1), (a -= 1), (i += s); 5408 } 5409 } else 5410 for (a = this._currentCopies, i = 0, s = 1; a; ) 5411 (r = (e = this.elemsData[i].it)[e.length - 1].transform.mProps.v 5412 .props), 5413 (e[e.length - 1].transform.mProps._mdf = !1), 5414 (e[e.length - 1].transform.op._mdf = !1), 5415 (a -= 1), 5416 (i += s); 5417 return n; 5418 }), 5419 (RepeaterModifier.prototype.addShape = function () {}), 5420 extendPrototype([ShapeModifier], RoundCornersModifier), 5421 (RoundCornersModifier.prototype.initModifierProperties = function (t, e) { 5422 (this.getValue = this.processKeys),
5423 (this.rd = PropertyFactory.getProp(t, e.r, 0, null, this)), 5424 (this._isAnimated = !!this.rd.effectsSequence.length); 5425 }), 5426 (RoundCornersModifier.prototype.processPath = function (t, e) { 5427 var r, 5428 i = shapePool.newElement(); 5429 i.c = t.c; 5430 var s, 5431 a, 5432 n, 5433 o, 5434 h, 5435 l, 5436 p, 5437 f, 5438 m, 5439 c, 5440 d, 5441 u, 5442 y = t._length, 5443 g = 0; 5444 for (r = 0; r < y; r += 1) 5445 (s = t.v[r]), 5446 (n = t.o[r]), 5447 (a = t.i[r]), 5448 s[0] === n[0] && s[1] === n[1] && s[0] === a[0] && s[1] === a[1] 5449 ? (0 !== r && r !== y - 1) || t.c 5450 ? ((o = 0 === r ? t.v[y - 1] : t.v[r - 1]), 5451 (l = (h = Math.sqrt( 5452 Math.pow(s[0] - o[0], 2) + Math.pow(s[1] - o[1], 2) 5453 )) 5454 ? Math.min(h / 2, e) / h 5455 : 0), 5456 (p = d = s[0] + (o[0] - s[0]) * l), 5457 (f = u = s[1] - (s[1] - o[1]) * l), 5458 (m = p - (p - s[0]) * roundCorner), 5459 (c = f - (f - s[1]) * roundCorner), 5460 i.setTripleAt(p, f, m, c, d, u, g), 5461 (g += 1), 5462 (o = r === y - 1 ? t.v[0] : t.v[r + 1]), 5463 (l = (h = Math.sqrt( 5464 Math.pow(s[0] - o[0], 2) + Math.pow(s[1] - o[1], 2) 5465 )) 5466 ? Math.min(h / 2, e) / h 5467 : 0), 5468 (p = m = s[0] + (o[0] - s[0]) * l), 5469 (f = c = s[1] + (o[1] - s[1]) * l), 5470 (d = p - (p - s[0]) * roundCorner), 5471 (u = f - (f - s[1]) * roundCorner), 5472 i.setTripleAt(p, f, m, c, d, u, g), 5473 (g += 1)) 5474 : (i.setTripleAt(s[0], s[1], n[0], n[1], a[0], a[1], g), 5475 (g += 1)) 5476 : (i.setTripleAt( 5477 t.v[r][0], 5478 t.v[r][1], 5479 t.o[r][0], 5480 t.o[r][1], 5481 t.i[r][0], 5482 t.i[r][1], 5483 g 5484 ), 5485 (g += 1)); 5486 return i; 5487 }), 5488 (RoundCornersModifier.prototype.processShapes = function (t) { 5489 var e, 5490 r, 5491 i, 5492 s, 5493 a, 5494 n, 5495 o = this.shapes.length, 5496 h = this.rd.v; 5497 if (0 !== h) 5498 for (r = 0; r < o; r += 1) { 5499 if ( 5500 ((n = (a = this.shapes[r]).localShapeCollection), 5501 a.shape._mdf || this._mdf || t) 5502 ) 5503 for ( 5504 n.releaseShapes(), 5505 a.shape._mdf = !0, 5506 e = a.shape.paths.shapes, 5507 s = a.shape.paths._length, 5508 i = 0; 5509 i < s; 5510 i += 1 5511 ) 5512 n.addShape(this.processPath(e[i], h)); 5513 a.shape.paths = a.localShapeCollection; 5514 } 5515 this.dynamicProperties.length || (this._mdf = !1);
5516 }), 5517 (PolynomialBezier.prototype.point = function (t) { 5518 return [ 5519 ((this.a[0] * t + this.b[0]) * t + this.c[0]) * t + this.d[0], 5520 ((this.a[1] * t + this.b[1]) * t + this.c[1]) * t + this.d[1], 5521 ]; 5522 }), 5523 (PolynomialBezier.prototype.derivative = function (t) { 5524 return [ 5525 (3 * t * this.a[0] + 2 * this.b[0]) * t + this.c[0], 5526 (3 * t * this.a[1] + 2 * this.b[1]) * t + this.c[1], 5527 ]; 5528 }), 5529 (PolynomialBezier.prototype.tangentAngle = function (t) { 5530 var e = this.derivative(t); 5531 return Math.atan2(e[1], e[0]); 5532 }), 5533 (PolynomialBezier.prototype.normalAngle = function (t) { 5534 var e = this.derivative(t); 5535 return Math.atan2(e[0], e[1]); 5536 }), 5537 (PolynomialBezier.prototype.inflectionPoints = function () { 5538 var t = this.a[1] * this.b[0] - this.a[0] * this.b[1]; 5539 if (floatZero(t)) return []; 5540 var e = (-0.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1])) / t, 5541 r = 5542 e * e - 5543 ((1 / 3) * (this.b[1] * this.c[0] - this.b[0] * this.c[1])) / t; 5544 if (r < 0) return []; 5545 var i = Math.sqrt(r); 5546 return floatZero(i) 5547 ? i > 0 && i < 1 5548 ? [e] 5549 : [] 5550 : [e - i, e + i].filter(function (t) { 5551 return t > 0 && t < 1; 5552 }); 5553 }), 5554 (PolynomialBezier.prototype.split = function (t) { 5555 if (t <= 0) return [singlePoint(this.points[0]), this]; 5556 if (t >= 1) 5557 return [this, singlePoint(this.points[this.points.length - 1])]; 5558 var e = lerpPoint(this.points[0], this.points[1], t), 5559 r = lerpPoint(this.points[1], this.points[2], t), 5560 i = lerpPoint(this.points[2], this.points[3], t), 5561 s = lerpPoint(e, r, t), 5562 a = lerpPoint(r, i, t), 5563 n = lerpPoint(s, a, t); 5564 return [ 5565 new PolynomialBezier(this.points[0], e, s, n, !0), 5566 new PolynomialBezier(n, a, i, this.points[3], !0), 5567 ]; 5568 }), 5569 (PolynomialBezier.prototype.bounds = function () { 5570 return { x: extrema(this, 0), y: extrema(this, 1) }; 5571 }), 5572 (PolynomialBezier.prototype.boundingBox = function () { 5573 var t = this.bounds(); 5574 return { 5575 left: t.x.min, 5576 right: t.x.max, 5577 top: t.y.min, 5578 bottom: t.y.max, 5579 width: t.x.max - t.x.min, 5580 height: t.y.max - t.y.min, 5581 cx: (t.x.max + t.x.min) / 2, 5582 cy: (t.y.max + t.y.min) / 2, 5583 }; 5584 }), 5585 (PolynomialBezier.prototype.intersections = function (t, e, r) { 5586 void 0 === e && (e = 2), void 0 === r && (r = 7); 5587 var i = []; 5588 return ( 5589 intersectsImpl( 5590 intersectData(this, 0, 1), 5591 intersectData(t, 0, 1), 5592 0, 5593 e, 5594 i, 5595 r 5596 ), 5597 i 5598 ); 5599 }), 5600 (PolynomialBezier.shapeSegment = function (t, e) { 5601 var r = (e + 1) % t.length(); 5602 return new PolynomialBezier(t.v[e], t.o[e], t.i[r], t.v[r], !0); 5603 }), 5604 (PolynomialBezier.shapeSegmentInverted = function (t, e) { 5605 var r = (e + 1) % t.length(); 5606 return new PolynomialBezier(t.v[r], t.i[r], t.o[e], t.v[e], !0); 5607 }), 5608 extendPrototype([ShapeModifier], ZigZagModifier), 5609 (ZigZagModifier.prototype.initModifierProperties = function (t, e) { 5610 (this.getValue = this.processKeys), 5611 (this.amplitude = PropertyFactory.getProp(t, e.s, 0, null, this)), 5612 (this.frequency = PropertyFactory.getProp(t, e.r, 0, null, this)), 5613 (this.pointsType = PropertyFactory.getProp(t, e.pt, 0, null, this)), 5614 (this._isAnimated = 5615 0 !== this.amplitude.effectsSequence.length || 5616 0 !== this.frequency.effectsSequence.length || 5617 0 !== this.pointsType.effectsSequence.length); 5618 }), 5619 (ZigZagModifier.prototype.processPath = function (t, e, r, i) { 5620 var s = t._length, 5621 a = shapePool.newElement(); 5622 if (((a.c = t.c), t.c || (s -= 1), 0 === s)) return a; 5623 var n = -1, 5624 o = PolynomialBezier.shapeSegment(t, 0); 5625 zigZagCorner(a, t, 0, e, r, i, n); 5626 for (var h = 0; h < s; h += 1) 5627 (n = zigZagSegment(a, o, e, r, i, -n)), 5628 (o = 5629 h !== s - 1 || t.c 5630 ? PolynomialBezier.shapeSegment(t, (h + 1) % s) 5631 : null), 5632 zigZagCorner(a, t, h + 1, e, r, i, n); 5633 return a; 5634 }), 5635 (ZigZagModifier.prototype.processShapes = function (t) { 5636 var e, 5637 r, 5638 i, 5639 s, 5640 a, 5641 n, 5642 o = this.shapes.length, 5643 h = this.amplitude.v, 5644 l = Math.max(0, Math.round(this.frequency.v)), 5645 p = this.pointsType.v; 5646 if (0 !== h) 5647 for (r = 0; r < o; r += 1) { 5648 if ( 5649 ((n = (a = this.shapes[r]).localShapeCollection), 5650 a.shape._mdf || this._mdf || t) 5651 ) 5652 for ( 5653 n.releaseShapes(), 5654 a.shape._mdf = !0, 5655 e = a.shape.paths.shapes, 5656 s = a.shape.paths._length, 5657 i = 0; 5658 i < s; 5659 i += 1 5660 ) 5661 n.addShape(this.processPath(e[i], h, l, p)); 5662 a.shape.paths = a.localShapeCollection; 5663 } 5664 this.dynamicProperties.length || (this._mdf = !1);
5665 }), 5666 extendPrototype([ShapeModifier], OffsetPathModifier), 5667 (OffsetPathModifier.prototype.initModifierProperties = function (t, e) { 5668 (this.getValue = this.processKeys), 5669 (this.amount = PropertyFactory.getProp(t, e.a, 0, null, this)), 5670 (this.miterLimit = PropertyFactory.getProp(t, e.ml, 0, null, this)), 5671 (this.lineJoin = e.lj), 5672 (this._isAnimated = 0 !== this.amount.effectsSequence.length); 5673 }), 5674 (OffsetPathModifier.prototype.processPath = function (t, e, r, i) { 5675 var s = shapePool.newElement(); 5676 s.c = t.c; 5677 var a, 5678 n, 5679 o, 5680 h = t.length(); 5681 t.c || (h -= 1); 5682 var l = []; 5683 for (a = 0; a < h; a += 1) 5684 (o = PolynomialBezier.shapeSegment(t, a)), 5685 l.push(offsetSegmentSplit(o, e)); 5686 if (!t.c) 5687 for (a = h - 1; a >= 0; a -= 1) 5688 (o = PolynomialBezier.shapeSegmentInverted(t, a)), 5689 l.push(offsetSegmentSplit(o, e)); 5690 l = pruneIntersections(l); 5691 var p = null, 5692 f = null; 5693 for (a = 0; a < l.length; a += 1) { 5694 var m = l[a]; 5695 for ( 5696 f && (p = joinLines(s, f, m[0], r, i)), f = m[m.length - 1], n = 0; 5697 n < m.length; 5698 n += 1 5699 ) 5700 (o = m[n]), 5701 p && pointEqual(o.points[0], p) 5702 ? s.setXYAt(o.points[1][0], o.points[1][1], "o", s.length() - 1) 5703 : s.setTripleAt( 5704 o.points[0][0], 5705 o.points[0][1], 5706 o.points[1][0], 5707 o.points[1][1], 5708 o.points[0][0], 5709 o.points[0][1], 5710 s.length() 5711 ), 5712 s.setTripleAt( 5713 o.points[3][0], 5714 o.points[3][1], 5715 o.points[3][0], 5716 o.points[3][1], 5717 o.points[2][0], 5718 o.points[2][1], 5719 s.length() 5720 ), 5721 (p = o.points[3]); 5722 } 5723 return l.length && joinLines(s, f, l[0][0], r, i), s; 5724 }), 5725 (OffsetPathModifier.prototype.processShapes = function (t) { 5726 var e, 5727 r, 5728 i, 5729 s, 5730 a, 5731 n, 5732 o = this.shapes.length, 5733 h = this.amount.v, 5734 l = this.miterLimit.v, 5735 p = this.lineJoin; 5736 if (0 !== h) 5737 for (r = 0; r < o; r += 1) { 5738 if ( 5739 ((n = (a = this.shapes[r]).localShapeCollection), 5740 a.shape._mdf || this._mdf || t) 5741 ) 5742 for ( 5743 n.releaseShapes(), 5744 a.shape._mdf = !0, 5745 e = a.shape.paths.shapes, 5746 s = a.shape.paths._length, 5747 i = 0; 5748 i < s; 5749 i += 1 5750 ) 5751 n.addShape(this.processPath(e[i], h, p, l)); 5752 a.shape.paths = a.localShapeCollection; 5753 } 5754 this.dynamicProperties.length || (this._mdf = !1);
5755 }); 5756 var FontManager = (function () { 5757 var t = { w: 0, size: 0, shapes: [], data: { shapes: [] } }, 5758 e = []; 5759 e = e.concat([ 5760 2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366, 2367, 2368, 2369, 5761 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 5762 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403, 5763 ]); 5764 var r = ["d83cdffb", "d83cdffc", "d83cdffd", "d83cdffe", "d83cdfff"], 5765 i = [65039, 8205]; 5766 function s(t, e) { 5767 var r = createTag("span"); 5768 r.setAttribute("aria-hidden", !0), (r.style.fontFamily = e); 5769 var i = createTag("span"); 5770 (i.innerText = "giItT1WQy@!-/#"), 5771 (r.style.position = "absolute"), 5772 (r.style.left = "-10000px"), 5773 (r.style.top = "-10000px"), 5774 (r.style.fontSize = "300px"), 5775 (r.style.fontVariant = "normal"), 5776 (r.style.fontStyle = "normal"), 5777 (r.style.fontWeight = "normal"), 5778 (r.style.letterSpacing = "0"), 5779 r.appendChild(i), 5780 document.body.appendChild(r); 5781 var s = i.offsetWidth; 5782 return ( 5783 (i.style.fontFamily = 5784 (function (t) { 5785 var e, 5786 r = t.split(","), 5787 i = r.length, 5788 s = []; 5789 for (e = 0; e < i; e += 1) 5790 "sans-serif" !== r[e] && "monospace" !== r[e] && s.push(r[e]); 5791 return s.join(","); 5792 })(t) + 5793 ", " + 5794 e), 5795 { node: i, w: s, parent: r } 5796 ); 5797 } 5798 function a(t, e) { 5799 var r, 5800 i = document.body && e ? "svg" : "canvas", 5801 s = getFontProperties(t); 5802 if ("svg" === i) { 5803 var a = createNS("text"); 5804 (a.style.fontSize = "100px"), 5805 a.setAttribute("font-family", t.fFamily), 5806 a.setAttribute("font-style", s.style), 5807 a.setAttribute("font-weight", s.weight), 5808 (a.textContent = "1"), 5809 t.fClass 5810 ? ((a.style.fontFamily = "inherit"), 5811 a.setAttribute("class", t.fClass)) 5812 : (a.style.fontFamily = t.fFamily), 5813 e.appendChild(a), 5814 (r = a); 5815 } else { 5816 var n = new OffscreenCanvas(500, 500).getContext("2d"); 5817 (n.font = s.style + " " + s.weight + " 100px " + t.fFamily), (r = n); 5818 } 5819 return { 5820 measureText: function (t) { 5821 return "svg" === i 5822 ? ((r.textContent = t), r.getComputedTextLength()) 5823 : r.measureText(t).width; 5824 }, 5825 }; 5826 } 5827 var n = function () { 5828 (this.fonts = []), 5829 (this.chars = null), 5830 (this.typekitLoaded = 0), 5831 (this.isLoaded = !1), 5832 (this._warned = !1), 5833 (this.initTime = Date.now()), 5834 (this.setIsLoadedBinded = this.setIsLoaded.bind(this)), 5835 (this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)); 5836 }; 5837 (n.isModifier = function (t, e) { 5838 var i = t.toString(16) + e.toString(16); 5839 return -1 !== r.indexOf(i); 5840 }), 5841 (n.isZeroWidthJoiner = function (t, e) { 5842 return e ? t === i[0] && e === i[1] : t === i[1]; 5843 }), 5844 (n.isCombinedCharacter = function (t) { 5845 return -1 !== e.indexOf(t); 5846 }); 5847 var o = { 5848 addChars: function (t) { 5849 if (t) { 5850 var e; 5851 this.chars || (this.chars = []); 5852 var r, 5853 i, 5854 s = t.length, 5855 a = this.chars.length; 5856 for (e = 0; e < s; e += 1) { 5857 for (r = 0, i = !1; r < a; ) 5858 this.chars[r].style === t[e].style && 5859 this.chars[r].fFamily === t[e].fFamily && 5860 this.chars[r].ch === t[e].ch && 5861 (i = !0), 5862 (r += 1); 5863 i || (this.chars.push(t[e]), (a += 1)); 5864 } 5865 } 5866 }, 5867 addFonts: function (t, e) { 5868 if (t) { 5869 if (this.chars) 5870 return (this.isLoaded = !0), void (this.fonts = t.list); 5871 if (!document.body) 5872 return ( 5873 (this.isLoaded = !0), 5874 t.list.forEach(function (t) { 5875 (t.helper = a(t)), (t.cache = {}); 5876 }), 5877 void (this.fonts = t.list) 5878 ); 5879 var r, 5880 i = t.list, 5881 n = i.length, 5882 o = n; 5883 for (r = 0; r < n; r += 1) { 5884 var h, 5885 l, 5886 p = !0; 5887 if ( 5888 ((i[r].loaded = !1), 5889 (i[r].monoCase = s(i[r].fFamily, "monospace")), 5890 (i[r].sansCase = s(i[r].fFamily, "sans-serif")), 5891 i[r].fPath) 5892 ) { 5893 if ("p" === i[r].fOrigin || 3 === i[r].origin) { 5894 if ( 5895 ((h = document.querySelectorAll( 5896 'style[f-forigin="p"][f-family="' + 5897 i[r].fFamily + 5898 '"], style[f-origin="3"][f-family="' + 5899 i[r].fFamily + 5900 '"]' 5901 )).length > 0 && (p = !1), 5902 p) 5903 ) { 5904 var f = createTag("style"); 5905 f.setAttribute("f-forigin", i[r].fOrigin), 5906 f.setAttribute("f-origin", i[r].origin), 5907 f.setAttribute("f-family", i[r].fFamily), 5908 (f.type = "text/css"), 5909 (f.innerText = 5910 "@font-face {font-family: " + 5911 i[r].fFamily + 5912 "; font-style: normal; src: url('" + 5913 i[r].fPath + 5914 "');}"), 5915 e.appendChild(f); 5916 } 5917 } else if ("g" === i[r].fOrigin || 1 === i[r].origin) { 5918 for ( 5919 h = document.querySelectorAll( 5920 'link[f-forigin="g"], link[f-origin="1"]' 5921 ), 5922 l = 0; 5923 l < h.length; 5924 l += 1 5925 ) 5926 -1 !== h[l].href.indexOf(i[r].fPath) && (p = !1); 5927 if (p) { 5928 var m = createTag("link"); 5929 m.setAttribute("f-forigin", i[r].fOrigin), 5930 m.setAttribute("f-origin", i[r].origin), 5931 (m.type = "text/css"), 5932 (m.rel = "stylesheet"), 5933 (m.href = i[r].fPath), 5934 document.body.appendChild(m); 5935 } 5936 } else if ("t" === i[r].fOrigin || 2 === i[r].origin) { 5937 for ( 5938 h = document.querySelectorAll( 5939 'script[f-forigin="t"], script[f-origin="2"]' 5940 ), 5941 l = 0; 5942 l < h.length; 5943 l += 1 5944 ) 5945 i[r].fPath === h[l].src && (p = !1); 5946 if (p) { 5947 var c = createTag("link"); 5948 c.setAttribute("f-forigin", i[r].fOrigin), 5949 c.setAttribute("f-origin", i[r].origin), 5950 c.setAttribute("rel", "stylesheet"), 5951 c.setAttribute("href", i[r].fPath), 5952 e.appendChild(c); 5953 } 5954 } 5955 } else (i[r].loaded = !0), (o -= 1); 5956 (i[r].helper = a(i[r], e)), 5957 (i[r].cache = {}), 5958 this.fonts.push(i[r]); 5959 } 5960 0 === o 5961 ? (this.isLoaded = !0) 5962 : setTimeout(this.checkLoadedFonts.bind(this), 100); 5963 } else this.isLoaded = !0; 5964 }, 5965 getCharData: function (e, r, i) { 5966 for (var s = 0, a = this.chars.length; s < a; ) { 5967 if ( 5968 this.chars[s].ch === e && 5969 this.chars[s].style === r && 5970 this.chars[s].fFamily === i 5971 ) 5972 return this.chars[s];
5973 s += 1; 5974 } 5975 return ( 5976 (("string" == typeof e && 13 !== e.charCodeAt(0)) || !e) && 5977 console && 5978 console.warn && 5979 !this._warned && 5980 ((this._warned = !0), 5981 console.warn( 5982 "Missing character from exported characters list: ", 5983 e, 5984 r, 5985 i 5986 )), 5987 t 5988 ); 5989 }, 5990 getFontByName: function (t) { 5991 for (var e = 0, r = this.fonts.length; e < r; ) { 5992 if (this.fonts[e].fName === t) return this.fonts[e]; 5993 e += 1; 5994 } 5995 return this.fonts[0]; 5996 }, 5997 measureText: function (t, e, r) { 5998 var i = this.getFontByName(e), 5999 s = t.charCodeAt(0); 6000 if (!i.cache[s + 1]) { 6001 var a = i.helper; 6002 if (" " === t) { 6003 var n = a.measureText("|" + t + "|"), 6004 o = a.measureText("||"); 6005 i.cache[s + 1] = (n - o) / 100; 6006 } else i.cache[s + 1] = a.measureText(t) / 100; 6007 } 6008 return i.cache[s + 1] * r; 6009 }, 6010 checkLoadedFonts: function () { 6011 var t, 6012 e, 6013 r, 6014 i = this.fonts.length, 6015 s = i; 6016 for (t = 0; t < i; t += 1) 6017 this.fonts[t].loaded 6018 ? (s -= 1) 6019 : "n" === this.fonts[t].fOrigin || 0 === this.fonts[t].origin 6020 ? (this.fonts[t].loaded = !0) 6021 : ((e = this.fonts[t].monoCase.node), 6022 (r = this.fonts[t].monoCase.w), 6023 e.offsetWidth !== r 6024 ? ((s -= 1), (this.fonts[t].loaded = !0)) 6025 : ((e = this.fonts[t].sansCase.node), 6026 (r = this.fonts[t].sansCase.w), 6027 e.offsetWidth !== r && 6028 ((s -= 1), (this.fonts[t].loaded = !0))), 6029 this.fonts[t].loaded && 6030 (this.fonts[t].sansCase.parent.parentNode.removeChild( 6031 this.fonts[t].sansCase.parent 6032 ), 6033 this.fonts[t].monoCase.parent.parentNode.removeChild( 6034 this.fonts[t].monoCase.parent 6035 ))); 6036 0 !== s && Date.now() - this.initTime < 5e3 6037 ? setTimeout(this.checkLoadedFontsBinded, 20) 6038 : setTimeout(this.setIsLoadedBinded, 10); 6039 }, 6040 setIsLoaded: function () { 6041 this.isLoaded = !0; 6042 }, 6043 }; 6044 return (n.prototype = o), n; 6045 })();
6046 function RenderableElement() {} 6047 RenderableElement.prototype = { 6048 initRenderable: function () { 6049 (this.isInRange = !1), 6050 (this.hidden = !1), 6051 (this.isTransparent = !1), 6052 (this.renderableComponents = []); 6053 }, 6054 addRenderableComponent: function (t) { 6055 -1 === this.renderableComponents.indexOf(t) && 6056 this.renderableComponents.push(t); 6057 }, 6058 removeRenderableComponent: function (t) { 6059 -1 !== this.renderableComponents.indexOf(t) && 6060 this.renderableComponents.splice( 6061 this.renderableComponents.indexOf(t), 6062 1 6063 ); 6064 }, 6065 prepareRenderableFrame: function (t) { 6066 this.checkLayerLimits(t); 6067 }, 6068 checkTransparency: function () { 6069 this.finalTransform.mProp.o.v <= 0 6070 ? !this.isTransparent && 6071 this.globalData.renderConfig.hideOnTransparent && 6072 ((this.isTransparent = !0), this.hide()) 6073 : this.isTransparent && ((this.isTransparent = !1), this.show()); 6074 }, 6075 checkLayerLimits: function (t) { 6076 this.data.ip - this.data.st <= t && this.data.op - this.data.st > t 6077 ? !0 !== this.isInRange && 6078 ((this.globalData._mdf = !0), 6079 (this._mdf = !0), 6080 (this.isInRange = !0), 6081 this.show()) 6082 : !1 !== this.isInRange && 6083 ((this.globalData._mdf = !0), (this.isInRange = !1), this.hide()); 6084 }, 6085 renderRenderable: function () { 6086 var t, 6087 e = this.renderableComponents.length; 6088 for (t = 0; t < e; t += 1) 6089 this.renderableComponents[t].renderFrame(this._isFirstFrame); 6090 }, 6091 sourceRectAtTime: function () { 6092 return { top: 0, left: 0, width: 100, height: 100 }; 6093 }, 6094 getLayerSize: function () { 6095 return 5 === this.data.ty 6096 ? { w: this.data.textData.width, h: this.data.textData.height } 6097 : { w: this.data.width, h: this.data.height }; 6098 }, 6099 }; 6100 var getBlendMode = 6101 ((blendModeEnums = { 6102 0: "source-over", 6103 1: "multiply", 6104 2: "screen", 6105 3: "overlay", 6106 4: "darken", 6107 5: "lighten", 6108 6: "color-dodge", 6109 7: "color-burn", 6110 8: "hard-light", 6111 9: "soft-light", 6112 10: "difference", 6113 11: "exclusion", 6114 12: "hue", 6115 13: "saturation", 6116 14: "color", 6117 15: "luminosity", 6118 }), 6119 function (t) { 6120 return blendModeEnums[t] || ""; 6121 }), 6122 blendModeEnums; 6123 function SliderEffect(t, e, r) { 6124 this.p = PropertyFactory.getProp(e, t.v, 0, 0, r); 6125 } 6126 function AngleEffect(t, e, r) { 6127 this.p = PropertyFactory.getProp(e, t.v, 0, 0, r); 6128 } 6129 function ColorEffect(t, e, r) { 6130 this.p = PropertyFactory.getProp(e, t.v, 1, 0, r); 6131 } 6132 function PointEffect(t, e, r) { 6133 this.p = PropertyFactory.getProp(e, t.v, 1, 0, r); 6134 } 6135 function LayerIndexEffect(t, e, r) { 6136 this.p = PropertyFactory.getProp(e, t.v, 0, 0, r); 6137 } 6138 function MaskIndexEffect(t, e, r) { 6139 this.p = PropertyFactory.getProp(e, t.v, 0, 0, r); 6140 } 6141 function CheckboxEffect(t, e, r) { 6142 this.p = PropertyFactory.getProp(e, t.v, 0, 0, r); 6143 } 6144 function NoValueEffect() { 6145 this.p = {}; 6146 } 6147 function EffectsManager(t, e) { 6148 var r, 6149 i = t.ef || []; 6150 this.effectElements = []; 6151 var s, 6152 a = i.length; 6153 for (r = 0; r < a; r += 1) 6154 (s = new GroupEffect(i[r], e)), this.effectElements.push(s); 6155 } 6156 function GroupEffect(t, e) { 6157 this.init(t, e); 6158 } 6159 function BaseElement() {} 6160 function FrameElement() {} 6161 function FootageElement(t, e, r) { 6162 this.initFrame(), 6163 this.initRenderable(), 6164 (this.assetData = e.getAssetData(t.refId)), 6165 (this.footageData = e.imageLoader.getAsset(this.assetData)), 6166 this.initBaseData(t, e, r); 6167 } 6168 function AudioElement(t, e, r) { 6169 this.initFrame(), 6170 this.initRenderable(), 6171 (this.assetData = e.getAssetData(t.refId)), 6172 this.initBaseData(t, e, r), 6173 (this._isPlaying = !1), 6174 (this._canPlay = !1); 6175 var i = this.globalData.getAssetsPath(this.assetData); 6176 (this.audio = this.globalData.audioController.createAudio(i)), 6177 (this._currentTime = 0), 6178 this.globalData.audioController.addAudio(this), 6179 (this._volumeMultiplier = 1), 6180 (this._volume = 1), 6181 (this._previousVolume = null), 6182 (this.tm = t.tm 6183 ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) 6184 : { _placeholder: !0 }), 6185 (this.lv = PropertyFactory.getProp( 6186 this,
6187 t.au && t.au.lv ? t.au.lv : { k: [100] }, 6188 1, 6189 0.01, 6190 this 6191 )); 6192 } 6193 function BaseRenderer() {} 6194 function TransformElement() {} 6195 function MaskElement(t, e, r) { 6196 (this.data = t), 6197 (this.element = e), 6198 (this.globalData = r), 6199 (this.storedData = []), 6200 (this.masksProperties = this.data.masksProperties || []), 6201 (this.maskElement = null); 6202 var i, 6203 s, 6204 a = this.globalData.defs, 6205 n = this.masksProperties ? this.masksProperties.length : 0; 6206 (this.viewData = createSizedArray(n)), (this.solidPath = ""); 6207 var o, 6208 h, 6209 l, 6210 p, 6211 f, 6212 m, 6213 c = this.masksProperties, 6214 d = 0, 6215 u = [], 6216 y = createElementID(), 6217 g = "clipPath", 6218 v = "clip-path"; 6219 for (i = 0; i < n; i += 1) 6220 if ( 6221 ((("a" !== c[i].mode && "n" !== c[i].mode) || 6222 c[i].inv || 6223 100 !== c[i].o.k || 6224 c[i].o.x) && 6225 ((g = "mask"), (v = "mask")), 6226 ("s" !== c[i].mode && "i" !== c[i].mode) || 0 !== d 6227 ? (l = null) 6228 : ((l = createNS("rect")).setAttribute("fill", "#ffffff"), 6229 l.setAttribute("width", this.element.comp.data.w || 0), 6230 l.setAttribute("height", this.element.comp.data.h || 0), 6231 u.push(l)), 6232 (s = createNS("path")), 6233 "n" === c[i].mode) 6234 ) 6235 (this.viewData[i] = { 6236 op: PropertyFactory.getProp( 6237 this.element, 6238 c[i].o, 6239 0, 6240 0.01, 6241 this.element 6242 ), 6243 prop: ShapePropertyFactory.getShapeProp(this.element, c[i], 3), 6244 elem: s, 6245 lastPath: "", 6246 }), 6247 a.appendChild(s); 6248 else { 6249 var b; 6250 if ( 6251 ((d += 1), 6252 s.setAttribute("fill", "s" === c[i].mode ? "#000000" : "#ffffff"), 6253 s.setAttribute("clip-rule", "nonzero"), 6254 0 !== c[i].x.k 6255 ? ((g = "mask"), 6256 (v = "mask"), 6257 (m = PropertyFactory.getProp( 6258 this.element, 6259 c[i].x, 6260 0, 6261 null, 6262 this.element 6263 )), 6264 (b = createElementID()), 6265 (p = createNS("filter")).setAttribute("id", b), 6266 (f = createNS("feMorphology")).setAttribute( 6267 "operator", 6268 "erode" 6269 ), 6270 f.setAttribute("in", "SourceGraphic"), 6271 f.setAttribute("radius", "0"), 6272 p.appendChild(f), 6273 a.appendChild(p), 6274 s.setAttribute( 6275 "stroke", 6276 "s" === c[i].mode ? "#000000" : "#ffffff" 6277 )) 6278 : ((f = null), (m = null)), 6279 (this.storedData[i] = { 6280 elem: s, 6281 x: m, 6282 expan: f, 6283 lastPath: "", 6284 lastOperator: "", 6285 filterId: b, 6286 lastRadius: 0, 6287 }), 6288 "i" === c[i].mode) 6289 ) { 6290 h = u.length; 6291 var P = createNS("g"); 6292 for (o = 0; o < h; o += 1) P.appendChild(u[o]); 6293 var x = createNS("mask"); 6294 x.setAttribute("mask-type", "alpha"), 6295 x.setAttribute("id", y + "_" + d), 6296 x.appendChild(s), 6297 a.appendChild(x), 6298 P.setAttribute( 6299 "mask", 6300 "url(" + getLocationHref() + "#" + y + "_" + d + ")" 6301 ), 6302 (u.length = 0), 6303 u.push(P); 6304 } else u.push(s); 6305 c[i].inv && 6306 !this.solidPath && 6307 (this.solidPath = this.createLayerSolidPath()), 6308 (this.viewData[i] = { 6309 elem: s, 6310 lastPath: "", 6311 op: PropertyFactory.getProp( 6312 this.element, 6313 c[i].o, 6314 0, 6315 0.01, 6316 this.element 6317 ), 6318 prop: ShapePropertyFactory.getShapeProp(this.element, c[i], 3), 6319 invRect: l, 6320 }), 6321 this.viewData[i].prop.k || 6322 this.drawPath(c[i], this.viewData[i].prop.v, this.viewData[i]); 6323 } 6324 for (this.maskElement = createNS(g), n = u.length, i = 0; i < n; i += 1) 6325 this.maskElement.appendChild(u[i]); 6326 d > 0 && 6327 (this.maskElement.setAttribute("id", y), 6328 this.element.maskedElement.setAttribute( 6329 v, 6330 "url(" + getLocationHref() + "#" + y + ")" 6331 ), 6332 a.appendChild(this.maskElement)), 6333 this.viewData.length && this.element.addRenderableComponent(this); 6334 } 6335 extendPrototype([DynamicPropertyContainer], GroupEffect), 6336 (GroupEffect.prototype.getValue = 6337 GroupEffect.prototype.iterateDynamicProperties), 6338 (GroupEffect.prototype.init = function (t, e) { 6339 var r; 6340 (this.data = t), 6341 (this.effectElements = []), 6342 this.initDynamicPropertyContainer(e); 6343 var i, 6344 s = this.data.ef.length, 6345 a = this.data.ef; 6346 for (r = 0; r < s; r += 1) { 6347 switch (((i = null), a[r].ty)) { 6348 case 0: 6349 i = new SliderEffect(a[r], e, this); 6350 break; 6351 case 1: 6352 i = new AngleEffect(a[r], e, this); 6353 break; 6354 case 2: 6355 i = new ColorEffect(a[r], e, this); 6356 break; 6357 case 3: 6358 i = new PointEffect(a[r], e, this); 6359 break; 6360 case 4: 6361 case 7: 6362 i = new CheckboxEffect(a[r], e, this); 6363 break; 6364 case 10:
6365 i = new LayerIndexEffect(a[r], e, this); 6366 break; 6367 case 11: 6368 i = new MaskIndexEffect(a[r], e, this); 6369 break; 6370 case 5: 6371 i = new EffectsManager(a[r], e, this); 6372 break; 6373 default: 6374 i = new NoValueEffect(a[r], e, this); 6375 } 6376 i && this.effectElements.push(i); 6377 } 6378 }), 6379 (BaseElement.prototype = { 6380 checkMasks: function () { 6381 if (!this.data.hasMask) return !1; 6382 for (var t = 0, e = this.data.masksProperties.length; t < e; ) { 6383 if ( 6384 "n" !== this.data.masksProperties[t].mode && 6385 !1 !== this.data.masksProperties[t].cl 6386 ) 6387 return !0; 6388 t += 1; 6389 } 6390 return !1; 6391 }, 6392 initExpressions: function () { 6393 var t = getExpressionInterfaces(); 6394 if (t) { 6395 var e = t("layer"), 6396 r = t("effects"), 6397 i = t("shape"), 6398 s = t("text"), 6399 a = t("comp"); 6400 (this.layerInterface = e(this)), 6401 this.data.hasMask && 6402 this.maskManager && 6403 this.layerInterface.registerMaskInterface(this.maskManager); 6404 var n = r.createEffectsInterface(this, this.layerInterface); 6405 this.layerInterface.registerEffectsInterface(n), 6406 0 === this.data.ty || this.data.xt 6407 ? (this.compInterface = a(this)) 6408 : 4 === this.data.ty 6409 ? ((this.layerInterface.shapeInterface = i( 6410 this.shapesData, 6411 this.itemsData, 6412 this.layerInterface 6413 )), 6414 (this.layerInterface.content = 6415 this.layerInterface.shapeInterface)) 6416 : 5 === this.data.ty && 6417 ((this.layerInterface.textInterface = s(this)), 6418 (this.layerInterface.text = 6419 this.layerInterface.textInterface)); 6420 } 6421 }, 6422 setBlendMode: function () { 6423 var t = getBlendMode(this.data.bm); 6424 (this.baseElement || this.layerElement).style["mix-blend-mode"] = t; 6425 }, 6426 initBaseData: function (t, e, r) { 6427 (this.globalData = e), 6428 (this.comp = r), 6429 (this.data = t), 6430 (this.layerId = createElementID()), 6431 this.data.sr || (this.data.sr = 1), 6432 (this.effectsManager = new EffectsManager( 6433 this.data, 6434 this, 6435 this.dynamicProperties 6436 )); 6437 }, 6438 getType: function () { 6439 return this.type; 6440 }, 6441 sourceRectAtTime: function () {}, 6442 }), 6443 (FrameElement.prototype = { 6444 initFrame: function () { 6445 (this._isFirstFrame = !1), 6446 (this.dynamicProperties = []), 6447 (this._mdf = !1);
6448 }, 6449 prepareProperties: function (t, e) { 6450 var r, 6451 i = this.dynamicProperties.length; 6452 for (r = 0; r < i; r += 1) 6453 (e || 6454 (this._isParent && 6455 "transform" === this.dynamicProperties[r].propType)) && 6456 (this.dynamicProperties[r].getValue(), 6457 this.dynamicProperties[r]._mdf && 6458 ((this.globalData._mdf = !0), (this._mdf = !0))); 6459 }, 6460 addDynamicProperty: function (t) { 6461 -1 === this.dynamicProperties.indexOf(t) && 6462 this.dynamicProperties.push(t); 6463 }, 6464 }), 6465 (FootageElement.prototype.prepareFrame = function () {}), 6466 extendPrototype( 6467 [RenderableElement, BaseElement, FrameElement], 6468 FootageElement 6469 ), 6470 (FootageElement.prototype.getBaseElement = function () { 6471 return null; 6472 }), 6473 (FootageElement.prototype.renderFrame = function () {}), 6474 (FootageElement.prototype.destroy = function () {}), 6475 (FootageElement.prototype.initExpressions = function () { 6476 var t = getExpressionInterfaces(); 6477 if (t) { 6478 var e = t("footage"); 6479 this.layerInterface = e(this); 6480 } 6481 }), 6482 (FootageElement.prototype.getFootageData = function () { 6483 return this.footageData; 6484 }), 6485 (AudioElement.prototype.prepareFrame = function (t) { 6486 if ( 6487 (this.prepareRenderableFrame(t, !0), 6488 this.prepareProperties(t, !0), 6489 this.tm._placeholder) 6490 ) 6491 this._currentTime = t / this.data.sr; 6492 else { 6493 var e = this.tm.v; 6494 this._currentTime = e; 6495 } 6496 this._volume = this.lv.v[0]; 6497 var r = this._volume * this._volumeMultiplier; 6498 this._previousVolume !== r && 6499 ((this._previousVolume = r), this.audio.volume(r)); 6500 }), 6501 extendPrototype( 6502 [RenderableElement, BaseElement, FrameElement], 6503 AudioElement 6504 ), 6505 (AudioElement.prototype.renderFrame = function () { 6506 this.isInRange && 6507 this._canPlay && 6508 (this._isPlaying 6509 ? (!this.audio.playing() || 6510 Math.abs( 6511 this._currentTime / this.globalData.frameRate - 6512 this.audio.seek() 6513 ) > 0.1) && 6514 this.audio.seek(this._currentTime / this.globalData.frameRate) 6515 : (this.audio.play(), 6516 this.audio.seek(this._currentTime / this.globalData.frameRate), 6517 (this._isPlaying = !0))); 6518 }), 6519 (AudioElement.prototype.show = function () {}), 6520 (AudioElement.prototype.hide = function () { 6521 this.audio.pause(), (this._isPlaying = !1); 6522 }), 6523 (AudioElement.prototype.pause = function () { 6524 this.audio.pause(), (this._isPlaying = !1), (this._canPlay = !1); 6525 }), 6526 (AudioElement.prototype.resume = function () { 6527 this._canPlay = !0; 6528 }), 6529 (AudioElement.prototype.setRate = function (t) { 6530 this.audio.rate(t); 6531 }), 6532 (AudioElement.prototype.volume = function (t) { 6533 (this._volumeMultiplier = t), 6534 (this._previousVolume = t * this._volume), 6535 this.audio.volume(this._previousVolume); 6536 }), 6537 (AudioElement.prototype.getBaseElement = function () { 6538 return null; 6539 }), 6540 (AudioElement.prototype.destroy = function () {}), 6541 (AudioElement.prototype.sourceRectAtTime = function () {}), 6542 (AudioElement.prototype.initExpressions = function () {}), 6543 (BaseRenderer.prototype.checkLayers = function (t) { 6544 var e, 6545 r, 6546 i = this.layers.length; 6547 for (this.completeLayers = !0, e = i - 1; e >= 0; e -= 1) 6548 this.elements[e] || 6549 ((r = this.layers[e]).ip - r.st <= t - this.layers[e].st && 6550 r.op - r.st > t - this.layers[e].st && 6551 this.buildItem(e)), 6552 (this.completeLayers = !!this.elements[e] && this.completeLayers); 6553 this.checkPendingElements(); 6554 }), 6555 (BaseRenderer.prototype.createItem = function (t) { 6556 switch (t.ty) { 6557 case 2: 6558 return this.createImage(t); 6559 case 0: 6560 return this.createComp(t); 6561 case 1: 6562 return this.createSolid(t); 6563 case 3: 6564 default: 6565 return this.createNull(t); 6566 case 4: 6567 return this.createShape(t); 6568 case 5: 6569 return this.createText(t); 6570 case 6: 6571 return this.createAudio(t); 6572 case 13: 6573 return this.createCamera(t); 6574 case 15: 6575 return this.createFootage(t); 6576 } 6577 }), 6578 (BaseRenderer.prototype.createCamera = function () { 6579 throw new Error("You're using a 3d camera. Try the html renderer."); 6580 }), 6581 (BaseRenderer.prototype.createAudio = function (t) { 6582 return new AudioElement(t, this.globalData, this); 6583 }), 6584 (BaseRenderer.prototype.createFootage = function (t) { 6585 return new FootageElement(t, this.globalData, this); 6586 }), 6587 (BaseRenderer.prototype.buildAllItems = function () { 6588 var t, 6589 e = this.layers.length; 6590 for (t = 0; t < e; t += 1) this.buildItem(t); 6591 this.checkPendingElements(); 6592 }), 6593 (BaseRenderer.prototype.includeLayers = function (t) { 6594 var e; 6595 this.completeLayers = !1; 6596 var r, 6597 i = t.length, 6598 s = this.layers.length; 6599 for (e = 0; e < i; e += 1) 6600 for (r = 0; r < s; ) { 6601 if (this.layers[r].id === t[e].id) { 6602 this.layers[r] = t[e]; 6603 break; 6604 } 6605 r += 1; 6606 } 6607 }), 6608 (BaseRenderer.prototype.setProjectInterface = function (t) { 6609 this.globalData.projectInterface = t; 6610 }), 6611 (BaseRenderer.prototype.initItems = function () { 6612 this.globalData.progressiveLoad || this.buildAllItems();
6613 }), 6614 (BaseRenderer.prototype.buildElementParenting = function (t, e, r) { 6615 for ( 6616 var i = this.elements, s = this.layers, a = 0, n = s.length; 6617 a < n; 6618 6619 ) 6620 s[a].ind == e && 6621 (i[a] && !0 !== i[a] 6622 ? (r.push(i[a]), 6623 i[a].setAsParent(), 6624 void 0 !== s[a].parent 6625 ? this.buildElementParenting(t, s[a].parent, r) 6626 : t.setHierarchy(r)) 6627 : (this.buildItem(a), this.addPendingElement(t))), 6628 (a += 1); 6629 }), 6630 (BaseRenderer.prototype.addPendingElement = function (t) { 6631 this.pendingElements.push(t); 6632 }), 6633 (BaseRenderer.prototype.searchExtraCompositions = function (t) { 6634 var e, 6635 r = t.length; 6636 for (e = 0; e < r; e += 1) 6637 if (t[e].xt) { 6638 var i = this.createComp(t[e]); 6639 i.initExpressions(), 6640 this.globalData.projectInterface.registerComposition(i); 6641 } 6642 }), 6643 (BaseRenderer.prototype.getElementByPath = function (t) { 6644 var e, 6645 r = t.shift(); 6646 if ("number" == typeof r) e = this.elements[r]; 6647 else { 6648 var i, 6649 s = this.elements.length; 6650 for (i = 0; i < s; i += 1) 6651 if (this.elements[i].data.nm === r) { 6652 e = this.elements[i]; 6653 break; 6654 } 6655 } 6656 return 0 === t.length ? e : e.getElementByPath(t); 6657 }), 6658 (BaseRenderer.prototype.setupGlobalData = function (t, e) { 6659 (this.globalData.fontManager = new FontManager()), 6660 this.globalData.fontManager.addChars(t.chars), 6661 this.globalData.fontManager.addFonts(t.fonts, e), 6662 (this.globalData.getAssetData = this.animationItem.getAssetData.bind( 6663 this.animationItem 6664 )), 6665 (this.globalData.getAssetsPath = 6666 this.animationItem.getAssetsPath.bind(this.animationItem)), 6667 (this.globalData.imageLoader = this.animationItem.imagePreloader), 6668 (this.globalData.audioController = 6669 this.animationItem.audioController), 6670 (this.globalData.frameId = 0), 6671 (this.globalData.frameRate = t.fr), 6672 (this.globalData.nm = t.nm), 6673 (this.globalData.compSize = { w: t.w, h: t.h }); 6674 }), 6675 (TransformElement.prototype = { 6676 initTransform: function () { 6677 (this.finalTransform = { 6678 mProp: this.data.ks 6679 ? TransformPropertyFactory.getTransformProperty( 6680 this, 6681 this.data.ks, 6682 this 6683 ) 6684 : { o: 0 }, 6685 _matMdf: !1, 6686 _opMdf: !1, 6687 mat: new Matrix(), 6688 }), 6689 this.data.ao && (this.finalTransform.mProp.autoOriented = !0), 6690 this.data.ty; 6691 }, 6692 renderTransform: function () { 6693 if ( 6694 ((this.finalTransform._opMdf = 6695 this.finalTransform.mProp.o._mdf || this._isFirstFrame), 6696 (this.finalTransform._matMdf = 6697 this.finalTransform.mProp._mdf || this._isFirstFrame), 6698 this.hierarchy) 6699 ) { 6700 var t, 6701 e = this.finalTransform.mat, 6702 r = 0, 6703 i = this.hierarchy.length; 6704 if (!this.finalTransform._matMdf) 6705 for (; r < i; ) { 6706 if (this.hierarchy[r].finalTransform.mProp._mdf) { 6707 this.finalTransform._matMdf = !0; 6708 break; 6709 } 6710 r += 1; 6711 } 6712 if (this.finalTransform._matMdf) 6713 for ( 6714 t = this.finalTransform.mProp.v.props, 6715 e.cloneFromProps(t), 6716 r = 0; 6717 r < i; 6718 r += 1 6719 ) 6720 (t = this.hierarchy[r].finalTransform.mProp.v.props), 6721 e.transform( 6722 t[0], 6723 t[1], 6724 t[2], 6725 t[3], 6726 t[4], 6727 t[5], 6728 t[6], 6729 t[7], 6730 t[8], 6731 t[9], 6732 t[10], 6733 t[11], 6734 t[12], 6735 t[13], 6736 t[14], 6737 t[15] 6738 ); 6739 } 6740 }, 6741 globalToLocal: function (t) { 6742 var e = []; 6743 e.push(this.finalTransform); 6744 for (var r, i = !0, s = this.comp; i; ) 6745 s.finalTransform 6746 ? (s.data.hasMask && e.splice(0, 0, s.finalTransform), 6747 (s = s.comp)) 6748 : (i = !1); 6749 var a, 6750 n = e.length; 6751 for (r = 0; r < n; r += 1) 6752 (a = e[r].mat.applyToPointArray(0, 0, 0)), 6753 (t = [t[0] - a[0], t[1] - a[1], 0]); 6754 return t; 6755 }, 6756 mHelper: new Matrix(), 6757 }), 6758 (MaskElement.prototype.getMaskProperty = function (t) { 6759 return this.viewData[t].prop; 6760 }), 6761 (MaskElement.prototype.renderFrame = function (t) { 6762 var e, 6763 r = this.element.finalTransform.mat, 6764 i = this.masksProperties.length; 6765 for (e = 0; e < i; e += 1) 6766 if ( 6767 ((this.viewData[e].prop._mdf || t) && 6768 this.drawPath( 6769 this.masksProperties[e], 6770 this.viewData[e].prop.v, 6771 this.viewData[e] 6772 ), 6773 (this.viewData[e].op._mdf || t) && 6774 this.viewData[e].elem.setAttribute( 6775 "fill-opacity", 6776 this.viewData[e].op.v 6777 ), 6778 "n" !== this.masksProperties[e].mode && 6779 (this.viewData[e].invRect && 6780 (this.element.finalTransform.mProp._mdf || t) && 6781 this.viewData[e].invRect.setAttribute( 6782 "transform", 6783 r.getInverseMatrix().to2dCSS() 6784 ), 6785 this.storedData[e].x && (this.storedData[e].x._mdf || t))) 6786 ) { 6787 var s = this.storedData[e].expan; 6788 this.storedData[e].x.v < 0 6789 ? ("erode" !== this.storedData[e].lastOperator && 6790 ((this.storedData[e].lastOperator = "erode"), 6791 this.storedData[e].elem.setAttribute( 6792 "filter", 6793 "url(" + 6794 getLocationHref() + 6795 "#" + 6796 this.storedData[e].filterId + 6797 ")" 6798 )), 6799 s.setAttribute("radius", -this.storedData[e].x.v)) 6800 : ("dilate" !== this.storedData[e].lastOperator && 6801 ((this.storedData[e].lastOperator = "dilate"), 6802 this.storedData[e].elem.setAttribute("filter", null)), 6803 this.storedData[e].elem.setAttribute( 6804 "stroke-width", 6805 2 * this.storedData[e].x.v 6806 )); 6807 } 6808 }), 6809 (MaskElement.prototype.getMaskelement = function () { 6810 return this.maskElement; 6811 }), 6812 (MaskElement.prototype.createLayerSolidPath = function () { 6813 var t = "M0,0 "; 6814 return ( 6815 (t += " h" + this.globalData.compSize.w), 6816 (t += " v" + this.globalData.compSize.h), 6817 (t += " h-" + this.globalData.compSize.w), 6818 (t += " v-" + this.globalData.compSize.h + " ") 6819 ); 6820 }), 6821 (MaskElement.prototype.drawPath = function (t, e, r) { 6822 var i, 6823 s, 6824 a = " M" + e.v[0][0] + "," + e.v[0][1]; 6825 for (s = e._length, i = 1; i < s; i += 1) 6826 a += 6827 " C" + 6828 e.o[i - 1][0] + 6829 "," + 6830 e.o[i - 1][1] + 6831 " " + 6832 e.i[i][0] + 6833 "," + 6834 e.i[i][1] + 6835 " " + 6836 e.v[i][0] + 6837 "," + 6838 e.v[i][1]; 6839 if ( 6840 (e.c && 6841 s > 1 && 6842 (a += 6843 " C" + 6844 e.o[i - 1][0] + 6845 "," + 6846 e.o[i - 1][1] + 6847 " " + 6848 e.i[0][0] + 6849 "," + 6850 e.i[0][1] + 6851 " " + 6852 e.v[0][0] + 6853 "," + 6854 e.v[0][1]), 6855 r.lastPath !== a) 6856 ) { 6857 var n = ""; 6858 r.elem && 6859 (e.c && (n = t.inv ? this.solidPath + a : a), 6860 r.elem.setAttribute("d", n)),
6861 (r.lastPath = a); 6862 } 6863 }), 6864 (MaskElement.prototype.destroy = function () { 6865 (this.element = null), 6866 (this.globalData = null), 6867 (this.maskElement = null), 6868 (this.data = null), 6869 (this.masksProperties = null); 6870 }); 6871 var filtersFactory = (function () { 6872 var t = {}; 6873 return ( 6874 (t.createFilter = function (t, e) { 6875 var r = createNS("filter"); 6876 r.setAttribute("id", t), 6877 !0 !== e && 6878 (r.setAttribute("filterUnits", "objectBoundingBox"), 6879 r.setAttribute("x", "0%"), 6880 r.setAttribute("y", "0%"), 6881 r.setAttribute("width", "100%"), 6882 r.setAttribute("height", "100%")); 6883 return r; 6884 }), 6885 (t.createAlphaToLuminanceFilter = function () { 6886 var t = createNS("feColorMatrix"); 6887 return ( 6888 t.setAttribute("type", "matrix"), 6889 t.setAttribute("color-interpolation-filters", "sRGB"), 6890 t.setAttribute( 6891 "values", 6892 "0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1" 6893 ), 6894 t 6895 ); 6896 }), 6897 t 6898 ); 6899 })(), 6900 featureSupport = (function () { 6901 var t = { maskType: !0 }; 6902 return ( 6903 (/MSIE 10/i.test(navigator.userAgent) || 6904 /MSIE 9/i.test(navigator.userAgent) || 6905 /rv:11.0/i.test(navigator.userAgent) || 6906 /Edge\/\d./i.test(navigator.userAgent)) && 6907 (t.maskType = !1), 6908 t 6909 ); 6910 })(), 6911 registeredEffects = {}, 6912 idPrefix = "filter_result_"; 6913 function SVGEffects(t) { 6914 var e, 6915 r, 6916 i = "SourceGraphic", 6917 s = t.data.ef ? t.data.ef.length : 0, 6918 a = createElementID(), 6919 n = filtersFactory.createFilter(a, !0), 6920 o = 0; 6921 for (this.filters = [], e = 0; e < s; e += 1) { 6922 r = null; 6923 var h = t.data.ef[e].ty; 6924 if (registeredEffects[h]) 6925 (r = new (0, registeredEffects[h].effect)( 6926 n, 6927 t.effectsManager.effectElements[e], 6928 t, 6929 idPrefix + o, 6930 i 6931 )), 6932 (i = idPrefix + o), 6933 registeredEffects[h].countsAsEffect && (o += 1); 6934 r && this.filters.push(r); 6935 } 6936 o && 6937 (t.globalData.defs.appendChild(n), 6938 t.layerElement.setAttribute( 6939 "filter", 6940 "url(" + getLocationHref() + "#" + a + ")" 6941 )), 6942 this.filters.length && t.addRenderableComponent(this); 6943 } 6944 function registerEffect(t, e, r) { 6945 registeredEffects[t] = { effect: e, countsAsEffect: r }; 6946 } 6947 function SVGBaseElement() {} 6948 function HierarchyElement() {}
6949 function RenderableDOMElement() {} 6950 function IImageElement(t, e, r) { 6951 (this.assetData = e.getAssetData(t.refId)), 6952 this.initElement(t, e, r), 6953 (this.sourceRect = { 6954 top: 0, 6955 left: 0, 6956 width: this.assetData.w, 6957 height: this.assetData.h, 6958 }); 6959 } 6960 function ProcessedElement(t, e) { 6961 (this.elem = t), (this.pos = e); 6962 } 6963 function IShapeElement() {} 6964 (SVGEffects.prototype.renderFrame = function (t) { 6965 var e, 6966 r = this.filters.length; 6967 for (e = 0; e < r; e += 1) this.filters[e].renderFrame(t); 6968 }), 6969 (SVGBaseElement.prototype = { 6970 initRendererElement: function () { 6971 this.layerElement = createNS("g"); 6972 }, 6973 createContainerElements: function () { 6974 (this.matteElement = createNS("g")), 6975 (this.transformedElement = this.layerElement), 6976 (this.maskedElement = this.layerElement), 6977 (this._sizeChanged = !1); 6978 var t = null; 6979 if (this.data.td) { 6980 this.matteMasks = {}; 6981 var e = createNS("g"); 6982 e.setAttribute("id", this.layerId), 6983 e.appendChild(this.layerElement), 6984 (t = e), 6985 this.globalData.defs.appendChild(e); 6986 } else 6987 this.data.tt 6988 ? (this.matteElement.appendChild(this.layerElement), 6989 (t = this.matteElement), 6990 (this.baseElement = this.matteElement)) 6991 : (this.baseElement = this.layerElement); 6992 if ( 6993 (this.data.ln && this.layerElement.setAttribute("id", this.data.ln), 6994 this.data.cl && 6995 this.layerElement.setAttribute("class", this.data.cl), 6996 0 === this.data.ty && !this.data.hd) 6997 ) { 6998 var r = createNS("clipPath"), 6999 i = createNS("path"); 7000 i.setAttribute( 7001 "d", 7002 "M0,0 L" + 7003 this.data.w + 7004 ",0 L" + 7005 this.data.w + 7006 "," + 7007 this.data.h + 7008 " L0," + 7009 this.data.h + 7010 "z" 7011 ); 7012 var s = createElementID(); 7013 if ( 7014 (r.setAttribute("id", s), 7015 r.appendChild(i), 7016 this.globalData.defs.appendChild(r), 7017 this.checkMasks()) 7018 ) { 7019 var a = createNS("g"); 7020 a.setAttribute( 7021 "clip-path", 7022 "url(" + getLocationHref() + "#" + s + ")" 7023 ), 7024 a.appendChild(this.layerElement), 7025 (this.transformedElement = a), 7026 t 7027 ? t.appendChild(this.transformedElement) 7028 : (this.baseElement = this.transformedElement); 7029 } else 7030 this.layerElement.setAttribute( 7031 "clip-path", 7032 "url(" + getLocationHref() + "#" + s + ")" 7033 ); 7034 } 7035 0 !== this.data.bm && this.setBlendMode(); 7036 }, 7037 renderElement: function () { 7038 this.finalTransform._matMdf && 7039 this.transformedElement.setAttribute( 7040 "transform", 7041 this.finalTransform.mat.to2dCSS() 7042 ), 7043 this.finalTransform._opMdf && 7044 this.transformedElement.setAttribute( 7045 "opacity", 7046 this.finalTransform.mProp.o.v 7047 ); 7048 }, 7049 destroyBaseElement: function () { 7050 (this.layerElement = null), 7051 (this.matteElement = null), 7052 this.maskManager.destroy(); 7053 }, 7054 getBaseElement: function () { 7055 return this.data.hd ? null : this.baseElement; 7056 }, 7057 createRenderableComponents: function () { 7058 (this.maskManager = new MaskElement( 7059 this.data, 7060 this, 7061 this.globalData 7062 )), 7063 (this.renderableEffectsManager = new SVGEffects(this)); 7064 }, 7065 getMatte: function (t) { 7066 if (!this.matteMasks[t]) { 7067 var e, 7068 r, 7069 i, 7070 s, 7071 a = this.layerId + "_" + t; 7072 if (1 === t || 3 === t) { 7073 var n = createNS("mask"); 7074 n.setAttribute("id", a), 7075 n.setAttribute("mask-type", 3 === t ? "luminance" : "alpha"), 7076 (i = createNS("use")).setAttributeNS( 7077 "http://www.w3.org/1999/xlink", 7078 "href", 7079 "#" + this.layerId 7080 ), 7081 n.appendChild(i), 7082 this.globalData.defs.appendChild(n), 7083 featureSupport.maskType || 7084 1 !== t || 7085 (n.setAttribute("mask-type", "luminance"), 7086 (e = createElementID()), 7087 (r = filtersFactory.createFilter(e)), 7088 this.globalData.defs.appendChild(r), 7089 r.appendChild(filtersFactory.createAlphaToLuminanceFilter()), 7090 (s = createNS("g")).appendChild(i), 7091 n.appendChild(s), 7092 s.setAttribute( 7093 "filter", 7094 "url(" + getLocationHref() + "#" + e + ")" 7095 )); 7096 } else if (2 === t) { 7097 var o = createNS("mask"); 7098 o.setAttribute("id", a), o.setAttribute("mask-type", "alpha"); 7099 var h = createNS("g"); 7100 o.appendChild(h), 7101 (e = createElementID()), 7102 (r = filtersFactory.createFilter(e)); 7103 var l = createNS("feComponentTransfer"); 7104 l.setAttribute("in", "SourceGraphic"), r.appendChild(l); 7105 var p = createNS("feFuncA"); 7106 p.setAttribute("type", "table"), 7107 p.setAttribute("tableValues", "1.0 0.0"), 7108 l.appendChild(p), 7109 this.globalData.defs.appendChild(r); 7110 var f = createNS("rect"); 7111 f.setAttribute("width", this.comp.data.w), 7112 f.setAttribute("height", this.comp.data.h), 7113 f.setAttribute("x", "0"), 7114 f.setAttribute("y", "0"), 7115 f.setAttribute("fill", "#ffffff"),
7116 f.setAttribute("opacity", "0"), 7117 h.setAttribute( 7118 "filter", 7119 "url(" + getLocationHref() + "#" + e + ")" 7120 ), 7121 h.appendChild(f), 7122 (i = createNS("use")).setAttributeNS( 7123 "http://www.w3.org/1999/xlink", 7124 "href", 7125 "#" + this.layerId 7126 ), 7127 h.appendChild(i), 7128 featureSupport.maskType || 7129 (o.setAttribute("mask-type", "luminance"), 7130 r.appendChild(filtersFactory.createAlphaToLuminanceFilter()), 7131 (s = createNS("g")), 7132 h.appendChild(f), 7133 s.appendChild(this.layerElement), 7134 h.appendChild(s)), 7135 this.globalData.defs.appendChild(o); 7136 } 7137 this.matteMasks[t] = a; 7138 } 7139 return this.matteMasks[t]; 7140 }, 7141 setMatte: function (t) { 7142 this.matteElement && 7143 this.matteElement.setAttribute( 7144 "mask", 7145 "url(" + getLocationHref() + "#" + t + ")" 7146 ); 7147 }, 7148 }), 7149 (HierarchyElement.prototype = { 7150 initHierarchy: function () { 7151 (this.hierarchy = []), (this._isParent = !1), this.checkParenting(); 7152 }, 7153 setHierarchy: function (t) { 7154 this.hierarchy = t; 7155 }, 7156 setAsParent: function () { 7157 this._isParent = !0; 7158 }, 7159 checkParenting: function () { 7160 void 0 !== this.data.parent && 7161 this.comp.buildElementParenting(this, this.data.parent, []); 7162 }, 7163 }), 7164 extendPrototype( 7165 [ 7166 RenderableElement, 7167 createProxyFunction({ 7168 initElement: function (t, e, r) { 7169 this.initFrame(), 7170 this.initBaseData(t, e, r), 7171 this.initTransform(t, e, r), 7172 this.initHierarchy(), 7173 this.initRenderable(), 7174 this.initRendererElement(), 7175 this.createContainerElements(), 7176 this.createRenderableComponents(), 7177 this.createContent(), 7178 this.hide(); 7179 }, 7180 hide: function () { 7181 this.hidden || 7182 (this.isInRange && !this.isTransparent) || 7183 (((this.baseElement || this.layerElement).style.display = 7184 "none"), 7185 (this.hidden = !0)); 7186 }, 7187 show: function () { 7188 this.isInRange && 7189 !this.isTransparent && 7190 (this.data.hd || 7191 ((this.baseElement || this.layerElement).style.display = 7192 "block"), 7193 (this.hidden = !1), 7194 (this._isFirstFrame = !0)); 7195 }, 7196 renderFrame: function () { 7197 this.data.hd || 7198 this.hidden || 7199 (this.renderTransform(), 7200 this.renderRenderable(), 7201 this.renderElement(), 7202 this.renderInnerContent(), 7203 this._isFirstFrame && (this._isFirstFrame = !1)); 7204 }, 7205 renderInnerContent: function () {}, 7206 prepareFrame: function (t) { 7207 (this._mdf = !1), 7208 this.prepareRenderableFrame(t), 7209 this.prepareProperties(t, this.isInRange), 7210 this.checkTransparency(); 7211 }, 7212 destroy: function () { 7213 (this.innerElem = null), this.destroyBaseElement(); 7214 }, 7215 }), 7216 ], 7217 RenderableDOMElement 7218 ), 7219 extendPrototype( 7220 [ 7221 BaseElement, 7222 TransformElement, 7223 SVGBaseElement, 7224 HierarchyElement, 7225 FrameElement, 7226 RenderableDOMElement, 7227 ], 7228 IImageElement 7229 ), 7230 (IImageElement.prototype.createContent = function () { 7231 var t = this.globalData.getAssetsPath(this.assetData); 7232 (this.innerElem = createNS("image")), 7233 this.innerElem.setAttribute("width", this.assetData.w + "px"), 7234 this.innerElem.setAttribute("height", this.assetData.h + "px"), 7235 this.innerElem.setAttribute( 7236 "preserveAspectRatio", 7237 this.assetData.pr || 7238 this.globalData.renderConfig.imagePreserveAspectRatio 7239 ), 7240 this.innerElem.setAttributeNS( 7241 "http://www.w3.org/1999/xlink", 7242 "href", 7243 t 7244 ), 7245 this.layerElement.appendChild(this.innerElem); 7246 }), 7247 (IImageElement.prototype.sourceRectAtTime = function () { 7248 return this.sourceRect; 7249 }), 7250 (IShapeElement.prototype = { 7251 addShapeToModifiers: function (t) { 7252 var e, 7253 r = this.shapeModifiers.length; 7254 for (e = 0; e < r; e += 1) this.shapeModifiers[e].addShape(t); 7255 }, 7256 isShapeInAnimatedModifiers: function (t) { 7257 for (var e = this.shapeModifiers.length; 0 < e; ) 7258 if (this.shapeModifiers[0].isAnimatedWithShape(t)) return !0; 7259 return !1; 7260 }, 7261 renderModifiers: function () { 7262 if (this.shapeModifiers.length) { 7263 var t, 7264 e = this.shapes.length; 7265 for (t = 0; t < e; t += 1) this.shapes[t].sh.reset(); 7266 for ( 7267 t = (e = this.shapeModifiers.length) - 1; 7268 t >= 0 && 7269 !this.shapeModifiers[t].processShapes(this._isFirstFrame); 7270 t -= 1 7271 ); 7272 } 7273 }, 7274 searchProcessedElement: function (t) { 7275 for (var e = this.processedElements, r = 0, i = e.length; r < i; ) { 7276 if (e[r].elem === t) return e[r].pos; 7277 r += 1; 7278 } 7279 return 0; 7280 }, 7281 addProcessedElement: function (t, e) { 7282 for (var r = this.processedElements, i = r.length; i; ) 7283 if (r[(i -= 1)].elem === t) return void (r[i].pos = e); 7284 r.push(new ProcessedElement(t, e)); 7285 }, 7286 prepareFrame: function (t) { 7287 this.prepareRenderableFrame(t), 7288 this.prepareProperties(t, this.isInRange); 7289 }, 7290 }); 7291 var lineCapEnum = { 1: "butt", 2: "round", 3: "square" }, 7292 lineJoinEnum = { 1: "miter", 2: "round", 3: "bevel" }; 7293 function SVGShapeData(t, e, r) { 7294 (this.caches = []), 7295 (this.styles = []), 7296 (this.transformers = t), 7297 (this.lStr = ""), 7298 (this.sh = r), 7299 (this.lvl = e), 7300 (this._isAnimated = !!r.k); 7301 for (var i = 0, s = t.length; i < s; ) { 7302 if (t[i].mProps.dynamicProperties.length) { 7303 this._isAnimated = !0; 7304 break; 7305 } 7306 i += 1; 7307 } 7308 } 7309 function SVGStyleData(t, e) { 7310 (this.data = t),
7311 (this.type = t.ty), 7312 (this.d = ""), 7313 (this.lvl = e), 7314 (this._mdf = !1), 7315 (this.closed = !0 === t.hd), 7316 (this.pElem = createNS("path")), 7317 (this.msElem = null); 7318 } 7319 function DashProperty(t, e, r, i) { 7320 var s; 7321 (this.elem = t), 7322 (this.frameId = -1), 7323 (this.dataProps = createSizedArray(e.length)), 7324 (this.renderer = r), 7325 (this.k = !1), 7326 (this.dashStr = ""), 7327 (this.dashArray = createTypedArray( 7328 "float32", 7329 e.length ? e.length - 1 : 0 7330 )), 7331 (this.dashoffset = createTypedArray("float32", 1)), 7332 this.initDynamicPropertyContainer(i); 7333 var a, 7334 n = e.length || 0; 7335 for (s = 0; s < n; s += 1) 7336 (a = PropertyFactory.getProp(t, e[s].v, 0, 0, this)), 7337 (this.k = a.k || this.k), 7338 (this.dataProps[s] = { n: e[s].n, p: a }); 7339 this.k || this.getValue(!0), (this._isAnimated = this.k); 7340 } 7341 function SVGStrokeStyleData(t, e, r) { 7342 this.initDynamicPropertyContainer(t), 7343 (this.getValue = this.iterateDynamicProperties), 7344 (this.o = PropertyFactory.getProp(t, e.o, 0, 0.01, this)), 7345 (this.w = PropertyFactory.getProp(t, e.w, 0, null, this)), 7346 (this.d = new DashProperty(t, e.d || {}, "svg", this)), 7347 (this.c = PropertyFactory.getProp(t, e.c, 1, 255, this)), 7348 (this.style = r), 7349 (this._isAnimated = !!this._isAnimated); 7350 } 7351 function SVGFillStyleData(t, e, r) { 7352 this.initDynamicPropertyContainer(t), 7353 (this.getValue = this.iterateDynamicProperties), 7354 (this.o = PropertyFactory.getProp(t, e.o, 0, 0.01, this)), 7355 (this.c = PropertyFactory.getProp(t, e.c, 1, 255, this)), 7356 (this.style = r); 7357 } 7358 function SVGNoStyleData(t, e, r) { 7359 this.initDynamicPropertyContainer(t), 7360 (this.getValue = this.iterateDynamicProperties), 7361 (this.style = r); 7362 } 7363 function GradientProperty(t, e, r) { 7364 (this.data = e), (this.c = createTypedArray("uint8c", 4 * e.p)); 7365 var i = e.k.k[0].s ? e.k.k[0].s.length - 4 * e.p : e.k.k.length - 4 * e.p; 7366 (this.o = createTypedArray("float32", i)), 7367 (this._cmdf = !1), 7368 (this._omdf = !1), 7369 (this._collapsable = this.checkCollapsable()), 7370 (this._hasOpacity = i), 7371 this.initDynamicPropertyContainer(r), 7372 (this.prop = PropertyFactory.getProp(t, e.k, 1, null, this)), 7373 (this.k = this.prop.k), 7374 this.getValue(!0); 7375 } 7376 function SVGGradientFillStyleData(t, e, r) { 7377 this.initDynamicPropertyContainer(t), 7378 (this.getValue = this.iterateDynamicProperties), 7379 this.initGradientData(t, e, r); 7380 } 7381 function SVGGradientStrokeStyleData(t, e, r) { 7382 this.initDynamicPropertyContainer(t), 7383 (this.getValue = this.iterateDynamicProperties), 7384 (this.w = PropertyFactory.getProp(t, e.w, 0, null, this)), 7385 (this.d = new DashProperty(t, e.d || {}, "svg", this)), 7386 this.initGradientData(t, e, r), 7387 (this._isAnimated = !!this._isAnimated); 7388 } 7389 function ShapeGroupData() { 7390 (this.it = []), (this.prevViewData = []), (this.gr = createNS("g")); 7391 } 7392 function SVGTransformData(t, e, r) { 7393 (this.transform = { mProps: t, op: e, container: r }), 7394 (this.elements = []), 7395 (this._isAnimated = 7396 this.transform.mProps.dynamicProperties.length || 7397 this.transform.op.effectsSequence.length); 7398 } 7399 (SVGShapeData.prototype.setAsAnimated = function () { 7400 this._isAnimated = !0; 7401 }), 7402 (SVGStyleData.prototype.reset = function () { 7403 (this.d = ""), (this._mdf = !1);
7404 }), 7405 (DashProperty.prototype.getValue = function (t) { 7406 if ( 7407 (this.elem.globalData.frameId !== this.frameId || t) && 7408 ((this.frameId = this.elem.globalData.frameId), 7409 this.iterateDynamicProperties(), 7410 (this._mdf = this._mdf || t), 7411 this._mdf) 7412 ) { 7413 var e = 0, 7414 r = this.dataProps.length; 7415 for ( 7416 "svg" === this.renderer && (this.dashStr = ""), e = 0; 7417 e < r; 7418 e += 1 7419 ) 7420 "o" !== this.dataProps[e].n 7421 ? "svg" === this.renderer 7422 ? (this.dashStr += " " + this.dataProps[e].p.v) 7423 : (this.dashArray[e] = this.dataProps[e].p.v) 7424 : (this.dashoffset[0] = this.dataProps[e].p.v); 7425 } 7426 }), 7427 extendPrototype([DynamicPropertyContainer], DashProperty), 7428 extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData), 7429 extendPrototype([DynamicPropertyContainer], SVGFillStyleData), 7430 extendPrototype([DynamicPropertyContainer], SVGNoStyleData), 7431 (GradientProperty.prototype.comparePoints = function (t, e) { 7432 for (var r = 0, i = this.o.length / 2; r < i; ) { 7433 if (Math.abs(t[4 * r] - t[4 * e + 2 * r]) > 0.01) return !1; 7434 r += 1; 7435 } 7436 return !0; 7437 }), 7438 (GradientProperty.prototype.checkCollapsable = function () { 7439 if (this.o.length / 2 != this.c.length / 4) return !1; 7440 if (this.data.k.k[0].s) 7441 for (var t = 0, e = this.data.k.k.length; t < e; ) { 7442 if (!this.comparePoints(this.data.k.k[t].s, this.data.p)) return !1; 7443 t += 1; 7444 } 7445 else if (!this.comparePoints(this.data.k.k, this.data.p)) return !1; 7446 return !0; 7447 }), 7448 (GradientProperty.prototype.getValue = function (t) { 7449 if ( 7450 (this.prop.getValue(), 7451 (this._mdf = !1), 7452 (this._cmdf = !1), 7453 (this._omdf = !1), 7454 this.prop._mdf || t) 7455 ) { 7456 var e, 7457 r, 7458 i, 7459 s = 4 * this.data.p; 7460 for (e = 0; e < s; e += 1) 7461 (r = e % 4 == 0 ? 100 : 255), 7462 (i = Math.round(this.prop.v[e] * r)), 7463 this.c[e] !== i && ((this.c[e] = i), (this._cmdf = !t)); 7464 if (this.o.length) 7465 for (s = this.prop.v.length, e = 4 * this.data.p; e < s; e += 1) 7466 (r = e % 2 == 0 ? 100 : 1), 7467 (i = 7468 e % 2 == 0 7469 ? Math.round(100 * this.prop.v[e]) 7470 : this.prop.v[e]), 7471 this.o[e - 4 * this.data.p] !== i && 7472 ((this.o[e - 4 * this.data.p] = i), (this._omdf = !t)); 7473 this._mdf = !t; 7474 } 7475 }), 7476 extendPrototype([DynamicPropertyContainer], GradientProperty), 7477 (SVGGradientFillStyleData.prototype.initGradientData = function ( 7478 t, 7479 e, 7480 r 7481 ) { 7482 (this.o = PropertyFactory.getProp(t, e.o, 0, 0.01, this)), 7483 (this.s = PropertyFactory.getProp(t, e.s, 1, null, this)), 7484 (this.e = PropertyFactory.getProp(t, e.e, 1, null, this)), 7485 (this.h = PropertyFactory.getProp(t, e.h || { k: 0 }, 0, 0.01, this)), 7486 (this.a = PropertyFactory.getProp( 7487 t, 7488 e.a || { k: 0 }, 7489 0, 7490 degToRads, 7491 this 7492 )), 7493 (this.g = new GradientProperty(t, e.g, this)), 7494 (this.style = r), 7495 (this.stops = []), 7496 this.setGradientData(r.pElem, e), 7497 this.setGradientOpacity(e, r), 7498 (this._isAnimated = !!this._isAnimated); 7499 }), 7500 (SVGGradientFillStyleData.prototype.setGradientData = function (t, e) { 7501 var r = createElementID(), 7502 i = createNS(1 === e.t ? "linearGradient" : "radialGradient"); 7503 i.setAttribute("id", r), 7504 i.setAttribute("spreadMethod", "pad"), 7505 i.setAttribute("gradientUnits", "userSpaceOnUse"); 7506 var s, 7507 a, 7508 n, 7509 o = []; 7510 for (n = 4 * e.g.p, a = 0; a < n; a += 4) 7511 (s = createNS("stop")), i.appendChild(s), o.push(s); 7512 t.setAttribute(
7513 "gf" === e.ty ? "fill" : "stroke", 7514 "url(" + getLocationHref() + "#" + r + ")" 7515 ), 7516 (this.gf = i), 7517 (this.cst = o); 7518 }), 7519 (SVGGradientFillStyleData.prototype.setGradientOpacity = function (t, e) { 7520 if (this.g._hasOpacity && !this.g._collapsable) { 7521 var r, 7522 i, 7523 s, 7524 a = createNS("mask"), 7525 n = createNS("path"); 7526 a.appendChild(n); 7527 var o = createElementID(), 7528 h = createElementID(); 7529 a.setAttribute("id", h); 7530 var l = createNS(1 === t.t ? "linearGradient" : "radialGradient"); 7531 l.setAttribute("id", o), 7532 l.setAttribute("spreadMethod", "pad"), 7533 l.setAttribute("gradientUnits", "userSpaceOnUse"), 7534 (s = t.g.k.k[0].s ? t.g.k.k[0].s.length : t.g.k.k.length); 7535 var p = this.stops; 7536 for (i = 4 * t.g.p; i < s; i += 2) 7537 (r = createNS("stop")).setAttribute( 7538 "stop-color", 7539 "rgb(255,255,255)" 7540 ), 7541 l.appendChild(r), 7542 p.push(r); 7543 n.setAttribute( 7544 "gf" === t.ty ? "fill" : "stroke", 7545 "url(" + getLocationHref() + "#" + o + ")" 7546 ), 7547 "gs" === t.ty && 7548 (n.setAttribute("stroke-linecap", lineCapEnum[t.lc || 2]), 7549 n.setAttribute("stroke-linejoin", lineJoinEnum[t.lj || 2]), 7550 1 === t.lj && n.setAttribute("stroke-miterlimit", t.ml)), 7551 (this.of = l), 7552 (this.ms = a), 7553 (this.ost = p), 7554 (this.maskId = h), 7555 (e.msElem = n); 7556 } 7557 }), 7558 extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData), 7559 extendPrototype( 7560 [SVGGradientFillStyleData, DynamicPropertyContainer], 7561 SVGGradientStrokeStyleData 7562 ); 7563 var buildShapeString = function (t, e, r, i) { 7564 if (0 === e) return ""; 7565 var s, 7566 a = t.o, 7567 n = t.i, 7568 o = t.v, 7569 h = " M" + i.applyToPointStringified(o[0][0], o[0][1]); 7570 for (s = 1; s < e; s += 1) 7571 h += 7572 " C" + 7573 i.applyToPointStringified(a[s - 1][0], a[s - 1][1]) + 7574 " " + 7575 i.applyToPointStringified(n[s][0], n[s][1]) + 7576 " " + 7577 i.applyToPointStringified(o[s][0], o[s][1]); 7578 return ( 7579 r && 7580 e && 7581 ((h += 7582 " C" + 7583 i.applyToPointStringified(a[s - 1][0], a[s - 1][1]) + 7584 " " + 7585 i.applyToPointStringified(n[0][0], n[0][1]) + 7586 " " + 7587 i.applyToPointStringified(o[0][0], o[0][1])), 7588 (h += "z")), 7589 h 7590 ); 7591 }, 7592 SVGElementsRenderer = (function () { 7593 var t = new Matrix(), 7594 e = new Matrix(); 7595 function r(t, e, r) { 7596 (r || e.transform.op._mdf) && 7597 e.transform.container.setAttribute("opacity", e.transform.op.v), 7598 (r || e.transform.mProps._mdf) && 7599 e.transform.container.setAttribute( 7600 "transform", 7601 e.transform.mProps.v.to2dCSS() 7602 ); 7603 } 7604 function i() {} 7605 function s(r, i, s) { 7606 var a, 7607 n, 7608 o, 7609 h, 7610 l, 7611 p, 7612 f, 7613 m, 7614 c, 7615 d, 7616 u, 7617 y = i.styles.length, 7618 g = i.lvl; 7619 for (p = 0; p < y; p += 1) { 7620 if (((h = i.sh._mdf || s), i.styles[p].lvl < g)) { 7621 for ( 7622 m = e.reset(), 7623 d = g - i.styles[p].lvl, 7624 u = i.transformers.length - 1; 7625 !h && d > 0; 7626 7627 ) 7628 (h = i.transformers[u].mProps._mdf || h), (d -= 1), (u -= 1); 7629 if (h) 7630 for ( 7631 d = g - i.styles[p].lvl, u = i.transformers.length - 1; 7632 d > 0;
7633 7634 ) 7635 (c = i.transformers[u].mProps.v.props), 7636 m.transform( 7637 c[0], 7638 c[1], 7639 c[2], 7640 c[3], 7641 c[4], 7642 c[5], 7643 c[6], 7644 c[7], 7645 c[8], 7646 c[9], 7647 c[10], 7648 c[11], 7649 c[12], 7650 c[13], 7651 c[14], 7652 c[15] 7653 ), 7654 (d -= 1), 7655 (u -= 1); 7656 } else m = t; 7657 if (((n = (f = i.sh.paths)._length), h)) { 7658 for (o = "", a = 0; a < n; a += 1) 7659 (l = f.shapes[a]) && 7660 l._length && 7661 (o += buildShapeString(l, l._length, l.c, m)); 7662 i.caches[p] = o; 7663 } else o = i.caches[p]; 7664 (i.styles[p].d += !0 === r.hd ? "" : o), 7665 (i.styles[p]._mdf = h || i.styles[p]._mdf); 7666 } 7667 } 7668 function a(t, e, r) { 7669 var i = e.style; 7670 (e.c._mdf || r) && 7671 i.pElem.setAttribute( 7672 "fill", 7673 "rgb(" + 7674 bmFloor(e.c.v[0]) + 7675 "," + 7676 bmFloor(e.c.v[1]) + 7677 "," + 7678 bmFloor(e.c.v[2]) + 7679 ")" 7680 ), 7681 (e.o._mdf || r) && i.pElem.setAttribute("fill-opacity", e.o.v); 7682 } 7683 function n(t, e, r) { 7684 o(t, e, r), h(t, e, r); 7685 } 7686 function o(t, e, r) { 7687 var i, 7688 s, 7689 a, 7690 n, 7691 o, 7692 h = e.gf, 7693 l = e.g._hasOpacity, 7694 p = e.s.v, 7695 f = e.e.v; 7696 if (e.o._mdf || r) { 7697 var m = "gf" === t.ty ? "fill-opacity" : "stroke-opacity"; 7698 e.style.pElem.setAttribute(m, e.o.v); 7699 } 7700 if (e.s._mdf || r) { 7701 var c = 1 === t.t ? "x1" : "cx", 7702 d = "x1" === c ? "y1" : "cy"; 7703 h.setAttribute(c, p[0]), 7704 h.setAttribute(d, p[1]), 7705 l && 7706 !e.g._collapsable && 7707 (e.of.setAttribute(c, p[0]), e.of.setAttribute(d, p[1])); 7708 } 7709 if (e.g._cmdf || r) { 7710 i = e.cst; 7711 var u = e.g.c; 7712 for (a = i.length, s = 0; s < a; s += 1) 7713 (n = i[s]).setAttribute("offset", u[4 * s] + "%"), 7714 n.setAttribute( 7715 "stop-color", 7716 "rgb(" + 7717 u[4 * s + 1] + 7718 "," + 7719 u[4 * s + 2] + 7720 "," + 7721 u[4 * s + 3] + 7722 ")" 7723 ); 7724 } 7725 if (l && (e.g._omdf || r)) { 7726 var y = e.g.o; 7727 for ( 7728 a = (i = e.g._collapsable ? e.cst : e.ost).length, s = 0; 7729 s < a; 7730 s += 1 7731 ) 7732 (n = i[s]), 7733 e.g._collapsable || n.setAttribute("offset", y[2 * s] + "%"), 7734 n.setAttribute("stop-opacity", y[2 * s + 1]); 7735 } 7736 if (1 === t.t) 7737 (e.e._mdf || r) && 7738 (h.setAttribute("x2", f[0]), 7739 h.setAttribute("y2", f[1]), 7740 l && 7741 !e.g._collapsable && 7742 (e.of.setAttribute("x2", f[0]), e.of.setAttribute("y2", f[1]))); 7743 else if ( 7744 ((e.s._mdf || e.e._mdf || r) && 7745 ((o = Math.sqrt( 7746 Math.pow(p[0] - f[0], 2) + Math.pow(p[1] - f[1], 2) 7747 )), 7748 h.setAttribute("r", o), 7749 l && !e.g._collapsable && e.of.setAttribute("r", o)), 7750 e.e._mdf || e.h._mdf || e.a._mdf || r) 7751 ) { 7752 o || 7753 (o = Math.sqrt( 7754 Math.pow(p[0] - f[0], 2) + Math.pow(p[1] - f[1], 2) 7755 )); 7756 var g = Math.atan2(f[1] - p[1], f[0] - p[0]), 7757 v = e.h.v; 7758 v >= 1 ? (v = 0.99) : v <= -1 && (v = -0.99); 7759 var b = o * v,
7760 P = Math.cos(g + e.a.v) * b + p[0], 7761 x = Math.sin(g + e.a.v) * b + p[1]; 7762 h.setAttribute("fx", P), 7763 h.setAttribute("fy", x), 7764 l && 7765 !e.g._collapsable && 7766 (e.of.setAttribute("fx", P), e.of.setAttribute("fy", x)); 7767 } 7768 } 7769 function h(t, e, r) { 7770 var i = e.style, 7771 s = e.d; 7772 s && 7773 (s._mdf || r) && 7774 s.dashStr && 7775 (i.pElem.setAttribute("stroke-dasharray", s.dashStr), 7776 i.pElem.setAttribute("stroke-dashoffset", s.dashoffset[0])), 7777 e.c && 7778 (e.c._mdf || r) && 7779 i.pElem.setAttribute( 7780 "stroke", 7781 "rgb(" + 7782 bmFloor(e.c.v[0]) + 7783 "," + 7784 bmFloor(e.c.v[1]) + 7785 "," + 7786 bmFloor(e.c.v[2]) + 7787 ")" 7788 ), 7789 (e.o._mdf || r) && i.pElem.setAttribute("stroke-opacity", e.o.v), 7790 (e.w._mdf || r) && 7791 (i.pElem.setAttribute("stroke-width", e.w.v), 7792 i.msElem && i.msElem.setAttribute("stroke-width", e.w.v)); 7793 } 7794 return { 7795 createRenderFunction: function (t) { 7796 switch (t.ty) { 7797 case "fl": 7798 return a; 7799 case "gf": 7800 return o; 7801 case "gs": 7802 return n; 7803 case "st": 7804 return h; 7805 case "sh": 7806 case "el": 7807 case "rc": 7808 case "sr": 7809 return s; 7810 case "tr": 7811 return r; 7812 case "no": 7813 return i; 7814 default: 7815 return null; 7816 } 7817 }, 7818 }; 7819 })(); 7820 function SVGShapeElement(t, e, r) { 7821 (this.shapes = []), 7822 (this.shapesData = t.shapes), 7823 (this.stylesList = []), 7824 (this.shapeModifiers = []), 7825 (this.itemsData = []), 7826 (this.processedElements = []), 7827 (this.animatedContents = []), 7828 this.initElement(t, e, r), 7829 (this.prevViewData = []); 7830 } 7831 function LetterProps(t, e, r, i, s, a) { 7832 (this.o = t), 7833 (this.sw = e), 7834 (this.sc = r), 7835 (this.fc = i), 7836 (this.m = s), 7837 (this.p = a), 7838 (this._mdf = { o: !0, sw: !!e, sc: !!r, fc: !!i, m: !0, p: !0 }); 7839 } 7840 function TextProperty(t, e) { 7841 (this._frameId = initialDefaultFrame), 7842 (this.pv = ""), 7843 (this.v = ""), 7844 (this.kf = !1), 7845 (this._isFirstFrame = !0), 7846 (this._mdf = !1), 7847 (this.data = e), 7848 (this.elem = t), 7849 (this.comp = this.elem.comp), 7850 (this.keysIndex = 0), 7851 (this.canResize = !1), 7852 (this.minimumFontSize = 1), 7853 (this.effectsSequence = []), 7854 (this.currentData = { 7855 ascent: 0, 7856 boxWidth: this.defaultBoxWidth, 7857 f: "", 7858 fStyle: "", 7859 fWeight: "", 7860 fc: "", 7861 j: "", 7862 justifyOffset: "", 7863 l: [], 7864 lh: 0, 7865 lineWidths: [], 7866 ls: "", 7867 of: "", 7868 s: "", 7869 sc: "", 7870 sw: 0, 7871 t: 0, 7872 tr: 0, 7873 sz: 0, 7874 ps: null, 7875 fillColorAnim: !1, 7876 strokeColorAnim: !1, 7877 strokeWidthAnim: !1, 7878 yOffset: 0, 7879 finalSize: 0, 7880 finalText: [], 7881 finalLineHeight: 0, 7882 __complete: !1, 7883 }), 7884 this.copyData(this.currentData, this.data.d.k[0].s), 7885 this.searchProperty() || this.completeTextData(this.currentData); 7886 } 7887 extendPrototype( 7888 [ 7889 BaseElement, 7890 TransformElement, 7891 SVGBaseElement, 7892 IShapeElement, 7893 HierarchyElement, 7894 FrameElement, 7895 RenderableDOMElement, 7896 ], 7897 SVGShapeElement 7898 ), 7899 (SVGShapeElement.prototype.initSecondaryElement = function () {}), 7900 (SVGShapeElement.prototype.identityMatrix = new Matrix()), 7901 (SVGShapeElement.prototype.buildExpressionInterface = function () {}), 7902 (SVGShapeElement.prototype.createContent = function () { 7903 this.searchShapes( 7904 this.shapesData, 7905 this.itemsData, 7906 this.prevViewData, 7907 this.layerElement, 7908 0, 7909 [], 7910 !0 7911 ), 7912 this.filterUniqueShapes(); 7913 }), 7914 (SVGShapeElement.prototype.filterUniqueShapes = function () { 7915 var t, 7916 e, 7917 r, 7918 i, 7919 s = this.shapes.length, 7920 a = this.stylesList.length, 7921 n = [], 7922 o = !1; 7923 for (r = 0; r < a; r += 1) { 7924 for ( 7925 i = this.stylesList[r], o = !1, n.length = 0, t = 0; 7926 t < s; 7927 t += 1 7928 ) 7929 -1 !== (e = this.shapes[t]).styles.indexOf(i) && 7930 (n.push(e), (o = e._isAnimated || o)); 7931 n.length > 1 && o && this.setShapesAsAnimated(n); 7932 } 7933 }), 7934 (SVGShapeElement.prototype.setShapesAsAnimated = function (t) { 7935 var e, 7936 r = t.length; 7937 for (e = 0; e < r; e += 1) t[e].setAsAnimated(); 7938 }), 7939 (SVGShapeElement.prototype.createStyleElement = function (t, e) { 7940 var r, 7941 i = new SVGStyleData(t, e), 7942 s = i.pElem; 7943 if ("st" === t.ty) r = new SVGStrokeStyleData(this, t, i); 7944 else if ("fl" === t.ty) r = new SVGFillStyleData(this, t, i); 7945 else if ("gf" === t.ty || "gs" === t.ty) { 7946 (r = new ( 7947 "gf" === t.ty 7948 ? SVGGradientFillStyleData 7949 : SVGGradientStrokeStyleData 7950 )(this, t, i)), 7951 this.globalData.defs.appendChild(r.gf), 7952 r.maskId && 7953 (this.globalData.defs.appendChild(r.ms), 7954 this.globalData.defs.appendChild(r.of), 7955 s.setAttribute( 7956 "mask", 7957 "url(" + getLocationHref() + "#" + r.maskId + ")" 7958 )); 7959 } else "no" === t.ty && (r = new SVGNoStyleData(this, t, i)); 7960 return ( 7961 ("st" !== t.ty && "gs" !== t.ty) || 7962 (s.setAttribute("stroke-linecap", lineCapEnum[t.lc || 2]), 7963 s.setAttribute("stroke-linejoin", lineJoinEnum[t.lj || 2]), 7964 s.setAttribute("fill-opacity", "0"), 7965 1 === t.lj && s.setAttribute("stroke-miterlimit", t.ml)), 7966 2 === t.r && s.setAttribute("fill-rule", "evenodd"), 7967 t.ln && s.setAttribute("id", t.ln), 7968 t.cl && s.setAttribute("class", t.cl),
7969 t.bm && (s.style["mix-blend-mode"] = getBlendMode(t.bm)), 7970 this.stylesList.push(i), 7971 this.addToAnimatedContents(t, r), 7972 r 7973 ); 7974 }), 7975 (SVGShapeElement.prototype.createGroupElement = function (t) { 7976 var e = new ShapeGroupData(); 7977 return ( 7978 t.ln && e.gr.setAttribute("id", t.ln), 7979 t.cl && e.gr.setAttribute("class", t.cl), 7980 t.bm && (e.gr.style["mix-blend-mode"] = getBlendMode(t.bm)), 7981 e 7982 ); 7983 }), 7984 (SVGShapeElement.prototype.createTransformElement = function (t, e) { 7985 var r = TransformPropertyFactory.getTransformProperty(this, t, this), 7986 i = new SVGTransformData(r, r.o, e); 7987 return this.addToAnimatedContents(t, i), i; 7988 }), 7989 (SVGShapeElement.prototype.createShapeElement = function (t, e, r) { 7990 var i = 4; 7991 "rc" === t.ty 7992 ? (i = 5) 7993 : "el" === t.ty 7994 ? (i = 6) 7995 : "sr" === t.ty && (i = 7); 7996 var s = new SVGShapeData( 7997 e, 7998 r, 7999 ShapePropertyFactory.getShapeProp(this, t, i, this) 8000 ); 8001 return ( 8002 this.shapes.push(s), 8003 this.addShapeToModifiers(s), 8004 this.addToAnimatedContents(t, s), 8005 s 8006 ); 8007 }), 8008 (SVGShapeElement.prototype.addToAnimatedContents = function (t, e) { 8009 for (var r = 0, i = this.animatedContents.length; r < i; ) { 8010 if (this.animatedContents[r].element === e) return; 8011 r += 1; 8012 } 8013 this.animatedContents.push({ 8014 fn: SVGElementsRenderer.createRenderFunction(t), 8015 element: e, 8016 data: t, 8017 }); 8018 }), 8019 (SVGShapeElement.prototype.setElementStyles = function (t) { 8020 var e, 8021 r = t.styles, 8022 i = this.stylesList.length; 8023 for (e = 0; e < i; e += 1) 8024 this.stylesList[e].closed || r.push(this.stylesList[e]); 8025 }), 8026 (SVGShapeElement.prototype.reloadShapes = function () { 8027 var t; 8028 this._isFirstFrame = !0; 8029 var e = this.itemsData.length; 8030 for (t = 0; t < e; t += 1) this.prevViewData[t] = this.itemsData[t]; 8031 for ( 8032 this.searchShapes( 8033 this.shapesData, 8034 this.itemsData, 8035 this.prevViewData, 8036 this.layerElement, 8037 0, 8038 [], 8039 !0 8040 ), 8041 this.filterUniqueShapes(), 8042 e = this.dynamicProperties.length, 8043 t = 0; 8044 t < e; 8045 t += 1 8046 ) 8047 this.dynamicProperties[t].getValue(); 8048 this.renderModifiers(); 8049 }), 8050 (SVGShapeElement.prototype.searchShapes = function (t, e, r, i, s, a, n) { 8051 var o, 8052 h, 8053 l, 8054 p, 8055 f, 8056 m, 8057 c = [].concat(a), 8058 d = t.length - 1, 8059 u = [], 8060 y = []; 8061 for (o = d; o >= 0; o -= 1) { 8062 if ( 8063 ((m = this.searchProcessedElement(t[o])) 8064 ? (e[o] = r[m - 1]) 8065 : (t[o]._render = n), 8066 "fl" === t[o].ty || 8067 "st" === t[o].ty || 8068 "gf" === t[o].ty || 8069 "gs" === t[o].ty || 8070 "no" === t[o].ty) 8071 ) 8072 m 8073 ? (e[o].style.closed = !1) 8074 : (e[o] = this.createStyleElement(t[o], s)), 8075 t[o]._render && 8076 e[o].style.pElem.parentNode !== i && 8077 i.appendChild(e[o].style.pElem), 8078 u.push(e[o].style); 8079 else if ("gr" === t[o].ty) { 8080 if (m) 8081 for (l = e[o].it.length, h = 0; h < l; h += 1) 8082 e[o].prevViewData[h] = e[o].it[h]; 8083 else e[o] = this.createGroupElement(t[o]); 8084 this.searchShapes( 8085 t[o].it, 8086 e[o].it, 8087 e[o].prevViewData, 8088 e[o].gr, 8089 s + 1, 8090 c, 8091 n 8092 ), 8093 t[o]._render && 8094 e[o].gr.parentNode !== i && 8095 i.appendChild(e[o].gr); 8096 } else 8097 "tr" === t[o].ty 8098 ? (m || (e[o] = this.createTransformElement(t[o], i)), 8099 (p = e[o].transform), 8100 c.push(p)) 8101 : "sh" === t[o].ty || 8102 "rc" === t[o].ty || 8103 "el" === t[o].ty || 8104 "sr" === t[o].ty 8105 ? (m || (e[o] = this.createShapeElement(t[o], c, s)), 8106 this.setElementStyles(e[o])) 8107 : "tm" === t[o].ty || 8108 "rd" === t[o].ty || 8109 "ms" === t[o].ty || 8110 "pb" === t[o].ty || 8111 "zz" === t[o].ty || 8112 "op" === t[o].ty 8113 ? (m 8114 ? ((f = e[o]).closed = !1) 8115 : ((f = ShapeModifiers.getModifier(t[o].ty)).init(this, t[o]), 8116 (e[o] = f), 8117 this.shapeModifiers.push(f)), 8118 y.push(f)) 8119 : "rp" === t[o].ty && 8120 (m 8121 ? ((f = e[o]).closed = !0) 8122 : ((f = ShapeModifiers.getModifier(t[o].ty)), 8123 (e[o] = f), 8124 f.init(this, t, o, e), 8125 this.shapeModifiers.push(f), 8126 (n = !1)), 8127 y.push(f)); 8128 this.addProcessedElement(t[o], o + 1); 8129 } 8130 for (d = u.length, o = 0; o < d; o += 1) u[o].closed = !0; 8131 for (d = y.length, o = 0; o < d; o += 1) y[o].closed = !0; 8132 }), 8133 (SVGShapeElement.prototype.renderInnerContent = function () { 8134 var t; 8135 this.renderModifiers(); 8136 var e = this.stylesList.length; 8137 for (t = 0; t < e; t += 1) this.stylesList[t].reset(); 8138 for (this.renderShape(), t = 0; t < e; t += 1) 8139 (this.stylesList[t]._mdf || this._isFirstFrame) && 8140 (this.stylesList[t].msElem && 8141 (this.stylesList[t].msElem.setAttribute( 8142 "d", 8143 this.stylesList[t].d 8144 ), 8145 (this.stylesList[t].d = "M0 0" + this.stylesList[t].d)), 8146 this.stylesList[t].pElem.setAttribute( 8147 "d", 8148 this.stylesList[t].d || "M0 0" 8149 )); 8150 }), 8151 (SVGShapeElement.prototype.renderShape = function () { 8152 var t, 8153 e, 8154 r = this.animatedContents.length; 8155 for (t = 0; t < r; t += 1) 8156 (e = this.animatedContents[t]), 8157 (this._isFirstFrame || e.element._isAnimated) && 8158 !0 !== e.data && 8159 e.fn(e.data, e.element, this._isFirstFrame); 8160 }), 8161 (SVGShapeElement.prototype.destroy = function () { 8162 this.destroyBaseElement(), 8163 (this.shapesData = null), 8164 (this.itemsData = null); 8165 }), 8166 (LetterProps.prototype.update = function (t, e, r, i, s, a) { 8167 (this._mdf.o = !1), 8168 (this._mdf.sw = !1), 8169 (this._mdf.sc = !1), 8170 (this._mdf.fc = !1), 8171 (this._mdf.m = !1), 8172 (this._mdf.p = !1); 8173 var n = !1; 8174 return ( 8175 this.o !== t && ((this.o = t), (this._mdf.o = !0), (n = !0)), 8176 this.sw !== e && ((this.sw = e), (this._mdf.sw = !0), (n = !0)), 8177 this.sc !== r && ((this.sc = r), (this._mdf.sc = !0), (n = !0)), 8178 this.fc !== i && ((this.fc = i), (this._mdf.fc = !0), (n = !0)), 8179 this.m !== s && ((this.m = s), (this._mdf.m = !0), (n = !0)), 8180 !a.length || 8181 (this.p[0] === a[0] && 8182 this.p[1] === a[1] && 8183 this.p[4] === a[4] &&
8184 this.p[5] === a[5] && 8185 this.p[12] === a[12] && 8186 this.p[13] === a[13]) || 8187 ((this.p = a), (this._mdf.p = !0), (n = !0)), 8188 n 8189 ); 8190 }), 8191 (TextProperty.prototype.defaultBoxWidth = [0, 0]), 8192 (TextProperty.prototype.copyData = function (t, e) { 8193 for (var r in e) 8194 Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); 8195 return t; 8196 }), 8197 (TextProperty.prototype.setCurrentData = function (t) { 8198 t.__complete || this.completeTextData(t), 8199 (this.currentData = t), 8200 (this.currentData.boxWidth = 8201 this.currentData.boxWidth || this.defaultBoxWidth), 8202 (this._mdf = !0); 8203 }), 8204 (TextProperty.prototype.searchProperty = function () { 8205 return this.searchKeyframes(); 8206 }), 8207 (TextProperty.prototype.searchKeyframes = function () { 8208 return ( 8209 (this.kf = this.data.d.k.length > 1), 8210 this.kf && this.addEffect(this.getKeyframeValue.bind(this)), 8211 this.kf 8212 ); 8213 }), 8214 (TextProperty.prototype.addEffect = function (t) { 8215 this.effectsSequence.push(t), this.elem.addDynamicProperty(this); 8216 }), 8217 (TextProperty.prototype.getValue = function (t) { 8218 if ( 8219 (this.elem.globalData.frameId !== this.frameId && 8220 this.effectsSequence.length) || 8221 t 8222 ) { 8223 this.currentData.t = this.data.d.k[this.keysIndex].s.t; 8224 var e = this.currentData, 8225 r = this.keysIndex; 8226 if (this.lock) this.setCurrentData(this.currentData); 8227 else { 8228 var i; 8229 (this.lock = !0), (this._mdf = !1);
8230 var s = this.effectsSequence.length, 8231 a = t || this.data.d.k[this.keysIndex].s; 8232 for (i = 0; i < s; i += 1) 8233 a = 8234 r !== this.keysIndex 8235 ? this.effectsSequence[i](a, a.t) 8236 : this.effectsSequence[i](this.currentData, a.t); 8237 e !== a && this.setCurrentData(a), 8238 (this.v = this.currentData), 8239 (this.pv = this.v), 8240 (this.lock = !1), 8241 (this.frameId = this.elem.globalData.frameId); 8242 } 8243 } 8244 }), 8245 (TextProperty.prototype.getKeyframeValue = function () { 8246 for ( 8247 var t = this.data.d.k, 8248 e = this.elem.comp.renderedFrame, 8249 r = 0, 8250 i = t.length; 8251 r <= i - 1 && !(r === i - 1 || t[r + 1].t > e); 8252 8253 ) 8254 r += 1; 8255 return ( 8256 this.keysIndex !== r && (this.keysIndex = r), 8257 this.data.d.k[this.keysIndex].s 8258 ); 8259 }), 8260 (TextProperty.prototype.buildFinalText = function (t) { 8261 for (var e, r, i = [], s = 0, a = t.length, n = !1; s < a; ) 8262 (e = t.charCodeAt(s)), 8263 FontManager.isCombinedCharacter(e) 8264 ? (i[i.length - 1] += t.charAt(s)) 8265 : e >= 55296 && e <= 56319 8266 ? (r = t.charCodeAt(s + 1)) >= 56320 && r <= 57343 8267 ? (n || FontManager.isModifier(e, r) 8268 ? ((i[i.length - 1] += t.substr(s, 2)), (n = !1)) 8269 : i.push(t.substr(s, 2)), 8270 (s += 1)) 8271 : i.push(t.charAt(s)) 8272 : e > 56319 8273 ? ((r = t.charCodeAt(s + 1)), 8274 FontManager.isZeroWidthJoiner(e, r) 8275 ? ((n = !0), (i[i.length - 1] += t.substr(s, 2)), (s += 1)) 8276 : i.push(t.charAt(s))) 8277 : FontManager.isZeroWidthJoiner(e) 8278 ? ((i[i.length - 1] += t.charAt(s)), (n = !0)) 8279 : i.push(t.charAt(s)), 8280 (s += 1); 8281 return i; 8282 }), 8283 (TextProperty.prototype.completeTextData = function (t) { 8284 t.__complete = !0; 8285 var e, 8286 r, 8287 i, 8288 s, 8289 a, 8290 n, 8291 o, 8292 h = this.elem.globalData.fontManager, 8293 l = this.data, 8294 p = [], 8295 f = 0, 8296 m = l.m.g, 8297 c = 0, 8298 d = 0, 8299 u = 0, 8300 y = [], 8301 g = 0, 8302 v = 0, 8303 b = h.getFontByName(t.f), 8304 P = 0, 8305 x = getFontProperties(b); 8306 (t.fWeight = x.weight), 8307 (t.fStyle = x.style), 8308 (t.finalSize = t.s), 8309 (t.finalText = this.buildFinalText(t.t)), 8310 (r = t.finalText.length), 8311 (t.finalLineHeight = t.lh); 8312 var E, 8313 S = (t.tr / 1e3) * t.finalSize; 8314 if (t.sz) 8315 for (var _, C, A = !0, M = t.sz[0], T = t.sz[1]; A; ) { 8316 (_ = 0), 8317 (g = 0), 8318 (r = (C = this.buildFinalText(t.t)).length), 8319 (S = (t.tr / 1e3) * t.finalSize); 8320 var D = -1; 8321 for (e = 0; e < r; e += 1) 8322 (E = C[e].charCodeAt(0)), 8323 (i = !1), 8324 " " === C[e] 8325 ? (D = e) 8326 : (13 !== E && 3 !== E) || 8327 ((g = 0), 8328 (i = !0), 8329 (_ += t.finalLineHeight || 1.2 * t.finalSize)), 8330 h.chars 8331 ? ((o = h.getCharData(C[e], b.fStyle, b.fFamily)), 8332 (P = i ? 0 : (o.w * t.finalSize) / 100)) 8333 : (P = h.measureText(C[e], t.f, t.finalSize)), 8334 g + P > M && " " !== C[e] 8335 ? (-1 === D ? (r += 1) : (e = D), 8336 (_ += t.finalLineHeight || 1.2 * t.finalSize), 8337 C.splice(e, D === e ? 1 : 0, "\r"), 8338 (D = -1), 8339 (g = 0)) 8340 : ((g += P), (g += S)); 8341 (_ += (b.ascent * t.finalSize) / 100), 8342 this.canResize && t.finalSize > this.minimumFontSize && T < _ 8343 ? ((t.finalSize -= 1), 8344 (t.finalLineHeight = (t.finalSize * t.lh) / t.s)) 8345 : ((t.finalText = C), (r = t.finalText.length), (A = !1)); 8346 } 8347 (g = -S), (P = 0); 8348 var k, 8349 F = 0; 8350 for (e = 0; e < r; e += 1) 8351 if ( 8352 ((i = !1),
8353 13 === (E = (k = t.finalText[e]).charCodeAt(0)) || 3 === E 8354 ? ((F = 0), 8355 y.push(g), 8356 (v = g > v ? g : v), 8357 (g = -2 * S), 8358 (s = ""), 8359 (i = !0), 8360 (u += 1)) 8361 : (s = k), 8362 h.chars 8363 ? ((o = h.getCharData(k, b.fStyle, h.getFontByName(t.f).fFamily)), 8364 (P = i ? 0 : (o.w * t.finalSize) / 100)) 8365 : (P = h.measureText(s, t.f, t.finalSize)), 8366 " " === k ? (F += P + S) : ((g += P + S + F), (F = 0)), 8367 p.push({ 8368 l: P, 8369 an: P, 8370 add: c, 8371 n: i, 8372 anIndexes: [], 8373 val: s, 8374 line: u, 8375 animatorJustifyOffset: 0, 8376 }), 8377 2 == m) 8378 ) { 8379 if (((c += P), "" === s || " " === s || e === r - 1)) { 8380 for (("" !== s && " " !== s) || (c -= P); d <= e; ) 8381 (p[d].an = c), (p[d].ind = f), (p[d].extra = P), (d += 1); 8382 (f += 1), (c = 0); 8383 } 8384 } else if (3 == m) { 8385 if (((c += P), "" === s || e === r - 1)) { 8386 for ("" === s && (c -= P); d <= e; ) 8387 (p[d].an = c), (p[d].ind = f), (p[d].extra = P), (d += 1); 8388 (c = 0), (f += 1); 8389 } 8390 } else (p[f].ind = f), (p[f].extra = 0), (f += 1); 8391 if (((t.l = p), (v = g > v ? g : v), y.push(g), t.sz)) 8392 (t.boxWidth = t.sz[0]), (t.justifyOffset = 0); 8393 else 8394 switch (((t.boxWidth = v), t.j)) { 8395 case 1: 8396 t.justifyOffset = -t.boxWidth; 8397 break; 8398 case 2: 8399 t.justifyOffset = -t.boxWidth / 2; 8400 break; 8401 default: 8402 t.justifyOffset = 0; 8403 } 8404 t.lineWidths = y; 8405 var w, 8406 I, 8407 B, 8408 V, 8409 R = l.a; 8410 n = R.length; 8411 var L = []; 8412 for (a = 0; a < n; a += 1) { 8413 for ( 8414 (w = R[a]).a.sc && (t.strokeColorAnim = !0), 8415 w.a.sw && (t.strokeWidthAnim = !0), 8416 (w.a.fc || w.a.fh || w.a.fs || w.a.fb) && (t.fillColorAnim = !0), 8417 V = 0, 8418 B = w.s.b, 8419 e = 0; 8420 e < r; 8421 e += 1 8422 ) 8423 ((I = p[e]).anIndexes[a] = V), 8424 ((1 == B && "" !== I.val) || 8425 (2 == B && "" !== I.val && " " !== I.val) || 8426 (3 == B && (I.n || " " == I.val || e == r - 1)) || 8427 (4 == B && (I.n || e == r - 1))) && 8428 (1 === w.s.rn && L.push(V), (V += 1)); 8429 l.a[a].s.totalChars = V; 8430 var z, 8431 G = -1; 8432 if (1 === w.s.rn) 8433 for (e = 0; e < r; e += 1) 8434 G != (I = p[e]).anIndexes[a] && 8435 ((G = I.anIndexes[a]), 8436 (z = L.splice(Math.floor(Math.random() * L.length), 1)[0])), 8437 (I.anIndexes[a] = z); 8438 } 8439 (t.yOffset = t.finalLineHeight || 1.2 * t.finalSize), 8440 (t.ls = t.ls || 0), 8441 (t.ascent = (b.ascent * t.finalSize) / 100); 8442 }), 8443 (TextProperty.prototype.updateDocumentData = function (t, e) { 8444 e = void 0 === e ? this.keysIndex : e; 8445 var r = this.copyData({}, this.data.d.k[e].s); 8446 (r = this.copyData(r, t)), 8447 (this.data.d.k[e].s = r), 8448 this.recalculate(e), 8449 this.elem.addDynamicProperty(this); 8450 }), 8451 (TextProperty.prototype.recalculate = function (t) { 8452 var e = this.data.d.k[t].s; 8453 (e.__complete = !1), 8454 (this.keysIndex = 0), 8455 (this._isFirstFrame = !0), 8456 this.getValue(e); 8457 }), 8458 (TextProperty.prototype.canResizeFont = function (t) { 8459 (this.canResize = t), 8460 this.recalculate(this.keysIndex), 8461 this.elem.addDynamicProperty(this); 8462 }), 8463 (TextProperty.prototype.setMinimumFontSize = function (t) { 8464 (this.minimumFontSize = Math.floor(t) || 1), 8465 this.recalculate(this.keysIndex), 8466 this.elem.addDynamicProperty(this); 8467 }); 8468 var TextSelectorProp = (function () { 8469 var t = Math.max, 8470 e = Math.min, 8471 r = Math.floor; 8472 function i(t, e) { 8473 (this._currentTextLength = -1), 8474 (this.k = !1), 8475 (this.data = e), 8476 (this.elem = t), 8477 (this.comp = t.comp), 8478 (this.finalS = 0), 8479 (this.finalE = 0), 8480 this.initDynamicPropertyContainer(t), 8481 (this.s = PropertyFactory.getProp(t, e.s || { k: 0 }, 0, 0, this)), 8482 (this.e = 8483 "e" in e 8484 ? PropertyFactory.getProp(t, e.e, 0, 0, this) 8485 : { v: 100 }), 8486 (this.o = PropertyFactory.getProp(t, e.o || { k: 0 }, 0, 0, this)), 8487 (this.xe = PropertyFactory.getProp(t, e.xe || { k: 0 }, 0, 0, this)), 8488 (this.ne = PropertyFactory.getProp(t, e.ne || { k: 0 }, 0, 0, this)), 8489 (this.sm = PropertyFactory.getProp( 8490 t, 8491 e.sm || { k: 100 }, 8492 0, 8493 0, 8494 this 8495 )), 8496 (this.a = PropertyFactory.getProp(t, e.a, 0, 0.01, this)), 8497 this.dynamicProperties.length || this.getValue(); 8498 } 8499 return ( 8500 (i.prototype = { 8501 getMult: function (i) { 8502 this._currentTextLength !== 8503 this.elem.textProperty.currentData.l.length && this.getValue(); 8504 var s = 0, 8505 a = 0, 8506 n = 1, 8507 o = 1; 8508 this.ne.v > 0 ? (s = this.ne.v / 100) : (a = -this.ne.v / 100), 8509 this.xe.v > 0 8510 ? (n = 1 - this.xe.v / 100) 8511 : (o = 1 + this.xe.v / 100); 8512 var h = BezierFactory.getBezierEasing(s, a, n, o).get, 8513 l = 0, 8514 p = this.finalS, 8515 f = this.finalE, 8516 m = this.data.sh; 8517 if (2 === m) 8518 l = h( 8519 (l = 8520 f === p 8521 ? i >= f 8522 ? 1 8523 : 0 8524 : t(0, e(0.5 / (f - p) + (i - p) / (f - p), 1))) 8525 ); 8526 else if (3 === m) 8527 l = h( 8528 (l = 8529 f === p 8530 ? i >= f 8531 ? 0 8532 : 1 8533 : 1 - t(0, e(0.5 / (f - p) + (i - p) / (f - p), 1))) 8534 ); 8535 else if (4 === m) 8536 f === p 8537 ? (l = 0) 8538 : (l = t(0, e(0.5 / (f - p) + (i - p) / (f - p), 1))) < 0.5 8539 ? (l *= 2) 8540 : (l = 1 - 2 * (l - 0.5)), 8541 (l = h(l)); 8542 else if (5 === m) { 8543 if (f === p) l = 0; 8544 else { 8545 var c = f - p, 8546 d = -c / 2 + (i = e(t(0, i + 0.5 - p), f - p)), 8547 u = c / 2; 8548 l = Math.sqrt(1 - (d * d) / (u * u)); 8549 } 8550 l = h(l); 8551 } else 8552 6 === m 8553 ? (f === p 8554 ? (l = 0) 8555 : ((i = e(t(0, i + 0.5 - p), f - p)), 8556 (l =
8557 (1 + Math.cos(Math.PI + (2 * Math.PI * i) / (f - p))) / 8558 2)), 8559 (l = h(l))) 8560 : (i >= r(p) && 8561 (l = t(0, e(i - p < 0 ? e(f, 1) - (p - i) : f - i, 1))), 8562 (l = h(l))); 8563 if (100 !== this.sm.v) { 8564 var y = 0.01 * this.sm.v; 8565 0 === y && (y = 1e-8); 8566 var g = 0.5 - 0.5 * y; 8567 l < g ? (l = 0) : (l = (l - g) / y) > 1 && (l = 1); 8568 } 8569 return l * this.a.v; 8570 }, 8571 getValue: function (t) { 8572 this.iterateDynamicProperties(), 8573 (this._mdf = t || this._mdf), 8574 (this._currentTextLength = 8575 this.elem.textProperty.currentData.l.length || 0), 8576 t && 2 === this.data.r && (this.e.v = this._currentTextLength); 8577 var e = 2 === this.data.r ? 1 : 100 / this.data.totalChars, 8578 r = this.o.v / e, 8579 i = this.s.v / e + r, 8580 s = this.e.v / e + r; 8581 if (i > s) { 8582 var a = i; 8583 (i = s), (s = a); 8584 } 8585 (this.finalS = i), (this.finalE = s); 8586 }, 8587 }), 8588 extendPrototype([DynamicPropertyContainer], i), 8589 { 8590 getTextSelectorProp: function (t, e, r) { 8591 return new i(t, e, r); 8592 }, 8593 } 8594 ); 8595 })(); 8596 function TextAnimatorDataProperty(t, e, r) { 8597 var i = { propType: !1 }, 8598 s = PropertyFactory.getProp, 8599 a = e.a; 8600 (this.a = { 8601 r: a.r ? s(t, a.r, 0, degToRads, r) : i, 8602 rx: a.rx ? s(t, a.rx, 0, degToRads, r) : i, 8603 ry: a.ry ? s(t, a.ry, 0, degToRads, r) : i, 8604 sk: a.sk ? s(t, a.sk, 0, degToRads, r) : i, 8605 sa: a.sa ? s(t, a.sa, 0, degToRads, r) : i, 8606 s: a.s ? s(t, a.s, 1, 0.01, r) : i, 8607 a: a.a ? s(t, a.a, 1, 0, r) : i, 8608 o: a.o ? s(t, a.o, 0, 0.01, r) : i, 8609 p: a.p ? s(t, a.p, 1, 0, r) : i, 8610 sw: a.sw ? s(t, a.sw, 0, 0, r) : i, 8611 sc: a.sc ? s(t, a.sc, 1, 0, r) : i, 8612 fc: a.fc ? s(t, a.fc, 1, 0, r) : i, 8613 fh: a.fh ? s(t, a.fh, 0, 0, r) : i, 8614 fs: a.fs ? s(t, a.fs, 0, 0.01, r) : i, 8615 fb: a.fb ? s(t, a.fb, 0, 0.01, r) : i, 8616 t: a.t ? s(t, a.t, 0, 0, r) : i, 8617 }), 8618 (this.s = TextSelectorProp.getTextSelectorProp(t, e.s, r)), 8619 (this.s.t = e.s.t); 8620 } 8621 function TextAnimatorProperty(t, e, r) { 8622 (this._isFirstFrame = !0), 8623 (this._hasMaskedPath = !1), 8624 (this._frameId = -1), 8625 (this._textData = t), 8626 (this._renderType = e), 8627 (this._elem = r), 8628 (this._animatorsData = createSizedArray(this._textData.a.length)), 8629 (this._pathData = {}), 8630 (this._moreOptions = { alignment: {} }), 8631 (this.renderedLetters = []), 8632 (this.lettersChangedFlag = !1), 8633 this.initDynamicPropertyContainer(r); 8634 } 8635 function ITextElement() {} 8636 (TextAnimatorProperty.prototype.searchProperties = function () { 8637 var t, 8638 e, 8639 r = this._textData.a.length, 8640 i = PropertyFactory.getProp; 8641 for (t = 0; t < r; t += 1) 8642 (e = this._textData.a[t]), 8643 (this._animatorsData[t] = new TextAnimatorDataProperty( 8644 this._elem, 8645 e, 8646 this 8647 )); 8648 this._textData.p && "m" in this._textData.p 8649 ? ((this._pathData = { 8650 a: i(this._elem, this._textData.p.a, 0, 0, this), 8651 f: i(this._elem, this._textData.p.f, 0, 0, this), 8652 l: i(this._elem, this._textData.p.l, 0, 0, this), 8653 r: i(this._elem, this._textData.p.r, 0, 0, this), 8654 p: i(this._elem, this._textData.p.p, 0, 0, this), 8655 m: this._elem.maskManager.getMaskProperty(this._textData.p.m), 8656 }), 8657 (this._hasMaskedPath = !0)) 8658 : (this._hasMaskedPath = !1), 8659 (this._moreOptions.alignment = i( 8660 this._elem, 8661 this._textData.m.a, 8662 1, 8663 0, 8664 this 8665 )); 8666 }), 8667 (TextAnimatorProperty.prototype.getMeasures = function (t, e) { 8668 if ( 8669 ((this.lettersChangedFlag = e), 8670 this._mdf || 8671 this._isFirstFrame || 8672 e || 8673 (this._hasMaskedPath && this._pathData.m._mdf)) 8674 ) { 8675 this._isFirstFrame = !1; 8676 var r, 8677 i, 8678 s, 8679 a, 8680 n, 8681 o, 8682 h, 8683 l, 8684 p, 8685 f, 8686 m, 8687 c, 8688 d, 8689 u, 8690 y, 8691 g, 8692 v, 8693 b, 8694 P, 8695 x = this._moreOptions.alignment.v,
8696 E = this._animatorsData, 8697 S = this._textData, 8698 _ = this.mHelper, 8699 C = this._renderType, 8700 A = this.renderedLetters.length, 8701 M = t.l; 8702 if (this._hasMaskedPath) { 8703 if ( 8704 ((P = this._pathData.m), !this._pathData.n || this._pathData._mdf) 8705 ) { 8706 var T, 8707 D = P.v; 8708 for ( 8709 this._pathData.r.v && (D = D.reverse()), 8710 n = { tLength: 0, segments: [] }, 8711 a = D._length - 1, 8712 g = 0, 8713 s = 0; 8714 s < a; 8715 s += 1 8716 ) 8717 (T = bez.buildBezierData( 8718 D.v[s], 8719 D.v[s + 1], 8720 [D.o[s][0] - D.v[s][0], D.o[s][1] - D.v[s][1]], 8721 [D.i[s + 1][0] - D.v[s + 1][0], D.i[s + 1][1] - D.v[s + 1][1]] 8722 )), 8723 (n.tLength += T.segmentLength), 8724 n.segments.push(T), 8725 (g += T.segmentLength); 8726 (s = a), 8727 P.v.c && 8728 ((T = bez.buildBezierData( 8729 D.v[s], 8730 D.v[0], 8731 [D.o[s][0] - D.v[s][0], D.o[s][1] - D.v[s][1]], 8732 [D.i[0][0] - D.v[0][0], D.i[0][1] - D.v[0][1]] 8733 )), 8734 (n.tLength += T.segmentLength), 8735 n.segments.push(T), 8736 (g += T.segmentLength)), 8737 (this._pathData.pi = n); 8738 } 8739 if ( 8740 ((n = this._pathData.pi), 8741 (o = this._pathData.f.v), 8742 (m = 0), 8743 (f = 1), 8744 (l = 0), 8745 (p = !0), 8746 (u = n.segments), 8747 o < 0 && P.v.c) 8748 ) 8749 for ( 8750 n.tLength < Math.abs(o) && (o = -Math.abs(o) % n.tLength), 8751 f = (d = u[(m = u.length - 1)].points).length - 1; 8752 o < 0; 8753 8754 ) 8755 (o += d[f].partialLength), 8756 (f -= 1) < 0 && (f = (d = u[(m -= 1)].points).length - 1); 8757 (c = (d = u[m].points)[f - 1]), (y = (h = d[f]).partialLength); 8758 } 8759 (a = M.length), (r = 0), (i = 0); 8760 var k, 8761 F, 8762 w, 8763 I, 8764 B, 8765 V = 1.2 * t.finalSize * 0.714, 8766 R = !0; 8767 w = E.length; 8768 var L, 8769 z, 8770 G, 8771 O, 8772 N, 8773 H, 8774 j, 8775 q, 8776 W, 8777 $, 8778 Y, 8779 X, 8780 Z = -1, 8781 K = o, 8782 J = m, 8783 U = f, 8784 Q = -1, 8785 tt = "", 8786 et = this.defaultPropsArray; 8787 if (2 === t.j || 1 === t.j) { 8788 var rt = 0, 8789 it = 0, 8790 st = 2 === t.j ? -0.5 : -1, 8791 at = 0, 8792 nt = !0; 8793 for (s = 0; s < a; s += 1) 8794 if (M[s].n) { 8795 for (rt && (rt += it); at < s; ) 8796 (M[at].animatorJustifyOffset = rt), (at += 1); 8797 (rt = 0), (nt = !0); 8798 } else { 8799 for (F = 0; F < w; F += 1) 8800 (k = E[F].a).t.propType && 8801 (nt && 2 === t.j && (it += k.t.v * st), 8802 (B = E[F].s.getMult(M[s].anIndexes[F], S.a[F].s.totalChars)) 8803 .length 8804 ? (rt += k.t.v * B[0] * st) 8805 : (rt += k.t.v * B * st)); 8806 nt = !1; 8807 } 8808 for (rt && (rt += it); at < s; ) 8809 (M[at].animatorJustifyOffset = rt), (at += 1); 8810 } 8811 for (s = 0; s < a; s += 1) { 8812 if ((_.reset(), (O = 1), M[s].n)) 8813 (r = 0), 8814 (i += t.yOffset), 8815 (i += R ? 1 : 0), 8816 (o = K), 8817 (R = !1), 8818 this._hasMaskedPath && 8819 ((f = U), 8820 (c = (d = u[(m = J)].points)[f - 1]), 8821 (y = (h = d[f]).partialLength), 8822 (l = 0)), 8823 (tt = ""), 8824 (Y = ""), 8825 (W = ""), 8826 (X = ""), 8827 (et = this.defaultPropsArray);
8828 else { 8829 if (this._hasMaskedPath) { 8830 if (Q !== M[s].line) { 8831 switch (t.j) { 8832 case 1: 8833 o += g - t.lineWidths[M[s].line]; 8834 break; 8835 case 2: 8836 o += (g - t.lineWidths[M[s].line]) / 2; 8837 } 8838 Q = M[s].line; 8839 } 8840 Z !== M[s].ind && 8841 (M[Z] && (o += M[Z].extra), 8842 (o += M[s].an / 2), 8843 (Z = M[s].ind)), 8844 (o += x[0] * M[s].an * 0.005); 8845 var ot = 0; 8846 for (F = 0; F < w; F += 1) 8847 (k = E[F].a).p.propType && 8848 ((B = E[F].s.getMult( 8849 M[s].anIndexes[F], 8850 S.a[F].s.totalChars 8851 )).length 8852 ? (ot += k.p.v[0] * B[0]) 8853 : (ot += k.p.v[0] * B)), 8854 k.a.propType && 8855 ((B = E[F].s.getMult( 8856 M[s].anIndexes[F], 8857 S.a[F].s.totalChars 8858 )).length 8859 ? (ot += k.a.v[0] * B[0]) 8860 : (ot += k.a.v[0] * B)); 8861 for ( 8862 p = !0, 8863 this._pathData.a.v && 8864 ((o = 8865 0.5 * M[0].an + 8866 ((g - 8867 this._pathData.f.v - 8868 0.5 * M[0].an - 8869 0.5 * M[M.length - 1].an) * 8870 Z) / 8871 (a - 1)), 8872 (o += this._pathData.f.v)); 8873 p; 8874 8875 ) 8876 l + y >= o + ot || !d 8877 ? ((v = (o + ot - l) / h.partialLength), 8878 (z = c.point[0] + (h.point[0] - c.point[0]) * v), 8879 (G = c.point[1] + (h.point[1] - c.point[1]) * v), 8880 _.translate(-x[0] * M[s].an * 0.005, -x[1] * V * 0.01), 8881 (p = !1)) 8882 : d && 8883 ((l += h.partialLength), 8884 (f += 1) >= d.length && 8885 ((f = 0), 8886 u[(m += 1)] 8887 ? (d = u[m].points) 8888 : P.v.c 8889 ? ((f = 0), (d = u[(m = 0)].points)) 8890 : ((l -= h.partialLength), (d = null))), 8891 d && ((c = h), (y = (h = d[f]).partialLength))); 8892 (L = M[s].an / 2 - M[s].add), _.translate(-L, 0, 0); 8893 } else 8894 (L = M[s].an / 2 - M[s].add), 8895 _.translate(-L, 0, 0), 8896 _.translate(-x[0] * M[s].an * 0.005, -x[1] * V * 0.01, 0); 8897 for (F = 0; F < w; F += 1) 8898 (k = E[F].a).t.propType && 8899 ((B = E[F].s.getMult(M[s].anIndexes[F], S.a[F].s.totalChars)), 8900 (0 === r && 0 === t.j) || 8901 (this._hasMaskedPath 8902 ? B.length 8903 ? (o += k.t.v * B[0]) 8904 : (o += k.t.v * B) 8905 : B.length 8906 ? (r += k.t.v * B[0]) 8907 : (r += k.t.v * B))); 8908 for ( 8909 t.strokeWidthAnim && (H = t.sw || 0), 8910 t.strokeColorAnim && 8911 (N = t.sc ? [t.sc[0], t.sc[1], t.sc[2]] : [0, 0, 0]), 8912 t.fillColorAnim && t.fc && (j = [t.fc[0], t.fc[1], t.fc[2]]), 8913 F = 0; 8914 F < w; 8915 F += 1 8916 ) 8917 (k = E[F].a).a.propType && 8918 ((B = E[F].s.getMult(M[s].anIndexes[F], S.a[F].s.totalChars)) 8919 .length 8920 ? _.translate( 8921 -k.a.v[0] * B[0], 8922 -k.a.v[1] * B[1], 8923 k.a.v[2] * B[2] 8924 ) 8925 : _.translate(-k.a.v[0] * B, -k.a.v[1] * B, k.a.v[2] * B)); 8926 for (F = 0; F < w; F += 1) 8927 (k = E[F].a).s.propType && 8928 ((B = E[F].s.getMult(M[s].anIndexes[F], S.a[F].s.totalChars)) 8929 .length 8930 ? _.scale( 8931 1 + (k.s.v[0] - 1) * B[0], 8932 1 + (k.s.v[1] - 1) * B[1], 8933 1 8934 ) 8935 : _.scale( 8936 1 + (k.s.v[0] - 1) * B, 8937 1 + (k.s.v[1] - 1) * B, 8938 1 8939 )); 8940 for (F = 0; F < w; F += 1) { 8941 if ( 8942 ((k = E[F].a), 8943 (B = E[F].s.getMult(M[s].anIndexes[F], S.a[F].s.totalChars)), 8944 k.sk.propType && 8945 (B.length 8946 ? _.skewFromAxis(-k.sk.v * B[0], k.sa.v * B[1]) 8947 : _.skewFromAxis(-k.sk.v * B, k.sa.v * B)), 8948 k.r.propType && 8949 (B.length 8950 ? _.rotateZ(-k.r.v * B[2]) 8951 : _.rotateZ(-k.r.v * B)), 8952 k.ry.propType && 8953 (B.length 8954 ? _.rotateY(k.ry.v * B[1]) 8955 : _.rotateY(k.ry.v * B)), 8956 k.rx.propType && 8957 (B.length 8958 ? _.rotateX(k.rx.v * B[0]) 8959 : _.rotateX(k.rx.v * B)), 8960 k.o.propType && 8961 (B.length 8962 ? (O += (k.o.v * B[0] - O) * B[0]) 8963 : (O += (k.o.v * B - O) * B)), 8964 t.strokeWidthAnim && 8965 k.sw.propType && 8966 (B.length ? (H += k.sw.v * B[0]) : (H += k.sw.v * B)), 8967 t.strokeColorAnim && k.sc.propType) 8968 ) 8969 for (q = 0; q < 3; q += 1) 8970 B.length 8971 ? (N[q] += (k.sc.v[q] - N[q]) * B[0]) 8972 : (N[q] += (k.sc.v[q] - N[q]) * B); 8973 if (t.fillColorAnim && t.fc) { 8974 if (k.fc.propType) 8975 for (q = 0; q < 3; q += 1) 8976 B.length 8977 ? (j[q] += (k.fc.v[q] - j[q]) * B[0]) 8978 : (j[q] += (k.fc.v[q] - j[q]) * B); 8979 k.fh.propType && 8980 (j = B.length 8981 ? addHueToRGB(j, k.fh.v * B[0]) 8982 : addHueToRGB(j, k.fh.v * B)), 8983 k.fs.propType && 8984 (j = B.length 8985 ? addSaturationToRGB(j, k.fs.v * B[0]) 8986 : addSaturationToRGB(j, k.fs.v * B)), 8987 k.fb.propType && 8988 (j = B.length 8989 ? addBrightnessToRGB(j, k.fb.v * B[0]) 8990 : addBrightnessToRGB(j, k.fb.v * B)); 8991 } 8992 } 8993 for (F = 0; F < w; F += 1) 8994 (k = E[F].a).p.propType && 8995 ((B = E[F].s.getMult(M[s].anIndexes[F], S.a[F].s.totalChars)), 8996 this._hasMaskedPath 8997 ? B.length 8998 ? _.translate(0, k.p.v[1] * B[0], -k.p.v[2] * B[1]) 8999 : _.translate(0, k.p.v[1] * B, -k.p.v[2] * B) 9000 : B.length 9001 ? _.translate( 9002 k.p.v[0] * B[0], 9003 k.p.v[1] * B[1], 9004 -k.p.v[2] * B[2] 9005 ) 9006 : _.translate(k.p.v[0] * B, k.p.v[1] * B, -k.p.v[2] * B)); 9007 if ( 9008 (t.strokeWidthAnim && (W = H < 0 ? 0 : H), 9009 t.strokeColorAnim && 9010 ($ = 9011 "rgb(" + 9012 Math.round(255 * N[0]) + 9013 "," + 9014 Math.round(255 * N[1]) + 9015 "," + 9016 Math.round(255 * N[2]) + 9017 ")"), 9018 t.fillColorAnim && 9019 t.fc && 9020 (Y = 9021 "rgb(" + 9022 Math.round(255 * j[0]) + 9023 "," + 9024 Math.round(255 * j[1]) + 9025 "," + 9026 Math.round(255 * j[2]) + 9027 ")"), 9028 this._hasMaskedPath) 9029 ) { 9030 if ( 9031 (_.translate(0, -t.ls), 9032 _.translate(0, x[1] * V * 0.01 + i, 0), 9033 this._pathData.p.v) 9034 ) { 9035 b = (h.point[1] - c.point[1]) / (h.point[0] - c.point[0]); 9036 var ht = (180 * Math.atan(b)) / Math.PI; 9037 h.point[0] < c.point[0] && (ht += 180), 9038 _.rotate((-ht * Math.PI) / 180); 9039 } 9040 _.translate(z, G, 0), 9041 (o -= x[0] * M[s].an * 0.005), 9042 M[s + 1] && 9043 Z !== M[s + 1].ind && 9044 ((o += M[s].an / 2), (o += 0.001 * t.tr * t.finalSize)); 9045 } else { 9046 switch ( 9047 (_.translate(r, i, 0), 9048 t.ps && _.translate(t.ps[0], t.ps[1] + t.ascent, 0), 9049 t.j) 9050 ) { 9051 case 1: 9052 _.translate( 9053 M[s].animatorJustifyOffset + 9054 t.justifyOffset + 9055 (t.boxWidth - t.lineWidths[M[s].line]), 9056 0, 9057 0 9058 ); 9059 break; 9060 case 2: 9061 _.translate( 9062 M[s].animatorJustifyOffset + 9063 t.justifyOffset + 9064 (t.boxWidth - t.lineWidths[M[s].line]) / 2, 9065 0, 9066 0 9067 ); 9068 } 9069 _.translate(0, -t.ls), 9070 _.translate(L, 0, 0), 9071 _.translate(x[0] * M[s].an * 0.005, x[1] * V * 0.01, 0), 9072 (r += M[s].l + 0.001 * t.tr * t.finalSize); 9073 } 9074 "html" === C 9075 ? (tt = _.toCSS()) 9076 : "svg" === C 9077 ? (tt = _.to2dCSS()) 9078 : (et = [ 9079 _.props[0], 9080 _.props[1], 9081 _.props[2], 9082 _.props[3], 9083 _.props[4], 9084 _.props[5], 9085 _.props[6], 9086 _.props[7], 9087 _.props[8], 9088 _.props[9], 9089 _.props[10], 9090 _.props[11], 9091 _.props[12], 9092 _.props[13], 9093 _.props[14], 9094 _.props[15], 9095 ]), 9096 (X = O); 9097 } 9098 A <= s 9099 ? ((I = new LetterProps(X, W, $, Y, tt, et)), 9100 this.renderedLetters.push(I), 9101 (A += 1), 9102 (this.lettersChangedFlag = !0)) 9103 : ((I = this.renderedLetters[s]), 9104 (this.lettersChangedFlag = 9105 I.update(X, W, $, Y, tt, et) || this.lettersChangedFlag)); 9106 } 9107 } 9108 }), 9109 (TextAnimatorProperty.prototype.getValue = function () { 9110 this._elem.globalData.frameId !== this._frameId && 9111 ((this._frameId = this._elem.globalData.frameId), 9112 this.iterateDynamicProperties()); 9113 }), 9114 (TextAnimatorProperty.prototype.mHelper = new Matrix()), 9115 (TextAnimatorProperty.prototype.defaultPropsArray = []), 9116 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty), 9117 (ITextElement.prototype.initElement = function (t, e, r) { 9118 (this.lettersChangedFlag = !0), 9119 this.initFrame(), 9120 this.initBaseData(t, e, r), 9121 (this.textProperty = new TextProperty( 9122 this, 9123 t.t, 9124 this.dynamicProperties 9125 )), 9126 (this.textAnimator = new TextAnimatorProperty( 9127 t.t, 9128 this.renderType, 9129 this 9130 )), 9131 this.initTransform(t, e, r), 9132 this.initHierarchy(), 9133 this.initRenderable(), 9134 this.initRendererElement(), 9135 this.createContainerElements(), 9136 this.createRenderableComponents(), 9137 this.createContent(), 9138 this.hide(), 9139 this.textAnimator.searchProperties(this.dynamicProperties); 9140 }), 9141 (ITextElement.prototype.prepareFrame = function (t) { 9142 (this._mdf = !1), 9143 this.prepareRenderableFrame(t), 9144 this.prepareProperties(t, this.isInRange), 9145 (this.textProperty._mdf || this.textProperty._isFirstFrame) && 9146 (this.buildNewText(), 9147 (this.textProperty._isFirstFrame = !1), 9148 (this.textProperty._mdf = !1)); 9149 }), 9150 (ITextElement.prototype.createPathShape = function (t, e) { 9151 var r, 9152 i, 9153 s = e.length, 9154 a = ""; 9155 for (r = 0; r < s; r += 1) 9156 "sh" === e[r].ty &&
9157 ((i = e[r].ks.k), (a += buildShapeString(i, i.i.length, !0, t))); 9158 return a; 9159 }), 9160 (ITextElement.prototype.updateDocumentData = function (t, e) { 9161 this.textProperty.updateDocumentData(t, e); 9162 }), 9163 (ITextElement.prototype.canResizeFont = function (t) { 9164 this.textProperty.canResizeFont(t); 9165 }), 9166 (ITextElement.prototype.setMinimumFontSize = function (t) { 9167 this.textProperty.setMinimumFontSize(t); 9168 }), 9169 (ITextElement.prototype.applyTextPropertiesToMatrix = function ( 9170 t, 9171 e, 9172 r, 9173 i, 9174 s 9175 ) { 9176 switch ( 9177 (t.ps && e.translate(t.ps[0], t.ps[1] + t.ascent, 0), 9178 e.translate(0, -t.ls, 0), 9179 t.j) 9180 ) { 9181 case 1: 9182 e.translate(t.justifyOffset + (t.boxWidth - t.lineWidths[r]), 0, 0); 9183 break; 9184 case 2: 9185 e.translate( 9186 t.justifyOffset + (t.boxWidth - t.lineWidths[r]) / 2, 9187 0, 9188 0 9189 ); 9190 } 9191 e.translate(i, s, 0); 9192 }), 9193 (ITextElement.prototype.buildColor = function (t) { 9194 return ( 9195 "rgb(" + 9196 Math.round(255 * t[0]) + 9197 "," + 9198 Math.round(255 * t[1]) + 9199 "," + 9200 Math.round(255 * t[2]) + 9201 ")" 9202 ); 9203 }), 9204 (ITextElement.prototype.emptyProp = new LetterProps()), 9205 (ITextElement.prototype.destroy = function () {}); 9206 var emptyShapeData = { shapes: [] }; 9207 function SVGTextLottieElement(t, e, r) { 9208 (this.textSpans = []), 9209 (this.renderType = "svg"), 9210 this.initElement(t, e, r); 9211 } 9212 function ISolidElement(t, e, r) { 9213 this.initElement(t, e, r); 9214 } 9215 function NullElement(t, e, r) { 9216 this.initFrame(), 9217 this.initBaseData(t, e, r), 9218 this.initFrame(), 9219 this.initTransform(t, e, r), 9220 this.initHierarchy(); 9221 } 9222 function SVGRendererBase() {} 9223 function ICompElement() {} 9224 function SVGCompElement(t, e, r) { 9225 (this.layers = t.layers), 9226 (this.supports3d = !0), 9227 (this.completeLayers = !1), 9228 (this.pendingElements = []), 9229 (this.elements = this.layers 9230 ? createSizedArray(this.layers.length) 9231 : []), 9232 this.initElement(t, e, r), 9233 (this.tm = t.tm 9234 ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) 9235 : { _placeholder: !0 }); 9236 } 9237 function SVGRenderer(t, e) { 9238 (this.animationItem = t), 9239 (this.layers = null), 9240 (this.renderedFrame = -1), 9241 (this.svgElement = createNS("svg")); 9242 var r = ""; 9243 if (e && e.title) { 9244 var i = createNS("title"), 9245 s = createElementID(); 9246 i.setAttribute("id", s), 9247 (i.textContent = e.title), 9248 this.svgElement.appendChild(i), 9249 (r += s); 9250 } 9251 if (e && e.description) { 9252 var a = createNS("desc"), 9253 n = createElementID(); 9254 a.setAttribute("id", n), 9255 (a.textContent = e.description), 9256 this.svgElement.appendChild(a), 9257 (r += " " + n); 9258 } 9259 r && this.svgElement.setAttribute("aria-labelledby", r); 9260 var o = createNS("defs"); 9261 this.svgElement.appendChild(o); 9262 var h = createNS("g"); 9263 this.svgElement.appendChild(h), 9264 (this.layerElement = h), 9265 (this.renderConfig = { 9266 preserveAspectRatio: (e && e.preserveAspectRatio) || "xMidYMid meet", 9267 imagePreserveAspectRatio: 9268 (e && e.imagePreserveAspectRatio) || "xMidYMid slice", 9269 contentVisibility: (e && e.contentVisibility) || "visible", 9270 progressiveLoad: (e && e.progressiveLoad) || !1, 9271 hideOnTransparent: !(e && !1 === e.hideOnTransparent),
9272 viewBoxOnly: (e && e.viewBoxOnly) || !1, 9273 viewBoxSize: (e && e.viewBoxSize) || !1, 9274 className: (e && e.className) || "", 9275 id: (e && e.id) || "", 9276 focusable: e && e.focusable, 9277 filterSize: { 9278 width: (e && e.filterSize && e.filterSize.width) || "100%", 9279 height: (e && e.filterSize && e.filterSize.height) || "100%", 9280 x: (e && e.filterSize && e.filterSize.x) || "0%", 9281 y: (e && e.filterSize && e.filterSize.y) || "0%", 9282 }, 9283 width: e && e.width, 9284 height: e && e.height, 9285 runExpressions: !e || void 0 === e.runExpressions || e.runExpressions, 9286 }), 9287 (this.globalData = { 9288 _mdf: !1, 9289 frameNum: -1, 9290 defs: o, 9291 renderConfig: this.renderConfig, 9292 }), 9293 (this.elements = []), 9294 (this.pendingElements = []), 9295 (this.destroyed = !1), 9296 (this.rendererType = "svg"); 9297 } 9298 function CVContextData() { 9299 var t; 9300 (this.saved = []), 9301 (this.cArrPos = 0), 9302 (this.cTr = new Matrix()), 9303 (this.cO = 1); 9304 for ( 9305 this.savedOp = createTypedArray("float32", 15), t = 0; 9306 t < 15; 9307 t += 1 9308 ) 9309 this.saved[t] = createTypedArray("float32", 16); 9310 this._length = 15; 9311 } 9312 function ShapeTransformManager() { 9313 (this.sequences = {}), 9314 (this.sequenceList = []), 9315 (this.transform_key_count = 0); 9316 } 9317 function CVEffects() {} 9318 function CVMaskElement(t, e) { 9319 var r; 9320 (this.data = t), 9321 (this.element = e), 9322 (this.masksProperties = this.data.masksProperties || []), 9323 (this.viewData = createSizedArray(this.masksProperties.length)); 9324 var i = this.masksProperties.length, 9325 s = !1; 9326 for (r = 0; r < i; r += 1) 9327 "n" !== this.masksProperties[r].mode && (s = !0), 9328 (this.viewData[r] = ShapePropertyFactory.getShapeProp( 9329 this.element, 9330 this.masksProperties[r], 9331 3 9332 )); 9333 (this.hasMasks = s), s && this.element.addRenderableComponent(this); 9334 } 9335 function CVBaseElement() {} 9336 function CVShapeData(t, e, r, i) { 9337 (this.styledShapes = []), (this.tr = [0, 0, 0, 0, 0, 0]); 9338 var s, 9339 a = 4; 9340 "rc" === e.ty 9341 ? (a = 5) 9342 : "el" === e.ty 9343 ? (a = 6) 9344 : "sr" === e.ty && (a = 7), 9345 (this.sh = ShapePropertyFactory.getShapeProp(t, e, a, t)); 9346 var n, 9347 o = r.length; 9348 for (s = 0; s < o; s += 1) 9349 r[s].closed || 9350 ((n = { 9351 transforms: i.addTransformSequence(r[s].transforms), 9352 trNodes: [], 9353 }), 9354 this.styledShapes.push(n), 9355 r[s].elements.push(n)); 9356 } 9357 function CVShapeElement(t, e, r) { 9358 (this.shapes = []), 9359 (this.shapesData = t.shapes), 9360 (this.stylesList = []), 9361 (this.itemsData = []), 9362 (this.prevViewData = []), 9363 (this.shapeModifiers = []), 9364 (this.processedElements = []), 9365 (this.transformsManager = new ShapeTransformManager()), 9366 this.initElement(t, e, r); 9367 } 9368 function CVTextElement(t, e, r) { 9369 (this.textSpans = []), 9370 (this.yOffset = 0), 9371 (this.fillColorAnim = !1), 9372 (this.strokeColorAnim = !1), 9373 (this.strokeWidthAnim = !1), 9374 (this.stroke = !1), 9375 (this.fill = !1), 9376 (this.justifyOffset = 0), 9377 (this.currentRender = null), 9378 (this.renderType = "canvas"), 9379 (this.values = { 9380 fill: "rgba(0,0,0,0)", 9381 stroke: "rgba(0,0,0,0)", 9382 sWidth: 0, 9383 fValue: "", 9384 }), 9385 this.initElement(t, e, r); 9386 } 9387 function CVImageElement(t, e, r) { 9388 (this.assetData = e.getAssetData(t.refId)), 9389 (this.img = e.imageLoader.getAsset(this.assetData)), 9390 this.initElement(t, e, r); 9391 } 9392 function CVSolidElement(t, e, r) { 9393 this.initElement(t, e, r); 9394 } 9395 function CanvasRendererBase(t, e) { 9396 (this.animationItem = t), 9397 (this.renderConfig = { 9398 clearCanvas: !e || void 0 === e.clearCanvas || e.clearCanvas, 9399 context: (e && e.context) || null, 9400 progressiveLoad: (e && e.progressiveLoad) || !1, 9401 preserveAspectRatio: (e && e.preserveAspectRatio) || "xMidYMid meet", 9402 imagePreserveAspectRatio: 9403 (e && e.imagePreserveAspectRatio) || "xMidYMid slice", 9404 contentVisibility: (e && e.contentVisibility) || "visible", 9405 className: (e && e.className) || "", 9406 id: (e && e.id) || "", 9407 }), 9408 (this.renderConfig.dpr = (e && e.dpr) || 1), 9409 this.animationItem.wrapper && 9410 (this.renderConfig.dpr = 9411 (e && e.dpr) || window.devicePixelRatio || 1), 9412 (this.renderedFrame = -1), 9413 (this.globalData = { 9414 frameNum: -1, 9415 _mdf: !1, 9416 renderConfig: this.renderConfig, 9417 currentGlobalAlpha: -1, 9418 }), 9419 (this.contextData = new CVContextData()), 9420 (this.elements = []), 9421 (this.pendingElements = []), 9422 (this.transformMat = new Matrix()), 9423 (this.completeLayers = !1), 9424 (this.rendererType = "canvas"); 9425 } 9426 function CVCompElement(t, e, r) { 9427 (this.completeLayers = !1),
9428 (this.layers = t.layers), 9429 (this.pendingElements = []), 9430 (this.elements = createSizedArray(this.layers.length)), 9431 this.initElement(t, e, r), 9432 (this.tm = t.tm 9433 ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) 9434 : { _placeholder: !0 }); 9435 } 9436 function CanvasRenderer(t, e) { 9437 (this.animationItem = t), 9438 (this.renderConfig = { 9439 clearCanvas: !e || void 0 === e.clearCanvas || e.clearCanvas, 9440 context: (e && e.context) || null, 9441 progressiveLoad: (e && e.progressiveLoad) || !1, 9442 preserveAspectRatio: (e && e.preserveAspectRatio) || "xMidYMid meet", 9443 imagePreserveAspectRatio: 9444 (e && e.imagePreserveAspectRatio) || "xMidYMid slice", 9445 contentVisibility: (e && e.contentVisibility) || "visible", 9446 className: (e && e.className) || "", 9447 id: (e && e.id) || "", 9448 runExpressions: !e || void 0 === e.runExpressions || e.runExpressions, 9449 }), 9450 (this.renderConfig.dpr = (e && e.dpr) || 1), 9451 this.animationItem.wrapper && 9452 (this.renderConfig.dpr = 9453 (e && e.dpr) || window.devicePixelRatio || 1), 9454 (this.renderedFrame = -1), 9455 (this.globalData = { 9456 frameNum: -1, 9457 _mdf: !1, 9458 renderConfig: this.renderConfig, 9459 currentGlobalAlpha: -1, 9460 }), 9461 (this.contextData = new CVContextData()), 9462 (this.elements = []), 9463 (this.pendingElements = []), 9464 (this.transformMat = new Matrix()), 9465 (this.completeLayers = !1), 9466 (this.rendererType = "canvas"); 9467 } 9468 function HBaseElement() {} 9469 function HSolidElement(t, e, r) { 9470 this.initElement(t, e, r); 9471 } 9472 function HShapeElement(t, e, r) { 9473 (this.shapes = []), 9474 (this.shapesData = t.shapes), 9475 (this.stylesList = []), 9476 (this.shapeModifiers = []), 9477 (this.itemsData = []), 9478 (this.processedElements = []), 9479 (this.animatedContents = []), 9480 (this.shapesContainer = createNS("g")), 9481 this.initElement(t, e, r), 9482 (this.prevViewData = []), 9483 (this.currentBBox = { x: 999999, y: -999999, h: 0, w: 0 }); 9484 } 9485 function HTextElement(t, e, r) { 9486 (this.textSpans = []), 9487 (this.textPaths = []), 9488 (this.currentBBox = { x: 999999, y: -999999, h: 0, w: 0 }), 9489 (this.renderType = "svg"), 9490 (this.isMasked = !1), 9491 this.initElement(t, e, r); 9492 } 9493 function HCameraElement(t, e, r) { 9494 this.initFrame(), this.initBaseData(t, e, r), this.initHierarchy(); 9495 var i = PropertyFactory.getProp; 9496 if ( 9497 ((this.pe = i(this, t.pe, 0, 0, this)), 9498 t.ks.p.s 9499 ? ((this.px = i(this, t.ks.p.x, 1, 0, this)), 9500 (this.py = i(this, t.ks.p.y, 1, 0, this)), 9501 (this.pz = i(this, t.ks.p.z, 1, 0, this))) 9502 : (this.p = i(this, t.ks.p, 1, 0, this)), 9503 t.ks.a && (this.a = i(this, t.ks.a, 1, 0, this)), 9504 t.ks.or.k.length && t.ks.or.k[0].to) 9505 ) { 9506 var s, 9507 a = t.ks.or.k.length; 9508 for (s = 0; s < a; s += 1) 9509 (t.ks.or.k[s].to = null), (t.ks.or.k[s].ti = null); 9510 } 9511 (this.or = i(this, t.ks.or, 1, degToRads, this)), 9512 (this.or.sh = !0), 9513 (this.rx = i(this, t.ks.rx, 0, degToRads, this)), 9514 (this.ry = i(this, t.ks.ry, 0, degToRads, this)), 9515 (this.rz = i(this, t.ks.rz, 0, degToRads, this)), 9516 (this.mat = new Matrix()), 9517 (this._prevMat = new Matrix()), 9518 (this._isFirstFrame = !0), 9519 (this.finalTransform = { mProp: this }); 9520 } 9521 function HImageElement(t, e, r) { 9522 (this.assetData = e.getAssetData(t.refId)), this.initElement(t, e, r); 9523 } 9524 function HybridRendererBase(t, e) { 9525 (this.animationItem = t), 9526 (this.layers = null), 9527 (this.renderedFrame = -1), 9528 (this.renderConfig = { 9529 className: (e && e.className) || "", 9530 imagePreserveAspectRatio: 9531 (e && e.imagePreserveAspectRatio) || "xMidYMid slice", 9532 hideOnTransparent: !(e && !1 === e.hideOnTransparent), 9533 filterSize: { 9534 width: (e && e.filterSize && e.filterSize.width) || "400%", 9535 height: (e && e.filterSize && e.filterSize.height) || "400%", 9536 x: (e && e.filterSize && e.filterSize.x) || "-100%", 9537 y: (e && e.filterSize && e.filterSize.y) || "-100%", 9538 }, 9539 }), 9540 (this.globalData = { 9541 _mdf: !1, 9542 frameNum: -1, 9543 renderConfig: this.renderConfig, 9544 }), 9545 (this.pendingElements = []), 9546 (this.elements = []), 9547 (this.threeDElements = []), 9548 (this.destroyed = !1), 9549 (this.camera = null), 9550 (this.supports3d = !0), 9551 (this.rendererType = "html"); 9552 } 9553 function HCompElement(t, e, r) {
9554 (this.layers = t.layers), 9555 (this.supports3d = !t.hasMask), 9556 (this.completeLayers = !1), 9557 (this.pendingElements = []), 9558 (this.elements = this.layers 9559 ? createSizedArray(this.layers.length) 9560 : []), 9561 this.initElement(t, e, r), 9562 (this.tm = t.tm 9563 ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) 9564 : { _placeholder: !0 }); 9565 } 9566 function HybridRenderer(t, e) { 9567 (this.animationItem = t), 9568 (this.layers = null), 9569 (this.renderedFrame = -1), 9570 (this.renderConfig = { 9571 className: (e && e.className) || "", 9572 imagePreserveAspectRatio: 9573 (e && e.imagePreserveAspectRatio) || "xMidYMid slice", 9574 hideOnTransparent: !(e && !1 === e.hideOnTransparent), 9575 filterSize: { 9576 width: (e && e.filterSize && e.filterSize.width) || "400%", 9577 height: (e && e.filterSize && e.filterSize.height) || "400%", 9578 x: (e && e.filterSize && e.filterSize.x) || "-100%", 9579 y: (e && e.filterSize && e.filterSize.y) || "-100%", 9580 }, 9581 runExpressions: !e || void 0 === e.runExpressions || e.runExpressions, 9582 }), 9583 (this.globalData = { 9584 _mdf: !1, 9585 frameNum: -1, 9586 renderConfig: this.renderConfig, 9587 }), 9588 (this.pendingElements = []), 9589 (this.elements = []), 9590 (this.threeDElements = []), 9591 (this.destroyed = !1), 9592 (this.camera = null), 9593 (this.supports3d = !0), 9594 (this.rendererType = "html"); 9595 } 9596 extendPrototype( 9597 [ 9598 BaseElement, 9599 TransformElement, 9600 SVGBaseElement, 9601 HierarchyElement, 9602 FrameElement, 9603 RenderableDOMElement, 9604 ITextElement, 9605 ], 9606 SVGTextLottieElement 9607 ), 9608 (SVGTextLottieElement.prototype.createContent = function () { 9609 this.data.singleShape && 9610 !this.globalData.fontManager.chars && 9611 (this.textContainer = createNS("text")); 9612 }), 9613 (SVGTextLottieElement.prototype.buildTextContents = function (t) { 9614 for (var e = 0, r = t.length, i = [], s = ""; e < r; ) 9615 t[e] === String.fromCharCode(13) || t[e] === String.fromCharCode(3) 9616 ? (i.push(s), (s = "")) 9617 : (s += t[e]), 9618 (e += 1); 9619 return i.push(s), i; 9620 }), 9621 (SVGTextLottieElement.prototype.buildShapeData = function (t, e) { 9622 if (t.shapes && t.shapes.length) { 9623 var r = t.shapes[0]; 9624 if (r.it) { 9625 var i = r.it[r.it.length - 1]; 9626 i.s && ((i.s.k[0] = e), (i.s.k[1] = e)); 9627 } 9628 } 9629 return t; 9630 }), 9631 (SVGTextLottieElement.prototype.buildNewText = function () { 9632 var t, e; 9633 this.addDynamicProperty(this); 9634 var r = this.textProperty.currentData; 9635 (this.renderedLetters = createSizedArray(r ? r.l.length : 0)), 9636 r.fc 9637 ? this.layerElement.setAttribute("fill", this.buildColor(r.fc)) 9638 : this.layerElement.setAttribute("fill", "rgba(0,0,0,0)"), 9639 r.sc && 9640 (this.layerElement.setAttribute("stroke", this.buildColor(r.sc)), 9641 this.layerElement.setAttribute("stroke-width", r.sw)), 9642 this.layerElement.setAttribute("font-size", r.finalSize); 9643 var i = this.globalData.fontManager.getFontByName(r.f); 9644 if (i.fClass) this.layerElement.setAttribute("class", i.fClass); 9645 else { 9646 this.layerElement.setAttribute("font-family", i.fFamily); 9647 var s = r.fWeight, 9648 a = r.fStyle; 9649 this.layerElement.setAttribute("font-style", a), 9650 this.layerElement.setAttribute("font-weight", s); 9651 } 9652 this.layerElement.setAttribute("aria-label", r.t); 9653 var n, 9654 o = r.l || [], 9655 h = !!this.globalData.fontManager.chars; 9656 e = o.length; 9657 var l = this.mHelper, 9658 p = this.data.singleShape, 9659 f = 0, 9660 m = 0, 9661 c = !0, 9662 d = 0.001 * r.tr * r.finalSize; 9663 if (!p || h || r.sz) { 9664 var u, 9665 y = this.textSpans.length; 9666 for (t = 0; t < e; t += 1) { 9667 if ( 9668 (this.textSpans[t] || 9669 (this.textSpans[t] = { 9670 span: null, 9671 childSpan: null, 9672 glyph: null, 9673 }), 9674 !h || !p || 0 === t) 9675 ) { 9676 if ( 9677 ((n = 9678 y > t ? this.textSpans[t].span : createNS(h ? "g" : "text")), 9679 y <= t) 9680 ) { 9681 if ( 9682 (n.setAttribute("stroke-linecap", "butt"), 9683 n.setAttribute("stroke-linejoin", "round"), 9684 n.setAttribute("stroke-miterlimit", "4"), 9685 (this.textSpans[t].span = n), 9686 h) 9687 ) { 9688 var g = createNS("g"); 9689 n.appendChild(g), (this.textSpans[t].childSpan = g); 9690 } 9691 (this.textSpans[t].span = n), this.layerElement.appendChild(n); 9692 } 9693 n.style.display = "inherit"; 9694 } 9695 if ( 9696 (l.reset(), 9697 p && 9698 (o[t].n && 9699 ((f = -d), (m += r.yOffset), (m += c ? 1 : 0), (c = !1)), 9700 this.applyTextPropertiesToMatrix(r, l, o[t].line, f, m),
9701 (f += o[t].l || 0), 9702 (f += d)), 9703 h) 9704 ) { 9705 var v; 9706 if ( 9707 1 === 9708 (u = this.globalData.fontManager.getCharData( 9709 r.finalText[t], 9710 i.fStyle, 9711 this.globalData.fontManager.getFontByName(r.f).fFamily 9712 )).t 9713 ) 9714 v = new SVGCompElement(u.data, this.globalData, this); 9715 else { 9716 var b = emptyShapeData; 9717 u.data && 9718 u.data.shapes && 9719 (b = this.buildShapeData(u.data, r.finalSize)), 9720 (v = new SVGShapeElement(b, this.globalData, this)); 9721 } 9722 if (this.textSpans[t].glyph) { 9723 var P = this.textSpans[t].glyph; 9724 this.textSpans[t].childSpan.removeChild(P.layerElement), 9725 P.destroy(); 9726 } 9727 (this.textSpans[t].glyph = v), 9728 (v._debug = !0), 9729 v.prepareFrame(0), 9730 v.renderFrame(), 9731 this.textSpans[t].childSpan.appendChild(v.layerElement), 9732 1 === u.t && 9733 this.textSpans[t].childSpan.setAttribute( 9734 "transform", 9735 "scale(" + r.finalSize / 100 + "," + r.finalSize / 100 + ")" 9736 ); 9737 } else 9738 p && 9739 n.setAttribute( 9740 "transform", 9741 "translate(" + l.props[12] + "," + l.props[13] + ")" 9742 ), 9743 (n.textContent = o[t].val), 9744 n.setAttributeNS( 9745 "http://www.w3.org/XML/1998/namespace", 9746 "xml:space", 9747 "preserve" 9748 ); 9749 } 9750 p && n && n.setAttribute("d", ""); 9751 } else { 9752 var x = this.textContainer, 9753 E = "start"; 9754 switch (r.j) { 9755 case 1: 9756 E = "end"; 9757 break; 9758 case 2: 9759 E = "middle"; 9760 break; 9761 default: 9762 E = "start"; 9763 } 9764 x.setAttribute("text-anchor", E), x.setAttribute("letter-spacing", d); 9765 var S = this.buildTextContents(r.finalText); 9766 for ( 9767 e = S.length, m = r.ps ? r.ps[1] + r.ascent : 0, t = 0; 9768 t < e; 9769 t += 1 9770 ) 9771 ((n = this.textSpans[t].span || createNS("tspan")).textContent = 9772 S[t]), 9773 n.setAttribute("x", 0), 9774 n.setAttribute("y", m), 9775 (n.style.display = "inherit"), 9776 x.appendChild(n), 9777 this.textSpans[t] || 9778 (this.textSpans[t] = { span: null, glyph: null }), 9779 (this.textSpans[t].span = n), 9780 (m += r.finalLineHeight); 9781 this.layerElement.appendChild(x); 9782 } 9783 for (; t < this.textSpans.length; ) 9784 (this.textSpans[t].span.style.display = "none"), (t += 1); 9785 this._sizeChanged = !0; 9786 }), 9787 (SVGTextLottieElement.prototype.sourceRectAtTime = function () { 9788 if ( 9789 (this.prepareFrame(this.comp.renderedFrame - this.data.st), 9790 this.renderInnerContent(), 9791 this._sizeChanged) 9792 ) { 9793 this._sizeChanged = !1; 9794 var t = this.layerElement.getBBox(); 9795 this.bbox = { top: t.y, left: t.x, width: t.width, height: t.height }; 9796 } 9797 return this.bbox; 9798 }), 9799 (SVGTextLottieElement.prototype.getValue = function () { 9800 var t, 9801 e, 9802 r = this.textSpans.length; 9803 for (this.renderedFrame = this.comp.renderedFrame, t = 0; t < r; t += 1) 9804 (e = this.textSpans[t].glyph) && 9805 (e.prepareFrame(this.comp.renderedFrame - this.data.st), 9806 e._mdf && (this._mdf = !0)); 9807 }), 9808 (SVGTextLottieElement.prototype.renderInnerContent = function () { 9809 if ( 9810 (!this.data.singleShape || this._mdf) && 9811 (this.textAnimator.getMeasures( 9812 this.textProperty.currentData, 9813 this.lettersChangedFlag 9814 ), 9815 this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) 9816 ) { 9817 var t, e; 9818 this._sizeChanged = !0; 9819 var r, 9820 i, 9821 s, 9822 a = this.textAnimator.renderedLetters, 9823 n = this.textProperty.currentData.l; 9824 for (e = n.length, t = 0; t < e; t += 1) 9825 n[t].n || 9826 ((r = a[t]), 9827 (i = this.textSpans[t].span), 9828 (s = this.textSpans[t].glyph) && s.renderFrame(), 9829 r._mdf.m && i.setAttribute("transform", r.m),
9830 r._mdf.o && i.setAttribute("opacity", r.o), 9831 r._mdf.sw && i.setAttribute("stroke-width", r.sw), 9832 r._mdf.sc && i.setAttribute("stroke", r.sc), 9833 r._mdf.fc && i.setAttribute("fill", r.fc)); 9834 } 9835 }), 9836 extendPrototype([IImageElement], ISolidElement), 9837 (ISolidElement.prototype.createContent = function () { 9838 var t = createNS("rect"); 9839 t.setAttribute("width", this.data.sw), 9840 t.setAttribute("height", this.data.sh), 9841 t.setAttribute("fill", this.data.sc), 9842 this.layerElement.appendChild(t); 9843 }), 9844 (NullElement.prototype.prepareFrame = function (t) { 9845 this.prepareProperties(t, !0); 9846 }), 9847 (NullElement.prototype.renderFrame = function () {}), 9848 (NullElement.prototype.getBaseElement = function () { 9849 return null; 9850 }), 9851 (NullElement.prototype.destroy = function () {}), 9852 (NullElement.prototype.sourceRectAtTime = function () {}), 9853 (NullElement.prototype.hide = function () {}), 9854 extendPrototype( 9855 [BaseElement, TransformElement, HierarchyElement, FrameElement], 9856 NullElement 9857 ), 9858 extendPrototype([BaseRenderer], SVGRendererBase), 9859 (SVGRendererBase.prototype.createNull = function (t) { 9860 return new NullElement(t, this.globalData, this); 9861 }), 9862 (SVGRendererBase.prototype.createShape = function (t) { 9863 return new SVGShapeElement(t, this.globalData, this); 9864 }), 9865 (SVGRendererBase.prototype.createText = function (t) { 9866 return new SVGTextLottieElement(t, this.globalData, this); 9867 }), 9868 (SVGRendererBase.prototype.createImage = function (t) { 9869 return new IImageElement(t, this.globalData, this); 9870 }), 9871 (SVGRendererBase.prototype.createSolid = function (t) { 9872 return new ISolidElement(t, this.globalData, this); 9873 }), 9874 (SVGRendererBase.prototype.configAnimation = function (t) { 9875 this.svgElement.setAttribute("xmlns", "http://www.w3.org/2000/svg"), 9876 this.svgElement.setAttribute( 9877 "xmlns:xlink", 9878 "http://www.w3.org/1999/xlink" 9879 ), 9880 this.renderConfig.viewBoxSize 9881 ? this.svgElement.setAttribute( 9882 "viewBox", 9883 this.renderConfig.viewBoxSize 9884 ) 9885 : this.svgElement.setAttribute("viewBox", "0 0 " + t.w + " " + t.h), 9886 this.renderConfig.viewBoxOnly || 9887 (this.svgElement.setAttribute("width", t.w), 9888 this.svgElement.setAttribute("height", t.h), 9889 (this.svgElement.style.width = "100%"), 9890 (this.svgElement.style.height = "100%"), 9891 (this.svgElement.style.transform = "translate3d(0,0,0)"), 9892 (this.svgElement.style.contentVisibility = 9893 this.renderConfig.contentVisibility)), 9894 this.renderConfig.width && 9895 this.svgElement.setAttribute("width", this.renderConfig.width), 9896 this.renderConfig.height && 9897 this.svgElement.setAttribute("height", this.renderConfig.height), 9898 this.renderConfig.className && 9899 this.svgElement.setAttribute("class", this.renderConfig.className), 9900 this.renderConfig.id && 9901 this.svgElement.setAttribute("id", this.renderConfig.id), 9902 void 0 !== this.renderConfig.focusable && 9903 this.svgElement.setAttribute( 9904 "focusable", 9905 this.renderConfig.focusable 9906 ), 9907 this.svgElement.setAttribute( 9908 "preserveAspectRatio", 9909 this.renderConfig.preserveAspectRatio 9910 ), 9911 this.animationItem.wrapper.appendChild(this.svgElement); 9912 var e = this.globalData.defs; 9913 this.setupGlobalData(t, e), 9914 (this.globalData.progressiveLoad = this.renderConfig.progressiveLoad), 9915 (this.data = t); 9916 var r = createNS("clipPath"), 9917 i = createNS("rect"); 9918 i.setAttribute("width", t.w), 9919 i.setAttribute("height", t.h), 9920 i.setAttribute("x", 0), 9921 i.setAttribute("y", 0); 9922 var s = createElementID();
9923 r.setAttribute("id", s), 9924 r.appendChild(i), 9925 this.layerElement.setAttribute( 9926 "clip-path", 9927 "url(" + getLocationHref() + "#" + s + ")" 9928 ), 9929 e.appendChild(r), 9930 (this.layers = t.layers), 9931 (this.elements = createSizedArray(t.layers.length)); 9932 }), 9933 (SVGRendererBase.prototype.destroy = function () { 9934 var t; 9935 this.animationItem.wrapper && 9936 (this.animationItem.wrapper.innerText = ""), 9937 (this.layerElement = null), 9938 (this.globalData.defs = null); 9939 var e = this.layers ? this.layers.length : 0; 9940 for (t = 0; t < e; t += 1) 9941 this.elements[t] && this.elements[t].destroy(); 9942 (this.elements.length = 0), 9943 (this.destroyed = !0), 9944 (this.animationItem = null); 9945 }), 9946 (SVGRendererBase.prototype.updateContainerSize = function () {}), 9947 (SVGRendererBase.prototype.findIndexByInd = function (t) { 9948 var e = 0, 9949 r = this.layers.length; 9950 for (e = 0; e < r; e += 1) if (this.layers[e].ind === t) return e; 9951 return -1; 9952 }), 9953 (SVGRendererBase.prototype.buildItem = function (t) { 9954 var e = this.elements; 9955 if (!e[t] && 99 !== this.layers[t].ty) { 9956 e[t] = !0; 9957 var r = this.createItem(this.layers[t]); 9958 if ( 9959 ((e[t] = r), 9960 getExpressionsPlugin() && 9961 (0 === this.layers[t].ty && 9962 this.globalData.projectInterface.registerComposition(r), 9963 r.initExpressions()), 9964 this.appendElementInPos(r, t), 9965 this.layers[t].tt) 9966 ) { 9967 var i = 9968 "tp" in this.layers[t] 9969 ? this.findIndexByInd(this.layers[t].tp) 9970 : t - 1; 9971 if (-1 === i) return; 9972 if (this.elements[i] && !0 !== this.elements[i]) { 9973 var s = e[i].getMatte(this.layers[t].tt); 9974 r.setMatte(s); 9975 } else this.buildItem(i), this.addPendingElement(r); 9976 } 9977 } 9978 }), 9979 (SVGRendererBase.prototype.checkPendingElements = function () { 9980 for (; this.pendingElements.length; ) { 9981 var t = this.pendingElements.pop(); 9982 if ((t.checkParenting(), t.data.tt)) 9983 for (var e = 0, r = this.elements.length; e < r; ) { 9984 if (this.elements[e] === t) { 9985 var i = "tp" in t.data ? this.findIndexByInd(t.data.tp) : e - 1, 9986 s = this.elements[i].getMatte(this.layers[e].tt); 9987 t.setMatte(s); 9988 break; 9989 } 9990 e += 1; 9991 } 9992 } 9993 }), 9994 (SVGRendererBase.prototype.renderFrame = function (t) { 9995 if (this.renderedFrame !== t && !this.destroyed) { 9996 var e; 9997 null === t ? (t = this.renderedFrame) : (this.renderedFrame = t), 9998 (this.globalData.frameNum = t), 9999 (this.globalData.frameId += 1), 10000 (this.globalData.projectInterface.currentFrame = t), 10001 (this.globalData._mdf = !1);
10002 var r = this.layers.length; 10003 for ( 10004 this.completeLayers || this.checkLayers(t), e = r - 1; 10005 e >= 0; 10006 e -= 1 10007 ) 10008 (this.completeLayers || this.elements[e]) && 10009 this.elements[e].prepareFrame(t - this.layers[e].st); 10010 if (this.globalData._mdf) 10011 for (e = 0; e < r; e += 1) 10012 (this.completeLayers || this.elements[e]) && 10013 this.elements[e].renderFrame(); 10014 } 10015 }), 10016 (SVGRendererBase.prototype.appendElementInPos = function (t, e) { 10017 var r = t.getBaseElement(); 10018 if (r) { 10019 for (var i, s = 0; s < e; ) 10020 this.elements[s] && 10021 !0 !== this.elements[s] && 10022 this.elements[s].getBaseElement() && 10023 (i = this.elements[s].getBaseElement()), 10024 (s += 1); 10025 i 10026 ? this.layerElement.insertBefore(r, i) 10027 : this.layerElement.appendChild(r); 10028 } 10029 }), 10030 (SVGRendererBase.prototype.hide = function () { 10031 this.layerElement.style.display = "none"; 10032 }), 10033 (SVGRendererBase.prototype.show = function () { 10034 this.layerElement.style.display = "block"; 10035 }), 10036 extendPrototype( 10037 [ 10038 BaseElement, 10039 TransformElement, 10040 HierarchyElement, 10041 FrameElement, 10042 RenderableDOMElement, 10043 ], 10044 ICompElement 10045 ), 10046 (ICompElement.prototype.initElement = function (t, e, r) { 10047 this.initFrame(), 10048 this.initBaseData(t, e, r), 10049 this.initTransform(t, e, r), 10050 this.initRenderable(), 10051 this.initHierarchy(), 10052 this.initRendererElement(), 10053 this.createContainerElements(), 10054 this.createRenderableComponents(), 10055 (!this.data.xt && e.progressiveLoad) || this.buildAllItems(), 10056 this.hide(); 10057 }), 10058 (ICompElement.prototype.prepareFrame = function (t) { 10059 if ( 10060 ((this._mdf = !1), 10061 this.prepareRenderableFrame(t), 10062 this.prepareProperties(t, this.isInRange), 10063 this.isInRange || this.data.xt) 10064 ) { 10065 if (this.tm._placeholder) this.renderedFrame = t / this.data.sr; 10066 else { 10067 var e = this.tm.v; 10068 e === this.data.op && (e = this.data.op - 1), 10069 (this.renderedFrame = e); 10070 } 10071 var r, 10072 i = this.elements.length; 10073 for ( 10074 this.completeLayers || this.checkLayers(this.renderedFrame), 10075 r = i - 1; 10076 r >= 0; 10077 r -= 1 10078 ) 10079 (this.completeLayers || this.elements[r]) && 10080 (this.elements[r].prepareFrame( 10081 this.renderedFrame - this.layers[r].st 10082 ), 10083 this.elements[r]._mdf && (this._mdf = !0)); 10084 } 10085 }), 10086 (ICompElement.prototype.renderInnerContent = function () { 10087 var t, 10088 e = this.layers.length; 10089 for (t = 0; t < e; t += 1) 10090 (this.completeLayers || this.elements[t]) && 10091 this.elements[t].renderFrame(); 10092 }), 10093 (ICompElement.prototype.setElements = function (t) { 10094 this.elements = t; 10095 }), 10096 (ICompElement.prototype.getElements = function () { 10097 return this.elements; 10098 }), 10099 (ICompElement.prototype.destroyElements = function () { 10100 var t, 10101 e = this.layers.length; 10102 for (t = 0; t < e; t += 1) 10103 this.elements[t] && this.elements[t].destroy(); 10104 }), 10105 (ICompElement.prototype.destroy = function () { 10106 this.destroyElements(), this.destroyBaseElement(); 10107 }), 10108 extendPrototype( 10109 [SVGRendererBase, ICompElement, SVGBaseElement], 10110 SVGCompElement 10111 ), 10112 (SVGCompElement.prototype.createComp = function (t) { 10113 return new SVGCompElement(t, this.globalData, this); 10114 }), 10115 extendPrototype([SVGRendererBase], SVGRenderer), 10116 (SVGRenderer.prototype.createComp = function (t) { 10117 return new SVGCompElement(t, this.globalData, this); 10118 }), 10119 (CVContextData.prototype.duplicate = function () { 10120 var t = 2 * this._length, 10121 e = this.savedOp; 10122 (this.savedOp = createTypedArray("float32", t)), this.savedOp.set(e); 10123 var r = 0; 10124 for (r = this._length; r < t; r += 1) 10125 this.saved[r] = createTypedArray("float32", 16); 10126 this._length = t; 10127 }), 10128 (CVContextData.prototype.reset = function () { 10129 (this.cArrPos = 0), this.cTr.reset(), (this.cO = 1); 10130 }), 10131 (ShapeTransformManager.prototype = { 10132 addTransformSequence: function (t) { 10133 var e, 10134 r = t.length, 10135 i = "_"; 10136 for (e = 0; e < r; e += 1) i += t[e].transform.key + "_"; 10137 var s = this.sequences[i]; 10138 return ( 10139 s || 10140 ((s = { 10141 transforms: [].concat(t), 10142 finalTransform: new Matrix(), 10143 _mdf: !1, 10144 }), 10145 (this.sequences[i] = s), 10146 this.sequenceList.push(s)), 10147 s 10148 ); 10149 }, 10150 processSequence: function (t, e) { 10151 for (var r, i = 0, s = t.transforms.length, a = e; i < s && !e; ) { 10152 if (t.transforms[i].transform.mProps._mdf) { 10153 a = !0; 10154 break; 10155 } 10156 i += 1; 10157 } 10158 if (a) 10159 for (t.finalTransform.reset(), i = s - 1; i >= 0; i -= 1) 10160 (r = t.transforms[i].transform.mProps.v.props), 10161 t.finalTransform.transform( 10162 r[0], 10163 r[1], 10164 r[2], 10165 r[3], 10166 r[4], 10167 r[5], 10168 r[6], 10169 r[7], 10170 r[8], 10171 r[9], 10172 r[10], 10173 r[11], 10174 r[12], 10175 r[13], 10176 r[14], 10177 r[15] 10178 ); 10179 t._mdf = a; 10180 }, 10181 processSequences: function (t) { 10182 var e, 10183 r = this.sequenceList.length; 10184 for (e = 0; e < r; e += 1) 10185 this.processSequence(this.sequenceList[e], t); 10186 }, 10187 getNewKey: function () { 10188 return ( 10189 (this.transform_key_count += 1), "_" + this.transform_key_count 10190 ); 10191 }, 10192 }), 10193 (CVEffects.prototype.renderFrame = function () {}), 10194 (CVMaskElement.prototype.renderFrame = function () { 10195 if (this.hasMasks) { 10196 var t, 10197 e, 10198 r, 10199 i, 10200 s = this.element.finalTransform.mat, 10201 a = this.element.canvasContext, 10202 n = this.masksProperties.length; 10203 for (a.beginPath(), t = 0; t < n; t += 1) 10204 if ("n" !== this.masksProperties[t].mode) { 10205 var o; 10206 this.masksProperties[t].inv && 10207 (a.moveTo(0, 0), 10208 a.lineTo(this.element.globalData.compSize.w, 0), 10209 a.lineTo( 10210 this.element.globalData.compSize.w, 10211 this.element.globalData.compSize.h 10212 ), 10213 a.lineTo(0, this.element.globalData.compSize.h), 10214 a.lineTo(0, 0)), 10215 (i = this.viewData[t].v), 10216 (e = s.applyToPointArray(i.v[0][0], i.v[0][1], 0)), 10217 a.moveTo(e[0], e[1]); 10218 var h = i._length; 10219 for (o = 1; o < h; o += 1) 10220 (r = s.applyToTriplePoints(i.o[o - 1], i.i[o], i.v[o])), 10221 a.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5]); 10222 (r = s.applyToTriplePoints(i.o[o - 1], i.i[0], i.v[0])), 10223 a.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5]); 10224 } 10225 this.element.globalData.renderer.save(!0), a.clip(); 10226 } 10227 }), 10228 (CVMaskElement.prototype.getMaskProperty = 10229 MaskElement.prototype.getMaskProperty), 10230 (CVMaskElement.prototype.destroy = function () { 10231 this.element = null; 10232 }), 10233 (CVBaseElement.prototype = { 10234 createElements: function () {}, 10235 initRendererElement: function () {}, 10236 createContainerElements: function () { 10237 (this.canvasContext = this.globalData.canvasContext),
10238 (this.renderableEffectsManager = new CVEffects(this)); 10239 }, 10240 createContent: function () {}, 10241 setBlendMode: function () { 10242 var t = this.globalData; 10243 if (t.blendMode !== this.data.bm) { 10244 t.blendMode = this.data.bm; 10245 var e = getBlendMode(this.data.bm); 10246 t.canvasContext.globalCompositeOperation = e; 10247 } 10248 }, 10249 createRenderableComponents: function () { 10250 this.maskManager = new CVMaskElement(this.data, this); 10251 }, 10252 hideElement: function () { 10253 this.hidden || 10254 (this.isInRange && !this.isTransparent) || 10255 (this.hidden = !0); 10256 }, 10257 showElement: function () { 10258 this.isInRange && 10259 !this.isTransparent && 10260 ((this.hidden = !1), 10261 (this._isFirstFrame = !0), 10262 (this.maskManager._isFirstFrame = !0)); 10263 }, 10264 renderFrame: function () { 10265 if (!this.hidden && !this.data.hd) { 10266 this.renderTransform(), 10267 this.renderRenderable(), 10268 this.setBlendMode(); 10269 var t = 0 === this.data.ty; 10270 this.globalData.renderer.save(t), 10271 this.globalData.renderer.ctxTransform( 10272 this.finalTransform.mat.props 10273 ), 10274 this.globalData.renderer.ctxOpacity( 10275 this.finalTransform.mProp.o.v 10276 ), 10277 this.renderInnerContent(), 10278 this.globalData.renderer.restore(t), 10279 this.maskManager.hasMasks && this.globalData.renderer.restore(!0), 10280 this._isFirstFrame && (this._isFirstFrame = !1); 10281 } 10282 }, 10283 destroy: function () { 10284 (this.canvasContext = null), 10285 (this.data = null), 10286 (this.globalData = null), 10287 this.maskManager.destroy(); 10288 }, 10289 mHelper: new Matrix(), 10290 }), 10291 (CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement), 10292 (CVBaseElement.prototype.show = CVBaseElement.prototype.showElement), 10293 (CVShapeData.prototype.setAsAnimated = 10294 SVGShapeData.prototype.setAsAnimated), 10295 extendPrototype( 10296 [ 10297 BaseElement, 10298 TransformElement, 10299 CVBaseElement, 10300 IShapeElement, 10301 HierarchyElement, 10302 FrameElement, 10303 RenderableElement, 10304 ], 10305 CVShapeElement 10306 ), 10307 (CVShapeElement.prototype.initElement = 10308 RenderableDOMElement.prototype.initElement), 10309 (CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: !1 }), 10310 (CVShapeElement.prototype.dashResetter = []), 10311 (CVShapeElement.prototype.createContent = function () { 10312 this.searchShapes( 10313 this.shapesData, 10314 this.itemsData, 10315 this.prevViewData, 10316 !0, 10317 [] 10318 ); 10319 }), 10320 (CVShapeElement.prototype.createStyleElement = function (t, e) { 10321 var r = { 10322 data: t, 10323 type: t.ty, 10324 preTransforms: this.transformsManager.addTransformSequence(e), 10325 transforms: [], 10326 elements: [], 10327 closed: !0 === t.hd, 10328 }, 10329 i = {}; 10330 if ( 10331 ("fl" === t.ty || "st" === t.ty 10332 ? ((i.c = PropertyFactory.getProp(this, t.c, 1, 255, this)), 10333 i.c.k || 10334 (r.co = 10335 "rgb(" + 10336 bmFloor(i.c.v[0]) + 10337 "," + 10338 bmFloor(i.c.v[1]) + 10339 "," + 10340 bmFloor(i.c.v[2]) + 10341 ")")) 10342 : ("gf" !== t.ty && "gs" !== t.ty) || 10343 ((i.s = PropertyFactory.getProp(this, t.s, 1, null, this)), 10344 (i.e = PropertyFactory.getProp(this, t.e, 1, null, this)), 10345 (i.h = PropertyFactory.getProp( 10346 this, 10347 t.h || { k: 0 }, 10348 0, 10349 0.01, 10350 this 10351 )), 10352 (i.a = PropertyFactory.getProp( 10353 this, 10354 t.a || { k: 0 }, 10355 0, 10356 degToRads, 10357 this 10358 )), 10359 (i.g = new GradientProperty(this, t.g, this))), 10360 (i.o = PropertyFactory.getProp(this, t.o, 0, 0.01, this)), 10361 "st" === t.ty || "gs" === t.ty) 10362 ) { 10363 if ( 10364 ((r.lc = lineCapEnum[t.lc || 2]), 10365 (r.lj = lineJoinEnum[t.lj || 2]), 10366 1 == t.lj && (r.ml = t.ml), 10367 (i.w = PropertyFactory.getProp(this, t.w, 0, null, this)), 10368 i.w.k || (r.wi = i.w.v), 10369 t.d) 10370 ) { 10371 var s = new DashProperty(this, t.d, "canvas", this); 10372 (i.d = s), 10373 i.d.k || ((r.da = i.d.dashArray), (r.do = i.d.dashoffset[0])); 10374 } 10375 } else r.r = 2 === t.r ? "evenodd" : "nonzero"; 10376 return this.stylesList.push(r), (i.style = r), i;
10377 }), 10378 (CVShapeElement.prototype.createGroupElement = function () { 10379 return { it: [], prevViewData: [] }; 10380 }), 10381 (CVShapeElement.prototype.createTransformElement = function (t) { 10382 return { 10383 transform: { 10384 opacity: 1, 10385 _opMdf: !1, 10386 key: this.transformsManager.getNewKey(), 10387 op: PropertyFactory.getProp(this, t.o, 0, 0.01, this), 10388 mProps: TransformPropertyFactory.getTransformProperty( 10389 this, 10390 t, 10391 this 10392 ), 10393 }, 10394 }; 10395 }), 10396 (CVShapeElement.prototype.createShapeElement = function (t) { 10397 var e = new CVShapeData( 10398 this, 10399 t, 10400 this.stylesList, 10401 this.transformsManager 10402 ); 10403 return this.shapes.push(e), this.addShapeToModifiers(e), e; 10404 }), 10405 (CVShapeElement.prototype.reloadShapes = function () { 10406 var t; 10407 this._isFirstFrame = !0; 10408 var e = this.itemsData.length; 10409 for (t = 0; t < e; t += 1) this.prevViewData[t] = this.itemsData[t]; 10410 for ( 10411 this.searchShapes( 10412 this.shapesData, 10413 this.itemsData, 10414 this.prevViewData, 10415 !0, 10416 [] 10417 ), 10418 e = this.dynamicProperties.length, 10419 t = 0; 10420 t < e; 10421 t += 1 10422 ) 10423 this.dynamicProperties[t].getValue(); 10424 this.renderModifiers(), 10425 this.transformsManager.processSequences(this._isFirstFrame); 10426 }), 10427 (CVShapeElement.prototype.addTransformToStyleList = function (t) { 10428 var e, 10429 r = this.stylesList.length; 10430 for (e = 0; e < r; e += 1) 10431 this.stylesList[e].closed || this.stylesList[e].transforms.push(t); 10432 }), 10433 (CVShapeElement.prototype.removeTransformFromStyleList = function () { 10434 var t, 10435 e = this.stylesList.length; 10436 for (t = 0; t < e; t += 1) 10437 this.stylesList[t].closed || this.stylesList[t].transforms.pop(); 10438 }), 10439 (CVShapeElement.prototype.closeStyles = function (t) { 10440 var e, 10441 r = t.length; 10442 for (e = 0; e < r; e += 1) t[e].closed = !0; 10443 }), 10444 (CVShapeElement.prototype.searchShapes = function (t, e, r, i, s) { 10445 var a, 10446 n, 10447 o, 10448 h, 10449 l, 10450 p, 10451 f = t.length - 1, 10452 m = [], 10453 c = [], 10454 d = [].concat(s); 10455 for (a = f; a >= 0; a -= 1) { 10456 if ( 10457 ((h = this.searchProcessedElement(t[a])) 10458 ? (e[a] = r[h - 1]) 10459 : (t[a]._shouldRender = i), 10460 "fl" === t[a].ty || 10461 "st" === t[a].ty || 10462 "gf" === t[a].ty || 10463 "gs" === t[a].ty) 10464 ) 10465 h 10466 ? (e[a].style.closed = !1) 10467 : (e[a] = this.createStyleElement(t[a], d)), 10468 m.push(e[a].style); 10469 else if ("gr" === t[a].ty) { 10470 if (h) 10471 for (o = e[a].it.length, n = 0; n < o; n += 1) 10472 e[a].prevViewData[n] = e[a].it[n]; 10473 else e[a] = this.createGroupElement(t[a]); 10474 this.searchShapes(t[a].it, e[a].it, e[a].prevViewData, i, d); 10475 } else 10476 "tr" === t[a].ty 10477 ? (h || ((p = this.createTransformElement(t[a])), (e[a] = p)), 10478 d.push(e[a]), 10479 this.addTransformToStyleList(e[a])) 10480 : "sh" === t[a].ty || 10481 "rc" === t[a].ty || 10482 "el" === t[a].ty || 10483 "sr" === t[a].ty 10484 ? h || (e[a] = this.createShapeElement(t[a])) 10485 : "tm" === t[a].ty || 10486 "rd" === t[a].ty || 10487 "pb" === t[a].ty || 10488 "zz" === t[a].ty || 10489 "op" === t[a].ty 10490 ? (h 10491 ? ((l = e[a]).closed = !1) 10492 : ((l = ShapeModifiers.getModifier(t[a].ty)).init(this, t[a]), 10493 (e[a] = l), 10494 this.shapeModifiers.push(l)), 10495 c.push(l)) 10496 : "rp" === t[a].ty && 10497 (h 10498 ? ((l = e[a]).closed = !0) 10499 : ((l = ShapeModifiers.getModifier(t[a].ty)), 10500 (e[a] = l), 10501 l.init(this, t, a, e), 10502 this.shapeModifiers.push(l), 10503 (i = !1)), 10504 c.push(l)); 10505 this.addProcessedElement(t[a], a + 1); 10506 } 10507 for ( 10508 this.removeTransformFromStyleList(), 10509 this.closeStyles(m), 10510 f = c.length, 10511 a = 0; 10512 a < f; 10513 a += 1 10514 ) 10515 c[a].closed = !0; 10516 }), 10517 (CVShapeElement.prototype.renderInnerContent = function () { 10518 (this.transformHelper.opacity = 1), 10519 (this.transformHelper._opMdf = !1), 10520 this.renderModifiers(), 10521 this.transformsManager.processSequences(this._isFirstFrame), 10522 this.renderShape( 10523 this.transformHelper, 10524 this.shapesData, 10525 this.itemsData, 10526 !0 10527 ); 10528 }), 10529 (CVShapeElement.prototype.renderShapeTransform = function (t, e) { 10530 (t._opMdf || e.op._mdf || this._isFirstFrame) && 10531 ((e.opacity = t.opacity), (e.opacity *= e.op.v), (e._opMdf = !0)); 10532 }), 10533 (CVShapeElement.prototype.drawLayer = function () { 10534 var t, 10535 e, 10536 r, 10537 i, 10538 s, 10539 a, 10540 n, 10541 o, 10542 h, 10543 l = this.stylesList.length, 10544 p = this.globalData.renderer, 10545 f = this.globalData.canvasContext; 10546 for (t = 0; t < l; t += 1) 10547 if ( 10548 (("st" !== (o = (h = this.stylesList[t]).type) && "gs" !== o) || 10549 0 !== h.wi) && 10550 h.data._shouldRender && 10551 0 !== h.coOp && 10552 0 !== this.globalData.currentGlobalAlpha 10553 ) { 10554 for ( 10555 p.save(), 10556 a = h.elements, 10557 "st" === o || "gs" === o 10558 ? ((f.strokeStyle = "st" === o ? h.co : h.grd), 10559 (f.lineWidth = h.wi), 10560 (f.lineCap = h.lc), 10561 (f.lineJoin = h.lj), 10562 (f.miterLimit = h.ml || 0)) 10563 : (f.fillStyle = "fl" === o ? h.co : h.grd), 10564 p.ctxOpacity(h.coOp), 10565 "st" !== o && "gs" !== o && f.beginPath(), 10566 p.ctxTransform(h.preTransforms.finalTransform.props), 10567 r = a.length, 10568 e = 0; 10569 e < r; 10570 e += 1 10571 ) { 10572 for ( 10573 ("st" !== o && "gs" !== o) || 10574 (f.beginPath(), 10575 h.da && (f.setLineDash(h.da), (f.lineDashOffset = h.do))), 10576 s = (n = a[e].trNodes).length, 10577 i = 0; 10578 i < s; 10579 i += 1 10580 ) 10581 "m" === n[i].t 10582 ? f.moveTo(n[i].p[0], n[i].p[1]) 10583 : "c" === n[i].t 10584 ? f.bezierCurveTo( 10585 n[i].pts[0], 10586 n[i].pts[1], 10587 n[i].pts[2], 10588 n[i].pts[3], 10589 n[i].pts[4], 10590 n[i].pts[5] 10591 ) 10592 : f.closePath(); 10593 ("st" !== o && "gs" !== o) || 10594 (f.stroke(), h.da && f.setLineDash(this.dashResetter)); 10595 }
10596 "st" !== o && "gs" !== o && f.fill(h.r), p.restore(); 10597 } 10598 }), 10599 (CVShapeElement.prototype.renderShape = function (t, e, r, i) { 10600 var s, a; 10601 for (a = t, s = e.length - 1; s >= 0; s -= 1) 10602 "tr" === e[s].ty 10603 ? ((a = r[s].transform), this.renderShapeTransform(t, a)) 10604 : "sh" === e[s].ty || 10605 "el" === e[s].ty || 10606 "rc" === e[s].ty || 10607 "sr" === e[s].ty 10608 ? this.renderPath(e[s], r[s]) 10609 : "fl" === e[s].ty 10610 ? this.renderFill(e[s], r[s], a) 10611 : "st" === e[s].ty 10612 ? this.renderStroke(e[s], r[s], a) 10613 : "gf" === e[s].ty || "gs" === e[s].ty 10614 ? this.renderGradientFill(e[s], r[s], a) 10615 : "gr" === e[s].ty 10616 ? this.renderShape(a, e[s].it, r[s].it) 10617 : e[s].ty; 10618 i && this.drawLayer(); 10619 }), 10620 (CVShapeElement.prototype.renderStyledShape = function (t, e) { 10621 if (this._isFirstFrame || e._mdf || t.transforms._mdf) { 10622 var r, 10623 i, 10624 s, 10625 a = t.trNodes, 10626 n = e.paths, 10627 o = n._length; 10628 a.length = 0; 10629 var h = t.transforms.finalTransform; 10630 for (s = 0; s < o; s += 1) { 10631 var l = n.shapes[s]; 10632 if (l && l.v) { 10633 for (i = l._length, r = 1; r < i; r += 1) 10634 1 === r && 10635 a.push({ 10636 t: "m", 10637 p: h.applyToPointArray(l.v[0][0], l.v[0][1], 0), 10638 }), 10639 a.push({ 10640 t: "c", 10641 pts: h.applyToTriplePoints(l.o[r - 1], l.i[r], l.v[r]), 10642 }); 10643 1 === i && 10644 a.push({ 10645 t: "m", 10646 p: h.applyToPointArray(l.v[0][0], l.v[0][1], 0), 10647 }), 10648 l.c && 10649 i && 10650 (a.push({ 10651 t: "c", 10652 pts: h.applyToTriplePoints(l.o[r - 1], l.i[0], l.v[0]), 10653 }), 10654 a.push({ t: "z" })); 10655 } 10656 } 10657 t.trNodes = a; 10658 } 10659 }), 10660 (CVShapeElement.prototype.renderPath = function (t, e) { 10661 if (!0 !== t.hd && t._shouldRender) { 10662 var r, 10663 i = e.styledShapes.length; 10664 for (r = 0; r < i; r += 1) 10665 this.renderStyledShape(e.styledShapes[r], e.sh); 10666 } 10667 }), 10668 (CVShapeElement.prototype.renderFill = function (t, e, r) { 10669 var i = e.style; 10670 (e.c._mdf || this._isFirstFrame) && 10671 (i.co = 10672 "rgb(" + 10673 bmFloor(e.c.v[0]) + 10674 "," + 10675 bmFloor(e.c.v[1]) + 10676 "," + 10677 bmFloor(e.c.v[2]) + 10678 ")"), 10679 (e.o._mdf || r._opMdf || this._isFirstFrame) && 10680 (i.coOp = e.o.v * r.opacity); 10681 }), 10682 (CVShapeElement.prototype.renderGradientFill = function (t, e, r) { 10683 var i, 10684 s = e.style; 10685 if ( 10686 !s.grd || 10687 e.g._mdf || 10688 e.s._mdf || 10689 e.e._mdf || 10690 (1 !== t.t && (e.h._mdf || e.a._mdf)) 10691 ) { 10692 var a, 10693 n = this.globalData.canvasContext, 10694 o = e.s.v, 10695 h = e.e.v; 10696 if (1 === t.t) i = n.createLinearGradient(o[0], o[1], h[0], h[1]); 10697 else { 10698 var l = Math.sqrt( 10699 Math.pow(o[0] - h[0], 2) + Math.pow(o[1] - h[1], 2) 10700 ), 10701 p = Math.atan2(h[1] - o[1], h[0] - o[0]), 10702 f = e.h.v; 10703 f >= 1 ? (f = 0.99) : f <= -1 && (f = -0.99); 10704 var m = l * f, 10705 c = Math.cos(p + e.a.v) * m + o[0], 10706 d = Math.sin(p + e.a.v) * m + o[1]; 10707 i = n.createRadialGradient(c, d, 0, o[0], o[1], l); 10708 } 10709 var u = t.g.p, 10710 y = e.g.c, 10711 g = 1; 10712 for (a = 0; a < u; a += 1) 10713 e.g._hasOpacity && e.g._collapsable && (g = e.g.o[2 * a + 1]), 10714 i.addColorStop( 10715 y[4 * a] / 100, 10716 "rgba(" + 10717 y[4 * a + 1] + 10718 "," + 10719 y[4 * a + 2] + 10720 "," + 10721 y[4 * a + 3] + 10722 "," + 10723 g + 10724 ")" 10725 ); 10726 s.grd = i; 10727 } 10728 s.coOp = e.o.v * r.opacity; 10729 }), 10730 (CVShapeElement.prototype.renderStroke = function (t, e, r) { 10731 var i = e.style, 10732 s = e.d; 10733 s && 10734 (s._mdf || this._isFirstFrame) && 10735 ((i.da = s.dashArray), (i.do = s.dashoffset[0])), 10736 (e.c._mdf || this._isFirstFrame) && 10737 (i.co = 10738 "rgb(" + 10739 bmFloor(e.c.v[0]) + 10740 "," + 10741 bmFloor(e.c.v[1]) + 10742 "," + 10743 bmFloor(e.c.v[2]) + 10744 ")"), 10745 (e.o._mdf || r._opMdf || this._isFirstFrame) && 10746 (i.coOp = e.o.v * r.opacity), 10747 (e.w._mdf || this._isFirstFrame) && (i.wi = e.w.v); 10748 }), 10749 (CVShapeElement.prototype.destroy = function () { 10750 (this.shapesData = null), 10751 (this.globalData = null), 10752 (this.canvasContext = null), 10753 (this.stylesList.length = 0), 10754 (this.itemsData.length = 0); 10755 }), 10756 extendPrototype( 10757 [ 10758 BaseElement, 10759 TransformElement, 10760 CVBaseElement, 10761 HierarchyElement, 10762 FrameElement, 10763 RenderableElement, 10764 ITextElement, 10765 ], 10766 CVTextElement 10767 ), 10768 (CVTextElement.prototype.tHelper = createTag("canvas").getContext("2d")), 10769 (CVTextElement.prototype.buildNewText = function () { 10770 var t = this.textProperty.currentData; 10771 this.renderedLetters = createSizedArray(t.l ? t.l.length : 0); 10772 var e = !1; 10773 t.fc 10774 ? ((e = !0), (this.values.fill = this.buildColor(t.fc))) 10775 : (this.values.fill = "rgba(0,0,0,0)"), 10776 (this.fill = e); 10777 var r = !1; 10778 t.sc && 10779 ((r = !0), 10780 (this.values.stroke = this.buildColor(t.sc)), 10781 (this.values.sWidth = t.sw)); 10782 var i, 10783 s, 10784 a, 10785 n, 10786 o, 10787 h, 10788 l, 10789 p, 10790 f, 10791 m, 10792 c, 10793 d, 10794 u = this.globalData.fontManager.getFontByName(t.f), 10795 y = t.l, 10796 g = this.mHelper; 10797 (this.stroke = r), 10798 (this.values.fValue = 10799 t.finalSize + 10800 "px " + 10801 this.globalData.fontManager.getFontByName(t.f).fFamily), 10802 (s = t.finalText.length); 10803 var v = this.data.singleShape, 10804 b = 0.001 * t.tr * t.finalSize, 10805 P = 0, 10806 x = 0, 10807 E = !0, 10808 S = 0; 10809 for (i = 0; i < s; i += 1) { 10810 (n = 10811 ((a = this.globalData.fontManager.getCharData( 10812 t.finalText[i], 10813 u.fStyle, 10814 this.globalData.fontManager.getFontByName(t.f).fFamily 10815 )) && 10816 a.data) || 10817 {}), 10818 g.reset(), 10819 v && 10820 y[i].n && 10821 ((P = -b), (x += t.yOffset), (x += E ? 1 : 0), (E = !1)), 10822 (f = (l = n.shapes ? n.shapes[0].it : []).length), 10823 g.scale(t.finalSize / 100, t.finalSize / 100), 10824 v && this.applyTextPropertiesToMatrix(t, g, y[i].line, P, x), 10825 (c = createSizedArray(f - 1)); 10826 var _ = 0; 10827 for (p = 0; p < f; p += 1) 10828 if ("sh" === l[p].ty) { 10829 for ( 10830 h = l[p].ks.k.i.length, m = l[p].ks.k, d = [], o = 1; 10831 o < h; 10832 o += 1 10833 ) 10834 1 === o && 10835 d.push( 10836 g.applyToX(m.v[0][0], m.v[0][1], 0), 10837 g.applyToY(m.v[0][0], m.v[0][1], 0) 10838 ), 10839 d.push( 10840 g.applyToX(m.o[o - 1][0], m.o[o - 1][1], 0), 10841 g.applyToY(m.o[o - 1][0], m.o[o - 1][1], 0), 10842 g.applyToX(m.i[o][0], m.i[o][1], 0), 10843 g.applyToY(m.i[o][0], m.i[o][1], 0), 10844 g.applyToX(m.v[o][0], m.v[o][1], 0), 10845 g.applyToY(m.v[o][0], m.v[o][1], 0) 10846 ); 10847 d.push( 10848 g.applyToX(m.o[o - 1][0], m.o[o - 1][1], 0), 10849 g.applyToY(m.o[o - 1][0], m.o[o - 1][1], 0), 10850 g.applyToX(m.i[0][0], m.i[0][1], 0), 10851 g.applyToY(m.i[0][0], m.i[0][1], 0), 10852 g.applyToX(m.v[0][0], m.v[0][1], 0), 10853 g.applyToY(m.v[0][0], m.v[0][1], 0) 10854 ), 10855 (c[_] = d), 10856 (_ += 1); 10857 } 10858 v && ((P += y[i].l), (P += b)), 10859 this.textSpans[S] 10860 ? (this.textSpans[S].elem = c) 10861 : (this.textSpans[S] = { elem: c }), 10862 (S += 1); 10863 } 10864 }), 10865 (CVTextElement.prototype.renderInnerContent = function () { 10866 var t, 10867 e, 10868 r, 10869 i, 10870 s, 10871 a, 10872 n = this.canvasContext; 10873 (n.font = this.values.fValue), 10874 (n.lineCap = "butt"), 10875 (n.lineJoin = "miter"), 10876 (n.miterLimit = 4), 10877 this.data.singleShape || 10878 this.textAnimator.getMeasures( 10879 this.textProperty.currentData, 10880 this.lettersChangedFlag 10881 ); 10882 var o, 10883 h = this.textAnimator.renderedLetters, 10884 l = this.textProperty.currentData.l; 10885 e = l.length; 10886 var p, 10887 f, 10888 m = null, 10889 c = null, 10890 d = null; 10891 for (t = 0; t < e; t += 1) 10892 if (!l[t].n) { 10893 if ( 10894 ((o = h[t]) && 10895 (this.globalData.renderer.save(), 10896 this.globalData.renderer.ctxTransform(o.p), 10897 this.globalData.renderer.ctxOpacity(o.o)), 10898 this.fill) 10899 ) { 10900 for ( 10901 o && o.fc 10902 ? m !== o.fc && ((m = o.fc), (n.fillStyle = o.fc)) 10903 : m !== this.values.fill && 10904 ((m = this.values.fill), (n.fillStyle = this.values.fill)), 10905 i = (p = this.textSpans[t].elem).length, 10906 this.globalData.canvasContext.beginPath(), 10907 r = 0; 10908 r < i; 10909 r += 1 10910 ) 10911 for ( 10912 a = (f = p[r]).length, 10913 this.globalData.canvasContext.moveTo(f[0], f[1]), 10914 s = 2; 10915 s < a; 10916 s += 6 10917 ) 10918 this.globalData.canvasContext.bezierCurveTo( 10919 f[s], 10920 f[s + 1], 10921 f[s + 2], 10922 f[s + 3], 10923 f[s + 4], 10924 f[s + 5] 10925 ); 10926 this.globalData.canvasContext.closePath(), 10927 this.globalData.canvasContext.fill(); 10928 } 10929 if (this.stroke) { 10930 for ( 10931 o && o.sw 10932 ? d !== o.sw && ((d = o.sw), (n.lineWidth = o.sw)) 10933 : d !== this.values.sWidth && 10934 ((d = this.values.sWidth), 10935 (n.lineWidth = this.values.sWidth)), 10936 o && o.sc 10937 ? c !== o.sc && ((c = o.sc), (n.strokeStyle = o.sc)) 10938 : c !== this.values.stroke && 10939 ((c = this.values.stroke), 10940 (n.strokeStyle = this.values.stroke)), 10941 i = (p = this.textSpans[t].elem).length, 10942 this.globalData.canvasContext.beginPath(), 10943 r = 0; 10944 r < i; 10945 r += 1 10946 ) 10947 for ( 10948 a = (f = p[r]).length, 10949 this.globalData.canvasContext.moveTo(f[0], f[1]), 10950 s = 2; 10951 s < a; 10952 s += 6 10953 ) 10954 this.globalData.canvasContext.bezierCurveTo( 10955 f[s], 10956 f[s + 1], 10957 f[s + 2], 10958 f[s + 3], 10959 f[s + 4], 10960 f[s + 5] 10961 ); 10962 this.globalData.canvasContext.closePath(), 10963 this.globalData.canvasContext.stroke(); 10964 }
10965 o && this.globalData.renderer.restore(); 10966 } 10967 }), 10968 extendPrototype( 10969 [ 10970 BaseElement, 10971 TransformElement, 10972 CVBaseElement, 10973 HierarchyElement, 10974 FrameElement, 10975 RenderableElement, 10976 ], 10977 CVImageElement 10978 ), 10979 (CVImageElement.prototype.initElement = 10980 SVGShapeElement.prototype.initElement), 10981 (CVImageElement.prototype.prepareFrame = 10982 IImageElement.prototype.prepareFrame), 10983 (CVImageElement.prototype.createContent = function () { 10984 if ( 10985 this.img.width && 10986 (this.assetData.w !== this.img.width || 10987 this.assetData.h !== this.img.height) 10988 ) { 10989 var t = createTag("canvas"); 10990 (t.width = this.assetData.w), (t.height = this.assetData.h); 10991 var e, 10992 r, 10993 i = t.getContext("2d"), 10994 s = this.img.width, 10995 a = this.img.height, 10996 n = s / a, 10997 o = this.assetData.w / this.assetData.h, 10998 h = 10999 this.assetData.pr || 11000 this.globalData.renderConfig.imagePreserveAspectRatio; 11001 (n > o && "xMidYMid slice" === h) || (n < o && "xMidYMid slice" !== h) 11002 ? (e = (r = a) * o) 11003 : (r = (e = s) / o), 11004 i.drawImage( 11005 this.img, 11006 (s - e) / 2, 11007 (a - r) / 2, 11008 e, 11009 r, 11010 0, 11011 0, 11012 this.assetData.w, 11013 this.assetData.h 11014 ), 11015 (this.img = t); 11016 } 11017 }), 11018 (CVImageElement.prototype.renderInnerContent = function () { 11019 this.canvasContext.drawImage(this.img, 0, 0); 11020 }), 11021 (CVImageElement.prototype.destroy = function () { 11022 this.img = null; 11023 }), 11024 extendPrototype( 11025 [ 11026 BaseElement, 11027 TransformElement, 11028 CVBaseElement, 11029 HierarchyElement, 11030 FrameElement, 11031 RenderableElement, 11032 ], 11033 CVSolidElement 11034 ), 11035 (CVSolidElement.prototype.initElement = 11036 SVGShapeElement.prototype.initElement), 11037 (CVSolidElement.prototype.prepareFrame = 11038 IImageElement.prototype.prepareFrame), 11039 (CVSolidElement.prototype.renderInnerContent = function () { 11040 var t = this.canvasContext; 11041 (t.fillStyle = this.data.sc), 11042 t.fillRect(0, 0, this.data.sw, this.data.sh); 11043 }), 11044 extendPrototype([BaseRenderer], CanvasRendererBase), 11045 (CanvasRendererBase.prototype.createShape = function (t) { 11046 return new CVShapeElement(t, this.globalData, this); 11047 }), 11048 (CanvasRendererBase.prototype.createText = function (t) { 11049 return new CVTextElement(t, this.globalData, this); 11050 }), 11051 (CanvasRendererBase.prototype.createImage = function (t) { 11052 return new CVImageElement(t, this.globalData, this); 11053 }), 11054 (CanvasRendererBase.prototype.createSolid = function (t) { 11055 return new CVSolidElement(t, this.globalData, this); 11056 }), 11057 (CanvasRendererBase.prototype.createNull = 11058 SVGRenderer.prototype.createNull), 11059 (CanvasRendererBase.prototype.ctxTransform = function (t) { 11060 if ( 11061 1 !== t[0] || 11062 0 !== t[1] || 11063 0 !== t[4] || 11064 1 !== t[5] || 11065 0 !== t[12] || 11066 0 !== t[13] 11067 ) 11068 if (this.renderConfig.clearCanvas) { 11069 this.transformMat.cloneFromProps(t); 11070 var e = this.contextData.cTr.props; 11071 this.transformMat.transform( 11072 e[0], 11073 e[1], 11074 e[2], 11075 e[3], 11076 e[4], 11077 e[5], 11078 e[6], 11079 e[7], 11080 e[8], 11081 e[9], 11082 e[10], 11083 e[11], 11084 e[12], 11085 e[13], 11086 e[14], 11087 e[15] 11088 ), 11089 this.contextData.cTr.cloneFromProps(this.transformMat.props); 11090 var r = this.contextData.cTr.props; 11091 this.canvasContext.setTransform( 11092 r[0], 11093 r[1], 11094 r[4], 11095 r[5], 11096 r[12], 11097 r[13] 11098 ); 11099 } else 11100 this.canvasContext.transform(t[0], t[1], t[4], t[5], t[12], t[13]); 11101 }), 11102 (CanvasRendererBase.prototype.ctxOpacity = function (t) { 11103 if (!this.renderConfig.clearCanvas) 11104 return ( 11105 (this.canvasContext.globalAlpha *= t < 0 ? 0 : t), 11106 void (this.globalData.currentGlobalAlpha = this.contextData.cO) 11107 ); 11108 (this.contextData.cO *= t < 0 ? 0 : t), 11109 this.globalData.currentGlobalAlpha !== this.contextData.cO && 11110 ((this.canvasContext.globalAlpha = this.contextData.cO), 11111 (this.globalData.currentGlobalAlpha = this.contextData.cO)); 11112 }), 11113 (CanvasRendererBase.prototype.reset = function () { 11114 this.renderConfig.clearCanvas 11115 ? this.contextData.reset()
11116 : this.canvasContext.restore(); 11117 }), 11118 (CanvasRendererBase.prototype.save = function (t) { 11119 if (this.renderConfig.clearCanvas) { 11120 t && this.canvasContext.save(); 11121 var e, 11122 r = this.contextData.cTr.props; 11123 this.contextData._length <= this.contextData.cArrPos && 11124 this.contextData.duplicate(); 11125 var i = this.contextData.saved[this.contextData.cArrPos]; 11126 for (e = 0; e < 16; e += 1) i[e] = r[e]; 11127 (this.contextData.savedOp[this.contextData.cArrPos] = 11128 this.contextData.cO), 11129 (this.contextData.cArrPos += 1); 11130 } else this.canvasContext.save(); 11131 }), 11132 (CanvasRendererBase.prototype.restore = function (t) { 11133 if (this.renderConfig.clearCanvas) { 11134 t && 11135 (this.canvasContext.restore(), 11136 (this.globalData.blendMode = "source-over")), 11137 (this.contextData.cArrPos -= 1); 11138 var e, 11139 r = this.contextData.saved[this.contextData.cArrPos], 11140 i = this.contextData.cTr.props; 11141 for (e = 0; e < 16; e += 1) i[e] = r[e]; 11142 this.canvasContext.setTransform(r[0], r[1], r[4], r[5], r[12], r[13]), 11143 (r = this.contextData.savedOp[this.contextData.cArrPos]), 11144 (this.contextData.cO = r), 11145 this.globalData.currentGlobalAlpha !== r && 11146 ((this.canvasContext.globalAlpha = r), 11147 (this.globalData.currentGlobalAlpha = r)); 11148 } else this.canvasContext.restore(); 11149 }), 11150 (CanvasRendererBase.prototype.configAnimation = function (t) { 11151 if (this.animationItem.wrapper) { 11152 this.animationItem.container = createTag("canvas"); 11153 var e = this.animationItem.container.style; 11154 (e.width = "100%"), (e.height = "100%"); 11155 var r = "0px 0px 0px"; 11156 (e.transformOrigin = r), 11157 (e.mozTransformOrigin = r), 11158 (e.webkitTransformOrigin = r), 11159 (e["-webkit-transform"] = r), 11160 (e.contentVisibility = this.renderConfig.contentVisibility), 11161 this.animationItem.wrapper.appendChild( 11162 this.animationItem.container 11163 ), 11164 (this.canvasContext = 11165 this.animationItem.container.getContext("2d")), 11166 this.renderConfig.className && 11167 this.animationItem.container.setAttribute( 11168 "class", 11169 this.renderConfig.className 11170 ), 11171 this.renderConfig.id && 11172 this.animationItem.container.setAttribute( 11173 "id", 11174 this.renderConfig.id 11175 ); 11176 } else this.canvasContext = this.renderConfig.context; 11177 (this.data = t), 11178 (this.layers = t.layers), 11179 (this.transformCanvas = { 11180 w: t.w, 11181 h: t.h, 11182 sx: 0, 11183 sy: 0, 11184 tx: 0, 11185 ty: 0, 11186 }), 11187 this.setupGlobalData(t, document.body), 11188 (this.globalData.canvasContext = this.canvasContext), 11189 (this.globalData.renderer = this), 11190 (this.globalData.isDashed = !1), 11191 (this.globalData.progressiveLoad = this.renderConfig.progressiveLoad), 11192 (this.globalData.transformCanvas = this.transformCanvas), 11193 (this.elements = createSizedArray(t.layers.length)), 11194 this.updateContainerSize(); 11195 }), 11196 (CanvasRendererBase.prototype.updateContainerSize = function (t, e) { 11197 var r, i, s, a; 11198 if ( 11199 (this.reset(), 11200 t 11201 ? ((r = t), 11202 (i = e), 11203 (this.canvasContext.canvas.width = r), 11204 (this.canvasContext.canvas.height = i)) 11205 : (this.animationItem.wrapper && this.animationItem.container 11206 ? ((r = this.animationItem.wrapper.offsetWidth), 11207 (i = this.animationItem.wrapper.offsetHeight)) 11208 : ((r = this.canvasContext.canvas.width), 11209 (i = this.canvasContext.canvas.height)), 11210 (this.canvasContext.canvas.width = r * this.renderConfig.dpr), 11211 (this.canvasContext.canvas.height = i * this.renderConfig.dpr)), 11212 -1 !== this.renderConfig.preserveAspectRatio.indexOf("meet") || 11213 -1 !== this.renderConfig.preserveAspectRatio.indexOf("slice")) 11214 ) { 11215 var n = this.renderConfig.preserveAspectRatio.split(" "), 11216 o = n[1] || "meet", 11217 h = n[0] || "xMidYMid", 11218 l = h.substr(0, 4), 11219 p = h.substr(4); 11220 (s = r / i), 11221 ((a = this.transformCanvas.w / this.transformCanvas.h) > s && 11222 "meet" === o) || 11223 (a < s && "slice" === o) 11224 ? ((this.transformCanvas.sx = 11225 r / (this.transformCanvas.w / this.renderConfig.dpr)), 11226 (this.transformCanvas.sy = 11227 r / (this.transformCanvas.w / this.renderConfig.dpr))) 11228 : ((this.transformCanvas.sx = 11229 i / (this.transformCanvas.h / this.renderConfig.dpr)), 11230 (this.transformCanvas.sy = 11231 i / (this.transformCanvas.h / this.renderConfig.dpr))), 11232 (this.transformCanvas.tx = 11233 "xMid" === l && 11234 ((a < s && "meet" === o) || (a > s && "slice" === o)) 11235 ? ((r - this.transformCanvas.w * (i / this.transformCanvas.h)) / 11236 2) * 11237 this.renderConfig.dpr 11238 : "xMax" === l && 11239 ((a < s && "meet" === o) || (a > s && "slice" === o)) 11240 ? (r - this.transformCanvas.w * (i / this.transformCanvas.h)) * 11241 this.renderConfig.dpr 11242 : 0),
11243 (this.transformCanvas.ty = 11244 "YMid" === p && 11245 ((a > s && "meet" === o) || (a < s && "slice" === o)) 11246 ? ((i - this.transformCanvas.h * (r / this.transformCanvas.w)) / 11247 2) * 11248 this.renderConfig.dpr 11249 : "YMax" === p && 11250 ((a > s && "meet" === o) || (a < s && "slice" === o)) 11251 ? (i - this.transformCanvas.h * (r / this.transformCanvas.w)) * 11252 this.renderConfig.dpr 11253 : 0); 11254 } else 11255 "none" === this.renderConfig.preserveAspectRatio 11256 ? ((this.transformCanvas.sx = 11257 r / (this.transformCanvas.w / this.renderConfig.dpr)), 11258 (this.transformCanvas.sy = 11259 i / (this.transformCanvas.h / this.renderConfig.dpr)), 11260 (this.transformCanvas.tx = 0), 11261 (this.transformCanvas.ty = 0)) 11262 : ((this.transformCanvas.sx = this.renderConfig.dpr), 11263 (this.transformCanvas.sy = this.renderConfig.dpr), 11264 (this.transformCanvas.tx = 0), 11265 (this.transformCanvas.ty = 0)); 11266 (this.transformCanvas.props = [ 11267 this.transformCanvas.sx, 11268 0, 11269 0, 11270 0, 11271 0, 11272 this.transformCanvas.sy, 11273 0, 11274 0, 11275 0, 11276 0, 11277 1, 11278 0, 11279 this.transformCanvas.tx, 11280 this.transformCanvas.ty, 11281 0, 11282 1, 11283 ]), 11284 this.ctxTransform(this.transformCanvas.props), 11285 this.canvasContext.beginPath(), 11286 this.canvasContext.rect( 11287 0, 11288 0, 11289 this.transformCanvas.w, 11290 this.transformCanvas.h 11291 ), 11292 this.canvasContext.closePath(), 11293 this.canvasContext.clip(), 11294 this.renderFrame(this.renderedFrame, !0); 11295 }), 11296 (CanvasRendererBase.prototype.destroy = function () { 11297 var t; 11298 for ( 11299 this.renderConfig.clearCanvas && 11300 this.animationItem.wrapper && 11301 (this.animationItem.wrapper.innerText = ""), 11302 t = (this.layers ? this.layers.length : 0) - 1; 11303 t >= 0; 11304 t -= 1 11305 ) 11306 this.elements[t] && this.elements[t].destroy(); 11307 (this.elements.length = 0), 11308 (this.globalData.canvasContext = null), 11309 (this.animationItem.container = null), 11310 (this.destroyed = !0); 11311 }), 11312 (CanvasRendererBase.prototype.renderFrame = function (t, e) { 11313 if ( 11314 (this.renderedFrame !== t || 11315 !0 !== this.renderConfig.clearCanvas || 11316 e) && 11317 !this.destroyed && 11318 -1 !== t 11319 ) { 11320 var r; 11321 (this.renderedFrame = t), 11322 (this.globalData.frameNum = t - this.animationItem._isFirstFrame), 11323 (this.globalData.frameId += 1), 11324 (this.globalData._mdf = !this.renderConfig.clearCanvas || e), 11325 (this.globalData.projectInterface.currentFrame = t); 11326 var i = this.layers.length; 11327 for (this.completeLayers || this.checkLayers(t), r = 0; r < i; r += 1) 11328 (this.completeLayers || this.elements[r]) && 11329 this.elements[r].prepareFrame(t - this.layers[r].st); 11330 if (this.globalData._mdf) { 11331 for ( 11332 !0 === this.renderConfig.clearCanvas 11333 ? this.canvasContext.clearRect( 11334 0, 11335 0, 11336 this.transformCanvas.w, 11337 this.transformCanvas.h 11338 ) 11339 : this.save(), 11340 r = i - 1; 11341 r >= 0; 11342 r -= 1 11343 ) 11344 (this.completeLayers || this.elements[r]) && 11345 this.elements[r].renderFrame(); 11346 !0 !== this.renderConfig.clearCanvas && this.restore(); 11347 } 11348 } 11349 }), 11350 (CanvasRendererBase.prototype.buildItem = function (t) { 11351 var e = this.elements; 11352 if (!e[t] && 99 !== this.layers[t].ty) { 11353 var r = this.createItem(this.layers[t], this, this.globalData); 11354 (e[t] = r), r.initExpressions(); 11355 } 11356 }), 11357 (CanvasRendererBase.prototype.checkPendingElements = function () { 11358 for (; this.pendingElements.length; ) { 11359 this.pendingElements.pop().checkParenting(); 11360 } 11361 }), 11362 (CanvasRendererBase.prototype.hide = function () { 11363 this.animationItem.container.style.display = "none"; 11364 }), 11365 (CanvasRendererBase.prototype.show = function () { 11366 this.animationItem.container.style.display = "block"; 11367 }), 11368 extendPrototype( 11369 [CanvasRendererBase, ICompElement, CVBaseElement], 11370 CVCompElement 11371 ), 11372 (CVCompElement.prototype.renderInnerContent = function () { 11373 var t, 11374 e = this.canvasContext; 11375 for ( 11376 e.beginPath(), 11377 e.moveTo(0, 0), 11378 e.lineTo(this.data.w, 0), 11379 e.lineTo(this.data.w, this.data.h), 11380 e.lineTo(0, this.data.h), 11381 e.lineTo(0, 0), 11382 e.clip(), 11383 t = this.layers.length - 1; 11384 t >= 0; 11385 t -= 1 11386 ) 11387 (this.completeLayers || this.elements[t]) && 11388 this.elements[t].renderFrame(); 11389 }), 11390 (CVCompElement.prototype.destroy = function () { 11391 var t; 11392 for (t = this.layers.length - 1; t >= 0; t -= 1) 11393 this.elements[t] && this.elements[t].destroy(); 11394 (this.layers = null), (this.elements = null); 11395 }), 11396 (CVCompElement.prototype.createComp = function (t) { 11397 return new CVCompElement(t, this.globalData, this); 11398 }),
11399 extendPrototype([CanvasRendererBase], CanvasRenderer), 11400 (CanvasRenderer.prototype.createComp = function (t) { 11401 return new CVCompElement(t, this.globalData, this); 11402 }), 11403 (HBaseElement.prototype = { 11404 checkBlendMode: function () {}, 11405 initRendererElement: function () { 11406 (this.baseElement = createTag(this.data.tg || "div")), 11407 this.data.hasMask 11408 ? ((this.svgElement = createNS("svg")), 11409 (this.layerElement = createNS("g")), 11410 (this.maskedElement = this.layerElement), 11411 this.svgElement.appendChild(this.layerElement), 11412 this.baseElement.appendChild(this.svgElement)) 11413 : (this.layerElement = this.baseElement), 11414 styleDiv(this.baseElement); 11415 }, 11416 createContainerElements: function () { 11417 (this.renderableEffectsManager = new CVEffects(this)), 11418 (this.transformedElement = this.baseElement), 11419 (this.maskedElement = this.layerElement), 11420 this.data.ln && this.layerElement.setAttribute("id", this.data.ln), 11421 this.data.cl && 11422 this.layerElement.setAttribute("class", this.data.cl), 11423 0 !== this.data.bm && this.setBlendMode(); 11424 }, 11425 renderElement: function () { 11426 var t = this.transformedElement ? this.transformedElement.style : {}; 11427 if (this.finalTransform._matMdf) { 11428 var e = this.finalTransform.mat.toCSS(); 11429 (t.transform = e), (t.webkitTransform = e); 11430 } 11431 this.finalTransform._opMdf && 11432 (t.opacity = this.finalTransform.mProp.o.v); 11433 }, 11434 renderFrame: function () { 11435 this.data.hd || 11436 this.hidden || 11437 (this.renderTransform(), 11438 this.renderRenderable(), 11439 this.renderElement(), 11440 this.renderInnerContent(), 11441 this._isFirstFrame && (this._isFirstFrame = !1)); 11442 }, 11443 destroy: function () { 11444 (this.layerElement = null), 11445 (this.transformedElement = null), 11446 this.matteElement && (this.matteElement = null), 11447 this.maskManager && 11448 (this.maskManager.destroy(), (this.maskManager = null)); 11449 }, 11450 createRenderableComponents: function () { 11451 this.maskManager = new MaskElement(this.data, this, this.globalData); 11452 }, 11453 addEffects: function () {}, 11454 setMatte: function () {}, 11455 }), 11456 (HBaseElement.prototype.getBaseElement = 11457 SVGBaseElement.prototype.getBaseElement), 11458 (HBaseElement.prototype.destroyBaseElement = 11459 HBaseElement.prototype.destroy), 11460 (HBaseElement.prototype.buildElementParenting = 11461 BaseRenderer.prototype.buildElementParenting), 11462 extendPrototype( 11463 [ 11464 BaseElement, 11465 TransformElement, 11466 HBaseElement, 11467 HierarchyElement, 11468 FrameElement, 11469 RenderableDOMElement, 11470 ], 11471 HSolidElement 11472 ), 11473 (HSolidElement.prototype.createContent = function () { 11474 var t; 11475 this.data.hasMask 11476 ? ((t = createNS("rect")).setAttribute("width", this.data.sw), 11477 t.setAttribute("height", this.data.sh), 11478 t.setAttribute("fill", this.data.sc), 11479 this.svgElement.setAttribute("width", this.data.sw), 11480 this.svgElement.setAttribute("height", this.data.sh)) 11481 : (((t = createTag("div")).style.width = this.data.sw + "px"), 11482 (t.style.height = this.data.sh + "px"), 11483 (t.style.backgroundColor = this.data.sc)), 11484 this.layerElement.appendChild(t); 11485 }), 11486 extendPrototype( 11487 [ 11488 BaseElement, 11489 TransformElement, 11490 HSolidElement, 11491 SVGShapeElement, 11492 HBaseElement, 11493 HierarchyElement, 11494 FrameElement, 11495 RenderableElement, 11496 ], 11497 HShapeElement 11498 ), 11499 (HShapeElement.prototype._renderShapeFrame = 11500 HShapeElement.prototype.renderInnerContent), 11501 (HShapeElement.prototype.createContent = function () { 11502 var t; 11503 if (((this.baseElement.style.fontSize = 0), this.data.hasMask)) 11504 this.layerElement.appendChild(this.shapesContainer), 11505 (t = this.svgElement); 11506 else { 11507 t = createNS("svg"); 11508 var e = this.comp.data ? this.comp.data : this.globalData.compSize; 11509 t.setAttribute("width", e.w), 11510 t.setAttribute("height", e.h), 11511 t.appendChild(this.shapesContainer), 11512 this.layerElement.appendChild(t); 11513 } 11514 this.searchShapes( 11515 this.shapesData, 11516 this.itemsData, 11517 this.prevViewData, 11518 this.shapesContainer, 11519 0, 11520 [], 11521 !0 11522 ), 11523 this.filterUniqueShapes(), 11524 (this.shapeCont = t); 11525 }), 11526 (HShapeElement.prototype.getTransformedPoint = function (t, e) { 11527 var r, 11528 i = t.length; 11529 for (r = 0; r < i; r += 1) 11530 e = t[r].mProps.v.applyToPointArray(e[0], e[1], 0); 11531 return e; 11532 }), 11533 (HShapeElement.prototype.calculateShapeBoundingBox = function (t, e) { 11534 var r, 11535 i, 11536 s, 11537 a, 11538 n, 11539 o = t.sh.v, 11540 h = t.transformers, 11541 l = o._length; 11542 if (!(l <= 1)) { 11543 for (r = 0; r < l - 1; r += 1) 11544 (i = this.getTransformedPoint(h, o.v[r])), 11545 (s = this.getTransformedPoint(h, o.o[r])), 11546 (a = this.getTransformedPoint(h, o.i[r + 1])), 11547 (n = this.getTransformedPoint(h, o.v[r + 1])), 11548 this.checkBounds(i, s, a, n, e); 11549 o.c && 11550 ((i = this.getTransformedPoint(h, o.v[r])), 11551 (s = this.getTransformedPoint(h, o.o[r])), 11552 (a = this.getTransformedPoint(h, o.i[0])), 11553 (n = this.getTransformedPoint(h, o.v[0])), 11554 this.checkBounds(i, s, a, n, e)); 11555 } 11556 }), 11557 (HShapeElement.prototype.checkBounds = function (t, e, r, i, s) { 11558 this.getBoundsOfCurve(t, e, r, i); 11559 var a = this.shapeBoundingBox; 11560 (s.x = bmMin(a.left, s.x)), 11561 (s.xMax = bmMax(a.right, s.xMax)), 11562 (s.y = bmMin(a.top, s.y)), 11563 (s.yMax = bmMax(a.bottom, s.yMax)); 11564 }), 11565 (HShapeElement.prototype.shapeBoundingBox = { 11566 left: 0, 11567 right: 0, 11568 top: 0, 11569 bottom: 0, 11570 }), 11571 (HShapeElement.prototype.tempBoundingBox = { 11572 x: 0, 11573 xMax: 0, 11574 y: 0, 11575 yMax: 0, 11576 width: 0, 11577 height: 0, 11578 }), 11579 (HShapeElement.prototype.getBoundsOfCurve = function (t, e, r, i) { 11580 for ( 11581 var s, 11582 a, 11583 n, 11584 o, 11585 h, 11586 l, 11587 p, 11588 f = [ 11589 [t[0], i[0]], 11590 [t[1], i[1]], 11591 ], 11592 m = 0; 11593 m < 2; 11594 ++m 11595 ) 11596 (a = 6 * t[m] - 12 * e[m] + 6 * r[m]), 11597 (s = -3 * t[m] + 9 * e[m] - 9 * r[m] + 3 * i[m]), 11598 (n = 3 * e[m] - 3 * t[m]), 11599 (a |= 0), 11600 (n |= 0), 11601 (0 === (s |= 0) && 0 === a) || 11602 (0 === s 11603 ? (o = -n / a) > 0 && 11604 o < 1 && 11605 f[m].push(this.calculateF(o, t, e, r, i, m)) 11606 : (h = a * a - 4 * n * s) >= 0 && 11607 ((l = (-a + bmSqrt(h)) / (2 * s)) > 0 && 11608 l < 1 && 11609 f[m].push(this.calculateF(l, t, e, r, i, m)), 11610 (p = (-a - bmSqrt(h)) / (2 * s)) > 0 && 11611 p < 1 && 11612 f[m].push(this.calculateF(p, t, e, r, i, m)))); 11613 (this.shapeBoundingBox.left = bmMin.apply(null, f[0])), 11614 (this.shapeBoundingBox.top = bmMin.apply(null, f[1])), 11615 (this.shapeBoundingBox.right = bmMax.apply(null, f[0])), 11616 (this.shapeBoundingBox.bottom = bmMax.apply(null, f[1])); 11617 }), 11618 (HShapeElement.prototype.calculateF = function (t, e, r, i, s, a) { 11619 return ( 11620 bmPow(1 - t, 3) * e[a] + 11621 3 * bmPow(1 - t, 2) * t * r[a] + 11622 3 * (1 - t) * bmPow(t, 2) * i[a] + 11623 bmPow(t, 3) * s[a] 11624 ); 11625 }), 11626 (HShapeElement.prototype.calculateBoundingBox = function (t, e) { 11627 var r, 11628 i = t.length; 11629 for (r = 0; r < i; r += 1) 11630 t[r] && t[r].sh 11631 ? this.calculateShapeBoundingBox(t[r], e) 11632 : t[r] && t[r].it 11633 ? this.calculateBoundingBox(t[r].it, e) 11634 : t[r] && 11635 t[r].style && 11636 t[r].w && 11637 this.expandStrokeBoundingBox(t[r].w, e); 11638 }), 11639 (HShapeElement.prototype.expandStrokeBoundingBox = function (t, e) { 11640 var r = 0; 11641 if (t.keyframes) { 11642 for (var i = 0; i < t.keyframes.length; i += 1) { 11643 var s = t.keyframes[i].s; 11644 s > r && (r = s); 11645 } 11646 r *= t.mult; 11647 } else r = t.v * t.mult; 11648 (e.x -= r), (e.xMax += r), (e.y -= r), (e.yMax += r); 11649 }), 11650 (HShapeElement.prototype.currentBoxContains = function (t) { 11651 return ( 11652 this.currentBBox.x <= t.x && 11653 this.currentBBox.y <= t.y && 11654 this.currentBBox.width + this.currentBBox.x >= t.x + t.width && 11655 this.currentBBox.height + this.currentBBox.y >= t.y + t.height 11656 ); 11657 }), 11658 (HShapeElement.prototype.renderInnerContent = function () { 11659 if ( 11660 (this._renderShapeFrame(), 11661 !this.hidden && (this._isFirstFrame || this._mdf)) 11662 ) { 11663 var t = this.tempBoundingBox, 11664 e = 999999; 11665 if ( 11666 ((t.x = e), 11667 (t.xMax = -e), 11668 (t.y = e), 11669 (t.yMax = -e), 11670 this.calculateBoundingBox(this.itemsData, t), 11671 (t.width = t.xMax < t.x ? 0 : t.xMax - t.x),
11672 (t.height = t.yMax < t.y ? 0 : t.yMax - t.y), 11673 this.currentBoxContains(t)) 11674 ) 11675 return; 11676 var r = !1; 11677 if ( 11678 (this.currentBBox.w !== t.width && 11679 ((this.currentBBox.w = t.width), 11680 this.shapeCont.setAttribute("width", t.width), 11681 (r = !0)), 11682 this.currentBBox.h !== t.height && 11683 ((this.currentBBox.h = t.height), 11684 this.shapeCont.setAttribute("height", t.height), 11685 (r = !0)), 11686 r || this.currentBBox.x !== t.x || this.currentBBox.y !== t.y) 11687 ) { 11688 (this.currentBBox.w = t.width), 11689 (this.currentBBox.h = t.height), 11690 (this.currentBBox.x = t.x), 11691 (this.currentBBox.y = t.y), 11692 this.shapeCont.setAttribute( 11693 "viewBox", 11694 this.currentBBox.x + 11695 " " + 11696 this.currentBBox.y + 11697 " " + 11698 this.currentBBox.w + 11699 " " + 11700 this.currentBBox.h 11701 ); 11702 var i = this.shapeCont.style, 11703 s = 11704 "translate(" + 11705 this.currentBBox.x + 11706 "px," + 11707 this.currentBBox.y + 11708 "px)"; 11709 (i.transform = s), (i.webkitTransform = s); 11710 } 11711 } 11712 }), 11713 extendPrototype( 11714 [ 11715 BaseElement, 11716 TransformElement, 11717 HBaseElement, 11718 HierarchyElement, 11719 FrameElement, 11720 RenderableDOMElement, 11721 ITextElement, 11722 ], 11723 HTextElement 11724 ), 11725 (HTextElement.prototype.createContent = function () { 11726 if (((this.isMasked = this.checkMasks()), this.isMasked)) { 11727 (this.renderType = "svg"), 11728 (this.compW = this.comp.data.w), 11729 (this.compH = this.comp.data.h), 11730 this.svgElement.setAttribute("width", this.compW), 11731 this.svgElement.setAttribute("height", this.compH); 11732 var t = createNS("g"); 11733 this.maskedElement.appendChild(t), (this.innerElem = t); 11734 } else (this.renderType = "html"), (this.innerElem = this.layerElement); 11735 this.checkParenting(); 11736 }), 11737 (HTextElement.prototype.buildNewText = function () { 11738 var t = this.textProperty.currentData; 11739 this.renderedLetters = createSizedArray(t.l ? t.l.length : 0); 11740 var e = this.innerElem.style, 11741 r = t.fc ? this.buildColor(t.fc) : "rgba(0,0,0,0)"; 11742 (e.fill = r), 11743 (e.color = r), 11744 t.sc && 11745 ((e.stroke = this.buildColor(t.sc)), (e.strokeWidth = t.sw + "px")); 11746 var i, 11747 s, 11748 a = this.globalData.fontManager.getFontByName(t.f); 11749 if (!this.globalData.fontManager.chars) 11750 if ( 11751 ((e.fontSize = t.finalSize + "px"), 11752 (e.lineHeight = t.finalSize + "px"), 11753 a.fClass) 11754 ) 11755 this.innerElem.className = a.fClass; 11756 else { 11757 e.fontFamily = a.fFamily; 11758 var n = t.fWeight, 11759 o = t.fStyle; 11760 (e.fontStyle = o), (e.fontWeight = n); 11761 } 11762 var h, 11763 l, 11764 p, 11765 f = t.l; 11766 s = f.length; 11767 var m, 11768 c = this.mHelper, 11769 d = "", 11770 u = 0; 11771 for (i = 0; i < s; i += 1) { 11772 if ( 11773 (this.globalData.fontManager.chars 11774 ? (this.textPaths[u] 11775 ? (h = this.textPaths[u]) 11776 : ((h = createNS("path")).setAttribute( 11777 "stroke-linecap", 11778 lineCapEnum[1] 11779 ), 11780 h.setAttribute("stroke-linejoin", lineJoinEnum[2]), 11781 h.setAttribute("stroke-miterlimit", "4")), 11782 this.isMasked || 11783 (this.textSpans[u] 11784 ? (p = (l = this.textSpans[u]).children[0]) 11785 : (((l = createTag("div")).style.lineHeight = 0), 11786 (p = createNS("svg")).appendChild(h), 11787 styleDiv(l)))) 11788 : this.isMasked 11789 ? (h = this.textPaths[u] ? this.textPaths[u] : createNS("text")) 11790 : this.textSpans[u] 11791 ? ((l = this.textSpans[u]), (h = this.textPaths[u])) 11792 : (styleDiv((l = createTag("span"))), 11793 styleDiv((h = createTag("span"))), 11794 l.appendChild(h)), 11795 this.globalData.fontManager.chars) 11796 ) { 11797 var y, 11798 g = this.globalData.fontManager.getCharData( 11799 t.finalText[i], 11800 a.fStyle, 11801 this.globalData.fontManager.getFontByName(t.f).fFamily 11802 ); 11803 if ( 11804 ((y = g ? g.data : null), 11805 c.reset(), 11806 y && 11807 y.shapes && 11808 y.shapes.length && 11809 ((m = y.shapes[0].it), 11810 c.scale(t.finalSize / 100, t.finalSize / 100), 11811 (d = this.createPathShape(c, m)), 11812 h.setAttribute("d", d)), 11813 this.isMasked) 11814 ) 11815 this.innerElem.appendChild(h); 11816 else { 11817 if ((this.innerElem.appendChild(l), y && y.shapes)) { 11818 document.body.appendChild(p); 11819 var v = p.getBBox(); 11820 p.setAttribute("width", v.width + 2), 11821 p.setAttribute("height", v.height + 2), 11822 p.setAttribute( 11823 "viewBox", 11824 v.x - 11825 1 + 11826 " " + 11827 (v.y - 1) + 11828 " " + 11829 (v.width + 2) + 11830 " " + 11831 (v.height + 2) 11832 ); 11833 var b = p.style, 11834 P = "translate(" + (v.x - 1) + "px," + (v.y - 1) + "px)"; 11835 (b.transform = P), 11836 (b.webkitTransform = P), 11837 (f[i].yOffset = v.y - 1); 11838 } else p.setAttribute("width", 1), p.setAttribute("height", 1); 11839 l.appendChild(p); 11840 } 11841 } else if ( 11842 ((h.textContent = f[i].val), 11843 h.setAttributeNS( 11844 "http://www.w3.org/XML/1998/namespace", 11845 "xml:space", 11846 "preserve" 11847 ), 11848 this.isMasked) 11849 ) 11850 this.innerElem.appendChild(h); 11851 else { 11852 this.innerElem.appendChild(l); 11853 var x = h.style,
11854 E = "translate3d(0," + -t.finalSize / 1.2 + "px,0)"; 11855 (x.transform = E), (x.webkitTransform = E); 11856 } 11857 this.isMasked ? (this.textSpans[u] = h) : (this.textSpans[u] = l), 11858 (this.textSpans[u].style.display = "block"), 11859 (this.textPaths[u] = h), 11860 (u += 1); 11861 } 11862 for (; u < this.textSpans.length; ) 11863 (this.textSpans[u].style.display = "none"), (u += 1); 11864 }), 11865 (HTextElement.prototype.renderInnerContent = function () { 11866 var t; 11867 if (this.data.singleShape) { 11868 if (!this._isFirstFrame && !this.lettersChangedFlag) return; 11869 if (this.isMasked && this.finalTransform._matMdf) { 11870 this.svgElement.setAttribute( 11871 "viewBox", 11872 -this.finalTransform.mProp.p.v[0] + 11873 " " + 11874 -this.finalTransform.mProp.p.v[1] + 11875 " " + 11876 this.compW + 11877 " " + 11878 this.compH 11879 ), 11880 (t = this.svgElement.style); 11881 var e = 11882 "translate(" + 11883 -this.finalTransform.mProp.p.v[0] + 11884 "px," + 11885 -this.finalTransform.mProp.p.v[1] + 11886 "px)"; 11887 (t.transform = e), (t.webkitTransform = e); 11888 } 11889 } 11890 if ( 11891 (this.textAnimator.getMeasures( 11892 this.textProperty.currentData, 11893 this.lettersChangedFlag 11894 ), 11895 this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) 11896 ) { 11897 var r, 11898 i, 11899 s, 11900 a, 11901 n, 11902 o = 0, 11903 h = this.textAnimator.renderedLetters, 11904 l = this.textProperty.currentData.l; 11905 for (i = l.length, r = 0; r < i; r += 1) 11906 l[r].n 11907 ? (o += 1) 11908 : ((a = this.textSpans[r]), 11909 (n = this.textPaths[r]), 11910 (s = h[o]), 11911 (o += 1), 11912 s._mdf.m && 11913 (this.isMasked 11914 ? a.setAttribute("transform", s.m) 11915 : ((a.style.webkitTransform = s.m), 11916 (a.style.transform = s.m))), 11917 (a.style.opacity = s.o), 11918 s.sw && s._mdf.sw && n.setAttribute("stroke-width", s.sw), 11919 s.sc && s._mdf.sc && n.setAttribute("stroke", s.sc), 11920 s.fc && 11921 s._mdf.fc && 11922 (n.setAttribute("fill", s.fc), (n.style.color = s.fc))); 11923 if ( 11924 this.innerElem.getBBox && 11925 !this.hidden && 11926 (this._isFirstFrame || this._mdf) 11927 ) { 11928 var p = this.innerElem.getBBox(); 11929 this.currentBBox.w !== p.width && 11930 ((this.currentBBox.w = p.width), 11931 this.svgElement.setAttribute("width", p.width)), 11932 this.currentBBox.h !== p.height && 11933 ((this.currentBBox.h = p.height), 11934 this.svgElement.setAttribute("height", p.height)); 11935 if ( 11936 this.currentBBox.w !== p.width + 2 || 11937 this.currentBBox.h !== p.height + 2 || 11938 this.currentBBox.x !== p.x - 1 || 11939 this.currentBBox.y !== p.y - 1 11940 ) { 11941 (this.currentBBox.w = p.width + 2), 11942 (this.currentBBox.h = p.height + 2), 11943 (this.currentBBox.x = p.x - 1), 11944 (this.currentBBox.y = p.y - 1), 11945 this.svgElement.setAttribute( 11946 "viewBox", 11947 this.currentBBox.x + 11948 " " + 11949 this.currentBBox.y + 11950 " " + 11951 this.currentBBox.w + 11952 " " + 11953 this.currentBBox.h 11954 ), 11955 (t = this.svgElement.style); 11956 var f = 11957 "translate(" + 11958 this.currentBBox.x + 11959 "px," + 11960 this.currentBBox.y + 11961 "px)"; 11962 (t.transform = f), (t.webkitTransform = f); 11963 } 11964 } 11965 } 11966 }), 11967 extendPrototype( 11968 [BaseElement, FrameElement, HierarchyElement], 11969 HCameraElement 11970 ), 11971 (HCameraElement.prototype.setup = function () { 11972 var t, 11973 e, 11974 r, 11975 i, 11976 s = this.comp.threeDElements.length; 11977 for (t = 0; t < s; t += 1) 11978 if ("3d" === (e = this.comp.threeDElements[t]).type) { 11979 (r = e.perspectiveElem.style), (i = e.container.style); 11980 var a = this.pe.v + "px", 11981 n = "0px 0px 0px", 11982 o = "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"; 11983 (r.perspective = a), 11984 (r.webkitPerspective = a), 11985 (i.transformOrigin = n), 11986 (i.mozTransformOrigin = n), 11987 (i.webkitTransformOrigin = n), 11988 (r.transform = o), 11989 (r.webkitTransform = o); 11990 } 11991 }), 11992 (HCameraElement.prototype.createElements = function () {}), 11993 (HCameraElement.prototype.hide = function () {}), 11994 (HCameraElement.prototype.renderFrame = function () { 11995 var t, 11996 e, 11997 r = this._isFirstFrame; 11998 if (this.hierarchy) 11999 for (e = this.hierarchy.length, t = 0; t < e; t += 1) 12000 r = this.hierarchy[t].finalTransform.mProp._mdf || r; 12001 if ( 12002 r || 12003 this.pe._mdf || 12004 (this.p && this.p._mdf) || 12005 (this.px && (this.px._mdf || this.py._mdf || this.pz._mdf)) || 12006 this.rx._mdf || 12007 this.ry._mdf || 12008 this.rz._mdf || 12009 this.or._mdf || 12010 (this.a && this.a._mdf) 12011 ) { 12012 if ((this.mat.reset(), this.hierarchy)) 12013 for (t = e = this.hierarchy.length - 1; t >= 0; t -= 1) { 12014 var i = this.hierarchy[t].finalTransform.mProp; 12015 this.mat.translate(-i.p.v[0], -i.p.v[1], i.p.v[2]), 12016 this.mat 12017 .rotateX(-i.or.v[0]) 12018 .rotateY(-i.or.v[1]) 12019 .rotateZ(i.or.v[2]), 12020 this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v), 12021 this.mat.scale(1 / i.s.v[0], 1 / i.s.v[1], 1 / i.s.v[2]), 12022 this.mat.translate(i.a.v[0], i.a.v[1], i.a.v[2]); 12023 } 12024 if ( 12025 (this.p 12026 ? this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]) 12027 : this.mat.translate(-this.px.v, -this.py.v, this.pz.v), 12028 this.a) 12029 ) { 12030 var s; 12031 s = this.p 12032 ? [ 12033 this.p.v[0] - this.a.v[0], 12034 this.p.v[1] - this.a.v[1], 12035 this.p.v[2] - this.a.v[2], 12036 ] 12037 : [ 12038 this.px.v - this.a.v[0], 12039 this.py.v - this.a.v[1], 12040 this.pz.v - this.a.v[2], 12041 ]; 12042 var a = Math.sqrt( 12043 Math.pow(s[0], 2) + Math.pow(s[1], 2) + Math.pow(s[2], 2) 12044 ), 12045 n = [s[0] / a, s[1] / a, s[2] / a], 12046 o = Math.sqrt(n[2] * n[2] + n[0] * n[0]), 12047 h = Math.atan2(n[1], o), 12048 l = Math.atan2(n[0], -n[2]); 12049 this.mat.rotateY(l).rotateX(-h); 12050 } 12051 this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v), 12052 this.mat 12053 .rotateX(-this.or.v[0]) 12054 .rotateY(-this.or.v[1]) 12055 .rotateZ(this.or.v[2]), 12056 this.mat.translate( 12057 this.globalData.compSize.w / 2, 12058 this.globalData.compSize.h / 2, 12059 0 12060 ), 12061 this.mat.translate(0, 0, this.pe.v); 12062 var p = !this._prevMat.equals(this.mat); 12063 if ((p || this.pe._mdf) && this.comp.threeDElements) { 12064 var f, m, c; 12065 for (e = this.comp.threeDElements.length, t = 0; t < e; t += 1) 12066 if ("3d" === (f = this.comp.threeDElements[t]).type) { 12067 if (p) { 12068 var d = this.mat.toCSS(); 12069 ((c = f.container.style).transform = d), 12070 (c.webkitTransform = d);
12071 } 12072 this.pe._mdf && 12073 (((m = f.perspectiveElem.style).perspective = 12074 this.pe.v + "px"), 12075 (m.webkitPerspective = this.pe.v + "px")); 12076 } 12077 this.mat.clone(this._prevMat); 12078 } 12079 } 12080 this._isFirstFrame = !1; 12081 }), 12082 (HCameraElement.prototype.prepareFrame = function (t) { 12083 this.prepareProperties(t, !0); 12084 }), 12085 (HCameraElement.prototype.destroy = function () {}), 12086 (HCameraElement.prototype.getBaseElement = function () { 12087 return null; 12088 }), 12089 extendPrototype( 12090 [ 12091 BaseElement, 12092 TransformElement, 12093 HBaseElement, 12094 HSolidElement, 12095 HierarchyElement, 12096 FrameElement, 12097 RenderableElement, 12098 ], 12099 HImageElement 12100 ), 12101 (HImageElement.prototype.createContent = function () { 12102 var t = this.globalData.getAssetsPath(this.assetData), 12103 e = new Image(); 12104 this.data.hasMask 12105 ? ((this.imageElem = createNS("image")), 12106 this.imageElem.setAttribute("width", this.assetData.w + "px"), 12107 this.imageElem.setAttribute("height", this.assetData.h + "px"), 12108 this.imageElem.setAttributeNS( 12109 "http://www.w3.org/1999/xlink", 12110 "href", 12111 t 12112 ), 12113 this.layerElement.appendChild(this.imageElem), 12114 this.baseElement.setAttribute("width", this.assetData.w), 12115 this.baseElement.setAttribute("height", this.assetData.h)) 12116 : this.layerElement.appendChild(e), 12117 (e.crossOrigin = "anonymous"), 12118 (e.src = t), 12119 this.data.ln && this.baseElement.setAttribute("id", this.data.ln); 12120 }), 12121 extendPrototype([BaseRenderer], HybridRendererBase), 12122 (HybridRendererBase.prototype.buildItem = 12123 SVGRenderer.prototype.buildItem), 12124 (HybridRendererBase.prototype.checkPendingElements = function () { 12125 for (; this.pendingElements.length; ) { 12126 this.pendingElements.pop().checkParenting(); 12127 } 12128 }), 12129 (HybridRendererBase.prototype.appendElementInPos = function (t, e) { 12130 var r = t.getBaseElement(); 12131 if (r) { 12132 var i = this.layers[e]; 12133 if (i.ddd && this.supports3d) this.addTo3dContainer(r, e); 12134 else if (this.threeDElements) this.addTo3dContainer(r, e); 12135 else { 12136 for (var s, a, n = 0; n < e; ) 12137 this.elements[n] && 12138 !0 !== this.elements[n] && 12139 this.elements[n].getBaseElement && 12140 ((a = this.elements[n]), 12141 (s = 12142 (this.layers[n].ddd 12143 ? this.getThreeDContainerByPos(n) 12144 : a.getBaseElement()) || s)), 12145 (n += 1); 12146 s 12147 ? (i.ddd && this.supports3d) || 12148 this.layerElement.insertBefore(r, s) 12149 : (i.ddd && this.supports3d) || this.layerElement.appendChild(r); 12150 } 12151 } 12152 }), 12153 (HybridRendererBase.prototype.createShape = function (t) { 12154 return this.supports3d 12155 ? new HShapeElement(t, this.globalData, this) 12156 : new SVGShapeElement(t, this.globalData, this); 12157 }), 12158 (HybridRendererBase.prototype.createText = function (t) { 12159 return this.supports3d 12160 ? new HTextElement(t, this.globalData, this) 12161 : new SVGTextLottieElement(t, this.globalData, this); 12162 }), 12163 (HybridRendererBase.prototype.createCamera = function (t) { 12164 return ( 12165 (this.camera = new HCameraElement(t, this.globalData, this)), 12166 this.camera 12167 ); 12168 }), 12169 (HybridRendererBase.prototype.createImage = function (t) { 12170 return this.supports3d 12171 ? new HImageElement(t, this.globalData, this) 12172 : new IImageElement(t, this.globalData, this); 12173 }), 12174 (HybridRendererBase.prototype.createSolid = function (t) { 12175 return this.supports3d 12176 ? new HSolidElement(t, this.globalData, this) 12177 : new ISolidElement(t, this.globalData, this); 12178 }), 12179 (HybridRendererBase.prototype.createNull = 12180 SVGRenderer.prototype.createNull), 12181 (HybridRendererBase.prototype.getThreeDContainerByPos = function (t) { 12182 for (var e = 0, r = this.threeDElements.length; e < r; ) { 12183 if ( 12184 this.threeDElements[e].startPos <= t && 12185 this.threeDElements[e].endPos >= t 12186 ) 12187 return this.threeDElements[e].perspectiveElem; 12188 e += 1; 12189 } 12190 return null; 12191 }), 12192 (HybridRendererBase.prototype.createThreeDContainer = function (t, e) { 12193 var r, 12194 i, 12195 s = createTag("div"); 12196 styleDiv(s); 12197 var a = createTag("div"); 12198 if ((styleDiv(a), "3d" === e)) { 12199 ((r = s.style).width = this.globalData.compSize.w + "px"), 12200 (r.height = this.globalData.compSize.h + "px"); 12201 var n = "50% 50%"; 12202 (r.webkitTransformOrigin = n), 12203 (r.mozTransformOrigin = n), 12204 (r.transformOrigin = n); 12205 var o = "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"; 12206 ((i = a.style).transform = o), (i.webkitTransform = o); 12207 } 12208 s.appendChild(a); 12209 var h = { 12210 container: a, 12211 perspectiveElem: s, 12212 startPos: t, 12213 endPos: t, 12214 type: e, 12215 }; 12216 return this.threeDElements.push(h), h; 12217 }), 12218 (HybridRendererBase.prototype.build3dContainers = function () { 12219 var t, 12220 e, 12221 r = this.layers.length, 12222 i = ""; 12223 for (t = 0; t < r; t += 1) 12224 this.layers[t].ddd && 3 !== this.layers[t].ty 12225 ? ("3d" !== i && 12226 ((i = "3d"), (e = this.createThreeDContainer(t, "3d"))), 12227 (e.endPos = Math.max(e.endPos, t))) 12228 : ("2d" !== i && 12229 ((i = "2d"), (e = this.createThreeDContainer(t, "2d"))), 12230 (e.endPos = Math.max(e.endPos, t))); 12231 for (t = (r = this.threeDElements.length) - 1; t >= 0; t -= 1) 12232 this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem); 12233 }), 12234 (HybridRendererBase.prototype.addTo3dContainer = function (t, e) { 12235 for (var r = 0, i = this.threeDElements.length; r < i; ) { 12236 if (e <= this.threeDElements[r].endPos) { 12237 for (var s, a = this.threeDElements[r].startPos; a < e; ) 12238 this.elements[a] && 12239 this.elements[a].getBaseElement && 12240 (s = this.elements[a].getBaseElement()), 12241 (a += 1); 12242 s 12243 ? this.threeDElements[r].container.insertBefore(t, s) 12244 : this.threeDElements[r].container.appendChild(t); 12245 break; 12246 } 12247 r += 1; 12248 } 12249 }), 12250 (HybridRendererBase.prototype.configAnimation = function (t) { 12251 var e = createTag("div"), 12252 r = this.animationItem.wrapper, 12253 i = e.style; 12254 (i.width = t.w + "px"), 12255 (i.height = t.h + "px"), 12256 (this.resizerElem = e), 12257 styleDiv(e), 12258 (i.transformStyle = "flat"), 12259 (i.mozTransformStyle = "flat"), 12260 (i.webkitTransformStyle = "flat"), 12261 this.renderConfig.className && 12262 e.setAttribute("class", this.renderConfig.className), 12263 r.appendChild(e), 12264 (i.overflow = "hidden"); 12265 var s = createNS("svg"); 12266 s.setAttribute("width", "1"), 12267 s.setAttribute("height", "1"), 12268 styleDiv(s), 12269 this.resizerElem.appendChild(s); 12270 var a = createNS("defs"); 12271 s.appendChild(a), 12272 (this.data = t), 12273 this.setupGlobalData(t, s), 12274 (this.globalData.defs = a),
12275 (this.layers = t.layers), 12276 (this.layerElement = this.resizerElem), 12277 this.build3dContainers(), 12278 this.updateContainerSize(); 12279 }), 12280 (HybridRendererBase.prototype.destroy = function () { 12281 var t; 12282 this.animationItem.wrapper && 12283 (this.animationItem.wrapper.innerText = ""), 12284 (this.animationItem.container = null), 12285 (this.globalData.defs = null); 12286 var e = this.layers ? this.layers.length : 0; 12287 for (t = 0; t < e; t += 1) this.elements[t].destroy(); 12288 (this.elements.length = 0), 12289 (this.destroyed = !0), 12290 (this.animationItem = null); 12291 }), 12292 (HybridRendererBase.prototype.updateContainerSize = function () { 12293 var t, 12294 e, 12295 r, 12296 i, 12297 s = this.animationItem.wrapper.offsetWidth, 12298 a = this.animationItem.wrapper.offsetHeight, 12299 n = s / a; 12300 this.globalData.compSize.w / this.globalData.compSize.h > n 12301 ? ((t = s / this.globalData.compSize.w), 12302 (e = s / this.globalData.compSize.w), 12303 (r = 0), 12304 (i = 12305 (a - 12306 this.globalData.compSize.h * (s / this.globalData.compSize.w)) / 12307 2)) 12308 : ((t = a / this.globalData.compSize.h), 12309 (e = a / this.globalData.compSize.h), 12310 (r = 12311 (s - 12312 this.globalData.compSize.w * (a / this.globalData.compSize.h)) / 12313 2), 12314 (i = 0)); 12315 var o = this.resizerElem.style; 12316 (o.webkitTransform = 12317 "matrix3d(" + 12318 t + 12319 ",0,0,0,0," + 12320 e + 12321 ",0,0,0,0,1,0," + 12322 r + 12323 "," + 12324 i + 12325 ",0,1)"), 12326 (o.transform = o.webkitTransform); 12327 }), 12328 (HybridRendererBase.prototype.renderFrame = 12329 SVGRenderer.prototype.renderFrame), 12330 (HybridRendererBase.prototype.hide = function () { 12331 this.resizerElem.style.display = "none"; 12332 }), 12333 (HybridRendererBase.prototype.show = function () { 12334 this.resizerElem.style.display = "block"; 12335 }), 12336 (HybridRendererBase.prototype.initItems = function () { 12337 if ((this.buildAllItems(), this.camera)) this.camera.setup(); 12338 else { 12339 var t, 12340 e = this.globalData.compSize.w, 12341 r = this.globalData.compSize.h, 12342 i = this.threeDElements.length; 12343 for (t = 0; t < i; t += 1) { 12344 var s = this.threeDElements[t].perspectiveElem.style; 12345 (s.webkitPerspective = 12346 Math.sqrt(Math.pow(e, 2) + Math.pow(r, 2)) + "px"), 12347 (s.perspective = s.webkitPerspective); 12348 } 12349 } 12350 }), 12351 (HybridRendererBase.prototype.searchExtraCompositions = function (t) { 12352 var e, 12353 r = t.length, 12354 i = createTag("div"); 12355 for (e = 0; e < r; e += 1) 12356 if (t[e].xt) { 12357 var s = this.createComp(t[e], i, this.globalData.comp, null); 12358 s.initExpressions(), 12359 this.globalData.projectInterface.registerComposition(s); 12360 } 12361 }), 12362 extendPrototype( 12363 [HybridRendererBase, ICompElement, HBaseElement], 12364 HCompElement 12365 ), 12366 (HCompElement.prototype._createBaseContainerElements = 12367 HCompElement.prototype.createContainerElements), 12368 (HCompElement.prototype.createContainerElements = function () { 12369 this._createBaseContainerElements(), 12370 this.data.hasMask 12371 ? (this.svgElement.setAttribute("width", this.data.w), 12372 this.svgElement.setAttribute("height", this.data.h), 12373 (this.transformedElement = this.baseElement)) 12374 : (this.transformedElement = this.layerElement); 12375 }), 12376 (HCompElement.prototype.addTo3dContainer = function (t, e) { 12377 for (var r, i = 0; i < e; ) 12378 this.elements[i] && 12379 this.elements[i].getBaseElement && 12380 (r = this.elements[i].getBaseElement()), 12381 (i += 1); 12382 r 12383 ? this.layerElement.insertBefore(t, r) 12384 : this.layerElement.appendChild(t); 12385 }), 12386 (HCompElement.prototype.createComp = function (t) { 12387 return this.supports3d 12388 ? new HCompElement(t, this.globalData, this) 12389 : new SVGCompElement(t, this.globalData, this); 12390 }), 12391 extendPrototype([HybridRendererBase], HybridRenderer), 12392 (HybridRenderer.prototype.createComp = function (t) { 12393 return this.supports3d 12394 ? new HCompElement(t, this.globalData, this) 12395 : new SVGCompElement(t, this.globalData, this); 12396 }); 12397 var CompExpressionInterface = function (t) { 12398 function e(e) { 12399 for (var r = 0, i = t.layers.length; r < i; ) { 12400 if (t.layers[r].nm === e || t.layers[r].ind === e) 12401 return t.elements[r].layerInterface; 12402 r += 1; 12403 } 12404 return null; 12405 } 12406 return ( 12407 Object.defineProperty(e, "_name", { value: t.data.nm }), 12408 (e.layer = e), 12409 (e.pixelAspect = 1), 12410 (e.height = t.data.h || t.globalData.compSize.h), 12411 (e.width = t.data.w || t.globalData.compSize.w), 12412 (e.pixelAspect = 1), 12413 (e.frameDuration = 1 / t.globalData.frameRate),
12414 (e.displayStartTime = 0), 12415 (e.numLayers = t.layers.length), 12416 e 12417 ); 12418 }, 12419 Expressions = (function () { 12420 var t = {}; 12421 return ( 12422 (t.initExpressions = function (t) { 12423 var e = 0, 12424 r = []; 12425 (t.renderer.compInterface = CompExpressionInterface(t.renderer)), 12426 t.renderer.globalData.projectInterface.registerComposition( 12427 t.renderer 12428 ), 12429 (t.renderer.globalData.pushExpression = function () { 12430 e += 1; 12431 }), 12432 (t.renderer.globalData.popExpression = function () { 12433 0 == (e -= 1) && 12434 (function () { 12435 var t, 12436 e = r.length; 12437 for (t = 0; t < e; t += 1) r[t].release(); 12438 r.length = 0; 12439 })(); 12440 }), 12441 (t.renderer.globalData.registerExpressionProperty = function (t) { 12442 -1 === r.indexOf(t) && r.push(t); 12443 }); 12444 }), 12445 t 12446 ); 12447 })(), 12448 MaskManagerInterface = (function () { 12449 function t(t, e) { 12450 (this._mask = t), (this._data = e); 12451 } 12452 Object.defineProperty(t.prototype, "maskPath", { 12453 get: function () { 12454 return ( 12455 this._mask.prop.k && this._mask.prop.getValue(), this._mask.prop 12456 ); 12457 }, 12458 }), 12459 Object.defineProperty(t.prototype, "maskOpacity", { 12460 get: function () { 12461 return ( 12462 this._mask.op.k && this._mask.op.getValue(), 12463 100 * this._mask.op.v 12464 ); 12465 }, 12466 }); 12467 return function (e) { 12468 var r, 12469 i = createSizedArray(e.viewData.length), 12470 s = e.viewData.length; 12471 for (r = 0; r < s; r += 1) 12472 i[r] = new t(e.viewData[r], e.masksProperties[r]); 12473 return function (t) { 12474 for (r = 0; r < s; ) { 12475 if (e.masksProperties[r].nm === t) return i[r]; 12476 r += 1; 12477 } 12478 return null; 12479 }; 12480 }; 12481 })(), 12482 ExpressionPropertyInterface = (function () { 12483 var t = { pv: 0, v: 0, mult: 1 }, 12484 e = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 }; 12485 function r(t, e, r) { 12486 Object.defineProperty(t, "velocity", { 12487 get: function () { 12488 return e.getVelocityAtTime(e.comp.currentFrame); 12489 }, 12490 }), 12491 (t.numKeys = e.keyframes ? e.keyframes.length : 0), 12492 (t.key = function (i) { 12493 if (!t.numKeys) return 0; 12494 var s = ""; 12495 s = 12496 "s" in e.keyframes[i - 1] 12497 ? e.keyframes[i - 1].s 12498 : "e" in e.keyframes[i - 2] 12499 ? e.keyframes[i - 2].e 12500 : e.keyframes[i - 2].s; 12501 var a = 12502 "unidimensional" === r ? new Number(s) : Object.assign({}, s); 12503 return ( 12504 (a.time = 12505 e.keyframes[i - 1].t / e.elem.comp.globalData.frameRate), 12506 (a.value = "unidimensional" === r ? s[0] : s), 12507 a 12508 ); 12509 }), 12510 (t.valueAtTime = e.getValueAtTime), 12511 (t.speedAtTime = e.getSpeedAtTime), 12512 (t.velocityAtTime = e.getVelocityAtTime), 12513 (t.propertyGroup = e.propertyGroup); 12514 } 12515 function i() { 12516 return t; 12517 } 12518 return function (s) { 12519 return s 12520 ? "unidimensional" === s.propType 12521 ? (function (e) { 12522 (e && "pv" in e) || (e = t); 12523 var i = 1 / e.mult, 12524 s = e.pv * i, 12525 a = new Number(s); 12526 return ( 12527 (a.value = s), 12528 r(a, e, "unidimensional"), 12529 function () { 12530 return ( 12531 e.k && e.getValue(), 12532 (s = e.v * i), 12533 a.value !== s && 12534 (((a = new Number(s)).value = s), 12535 r(a, e, "unidimensional")), 12536 a 12537 ); 12538 } 12539 ); 12540 })(s) 12541 : (function (t) { 12542 (t && "pv" in t) || (t = e); 12543 var i = 1 / t.mult, 12544 s = (t.data && t.data.l) || t.pv.length, 12545 a = createTypedArray("float32", s), 12546 n = createTypedArray("float32", s); 12547 return ( 12548 (a.value = n), 12549 r(a, t, "multidimensional"), 12550 function () { 12551 t.k && t.getValue(); 12552 for (var e = 0; e < s; e += 1) 12553 (n[e] = t.v[e] * i), (a[e] = n[e]); 12554 return a; 12555 } 12556 ); 12557 })(s) 12558 : i; 12559 }; 12560 })(), 12561 TransformExpressionInterface = function (t) { 12562 function e(t) { 12563 switch (t) { 12564 case "scale": 12565 case "Scale": 12566 case "ADBE Scale": 12567 case 6: 12568 return e.scale; 12569 case "rotation": 12570 case "Rotation": 12571 case "ADBE Rotation": 12572 case "ADBE Rotate Z": 12573 case 10: 12574 return e.rotation; 12575 case "ADBE Rotate X": 12576 return e.xRotation; 12577 case "ADBE Rotate Y": 12578 return e.yRotation; 12579 case "position": 12580 case "Position": 12581 case "ADBE Position": 12582 case 2: 12583 return e.position; 12584 case "ADBE Position_0": 12585 return e.xPosition; 12586 case "ADBE Position_1": 12587 return e.yPosition; 12588 case "ADBE Position_2": 12589 return e.zPosition; 12590 case "anchorPoint": 12591 case "AnchorPoint": 12592 case "Anchor Point": 12593 case "ADBE AnchorPoint": 12594 case 1: 12595 return e.anchorPoint; 12596 case "opacity": 12597 case "Opacity": 12598 case 11: 12599 return e.opacity; 12600 default: 12601 return null; 12602 } 12603 } 12604 var r, i, s, a; 12605 return ( 12606 Object.defineProperty(e, "rotation", { 12607 get: ExpressionPropertyInterface(t.r || t.rz), 12608 }), 12609 Object.defineProperty(e, "zRotation", { 12610 get: ExpressionPropertyInterface(t.rz || t.r), 12611 }), 12612 Object.defineProperty(e, "xRotation", { 12613 get: ExpressionPropertyInterface(t.rx), 12614 }), 12615 Object.defineProperty(e, "yRotation", { 12616 get: ExpressionPropertyInterface(t.ry), 12617 }), 12618 Object.defineProperty(e, "scale", { 12619 get: ExpressionPropertyInterface(t.s), 12620 }), 12621 t.p 12622 ? (a = ExpressionPropertyInterface(t.p)) 12623 : ((r = ExpressionPropertyInterface(t.px)), 12624 (i = ExpressionPropertyInterface(t.py)), 12625 t.pz && (s = ExpressionPropertyInterface(t.pz))), 12626 Object.defineProperty(e, "position", { 12627 get: function () { 12628 return t.p ? a() : [r(), i(), s ? s() : 0]; 12629 }, 12630 }), 12631 Object.defineProperty(e, "xPosition", { 12632 get: ExpressionPropertyInterface(t.px), 12633 }), 12634 Object.defineProperty(e, "yPosition", { 12635 get: ExpressionPropertyInterface(t.py), 12636 }), 12637 Object.defineProperty(e, "zPosition", { 12638 get: ExpressionPropertyInterface(t.pz), 12639 }), 12640 Object.defineProperty(e, "anchorPoint", { 12641 get: ExpressionPropertyInterface(t.a), 12642 }), 12643 Object.defineProperty(e, "opacity", { 12644 get: ExpressionPropertyInterface(t.o), 12645 }), 12646 Object.defineProperty(e, "skew", { 12647 get: ExpressionPropertyInterface(t.sk), 12648 }), 12649 Object.defineProperty(e, "skewAxis", { 12650 get: ExpressionPropertyInterface(t.sa), 12651 }), 12652 Object.defineProperty(e, "orientation", { 12653 get: ExpressionPropertyInterface(t.or), 12654 }), 12655 e 12656 ); 12657 }, 12658 LayerExpressionInterface = (function () { 12659 function t(t) { 12660 var e = new Matrix(); 12661 void 0 !== t 12662 ? this._elem.finalTransform.mProp.getValueAtTime(t).clone(e) 12663 : this._elem.finalTransform.mProp.applyToMatrix(e); 12664 return e; 12665 } 12666 function e(t, e) { 12667 var r = this.getMatrix(e); 12668 return ( 12669 (r.props[12] = 0), 12670 (r.props[13] = 0), 12671 (r.props[14] = 0), 12672 this.applyPoint(r, t) 12673 ); 12674 } 12675 function r(t, e) { 12676 var r = this.getMatrix(e); 12677 return this.applyPoint(r, t); 12678 } 12679 function i(t, e) { 12680 var r = this.getMatrix(e); 12681 return ( 12682 (r.props[12] = 0), 12683 (r.props[13] = 0), 12684 (r.props[14] = 0), 12685 this.invertPoint(r, t) 12686 ); 12687 } 12688 function s(t, e) { 12689 var r = this.getMatrix(e); 12690 return this.invertPoint(r, t); 12691 } 12692 function a(t, e) { 12693 if (this._elem.hierarchy && this._elem.hierarchy.length) { 12694 var r, 12695 i = this._elem.hierarchy.length; 12696 for (r = 0; r < i; r += 1) 12697 this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t); 12698 } 12699 return t.applyToPointArray(e[0], e[1], e[2] || 0); 12700 } 12701 function n(t, e) { 12702 if (this._elem.hierarchy && this._elem.hierarchy.length) { 12703 var r, 12704 i = this._elem.hierarchy.length; 12705 for (r = 0; r < i; r += 1) 12706 this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t); 12707 } 12708 return t.inversePoint(e); 12709 } 12710 function o(t) { 12711 var e = new Matrix(); 12712 if ( 12713 (e.reset(), 12714 this._elem.finalTransform.mProp.applyToMatrix(e), 12715 this._elem.hierarchy && this._elem.hierarchy.length) 12716 ) { 12717 var r, 12718 i = this._elem.hierarchy.length; 12719 for (r = 0; r < i; r += 1) 12720 this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e); 12721 return e.inversePoint(t); 12722 } 12723 return e.inversePoint(t); 12724 } 12725 function h() { 12726 return [1, 1, 1, 1]; 12727 } 12728 return function (l) { 12729 var p; 12730 function f(t) { 12731 switch (t) { 12732 case "ADBE Root Vectors Group": 12733 case "Contents": 12734 case 2: 12735 return f.shapeInterface; 12736 case 1: 12737 case 6: 12738 case "Transform": 12739 case "transform": 12740 case "ADBE Transform Group": 12741 return p; 12742 case 4: 12743 case "ADBE Effect Parade": 12744 case "effects": 12745 case "Effects": 12746 return f.effect; 12747 case "ADBE Text Properties": 12748 return f.textInterface; 12749 default: 12750 return null; 12751 } 12752 } 12753 (f.getMatrix = t), 12754 (f.invertPoint = n), 12755 (f.applyPoint = a), 12756 (f.toWorld = r), 12757 (f.toWorldVec = e), 12758 (f.fromWorld = s), 12759 (f.fromWorldVec = i), 12760 (f.toComp = r), 12761 (f.fromComp = o), 12762 (f.sampleImage = h), 12763 (f.sourceRectAtTime = l.sourceRectAtTime.bind(l)), 12764 (f._elem = l); 12765 var m = getDescriptor( 12766 (p = TransformExpressionInterface(l.finalTransform.mProp)), 12767 "anchorPoint" 12768 ); 12769 return ( 12770 Object.defineProperties(f, { 12771 hasParent: { 12772 get: function () { 12773 return l.hierarchy.length; 12774 }, 12775 }, 12776 parent: { 12777 get: function () { 12778 return l.hierarchy[0].layerInterface; 12779 }, 12780 }, 12781 rotation: getDescriptor(p, "rotation"), 12782 scale: getDescriptor(p, "scale"), 12783 position: getDescriptor(p, "position"), 12784 opacity: getDescriptor(p, "opacity"), 12785 anchorPoint: m, 12786 anchor_point: m, 12787 transform: { 12788 get: function () { 12789 return p; 12790 }, 12791 }, 12792 active: { 12793 get: function () { 12794 return l.isInRange; 12795 }, 12796 }, 12797 }), 12798 (f.startTime = l.data.st), 12799 (f.index = l.data.ind), 12800 (f.source = l.data.refId), 12801 (f.height = 0 === l.data.ty ? l.data.h : 100), 12802 (f.width = 0 === l.data.ty ? l.data.w : 100), 12803 (f.inPoint = l.data.ip / l.comp.globalData.frameRate), 12804 (f.outPoint = l.data.op / l.comp.globalData.frameRate), 12805 (f._name = l.data.nm), 12806 (f.registerMaskInterface = function (t) { 12807 f.mask = new MaskManagerInterface(t, l); 12808 }), 12809 (f.registerEffectsInterface = function (t) { 12810 f.effect = t; 12811 }), 12812 f 12813 ); 12814 }; 12815 })(), 12816 propertyGroupFactory = function (t, e) { 12817 return function (r) { 12818 return (r = void 0 === r ? 1 : r) <= 0 ? t : e(r - 1); 12819 }; 12820 }, 12821 PropertyInterface = function (t, e) { 12822 var r = { _name: t }; 12823 return function (t) { 12824 return (t = void 0 === t ? 1 : t) <= 0 ? r : e(t - 1); 12825 }; 12826 },
12827 EffectsExpressionInterface = (function () { 12828 function t(r, i, s, a) { 12829 function n(t) { 12830 for (var e = r.ef, i = 0, s = e.length; i < s; ) { 12831 if (t === e[i].nm || t === e[i].mn || t === e[i].ix) 12832 return 5 === e[i].ty ? l[i] : l[i](); 12833 i += 1; 12834 } 12835 throw new Error(); 12836 } 12837 var o, 12838 h = propertyGroupFactory(n, s), 12839 l = [], 12840 p = r.ef.length; 12841 for (o = 0; o < p; o += 1) 12842 5 === r.ef[o].ty 12843 ? l.push( 12844 t( 12845 r.ef[o], 12846 i.effectElements[o], 12847 i.effectElements[o].propertyGroup, 12848 a 12849 ) 12850 ) 12851 : l.push(e(i.effectElements[o], r.ef[o].ty, a, h)); 12852 return ( 12853 "ADBE Color Control" === r.mn && 12854 Object.defineProperty(n, "color", { 12855 get: function () { 12856 return l[0](); 12857 }, 12858 }), 12859 Object.defineProperties(n, { 12860 numProperties: { 12861 get: function () { 12862 return r.np; 12863 }, 12864 }, 12865 _name: { value: r.nm }, 12866 propertyGroup: { value: h }, 12867 }), 12868 (n.enabled = 0 !== r.en), 12869 (n.active = n.enabled), 12870 n 12871 ); 12872 } 12873 function e(t, e, r, i) { 12874 var s = ExpressionPropertyInterface(t.p); 12875 return ( 12876 t.p.setGroupProperty && 12877 t.p.setGroupProperty(PropertyInterface("", i)), 12878 function () { 12879 return 10 === e ? r.comp.compInterface(t.p.v) : s(); 12880 } 12881 ); 12882 } 12883 return { 12884 createEffectsInterface: function (e, r) { 12885 if (e.effectsManager) { 12886 var i, 12887 s = [], 12888 a = e.data.ef, 12889 n = e.effectsManager.effectElements.length; 12890 for (i = 0; i < n; i += 1) 12891 s.push(t(a[i], e.effectsManager.effectElements[i], r, e)); 12892 var o = e.data.ef || [], 12893 h = function (t) { 12894 for (i = 0, n = o.length; i < n; ) { 12895 if (t === o[i].nm || t === o[i].mn || t === o[i].ix) 12896 return s[i]; 12897 i += 1; 12898 } 12899 return null; 12900 }; 12901 return ( 12902 Object.defineProperty(h, "numProperties", { 12903 get: function () { 12904 return o.length; 12905 }, 12906 }), 12907 h 12908 ); 12909 } 12910 return null; 12911 }, 12912 }; 12913 })(), 12914 ShapePathInterface = function (t, e, r) { 12915 var i = e.sh; 12916 function s(t) { 12917 return "Shape" === t || 12918 "shape" === t || 12919 "Path" === t || 12920 "path" === t || 12921 "ADBE Vector Shape" === t || 12922 2 === t 12923 ? s.path 12924 : null; 12925 } 12926 var a = propertyGroupFactory(s, r); 12927 return ( 12928 i.setGroupProperty(PropertyInterface("Path", a)), 12929 Object.defineProperties(s, { 12930 path: { 12931 get: function () { 12932 return i.k && i.getValue(), i; 12933 }, 12934 }, 12935 shape: { 12936 get: function () { 12937 return i.k && i.getValue(), i; 12938 }, 12939 }, 12940 _name: { value: t.nm }, 12941 ix: { value: t.ix }, 12942 propertyIndex: { value: t.ix }, 12943 mn: { value: t.mn }, 12944 propertyGroup: { value: r }, 12945 }), 12946 s 12947 ); 12948 }, 12949 ShapeExpressionInterface = (function () { 12950 function t(t, o, c) { 12951 var d, 12952 u = [], 12953 y = t ? t.length : 0; 12954 for (d = 0; d < y; d += 1) 12955 "gr" === t[d].ty 12956 ? u.push(e(t[d], o[d], c)) 12957 : "fl" === t[d].ty 12958 ? u.push(r(t[d], o[d], c)) 12959 : "st" === t[d].ty 12960 ? u.push(a(t[d], o[d], c)) 12961 : "tm" === t[d].ty 12962 ? u.push(n(t[d], o[d], c)) 12963 : "tr" === t[d].ty || 12964 ("el" === t[d].ty 12965 ? u.push(h(t[d], o[d], c)) 12966 : "sr" === t[d].ty 12967 ? u.push(l(t[d], o[d], c)) 12968 : "sh" === t[d].ty 12969 ? u.push(ShapePathInterface(t[d], o[d], c)) 12970 : "rc" === t[d].ty 12971 ? u.push(p(t[d], o[d], c)) 12972 : "rd" === t[d].ty 12973 ? u.push(f(t[d], o[d], c)) 12974 : "rp" === t[d].ty 12975 ? u.push(m(t[d], o[d], c)) 12976 : "gf" === t[d].ty 12977 ? u.push(i(t[d], o[d], c)) 12978 : u.push(s(t[d], o[d]))); 12979 return u; 12980 } 12981 function e(e, r, i) { 12982 var s = function (t) { 12983 switch (t) { 12984 case "ADBE Vectors Group": 12985 case "Contents": 12986 case 2: 12987 return s.content; 12988 default: 12989 return s.transform; 12990 } 12991 }; 12992 s.propertyGroup = propertyGroupFactory(s, i); 12993 var a = (function (e, r, i) { 12994 var s, 12995 a = function (t) { 12996 for (var e = 0, r = s.length; e < r; ) { 12997 if ( 12998 s[e]._name === t || 12999 s[e].mn === t || 13000 s[e].propertyIndex === t || 13001 s[e].ix === t || 13002 s[e].ind === t 13003 ) 13004 return s[e]; 13005 e += 1; 13006 } 13007 return "number" == typeof t ? s[t - 1] : null; 13008 }; 13009 (a.propertyGroup = propertyGroupFactory(a, i)), 13010 (s = t(e.it, r.it, a.propertyGroup)), 13011 (a.numProperties = s.length); 13012 var n = o( 13013 e.it[e.it.length - 1], 13014 r.it[r.it.length - 1], 13015 a.propertyGroup 13016 ); 13017 return ( 13018 (a.transform = n), 13019 (a.propertyIndex = e.cix), 13020 (a._name = e.nm), 13021 a 13022 ); 13023 })(e, r, s.propertyGroup), 13024 n = o( 13025 e.it[e.it.length - 1], 13026 r.it[r.it.length - 1], 13027 s.propertyGroup 13028 ); 13029 return ( 13030 (s.content = a), 13031 (s.transform = n), 13032 Object.defineProperty(s, "_name", { 13033 get: function () { 13034 return e.nm; 13035 }, 13036 }), 13037 (s.numProperties = e.np), 13038 (s.propertyIndex = e.ix), 13039 (s.nm = e.nm), 13040 (s.mn = e.mn), 13041 s 13042 ); 13043 } 13044 function r(t, e, r) { 13045 function i(t) { 13046 return "Color" === t || "color" === t 13047 ? i.color 13048 : "Opacity" === t || "opacity" === t 13049 ? i.opacity 13050 : null; 13051 } 13052 return ( 13053 Object.defineProperties(i, { 13054 color: { get: ExpressionPropertyInterface(e.c) }, 13055 opacity: { get: ExpressionPropertyInterface(e.o) }, 13056 _name: { value: t.nm }, 13057 mn: { value: t.mn }, 13058 }), 13059 e.c.setGroupProperty(PropertyInterface("Color", r)), 13060 e.o.setGroupProperty(PropertyInterface("Opacity", r)), 13061 i 13062 ); 13063 } 13064 function i(t, e, r) { 13065 function i(t) { 13066 return "Start Point" === t || "start point" === t 13067 ? i.startPoint 13068 : "End Point" === t || "end point" === t 13069 ? i.endPoint 13070 : "Opacity" === t || "opacity" === t 13071 ? i.opacity 13072 : null; 13073 } 13074 return ( 13075 Object.defineProperties(i, { 13076 startPoint: { get: ExpressionPropertyInterface(e.s) }, 13077 endPoint: { get: ExpressionPropertyInterface(e.e) }, 13078 opacity: { get: ExpressionPropertyInterface(e.o) }, 13079 type: { 13080 get: function () { 13081 return "a"; 13082 }, 13083 }, 13084 _name: { value: t.nm }, 13085 mn: { value: t.mn }, 13086 }), 13087 e.s.setGroupProperty(PropertyInterface("Start Point", r)), 13088 e.e.setGroupProperty(PropertyInterface("End Point", r)), 13089 e.o.setGroupProperty(PropertyInterface("Opacity", r)), 13090 i 13091 ); 13092 } 13093 function s() { 13094 return function () { 13095 return null; 13096 }; 13097 } 13098 function a(t, e, r) { 13099 var i, 13100 s = propertyGroupFactory(l, r), 13101 a = propertyGroupFactory(h, s); 13102 function n(r) { 13103 Object.defineProperty(h, t.d[r].nm, { 13104 get: ExpressionPropertyInterface(e.d.dataProps[r].p), 13105 }); 13106 } 13107 var o = t.d ? t.d.length : 0, 13108 h = {}; 13109 for (i = 0; i < o; i += 1) 13110 n(i), e.d.dataProps[i].p.setGroupProperty(a); 13111 function l(t) { 13112 return "Color" === t || "color" === t 13113 ? l.color 13114 : "Opacity" === t || "opacity" === t 13115 ? l.opacity 13116 : "Stroke Width" === t || "stroke width" === t 13117 ? l.strokeWidth 13118 : null; 13119 } 13120 return ( 13121 Object.defineProperties(l, { 13122 color: { get: ExpressionPropertyInterface(e.c) }, 13123 opacity: { get: ExpressionPropertyInterface(e.o) }, 13124 strokeWidth: { get: ExpressionPropertyInterface(e.w) }, 13125 dash: { 13126 get: function () { 13127 return h; 13128 }, 13129 }, 13130 _name: { value: t.nm }, 13131 mn: { value: t.mn }, 13132 }), 13133 e.c.setGroupProperty(PropertyInterface("Color", s)), 13134 e.o.setGroupProperty(PropertyInterface("Opacity", s)),
13135 e.w.setGroupProperty(PropertyInterface("Stroke Width", s)), 13136 l 13137 ); 13138 } 13139 function n(t, e, r) { 13140 function i(e) { 13141 return e === t.e.ix || "End" === e || "end" === e 13142 ? i.end 13143 : e === t.s.ix 13144 ? i.start 13145 : e === t.o.ix 13146 ? i.offset 13147 : null; 13148 } 13149 var s = propertyGroupFactory(i, r); 13150 return ( 13151 (i.propertyIndex = t.ix), 13152 e.s.setGroupProperty(PropertyInterface("Start", s)), 13153 e.e.setGroupProperty(PropertyInterface("End", s)), 13154 e.o.setGroupProperty(PropertyInterface("Offset", s)), 13155 (i.propertyIndex = t.ix), 13156 (i.propertyGroup = r), 13157 Object.defineProperties(i, { 13158 start: { get: ExpressionPropertyInterface(e.s) }, 13159 end: { get: ExpressionPropertyInterface(e.e) }, 13160 offset: { get: ExpressionPropertyInterface(e.o) }, 13161 _name: { value: t.nm }, 13162 }), 13163 (i.mn = t.mn), 13164 i 13165 ); 13166 } 13167 function o(t, e, r) { 13168 function i(e) { 13169 return t.a.ix === e || "Anchor Point" === e 13170 ? i.anchorPoint 13171 : t.o.ix === e || "Opacity" === e 13172 ? i.opacity 13173 : t.p.ix === e || "Position" === e 13174 ? i.position 13175 : t.r.ix === e || "Rotation" === e || "ADBE Vector Rotation" === e 13176 ? i.rotation 13177 : t.s.ix === e || "Scale" === e 13178 ? i.scale 13179 : (t.sk && t.sk.ix === e) || "Skew" === e 13180 ? i.skew 13181 : (t.sa && t.sa.ix === e) || "Skew Axis" === e 13182 ? i.skewAxis 13183 : null; 13184 } 13185 var s = propertyGroupFactory(i, r); 13186 return ( 13187 e.transform.mProps.o.setGroupProperty( 13188 PropertyInterface("Opacity", s) 13189 ), 13190 e.transform.mProps.p.setGroupProperty( 13191 PropertyInterface("Position", s) 13192 ), 13193 e.transform.mProps.a.setGroupProperty( 13194 PropertyInterface("Anchor Point", s) 13195 ), 13196 e.transform.mProps.s.setGroupProperty( 13197 PropertyInterface("Scale", s) 13198 ), 13199 e.transform.mProps.r.setGroupProperty( 13200 PropertyInterface("Rotation", s) 13201 ), 13202 e.transform.mProps.sk && 13203 (e.transform.mProps.sk.setGroupProperty( 13204 PropertyInterface("Skew", s) 13205 ), 13206 e.transform.mProps.sa.setGroupProperty( 13207 PropertyInterface("Skew Angle", s) 13208 )), 13209 e.transform.op.setGroupProperty(PropertyInterface("Opacity", s)), 13210 Object.defineProperties(i, { 13211 opacity: { 13212 get: ExpressionPropertyInterface(e.transform.mProps.o), 13213 }, 13214 position: { 13215 get: ExpressionPropertyInterface(e.transform.mProps.p), 13216 }, 13217 anchorPoint: { 13218 get: ExpressionPropertyInterface(e.transform.mProps.a), 13219 }, 13220 scale: { get: ExpressionPropertyInterface(e.transform.mProps.s) }, 13221 rotation: { 13222 get: ExpressionPropertyInterface(e.transform.mProps.r), 13223 }, 13224 skew: { get: ExpressionPropertyInterface(e.transform.mProps.sk) }, 13225 skewAxis: { 13226 get: ExpressionPropertyInterface(e.transform.mProps.sa), 13227 }, 13228 _name: { value: t.nm }, 13229 }), 13230 (i.ty = "tr"), 13231 (i.mn = t.mn), 13232 (i.propertyGroup = r), 13233 i 13234 ); 13235 } 13236 function h(t, e, r) { 13237 function i(e) { 13238 return t.p.ix === e ? i.position : t.s.ix === e ? i.size : null; 13239 } 13240 var s = propertyGroupFactory(i, r); 13241 i.propertyIndex = t.ix; 13242 var a = "tm" === e.sh.ty ? e.sh.prop : e.sh; 13243 return ( 13244 a.s.setGroupProperty(PropertyInterface("Size", s)), 13245 a.p.setGroupProperty(PropertyInterface("Position", s)), 13246 Object.defineProperties(i, { 13247 size: { get: ExpressionPropertyInterface(a.s) }, 13248 position: { get: ExpressionPropertyInterface(a.p) }, 13249 _name: { value: t.nm }, 13250 }), 13251 (i.mn = t.mn), 13252 i 13253 ); 13254 } 13255 function l(t, e, r) { 13256 function i(e) { 13257 return t.p.ix === e 13258 ? i.position 13259 : t.r.ix === e 13260 ? i.rotation 13261 : t.pt.ix === e 13262 ? i.points 13263 : t.or.ix === e || "ADBE Vector Star Outer Radius" === e 13264 ? i.outerRadius 13265 : t.os.ix === e 13266 ? i.outerRoundness 13267 : !t.ir || 13268 (t.ir.ix !== e && "ADBE Vector Star Inner Radius" !== e) 13269 ? t.is && t.is.ix === e 13270 ? i.innerRoundness 13271 : null 13272 : i.innerRadius; 13273 } 13274 var s = propertyGroupFactory(i, r), 13275 a = "tm" === e.sh.ty ? e.sh.prop : e.sh; 13276 return ( 13277 (i.propertyIndex = t.ix), 13278 a.or.setGroupProperty(PropertyInterface("Outer Radius", s)), 13279 a.os.setGroupProperty(PropertyInterface("Outer Roundness", s)), 13280 a.pt.setGroupProperty(PropertyInterface("Points", s)), 13281 a.p.setGroupProperty(PropertyInterface("Position", s)), 13282 a.r.setGroupProperty(PropertyInterface("Rotation", s)), 13283 t.ir && 13284 (a.ir.setGroupProperty(PropertyInterface("Inner Radius", s)), 13285 a.is.setGroupProperty(PropertyInterface("Inner Roundness", s))), 13286 Object.defineProperties(i, { 13287 position: { get: ExpressionPropertyInterface(a.p) }, 13288 rotation: { get: ExpressionPropertyInterface(a.r) }, 13289 points: { get: ExpressionPropertyInterface(a.pt) }, 13290 outerRadius: { get: ExpressionPropertyInterface(a.or) }, 13291 outerRoundness: { get: ExpressionPropertyInterface(a.os) }, 13292 innerRadius: { get: ExpressionPropertyInterface(a.ir) }, 13293 innerRoundness: { get: ExpressionPropertyInterface(a.is) }, 13294 _name: { value: t.nm }, 13295 }), 13296 (i.mn = t.mn), 13297 i 13298 ); 13299 } 13300 function p(t, e, r) { 13301 function i(e) { 13302 return t.p.ix === e 13303 ? i.position 13304 : t.r.ix === e 13305 ? i.roundness 13306 : t.s.ix === e || "Size" === e || "ADBE Vector Rect Size" === e 13307 ? i.size 13308 : null; 13309 } 13310 var s = propertyGroupFactory(i, r), 13311 a = "tm" === e.sh.ty ? e.sh.prop : e.sh; 13312 return ( 13313 (i.propertyIndex = t.ix), 13314 a.p.setGroupProperty(PropertyInterface("Position", s)), 13315 a.s.setGroupProperty(PropertyInterface("Size", s)), 13316 a.r.setGroupProperty(PropertyInterface("Rotation", s)), 13317 Object.defineProperties(i, { 13318 position: { get: ExpressionPropertyInterface(a.p) }, 13319 roundness: { get: ExpressionPropertyInterface(a.r) }, 13320 size: { get: ExpressionPropertyInterface(a.s) }, 13321 _name: { value: t.nm }, 13322 }), 13323 (i.mn = t.mn), 13324 i 13325 ); 13326 } 13327 function f(t, e, r) { 13328 function i(e) { 13329 return t.r.ix === e || "Round Corners 1" === e ? i.radius : null; 13330 } 13331 var s = propertyGroupFactory(i, r), 13332 a = e; 13333 return ( 13334 (i.propertyIndex = t.ix), 13335 a.rd.setGroupProperty(PropertyInterface("Radius", s)), 13336 Object.defineProperties(i, { 13337 radius: { get: ExpressionPropertyInterface(a.rd) }, 13338 _name: { value: t.nm }, 13339 }), 13340 (i.mn = t.mn), 13341 i 13342 ); 13343 } 13344 function m(t, e, r) { 13345 function i(e) { 13346 return t.c.ix === e || "Copies" === e 13347 ? i.copies 13348 : t.o.ix === e || "Offset" === e 13349 ? i.offset 13350 : null; 13351 } 13352 var s = propertyGroupFactory(i, r), 13353 a = e; 13354 return ( 13355 (i.propertyIndex = t.ix), 13356 a.c.setGroupProperty(PropertyInterface("Copies", s)), 13357 a.o.setGroupProperty(PropertyInterface("Offset", s)), 13358 Object.defineProperties(i, { 13359 copies: { get: ExpressionPropertyInterface(a.c) }, 13360 offset: { get: ExpressionPropertyInterface(a.o) }, 13361 _name: { value: t.nm }, 13362 }), 13363 (i.mn = t.mn), 13364 i 13365 ); 13366 } 13367 return function (e, r, i) { 13368 var s; 13369 function a(t) { 13370 if ("number" == typeof t) 13371 return 0 === (t = void 0 === t ? 1 : t) ? i : s[t - 1];
13372 for (var e = 0, r = s.length; e < r; ) { 13373 if (s[e]._name === t) return s[e]; 13374 e += 1; 13375 } 13376 return null; 13377 } 13378 return ( 13379 (a.propertyGroup = propertyGroupFactory(a, function () { 13380 return i; 13381 })), 13382 (s = t(e, r, a.propertyGroup)), 13383 (a.numProperties = s.length), 13384 (a._name = "Contents"), 13385 a 13386 ); 13387 }; 13388 })(), 13389 TextExpressionInterface = function (t) { 13390 var e, r; 13391 function i(t) { 13392 return "ADBE Text Document" === t ? i.sourceText : null; 13393 } 13394 return ( 13395 Object.defineProperty(i, "sourceText", { 13396 get: function () { 13397 t.textProperty.getValue(); 13398 var i = t.textProperty.currentData.t; 13399 return ( 13400 i !== e && 13401 ((t.textProperty.currentData.t = e), 13402 ((r = new String(i)).value = i || new String(i))), 13403 r 13404 ); 13405 }, 13406 }), 13407 i 13408 ); 13409 }; 13410 function _typeof$2(t) { 13411 return ( 13412 (_typeof$2 = 13413 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 13414 ? function (t) { 13415 return typeof t; 13416 } 13417 : function (t) { 13418 return t && 13419 "function" == typeof Symbol && 13420 t.constructor === Symbol && 13421 t !== Symbol.prototype 13422 ? "symbol" 13423 : typeof t; 13424 }), 13425 _typeof$2(t) 13426 ); 13427 } 13428 var FootageInterface = 13429 ((dataInterfaceFactory = function (t) { 13430 function e(t) { 13431 return "Outline" === t ? e.outlineInterface() : null; 13432 } 13433 return ( 13434 (e._name = "Outline"), 13435 (e.outlineInterface = (function (t) { 13436 var e = "", 13437 r = t.getFootageData(); 13438 function i(t) { 13439 if (r[t]) 13440 return (e = t), "object" === _typeof$2((r = r[t])) ? i : r; 13441 var s = t.indexOf(e); 13442 if (-1 !== s) { 13443 var a = parseInt(t.substr(s + e.length), 10); 13444 return "object" === _typeof$2((r = r[a])) ? i : r; 13445 } 13446 return ""; 13447 } 13448 return function () { 13449 return (e = ""), (r = t.getFootageData()), i; 13450 }; 13451 })(t)), 13452 e 13453 ); 13454 }), 13455 function (t) { 13456 function e(t) { 13457 return "Data" === t ? e.dataInterface : null; 13458 } 13459 return ( 13460 (e._name = "Data"), (e.dataInterface = dataInterfaceFactory(t)), e 13461 ); 13462 }), 13463 dataInterfaceFactory, 13464 interfaces = { 13465 layer: LayerExpressionInterface, 13466 effects: EffectsExpressionInterface, 13467 comp: CompExpressionInterface, 13468 shape: ShapeExpressionInterface, 13469 text: TextExpressionInterface, 13470 footage: FootageInterface, 13471 }; 13472 function getInterface(t) { 13473 return interfaces[t] || null; 13474 } 13475 function _typeof$1(t) { 13476 return ( 13477 (_typeof$1 = 13478 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 13479 ? function (t) { 13480 return typeof t; 13481 } 13482 : function (t) { 13483 return t && 13484 "function" == typeof Symbol && 13485 t.constructor === Symbol && 13486 t !== Symbol.prototype 13487 ? "symbol" 13488 : typeof t; 13489 }), 13490 _typeof$1(t) 13491 ); 13492 } 13493 function seedRandom(t, e) { 13494 var r, 13495 i = this, 13496 s = 256, 13497 a = e.pow(s, 6), 13498 n = e.pow(2, 52), 13499 o = 2 * n, 13500 h = 255; 13501 function l(t) { 13502 var e, 13503 r = t.length, 13504 i = this, 13505 a = 0, 13506 n = (i.i = i.j = 0), 13507 o = (i.S = []); 13508 for (r || (t = [r++]); a < s; ) o[a] = a++; 13509 for (a = 0; a < s; a++) 13510 (o[a] = o[(n = h & (n + t[a % r] + (e = o[a])))]), (o[n] = e); 13511 i.g = function (t) { 13512 for (var e, r = 0, a = i.i, n = i.j, o = i.S; t--; ) 13513 (e = o[(a = h & (a + 1))]), 13514 (r = r * s + o[h & ((o[a] = o[(n = h & (n + e))]) + (o[n] = e))]); 13515 return (i.i = a), (i.j = n), r; 13516 }; 13517 } 13518 function p(t, e) { 13519 return (e.i = t.i), (e.j = t.j), (e.S = t.S.slice()), e; 13520 } 13521 function f(t, e) { 13522 var r, 13523 i = [], 13524 s = _typeof$1(t); 13525 if (e && "object" == s) 13526 for (r in t) 13527 try { 13528 i.push(f(t[r], e - 1)); 13529 } catch (t) {} 13530 return i.length ? i : "string" == s ? t : t + "\0"; 13531 } 13532 function m(t, e) { 13533 for (var r, i = t + "", s = 0; s < i.length; )
13534 e[h & s] = h & ((r ^= 19 * e[h & s]) + i.charCodeAt(s++)); 13535 return c(e); 13536 } 13537 function c(t) { 13538 return String.fromCharCode.apply(0, t); 13539 } 13540 (e.seedrandom = function (h, d, u) { 13541 var y = [], 13542 g = m( 13543 f( 13544 (d = !0 === d ? { entropy: !0 } : d || {}).entropy 13545 ? [h, c(t)] 13546 : null === h 13547 ? (function () { 13548 try { 13549 r; 13550 var e = new Uint8Array(s); 13551 return (i.crypto || i.msCrypto).getRandomValues(e), c(e); 13552 } catch (e) { 13553 var a = i.navigator, 13554 n = a && a.plugins; 13555 return [+new Date(), i, n, i.screen, c(t)]; 13556 } 13557 })() 13558 : h, 13559 3 13560 ), 13561 y 13562 ), 13563 v = new l(y), 13564 b = function () { 13565 for (var t = v.g(6), e = a, r = 0; t < n; ) 13566 (t = (t + r) * s), (e *= s), (r = v.g(1)); 13567 for (; t >= o; ) (t /= 2), (e /= 2), (r >>>= 1); 13568 return (t + r) / e; 13569 }; 13570 return ( 13571 (b.int32 = function () { 13572 return 0 | v.g(4); 13573 }), 13574 (b.quick = function () { 13575 return v.g(4) / 4294967296; 13576 }), 13577 (b.double = b), 13578 m(c(v.S), t), 13579 ( 13580 d.pass || 13581 u || 13582 function (t, r, i, s) { 13583 return ( 13584 s && 13585 (s.S && p(s, v), 13586 (t.state = function () { 13587 return p(v, {}); 13588 })), 13589 i ? ((e.random = t), r) : t 13590 ); 13591 } 13592 )(b, g, "global" in d ? d.global : this == e, d.state) 13593 ); 13594 }), 13595 m(e.random(), t); 13596 } 13597 function initialize$2(t) { 13598 seedRandom([], t); 13599 } 13600 var propTypes = { SHAPE: "shape" }; 13601 function _typeof(t) { 13602 return ( 13603 (_typeof = 13604 "function" == typeof Symbol && "symbol" == typeof Symbol.iterator 13605 ? function (t) { 13606 return typeof t; 13607 } 13608 : function (t) { 13609 return t && 13610 "function" == typeof Symbol && 13611 t.constructor === Symbol && 13612 t !== Symbol.prototype 13613 ? "symbol" 13614 : typeof t; 13615 }), 13616 _typeof(t) 13617 ); 13618 } 13619 var ExpressionManager = (function () { 13620 var ob = {}, 13621 Math = BMMath, 13622 window = null, 13623 document = null, 13624 XMLHttpRequest = null, 13625 fetch = null, 13626 frames = null; 13627 function $bm_isInstanceOfArray(t) { 13628 return t.constructor === Array || t.constructor === Float32Array; 13629 } 13630 function isNumerable(t, e) { 13631 return ( 13632 "number" === t || 13633 "boolean" === t || 13634 "string" === t || 13635 e instanceof Number 13636 ); 13637 } 13638 function $bm_neg(t) { 13639 var e = _typeof(t); 13640 if ("number" === e || "boolean" === e || t instanceof Number) 13641 return -t; 13642 if ($bm_isInstanceOfArray(t)) { 13643 var r, 13644 i = t.length, 13645 s = []; 13646 for (r = 0; r < i; r += 1) s[r] = -t[r]; 13647 return s; 13648 } 13649 return t.propType ? t.v : -t; 13650 } 13651 initialize$2(BMMath); 13652 var easeInBez = BezierFactory.getBezierEasing( 13653 0.333, 13654 0, 13655 0.833, 13656 0.833, 13657 "easeIn" 13658 ).get, 13659 easeOutBez = BezierFactory.getBezierEasing( 13660 0.167, 13661 0.167, 13662 0.667, 13663 1, 13664 "easeOut" 13665 ).get, 13666 easeInOutBez = BezierFactory.getBezierEasing( 13667 0.33, 13668 0, 13669 0.667, 13670 1, 13671 "easeInOut" 13672 ).get; 13673 function sum(t, e) { 13674 var r = _typeof(t), 13675 i = _typeof(e); 13676 if ("string" === r || "string" === i) return t + e; 13677 if (isNumerable(r, t) && isNumerable(i, e)) return t + e; 13678 if ($bm_isInstanceOfArray(t) && isNumerable(i, e)) 13679 return ((t = t.slice(0))[0] += e), t; 13680 if (isNumerable(r, t) && $bm_isInstanceOfArray(e)) 13681 return ((e = e.slice(0))[0] = t + e[0]), e; 13682 if ($bm_isInstanceOfArray(t) && $bm_isInstanceOfArray(e)) { 13683 for ( 13684 var s = 0, a = t.length, n = e.length, o = []; 13685 s < a || s < n; 13686 13687 ) 13688 ("number" == typeof t[s] || t[s] instanceof Number) && 13689 ("number" == typeof e[s] || e[s] instanceof Number) 13690 ? (o[s] = t[s] + e[s]) 13691 : (o[s] = void 0 === e[s] ? t[s] : t[s] || e[s]), 13692 (s += 1); 13693 return o; 13694 } 13695 return 0; 13696 } 13697 var add = sum; 13698 function sub(t, e) { 13699 var r = _typeof(t), 13700 i = _typeof(e); 13701 if (isNumerable(r, t) && isNumerable(i, e)) 13702 return ( 13703 "string" === r && (t = parseInt(t, 10)), 13704 "string" === i && (e = parseInt(e, 10)), 13705 t - e 13706 ); 13707 if ($bm_isInstanceOfArray(t) && isNumerable(i, e)) 13708 return ((t = t.slice(0))[0] -= e), t; 13709 if (isNumerable(r, t) && $bm_isInstanceOfArray(e)) 13710 return ((e = e.slice(0))[0] = t - e[0]), e; 13711 if ($bm_isInstanceOfArray(t) && $bm_isInstanceOfArray(e)) { 13712 for ( 13713 var s = 0, a = t.length, n = e.length, o = []; 13714 s < a || s < n; 13715 13716 ) 13717 ("number" == typeof t[s] || t[s] instanceof Number) && 13718 ("number" == typeof e[s] || e[s] instanceof Number) 13719 ? (o[s] = t[s] - e[s]) 13720 : (o[s] = void 0 === e[s] ? t[s] : t[s] || e[s]), 13721 (s += 1); 13722 return o; 13723 } 13724 return 0; 13725 } 13726 function mul(t, e) { 13727 var r, 13728 i, 13729 s, 13730 a = _typeof(t), 13731 n = _typeof(e); 13732 if (isNumerable(a, t) && isNumerable(n, e)) return t * e; 13733 if ($bm_isInstanceOfArray(t) && isNumerable(n, e)) { 13734 for ( 13735 s = t.length, r = createTypedArray("float32", s), i = 0; 13736 i < s; 13737 i += 1 13738 ) 13739 r[i] = t[i] * e; 13740 return r; 13741 } 13742 if (isNumerable(a, t) && $bm_isInstanceOfArray(e)) { 13743 for ( 13744 s = e.length, r = createTypedArray("float32", s), i = 0; 13745 i < s; 13746 i += 1 13747 ) 13748 r[i] = t * e[i]; 13749 return r; 13750 } 13751 return 0; 13752 } 13753 function div(t, e) { 13754 var r, 13755 i, 13756 s, 13757 a = _typeof(t), 13758 n = _typeof(e); 13759 if (isNumerable(a, t) && isNumerable(n, e)) return t / e; 13760 if ($bm_isInstanceOfArray(t) && isNumerable(n, e)) { 13761 for ( 13762 s = t.length, r = createTypedArray("float32", s), i = 0; 13763 i < s; 13764 i += 1 13765 ) 13766 r[i] = t[i] / e; 13767 return r; 13768 } 13769 if (isNumerable(a, t) && $bm_isInstanceOfArray(e)) { 13770 for ( 13771 s = e.length, r = createTypedArray("float32", s), i = 0; 13772 i < s; 13773 i += 1 13774 ) 13775 r[i] = t / e[i]; 13776 return r; 13777 } 13778 return 0; 13779 } 13780 function mod(t, e) { 13781 return ( 13782 "string" == typeof t && (t = parseInt(t, 10)), 13783 "string" == typeof e && (e = parseInt(e, 10)), 13784 t % e 13785 ); 13786 } 13787 var $bm_sum = sum, 13788 $bm_sub = sub, 13789 $bm_mul = mul, 13790 $bm_div = div, 13791 $bm_mod = mod; 13792 function clamp(t, e, r) { 13793 if (e > r) { 13794 var i = r; 13795 (r = e), (e = i); 13796 } 13797 return Math.min(Math.max(t, e), r); 13798 } 13799 function radiansToDegrees(t) { 13800 return t / degToRads; 13801 } 13802 var radians_to_degrees = radiansToDegrees; 13803 function degreesToRadians(t) { 13804 return t * degToRads; 13805 } 13806 var degrees_to_radians = radiansToDegrees, 13807 helperLengthArray = [0, 0, 0, 0, 0, 0]; 13808 function length(t, e) { 13809 if ("number" == typeof t || t instanceof Number) 13810 return (e = e || 0), Math.abs(t - e); 13811 var r; 13812 e || (e = helperLengthArray);
13813 var i = Math.min(t.length, e.length), 13814 s = 0; 13815 for (r = 0; r < i; r += 1) s += Math.pow(e[r] - t[r], 2); 13816 return Math.sqrt(s); 13817 } 13818 function normalize(t) { 13819 return div(t, length(t)); 13820 } 13821 function rgbToHsl(t) { 13822 var e, 13823 r, 13824 i = t[0], 13825 s = t[1], 13826 a = t[2], 13827 n = Math.max(i, s, a), 13828 o = Math.min(i, s, a), 13829 h = (n + o) / 2; 13830 if (n === o) (e = 0), (r = 0); 13831 else { 13832 var l = n - o; 13833 switch (((r = h > 0.5 ? l / (2 - n - o) : l / (n + o)), n)) { 13834 case i: 13835 e = (s - a) / l + (s < a ? 6 : 0); 13836 break; 13837 case s: 13838 e = (a - i) / l + 2; 13839 break; 13840 case a: 13841 e = (i - s) / l + 4; 13842 } 13843 e /= 6; 13844 } 13845 return [e, r, h, t[3]]; 13846 } 13847 function hue2rgb(t, e, r) { 13848 return ( 13849 r < 0 && (r += 1), 13850 r > 1 && (r -= 1), 13851 r < 1 / 6 13852 ? t + 6 * (e - t) * r 13853 : r < 0.5 13854 ? e 13855 : r < 2 / 3 13856 ? t + (e - t) * (2 / 3 - r) * 6 13857 : t 13858 ); 13859 } 13860 function hslToRgb(t) { 13861 var e, 13862 r, 13863 i, 13864 s = t[0], 13865 a = t[1], 13866 n = t[2]; 13867 if (0 === a) (e = n), (i = n), (r = n); 13868 else { 13869 var o = n < 0.5 ? n * (1 + a) : n + a - n * a, 13870 h = 2 * n - o; 13871 (e = hue2rgb(h, o, s + 1 / 3)), 13872 (r = hue2rgb(h, o, s)), 13873 (i = hue2rgb(h, o, s - 1 / 3)); 13874 } 13875 return [e, r, i, t[3]]; 13876 } 13877 function linear(t, e, r, i, s) { 13878 if ( 13879 ((void 0 !== i && void 0 !== s) || 13880 ((i = e), (s = r), (e = 0), (r = 1)), 13881 r < e) 13882 ) { 13883 var a = r; 13884 (r = e), (e = a); 13885 } 13886 if (t <= e) return i; 13887 if (t >= r) return s; 13888 var n, 13889 o = r === e ? 0 : (t - e) / (r - e); 13890 if (!i.length) return i + (s - i) * o; 13891 var h = i.length, 13892 l = createTypedArray("float32", h); 13893 for (n = 0; n < h; n += 1) l[n] = i[n] + (s[n] - i[n]) * o; 13894 return l; 13895 } 13896 function random(t, e) { 13897 if ( 13898 (void 0 === e && 13899 (void 0 === t ? ((t = 0), (e = 1)) : ((e = t), (t = void 0))), 13900 e.length) 13901 ) { 13902 var r, 13903 i = e.length; 13904 t || (t = createTypedArray("float32", i)); 13905 var s = createTypedArray("float32", i), 13906 a = BMMath.random(); 13907 for (r = 0; r < i; r += 1) s[r] = t[r] + a * (e[r] - t[r]); 13908 return s; 13909 } 13910 return void 0 === t && (t = 0), t + BMMath.random() * (e - t); 13911 } 13912 function createPath(t, e, r, i) { 13913 var s, 13914 a = t.length, 13915 n = shapePool.newElement(); 13916 n.setPathData(!!i, a); 13917 var o, 13918 h, 13919 l = [0, 0]; 13920 for (s = 0; s < a; s += 1) 13921 (o = e && e[s] ? e[s] : l), 13922 (h = r && r[s] ? r[s] : l), 13923 n.setTripleAt( 13924 t[s][0], 13925 t[s][1], 13926 h[0] + t[s][0], 13927 h[1] + t[s][1], 13928 o[0] + t[s][0], 13929 o[1] + t[s][1], 13930 s, 13931 !0 13932 ); 13933 return n; 13934 } 13935 function initiateExpression(elem, data, property) { 13936 function noOp(t) { 13937 return t; 13938 } 13939 if (!elem.globalData.renderConfig.runExpressions) return noOp; 13940 var val = data.x, 13941 needsVelocity = /velocity(?![\w\d])/.test(val), 13942 _needsRandom = -1 !== val.indexOf("random"), 13943 elemType = elem.data.ty, 13944 transform, 13945 $bm_transform, 13946 content, 13947 effect, 13948 thisProperty = property; 13949 (thisProperty.valueAtTime = thisProperty.getValueAtTime), 13950 Object.defineProperty(thisProperty, "value", { 13951 get: function () { 13952 return thisProperty.v; 13953 }, 13954 }), 13955 (elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate), 13956 (elem.comp.displayStartTime = 0); 13957 var inPoint = elem.data.ip / elem.comp.globalData.frameRate, 13958 outPoint = elem.data.op / elem.comp.globalData.frameRate, 13959 width = elem.data.sw ? elem.data.sw : 0, 13960 height = elem.data.sh ? elem.data.sh : 0, 13961 name = elem.data.nm, 13962 loopIn, 13963 loop_in, 13964 loopOut, 13965 loop_out, 13966 smooth, 13967 toWorld, 13968 fromWorld, 13969 fromComp, 13970 toComp, 13971 fromCompToSurface, 13972 position, 13973 rotation, 13974 anchorPoint, 13975 scale, 13976 thisLayer, 13977 thisComp, 13978 mask, 13979 valueAtTime, 13980 velocityAtTime, 13981 scoped_bm_rt, 13982 expression_function = eval( 13983 "[function _expression_function(){" + 13984 val + 13985 ";scoped_bm_rt=$bm_rt}]" 13986 )[0], 13987 numKeys = property.kf ? data.k.length : 0, 13988 active = !this.data || !0 !== this.data.hd, 13989 wiggle = function (t, e) { 13990 var r, 13991 i, 13992 s = this.pv.length ? this.pv.length : 1, 13993 a = createTypedArray("float32", s); 13994 var n = Math.floor(5 * time); 13995 for (r = 0, i = 0; r < n; ) { 13996 for (i = 0; i < s; i += 1) a[i] += -e + 2 * e * BMMath.random(); 13997 r += 1; 13998 } 13999 var o = 5 * time, 14000 h = o - Math.floor(o), 14001 l = createTypedArray("float32", s); 14002 if (s > 1) { 14003 for (i = 0; i < s; i += 1) 14004 l[i] = this.pv[i] + a[i] + (-e + 2 * e * BMMath.random()) * h; 14005 return l; 14006 } 14007 return this.pv + a[0] + (-e + 2 * e * BMMath.random()) * h; 14008 }.bind(this); 14009 function loopInDuration(t, e) { 14010 return loopIn(t, e, !0); 14011 } 14012 function loopOutDuration(t, e) { 14013 return loopOut(t, e, !0); 14014 } 14015 thisProperty.loopIn && 14016 ((loopIn = thisProperty.loopIn.bind(thisProperty)), 14017 (loop_in = loopIn)), 14018 thisProperty.loopOut && 14019 ((loopOut = thisProperty.loopOut.bind(thisProperty)), 14020 (loop_out = loopOut)), 14021 thisProperty.smooth && 14022 (smooth = thisProperty.smooth.bind(thisProperty)), 14023 this.getValueAtTime && 14024 (valueAtTime = this.getValueAtTime.bind(this)), 14025 this.getVelocityAtTime && 14026 (velocityAtTime = this.getVelocityAtTime.bind(this));
14027 var comp = elem.comp.globalData.projectInterface.bind( 14028 elem.comp.globalData.projectInterface 14029 ), 14030 time, 14031 velocity, 14032 value, 14033 text, 14034 textIndex, 14035 textTotal, 14036 selectorValue; 14037 function lookAt(t, e) { 14038 var r = [e[0] - t[0], e[1] - t[1], e[2] - t[2]], 14039 i = 14040 Math.atan2(r[0], Math.sqrt(r[1] * r[1] + r[2] * r[2])) / 14041 degToRads; 14042 return [-Math.atan2(r[1], r[2]) / degToRads, i, 0]; 14043 } 14044 function easeOut(t, e, r, i, s) { 14045 return applyEase(easeOutBez, t, e, r, i, s); 14046 } 14047 function easeIn(t, e, r, i, s) { 14048 return applyEase(easeInBez, t, e, r, i, s); 14049 } 14050 function ease(t, e, r, i, s) { 14051 return applyEase(easeInOutBez, t, e, r, i, s); 14052 } 14053 function applyEase(t, e, r, i, s, a) { 14054 void 0 === s ? ((s = r), (a = i)) : (e = (e - r) / (i - r)), 14055 e > 1 ? (e = 1) : e < 0 && (e = 0); 14056 var n = t(e); 14057 if ($bm_isInstanceOfArray(s)) { 14058 var o, 14059 h = s.length, 14060 l = createTypedArray("float32", h); 14061 for (o = 0; o < h; o += 1) l[o] = (a[o] - s[o]) * n + s[o]; 14062 return l; 14063 } 14064 return (a - s) * n + s; 14065 } 14066 function nearestKey(t) { 14067 var e, 14068 r, 14069 i, 14070 s = data.k.length; 14071 if (data.k.length && "number" != typeof data.k[0]) 14072 if ( 14073 ((r = -1), (t *= elem.comp.globalData.frameRate) < data.k[0].t) 14074 ) 14075 (r = 1), (i = data.k[0].t); 14076 else { 14077 for (e = 0; e < s - 1; e += 1) { 14078 if (t === data.k[e].t) { 14079 (r = e + 1), (i = data.k[e].t); 14080 break; 14081 } 14082 if (t > data.k[e].t && t < data.k[e + 1].t) { 14083 t - data.k[e].t > data.k[e + 1].t - t 14084 ? ((r = e + 2), (i = data.k[e + 1].t)) 14085 : ((r = e + 1), (i = data.k[e].t)); 14086 break; 14087 } 14088 } 14089 -1 === r && ((r = e + 1), (i = data.k[e].t)); 14090 } 14091 else (r = 0), (i = 0); 14092 var a = {}; 14093 return ( 14094 (a.index = r), (a.time = i / elem.comp.globalData.frameRate), a 14095 ); 14096 } 14097 function key(t) { 14098 var e, r, i; 14099 if (!data.k.length || "number" == typeof data.k[0]) 14100 throw new Error("The property has no keyframe at index " + t); 14101 (t -= 1), 14102 (e = { 14103 time: data.k[t].t / elem.comp.globalData.frameRate, 14104 value: [], 14105 }); 14106 var s = Object.prototype.hasOwnProperty.call(data.k[t], "s") 14107 ? data.k[t].s 14108 : data.k[t - 1].e; 14109 for (i = s.length, r = 0; r < i; r += 1) 14110 (e[r] = s[r]), (e.value[r] = s[r]); 14111 return e; 14112 } 14113 function framesToTime(t, e) { 14114 return e || (e = elem.comp.globalData.frameRate), t / e; 14115 } 14116 function timeToFrames(t, e) { 14117 return ( 14118 t || 0 === t || (t = time), 14119 e || (e = elem.comp.globalData.frameRate), 14120 t * e 14121 ); 14122 } 14123 function seedRandom(t) { 14124 BMMath.seedrandom(randSeed + t); 14125 } 14126 function sourceRectAtTime() { 14127 return elem.sourceRectAtTime(); 14128 } 14129 function substring(t, e) { 14130 return "string" == typeof value 14131 ? void 0 === e 14132 ? value.substring(t) 14133 : value.substring(t, e) 14134 : ""; 14135 } 14136 function substr(t, e) { 14137 return "string" == typeof value 14138 ? void 0 === e 14139 ? value.substr(t) 14140 : value.substr(t, e) 14141 : ""; 14142 } 14143 function posterizeTime(t) { 14144 (time = 0 === t ? 0 : Math.floor(time * t) / t), 14145 (value = valueAtTime(time)); 14146 } 14147 var index = elem.data.ind, 14148 hasParent = !(!elem.hierarchy || !elem.hierarchy.length), 14149 parent, 14150 randSeed = Math.floor(1e6 * Math.random()), 14151 globalData = elem.globalData; 14152 function executeExpression(t) { 14153 return ( 14154 (value = t), 14155 this.frameExpressionId === elem.globalData.frameId && 14156 "textSelector" !== this.propType 14157 ? value 14158 : ("textSelector" === this.propType && 14159 ((textIndex = this.textIndex), 14160 (textTotal = this.textTotal), 14161 (selectorValue = this.selectorValue)), 14162 thisLayer || 14163 ((text = elem.layerInterface.text), 14164 (thisLayer = elem.layerInterface), 14165 (thisComp = elem.comp.compInterface), 14166 (toWorld = thisLayer.toWorld.bind(thisLayer)), 14167 (fromWorld = thisLayer.fromWorld.bind(thisLayer)), 14168 (fromComp = thisLayer.fromComp.bind(thisLayer)), 14169 (toComp = thisLayer.toComp.bind(thisLayer)), 14170 (mask = thisLayer.mask 14171 ? thisLayer.mask.bind(thisLayer) 14172 : null), 14173 (fromCompToSurface = fromComp)), 14174 transform || 14175 ((transform = elem.layerInterface("ADBE Transform Group")), 14176 ($bm_transform = transform), 14177 transform && (anchorPoint = transform.anchorPoint)), 14178 4 !== elemType || 14179 content || 14180 (content = thisLayer("ADBE Root Vectors Group")), 14181 effect || (effect = thisLayer(4)), 14182 (hasParent = !(!elem.hierarchy || !elem.hierarchy.length)) && 14183 !parent && 14184 (parent = elem.hierarchy[0].layerInterface), 14185 (time = 14186 this.comp.renderedFrame / this.comp.globalData.frameRate), 14187 _needsRandom && seedRandom(randSeed + time), 14188 needsVelocity && (velocity = velocityAtTime(time)), 14189 expression_function(), 14190 (this.frameExpressionId = elem.globalData.frameId), 14191 (scoped_bm_rt = 14192 scoped_bm_rt.propType === propTypes.SHAPE 14193 ? scoped_bm_rt.v 14194 : scoped_bm_rt)) 14195 ); 14196 } 14197 return ( 14198 (executeExpression.__preventDeadCodeRemoval = [ 14199 $bm_transform, 14200 anchorPoint, 14201 time, 14202 velocity, 14203 inPoint, 14204 outPoint, 14205 width, 14206 height, 14207 name, 14208 loop_in, 14209 loop_out, 14210 smooth, 14211 toComp, 14212 fromCompToSurface, 14213 toWorld, 14214 fromWorld, 14215 mask, 14216 position, 14217 rotation, 14218 scale, 14219 thisComp, 14220 numKeys, 14221 active, 14222 wiggle, 14223 loopInDuration, 14224 loopOutDuration, 14225 comp, 14226 lookAt, 14227 easeOut, 14228 easeIn, 14229 ease, 14230 nearestKey, 14231 key, 14232 text, 14233 textIndex, 14234 textTotal, 14235 selectorValue, 14236 framesToTime, 14237 timeToFrames, 14238 sourceRectAtTime, 14239 substring, 14240 substr, 14241 posterizeTime, 14242 index, 14243 globalData, 14244 ]), 14245 executeExpression 14246 ); 14247 } 14248 return ( 14249 (ob.initiateExpression = initiateExpression), 14250 (ob.__preventDeadCodeRemoval = [ 14251 window, 14252 document, 14253 XMLHttpRequest, 14254 fetch, 14255 frames, 14256 $bm_neg, 14257 add, 14258 $bm_sum, 14259 $bm_sub, 14260 $bm_mul, 14261 $bm_div, 14262 $bm_mod, 14263 clamp, 14264 radians_to_degrees, 14265 degreesToRadians, 14266 degrees_to_radians, 14267 normalize, 14268 rgbToHsl, 14269 hslToRgb,
14270 linear, 14271 random, 14272 createPath, 14273 ]), 14274 ob 14275 ); 14276 })(), 14277 expressionHelpers = { 14278 searchExpressions: function (t, e, r) { 14279 e.x && 14280 ((r.k = !0), 14281 (r.x = !0), 14282 (r.initiateExpression = ExpressionManager.initiateExpression), 14283 r.effectsSequence.push(r.initiateExpression(t, e, r).bind(r))); 14284 }, 14285 getSpeedAtTime: function (t) { 14286 var e = this.getValueAtTime(t), 14287 r = this.getValueAtTime(t + -0.01), 14288 i = 0; 14289 if (e.length) { 14290 var s; 14291 for (s = 0; s < e.length; s += 1) i += Math.pow(r[s] - e[s], 2); 14292 i = 100 * Math.sqrt(i); 14293 } else i = 0; 14294 return i; 14295 }, 14296 getVelocityAtTime: function (t) { 14297 if (void 0 !== this.vel) return this.vel; 14298 var e, 14299 r, 14300 i = -0.001, 14301 s = this.getValueAtTime(t), 14302 a = this.getValueAtTime(t + i); 14303 if (s.length) 14304 for ( 14305 e = createTypedArray("float32", s.length), r = 0; 14306 r < s.length; 14307 r += 1 14308 ) 14309 e[r] = (a[r] - s[r]) / i; 14310 else e = (a - s) / i; 14311 return e; 14312 }, 14313 getValueAtTime: function (t) { 14314 return ( 14315 (t *= this.elem.globalData.frameRate), 14316 (t -= this.offsetTime) !== this._cachingAtTime.lastFrame && 14317 ((this._cachingAtTime.lastIndex = 14318 this._cachingAtTime.lastFrame < t 14319 ? this._cachingAtTime.lastIndex 14320 : 0), 14321 (this._cachingAtTime.value = this.interpolateValue( 14322 t, 14323 this._cachingAtTime 14324 )), 14325 (this._cachingAtTime.lastFrame = t)), 14326 this._cachingAtTime.value 14327 ); 14328 }, 14329 getStaticValueAtTime: function () { 14330 return this.pv; 14331 }, 14332 setGroupProperty: function (t) { 14333 this.propertyGroup = t; 14334 }, 14335 }; 14336 function addPropertyDecorator() { 14337 function t(t, e, r) { 14338 if (!this.k || !this.keyframes) return this.pv; 14339 t = t ? t.toLowerCase() : ""; 14340 var i, 14341 s, 14342 a, 14343 n, 14344 o, 14345 h = this.comp.renderedFrame, 14346 l = this.keyframes, 14347 p = l[l.length - 1].t; 14348 if (h <= p) return this.pv; 14349 if ( 14350 (r 14351 ? (s = 14352 p - 14353 (i = e 14354 ? Math.abs(p - this.elem.comp.globalData.frameRate * e) 14355 : Math.max(0, p - this.elem.data.ip))) 14356 : ((!e || e > l.length - 1) && (e = l.length - 1), 14357 (i = p - (s = l[l.length - 1 - e].t))), 14358 "pingpong" === t) 14359 ) { 14360 if (Math.floor((h - s) / i) % 2 != 0) 14361 return this.getValueAtTime( 14362 (i - ((h - s) % i) + s) / this.comp.globalData.frameRate, 14363 0 14364 ); 14365 } else { 14366 if ("offset" === t) { 14367 var f = this.getValueAtTime(s / this.comp.globalData.frameRate, 0), 14368 m = this.getValueAtTime(p / this.comp.globalData.frameRate, 0), 14369 c = this.getValueAtTime( 14370 (((h - s) % i) + s) / this.comp.globalData.frameRate, 14371 0 14372 ), 14373 d = Math.floor((h - s) / i); 14374 if (this.pv.length) { 14375 for (n = (o = new Array(f.length)).length, a = 0; a < n; a += 1) 14376 o[a] = (m[a] - f[a]) * d + c[a]; 14377 return o; 14378 } 14379 return (m - f) * d + c; 14380 } 14381 if ("continue" === t) { 14382 var u = this.getValueAtTime(p / this.comp.globalData.frameRate, 0), 14383 y = this.getValueAtTime( 14384 (p - 0.001) / this.comp.globalData.frameRate, 14385 0 14386 ); 14387 if (this.pv.length) { 14388 for (n = (o = new Array(u.length)).length, a = 0; a < n; a += 1) 14389 o[a] = 14390 u[a] + 14391 ((u[a] - y[a]) * ((h - p) / this.comp.globalData.frameRate)) / 14392 5e-4; 14393 return o; 14394 } 14395 return u + ((h - p) / 0.001) * (u - y); 14396 } 14397 } 14398 return this.getValueAtTime( 14399 (((h - s) % i) + s) / this.comp.globalData.frameRate, 14400 0 14401 ); 14402 } 14403 function e(t, e, r) { 14404 if (!this.k) return this.pv; 14405 t = t ? t.toLowerCase() : ""; 14406 var i, 14407 s, 14408 a, 14409 n, 14410 o, 14411 h = this.comp.renderedFrame, 14412 l = this.keyframes, 14413 p = l[0].t; 14414 if (h >= p) return this.pv; 14415 if ( 14416 (r 14417 ? (s = 14418 p + 14419 (i = e 14420 ? Math.abs(this.elem.comp.globalData.frameRate * e) 14421 : Math.max(0, this.elem.data.op - p))) 14422 : ((!e || e > l.length - 1) && (e = l.length - 1), 14423 (i = (s = l[e].t) - p)), 14424 "pingpong" === t) 14425 ) { 14426 if (Math.floor((p - h) / i) % 2 == 0) 14427 return this.getValueAtTime( 14428 (((p - h) % i) + p) / this.comp.globalData.frameRate, 14429 0 14430 ); 14431 } else { 14432 if ("offset" === t) { 14433 var f = this.getValueAtTime(p / this.comp.globalData.frameRate, 0), 14434 m = this.getValueAtTime(s / this.comp.globalData.frameRate, 0), 14435 c = this.getValueAtTime( 14436 (i - ((p - h) % i) + p) / this.comp.globalData.frameRate, 14437 0 14438 ), 14439 d = Math.floor((p - h) / i) + 1; 14440 if (this.pv.length) { 14441 for (n = (o = new Array(f.length)).length, a = 0; a < n; a += 1) 14442 o[a] = c[a] - (m[a] - f[a]) * d; 14443 return o; 14444 } 14445 return c - (m - f) * d; 14446 } 14447 if ("continue" === t) { 14448 var u = this.getValueAtTime(p / this.comp.globalData.frameRate, 0), 14449 y = this.getValueAtTime( 14450 (p + 0.001) / this.comp.globalData.frameRate, 14451 0 14452 ); 14453 if (this.pv.length) { 14454 for (n = (o = new Array(u.length)).length, a = 0; a < n; a += 1) 14455 o[a] = u[a] + ((u[a] - y[a]) * (p - h)) / 0.001; 14456 return o; 14457 } 14458 return u + ((u - y) * (p - h)) / 0.001; 14459 } 14460 } 14461 return this.getValueAtTime( 14462 (i - (((p - h) % i) + p)) / this.comp.globalData.frameRate, 14463 0 14464 ); 14465 } 14466 function r(t, e) { 14467 if (!this.k) return this.pv; 14468 if (((t = 0.5 * (t || 0.4)), (e = Math.floor(e || 5)) <= 1)
14468) 14469 return this.pv; 14470 var r, 14471 i, 14472 s = this.comp.renderedFrame / this.comp.globalData.frameRate, 14473 a = s - t, 14474 n = e > 1 ? (s + t - a) / (e - 1) : 1, 14475 o = 0, 14476 h = 0; 14477 for ( 14478 r = this.pv.length ? createTypedArray("float32", this.pv.length) : 0; 14479 o < e; 14480 14481 ) { 14482 if (((i = this.getValueAtTime(a + o * n)), this.pv.length)) 14483 for (h = 0; h < this.pv.length; h += 1) r[h] += i[h]; 14484 else r += i; 14485 o += 1; 14486 } 14487 if (this.pv.length) for (h = 0; h < this.pv.length; h += 1) r[h] /= e; 14488 else r /= e; 14489 return r; 14490 } 14491 function i(t) { 14492 this._transformCachingAtTime || 14493 (this._transformCachingAtTime = { v: new Matrix() }); 14494 var e = this._transformCachingAtTime.v; 14495 if ( 14496 (e.cloneFromProps(this.pre.props), this.appliedTransformations < 1) 14497 ) { 14498 var r = this.a.getValueAtTime(t); 14499 e.translate( 14500 -r[0] * this.a.mult, 14501 -r[1] * this.a.mult, 14502 r[2] * this.a.mult 14503 ); 14504 } 14505 if (this.appliedTransformations < 2) { 14506 var i = this.s.getValueAtTime(t); 14507 e.scale(i[0] * this.s.mult, i[1] * this.s.mult, i[2] * this.s.mult); 14508 } 14509 if (this.sk && this.appliedTransformations < 3) { 14510 var s = this.sk.getValueAtTime(t), 14511 a = this.sa.getValueAtTime(t); 14512 e.skewFromAxis(-s * this.sk.mult, a * this.sa.mult); 14513 } 14514 if (this.r && this.appliedTransformations < 4) { 14515 var n = this.r.getValueAtTime(t); 14516 e.rotate(-n * this.r.mult); 14517 } else if (!this.r && this.appliedTransformations < 4) { 14518 var o = this.rz.getValueAtTime(t), 14519 h = this.ry.getValueAtTime(t), 14520 l = this.rx.getValueAtTime(t), 14521 p = this.or.getValueAtTime(t); 14522 e.rotateZ(-o * this.rz.mult) 14523 .rotateY(h * this.ry.mult) 14524 .rotateX(l * this.rx.mult) 14525 .rotateZ(-p[2] * this.or.mult) 14526 .rotateY(p[1] * this.or.mult) 14527 .rotateX(p[0] * this.or.mult); 14528 } 14529 if (this.data.p && this.data.p.s) { 14530 var f = this.px.getValueAtTime(t), 14531 m = this.py.getValueAtTime(t); 14532 if (this.data.p.z) { 14533 var c = this.pz.getValueAtTime(t); 14534 e.translate(f * this.px.mult, m * this.py.mult, -c * this.pz.mult); 14535 } else e.translate(f * this.px.mult, m * this.py.mult, 0); 14536 } else { 14537 var d = this.p.getValueAtTime(t); 14538 e.translate( 14539 d[0] * this.p.mult, 14540 d[1] * this.p.mult, 14541 -d[2] * this.p.mult 14542 ); 14543 } 14544 return e; 14545 } 14546 function s() { 14547 return this.v.clone(new Matrix()); 14548 } 14549 var a = TransformPropertyFactory.getTransformProperty; 14550 TransformPropertyFactory.getTransformProperty = function (t, e, r) { 14551 var n = a(t, e, r); 14552 return ( 14553 n.dynamicProperties.length 14554 ? (n.getValueAtTime = i.bind(n)) 14555 : (n.getValueAtTime = s.bind(n)), 14556 (n.setGroupProperty = expressionHelpers.setGroupProperty), 14557 n 14558 ); 14559 }; 14560 var n = PropertyFactory.getProp; 14561 PropertyFactory.getProp = function (i, s, a, o, h) { 14562 var l = n(i, s, a, o, h); 14563 l.kf 14564 ? (l.getValueAtTime = expressionHelpers.getValueAtTime.bind(l)) 14565 : (l.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(l)), 14566 (l.setGroupProperty = expressionHelpers.setGroupProperty), 14567 (l.loopOut = t), 14568 (l.loopIn = e), 14569 (l.smooth = r), 14570 (l.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(l)), 14571 (l.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(l)), 14572 (l.numKeys = 1 === s.a ? s.k.length : 0), 14573 (l.propertyIndex = s.ix); 14574 var p = 0; 14575 return ( 14576 0 !== a && 14577 (p = createTypedArray( 14578 "float32", 14579 1 === s.a ? s.k[0].s.length : s.k.length 14580 )), 14581 (l._cachingAtTime = { 14582 lastFrame: initialDefaultFrame, 14583 lastIndex: 0, 14584 value: p, 14585 }), 14586 expressionHelpers.searchExpressions(i, s, l), 14587 l.k && h.addDynamicProperty(l), 14588 l 14589 ); 14590 }; 14591 var o = ShapePropertyFactory.getConstructorFunction(), 14592 h = ShapePropertyFactory.getKeyframedConstructorFunction(); 14593 function l() {} 14594 (l.prototype = { 14595 vertices: function (t, e) { 14596 this.k && this.getValue(); 14597 var r, 14598 i = this.v; 14599 void 0 !== e && (i = this.getValueAtTime(e, 0)); 14600 var s = i._length, 14601 a = i[t], 14602 n = i.v, 14603 o = createSizedArray(s);
14604 for (r = 0; r < s; r += 1) 14605 o[r] = 14606 "i" === t || "o" === t 14607 ? [a[r][0] - n[r][0], a[r][1] - n[r][1]] 14608 : [a[r][0], a[r][1]]; 14609 return o; 14610 }, 14611 points: function (t) { 14612 return this.vertices("v", t); 14613 }, 14614 inTangents: function (t) { 14615 return this.vertices("i", t); 14616 }, 14617 outTangents: function (t) { 14618 return this.vertices("o", t); 14619 }, 14620 isClosed: function () { 14621 return this.v.c; 14622 }, 14623 pointOnPath: function (t, e) { 14624 var r = this.v; 14625 void 0 !== e && (r = this.getValueAtTime(e, 0)), 14626 this._segmentsLength || 14627 (this._segmentsLength = bez.getSegmentsLength(r)); 14628 for ( 14629 var i, 14630 s = this._segmentsLength, 14631 a = s.lengths, 14632 n = s.totalLength * t, 14633 o = 0, 14634 h = a.length, 14635 l = 0; 14636 o < h; 14637 14638 ) { 14639 if (l + a[o].addedLength > n) { 14640 var p = o, 14641 f = r.c && o === h - 1 ? 0 : o + 1, 14642 m = (n - l) / a[o].addedLength; 14643 i = bez.getPointInSegment( 14644 r.v[p], 14645 r.v[f], 14646 r.o[p], 14647 r.i[f], 14648 m, 14649 a[o] 14650 ); 14651 break; 14652 } 14653 (l += a[o].addedLength), (o += 1); 14654 } 14655 return ( 14656 i || 14657 (i = r.c 14658 ? [r.v[0][0], r.v[0][1]] 14659 : [r.v[r._length - 1][0], r.v[r._length - 1][1]]), 14660 i 14661 ); 14662 }, 14663 vectorOnPath: function (t, e, r) { 14664 1 == t ? (t = this.v.c) : 0 == t && (t = 0.999); 14665 var i = this.pointOnPath(t, e), 14666 s = this.pointOnPath(t + 0.001, e), 14667 a = s[0] - i[0], 14668 n = s[1] - i[1], 14669 o = Math.sqrt(Math.pow(a, 2) + Math.pow(n, 2)); 14670 return 0 === o 14671 ? [0, 0] 14672 : "tangent" === r 14673 ? [a / o, n / o] 14674 : [-n / o, a / o]; 14675 }, 14676 tangentOnPath: function (t, e) { 14677 return this.vectorOnPath(t, e, "tangent"); 14678 }, 14679 normalOnPath: function (t, e) { 14680 return this.vectorOnPath(t, e, "normal"); 14681 }, 14682 setGroupProperty: expressionHelpers.setGroupProperty, 14683 getValueAtTime: expressionHelpers.getStaticValueAtTime, 14684 }), 14685 extendPrototype([l], o), 14686 extendPrototype([l], h), 14687 (h.prototype.getValueAtTime = function (t) { 14688 return ( 14689 this._cachingAtTime || 14690 (this._cachingAtTime = { 14691 shapeValue: shapePool.clone(this.pv), 14692 lastIndex: 0, 14693 lastTime: initialDefaultFrame, 14694 }), 14695 (t *= this.elem.globalData.frameRate), 14696 (t -= this.offsetTime) !== this._cachingAtTime.lastTime && 14697 ((this._cachingAtTime.lastIndex = 14698 this._cachingAtTime.lastTime < t ? this._caching.lastIndex : 0), 14699 (this._cachingAtTime.lastTime = t), 14700 this.interpolateShape( 14701 t, 14702 this._cachingAtTime.shapeValue, 14703 this._cachingAtTime 14704 )), 14705 this._cachingAtTime.shapeValue 14706 ); 14707 }), 14708 (h.prototype.initiateExpression = ExpressionManager.initiateExpression); 14709 var p = ShapePropertyFactory.getShapeProp; 14710 ShapePropertyFactory.getShapeProp = function (t, e, r, i, s) { 14711 var a = p(t, e, r, i, s); 14712 return ( 14713 (a.propertyIndex = e.ix), 14714 (a.lock = !1), 14715 3 === r 14716 ? expressionHelpers.searchExpressions(t, e.pt, a) 14717 : 4 === r && expressionHelpers.searchExpressions(t, e.ks, a), 14718 a.k && t.addDynamicProperty(a), 14719 a 14720 ); 14721 }; 14722 } 14723 function initialize$1() { 14724 addPropertyDecorator(); 14725 } 14726 function addDecorator() { 14727 (TextProperty.prototype.getExpressionValue = function (t, e) { 14728 var r = this.calculateExpression(e); 14729 if (t.t !== r) { 14730 var i = {}; 14731 return ( 14732 this.copyData(i, t), (i.t = r.toString()), (i.__complete = !1), i 14733 ); 14734 } 14735 return t; 14736 }), 14737 (TextProperty.prototype.searchProperty = function () { 14738 var t = this.searchKeyframes(), 14739 e = this.searchExpressions(); 14740 return (this.kf = t || e), this.kf; 14741 }), 14742 (TextProperty.prototype.searchExpressions = function () { 14743 return this.data.d.x 14744 ? ((this.calculateExpression = 14745 ExpressionManager.initiateExpression.bind(this)( 14746 this.elem, 14747 this.data.d, 14748 this 14749 )), 14750 this.addEffect(this.getExpressionValue.bind(this)), 14751 !0) 14752 : null; 14753 }); 14754 } 14755 function initialize() { 14756 addDecorator(); 14757 } 14758 function SVGComposableEffect() {} 14759 function SVGTintFilter(t, e, r, i, s) { 14760 this.filterManager = e; 14761 var a = createNS("feColorMatrix"); 14762 a.setAttribute("type", "matrix"), 14763 a.setAttribute("color-interpolation-filters", "linearRGB"), 14764 a.setAttribute( 14765 "values", 14766 "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" 14767 ), 14768 a.setAttribute("result", i + "_tint_1"), 14769 t.appendChild(a), 14770 (a = createNS("feColorMatrix")).setAttribute("type", "matrix"), 14771 a.setAttribute("color-interpolation-filters", "sRGB"), 14772 a.setAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"), 14773 a.setAttribute("result", i + "_tint_2"), 14774 t.appendChild(a), 14775 (this.matrixFilter = a); 14776 var n = this.createMergeNode(i, [s, i + "_tint_1", i + "_tint_2"]); 14777 t.appendChild(n); 14778 } 14779 function SVGFillFilter(t, e, r, i) { 14780 this.filterManager = e; 14781 var s = createNS("feColorMatrix"); 14782 s.setAttribute("type", "matrix"), 14783 s.setAttribute("color-interpolation-filters", "sRGB"), 14784 s.setAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"), 14785 s.setAttribute("result", i), 14786 t.appendChild(s), 14787 (this.matrixFilter = s); 14788 } 14789 function SVGStrokeEffect(t, e, r) { 14790 (this.initialized = !1), 14791 (this.filterManager = e), 14792 (this.elem = r), 14793 (this.paths = []); 14794 } 14795 function SVGTritoneFilter(t, e, r, i) { 14796 this.filterManager = e; 14797 var s = createNS("feColorMatrix"); 14798 s.setAttribute("type", "matrix"), 14799 s.setAttribute("color-interpolation-filters", "linearRGB"), 14800 s.setAttribute( 14801 "values", 14802 "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" 14803 ), 14804 t.appendChild(s); 14805 var a = createNS("feComponentTransfer"); 14806 a.setAttribute("color-interpolation-filters", "sRGB"), 14807 a.setAttribute("result", i), 14808 (this.matrixFilter = a); 14809 var n = createNS("feFuncR"); 14810 n.setAttribute("type", "table"), a.appendChild(n), (this.feFuncR = n); 14811 var o = createNS("feFuncG"); 14812 o.setAttribute("type", "table"), a.appendChild(o), (this.feFuncG = o); 14813 var h = createNS("feFuncB"); 14814 h.setAttribute("type", "table"), 14815 a.appendChild(h), 14816 (this.feFuncB = h), 14817 t.appendChild(a); 14818 } 14819 function SVGProLevelsFilter(t, e, r, i) { 14820 this.filterManager = e; 14821 var s = this.filterManager.effectElements, 14822 a = createNS("feComponentTransfer"); 14823 (s[10].p.k || 14824 0 !== s[10].p.v || 14825 s[11].p.k || 14826 1 !== s[11].p.v || 14827 s[12].p.k || 14828 1 !== s[12].p.v || 14829 s[13].p.k || 14830 0 !== s[13].p.v || 14831 s[14].p.k || 14832 1 !== s[14].p.v) && 14833 (this.feFuncR = this.createFeFunc("feFuncR", a)), 14834 (s[17].p.k || 14835 0 !== s[17].p.v || 14836 s[18].p.k || 14837 1 !== s[18].p.v || 14838 s[19].p.k || 14839 1 !== s[19].p.v || 14840 s[20].p.k || 14841 0 !== s[20].p.v || 14842 s[21].p.k || 14843 1 !== s[21].p.v) && 14844 (this.feFuncG = this.createFeFunc("feFuncG", a)), 14845 (s[24].p.k || 14846 0 !== s[24].p.v || 14847 s[25].p.k || 14848 1 !== s[25].p.v || 14849 s[26].p.k || 14850 1 !== s[26].p.v || 14851 s[27].p.k || 14852 0 !== s[27].p.v || 14853 s[28].p.k || 14854 1 !== s[28].p.v) && 14855 (this.feFuncB = this.createFeFunc("feFuncB", a)), 14856 (s[31].p.k || 14857 0 !== s[31].p.v || 14858 s[32].p.k || 14859 1 !== s[32].p.v || 14860 s[33].p.k || 14861 1 !== s[33].p.v || 14862 s[34].p.k || 14863 0 !== s[34].p.v || 14864 s[35].p.k || 14865 1 !== s[35].p.v) && 14866 (this.feFuncA = this.createFeFunc("feFuncA", a)), 14867 (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) && 14868 (a.setAttribute("color-interpolation-filters", "sRGB"), 14869 t.appendChild(a)), 14870 (s[3].p.k || 14871 0 !== s[3].p.v || 14872 s[4].p.k || 14873 1 !== s[4].p.v || 14874 s[5].p.k || 14875 1 !== s[5].p.v || 14876 s[6].p.k || 14877 0 !== s[6].p.v || 14878 s[7].p.k || 14879 1 !== s[7].p.v) && 14880 ((a = createNS("feComponentTransfer")).setAttribute( 14881 "color-interpolation-filters", 14882 "sRGB" 14883 ), 14884 a.setAttribute("result", i), 14885 t.appendChild(a), 14886 (this.feFuncRComposed = this.createFeFunc("feFuncR", a)), 14887 (this.feFuncGComposed = this.createFeFunc("feFuncG", a)), 14888 (this.feFuncBComposed = this.createFeFunc("feFuncB", a))); 14889 } 14890 function SVGDropShadowEffect(t, e, r, i, s) { 14891 var a = e.container.globalData.renderConfig.filterSize, 14892 n = e.data.fs || a; 14893 t.setAttribute("x", n.x || a.x), 14894 t.setAttribute("y", n.y || a.y), 14895 t.setAttribute("width", n.width || a.width), 14896 t.setAttribute("height", n.height || a.height), 14897 (this.filterManager = e); 14898 var o = createNS("feGaussianBlur"); 14899 o.setAttribute("in", "SourceAlpha"), 14900 o.setAttribute("result", i + "_drop_shadow_1"), 14901 o.setAttribute("stdDeviation", "0"), 14902 (this.feGaussianBlur = o), 14903 t.appendChild(o); 14904 var h = createNS("feOffset"); 14905 h.setAttribute("dx", "25"), 14906 h.setAttribute("dy", "0"), 14907 h.setAttribute("in", i + "_drop_shadow_1"), 14908 h.setAttribute("result", i + "_drop_shadow_2"),
14909 (this.feOffset = h), 14910 t.appendChild(h); 14911 var l = createNS("feFlood"); 14912 l.setAttribute("flood-color", "#00ff00"), 14913 l.setAttribute("flood-opacity", "1"), 14914 l.setAttribute("result", i + "_drop_shadow_3"), 14915 (this.feFlood = l), 14916 t.appendChild(l); 14917 var p = createNS("feComposite"); 14918 p.setAttribute("in", i + "_drop_shadow_3"), 14919 p.setAttribute("in2", i + "_drop_shadow_2"), 14920 p.setAttribute("operator", "in"), 14921 p.setAttribute("result", i + "_drop_shadow_4"), 14922 t.appendChild(p); 14923 var f = this.createMergeNode(i, [i + "_drop_shadow_4", s]); 14924 t.appendChild(f); 14925 } 14926 (SVGComposableEffect.prototype = { 14927 createMergeNode: function (t, e) { 14928 var r, 14929 i, 14930 s = createNS("feMerge"); 14931 for (s.setAttribute("result", t), i = 0; i < e.length; i += 1) 14932 (r = createNS("feMergeNode")).setAttribute("in", e[i]), 14933 s.appendChild(r), 14934 s.appendChild(r); 14935 return s; 14936 }, 14937 }), 14938 extendPrototype([SVGComposableEffect], SVGTintFilter), 14939 (SVGTintFilter.prototype.renderFrame = function (t) { 14940 if (t || this.filterManager._mdf) { 14941 var e = this.filterManager.effectElements[0].p.v, 14942 r = this.filterManager.effectElements[1].p.v, 14943 i = this.filterManager.effectElements[2].p.v / 100; 14944 this.matrixFilter.setAttribute( 14945 "values", 14946 r[0] - 14947 e[0] + 14948 " 0 0 0 " + 14949 e[0] + 14950 " " + 14951 (r[1] - e[1]) + 14952 " 0 0 0 " + 14953 e[1] + 14954 " " + 14955 (r[2] - e[2]) + 14956 " 0 0 0 " + 14957 e[2] + 14958 " 0 0 0 " + 14959 i + 14960 " 0" 14961 ); 14962 } 14963 }), 14964 (SVGFillFilter.prototype.renderFrame = function (t) { 14965 if (t || this.filterManager._mdf) { 14966 var e = this.filterManager.effectElements[2].p.v, 14967 r = this.filterManager.effectElements[6].p.v; 14968 this.matrixFilter.setAttribute( 14969 "values", 14970 "0 0 0 0 " + 14971 e[0] + 14972 " 0 0 0 0 " + 14973 e[1] + 14974 " 0 0 0 0 " + 14975 e[2] + 14976 " 0 0 0 " + 14977 r + 14978 " 0" 14979 ); 14980 } 14981 }), 14982 (SVGStrokeEffect.prototype.initialize = function () { 14983 var t, 14984 e, 14985 r, 14986 i, 14987 s = 14988 this.elem.layerElement.children || 14989 this.elem.layerElement.childNodes; 14990 for ( 14991 1 === this.filterManager.effectElements[1].p.v 14992 ? ((i = this.elem.maskManager.masksProperties.length), (r = 0)) 14993 : (i = (r = this.filterManager.effectElements[0].p.v - 1) + 1), 14994 (e = createNS("g")).setAttribute("fill", "none"), 14995 e.setAttribute("stroke-linecap", "round"), 14996 e.setAttribute("stroke-dashoffset", 1); 14997 r < i; 14998 r += 1 14999 ) 15000 (t = createNS("path")), 15001 e.appendChild(t), 15002 this.paths.push({ p: t, m: r }); 15003 if (3 === this.filterManager.effectElements[10].p.v) { 15004 var a = createNS("mask"), 15005 n = createElementID(); 15006 a.setAttribute("id", n), 15007 a.setAttribute("mask-type", "alpha"), 15008 a.appendChild(e), 15009 this.elem.globalData.defs.appendChild(a); 15010 var o = createNS("g"); 15011 for ( 15012 o.setAttribute("mask", "url(" + getLocationHref() + "#" + n + ")"); 15013 s[0]; 15014 15015 ) 15016 o.appendChild(s[0]); 15017 this.elem.layerElement.appendChild(o), 15018 (this.masker = a), 15019 e.setAttribute("stroke", "#fff"); 15020 } else if ( 15021 1 === this.filterManager.effectElements[10].p.v || 15022 2 === this.filterManager.effectElements[10].p.v 15023 ) { 15024 if (2 === this.filterManager.effectElements[10].p.v) 15025 for ( 15026 s = 15027 this.elem.layerElement.children || 15028 this.elem.layerElement.childNodes; 15029 s.length; 15030 15031 ) 15032 this.elem.layerElement.removeChild(s[0]); 15033 this.elem.layerElement.appendChild(e), 15034 this.elem.layerElement.removeAttribute("mask"), 15035 e.setAttribute("stroke", "#fff"); 15036 } 15037 (this.initialized = !0), (this.pathMasker = e); 15038 }), 15039 (SVGStrokeEffect.prototype.renderFrame = function (t) { 15040 var e; 15041 this.initialized || this.initialize(); 15042 var r, 15043 i, 15044 s = this.paths.length; 15045 for (e = 0; e < s; e += 1) 15046 if ( 15047 -1 !== this.paths[e].m &&
vendor: 4,287 bytes, lines 15048-15158
15048 ((r = this.elem.maskManager.viewData[this.paths[e].m]), 15049 (i = this.paths[e].p), 15050 (t || this.filterManager._mdf || r.prop._mdf) && 15051 i.setAttribute("d", r.lastPath), 15052 t || 15053 this.filterManager.effectElements[9].p._mdf || 15054 this.filterManager.effectElements[4].p._mdf || 15055 this.filterManager.effectElements[7].p._mdf || 15056 this.filterManager.effectElements[8].p._mdf || 15057 r.prop._mdf) 15058 ) { 15059 var a; 15060 if ( 15061 0 !== this.filterManager.effectElements[7].p.v || 15062 100 !== this.filterManager.effectElements[8].p.v 15063 ) { 15064 var n = 15065 0.01 * 15066 Math.min( 15067 this.filterManager.effectElements[7].p.v, 15068 this.filterManager.effectElements[8].p.v 15069 ), 15070 o = 15071 0.01 * 15072 Math.max( 15073 this.filterManager.effectElements[7].p.v, 15074 this.filterManager.effectElements[8].p.v 15075 ), 15076 h = i.getTotalLength(); 15077 a = "0 0 0 " + h * n + " "; 15078 var l, 15079 p = h * (o - n), 15080 f = 15081 1 + 15082 2 * 15083 this.filterManager.effectElements[4].p.v * 15084 this.filterManager.effectElements[9].p.v * 15085 0.01, 15086 m = Math.floor(p / f); 15087 for (l = 0; l < m; l += 1) 15088 a += 15089 "1 " + 15090 2 * 15091 this.filterManager.effectElements[4].p.v * 15092 this.filterManager.effectElements[9].p.v * 15093 0.01 + 15094 " "; 15095 a += "0 " + 10 * h + " 0 0"; 15096 } else 15097 a = 15098 "1 " + 15099 2 * 15100 this.filterManager.effectElements[4].p.v * 15101 this.filterManager.effectElements[9].p.v * 15102 0.01; 15103 i.setAttribute("stroke-dasharray", a); 15104 } 15105 if ( 15106 ((t || this.filterManager.effectElements[4].p._mdf) && 15107 this.pathMasker.setAttribute( 15108 "stroke-width", 15109 2 * this.filterManager.effectElements[4].p.v 15110 ), 15111 (t || this.filterManager.effectElements[6].p._mdf) && 15112 this.pathMasker.setAttribute( 15113 "opacity", 15114 this.filterManager.effectElements[6].p.v 15115 ), 15116 (1 === this.filterManager.effectElements[10].p.v || 15117 2 === this.filterManager.effectElements[10].p.v) && 15118 (t || this.filterManager.effectElements[3].p._mdf)) 15119 ) { 15120 var c = this.filterManager.effectElements[3].p.v; 15121 this.pathMasker.setAttribute( 15122 "stroke", 15123 "rgb(" + 15124 bmFloor(255 * c[0]) + 15125 "," + 15126 bmFloor(255 * c[1]) + 15127 "," + 15128 bmFloor(255 * c[2]) + 15129 ")" 15130 ); 15131 } 15132 }), 15133 (SVGTritoneFilter.prototype.renderFrame = function (t) { 15134 if (t || this.filterManager._mdf) { 15135 var e = this.filterManager.effectElements[0].p.v, 15136 r = this.filterManager.effectElements[1].p.v, 15137 i = this.filterManager.effectElements[2].p.v, 15138 s = i[0] + " " + r[0] + " " + e[0], 15139 a = i[1] + " " + r[1] + " " + e[1], 15140 n = i[2] + " " + r[2] + " " + e[2]; 15141 this.feFuncR.setAttribute("tableValues", s), 15142 this.feFuncG.setAttribute("tableValues", a), 15143 this.feFuncB.setAttribute("tableValues", n); 15144 } 15145 }), 15146 (SVGProLevelsFilter.prototype.createFeFunc = function (t, e) { 15147 var r = createNS(t); 15148 return r.setAttribute("type", "table"), e.appendChild(r), r; 15149 }), 15150 (SVGProLevelsFilter.prototype.getTableValue = function (t, e, r, i, s) { 15151 for ( 15152 var a, 15153 n, 15154 o = 0, 15155 h = Math.min(t, e), 15156 l = Math.max(t, e), 15157 p = Array.call(null, { length: 256 }), 15158 f = 0,
15159 m = s - i, 15160 c = e - t; 15161 o <= 256; 15162 15163 ) 15164 (n = 15165 (a = o / 256) <= h 15166 ? c < 0 15167 ? s 15168 : i 15169 : a >= l 15170 ? c < 0 15171 ? i 15172 : s 15173 : i + m * Math.pow((a - t) / c, 1 / r)), 15174 (p[f] = n), 15175 (f += 1), 15176 (o += 256 / 255); 15177 return p.join(" "); 15178 }), 15179 (SVGProLevelsFilter.prototype.renderFrame = function (t) { 15180 if (t || this.filterManager._mdf) { 15181 var e, 15182 r = this.filterManager.effectElements; 15183 this.feFuncRComposed && 15184 (t || 15185 r[3].p._mdf || 15186 r[4].p._mdf || 15187 r[5].p._mdf || 15188 r[6].p._mdf || 15189 r[7].p._mdf) && 15190 ((e = this.getTableValue( 15191 r[3].p.v, 15192 r[4].p.v, 15193 r[5].p.v, 15194 r[6].p.v, 15195 r[7].p.v 15196 )), 15197 this.feFuncRComposed.setAttribute("tableValues", e), 15198 this.feFuncGComposed.setAttribute("tableValues", e), 15199 this.feFuncBComposed.setAttribute("tableValues", e)), 15200 this.feFuncR && 15201 (t || 15202 r[10].p._mdf || 15203 r[11].p._mdf || 15204 r[12].p._mdf || 15205 r[13].p._mdf || 15206 r[14].p._mdf) && 15207 ((e = this.getTableValue( 15208 r[10].p.v, 15209 r[11].p.v, 15210 r[12].p.v, 15211 r[13].p.v, 15212 r[14].p.v 15213 )), 15214 this.feFuncR.setAttribute("tableValues", e)), 15215 this.feFuncG && 15216 (t || 15217 r[17].p._mdf || 15218 r[18].p._mdf || 15219 r[19].p._mdf || 15220 r[20].p._mdf || 15221 r[21].p._mdf) && 15222 ((e = this.getTableValue( 15223 r[17].p.v, 15224 r[18].p.v, 15225 r[19].p.v, 15226 r[20].p.v, 15227 r[21].p.v 15228 )), 15229 this.feFuncG.setAttribute("tableValues", e)), 15230 this.feFuncB && 15231 (t || 15232 r[24].p._mdf || 15233 r[25].p._mdf || 15234 r[26].p._mdf || 15235 r[27].p._mdf || 15236 r[28].p._mdf) && 15237 ((e = this.getTableValue( 15238 r[24].p.v, 15239 r[25].p.v, 15240 r[26].p.v, 15241 r[27].p.v, 15242 r[28].p.v 15243 )), 15244 this.feFuncB.setAttribute("tableValues", e)), 15245 this.feFuncA && 15246 (t || 15247 r[31].p._mdf || 15248 r[32].p._mdf || 15249 r[33].p._mdf || 15250 r[34].p._mdf || 15251 r[35].p._mdf) && 15252 ((e = this.getTableValue( 15253 r[31].p.v, 15254 r[32].p.v, 15255 r[33].p.v, 15256 r[34].p.v, 15257 r[35].p.v 15258 )), 15259 this.feFuncA.setAttribute("tableValues", e)); 15260 } 15261 }), 15262 extendPrototype([SVGComposableEffect], SVGDropShadowEffect), 15263 (SVGDropShadowEffect.prototype.renderFrame = function (t) { 15264 if (t || this.filterManager._mdf) { 15265 if ( 15266 ((t || this.filterManager.effectElements[4].p._mdf) && 15267 this.feGaussianBlur.setAttribute( 15268 "stdDeviation", 15269 this.filterManager.effectElements[4].p.v / 4 15270 ), 15271 t || this.filterManager.effectElements[0].p._mdf) 15272 ) { 15273 var e = this.filterManager.effectElements[0].p.v; 15274 this.feFlood.setAttribute( 15275 "flood-color", 15276 rgbToHex( 15277 Math.round(255 * e[0]), 15278 Math.round(255 * e[1]), 15279 Math.round(255 * e[2]) 15280 ) 15281 ); 15282 } 15283 if ( 15284 ((t || this.filterManager.effectElements[1].p._mdf) && 15285 this.feFlood.setAttribute( 15286 "flood-opacity", 15287 this.filterManager.effectElements[1].p.v / 255 15288 ), 15289 t || 15290 this.filterManager.effectElements[2].p._mdf || 15291 this.filterManager.effectElements[3].p._mdf) 15292 ) { 15293 var r = this.filterManager.effectElements[3].p.v, 15294 i = (this.filterManager.effectElements[2].p.v - 90) * degToRads, 15295 s = r * Math.cos(i), 15296 a = r * Math.sin(i);
15297 this.feOffset.setAttribute("dx", s), 15298 this.feOffset.setAttribute("dy", a); 15299 } 15300 } 15301 }); 15302 var _svgMatteSymbols = []; 15303 function SVGMatte3Effect(t, e, r) { 15304 (this.initialized = !1), 15305 (this.filterManager = e), 15306 (this.filterElem = t), 15307 (this.elem = r), 15308 (r.matteElement = createNS("g")), 15309 r.matteElement.appendChild(r.layerElement), 15310 r.matteElement.appendChild(r.transformedElement), 15311 (r.baseElement = r.matteElement); 15312 } 15313 function SVGGaussianBlurEffect(t, e, r, i) { 15314 t.setAttribute("x", "-100%"), 15315 t.setAttribute("y", "-100%"), 15316 t.setAttribute("width", "300%"), 15317 t.setAttribute("height", "300%"), 15318 (this.filterManager = e); 15319 var s = createNS("feGaussianBlur"); 15320 s.setAttribute("result", i), t.appendChild(s), (this.feGaussianBlur = s); 15321 } 15322 return ( 15323 (SVGMatte3Effect.prototype.findSymbol = function (t) { 15324 for (var e = 0, r = _svgMatteSymbols.length; e < r; ) { 15325 if (_svgMatteSymbols[e] === t) return _svgMatteSymbols[e]; 15326 e += 1; 15327 } 15328 return null; 15329 }), 15330 (SVGMatte3Effect.prototype.replaceInParent = function (t, e) { 15331 var r = t.layerElement.parentNode; 15332 if (r) { 15333 for ( 15334 var i, s = r.children, a = 0, n = s.length; 15335 a < n && s[a] !== t.layerElement; 15336 15337 ) 15338 a += 1; 15339 a <= n - 2 && (i = s[a + 1]); 15340 var o = createNS("use"); 15341 o.setAttribute("href", "#" + e), 15342 i ? r.insertBefore(o, i) : r.appendChild(o); 15343 } 15344 }), 15345 (SVGMatte3Effect.prototype.setElementAsMask = function (t, e) { 15346 if (!this.findSymbol(e)) { 15347 var r = createElementID(), 15348 i = createNS("mask"); 15349 i.setAttribute("id", e.layerId), 15350 i.setAttribute("mask-type", "alpha"), 15351 _svgMatteSymbols.push(e); 15352 var s = t.globalData.defs; 15353 s.appendChild(i); 15354 var a = createNS("symbol"); 15355 a.setAttribute("id", r), 15356 this.replaceInParent(e, r), 15357 a.appendChild(e.layerElement), 15358 s.appendChild(a); 15359 var n = createNS("use"); 15360 n.setAttribute("href", "#" + r), 15361 i.appendChild(n), 15362 (e.data.hd = !1), 15363 e.show(); 15364 } 15365 t.setMatte(e.layerId); 15366 }), 15367 (SVGMatte3Effect.prototype.initialize = function () { 15368 for ( 15369 var t = this.filterManager.effectElements[0].p.v, 15370 e = this.elem.comp.elements, 15371 r = 0, 15372 i = e.length; 15373 r < i; 15374 15375 ) 15376 e[r] && e[r].data.ind === t && this.setElementAsMask(this.elem, e[r]), 15377 (r += 1); 15378 this.initialized = !0; 15379 }), 15380 (SVGMatte3Effect.prototype.renderFrame = function () { 15381 this.initialized || this.initialize(); 15382 }), 15383 (SVGGaussianBlurEffect.prototype.renderFrame = function (t) { 15384 if (t || this.filterManager._mdf) { 15385 var e = 0.3 * this.filterManager.effectElements[0].p.v, 15386 r = this.filterManager.effectElements[1].p.v, 15387 i = 3 == r ? 0 : e, 15388 s = 2 == r ? 0 : e; 15389 this.feGaussianBlur.setAttribute("stdDeviation", i + " " + s); 15390 var a = 15391 1 == this.filterManager.effectElements[2].p.v 15392 ? "wrap" 15393 : "duplicate"; 15394 this.feGaussianBlur.setAttribute("edgeMode", a); 15395 } 15396 }), 15397 registerRenderer("canvas", CanvasRenderer), 15398 registerRenderer("html", HybridRenderer), 15399 registerRenderer("svg", SVGRenderer), 15400 ShapeModifiers.registerModifier("tm", TrimModifier), 15401 ShapeModifiers.registerModifier("pb", PuckerAndBloatModifier), 15402 ShapeModifiers.registerModifier("rp", RepeaterModifier), 15403 ShapeModifiers.registerModifier("rd", RoundCornersModifier), 15404 ShapeModifiers.registerModifier("zz", ZigZagModifier), 15405 ShapeModifiers.registerModifier("op", OffsetPathModifier), 15406 setExpressionsPlugin(Expressions), 15407 setExpressionInterfaces(getInterface), 15408 initialize$1(), 15409 initialize(), 15410 registerEffect(20, SVGTintFilter, !0), 15411 registerEffect(21, SVGFillFilter, !0), 15412 registerEffect(22, SVGStrokeEffect, !1), 15413 registerEffect(23, SVGTritoneFilter, !0), 15414 registerEffect(24, SVGProLevelsFilter, !0), 15415 registerEffect(25, SVGDropShadowEffect, !0), 15416 registerEffect(28, SVGMatte3Effect, !1), 15417 registerEffect(29, SVGGaussianBlurEffect, !0), 15418 lottie 15419 ); 15420 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.