PIXI partial
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..2dd0dbf
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,22 @@
+<!--
+    This template is for bug reports. If you are reporting a bug, please answer all the questions below.
+    If you are here for another reason (feature request, question, etc) please delete this template before continuing.
+
+    Note that leaving sections blank will make it difficult for us to troubleshoot bugs, causing delays in our response,
+    or result in closing this issue.
+
+    Please include screenshots where applicable.
+-->
+
+**Tell us about your environment**
+
+* **Browser and Browser Version:**
+* **After Effects Version:**
+
+**What did you do? Please explain the steps you took before you encountered the problem.**
+
+**What did you expect to happen?**
+
+**What actually happened? Please include as much _relevant_ detail as possible.**
+
+**Please provide a download link to the After Effects file that demonstrates the problem.**
diff --git a/.gitignore b/.gitignore
index f5e22f1..50b8903 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,7 @@
 esprima/
 bodymovinCert.p12
 ZXPSignCmd.exe
-signer.bat
\ No newline at end of file
+signer.bat
+commands.txt
+debug.txt
+package-lock.json
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..c37d67a
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,146 @@
+## V 5.1.13
+- EXPRESSIONS: fix for global variables used in functions
+- EXPRESSIONS: operations supported for arrays
+
+## V 5.1.12
+- EXPRESSIONS: improved memory management for declared functions
+- EXPRESSIONS: speedAtTime support
+- FIX: trimmed paths fix
+- FIX: destroy method fix
+- SSR: checking for navigator to create library
+
+## V 5.1.11
+- PERFORMANCE: significant improvement on the svg and canvas renderers
+- FIX: floating points fix
+
+## V 5.1.10
+- TEXT LAYERS: font measuring and some text fixes
+- FIX: 2d and 3d layers stack fix
+- FEATURE: added support for assetsPath when using animationData (@kwilliams-curago)
+- FEATURE: added getDuration method. In frames and in seconds.
+- FIX: fixed breaking change from AE 15.1 with text layers
+
+## V 5.1.9
+- EXPRESSIONS: adding name property to shape property group
+- FIX: adding timeout before checking loaded fonts
+- IMPROVEMENT: html elements now hide their base container when off render time bounds
+- FIX: undeclared variable in reverse method
+- FIX: text font issues
+
+## V 5.1.8
+- FIX: centered tracking
+- FIX: augmenting linearity threshold
+- FIX: using quaternions to calculate 3d orientation
+- FIX: undeclared variables
+- FIX: CW CCW ellipse fix
+- EXPRESSIONS: added xRotation and yRotation support
+- FEATURE: added skew to transform calculations
+- FIX: Time remap on html renderer
+- FEATURE: calculating shape bounds for html shape elements without depending on getBBox
+- FEATURE: Supporting custom tags on html renderer
+- FIX: dash array fix
+
+
+## V 5.1.7
+- FIX: looping and non looping animations end frame fix
+
+## V 5.1.6
+- FIX: HTMLRenderer image fix
+- FIX: HTMLRenderer masked comp fix
+- FIX: Text fWeight precedence over fStyle (thanks @nick-vincent)
+
+## V 5.1.5
+- FIX: text selector fix
+- FIX: text expression fix
+- FEATURE: more expressions supported
+
+## V 5.1.4
+- FIX: hidden parented layer with mask
+- FIX: gradient property animated
+- FIX: hindi combined characters support with text as font
+
+## V 5.1.3
+- FIX: Color interpolation fix
+- FIX: id and classes fix for images and solids
+- FIX: canvas nested groups transform fix
+- FIX: lottie_light.js fix 
+
+## V 5.1.2
+- FIX: Expressions switch statements adding variable declaration when missing
+
+## V 5.1.1
+- Text Layer keyframed fix
+
+## V 5.1.0
+- FEATURE: support for all text document property updates usign TextLayer.updateDocumentData (check Wiki for more information)
+- FEATURE: text layers with text boxes have two new methods: TextLayer.canResizeFont and TextLayer.setMinimumFontSize (check Wiki for more information)
+- PERFORMANCE: Significant performance improvement on all renderers
+- PERFORMANCE: repeaters significant performance improvement
+- PERFORMANCE: gradients with opacity significant performance improvement
+- REFACTOR: reduced and organized main element classes
+- TEXT: text align fix for font based text layers
+
+## V 5.0.6
+- FIX: totalFrames and resetFrames
+- FIX: canvas destroy method
+- FIX: expressions rect size support
+- FIX: multiple requestAnimationFrame fix
+- FIX: variable not being declared
+- FEATURE: support for custom viewBox
+
+## V 5.0.5
+- FIX: totalFrames now ends at previous frame to respect AE's last frame
+- FIX: duplicate requestAnimationFrame call
+- CHANGE: removed M0,0 added to every path. Should fix chrome issues.
+- REFACTOR: small changes on AnimationItem
+
+## V 5.0.4
+- FIX: if initial value for multidimensional properties was 0 and not in start point, it wasn't getting rendered
+- EXPRESSIONS: support for "anchor_point"
+- PERFORMANCE: separated opacity from transform properties
+- FIX: effects properties offset
+- FIX: 3d orientation for negative values
+
+## V 5.0.3
+- FIX: IE Arrays support
+- FIX: destroy method wasn't releasing all memory if a single animation was loaded.
+- FIX: IE masks fix when used as Alpha Masks with gradients.
+
+## V 5.0.2
+- IE 10 fix
+- loopIn and loopOut fix
+
+## V 5.0.1
+- expression fixes
+- text box fix
+- performance improvements
+
+## V 5.0.0
+- bodymovin renamed to lottie!
+- gradients performance improved
+- cleaned up code
+
+## V 4.13.0
+- text expression support
+- text update support with updateDocumentData (check wiki)
+- tangentOnPath, normalOnPath and more expressions
+- loaded_images event
+- fixed global calls
+- fixed ie9 error
+
+## V 4.12.3
+- valueAtTime fix
+
+## V 4.12.2
+- caching fix
+
+## V 4.12.1
+- velocityAtTime fix
+
+## V 4.12.0
+- pointOnLine support
+- createPath support
+- points, inTangents, outTangents support
+- expressions fixes
+- className for  container via loading config
+- 3d orientation fix
\ No newline at end of file
diff --git a/History.md b/History.md
index 4d12070..31d6d02 100644
--- a/History.md
+++ b/History.md
@@ -1,3 +1,209 @@
+## V 5.1.13
+- EXPRESSIONS: fix for global variables used in functions
+- EXPRESSIONS: operations supported for arrays
+
+## V 5.1.12
+- EXPRESSIONS: improved memory management for declared functions
+- EXPRESSIONS: speedAtTime support
+- FIX: trimmed paths fix
+- FIX: destroy method fix
+- SSR: checking for navigator to create library
+
+## V 5.1.11
+- PERFORMANCE: significant improvement on the svg and canvas renderers
+- FIX: floating points fix
+
+## V 5.1.10
+- TEXT LAYERS: font measuring and some text fixes
+- FIX: 2d and 3d layers stack fix
+- FEATURE: added support for assetsPath when using animationData (@kwilliams-curago)
+- FEATURE: added getDuration method. In frames and in seconds.
+- FIX: fixed breaking change from AE 15.1 with text layers
+
+## V 5.1.9
+- EXPRESSIONS: adding name property to shape property group
+- FIX: adding timeout before checking loaded fonts
+- IMPROVEMENT: html elements now hide their base container when off render time bounds
+- FIX: undeclared variable in reverse method
+- FIX: text font issues
+
+## V 5.1.8
+- FIX: centered tracking
+- FIX: augmenting linearity threshold
+- FIX: using quaternions to calculate 3d orientation
+- FIX: undeclared variables
+- FIX: CW CCW ellipse fix
+- EXPRESSIONS: added xRotation and yRotation support
+- FEATURE: added skew to transform calculations
+- FIX: Time remap on html renderer
+- FEATURE: calculating shape bounds for html shape elements without depending on getBBox
+- FEATURE: Supporting custom tags on html renderer
+- FIX: dash array fix
+
+## V 5.1.7
+- FIX: looping and non looping animations end frame fix
+
+## V 5.1.6
+- FIX: HTMLRenderer image fix
+- FIX: HTMLRenderer masked comp fix
+- FIX: Text fWeight precedence over fStyle (thanks @nick-vincent)
+
+## V 5.1.5
+- FIX: text selector fix
+- FIX: text expression fix
+- FEATURE: more expressions supported
+
+## V 5.1.4
+- FIX: hidden parented layer with mask
+- FIX: gradient property animated
+- FIX: hindi combined characters support with text as font
+
+## V 5.1.3
+- FIX: Color interpolation fix
+- FIX: id and classes fix for images and solids
+- FIX: canvas nested groups transform fix
+- FIX: lottie_light.js fix 
+
+## V 5.1.2
+- FIX: Expressions switch statements adding variable declaration when missing
+
+## V 5.1.1
+- Text Layer keyframed fix
+
+## V 5.1.0
+- FEATURE: support for all text document property updates usign TextLayer.updateDocumentData (check Wiki for more information)
+- FEATURE: text layers with text boxes have two new methods: TextLayer.canResizeFont and TextLayer.setMinimumFontSize (check Wiki for more information)
+- PERFORMANCE: Significant performance improvement on all renderers
+- PERFORMANCE: repeaters significant performance improvement
+- PERFORMANCE: gradients with opacity significant performance improvement
+- REFACTOR: reduced and organized main element classes
+- TEXT: text align fix for font based text layers
+
+## V 5.0.6
+- FIX: totalFrames and resetFrames
+- FIX: canvas destroy method
+- FIX: expressions rect size support
+- FIX: multiple requestAnimationFrame fix
+- FIX: variable not being declared
+- FEATURE: support for custom viewBox
+
+## V 5.0.5
+- FIX: totalFrames now ends at previous frame to respect AE's last frame
+- FIX: duplicate requestAnimationFrame call
+- CHANGE: removed M0,0 added to every path. Should fix chrome issues.
+- REFACTOR: small changes on AnimationItem
+
+## V 5.0.4
+- FIX: if initial value for multidimensional properties was 0 and not in start point, it wasn't getting rendered
+- EXPRESSIONS: support for "anchor_point"
+- PERFORMANCE: separated opacity from transform properties
+- FIX: effects properties offset
+- FIX: 3d orientation for negative values
+
+## V 5.0.3
+- FIX: IE Arrays support
+- FIX: destroy method wasn't releasing all memory if a single animation was loaded.
+- FIX: IE masks fix when used as Alpha Masks with gradients.
+
+## V 5.0.2
+- IE 10 fix
+- loopIn and loopOut fix
+
+## V 5.0.1
+- expression fixes
+- text box fix
+- performance improvements
+
+## V 5.0.0
+- bodymovin renamed to lottie
+- gradients performance improved
+- cleaned up code
+- new expressions
+
+## V 4.13.0
+- text expression support
+- text update support with updateDocumentData (check wiki)
+- tangentOnPath, normalOnPath and more expressions
+- loaded_images event
+- fixed global calls
+- fixed ie9 error
+
+## V 4.12.3
+- valueAtTime fix
+
+## V 4.12.2
+- caching fix
+
+## V 4.12.1
+- velocityAtTime fix
+
+## V 4.12.0
+- pointOnLine support
+- createPath support
+- points, inTangents, outTangents support
+- expressions fixes
+- className for  container via loading config
+- 3d orientation fix
+
+## V 4.11.2
+- new line text fix
+- expression fromComp support
+- rounding to decimals shapes to prevent exponential values
+
+## V 4.11.1
+- 3d and 2d layers html renderer fix
+- text new lines fix
+- text tracking with alignment fix
+
+## V 4.11.0
+- bodymovin.setLocationHref method to set base url for svg fragments
+- optional viewBox only settings on renderConfig
+- sourceRectAtTime support for text on svg renderer
+- text fixes and performance improvements
+
+## V 4.10.3
+- fix for AE CC2014 when reopening App
+- line cap - projecting cap support
+- AVD fix for AE CC2014
+
+## V 4.10.2
+- AVD fixes
+
+## V 4.10.1
+- Expression fix
+
+## V 4.10.0
+- Lots of new expressions
+- Ouroboros 2.0 support! (in beta just in case)
+- AVD Format export!
+
+## V 4.9.0
+- Full repeaters support
+- Keyframes interpolation fix for stretched layers
+- inBrowser method added 
+
+## V 4.8.0
+- Fonts fix for Lottie compatibility
+- fonts reduced exported filesize
+- fonts fix for non-zero width character
+- expressions transform separate dimensions fix
+- expression shape rectangle size support
+
+## V 4.7.1
+- still images validation fix
+- expression for transform on separate dimensions fix
+
+## V 4.7.0
+- hiding elements when opacity is at 0
+- colinear points fix
+- anchor point expression fix
+- server side rendering window object validation (thanks @zephinzer)
+
+## V 4.6.11
+- Non spatial interpolation fix
+- new expressions supported
+- fonts fix
+
 ## V 4.6.10
 - AE language export fix
 - nearestKey expression fix
diff --git a/README.md b/README.md
index 8fbb1ce..6c4d976 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,39 @@
-# bodymovin
-After Effects plugin for exporting animations to svg/canvas/html + js
+# Lottie for Web, [Android](https://github.com/airbnb/lottie-android), [iOS](https://github.com/airbnb/lottie-ios), and [React Native](https://github.com/airbnb/lottie-react-native)
 
-## V 4.6.10
-- AE language export fix
-- nearestKey expression fix
+Lottie is a mobile library for Web,  and iOS that parses [Adobe After Effects](http://www.adobe.com/products/aftereffects.html) animations exported as json with [Bodymovin](https://github.com/airbnb/lottie-web) and renders them natively on mobile!
 
-## V 4.6.9
-- new expressions. More Rubberhose support
-- expression fixes
-- expression sandboxing window and document
-- pointInLine 3d fix
+For the first time, designers can create **and ship** beautiful animations without an engineer painstakingly recreating it by hand. They say a picture is worth 1,000 words so here are 13,000:
+
+
+
+# View documentation, FAQ, help, examples, and more at [airbnb.io/lottie](http://airbnb.io/lottie/)
+
+
+
+![Example1](gifs/Example1.gif)
+
+
+![Example2](gifs/Example2.gif)
+
+
+![Example3](gifs/Example3.gif)
+
+
+![Community](gifs/Community%202_3.gif)
+
+
+![Example4](gifs/Example4.gif)
+
 
 # Plugin installation
 
 ### Option 1 (Recommended):
-**Download it from from AE scripts:**
+**Download it from from aescripts + aeplugins:**
 http://aescripts.com/bodymovin/
 
 ### Option 2:
-**Or get it from the adobe store**  
-https://creative.adobe.com/addons/products/12557  
+**Or get it from the adobe store**
+https://creative.adobe.com/addons/products/12557
 CC 2014 and up.
 
 ## Other installation options:
@@ -31,40 +45,53 @@
 
 ### Option 4:
 - Close After Effects<br/>
-- Extract the zipped file on build/extension/bodymovin.zxp to the adobe CEP folder:<br/>
+- Extract the zipped file on `build/extension/bodymovin.zxp` to the adobe CEP folder:<br/>
 WINDOWS:<br/>
-C:\Program Files (x86)\Common Files\Adobe\CEP\extensions or<br/>
-C:\<username>\AppData\Roaming\Adobe\CEP\extensions<br/>
+`C:\Program Files (x86)\Common Files\Adobe\CEP\extensions or`<br/>
+`C:\<username>\AppData\Roaming\Adobe\CEP\extensions`<br/>
 MAC:<br/>
-/Library/Application\ Support/Adobe/CEP/extensions/bodymovin<br/>
+`/Library/Application\ Support/Adobe/CEP/extensions/bodymovin`<br/>
 (you can open the terminal and type:<br/>
-cp -R YOURUNZIPEDFOLDERPATH/extension /Library/Application\ Support/Adobe/CEP/extensions/bodymovin<br/>
+`$ cp -R YOURUNZIPEDFOLDERPATH/extension /Library/Application\ Support/Adobe/CEP/extensions/bodymovin`<br/>
 then type:<br/>
-ls /Library/Application\ Support/Adobe/CEP/extensions/bodymovin<br/>
+`$ ls /Library/Application\ Support/Adobe/CEP/extensions/bodymovin`<br/>
 to make sure it was copied correctly type)<br/>
 
 - Edit the registry key:<br/>
 WINDOWS:<br/>
-open the registry key HKEY_CURRENT_USER/Software/Adobe/CSXS.6 and add a key named PlayerDebugMode, of type String, and value 1.<br/>
+open the registry key `HKEY_CURRENT_USER/Software/Adobe/CSXS.6` and add a key named `PlayerDebugMode`, of type String, and value `1`.<br/>
 MAC:<br/>
-open the file ~/Library/Preferences/com.adobe.CSXS.6.plist and add a row with key PlayerDebugMode, of type String, and value 1.<br/>
+open the file `~/Library/Preferences/com.adobe.CSXS.6.plist` and add a row with key `PlayerDebugMode`, of type String, and value `1`.<br/>
 
 ### Option 5:
 
 Install the zxp manually following the instructions here:
-https://helpx.adobe.com/x-productkb/global/installingextensionsandaddons.html  
+https://helpx.adobe.com/x-productkb/global/installingextensionsandaddons.html
 Skip directly to "Install third-party extensions"
 
+### Option 6:
+
+Install with [Homebrew](http://brew.sh)-[adobe](https://github.com/danielbayley/homebrew-adobe):
+```bash
+brew tap danielbayley/adobe
+brew cask install lottie
+```
+
 ### After installing
-- Go to Edit > Preferences > General > and check on "Allow Scripts to Write Files and Access Network"
+- **Windows:** Go to Edit > Preferences > General > and check on "Allow Scripts to Write Files and Access Network"
+- **Mac:** Go to Adobe After Effects > Preferences > General > and check on "Allow Scripts to Write Files and Access Network"
 
 # HTML player installation
-```node
-npm install bodymovin
-```  
-Or you can use the script file from here:  
-https://cdnjs.com/libraries/bodymovin  
-Or get it directly from the AE plugin clicking on Get Player  
+```bash
+# with npm
+npm install lottie-web
+
+# with bower
+bower install bodymovin
+```
+Or you can use the script file from here:
+https://cdnjs.com/libraries/bodymovin
+Or get it directly from the AE plugin clicking on Get Player
 
 # Demo
 [See a basic implementation here.](https://codepen.io/airnan/project/editor/ZeNONO/) <br/>
@@ -83,12 +110,12 @@
 - look for the exported json file (if you had images or AI layers on your animation, there will be an images folder with the exported files)
 
 ### HTML
-- get the bodymovin.js file from the build/player/ folder for the latest build
+- get the lottie.js file from the build/player/ folder for the latest build
 - include the .js file on your html (remember to gzip it for production)
 ```html
-<script src="js/bodymovin.js" type="text/javascript"></script>
+<script src="js/lottie.js" type="text/javascript"></script>
 ```
-You can call bodymovin.loadAnimation() to start an animation.
+You can call lottie.loadAnimation() to start an animation.
 It takes an object as a unique param with:
 - animationData: an Object with the exported animation data.
 - path: the relative path to the animation object. (animationData and path are mutually exclusive)
@@ -96,48 +123,86 @@
 - autoplay: true / false it will start playing as soon as it is ready
 - name: animation name for future reference
 - renderer: 'svg' / 'canvas' / 'html' to set the renderer
-- container: the dom element on which to render the animation  
+- container: the dom element on which to render the animation
 
 
 It returns the animation instance you can control with play, pause, setSpeed, etc.
 
 ```js
-bodymovin.loadAnimation({
+lottie.loadAnimation({
   container: element, // the dom element that will contain the animation
   renderer: 'svg',
   loop: true,
   autoplay: true,
-  path: ‘data.json’ // the path to the animation json
+  path: 'data.json' // the path to the animation json
 });
 ```
 
 #### Composition Settings:
-Check this wiki page for an explanation for each setting.  
-https://github.com/bodymovin/bodymovin/wiki/Composition-Settings  
+Check this wiki page for an explanation for each setting.
+https://github.com/airbnb/lottie-web/wiki/Composition-Settings
 
 ## Usage
-animation instances have these main methods:
-**anim.play()** <br/>
-**anim.stop()** <br/>
-**anim.pause()** <br/>
-**anim.setSpeed(speed)** -- one param speed (1 is normal speed) <br/>
-**anim.goToAndStop(value, isFrame)** first param is a numeric value. second param is a boolean that defines time or frames for first param <br/>
-**anim.goToAndPlay(value, isFrame)** first param is a numeric value. second param is a boolean that defines time or frames for first param <br/>
-**anim.setDirection(direction)** -- one param direction (1 is normal direction.) <br/>
-**anim.playSegments(segments, forceFlag)** -- first param is a single array or multiple arrays of two values each(fromFrame,toFrame), second param is a boolean for forcing the new segment right away<br/>
-**anim.setSubframe(flag)** -- If false, it will respect the original AE fps. If true, it will update as much as possible. (true by default)<br/>
-**anim.destroy()**<br/>
+Animation instances have these main methods:
+### play
 
-bodymovin has 8 main methods:
-**bodymovin.play()** -- with 1 optional parameter **name** to target a specific animation <br/>
-**bodymovin.stop()** -- with 1 optional parameter **name** to target a specific animation <br/>
-**bodymovin.setSpeed()** -- first param speed (1 is normal speed) -- with 1 optional parameter **name** to target a specific animation <br/>
-**bodymovin.setDirection()** -- first param direction (1 is normal direction.) -- with 1 optional parameter **name** to target a specific animation <br/>
-**bodymovin.searchAnimations()** -- looks for elements with class "bodymovin" <br/>
-**bodymovin.loadAnimation()** -- Explained above. returns an animation instance to control individually. <br/>
-**bodymovin.destroy()** -- To destroy and release resources. The DOM element will be emptied.<br />
-**bodymovin.registerAnimation()** -- you can register an element directly with registerAnimation. It must have the "data-animation-path" attribute pointing at the data.json url<br />
-**bodymovin.setQuality()** -- default 'high', set 'high','medium','low', or a number > 1 to improve player performance. In some animations as low as 2 won't show any difference.<br />
+***
+### stop
+
+***
+### pause
+
+***
+### setLocationHref(href)
+- `href`: usually pass as `location.href`. Its useful when you experience mask issue in safari where your url does not have `#` symbol.
+
+***
+### setSpeed(speed)
+- `speed`: 1 is normal speed.
+
+***
+### goToAndStop(value, isFrame)
+- `value`: numeric value.
+- `isFrame`: defines if first argument is a time based value or a frame based (default false).
+
+***
+### goToAndPlay(value, isFrame)
+- `value`: numeric value.
+- `isFrame`: defines if first argument is a time based value or a frame based (default false).
+
+***
+### setDirection(direction)
+- `direction`: 1 is forward, -1 is reverse.
+
+***
+### playSegments(segments, forceFlag)
+- `segments`: array. Can contain 2 numeric values that will be used as first and last frame of the animation. Or can contain a sequence of arrays each with 2 numeric values.
+- `forceFlag`: boolean. If set to false, it will wait until the current segment is complete. If true, it will update values immediately.
+***
+### setSubframe(useSubFrames)
+- `useSubFrames`:  If false, it will respect the original AE fps. If true, it will update on every requestAnimationFrame with intermediate values. Default is true.
+***
+### destroy()
+***
+### getDuration(inFrames)
+- `inFrames`:  If true, returns duration in frames, if false, in seconds.
+***
+
+### Additional methods:
+- updateTextDocumentData -- updates a text layer's data
+[More Info](https://github.com/airbnb/lottie-web/wiki/TextLayer.updateDocumentData)
+***
+
+### Lottie has 8 global methods that will affect all animations:
+**lottie.play()** -- with 1 optional parameter **name** to target a specific animation <br/>
+**lottie.stop()** -- with 1 optional parameter **name** to target a specific animation <br/>
+**lottie.setSpeed()** -- first argument speed (1 is normal speed) -- with 1 optional parameter **name** to target a specific animation <br/>
+**lottie.setDirection()** -- first argument direction (1 is normal direction.) -- with 1 optional parameter **name** to target a specific animation <br/>
+**lottie.searchAnimations()** -- looks for elements with class "lottie" or "bodymovin" <br/>
+**lottie.loadAnimation()** -- Explained above. returns an animation instance to control individually. <br/>
+**lottie.destroy()** -- To destroy and release resources. The DOM element will be emptied.<br />
+**lottie.registerAnimation()** -- you can register an element directly with registerAnimation. It must have the "data-animation-path" attribute pointing at the data.json url<br />
+**lottie.setQuality()** -- default 'high', set 'high','medium','low', or a number > 1 to improve player performance. In some animations as low as 2 won't show any difference.<br />
 
 ## Events
 - onComplete
@@ -152,13 +217,14 @@
 - segmentStart
 - config_ready (when initial config is done)
 - data_ready (when all parts of the animation have been loaded)
+- loaded_images (when all image loads have either succeeded or errored)
 - DOMLoaded (when elements have been added to the DOM)
 - destroy
 
 #### Other loading options
 - if you want to use an existing canvas to draw, you can pass an extra object: 'renderer' with the following configuration:
 ```js
-bodymovin.loadAnimation({
+lottie.loadAnimation({
   container: element, // the dom element
   renderer: 'svg',
   loop: true,
@@ -167,40 +233,38 @@
   rendererSettings: {
     context: canvasContext, // the canvas context
     scaleMode: 'noScale',
-    clearCanvas: false
+    clearCanvas: false,
+    progressiveLoad: false, // Boolean, only svg renderer, loads dom elements when needed. Might speed up initialization for large number of elements.
+    hideOnTransparent: true, //Boolean, only svg renderer, hides elements when opacity reaches 0 (defaults to true)
+    className: 'some-css-class-name'
   }
 });
 ```
 Doing this you will have to handle the canvas clearing after each frame
 <br/>
 Another way to load animations is adding specific attributes to a dom element.
-You have to include a div and set it's class to bodymovin.
-If you do it before page load, it will automatically search for all tags with the class "bodymovin".
-Or you can call bodymovin.searchAnimations() after page load and it will search all elements with the class "bodymovin".
+You have to include a div and set it's class to "lottie".
+If you do it before page load, it will automatically search for all tags with the class "lottie".
+Or you can call `lottie.searchAnimations()` after page load and it will search all elements with the class "lottie".
 <br/>
-- add the data.json to a folder relative to the html
-- create a div that will contain the animation.
-<br/>
- **Required**
- <br/>
- . a class called "bodymovin"
- . a "data-animation-path" attribute with relative path to the data.json
- <br/>
-**Optional**
-<br/>
- . a "data-anim-loop" attribute
- . a "data-name" attribute to specify a name to target play controls specifically
- <br/>
- **Example**
- <br/> 
+- Add the data.json to a folder relative to the html
+- Create a div that will contain the animation.
+- **Required**
+  - A class called "lottie"
+  - A "data-animation-path" attribute with relative path to the data.json
+- **Optional**
+  - A "data-anim-loop" attribute
+  - A "data-name" attribute to specify a name to target play controls specifically
+
+**Example**
+
 ```html
- <div style="width:1067px;height:600px" class="bodymovin" data-animation-path="animation/" data-anim-loop="true" data-name="ninja"></div>
+ <div style="width:1067px;height:600px"  class="lottie" data-animation-path="animation/" data-anim-loop="true" data-name="ninja"></div>
 ```
-<br/>
 
 
 
-## Preview  
+## Preview
 You can preview or take an svg snapshot of the animation to use as poster. After you render your animation, you can take a snapshot of any frame in the animation and save it to your disk. I recommend to pass the svg through an svg optimizer like https://jakearchibald.github.io/svgomg/ and play around with their settings.<br/>
 
 ## Recommendations
@@ -222,17 +286,22 @@
 
 
 ## AE Feature Support
-- The script supports precomps, shapes, solids, images, null objects, texts  
-- It supports masks and inverted masks. Maybe other modes will come but it has a huge performance hit.  
-- It supports time remapping  
-- The script supports shapes, rectangles, ellipses and stars.  
-- Expressions. Check the wiki page for [more info.](https://github.com/bodymovin/bodymovin/wiki/Expressions)  
-- Not supported: image sequences, videos and audio are not supported  
+- The script supports precomps, shapes, solids, images, null objects, texts
+- It supports masks and inverted masks. Maybe other modes will come but it has a huge performance hit.
+- It supports time remapping
+- The script supports shapes, rectangles, ellipses and stars.
+- Expressions. Check the wiki page for [more info.](https://github.com/bodymovin/bodymovin/wiki/Expressions)
+- Not supported: image sequences, videos and audio are not supported
 - **No  negative layer stretching**! No idea why, but stretching a layer messes with all the data.
 
+## Development
+`npm install` or `bower install` first
+`npm start`
+
 ## Notes
 - If you want to modify the parser or the player, there are some gulp commands that can simplify the task
 - look at the great animations exported on codepen [See examples on codepen.](http://codepen.io/collection/nVYWZR/)
 - gzipping the animation jsons and the player have a huge reduction on the filesize. I recommend doing it if you use it for a project.
 
-
+## Issues
+- For missing mask in Safari browser, please anim.setLocationHref(locationHref) before animation is generated. It usually caused by usage of base tag in html. (see above for description of setLocationHref)
diff --git a/bower.json b/bower.json
new file mode 100644
index 0000000..d3809e9
--- /dev/null
+++ b/bower.json
@@ -0,0 +1,31 @@
+{
+  "name": "bodymovin",
+  "description": "After Effects plugin for exporting animations to SVG + JavaScript or canvas + JavaScript",
+  "main": "./build/player/bodymovin.js",
+  "authors": [
+    "hernan <bodymovin@users.noreply.github.com>"
+  ],
+  "license": "MIT",
+  "keywords": [
+    "animation",
+    "canvas",
+    "svg",
+    "after",
+    "effects",
+    "plugin",
+    "export"
+  ],
+  "homepage": "https://github.com/bodymovin/bodymovin",
+  "ignore": [
+    "**/.*",
+    "bower_components",
+    "node_modules",
+    "player/",
+    "test",
+    "tests"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/bodymovin/bodymovin.git"
+  }
+}
diff --git a/build/extension/bodymovin.zxp b/build/extension/bodymovin.zxp
index 87a49ed..280bd60 100644
--- a/build/extension/bodymovin.zxp
+++ b/build/extension/bodymovin.zxp
Binary files differ
diff --git a/build/player/bodymovin.min.js b/build/player/bodymovin.min.js
deleted file mode 100644
index 2fcfe64..0000000
--- a/build/player/bodymovin.min.js
+++ /dev/null
@@ -1,10 +0,0 @@
-!function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof module&&module.exports?module.exports=e():t.bodymovin=e()}(window,function(){function ProjectInterface(){return{}}function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function roundTo2Decimals(t){return Math.round(1e4*t)/1e4}function roundTo3Decimals(t){return Math.round(100*t)/100}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function styleUnselectableDiv(t){t.style.userSelect="none",t.style.MozUserSelect="none",t.style.webkitUserSelect="none",t.style.oUserSelect="none"}function BMEnterFrameEvent(t,e,r,s){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=0>s?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=0>e?-1:1}function BMCompleteLoopEvent(t,e,r,s){this.type=t,this.currentLoop=e,this.totalLoops=r,this.direction=0>s?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function _addEventListener(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)}function _removeEventListener(t,e){if(e){if(this._cbs[t]){for(var r=0,s=this._cbs[t].length;s>r;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,s-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}function _triggerEvent(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,s=0;r>s;s++)this._cbs[t][s](e)}function randomString(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var r,s="";for(r=t;r>0;--r)s+=e[Math.round(Math.random()*(e.length-1))];return s}function HSVtoRGB(t,e,r){var s,i,a,n,o,h,l,p;switch(1===arguments.length&&(e=t.s,r=t.v,t=t.h),n=Math.floor(6*t),o=6*t-n,h=r*(1-e),l=r*(1-o*e),p=r*(1-(1-o)*e),n%6){case 0:s=r,i=p,a=h;break;case 1:s=l,i=r,a=h;break;case 2:s=h,i=r,a=p;break;case 3:s=h,i=l,a=r;break;case 4:s=p,i=h,a=r;break;case 5:s=r,i=h,a=l}return[s,i,a]}function RGBtoHSV(t,e,r){1===arguments.length&&(e=t.g,r=t.b,t=t.r);var s,i=Math.max(t,e,r),a=Math.min(t,e,r),n=i-a,o=0===i?0:n/i,h=i/255;switch(i){case a:s=0;break;case t:s=e-r+n*(r>e?6:0),s/=6*n;break;case e:s=r-t+2*n,s/=6*n;break;case r:s=t-e+4*n,s/=6*n}return[s,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,r[1]>1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}function componentToHex(t){var e=t.toString(16);return 1==e.length?"0"+e:e}function fillToRgba(t,e){if(!cachedColors[t]){var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);cachedColors[t]=parseInt(r[1],16)+","+parseInt(r[2],16)+","+parseInt(r[3],16)}return"rgba("+cachedColors[t]+","+e+")"}function RenderedFrame(t,e){this.tr=t,this.o=e}function LetterProps(t,e,r,s,i,a){this.o=t,this.sw=e,this.sc=r,this.fc=s,this.m=i,this.props=a}function iterateDynamicProperties(t){var e,r=this.dynamicProperties;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(t)}function reversePath(t){var e,r,s=[],i=[],a=[],n={},o=0;t.c&&(s[0]=t.o[0],i[0]=t.i[0],a[0]=t.v[0],o=1),r=t.i.length;var h=r-1;for(e=o;r>e;e+=1)s.push(t.o[h]),i.push(t.i[h]),a.push(t.v[h]),h-=1;return n.i=s,n.o=i,n.v=a,n}function Matrix(){}function matrixManagerFunction(){var t=new Matrix,e=function(e,r,s,i,a){return t.reset().translate(i,a).rotate(e).scale(r,s).toCSS()},r=function(t){return e(t.tr.r[2],t.tr.s[0],t.tr.s[1],t.tr.p[0],t.tr.p[1])};return{getMatrix:r}}function createElement(t,e,r){if(!e){var s=Object.create(t.prototype,r),i={};return s&&"[object Function]"===i.toString.call(s.init)&&s.init(),s}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype._parent=t.prototype}function extendPrototype(t,e){for(var r in t.prototype)t.prototype.hasOwnProperty(r)&&(e.prototype[r]=t.prototype[r])}function bezFunction(){function t(t,e,r,s,i,a){var n=t*s+e*i+r*a-i*s-a*t-r*e;return n>-1e-4&&1e-4>n}function e(t,e,r,s,i,a,n,o,h){var l,p=Math.sqrt(Math.pow(s-t,2)+Math.pow(i-e,2)+Math.pow(a-r,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-r,2)),f=Math.sqrt(Math.pow(n-s,2)+Math.pow(o-i,2)+Math.pow(h-a,2));return l=p>m?p>f?p-m-f:f-m-p:f>m?f-m-p:m-p-f,l>-1e-4&&1e-4>l}function r(t){this.segmentLength=0,this.points=new Array(t)}function s(t,e){this.partialLength=t,this.point=e}function i(t,e){var r=e.segments,s=r.length,i=bm_floor((s-1)*t),a=t*e.addedLength,n=0;if(a==r[i].l)return r[i].p;for(var o=r[i].l>a?-1:1,h=!0;h;)r[i].l<=a&&r[i+1].l>a?(n=(a-r[i].l)/(r[i+1].l-r[i].l),h=!1):i+=o,(0>i||i>=s-1)&&(h=!1);return r[i].p+(r[i+1].p-r[i].p)*n}function a(){this.pt1=new Array(2),this.pt2=new Array(2),this.pt3=new Array(2),this.pt4=new Array(2)}function n(t,e,r,s,n,o,h){var l=new a;n=0>n?0:n>1?1:n;var p=i(n,h);o=o>1?1:o;var m,f=i(o,h),c=t.length,d=1-p,u=1-f;for(m=0;c>m;m+=1)l.pt1[m]=Math.round(1e3*(d*d*d*t[m]+(p*d*d+d*p*d+d*d*p)*r[m]+(p*p*d+d*p*p+p*d*p)*s[m]+p*p*p*e[m]))/1e3,l.pt3[m]=Math.round(1e3*(d*d*u*t[m]+(p*d*u+d*p*u+d*d*f)*r[m]+(p*p*u+d*p*f+p*d*f)*s[m]+p*p*f*e[m]))/1e3,l.pt4[m]=Math.round(1e3*(d*u*u*t[m]+(p*u*u+d*f*u+d*u*f)*r[m]+(p*f*u+d*f*f+p*u*f)*s[m]+p*f*f*e[m]))/1e3,l.pt2[m]=Math.round(1e3*(u*u*u*t[m]+(f*u*u+u*f*u+u*u*f)*r[m]+(f*f*u+u*f*f+f*u*f)*s[m]+f*f*f*e[m]))/1e3;return l}var o=(Math,function(){function t(t,e){this.l=t,this.p=e}return function(e,r,s,i){var a,n,o,h,l,p,m=defaultCurveSegments,f=0,c=[],d=[],u={addedLength:0,segments:[]};for(o=s.length,a=0;m>a;a+=1){for(l=a/(m-1),p=0,n=0;o>n;n+=1)h=bm_pow(1-l,3)*e[n]+3*bm_pow(1-l,2)*l*s[n]+3*(1-l)*bm_pow(l,2)*i[n]+bm_pow(l,3)*r[n],c[n]=h,null!==d[n]&&(p+=bm_pow(c[n]-d[n],2)),d[n]=c[n];p&&(p=bm_sqrt(p),f+=p),u.segments.push(new t(f,l))}return u.addedLength=f,u}}()),h=function(){var e={};return function(i){var a=i.s,n=i.e,o=i.to,h=i.ti,l=(a.join("_")+"_"+n.join("_")+"_"+o.join("_")+"_"+h.join("_")).replace(/\./g,"p");if(e[l])return void(i.bezierData=e[l]);var p,m,f,c,d,u,y,g=defaultCurveSegments,v=0,b=null;2===a.length&&(a[0]!=n[0]||a[1]!=n[1])&&t(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&t(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])&&(g=2);var E=new r(g);for(f=o.length,p=0;g>p;p+=1){for(y=new Array(f),d=p/(g-1),u=0,m=0;f>m;m+=1)c=bm_pow(1-d,3)*a[m]+3*bm_pow(1-d,2)*d*(a[m]+o[m])+3*(1-d)*bm_pow(d,2)*(n[m]+h[m])+bm_pow(d,3)*n[m],y[m]=c,null!==b&&(u+=bm_pow(y[m]-b[m],2));u=bm_sqrt(u),v+=u,E.points[p]=new s(u,y),b=y}E.segmentLength=v,i.bezierData=E,e[l]=E}}();return{getBezierLength:o,getNewSegment:n,buildBezierData:h,pointOnLine2D:t,pointOnLine3D:e}}function dataFunctionManager(){function t(i,a,o){var h,l,p,m,f,c,d,u,y=i.length;for(m=0;y>m;m+=1)if(h=i[m],"ks"in h&&!h.completed){if(h.completed=!0,h.tt&&(i[m-1].td=h.tt),l=[],p=-1,h.hasMask){var g=h.masksProperties;for(c=g.length,f=0;c>f;f+=1)if(g[f].pt.k.i)s(g[f].pt.k);else for(u=g[f].pt.k.length,d=0;u>d;d+=1)g[f].pt.k[d].s&&s(g[f].pt.k[d].s[0]),g[f].pt.k[d].e&&s(g[f].pt.k[d].e[0])}0===h.ty?(h.layers=e(h.refId,a),t(h.layers,a,o)):4===h.ty?r(h.shapes):5==h.ty&&n(h,o)}}function e(t,e){for(var r=0,s=e.length;s>r;){if(e[r].id===t)return e[r].layers;r+=1}}function r(t){var e,i,a,n=t.length,o=!1;for(e=n-1;e>=0;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)s(t[e].ks.k);else for(a=t[e].ks.k.length,i=0;a>i;i+=1)t[e].ks.k[i].s&&s(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&s(t[e].ks.k[i].e[0]);o=!0}else"gr"==t[e].ty&&r(t[e].it)}function s(t){var e,r=t.i.length;for(e=0;r>e;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function i(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]?!0:r[0]>t[0]?!1:t[1]>r[1]?!0:r[1]>t[1]?!1:t[2]>r[2]?!0:r[2]>t[2]?!1:void 0}function a(e,r){e.__complete||(h(e),o(e),l(e),t(e.layers,e.assets,r),e.__complete=!0)}function n(t,e){var r,s,i=t.t.d.k,a=i.length;for(s=0;a>s;s+=1){var n=t.t.d.k[s].s;r=[];var o,h,l,p,m,f,c,d=0,u=t.t.m.g,y=0,g=0,v=0,b=[],E=0,P=0,x=e.getFontByName(n.f),S=0,C=x.fStyle.split(" "),k="normal",M="normal";for(h=C.length,o=0;h>o;o+=1)"italic"===C[o].toLowerCase()?M="italic":"bold"===C[o].toLowerCase()?k="700":"black"===C[o].toLowerCase()?k="900":"medium"===C[o].toLowerCase()?k="500":"regular"===C[o].toLowerCase()||"normal"===C[o].toLowerCase()?k="400":("light"===C[o].toLowerCase()||"thin"===C[o].toLowerCase())&&(k="200");if(n.fWeight=k,n.fStyle=M,h=n.t.length,n.sz){var A=n.sz[0],D=-1;for(o=0;h>o;o+=1)l=!1," "===n.t.charAt(o)?D=o:13===n.t.charCodeAt(o)&&(E=0,l=!0),e.chars?(c=e.getCharData(n.t.charAt(o),x.fStyle,x.fFamily),S=l?0:c.w*n.s/100):S=e.measureText(n.t.charAt(o),n.f,n.s),E+S>A?(-1===D?(n.t=n.t.substr(0,o)+"\r"+n.t.substr(o),h+=1):(o=D,n.t=n.t.substr(0,o)+"\r"+n.t.substr(o+1)),D=-1,E=0):E+=S;h=n.t.length}for(E=0,S=0,o=0;h>o;o+=1)if(l=!1," "===n.t.charAt(o)?p="\xa0":13===n.t.charCodeAt(o)?(b.push(E),P=E>P?E:P,E=0,p="",l=!0,v+=1):p=n.t.charAt(o),e.chars?(c=e.getCharData(n.t.charAt(o),x.fStyle,e.getFontByName(n.f).fFamily),S=l?0:c.w*n.s/100):S=e.measureText(p,n.f,n.s),E+=S,r.push({l:S,an:S,add:y,n:l,anIndexes:[],val:p,line:v}),2==u){if(y+=S,""==p||"\xa0"==p||o==h-1){for((""==p||"\xa0"==p)&&(y-=S);o>=g;)r[g].an=y,r[g].ind=d,r[g].extra=S,g+=1;d+=1,y=0}}else if(3==u){if(y+=S,""==p||o==h-1){for(""==p&&(y-=S);o>=g;)r[g].an=y,r[g].ind=d,r[g].extra=S,g+=1;y=0,d+=1}}else r[d].ind=d,r[d].extra=0,d+=1;if(n.l=r,P=E>P?E:P,b.push(E),n.sz)n.boxWidth=n.sz[0],n.justifyOffset=0;else switch(n.boxWidth=P,n.j){case 1:n.justifyOffset=-n.boxWidth;break;case 2:n.justifyOffset=-n.boxWidth/2;break;default:n.justifyOffset=0}n.lineWidths=b;var w=t.t.a;f=w.length;var T,F,I=[];for(m=0;f>m;m+=1){for(w[m].a.sc&&(n.strokeColorAnim=!0),w[m].a.sw&&(n.strokeWidthAnim=!0),(w[m].a.fc||w[m].a.fh||w[m].a.fs||w[m].a.fb)&&(n.fillColorAnim=!0),F=0,T=w[m].s.b,o=0;h>o;o+=1)r[o].anIndexes[m]=F,(1==T&&""!=r[o].val||2==T&&""!=r[o].val&&"\xa0"!=r[o].val||3==T&&(r[o].n||"\xa0"==r[o].val||o==h-1)||4==T&&(r[o].n||o==h-1))&&(1===w[m].s.rn&&I.push(F),F+=1);t.t.a[m].s.totalChars=F;var _,V=-1;if(1===w[m].s.rn)for(o=0;h>o;o+=1)V!=r[o].anIndexes[m]&&(V=r[o].anIndexes[m],_=I.splice(Math.floor(Math.random()*I.length),1)[0]),r[o].anIndexes[m]=_}0!==f||"m"in t.t.p||(t.singleShape=!0),n.yOffset=n.lh||1.2*n.s,n.ls=n.ls||0,n.ascent=x.ascent*n.s/100}}var o=function(){function t(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function e(e){var r,s=e.length;for(r=0;s>r;r+=1)5===e[r].ty&&t(e[r])}var r=[4,4,14];return function(t){if(i(r,t.v)&&(e(t.layers),t.assets)){var s,a=t.assets.length;for(s=0;a>s;s+=1)t.assets[s].layers&&e(t.assets[s].layers)}}}(),h=function(){function t(e){var r,s,i,a=e.length;for(r=0;a>r;r+=1)if("gr"===e[r].ty)t(e[r].it);else if("fl"===e[r].ty||"st"===e[r].ty)if(e[r].c.k&&e[r].c.k[0].i)for(i=e[r].c.k.length,s=0;i>s;s+=1)e[r].c.k[s].s&&(e[r].c.k[s].s[0]/=255,e[r].c.k[s].s[1]/=255,e[r].c.k[s].s[2]/=255,e[r].c.k[s].s[3]/=255),e[r].c.k[s].e&&(e[r].c.k[s].e[0]/=255,e[r].c.k[s].e[1]/=255,e[r].c.k[s].e[2]/=255,e[r].c.k[s].e[3]/=255);else e[r].c.k[0]/=255,e[r].c.k[1]/=255,e[r].c.k[2]/=255,e[r].c.k[3]/=255}function e(e){var r,s=e.length;for(r=0;s>r;r+=1)4===e[r].ty&&t(e[r].shapes)}var r=[4,1,9];return function(t){if(i(r,t.v)&&(e(t.layers),t.assets)){var s,a=t.assets.length;for(s=0;a>s;s+=1)t.assets[s].layers&&e(t.assets[s].layers)}}}(),l=function(){function t(e){var r,s,i,a=e.length,n=!1;for(r=a-1;r>=0;r-=1)if("sh"==e[r].ty){if(e[r].ks.k.i)e[r].ks.k.c=e[r].closed;else for(i=e[r].ks.k.length,s=0;i>s;s+=1)e[r].ks.k[s].s&&(e[r].ks.k[s].s[0].c=e[r].closed),e[r].ks.k[s].e&&(e[r].ks.k[s].e[0].c=e[r].closed);n=!0}else"gr"==e[r].ty&&t(e[r].it)}function e(e){var r,s,i,a,n,o,h=e.length;for(s=0;h>s;s+=1){if(r=e[s],r.hasMask){var l=r.masksProperties;for(a=l.length,i=0;a>i;i+=1)if(l[i].pt.k.i)l[i].pt.k.c=l[i].cl;else for(o=l[i].pt.k.length,n=0;o>n;n+=1)l[i].pt.k[n].s&&(l[i].pt.k[n].s[0].c=l[i].cl),l[i].pt.k[n].e&&(l[i].pt.k[n].e[0].c=l[i].cl)}4===r.ty&&t(r.shapes)}}var r=[4,4,18];return function(t){if(i(r,t.v)&&(e(t.layers),t.assets)){var s,a=t.assets.length;for(s=0;a>s;s+=1)t.assets[s].layers&&e(t.assets[s].layers)}}}(),p={};return p.completeData=a,p}function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=Array.apply(null,{length:this._maxLength}),this.o=Array.apply(null,{length:this._maxLength}),this.i=Array.apply(null,{length:this._maxLength})}function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=Array.apply(null,{length:this._maxLength})}function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.globalData={frameNum:-1},this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",progressiveLoad:e&&e.progressiveLoad||!1},this.elements=[],this.pendingElements=[],this.destroyed=!1}function MaskElement(t,e,r){this.dynamicProperties=[],this.data=t,this.element=e,this.globalData=r,this.paths=[],this.storedData=[],this.masksProperties=this.data.masksProperties,this.viewData=new Array(this.masksProperties.length),this.maskElement=null,this.firstFrame=!0;var s,i,a,n,o,h,l,p,m=this.globalData.defs,f=this.masksProperties.length,c=this.masksProperties,d=0,u=[],y=randomString(10),g="clipPath",v="clip-path";for(s=0;f>s;s++)if(("a"!==c[s].mode&&"n"!==c[s].mode||c[s].inv||100!==c[s].o.k)&&(g="mask",v="mask"),"s"!=c[s].mode&&"i"!=c[s].mode||0!=d?o=null:(o=document.createElementNS(svgNS,"rect"),o.setAttribute("fill","#ffffff"),o.setAttribute("width",this.element.comp.data.w),o.setAttribute("height",this.element.comp.data.h),u.push(o)),i=document.createElementNS(svgNS,"path"),"n"!=c[s].mode){if(d+=1,"s"==c[s].mode?i.setAttribute("fill","#000000"):i.setAttribute("fill","#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==c[s].x.k){g="mask",v="mask",p=PropertyFactory.getProp(this.element,c[s].x,0,null,this.dynamicProperties);var b="fi_"+randomString(10);h=document.createElementNS(svgNS,"filter"),h.setAttribute("id",b),l=document.createElementNS(svgNS,"feMorphology"),l.setAttribute("operator","dilate"),l.setAttribute("in","SourceGraphic"),l.setAttribute("radius","0"),h.appendChild(l),m.appendChild(h),"s"==c[s].mode?i.setAttribute("stroke","#000000"):i.setAttribute("stroke","#ffffff")}else l=null,p=null;if(this.storedData[s]={elem:i,x:p,expan:l,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==c[s].mode){n=u.length;var E=document.createElementNS(svgNS,"g");for(a=0;n>a;a+=1)E.appendChild(u[a]);var P=document.createElementNS(svgNS,"mask");P.setAttribute("mask-type","alpha"),P.setAttribute("id",y+"_"+d),P.appendChild(i),m.appendChild(P),E.setAttribute("mask","url(#"+y+"_"+d+")"),u.length=0,u.push(E)}else u.push(i);c[s].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[s]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,c[s].o,0,.01,this.dynamicProperties),prop:ShapePropertyFactory.getShapeProp(this.element,c[s],3,this.dynamicProperties,null)},o&&(this.viewData[s].invRect=o),this.viewData[s].prop.k||this.drawPath(c[s],this.viewData[s].prop.v,this.viewData[s])}else this.viewData[s]={op:PropertyFactory.getProp(this.element,c[s].o,0,.01,this.dynamicProperties),prop:ShapePropertyFactory.getShapeProp(this.element,c[s],3,this.dynamicProperties,null),elem:i},m.appendChild(i);for(this.maskElement=document.createElementNS(svgNS,g),f=u.length,s=0;f>s;s+=1)this.maskElement.appendChild(u[s]);this.maskElement.setAttribute("id",y),d>0&&this.element.maskedElement.setAttribute(v,"url(#"+y+")"),m.appendChild(this.maskElement)}function BaseElement(){}function SVGBaseElement(t,e,r,s,i){this.globalData=r,this.comp=s,this.data=t,this.matteElement=null,this.transformedElement=null,this.parentContainer=e,this.layerId=i?i.layerId:"ly_"+randomString(10),this.placeholder=i,this.init()}function ITextElement(t,e,r,s){}function SVGTextElement(t,e,r,s,i){this.textSpans=[],this.renderType="svg",this._parent.constructor.call(this,t,e,r,s,i)}function SVGTintFilter(t,e){this.filterManager=e;var r=document.createElementNS(svgNS,"feColorMatrix");if(r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),r.setAttribute("result","f1"),t.appendChild(r),r=document.createElementNS(svgNS,"feColorMatrix"),r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result","f2"),t.appendChild(r),this.matrixFilter=r,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var s=document.createElementNS(svgNS,"feMerge");t.appendChild(s);var i;i=document.createElementNS(svgNS,"feMergeNode"),i.setAttribute("in","SourceGraphic"),s.appendChild(i),i=document.createElementNS(svgNS,"feMergeNode"),i.setAttribute("in","f2"),s.appendChild(i)}}function SVGFillFilter(t,e){this.filterManager=e;var r=document.createElementNS(svgNS,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(r),this.matrixFilter=r}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var r=document.createElementNS(svgNS,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),r.setAttribute("result","f1"),t.appendChild(r);var s=document.createElementNS(svgNS,"feComponentTransfer");s.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(s),this.matrixFilter=s;var i=document.createElementNS(svgNS,"feFuncR");i.setAttribute("type","table"),s.appendChild(i),this.feFuncR=i;var a=document.createElementNS(svgNS,"feFuncG");a.setAttribute("type","table"),s.appendChild(a),this.feFuncG=a;var n=document.createElementNS(svgNS,"feFuncB");n.setAttribute("type","table"),s.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var r=this.filterManager.effectElements,s=document.createElementNS(svgNS,"feComponentTransfer");(r[9].p.k||0!==r[9].p.v||r[10].p.k||1!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||0!==r[12].p.v||r[13].p.k||1!==r[13].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",s)),(r[16].p.k||0!==r[16].p.v||r[17].p.k||1!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||0!==r[19].p.v||r[20].p.k||1!==r[20].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",s)),(r[23].p.k||0!==r[23].p.v||r[24].p.k||1!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||0!==r[26].p.v||r[27].p.k||1!==r[27].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",s)),(r[30].p.k||0!==r[30].p.v||r[31].p.k||1!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||0!==r[33].p.v||r[34].p.k||1!==r[34].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",s)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(s.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(s),s=document.createElementNS(svgNS,"feComponentTransfer")),(r[2].p.k||0!==r[2].p.v||r[3].p.k||1!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||0!==r[5].p.v||r[6].p.k||1!==r[6].p.v)&&(s.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(s),this.feFuncRComposed=this.createFeFunc("feFuncR",s),this.feFuncGComposed=this.createFeFunc("feFuncG",s),this.feFuncBComposed=this.createFeFunc("feFuncB",s))}function SVGDropShadowEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","400%"),t.setAttribute("height","400%"),this.filterManager=e;var r=document.createElementNS(svgNS,"feGaussianBlur");r.setAttribute("in","SourceAlpha"),r.setAttribute("result","drop_shadow_1"),r.setAttribute("stdDeviation","0"),this.feGaussianBlur=r,t.appendChild(r);var s=document.createElementNS(svgNS,"feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var i=document.createElementNS(svgNS,"feFlood");i.setAttribute("flood-color","#00ff00"),i.setAttribute("flood-opacity","1"),i.setAttribute("result","drop_shadow_3"),this.feFlood=i,t.appendChild(i);var a=document.createElementNS(svgNS,"feComposite");a.setAttribute("in","drop_shadow_3"),a.setAttribute("in2","drop_shadow_2"),a.setAttribute("operator","in"),a.setAttribute("result","drop_shadow_4"),t.appendChild(a);var n=document.createElementNS(svgNS,"feMerge");t.appendChild(n);var o;o=document.createElementNS(svgNS,"feMergeNode"),n.appendChild(o),o=document.createElementNS(svgNS,"feMergeNode"),o.setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=n,this.originalNodeAdded=!1,n.appendChild(o)}function SVGEffects(t){var e,r=t.data.ef.length,s=randomString(10),i=filtersFactory.createFilter(s),a=0;this.filters=[];var n;for(e=0;r>e;e+=1)20===t.data.ef[e].ty?(a+=1,n=new SVGTintFilter(i,t.effects.effectElements[e]),this.filters.push(n)):21===t.data.ef[e].ty?(a+=1,n=new SVGFillFilter(i,t.effects.effectElements[e]),this.filters.push(n)):22===t.data.ef[e].ty?(n=new SVGStrokeEffect(t,t.effects.effectElements[e]),this.filters.push(n)):23===t.data.ef[e].ty?(a+=1,n=new SVGTritoneFilter(i,t.effects.effectElements[e]),this.filters.push(n)):24===t.data.ef[e].ty?(a+=1,n=new SVGProLevelsFilter(i,t.effects.effectElements[e]),this.filters.push(n)):25===t.data.ef[e].ty&&(a+=1,n=new SVGDropShadowEffect(i,t.effects.effectElements[e]),this.filters.push(n));a&&(t.globalData.defs.appendChild(i),t.layerElement.setAttribute("filter","url(#"+s+")"))}function ICompElement(t,e,r,s,i){this._parent.constructor.call(this,t,e,r,s,i),this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?Array.apply(null,{length:this.layers.length}):[],this.data.tm&&(this.tm=PropertyFactory.getProp(this,this.data.tm,0,r.frameRate,this.dynamicProperties)),this.data.xt?(this.layerElement=document.createElementNS(svgNS,"g"),this.buildAllItems()):r.progressiveLoad||this.buildAllItems()}function IImageElement(t,e,r,s,i){this.assetData=r.getAssetData(t.refId),this._parent.constructor.call(this,t,e,r,s,i)}function IShapeElement(t,e,r,s,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.viewData=[],this.shapeModifiers=[],this._parent.constructor.call(this,t,e,r,s,i)}function ISolidElement(t,e,r,s,i){this._parent.constructor.call(this,t,e,r,s,i)}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:e&&void 0!==e.clearCanvas?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet"},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1},this.contextData={saved:Array.apply(null,{length:15}),savedOp:Array.apply(null,{length:15}),cArrPos:0,cTr:new Matrix,cO:1};var r,s=15;for(r=0;s>r;r+=1)this.contextData.saved[r]=Array.apply(null,{length:16});this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1}function HybridRenderer(t){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.globalData={frameNum:-1},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0}function CVBaseElement(t,e,r){this.globalData=r,this.data=t,this.comp=e,this.canvasContext=r.canvasContext,this.init()}function CVCompElement(t,e,r){this._parent.constructor.call(this,t,e,r);var s={};for(var i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);s.renderer=this,s.compHeight=this.data.h,s.compWidth=this.data.w,this.renderConfig={clearCanvas:!0},this.contextData={saved:Array.apply(null,{length:15}),savedOp:Array.apply(null,{length:15}),cArrPos:0,cTr:new Matrix,cO:1},this.completeLayers=!1;var a,n=15;for(a=0;n>a;a+=1)this.contextData.saved[a]=Array.apply(null,{length:16});this.transformMat=new Matrix,this.parentGlobalData=this.globalData;var o=document.createElement("canvas");s.canvasContext=o.getContext("2d"),this.canvasContext=s.canvasContext,o.width=this.data.w,o.height=this.data.h,this.canvas=o,this.globalData=s,this.layers=t.layers,this.pendingElements=[],this.elements=Array.apply(null,{length:this.layers.length}),this.data.tm&&(this.tm=PropertyFactory.getProp(this,this.data.tm,0,r.frameRate,this.dynamicProperties)),(this.data.xt||!r.progressiveLoad)&&this.buildAllItems()}function CVImageElement(t,e,r){this.assetData=r.getAssetData(t.refId),this._parent.constructor.call(this,t,e,r),this.globalData.addPendingElement()}function CVMaskElement(t,e){this.data=t,this.element=e,this.dynamicProperties=[],this.masksProperties=this.data.masksProperties,this.viewData=new Array(this.masksProperties.length);var r,s=this.masksProperties.length;for(r=0;s>r;r++)this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3,this.dynamicProperties,null)}function CVShapeElement(t,e,r){this.shapes=[],this.stylesList=[],this.viewData=[],this.shapeModifiers=[],this.shapesData=t.shapes,this.firstFrame=!0,this._parent.constructor.call(this,t,e,r)}function CVSolidElement(t,e,r){this._parent.constructor.call(this,t,e,r)}function CVTextElement(t,e,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this._parent.constructor.call(this,t,e,r)}function HBaseElement(t,e,r,s,i){this.globalData=r,this.comp=s,this.data=t,this.matteElement=null,this.parentContainer=e,this.layerId=i?i.layerId:"ly_"+randomString(10),this.placeholder=i,this.init()}function HSolidElement(t,e,r,s,i){this._parent.constructor.call(this,t,e,r,s,i)}function HCompElement(t,e,r,s,i){this._parent.constructor.call(this,t,e,r,s,i),this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=Array.apply(null,{length:this.layers.length}),this.data.tm&&(this.tm=PropertyFactory.getProp(this,this.data.tm,0,r.frameRate,this.dynamicProperties)),this.data.hasMask&&(this.supports3d=!1),this.data.xt&&(this.layerElement=document.createElement("div")),this.buildAllItems()}function HShapeElement(t,e,r,s,i){this.shapes=[],this.shapeModifiers=[],this.shapesData=t.shapes,this.stylesList=[],this.viewData=[],this._parent.constructor.call(this,t,e,r,s,i),this.addedTransforms={mdf:!1,mats:[this.finalTransform.mat]},this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,r,s,i){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this._parent.constructor.call(this,t,e,r,s,i)}function HImageElement(t,e,r,s,i){this.assetData=r.getAssetData(t.refId),this._parent.constructor.call(this,t,e,r,s,i)}function HCameraElement(t,e,r,s,i){if(this._parent.constructor.call(this,t,e,r,s,i),this.pe=PropertyFactory.getProp(this,t.pe,0,0,this.dynamicProperties),t.ks.p.s?(this.px=PropertyFactory.getProp(this,t.ks.p.x,1,0,this.dynamicProperties),this.py=PropertyFactory.getProp(this,t.ks.p.y,1,0,this.dynamicProperties),this.pz=PropertyFactory.getProp(this,t.ks.p.z,1,0,this.dynamicProperties)):this.p=PropertyFactory.getProp(this,t.ks.p,1,0,this.dynamicProperties),t.ks.a&&(this.a=PropertyFactory.getProp(this,t.ks.a,1,0,this.dynamicProperties)),t.ks.or.k.length&&t.ks.or.k[0].to){var a,n=t.ks.or.k.length;for(a=0;n>a;a+=1)t.ks.or.k[a].to=null,t.ks.or.k[a].ti=null}this.or=PropertyFactory.getProp(this,t.ks.or,1,degToRads,this.dynamicProperties),this.or.sh=!0,this.rx=PropertyFactory.getProp(this,t.ks.rx,0,degToRads,this.dynamicProperties),this.ry=PropertyFactory.getProp(this,t.ks.ry,0,degToRads,this.dynamicProperties),this.rz=PropertyFactory.getProp(this,t.ks.rz,0,degToRads,this.dynamicProperties),this.mat=new Matrix}function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e,r){var s=t.ef;this.effectElements=[];var i,a,n=s.length;for(i=0;n>i;i++)a=new GroupEffect(s[i],e,r),this.effectElements.push(a)}function GroupEffect(t,e,r){this.dynamicProperties=[],this.init(t,e,this.dynamicProperties),this.dynamicProperties.length&&r.push(this)}function play(t){animationManager.play(t)}function pause(t){animationManager.pause(t)}function togglePause(t){animationManager.togglePause(t)}function setSpeed(t,e){animationManager.setSpeed(t,e)}function setDirection(t,e){animationManager.setDirection(t,e)}function stop(t){animationManager.stop(t)}function moveFrame(t){animationManager.moveFrame(t)}function searchAnimations(){standalone===!0?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function registerAnimation(t){return animationManager.registerAnimation(t)}function resize(){animationManager.resize()}function start(){animationManager.start()}function goToAndStop(t,e,r){animationManager.goToAndStop(t,e,r)}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return standalone===!0&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function destroy(t){return animationManager.destroy(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&t>1&&(defaultCurveSegments=t);roundValues(defaultCurveSegments>=50?!1:!0)}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r++){var s=e[r].split("=");if(decodeURIComponent(s[0])==t)return decodeURIComponent(s[1])}}var svgNS="http://www.w3.org/2000/svg",subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};!function(){var t,e=Object.getOwnPropertyNames(Math),r=e.length;for(t=0;r>t;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){var e=typeof t;if("object"===e&&t.length){var r,s=Array.apply(null,{length:t.length}),i=t.length;for(r=0;i>r;r+=1)s[r]=Math.abs(t[r]);return s}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;roundValues(!1);var rgbToHex=function(){var t,e,r=[];for(t=0;256>t;t+=1)e=t.toString(16),r[t]=1==e.length?"0"+e:e;return function(t,e,s){return 0>t&&(t=0),0>e&&(e=0),0>s&&(s=0),"#"+r[t]+r[e]+r[s]}}(),fillColorToString=function(){var t=[];return function(e,r){return void 0!==r&&(e[3]=r),t[e[0]]||(t[e[0]]={}),
-t[e[0]][e[1]]||(t[e[0]][e[1]]={}),t[e[0]][e[1]][e[2]]||(t[e[0]][e[1]][e[2]]={}),t[e[0]][e[1]][e[2]][e[3]]||(t[e[0]][e[1]][e[2]][e[3]]="rgba("+e.join(",")+")"),t[e[0]][e[1]][e[2]][e[3]]}}(),Matrix=function(){function t(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function e(t){if(0===t)return this;var e=Math.cos(t),r=Math.sin(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=Math.cos(t),r=Math.sin(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function s(t){if(0===t)return this;var e=Math.cos(t),r=Math.sin(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function i(t){if(0===t)return this;var e=Math.cos(t),r=Math.sin(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function a(t,e){return this._t(1,e,t,1,0,0)}function n(t,e){return this.shear(Math.tan(t),Math.tan(e))}function o(t,e){var r=Math.cos(e),s=Math.sin(e);return this._t(r,s,0,0,-s,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-s,0,0,s,r,0,0,0,0,1,0,0,0,0,1)}function h(t,e,r){return r=isNaN(r)?1:r,1==t&&1==e&&1==r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function l(t,e,r,s,i,a,n,o,h,l,p,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=s,this.props[4]=i,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function p(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function m(t,e,r,s,i,a,n,o,h,l,p,m,f,c,d,u){if(1===t&&0===e&&0===r&&0===s&&0===i&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return(0!==f||0!==c||0!==d)&&(this.props[12]=this.props[12]*t+this.props[13]*i+this.props[14]*h+this.props[15]*f,this.props[13]=this.props[12]*e+this.props[13]*a+this.props[14]*l+this.props[15]*c,this.props[14]=this.props[12]*r+this.props[13]*n+this.props[14]*p+this.props[15]*d,this.props[15]=this.props[12]*s+this.props[13]*o+this.props[14]*m+this.props[15]*u),this;var y=this.props[0],g=this.props[1],v=this.props[2],b=this.props[3],E=this.props[4],P=this.props[5],x=this.props[6],S=this.props[7],C=this.props[8],k=this.props[9],M=this.props[10],A=this.props[11],D=this.props[12],w=this.props[13],T=this.props[14],F=this.props[15];return this.props[0]=y*t+g*i+v*h+b*f,this.props[1]=y*e+g*a+v*l+b*c,this.props[2]=y*r+g*n+v*p+b*d,this.props[3]=y*s+g*o+v*m+b*u,this.props[4]=E*t+P*i+x*h+S*f,this.props[5]=E*e+P*a+x*l+S*c,this.props[6]=E*r+P*n+x*p+S*d,this.props[7]=E*s+P*o+x*m+S*u,this.props[8]=C*t+k*i+M*h+A*f,this.props[9]=C*e+k*a+M*l+A*c,this.props[10]=C*r+k*n+M*p+A*d,this.props[11]=C*s+k*o+M*m+A*u,this.props[12]=D*t+w*i+T*h+F*f,this.props[13]=D*e+w*a+T*l+F*c,this.props[14]=D*r+w*n+T*p+F*d,this.props[15]=D*s+w*o+T*m+F*u,this}function f(t){var e;for(e=0;16>e;e+=1)t.props[e]=this.props[e]}function c(t){var e;for(e=0;16>e;e+=1)this.props[e]=t[e]}function d(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function u(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function y(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function g(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function v(t){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],r=this.props[5]/e,s=-this.props[1]/e,i=-this.props[4]/e,a=this.props[0]/e,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,o=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e;return[t[0]*r+t[1]*i+n,t[0]*s+t[1]*a+o,0]}function b(t){var e,r=t.length,s=[];for(e=0;r>e;e+=1)s[e]=v(t[e]);return s}function E(t,e,r,s){if(s&&2===s){var i=point_pool.newPoint();return i[0]=t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],i[1]=t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],i}return[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function P(t,e){return bm_rnd(t*this.props[0]+e*this.props[4]+this.props[12])+","+bm_rnd(t*this.props[1]+e*this.props[5]+this.props[13])}function x(){return[this.props[0],this.props[1],this.props[2],this.props[3],this.props[4],this.props[5],this.props[6],this.props[7],this.props[8],this.props[9],this.props[10],this.props[11],this.props[12],this.props[13],this.props[14],this.props[15]]}function S(){return isSafari?"matrix3d("+roundTo2Decimals(this.props[0])+","+roundTo2Decimals(this.props[1])+","+roundTo2Decimals(this.props[2])+","+roundTo2Decimals(this.props[3])+","+roundTo2Decimals(this.props[4])+","+roundTo2Decimals(this.props[5])+","+roundTo2Decimals(this.props[6])+","+roundTo2Decimals(this.props[7])+","+roundTo2Decimals(this.props[8])+","+roundTo2Decimals(this.props[9])+","+roundTo2Decimals(this.props[10])+","+roundTo2Decimals(this.props[11])+","+roundTo2Decimals(this.props[12])+","+roundTo2Decimals(this.props[13])+","+roundTo2Decimals(this.props[14])+","+roundTo2Decimals(this.props[15])+")":(this.cssParts[1]=this.props.join(","),this.cssParts.join(""))}function C(){return"matrix("+this.props[0]+","+this.props[1]+","+this.props[4]+","+this.props[5]+","+this.props[12]+","+this.props[13]+")"}function k(){return""+this.toArray()}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=s,this.rotateZ=i,this.skew=n,this.skewFromAxis=o,this.shear=a,this.scale=h,this.setTransform=l,this.translate=p,this.transform=m,this.applyToPoint=d,this.applyToX=u,this.applyToY=y,this.applyToZ=g,this.applyToPointArray=E,this.applyToPointStringified=P,this.toArray=x,this.toCSS=S,this.to2dCSS=C,this.toString=k,this.clone=f,this.cloneFromProps=c,this.inversePoints=b,this.inversePoint=v,this._t=this.transform,this.props=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.cssParts=["matrix3d(","",")"]}}();!function(t,e){function r(r,l,p){var c=[];l=1==l?{entropy:!0}:l||{};var v=n(a(l.entropy?[r,h(t)]:null==r?o():r,3),c),b=new s(c),E=function(){for(var t=b.g(f),e=u,r=0;y>t;)t=(t+r)*m,e*=m,r=b.g(1);for(;t>=g;)t/=2,e/=2,r>>>=1;return(t+r)/e};return E.int32=function(){return 0|b.g(4)},E.quick=function(){return b.g(4)/4294967296},E["double"]=E,n(h(b.S),t),(l.pass||p||function(t,r,s,a){return a&&(a.S&&i(a,b),t.state=function(){return i(b,{})}),s?(e[d]=t,r):t})(E,v,"global"in l?l.global:this==e,l.state)}function s(t){var e,r=t.length,s=this,i=0,a=s.i=s.j=0,n=s.S=[];for(r||(t=[r++]);m>i;)n[i]=i++;for(i=0;m>i;i++)n[i]=n[a=v&a+t[i%r]+(e=n[i])],n[a]=e;(s.g=function(t){for(var e,r=0,i=s.i,a=s.j,n=s.S;t--;)e=n[i=v&i+1],r=r*m+n[v&(n[i]=n[a=v&a+e])+(n[a]=e)];return s.i=i,s.j=a,r})(m)}function i(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function a(t,e){var r,s=[],i=typeof t;if(e&&"object"==i)for(r in t)try{s.push(a(t[r],e-1))}catch(n){}return s.length?s:"string"==i?t:t+"\x00"}function n(t,e){for(var r,s=t+"",i=0;i<s.length;)e[v&i]=v&(r^=19*e[v&i])+s.charCodeAt(i++);return h(e)}function o(){try{if(l)return h(l.randomBytes(m));var e=new Uint8Array(m);return(p.crypto||p.msCrypto).getRandomValues(e),h(e)}catch(r){var s=p.navigator,i=s&&s.plugins;return[+new Date,p,i,p.screen,h(t)]}}function h(t){return String.fromCharCode.apply(0,t)}var l,p=this,m=256,f=6,c=52,d="random",u=e.pow(m,f),y=e.pow(2,c),g=2*y,v=m-1;e["seed"+d]=r,n(e.random(),t)}([],BMMath);var BezierFactory=function(){function t(t,e,r,s,i){var a=i||("bez_"+t+"_"+e+"_"+r+"_"+s).replace(/\./g,"p");if(p[a])return p[a];var n=new h([t,e,r,s]);return p[a]=n,n}function e(t,e){return 1-3*e+3*t}function r(t,e){return 3*e-6*t}function s(t){return 3*t}function i(t,i,a){return((e(i,a)*t+r(i,a))*t+s(i))*t}function a(t,i,a){return 3*e(i,a)*t*t+2*r(i,a)*t+s(i)}function n(t,e,r,s,a){var n,o,h=0;do o=e+(r-e)/2,n=i(o,s,a)-t,n>0?r=o:e=o;while(Math.abs(n)>c&&++h<d);return o}function o(t,e,r,s){for(var n=0;m>n;++n){var o=a(e,r,s);if(0===o)return e;var h=i(e,r,s)-t;e-=h/o}return e}function h(t){this._p=t,this._mSampleValues=g?new Float32Array(u):new Array(u),this._precomputed=!1,this.get=this.get.bind(this)}var l={};l.getBezierEasing=t;var p={},m=4,f=.001,c=1e-7,d=10,u=11,y=1/(u-1),g="function"==typeof Float32Array;return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],s=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===r&&s===a?t:0===t?0:1===t?1:i(this._getTForX(t),r,a)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],s=this._p[3];this._precomputed=!0,(t!==e||r!==s)&&this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;u>r;++r)this._mSampleValues[r]=i(r*y,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],s=this._mSampleValues,i=0,h=1,l=u-1;h!==l&&s[h]<=t;++h)i+=y;--h;var p=(t-s[h])/(s[h+1]-s[h]),m=i+p*y,c=a(m,e,r);return c>=f?o(t,m,e,r):0===c?m:n(t,i,i+y,e,r)}},l}(),MatrixManager=matrixManagerFunction;!function(){for(var t=0,e=["ms","moz","webkit","o"],r=0;r<e.length&&!window.requestAnimationFrame;++r)window.requestAnimationFrame=window[e[r]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[r]+"CancelAnimationFrame"]||window[e[r]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,r){var s=(new Date).getTime(),i=Math.max(0,16-(s-t)),a=window.setTimeout(function(){e(s+i)},i);return t=s+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction(),dataManager=dataFunctionManager(),FontManager=function(){function t(t,e){var r=document.createElement("span");r.style.fontFamily=e;var s=document.createElement("span");s.innerHTML="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(s),document.body.appendChild(r);var i=s.offsetWidth;return s.style.fontFamily=t+", "+e,{node:s,w:i,parent:r}}function e(){var t,r,s,i=this.fonts.length,a=i;for(t=0;i>t;t+=1)if(this.fonts[t].loaded)a-=1;else if("t"===this.fonts[t].fOrigin){if(window.Typekit&&window.Typekit.load&&0===this.typekitLoaded){this.typekitLoaded=1;try{window.Typekit.load({async:!0,active:function(){this.typekitLoaded=2}.bind(this)})}catch(n){}}2===this.typekitLoaded&&(this.fonts[t].loaded=!0)}else"n"===this.fonts[t].fOrigin?this.fonts[t].loaded=!0:(r=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,r.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(r=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,r.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<h?setTimeout(e.bind(this),20):setTimeout(function(){this.loaded=!0}.bind(this),0)}function r(t,e){var r=document.createElementNS(svgNS,"text");r.style.fontSize="100px",r.style.fontFamily=e.fFamily,r.textContent="1",e.fClass?(r.style.fontFamily="inherit",r.className=e.fClass):r.style.fontFamily=e.fFamily,t.appendChild(r);var s=document.createElement("canvas").getContext("2d");return s.font="100px "+e.fFamily,s}function s(s,i){if(!s)return void(this.loaded=!0);if(this.chars)return this.loaded=!0,void(this.fonts=s.list);var a,n=s.list,o=n.length;for(a=0;o>a;a+=1){if(n[a].loaded=!1,n[a].monoCase=t(n[a].fFamily,"monospace"),n[a].sansCase=t(n[a].fFamily,"sans-serif"),n[a].fPath){if("p"===n[a].fOrigin){var h=document.createElement("style");h.type="text/css",h.innerHTML="@font-face {font-family: "+n[a].fFamily+"; font-style: normal; src: url('"+n[a].fPath+"');}",i.appendChild(h)}else if("g"===n[a].fOrigin){var l=document.createElement("link");l.type="text/css",l.rel="stylesheet",l.href=n[a].fPath,i.appendChild(l)}else if("t"===n[a].fOrigin){var p=document.createElement("script");p.setAttribute("src",n[a].fPath),i.appendChild(p)}}else n[a].loaded=!0;n[a].helper=r(i,n[a]),this.fonts.push(n[a])}e.bind(this)()}function i(t){if(t){this.chars||(this.chars=[]);var e,r,s,i=t.length,a=this.chars.length;for(e=0;i>e;e+=1){for(r=0,s=!1;a>r;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(s=!0),r+=1;s||(this.chars.push(t[e]),a+=1)}}}function a(t,e,r){for(var s=0,i=this.chars.length;i>s;){if(this.chars[s].ch===t&&this.chars[s].style===e&&this.chars[s].fFamily===r)return this.chars[s];s+=1}}function n(t,e,r){var s=this.getFontByName(e),i=s.helper;return i.measureText(t).width*r/100}function o(t){for(var e=0,r=this.fonts.length;r>e;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return"sans-serif"}var h=5e3,l=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.loaded=!1,this.initTime=Date.now()};return l.prototype.addChars=i,l.prototype.addFonts=s,l.prototype.getCharData=a,l.prototype.getFontByName=o,l.prototype.measureText=n,l}(),PropertyFactory=function(){function t(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t=this.comp.renderedFrame-this.offsetTime;if(!(t===this.lastFrame||this.lastFrame!==l&&(this.lastFrame>=this.keyframes[this.keyframes.length-1].t-this.offsetTime&&t>=this.keyframes[this.keyframes.length-1].t-this.offsetTime||this.lastFrame<this.keyframes[0].t-this.offsetTime&&t<this.keyframes[0].t-this.offsetTime))){for(var e,r,s=this.lastFrame<t?this._lastIndex:0,i=this.keyframes.length-1,a=!0;a;){if(e=this.keyframes[s],r=this.keyframes[s+1],s==i-1&&t>=r.t-this.offsetTime){e.h&&(e=r);break}if(r.t-this.offsetTime>t)break;i-1>s?s+=1:a=!1}this._lastIndex=s;var n,o,h,p,m,f;if(e.to){e.bezierData||bez.buildBezierData(e);var c=e.bezierData;if(t>=r.t-this.offsetTime||t<e.t-this.offsetTime){var d=t>=r.t-this.offsetTime?c.points.length-1:0;for(o=c.points[d].point.length,n=0;o>n;n+=1)this.pv[n]=c.points[d].point[n],this.v[n]=this.mult?this.pv[n]*this.mult:this.pv[n],this.lastPValue[n]!==this.pv[n]&&(this.mdf=!0,this.lastPValue[n]=this.pv[n]);this._lastBezierData=null}else{e.__fnct?f=e.__fnct:(f=BezierFactory.getBezierEasing(e.o.x,e.o.y,e.i.x,e.i.y,e.n).get,e.__fnct=f),h=f((t-(e.t-this.offsetTime))/(r.t-this.offsetTime-(e.t-this.offsetTime)));var u,y=c.segmentLength*h,g=this.lastFrame<t&&this._lastBezierData===c?this._lastAddedLength:0;for(m=this.lastFrame<t&&this._lastBezierData===c?this._lastPoint:0,a=!0,p=c.points.length;a;){if(g+=c.points[m].partialLength,0===y||0===h||m==c.points.length-1){for(o=c.points[m].point.length,n=0;o>n;n+=1)this.pv[n]=c.points[m].point[n],this.v[n]=this.mult?this.pv[n]*this.mult:this.pv[n],this.lastPValue[n]!==this.pv[n]&&(this.mdf=!0,this.lastPValue[n]=this.pv[n]);break}if(y>=g&&y<g+c.points[m+1].partialLength){for(u=(y-g)/c.points[m+1].partialLength,o=c.points[m].point.length,n=0;o>n;n+=1)this.pv[n]=c.points[m].point[n]+(c.points[m+1].point[n]-c.points[m].point[n])*u,this.v[n]=this.mult?this.pv[n]*this.mult:this.pv[n],this.lastPValue[n]!==this.pv[n]&&(this.mdf=!0,this.lastPValue[n]=this.pv[n]);break}p-1>m?m+=1:a=!1}this._lastPoint=m,this._lastAddedLength=g-c.points[m].partialLength,this._lastBezierData=c}}else{var v,b,E,P,x;for(i=e.s.length,s=0;i>s;s+=1){if(1!==e.h&&(t>=r.t-this.offsetTime?h=1:t<e.t-this.offsetTime?h=0:(e.o.x instanceof Array?(e.__fnct||(e.__fnct=[]),e.__fnct[s]?f=e.__fnct[s]:(v=e.o.x[s]||e.o.x[0],b=e.o.y[s]||e.o.y[0],E=e.i.x[s]||e.i.x[0],P=e.i.y[s]||e.i.y[0],f=BezierFactory.getBezierEasing(v,b,E,P).get,e.__fnct[s]=f)):e.__fnct?f=e.__fnct:(v=e.o.x,b=e.o.y,E=e.i.x,P=e.i.y,f=BezierFactory.getBezierEasing(v,b,E,P).get,e.__fnct=f),h=f((t-(e.t-this.offsetTime))/(r.t-this.offsetTime-(e.t-this.offsetTime))))),this.sh&&1!==e.h){var S=e.s[s],C=e.e[s];-180>S-C?S+=360:S-C>180&&(S-=360),x=S+(C-S)*h}else x=1===e.h?e.s[s]:e.s[s]+(e.e[s]-e.s[s])*h;1===i?(this.v=this.mult?x*this.mult:x,this.pv=x,this.lastPValue!=this.pv&&(this.mdf=!0,this.lastPValue=this.pv)):(this.v[s]=this.mult?x*this.mult:x,this.pv[s]=x,this.lastPValue[s]!==this.pv[s]&&(this.mdf=!0,this.lastPValue[s]=this.pv[s]))}}}this.lastFrame=t,this.frameId=this.elem.globalData.frameId}}function e(){}function r(t,r,s){this.mult=s,this.v=s?r.k*s:r.k,this.pv=r.k,this.mdf=!1,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.getValue=e}function s(t,r,s){this.mult=s,this.data=r,this.mdf=!1,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1,this.v=Array.apply(null,{length:r.k.length}),this.pv=Array.apply(null,{length:r.k.length}),this.lastValue=Array.apply(null,{length:r.k.length});var i=Array.apply(null,{length:r.k.length});this.vel=i.map(function(){return 0});var a,n=r.k.length;for(a=0;n>a;a+=1)this.v[a]=s?r.k[a]*s:r.k[a],this.pv[a]=r.k[a];this.getValue=e}function i(e,r,s){this.keyframes=r.k,this.offsetTime=e.data.st,this.lastValue=-99999,this.lastPValue=-99999,this.frameId=-1,this._lastIndex=0,this.k=!0,this.kf=!0,this.data=r,this.mult=s,this.elem=e,this.comp=e.comp,this.lastFrame=l,this.v=s?r.k[0].s[0]*s:r.k[0].s[0],this.pv=r.k[0].s[0],this.getValue=t}function a(e,r,s){var i,a,n,o,h,p=r.k.length;for(i=0;p-1>i;i+=1)r.k[i].to&&r.k[i].s&&r.k[i].e&&(a=r.k[i].s,n=r.k[i].e,o=r.k[i].to,h=r.k[i].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(r.k[i].to=null,r.k[i].ti=null));this.keyframes=r.k,this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this.mult=s,this.elem=e,this.comp=e.comp,this.getValue=t,this.frameId=-1,this._lastIndex=0,this.v=Array.apply(null,{length:r.k[0].s.length}),this.pv=Array.apply(null,{length:r.k[0].s.length}),this.lastValue=Array.apply(null,{length:r.k[0].s.length}),this.lastPValue=Array.apply(null,{length:r.k[0].s.length}),this.lastFrame=l}function n(t,e,n,o,h){var l;if(2===n)l=new p(t,e,h);else if(0===e.a)l=0===n?new r(t,e,o):new s(t,e,o);else if(1===e.a)l=0===n?new i(t,e,o):new a(t,e,o);else if(e.k.length)if("number"==typeof e.k[0])l=new s(t,e,o);else switch(n){case 0:l=new i(t,e,o);break;case 1:l=new a(t,e,o)}else l=new r(t,e,o);return l.k&&h.push(l),l}function o(t,e,r,s){return new f(t,e,r,s)}function h(t,e,r){return new c(t,e,r)}var l=-999999,p=function(){function t(){return ExpressionValue(this.p)}function e(){return ExpressionValue(this.px)}function r(){return ExpressionValue(this.py)}function s(){return ExpressionValue(this.a)}function i(){return ExpressionValue(this.or)}function a(){return ExpressionValue(this.r,1/degToRads)}function n(){return ExpressionValue(this.s,100)}function o(){return ExpressionValue(this.o,100)}function h(){return ExpressionValue(this.sk)}function l(){return ExpressionValue(this.sa)}function p(t){var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function m(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0);if(this.mdf){if(this.v.reset(),this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r?this.v.rotate(-this.r.v):this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented&&this.p.keyframes&&this.p.getValueAtTime){var r,s;this.p.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/this.elem.globalData.frameRate,0),s=this.p.getValueAtTime(this.p.keyframes[0].t/this.elem.globalData.frameRate,0)):this.p.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/this.elem.globalData.frameRate,0),s=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.01)/this.elem.globalData.frameRate,0)):(r=this.p.pv,s=this.p.getValueAtTime((this.p.lastFrame+this.p.offsetTime-.01)/this.elem.globalData.frameRate,this.p.offsetTime)),this.v.rotate(-Math.atan2(r[1]-s[1],r[0]-s[0]))}this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function f(){this.inverted=!0,this.iv=new Matrix,this.k||(this.data.p.s?this.iv.translate(this.px.v,this.py.v,-this.pz.v):this.iv.translate(this.p.v[0],this.p.v[1],-this.p.v[2]),this.r?this.iv.rotate(-this.r.v):this.iv.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.s&&this.iv.scale(this.s.v[0],this.s.v[1],1),this.a&&this.iv.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]))}function c(){}return function(d,u,y){this.elem=d,this.frameId=-1,this.type="transform",this.dynamicProperties=[],this.mdf=!1,this.data=u,this.getValue=m,this.applyToMatrix=p,this.setInverted=f,this.autoOrient=c,this.v=new Matrix,u.p.s?(this.px=PropertyFactory.getProp(d,u.p.x,0,0,this.dynamicProperties),this.py=PropertyFactory.getProp(d,u.p.y,0,0,this.dynamicProperties),u.p.z&&(this.pz=PropertyFactory.getProp(d,u.p.z,0,0,this.dynamicProperties))):this.p=PropertyFactory.getProp(d,u.p,1,0,this.dynamicProperties),u.r?this.r=PropertyFactory.getProp(d,u.r,0,degToRads,this.dynamicProperties):u.rx&&(this.rx=PropertyFactory.getProp(d,u.rx,0,degToRads,this.dynamicProperties),this.ry=PropertyFactory.getProp(d,u.ry,0,degToRads,this.dynamicProperties),this.rz=PropertyFactory.getProp(d,u.rz,0,degToRads,this.dynamicProperties),this.or=PropertyFactory.getProp(d,u.or,1,degToRads,this.dynamicProperties)),u.sk&&(this.sk=PropertyFactory.getProp(d,u.sk,0,degToRads,this.dynamicProperties),this.sa=PropertyFactory.getProp(d,u.sa,0,degToRads,this.dynamicProperties)),u.a&&(this.a=PropertyFactory.getProp(d,u.a,1,0,this.dynamicProperties)),u.s&&(this.s=PropertyFactory.getProp(d,u.s,1,.01,this.dynamicProperties)),this.o=u.o?PropertyFactory.getProp(d,u.o,0,.01,y):{mdf:!1,v:1},this.dynamicProperties.length?y.push(this):(this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r?this.v.rotate(-this.r.v):this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?u.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])),Object.defineProperty(this,"position",{get:t}),Object.defineProperty(this,"xPosition",{get:e}),Object.defineProperty(this,"yPosition",{get:r}),Object.defineProperty(this,"orientation",{get:i}),Object.defineProperty(this,"anchorPoint",{get:s}),Object.defineProperty(this,"rotation",{get:a}),Object.defineProperty(this,"scale",{get:n}),Object.defineProperty(this,"opacity",{get:o}),Object.defineProperty(this,"skew",{get:h}),Object.defineProperty(this,"skewAxis",{get:l})}}(),m=function(){function t(t){if(this.prop.getValue(),this.cmdf=!1,this.omdf=!1,this.prop.mdf||t){var e,r,s,i=4*this.data.p;for(e=0;i>e;e+=1)r=e%4===0?100:255,s=Math.round(this.prop.v[e]*r),this.c[e]!==s&&(this.c[e]=s,this.cmdf=!0);if(this.o.length)for(i=this.prop.v.length,e=4*this.data.p;i>e;e+=1)r=e%2===0?100:1,s=e%2===0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==s&&(this.o[e-4*this.data.p]=s,this.omdf=!0)}}function e(e,r,s){this.prop=n(e,r.k,1,null,[]),this.data=r,this.k=this.prop.k,this.c=Array.apply(null,{length:4*r.p});var i=r.k.k[0].s?r.k.k[0].s.length-4*r.p:r.k.k.length-4*r.p;this.o=Array.apply(null,{length:i}),this.cmdf=!1,this.omdf=!1,this.getValue=t,this.prop.k&&s.push(this),this.getValue(!0)}return function(t,r,s){return new e(t,r,s)}}(),f=function(){function t(t){var e=0,r=this.dataProps.length;if(this.elem.globalData.frameId!==this.frameId||t){for(this.mdf=!1,this.frameId=this.elem.globalData.frameId;r>e;){if(this.dataProps[e].p.mdf){this.mdf=!0;break}e+=1}if(this.mdf||t)for("svg"===this.renderer&&(this.dasharray=""),e=0;r>e;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dasharray+=" "+this.dataProps[e].p.v:this.dasharray[e]=this.dataProps[e].p.v:this.dashoffset=this.dataProps[e].p.v}}return function(e,r,s,i){this.elem=e,this.frameId=-1,this.dataProps=new Array(r.length),this.renderer=s,this.mdf=!1,this.k=!1,this.dasharray="svg"===this.renderer?"":new Array(r.length-1),this.dashoffset=0;var a,n,o=r.length;for(a=0;o>a;a+=1)n=PropertyFactory.getProp(e,r[a].v,0,0,i),this.k=n.k?!0:this.k,this.dataProps[a]={n:r[a].n,p:n};this.getValue=t,this.k?i.push(this):this.getValue(!0)}}(),c=function(){function t(){if(this.dynamicProperties.length){var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0)}var r=this.data.totalChars,s=2===this.data.r?1:100/r,i=this.o.v/s,a=this.s.v/s+i,n=this.e.v/s+i;if(a>n){var o=a;a=n,n=o}this.finalS=a,this.finalE=n}function e(t){var e=BezierFactory.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get,a=0,n=this.finalS,o=this.finalE,h=this.data.sh;if(2==h)a=o===n?t>=o?1:0:r(0,s(.5/(o-n)+(t-n)/(o-n),1)),a=e(a);else if(3==h)a=o===n?t>=o?0:1:1-r(0,s(.5/(o-n)+(t-n)/(o-n),1)),a=e(a);else if(4==h)o===n?a=0:(a=r(0,s(.5/(o-n)+(t-n)/(o-n),1)),.5>a?a*=2:a=1-2*(a-.5)),a=e(a);else if(5==h){if(o===n)a=0;else{var l=o-n;t=s(r(0,t+.5-n),o-n);var p=-l/2+t,m=l/2;a=Math.sqrt(1-p*p/(m*m))}a=e(a)}else 6==h?(o===n?a=0:(t=s(r(0,t+.5-n),o-n),a=(1+Math.cos(Math.PI+2*Math.PI*t/(o-n)))/2),a=e(a)):(t>=i(n)&&(a=0>t-n?1-(n-t):r(0,s(o-t,1))),a=e(a));return a*this.a.v}var r=Math.max,s=Math.min,i=Math.floor;return function(r,s,i){this.mdf=!1,this.k=!1,this.data=s,this.dynamicProperties=[],this.getValue=t,this.getMult=e,this.comp=r.comp,this.finalS=0,this.finalE=0,this.s=PropertyFactory.getProp(r,s.s||{k:0},0,0,this.dynamicProperties),this.e="e"in s?PropertyFactory.getProp(r,s.e,0,0,this.dynamicProperties):{v:2===s.r?s.totalChars:100},this.o=PropertyFactory.getProp(r,s.o||{k:0},0,0,this.dynamicProperties),this.xe=PropertyFactory.getProp(r,s.xe||{k:0},0,0,this.dynamicProperties),this.ne=PropertyFactory.getProp(r,s.ne||{k:0},0,0,this.dynamicProperties),this.a=PropertyFactory.getProp(r,s.a,0,.01,this.dynamicProperties),this.dynamicProperties.length?i.push(this):this.getValue()}}(),d={};return d.getProp=n,d.getDashProp=o,d.getTextSelectorProp=h,d.getGradientProp=m,d}();ShapePath.prototype.setPathData=function(t,e){for(this.c=t;e>this._maxLength;)this.doubleArrayLength();for(var r=0;e>r;)this.v[r]=point_pool.newPoint(),this.o[r]=point_pool.newPoint(),this.i[r]=point_pool.newPoint(),r+=1;this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(Array.apply(null,{length:this._maxLength})),this.i=this.i.concat(Array.apply(null,{length:this._maxLength})),this.o=this.o.concat(Array.apply(null,{length:this._maxLength})),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,s,i){var a;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[s]||a[s]&&!i)&&(a[s]=point_pool.newPoint()),a[s][0]=t,a[s][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,s,i,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,s,"o",n,o),this.setXYAt(i,a,"i",n,o)};var ShapePropertyFactory=function(){function t(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t=this.comp.renderedFrame-this.offsetTime;if(this.lastFrame===n||!(this.lastFrame<this.keyframes[0].t-this.offsetTime&&t<this.keyframes[0].t-this.offsetTime||this.lastFrame>this.keyframes[this.keyframes.length-1].t-this.offsetTime&&t>this.keyframes[this.keyframes.length-1].t-this.offsetTime)){var e,r,s;if(t<this.keyframes[0].t-this.offsetTime)e=this.keyframes[0].s[0],s=!0,this._lastIndex=0;else if(t>=this.keyframes[this.keyframes.length-1].t-this.offsetTime)e=1===this.keyframes[this.keyframes.length-2].h?this.keyframes[this.keyframes.length-1].s[0]:this.keyframes[this.keyframes.length-2].e[0],s=!0;else{for(var i,a,o,h,l,p,m=this.lastFrame<n?this._lastIndex:0,f=this.keyframes.length-1,c=!0;c&&(i=this.keyframes[m],a=this.keyframes[m+1],!(a.t-this.offsetTime>t));)f-1>m?m+=1:c=!1;s=1===i.h,this._lastIndex=m;var d;if(!s){if(t>=a.t-this.offsetTime)d=1;else if(t<i.t-this.offsetTime)d=0;else{var u;i.__fnct?u=i.__fnct:(u=BezierFactory.getBezierEasing(i.o.x,i.o.y,i.i.x,i.i.y).get,i.__fnct=u),d=u((t-(i.t-this.offsetTime))/(a.t-this.offsetTime-(i.t-this.offsetTime)))}r=i.e[0]}e=i.s[0]}h=this.v._length,p=e.i[0].length;var y,g=!1;for(o=0;h>o;o+=1)for(l=0;p>l;l+=1)s?(y=e.i[o][l],this.v.i[o][l]!==y&&(this.v.i[o][l]=y,this.pv.i[o][l]=y,g=!0),y=e.o[o][l],this.v.o[o][l]!==y&&(this.v.o[o][l]=y,this.pv.o[o][l]=y,g=!0),y=e.v[o][l],this.v.v[o][l]!==y&&(this.v.v[o][l]=y,this.pv.v[o][l]=y,g=!0)):(y=e.i[o][l]+(r.i[o][l]-e.i[o][l])*d,this.v.i[o][l]!==y&&(this.v.i[o][l]=y,this.pv.i[o][l]=y,g=!0),y=e.o[o][l]+(r.o[o][l]-e.o[o][l])*d,this.v.o[o][l]!==y&&(this.v.o[o][l]=y,this.pv.o[o][l]=y,g=!0),y=e.v[o][l]+(r.v[o][l]-e.v[o][l])*d,this.v.v[o][l]!==y&&(this.v.v[o][l]=y,this.pv.v[o][l]=y,g=!0));this.mdf=g,this.v.c=e.c,this.paths=this.localShapeCollection}this.lastFrame=t,this.frameId=this.elem.globalData.frameId}}function e(){return this.v}function r(){this.paths=this.localShapeCollection,this.k||(this.mdf=!1)}function s(t,s,i){this.comp=t.comp,this.k=!1,this.mdf=!1,this.v=shape_pool.newShape();var a=3===i?s.pt.k:s.ks.k;this.v.v=a.v,this.v.i=a.i,this.v.o=a.o,this.v.c=a.c,this.v._length=this.v.v.length,this.getValue=e,this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r}function i(e,s,i){this.comp=e.comp,this.elem=e,this.offsetTime=e.data.st,this._lastIndex=0,this.getValue=t,this.keyframes=3===i?s.pt.k:s.ks.k,this.k=!0,this.kf=!0;{var a=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length}this.v=shape_pool.newShape(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=n,this.reset=r}function a(t,e,r,a){var n;if(3===r||4===r){var p=3===r?e.pt:e.ks,m=p.k;n=1===p.a||m.length?new i(t,e,r):new s(t,e,r)}else 5===r?n=new l(t,e):6===r?n=new o(t,e):7===r&&(n=new h(t,e));return n.k&&a.push(n),n}var n=-999999,o=function(){function t(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2;3!==this.d?(this.v.v[0][0]=t,this.v.v[0][1]=e-i,this.v.v[1][0]=t+r,this.v.v[1][1]=e,this.v.v[2][0]=t,this.v.v[2][1]=e+i,this.v.v[3][0]=t-r,this.v.v[3][1]=e,this.v.i[0][0]=t-r*s,this.v.i[0][1]=e-i,this.v.i[1][0]=t+r,this.v.i[1][1]=e-i*s,this.v.i[2][0]=t+r*s,this.v.i[2][1]=e+i,this.v.i[3][0]=t-r,this.v.i[3][1]=e+i*s,this.v.o[0][0]=t+r*s,this.v.o[0][1]=e-i,this.v.o[1][0]=t+r,this.v.o[1][1]=e+i*s,this.v.o[2][0]=t-r*s,this.v.o[2][1]=e+i,
-this.v.o[3][0]=t-r,this.v.o[3][1]=e-i*s):(this.v.v[0][0]=t,this.v.v[0][1]=e-i,this.v.v[1][0]=t-r,this.v.v[1][1]=e,this.v.v[2][0]=t,this.v.v[2][1]=e+i,this.v.v[3][0]=t+r,this.v.v[3][1]=e,this.v.i[0][0]=t+r*s,this.v.i[0][1]=e-i,this.v.i[1][0]=t-r,this.v.i[1][1]=e-i*s,this.v.i[2][0]=t-r*s,this.v.i[2][1]=e+i,this.v.i[3][0]=t+r,this.v.i[3][1]=e+i*s,this.v.o[0][0]=t-r*s,this.v.o[0][1]=e-i,this.v.o[1][0]=t-r,this.v.o[1][1]=e+i*s,this.v.o[2][0]=t+r*s,this.v.o[2][1]=e+i,this.v.o[3][0]=t+r,this.v.o[3][1]=e-i*s)}function e(t){var e,r=this.dynamicProperties.length;if(this.elem.globalData.frameId!==this.frameId){for(this.mdf=!1,this.frameId=this.elem.globalData.frameId,e=0;r>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.mdf&&this.convertEllToPath()}}var s=roundCorner;return function(s,i){this.v=shape_pool.newShape(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=i.d,this.dynamicProperties=[],this.elem=s,this.comp=s.comp,this.frameId=-1,this.mdf=!1,this.getValue=e,this.convertEllToPath=t,this.reset=r,this.p=PropertyFactory.getProp(s,i.p,1,0,this.dynamicProperties),this.s=PropertyFactory.getProp(s,i.s,1,0,this.dynamicProperties),this.dynamicProperties.length?this.k=!0:this.convertEllToPath()}}(),h=function(){function t(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,s=this.or.v,i=this.os.v,a=2*Math.PI*s/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,this.v._length=0,t=0;e>t;t+=1){var h=s*Math.cos(n),l=s*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),m=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*i*o,l-m*a*i*o,h+p*a*i*o,l+m*a*i*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}function e(){var t,e,r,s,i=2*Math.floor(this.pt.v),a=2*Math.PI/i,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,m=2*Math.PI*o/(2*i),f=2*Math.PI*h/(2*i),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(this.v._length=0,t=0;i>t;t+=1){e=n?o:h,r=n?l:p,s=n?m:f;var u=e*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*s*r*d,y-v*s*r*d,u+g*s*r*d,y+v*s*r*d,t,!0),n=!n,c+=a*d}}function s(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1,this.frameId=this.elem.globalData.frameId;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0);this.mdf&&this.convertToPath()}}return function(i,a){this.v=shape_pool.newShape(),this.v.setPathData(!0,0),this.elem=i,this.comp=i.comp,this.data=a,this.frameId=-1,this.d=a.d,this.dynamicProperties=[],this.mdf=!1,this.getValue=s,this.reset=r,1===a.sy?(this.ir=PropertyFactory.getProp(i,a.ir,0,0,this.dynamicProperties),this.is=PropertyFactory.getProp(i,a.is,0,.01,this.dynamicProperties),this.convertToPath=e):this.convertToPath=t,this.pt=PropertyFactory.getProp(i,a.pt,0,0,this.dynamicProperties),this.p=PropertyFactory.getProp(i,a.p,1,0,this.dynamicProperties),this.r=PropertyFactory.getProp(i,a.r,0,degToRads,this.dynamicProperties),this.or=PropertyFactory.getProp(i,a.or,0,0,this.dynamicProperties),this.os=PropertyFactory.getProp(i,a.os,0,.01,this.dynamicProperties),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:this.convertToPath()}}(),l=function(){function t(t){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1,this.frameId=this.elem.globalData.frameId;var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.mdf&&this.convertRectToPath()}}function e(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,s=this.s.v[1]/2,i=bm_min(r,s,this.r.v),a=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-s+i,t+r,e-s+i,t+r,e-s+a,0,!0),this.v.setTripleAt(t+r,e+s-i,t+r,e+s-a,t+r,e+s-i,1,!0),0!==i?(this.v.setTripleAt(t+r-i,e+s,t+r-i,e+s,t+r-a,e+s,2,!0),this.v.setTripleAt(t-r+i,e+s,t-r+a,e+s,t-r+i,e+s,3,!0),this.v.setTripleAt(t-r,e+s-i,t-r,e+s-i,t-r,e+s-a,4,!0),this.v.setTripleAt(t-r,e-s+i,t-r,e-s+a,t-r,e-s+i,5,!0),this.v.setTripleAt(t-r+i,e-s,t-r+i,e-s,t-r+a,e-s,6,!0),this.v.setTripleAt(t+r-i,e-s,t+r-a,e-s,t+r-i,e-s,7,!0)):(this.v.setTripleAt(t-r,e+s,t-r+a,e+s,t-r,e+s,2),this.v.setTripleAt(t-r,e-s,t-r,e-s+a,t-r,e-s,3))):(this.v.setTripleAt(t+r,e-s+i,t+r,e-s+a,t+r,e-s+i,0,!0),0!==i?(this.v.setTripleAt(t+r-i,e-s,t+r-i,e-s,t+r-a,e-s,1,!0),this.v.setTripleAt(t-r+i,e-s,t-r+a,e-s,t-r+i,e-s,2,!0),this.v.setTripleAt(t-r,e-s+i,t-r,e-s+i,t-r,e-s+a,3,!0),this.v.setTripleAt(t-r,e+s-i,t-r,e+s-a,t-r,e+s-i,4,!0),this.v.setTripleAt(t-r+i,e+s,t-r+i,e+s,t-r+a,e+s,5,!0),this.v.setTripleAt(t+r-i,e+s,t+r-a,e+s,t+r-i,e+s,6,!0),this.v.setTripleAt(t+r,e+s-i,t+r,e+s-i,t+r,e+s-a,7,!0)):(this.v.setTripleAt(t-r,e-s,t-r+a,e-s,t-r,e-s,1,!0),this.v.setTripleAt(t-r,e+s,t-r,e+s-a,t-r,e+s,2,!0),this.v.setTripleAt(t+r,e+s,t+r-a,e+s,t+r,e+s,3,!0)))}return function(s,i){this.v=shape_pool.newShape(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=s,this.comp=s.comp,this.frameId=-1,this.d=i.d,this.dynamicProperties=[],this.mdf=!1,this.getValue=t,this.convertRectToPath=e,this.reset=r,this.p=PropertyFactory.getProp(s,i.p,1,0,this.dynamicProperties),this.s=PropertyFactory.getProp(s,i.s,1,0,this.dynamicProperties),this.r=PropertyFactory.getProp(s,i.r,0,0,this.dynamicProperties),this.dynamicProperties.length?this.k=!0:this.convertRectToPath()}}(),p={};return p.getShapeProp=a,p}(),ShapeModifiers=function(){function t(t,e){s[t]||(s[t]=e)}function e(t,e,r,i){return new s[t](e,r,i)}var r={},s={};return r.registerModifier=t,r.getModifier=e,r}();ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){this.closed||(this.shapes.push({shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()}),this.addShapeToModifier(t.sh))},ShapeModifier.prototype.init=function(t,e,r){this.elem=t,this.frameId=-1,this.shapes=[],this.dynamicProperties=[],this.mdf=!1,this.closed=!1,this.k=!1,this.isTrimming=!1,this.comp=t.comp,this.initModifierProperties(t,e),this.dynamicProperties.length?(this.k=!0,r.push(this)):this.getValue(!0)},extendPrototype(ShapeModifier,TrimModifier),TrimModifier.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0);if(this.mdf||t){var s=this.o.v%360/360;0>s&&(s+=1);var i=this.s.v+s,a=this.e.v+s;if(i>a){var n=i;i=a,a=n}this.sValue=i,this.eValue=a,this.oValue=s}}},TrimModifier.prototype.initModifierProperties=function(t,e){this.sValue=0,this.eValue=0,this.oValue=0,this.getValue=this.processKeys,this.s=PropertyFactory.getProp(t,e.s,0,.01,this.dynamicProperties),this.e=PropertyFactory.getProp(t,e.e,0,.01,this.dynamicProperties),this.o=PropertyFactory.getProp(t,e.o,0,0,this.dynamicProperties),this.m=e.m,this.dynamicProperties.length||this.getValue(!0)},TrimModifier.prototype.getSegmentsLength=function(t){var e,r=t.c,s=t.v,i=t.o,a=t.i,n=t._length,o=[],h=0;for(e=0;n-1>e;e+=1)o[e]=bez.getBezierLength(s[e],s[e+1],i[e],a[e+1]),h+=o[e].addedLength;return r&&(o[e]=bez.getBezierLength(s[e],s[0],i[e],a[0]),h+=o[e].addedLength),{lengths:o,totalLength:h}},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,s,i){var a=[];1>=e?a.push({s:t,e:e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;l>n;n+=1)if(o=a[n],o.e*i<s||o.s*i>s+r);else{var p,m;p=o.s*i<=s?0:(o.s*i-s)/r,m=o.e*i>=s+r?1:(o.e*i-s)/r,h.push([p,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.processShapes=function(t){var e,r,s,i,a,n,o,h=this.shapes.length,l=this.sValue,p=this.eValue,m=0;if(p===l)for(r=0;h>r;r+=1)this.shapes[r].localShapeCollection.releaseShapes(),this.shapes[r].shape.mdf=!0,this.shapes[r].shape.paths=this.shapes[r].localShapeCollection;else if(1===p&&0===l||0===p&&1===l){if(this.mdf)for(r=0;h>r;r+=1)this.shapes[r].shape.mdf=!0}else{var f,c,d=[];for(r=0;h>r;r+=1)if(f=this.shapes[r],f.shape.mdf||this.mdf||t||2===this.m){if(e=f.shape.paths,i=e._length,o=0,!f.shape.mdf&&f.pathsData)o=f.totalShapeLength;else{for(a=[],s=0;i>s;s+=1)n=this.getSegmentsLength(e.shapes[s]),a.push(n),o+=n.totalLength;f.totalShapeLength=o,f.pathsData=a}m+=o,f.shape.mdf=!0}else f.shape.paths=f.localShapeCollection;var s,i,u=l,y=p,g=0;for(r=h-1;r>=0;r-=1)if(f=this.shapes[r],f.shape.mdf){if(c=f.localShapeCollection,c.releaseShapes(),2===this.m&&h>1){var v=this.calculateShapeEdges(l,p,f.totalShapeLength,g,m);g+=f.totalShapeLength}else v=[[u,y]];for(i=v.length,s=0;i>s;s+=1){u=v[s][0],y=v[s][1],d.length=0,1>=y?d.push({s:f.totalShapeLength*u,e:f.totalShapeLength*y}):u>=1?d.push({s:f.totalShapeLength*(u-1),e:f.totalShapeLength*(y-1)}):(d.push({s:f.totalShapeLength*u,e:f.totalShapeLength}),d.push({s:0,e:f.totalShapeLength*(y-1)}));var b=this.addShapes(f,d[0]);if(d[0].s!==d[0].e){if(d.length>1)if(f.shape.v.c){var E=b.pop();this.addPaths(b,c),b=this.addShapes(f,d[1],E)}else this.addPaths(b,c),b=this.addShapes(f,d[1]);this.addPaths(b,c)}}f.shape.paths=c}}this.dynamicProperties.length||(this.mdf=!1)},TrimModifier.prototype.addPaths=function(t,e){var r,s=t.length;for(r=0;s>r;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,s,i,a,n){i.setXYAt(e[0],e[1],"o",a),i.setXYAt(r[0],r[1],"i",a+1),n&&i.setXYAt(t[0],t[1],"v",a),i.setXYAt(s[0],s[1],"v",a+1)},TrimModifier.prototype.addShapes=function(t,e,r){var s,i,a,n,o,h,l,p,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(r?(o=r._length,p=r._length):(r=shape_pool.newShape(),o=0,p=0),u.push(r),s=0;c>s;s+=1){for(h=m[s].lengths,r.c=f[s].c,a=f[s].c?h.length:h.length+1,i=1;a>i;i+=1)if(n=h[i-1],d+n.addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[s].v[i-1],f[s].o[i-1],f[s].i[i],f[s].v[i],r,o,y),y=!1):(l=bez.getNewSegment(f[s].v[i-1],f[s].v[i],f[s].o[i-1],f[s].i[i],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[i-1]),this.addSegment(l.pt1,l.pt3,l.pt4,l.pt2,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[s].c){if(n=h[i-1],d<=e.e){var g=h[i-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[s].v[i-1],f[s].o[i-1],f[s].i[0],f[s].v[0],r,o,y),y=!1):(l=bez.getNewSegment(f[s].v[i-1],f[s].v[0],f[s].o[i-1],f[s].i[0],(e.s-d)/g,(e.e-d)/g,h[i-1]),this.addSegment(l.pt1,l.pt3,l.pt4,l.pt2,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;c-1>s&&(r=shape_pool.newShape(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype(ShapeModifier,RoundCornersModifier),RoundCornersModifier.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0)}},RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this.dynamicProperties),this.dynamicProperties.length||this.getValue(!0)},RoundCornersModifier.prototype.processPath=function(t,e){var r=shape_pool.newShape();r.c=t.c;var s,i,a,n,o,h,l,p,m,f,c,d,u,y=t._length,g=0;for(s=0;y>s;s+=1)i=t.v[s],n=t.o[s],a=t.i[s],i[0]===n[0]&&i[1]===n[1]&&i[0]===a[0]&&i[1]===a[1]?0!==s&&s!==y-1||t.c?(o=0===s?t.v[y-1]:t.v[s-1],h=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)),l=h?Math.min(h/2,e)/h:0,p=d=i[0]+(o[0]-i[0])*l,m=u=i[1]-(i[1]-o[1])*l,f=p-(p-i[0])*roundCorner,c=m-(m-i[1])*roundCorner,r.setTripleAt(p,m,f,c,d,u,g),g+=1,o=s===y-1?t.v[0]:t.v[s+1],h=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)),l=h?Math.min(h/2,e)/h:0,p=f=i[0]+(o[0]-i[0])*l,m=c=i[1]+(o[1]-i[1])*l,d=p-(p-i[0])*roundCorner,u=m-(m-i[1])*roundCorner,r.setTripleAt(p,m,f,c,d,u,g),g+=1):(r.setTripleAt(i[0],i[1],n[0],n[1],a[0],a[1],g),g+=1):(r.setTripleAt(t.v[s][0],t.v[s][1],t.o[s][0],t.o[s][1],t.i[s][0],t.i[s][1],g),g+=1);return r},RoundCornersModifier.prototype.processShapes=function(t){var e,r,s,i,a=this.shapes.length,n=this.rd.v;if(0!==n){var o,h,l;for(r=0;a>r;r+=1){if(o=this.shapes[r],h=o.shape.paths,l=o.localShapeCollection,o.shape.mdf||this.mdf||t)for(l.releaseShapes(),o.shape.mdf=!0,e=o.shape.paths.shapes,i=o.shape.paths._length,s=0;i>s;s+=1)l.addShape(this.processPath(e[s],n));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this.mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype(ShapeModifier,RepeaterModifier),RepeaterModifier.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0)}},RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this.dynamicProperties),this.o=PropertyFactory.getProp(t,e.o,0,null,this.dynamicProperties),this.tr=PropertyFactory.getProp(t,e.tr,2,null,this.dynamicProperties),this.dynamicProperties.length||this.getValue(!0),this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,s,i,a){var n=a?-1:1,o=s.s.v[0]+(1-s.s.v[0])*(1-i),h=s.s.v[1]+(1-s.s.v[1])*(1-i);t.translate(s.p.v[0]*n*i,s.p.v[1]*n*i,s.p.v[2]),e.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),e.rotate(-s.r.v*n*i),e.translate(s.a.v[0],s.a.v[1],s.a.v[2]),r.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(s.a.v[0],s.a.v[1],s.a.v[2])},RepeaterModifier.prototype.processShapes=function(t){this.dynamicProperties.length||(this.mdf=!1);var e,r,s,i,a,n,o,h,l,p,m,f,c,d,u=this.shapes.length,y=Math.ceil(this.c.v),g=this.o.v,v=g%1,b=g>0?Math.floor(g):Math.ceil(g),E=(this.tr.v.props,this.pMatrix.props),P=this.rMatrix.props,x=this.sMatrix.props,S=0;for(e=0;u>e;e+=1){if(i=this.shapes[e],a=i.localShapeCollection,i.shape.mdf||this.mdf||t){if(a.releaseShapes(),i.shape.mdf=!0,h=i.shape.paths,l=h.shapes,s=h._length,S=0,this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset(),g>0){for(;b>S;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),S+=1;v&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,v,!1),S+=v)}else if(0>b){for(;S>b;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),S-=1;v&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-v,!0),S-=v)}for(r=0;s>r;r+=1)for(n=l[r],o=0;y>o;o+=1){if(0!==o&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),i.data.transformers){for(i.data.lvl=0,d=0,m=i.data.elements.length,p=0;m>p;p+=1)d=Math.max(d,i.data.elements[p].st.lvl);for(c=i.data.transformers,m=c.length,p=m-1;p>=d;p-=1)f=c[p].mProps.v.props,this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15])}0!==S&&(this.matrix.transform(P[0],P[1],P[2],P[3],P[4],P[5],P[6],P[7],P[8],P[9],P[10],P[11],P[12],P[13],P[14],P[15]),this.matrix.transform(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]),this.matrix.transform(E[0],E[1],E[2],E[3],E[4],E[5],E[6],E[7],E[8],E[9],E[10],E[11],E[12],E[13],E[14],E[15])),a.addShape(this.processPath(n,this.matrix)),this.matrix.reset(),S+=1}}i.shape.paths=a}},RepeaterModifier.prototype.processPath=function(t,e){var r=shape_pool.clone(t,e);return r},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(Array.apply(null,{length:this._maxLength})),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0};var ImagePreloader=function(){function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages}function e(t){var e="";if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e}function r(e){var r=document.createElement("img");r.addEventListener("load",t.bind(this),!1),r.addEventListener("error",t.bind(this),!1),r.src=e}function s(t){this.totalAssets=t.length;var s;for(s=0;s<this.totalAssets;s+=1)t[s].layers||(r.bind(this)(e.bind(this)(t[s])),this.totalImages+=1)}function i(t){this.path=t||""}function a(t){this.assetsPath=t||""}return function(){this.loadAssets=s,this.setAssetsPath=a,this.setPath=i,this.assetsPath="",this.path="",this.totalAssets=0,this.totalImages=0,this.loadedAssets=0}}(),featureSupport=function(){var t={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),t}(),filtersFactory=function(){function t(t){var e=document.createElementNS(svgNS,"filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e}function e(){var t=document.createElementNS(svgNS,"feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 0 1"),t}var r={};return r.createFilter=t,r.createAlphaToLuminanceFilter=e,r}(),pooling=function(){function t(t){return t.concat(Array.apply(null,{length:t.length}))}return{"double":t}}(),point_pool=function(){function t(){var t;return s?(s-=1,t=a[s]):t=[.1,.1],t}function e(t){s===i&&(a=pooling["double"](a),i=2*i),a[s]=t,s+=1}var r={newPoint:t,release:e},s=0,i=8,a=Array.apply(null,{length:i});return r}(),shape_pool=function(){function t(){var t;return a?(a-=1,t=o[a]):t=new ShapePath,t}function e(t){a===n&&(o=pooling["double"](o),n=2*n);var e,r=t._length;for(e=0;r>e;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1,o[a]=t,a+=1}function r(t,r){for(;r--;)e(t[r])}function s(e,r){var s,i=e._length,a=t();a._length=e._length,a.c=e.c;var n;for(s=0;i>s;s+=1)r?(n=r.applyToPointArray(e.v[s][0],e.v[s][1],0,2),a.setXYAt(n[0],n[1],"v",s),point_pool.release(n),n=r.applyToPointArray(e.o[s][0],e.o[s][1],0,2),a.setXYAt(n[0],n[1],"o",s),point_pool.release(n),n=r.applyToPointArray(e.i[s][0],e.i[s][1],0,2),a.setXYAt(n[0],n[1],"i",s),point_pool.release(n)):a.setTripleAt(e.v[s][0],e.v[s][1],e.o[s][0],e.o[s][1],e.i[s][0],e.i[s][1],s);return a}var i={clone:s,newShape:t,release:e,releaseArray:r},a=0,n=4,o=Array.apply(null,{length:n});return i}(),shapeCollection_pool=function(){function t(){var t;return i?(i-=1,t=n[i]):t=new ShapeCollection,t}function e(t){var e,r=t._length;for(e=0;r>e;e+=1)shape_pool.release(t.shapes[e]);t._length=0,i===a&&(n=pooling["double"](n),a=2*a),n[i]=t,i+=1}function r(t,r){e(t),i===a&&(n=pooling["double"](n),a=2*a),n[i]=t,i+=1}var s={newShapeCollection:t,release:e,clone:r},i=0,a=4,n=Array.apply(null,{length:a});return s}();BaseRenderer.prototype.checkLayers=function(t){var e,r,s=this.layers.length;for(this.completeLayers=!0,e=s-1;e>=0;e--)this.elements[e]||(r=this.layers[e],r.ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t);case 99:return null}return this.createBase(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;e>t;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,r,s=t.length,i=this.layers.length;for(e=0;s>e;e+=1)for(r=0;i>r;){if(this.layers[r].id==t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){r=r||[];for(var s=this.elements,i=this.layers,a=0,n=i.length;n>a;)i[a].ind==e&&(s[a]&&s[a]!==!0?void 0!==i[a].parent?(r.push(s[a]),s[a]._isParent=!0,this.buildElementParenting(t,i[a].parent,r)):(r.push(s[a]),s[a]._isParent=!0,t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},extendPrototype(BaseRenderer,SVGRenderer),SVGRenderer.prototype.createBase=function(t){return new SVGBaseElement(t,this.layerElement,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new IShapeElement(t,this.layerElement,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.layerElement,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.layerElement,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new ICompElement(t,this.layerElement,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.layerElement,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.layerElement=document.createElementNS(svgNS,"svg"),this.layerElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.layerElement.setAttribute("width",t.w),this.layerElement.setAttribute("height",t.h),this.layerElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.layerElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.layerElement.style.width="100%",this.layerElement.style.height="100%",this.animationItem.wrapper.appendChild(this.layerElement);var e=document.createElementNS(svgNS,"defs");this.globalData.defs=e,this.layerElement.appendChild(e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.frameId=0,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h},this.data=t,this.globalData.frameRate=t.fr;var r=document.createElementNS(svgNS,"clipPath"),s=document.createElementNS(svgNS,"rect");s.setAttribute("width",t.w),s.setAttribute("height",t.h),s.setAttribute("x",0),s.setAttribute("y",0);var i="animationMask_"+randomString(10);r.setAttribute("id",i),r.appendChild(s);var a=document.createElementNS(svgNS,"g");a.setAttribute("clip-path","url(#"+i+")"),this.layerElement.appendChild(a),e.appendChild(r),this.layerElement=a,this.layers=t.layers,this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.elements=Array.apply(null,{length:t.layers.length})},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;e>t;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&this.elements[t-1]!==!0?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;r>e;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!=t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t;var e,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);for(e=r-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var s,i=0;e>i;)this.elements[i]&&this.elements[i]!==!0&&this.elements[i].getBaseElement()&&(s=this.elements[i].getBaseElement()),i+=1;s?this.layerElement.insertBefore(r,s):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},SVGRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length,s=document.createElementNS(svgNS,"g");for(e=0;r>e;e+=1)if(t[e].xt){var i=this.createComp(t[e],s,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.prepareFrame=function(){var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue()},MaskElement.prototype.renderFrame=function(t){var e,r=this.masksProperties.length;for(e=0;r>e;e++)if((this.viewData[e].prop.mdf||this.firstFrame)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op.mdf||this.firstFrame)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp.mdf||this.firstFrame)&&(this.viewData[e].invRect.setAttribute("x",-t.props[12]),this.viewData[e].invRect.setAttribute("y",-t.props[13])),this.storedData[e].x&&(this.storedData[e].x.mdf||this.firstFrame))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url(#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}this.firstFrame=!1},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var s,i,a=" M"+e.v[0][0]+","+e.v[0][1];for(i=e._length,s=1;i>s;s+=1)a+=" C"+bm_rnd(e.o[s-1][0])+","+bm_rnd(e.o[s-1][1])+" "+bm_rnd(e.i[s][0])+","+bm_rnd(e.i[s][1])+" "+bm_rnd(e.v[s][0])+","+bm_rnd(e.v[s][1]);e.c&&i>1&&(a+=" C"+bm_rnd(e.o[s-1][0])+","+bm_rnd(e.o[s-1][1])+" "+bm_rnd(e.i[0][0])+","+bm_rnd(e.i[0][1])+" "+bm_rnd(e.v[0][0])+","+bm_rnd(e.v[0][1])),r.lastPath!==a&&(r.elem&&(e.c?t.inv?r.elem.setAttribute("d",this.solidPath+a):r.elem.setAttribute("d",a):r.elem.setAttribute("d","")),r.lastPath=a)},MaskElement.prototype.getMask=function(t){for(var e=0,r=this.masksProperties.length;r>e;){if(this.masksProperties[e].nm===t)return{maskPath:this.viewData[e].prop.pv};e+=1}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.paths=null,this.masksProperties=null},BaseElement.prototype.checkMasks=function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;e>t;){if("n"!==this.data.masksProperties[t].mode&&this.data.masksProperties[t].cl!==!1)return!0;t+=1}return!1},BaseElement.prototype.checkParenting=function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent)},BaseElement.prototype.prepareFrame=function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isVisible!==!0&&(this.elemMdf=!0,this.globalData.mdf=!0,this.isVisible=!0,this.firstFrame=!0,this.data.hasMask&&(this.maskManager.firstFrame=!0)):this.isVisible!==!1&&(this.elemMdf=!0,this.globalData.mdf=!0,this.isVisible=!1);var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)(this.isVisible||this._isParent&&"transform"===this.dynamicProperties[e].type)&&(this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.elemMdf=!0,this.globalData.mdf=!0));return this.data.hasMask&&this.isVisible&&this.maskManager.prepareFrame(t*this.data.sr),this.currentFrameNum=t*this.data.sr,this.isVisible},BaseElement.prototype.globalToLocal=function(t){var e=[];e.push(this.finalTransform);for(var r=!0,s=this.comp;r;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):r=!1;var i,a,n=e.length;for(i=0;n>i;i+=1)a=e[i].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},BaseElement.prototype.initExpressions=function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?this.layerInterface.shapeInterface=ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.layerInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this))},BaseElement.prototype.setBlendMode=function(){var t="";switch(this.data.bm){case 1:t="multiply";break;case 2:t="screen";break;case 3:t="overlay";break;case 4:t="darken";break;case 5:t="lighten";break;case 6:t="color-dodge";break;case 7:t="color-burn";break;case 8:t="hard-light";break;case 9:t="soft-light";break;case 10:t="difference";break;case 11:t="exclusion";break;case 12:t="hue";break;case 13:t="saturation";break;case 14:t="color";break;case 15:t="luminosity"}var e=this.baseElement||this.layerElement;e.style["mix-blend-mode"]=t},BaseElement.prototype.init=function(){this.data.sr||(this.data.sr=1),this.dynamicProperties=[],this.data.ef&&(this.effects=new EffectsManager(this.data,this,this.dynamicProperties)),this.hidden=!1,this.firstFrame=!0,this.isVisible=!1,this._isParent=!1,this.currentFrameNum=-99999,this.lastNum=-99999,this.data.ks&&(this.finalTransform={mProp:PropertyFactory.getProp(this,this.data.ks,2,null,this.dynamicProperties),matMdf:!1,opMdf:!1,mat:new Matrix,opacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),
-this.finalTransform.op=this.finalTransform.mProp.o,this.transform=this.finalTransform.mProp,11!==this.data.ty&&this.createElements(),this.data.hasMask&&this.addMasks(this.data)),this.elemMdf=!1},BaseElement.prototype.getType=function(){return this.type},BaseElement.prototype.resetHierarchy=function(){this.hierarchy?this.hierarchy.length=0:this.hierarchy=[]},BaseElement.prototype.getHierarchy=function(){return this.hierarchy||(this.hierarchy=[]),this.hierarchy},BaseElement.prototype.setHierarchy=function(t){this.hierarchy=t},BaseElement.prototype.getLayerSize=function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}},BaseElement.prototype.hide=function(){},BaseElement.prototype.mHelper=new Matrix,createElement(BaseElement,SVGBaseElement),SVGBaseElement.prototype.createElements=function(){this.layerElement=document.createElementNS(svgNS,"g"),this.transformedElement=this.layerElement,this.data.hasMask&&(this.maskedElement=this.layerElement);var t=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var e=document.createElementNS(svgNS,"mask");if(e.setAttribute("id",this.layerId),e.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e),!featureSupport.maskType&&1==this.data.td){e.setAttribute("mask-type","luminance");var r=randomString(10),s=filtersFactory.createFilter(r);this.globalData.defs.appendChild(s),s.appendChild(filtersFactory.createAlphaToLuminanceFilter());var i=document.createElementNS(svgNS,"g");i.appendChild(this.layerElement),t=i,e.appendChild(i),i.setAttribute("filter","url(#"+r+")")}}else if(2==this.data.td){var a=document.createElementNS(svgNS,"mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=document.createElementNS(svgNS,"g");a.appendChild(n);var r=randomString(10),s=filtersFactory.createFilter(r),o=document.createElementNS(svgNS,"feColorMatrix");o.setAttribute("type","matrix"),o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1"),s.appendChild(o),this.globalData.defs.appendChild(s);var h=document.createElementNS(svgNS,"rect");if(h.setAttribute("width",this.comp.data.w),h.setAttribute("height",this.comp.data.h),h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("fill","#ffffff"),h.setAttribute("opacity","0"),n.setAttribute("filter","url(#"+r+")"),n.appendChild(h),n.appendChild(this.layerElement),t=n,!featureSupport.maskType){a.setAttribute("mask-type","luminance"),s.appendChild(filtersFactory.createAlphaToLuminanceFilter());var i=document.createElementNS(svgNS,"g");n.appendChild(h),i.appendChild(this.layerElement),t=i,n.appendChild(i)}this.globalData.defs.appendChild(a)}}else(this.data.hasMask||this.data.tt)&&this.data.tt?(this.matteElement=document.createElementNS(svgNS,"g"),this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(!this.data.ln&&!this.data.cl||4!==this.data.ty&&0!==this.data.ty||(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)),0===this.data.ty){var l=document.createElementNS(svgNS,"clipPath"),p=document.createElementNS(svgNS,"path");p.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m="cp_"+randomString(8);if(l.setAttribute("id",m),l.appendChild(p),this.globalData.defs.appendChild(l),this.checkMasks()){var f=document.createElementNS(svgNS,"g");f.setAttribute("clip-path","url(#"+m+")"),f.appendChild(this.layerElement),this.transformedElement=f,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url(#"+m+")")}0!==this.data.bm&&this.setBlendMode(),this.layerElement!==this.parentContainer&&(this.placeholder=null),this.data.ef&&(this.effectsManager=new SVGEffects(this)),this.checkParenting()},SVGBaseElement.prototype.setBlendMode=BaseElement.prototype.setBlendMode,SVGBaseElement.prototype.renderFrame=function(t){if(3===this.data.ty||this.data.hd||!this.isVisible)return!1;this.lastNum=this.currentFrameNum,this.finalTransform.opMdf=this.firstFrame||this.finalTransform.op.mdf,this.finalTransform.matMdf=this.firstFrame||this.finalTransform.mProp.mdf,this.finalTransform.opacity=this.finalTransform.op.v;var e,r=this.finalTransform.mat;if(this.hierarchy){var s=0,i=this.hierarchy.length;if(!this.finalTransform.matMdf)for(;i>s;){if(this.hierarchy[s].finalTransform.mProp.mdf){this.finalTransform.matMdf=!0;break}s+=1}if(this.finalTransform.matMdf)for(e=this.finalTransform.mProp.v.props,r.cloneFromProps(e),s=0;i>s;s+=1)e=this.hierarchy[s].finalTransform.mProp.v.props,r.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}else this.isVisible&&(r=this.finalTransform.mProp.v);return this.finalTransform.matMdf&&this.layerElement&&this.transformedElement.setAttribute("transform",r.to2dCSS()),this.finalTransform.opMdf&&this.layerElement&&this.transformedElement.setAttribute("opacity",this.finalTransform.op.v),this.data.hasMask&&this.maskManager.renderFrame(r),this.effectsManager&&this.effectsManager.renderFrame(this.firstFrame),this.isVisible},SVGBaseElement.prototype.destroy=function(){this.layerElement=null,this.parentContainer=null,this.matteElement&&(this.matteElement=null),this.maskManager&&this.maskManager.destroy()},SVGBaseElement.prototype.getBaseElement=function(){return this.baseElement},SVGBaseElement.prototype.addMasks=function(t){this.maskManager=new MaskElement(t,this,this.globalData)},SVGBaseElement.prototype.setMatte=function(t){this.matteElement&&this.matteElement.setAttribute("mask","url(#"+t+")")},SVGBaseElement.prototype.setMatte=function(t){this.matteElement&&this.matteElement.setAttribute("mask","url(#"+t+")")},SVGBaseElement.prototype.hide=function(){},ITextElement.prototype.init=function(){this._parent.init.call(this),this.lettersChangedFlag=!1,this.currentTextDocumentData={};var t=this.data;this.viewData={m:{a:PropertyFactory.getProp(this,t.t.m.a,1,0,this.dynamicProperties)}};var e=this.data.t;if(e.a.length){this.viewData.a=Array.apply(null,{length:e.a.length});var r,s,i,a=e.a.length;for(r=0;a>r;r+=1)i=e.a[r],s={a:{},s:{}},"r"in i.a&&(s.a.r=PropertyFactory.getProp(this,i.a.r,0,degToRads,this.dynamicProperties)),"rx"in i.a&&(s.a.rx=PropertyFactory.getProp(this,i.a.rx,0,degToRads,this.dynamicProperties)),"ry"in i.a&&(s.a.ry=PropertyFactory.getProp(this,i.a.ry,0,degToRads,this.dynamicProperties)),"sk"in i.a&&(s.a.sk=PropertyFactory.getProp(this,i.a.sk,0,degToRads,this.dynamicProperties)),"sa"in i.a&&(s.a.sa=PropertyFactory.getProp(this,i.a.sa,0,degToRads,this.dynamicProperties)),"s"in i.a&&(s.a.s=PropertyFactory.getProp(this,i.a.s,1,.01,this.dynamicProperties)),"a"in i.a&&(s.a.a=PropertyFactory.getProp(this,i.a.a,1,0,this.dynamicProperties)),"o"in i.a&&(s.a.o=PropertyFactory.getProp(this,i.a.o,0,.01,this.dynamicProperties)),"p"in i.a&&(s.a.p=PropertyFactory.getProp(this,i.a.p,1,0,this.dynamicProperties)),"sw"in i.a&&(s.a.sw=PropertyFactory.getProp(this,i.a.sw,0,0,this.dynamicProperties)),"sc"in i.a&&(s.a.sc=PropertyFactory.getProp(this,i.a.sc,1,0,this.dynamicProperties)),"fc"in i.a&&(s.a.fc=PropertyFactory.getProp(this,i.a.fc,1,0,this.dynamicProperties)),"fh"in i.a&&(s.a.fh=PropertyFactory.getProp(this,i.a.fh,0,0,this.dynamicProperties)),"fs"in i.a&&(s.a.fs=PropertyFactory.getProp(this,i.a.fs,0,.01,this.dynamicProperties)),"fb"in i.a&&(s.a.fb=PropertyFactory.getProp(this,i.a.fb,0,.01,this.dynamicProperties)),"t"in i.a&&(s.a.t=PropertyFactory.getProp(this,i.a.t,0,0,this.dynamicProperties)),s.s=PropertyFactory.getTextSelectorProp(this,i.s,this.dynamicProperties),s.s.t=i.s.t,this.viewData.a[r]=s}else this.viewData.a=[];e.p&&"m"in e.p?(this.viewData.p={f:PropertyFactory.getProp(this,e.p.f,0,0,this.dynamicProperties),l:PropertyFactory.getProp(this,e.p.l,0,0,this.dynamicProperties),r:e.p.r,m:this.maskManager.getMaskProperty(e.p.m)},this.maskPath=!0):this.maskPath=!1},ITextElement.prototype.prepareFrame=function(t){var e=0,r=this.data.t.d.k.length,s=this.data.t.d.k[e].s;for(e+=1;r>e&&!(this.data.t.d.k[e].t>t);)s=this.data.t.d.k[e].s,e+=1;this.lettersChangedFlag=!1,s!==this.currentTextDocumentData&&(this.currentTextDocumentData=s,this.lettersChangedFlag=!0,this.buildNewText()),this._parent.prepareFrame.call(this,t)},ITextElement.prototype.createPathShape=function(t,e){var r,s,i,a,n=e.length,o="";for(r=0;n>r;r+=1){for(i=e[r].ks.k.i.length,a=e[r].ks.k,s=1;i>s;s+=1)1==s&&(o+=" M"+t.applyToPointStringified(a.v[0][0],a.v[0][1])),o+=" C"+t.applyToPointStringified(a.o[s-1][0],a.o[s-1][1])+" "+t.applyToPointStringified(a.i[s][0],a.i[s][1])+" "+t.applyToPointStringified(a.v[s][0],a.v[s][1]);o+=" C"+t.applyToPointStringified(a.o[s-1][0],a.o[s-1][1])+" "+t.applyToPointStringified(a.i[0][0],a.i[0][1])+" "+t.applyToPointStringified(a.v[0][0],a.v[0][1]),o+="z"}return o},ITextElement.prototype.getMeasures=function(){var t,e,r,s,i=this.mHelper,a=this.renderType,n=this.data,o=this.currentTextDocumentData,h=o.l;if(this.maskPath){var l=this.viewData.p.m;if(!this.viewData.p.n||this.viewData.p.mdf){var p=l.v;this.viewData.p.r&&(p=reversePath(p));var m={tLength:0,segments:[]};s=p.v.length-1;var f,c=0;for(r=0;s>r;r+=1)f={s:p.v[r],e:p.v[r+1],to:[p.o[r][0]-p.v[r][0],p.o[r][1]-p.v[r][1]],ti:[p.i[r+1][0]-p.v[r+1][0],p.i[r+1][1]-p.v[r+1][1]]},bez.buildBezierData(f),m.tLength+=f.bezierData.segmentLength,m.segments.push(f),c+=f.bezierData.segmentLength;r=s,l.v.c&&(f={s:p.v[r],e:p.v[0],to:[p.o[r][0]-p.v[r][0],p.o[r][1]-p.v[r][1]],ti:[p.i[0][0]-p.v[0][0],p.i[0][1]-p.v[0][1]]},bez.buildBezierData(f),m.tLength+=f.bezierData.segmentLength,m.segments.push(f),c+=f.bezierData.segmentLength),this.viewData.p.pi=m}var d,u,y,m=this.viewData.p.pi,g=this.viewData.p.f.v,v=0,b=1,E=0,P=!0,x=m.segments;if(0>g&&l.v.c)for(m.tLength<Math.abs(g)&&(g=-Math.abs(g)%m.tLength),v=x.length-1,y=x[v].bezierData.points,b=y.length-1;0>g;)g+=y[b].partialLength,b-=1,0>b&&(v-=1,y=x[v].bezierData.points,b=y.length-1);y=x[v].bezierData.points,u=y[b-1],d=y[b];var S,C,k=d.partialLength}s=h.length,t=0,e=0;var M,A,D,w,T,F=1.2*o.s*.714,I=!0,_=this.viewData,V=Array.apply(null,{length:s});w=_.a.length;var R,B,N,L,G,O,j,H,z,W,Y,X,q,U,Z,J,K=-1,Q=g,$=v,tt=b,et=-1,rt=0;for(r=0;s>r;r+=1)if(i.reset(),O=1,h[r].n)t=0,e+=o.yOffset,e+=I?1:0,g=Q,I=!1,rt=0,this.maskPath&&(v=$,b=tt,y=x[v].bezierData.points,u=y[b-1],d=y[b],k=d.partialLength,E=0),V[r]=this.emptyProp;else{if(this.maskPath){if(et!==h[r].line){switch(o.j){case 1:g+=c-o.lineWidths[h[r].line];break;case 2:g+=(c-o.lineWidths[h[r].line])/2}et=h[r].line}K!==h[r].ind&&(h[K]&&(g+=h[K].extra),g+=h[r].an/2,K=h[r].ind),g+=_.m.a.v[0]*h[r].an/200;var st=0;for(D=0;w>D;D+=1)M=_.a[D].a,"p"in M&&(A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),st+=B.length?M.p.v[0]*B[0]:M.p.v[0]*B),"a"in M&&(A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),st+=B.length?M.a.v[0]*B[0]:M.a.v[0]*B);for(P=!0;P;)E+k>=g+st||!y?(S=(g+st-E)/d.partialLength,L=u.point[0]+(d.point[0]-u.point[0])*S,G=u.point[1]+(d.point[1]-u.point[1])*S,i.translate(-_.m.a.v[0]*h[r].an/200,-(_.m.a.v[1]*F/100)),P=!1):y&&(E+=d.partialLength,b+=1,b>=y.length&&(b=0,v+=1,x[v]?y=x[v].bezierData.points:l.v.c?(b=0,v=0,y=x[v].bezierData.points):(E-=d.partialLength,y=null)),y&&(u=d,d=y[b],k=d.partialLength));N=h[r].an/2-h[r].add,i.translate(-N,0,0)}else N=h[r].an/2-h[r].add,i.translate(-N,0,0),i.translate(-_.m.a.v[0]*h[r].an/200,-_.m.a.v[1]*F/100,0);for(rt+=h[r].l/2,D=0;w>D;D+=1)M=_.a[D].a,"t"in M&&(A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),this.maskPath?g+=B.length?M.t*B[0]:M.t*B:t+=B.length?M.t.v*B[0]:M.t.v*B);for(rt+=h[r].l/2,o.strokeWidthAnim&&(H=o.sw||0),o.strokeColorAnim&&(j=o.sc?[o.sc[0],o.sc[1],o.sc[2]]:[0,0,0]),o.fillColorAnim&&(z=[o.fc[0],o.fc[1],o.fc[2]]),D=0;w>D;D+=1)M=_.a[D].a,"a"in M&&(A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),B.length?i.translate(-M.a.v[0]*B[0],-M.a.v[1]*B[1],M.a.v[2]*B[2]):i.translate(-M.a.v[0]*B,-M.a.v[1]*B,M.a.v[2]*B));for(D=0;w>D;D+=1)M=_.a[D].a,"s"in M&&(A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),B.length?i.scale(1+(M.s.v[0]-1)*B[0],1+(M.s.v[1]-1)*B[1],1):i.scale(1+(M.s.v[0]-1)*B,1+(M.s.v[1]-1)*B,1));for(D=0;w>D;D+=1){if(M=_.a[D].a,A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),"sk"in M&&(B.length?i.skewFromAxis(-M.sk.v*B[0],M.sa.v*B[1]):i.skewFromAxis(-M.sk.v*B,M.sa.v*B)),"r"in M&&i.rotateZ(B.length?-M.r.v*B[2]:-M.r.v*B),"ry"in M&&i.rotateY(B.length?M.ry.v*B[1]:M.ry.v*B),"rx"in M&&i.rotateX(B.length?M.rx.v*B[0]:M.rx.v*B),"o"in M&&(O+=B.length?(M.o.v*B[0]-O)*B[0]:(M.o.v*B-O)*B),o.strokeWidthAnim&&"sw"in M&&(H+=B.length?M.sw.v*B[0]:M.sw.v*B),o.strokeColorAnim&&"sc"in M)for(W=0;3>W;W+=1)j[W]=Math.round(B.length?255*(j[W]+(M.sc.v[W]-j[W])*B[0]):255*(j[W]+(M.sc.v[W]-j[W])*B));if(o.fillColorAnim){if("fc"in M)for(W=0;3>W;W+=1)z[W]=B.length?z[W]+(M.fc.v[W]-z[W])*B[0]:z[W]+(M.fc.v[W]-z[W])*B;"fh"in M&&(z=B.length?addHueToRGB(z,M.fh.v*B[0]):addHueToRGB(z,M.fh.v*B)),"fs"in M&&(z=B.length?addSaturationToRGB(z,M.fs.v*B[0]):addSaturationToRGB(z,M.fs.v*B)),"fb"in M&&(z=B.length?addBrightnessToRGB(z,M.fb.v*B[0]):addBrightnessToRGB(z,M.fb.v*B))}}for(D=0;w>D;D+=1)M=_.a[D].a,"p"in M&&(A=_.a[D].s,B=A.getMult(h[r].anIndexes[D],n.t.a[D].s.totalChars),this.maskPath?B.length?i.translate(0,M.p.v[1]*B[0],-M.p.v[2]*B[1]):i.translate(0,M.p.v[1]*B,-M.p.v[2]*B):B.length?i.translate(M.p.v[0]*B[0],M.p.v[1]*B[1],-M.p.v[2]*B[2]):i.translate(M.p.v[0]*B,M.p.v[1]*B,-M.p.v[2]*B));if(o.strokeWidthAnim&&(Y=0>H?0:H),o.strokeColorAnim&&(X="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),o.fillColorAnim&&(q="rgb("+Math.round(255*z[0])+","+Math.round(255*z[1])+","+Math.round(255*z[2])+")"),this.maskPath){if(i.translate(0,-o.ls),i.translate(0,_.m.a.v[1]*F/100+e,0),n.t.p.p){C=(d.point[1]-u.point[1])/(d.point[0]-u.point[0]);var it=180*Math.atan(C)/Math.PI;d.point[0]<u.point[0]&&(it+=180),i.rotate(-it*Math.PI/180)}i.translate(L,G,0),g-=_.m.a.v[0]*h[r].an/200,h[r+1]&&K!==h[r+1].ind&&(g+=h[r].an/2,g+=o.tr/1e3*o.s)}else{switch(i.translate(t,e,0),o.ps&&i.translate(o.ps[0],o.ps[1]+o.ascent,0),o.j){case 1:i.translate(o.justifyOffset+(o.boxWidth-o.lineWidths[h[r].line]),0,0);break;case 2:i.translate(o.justifyOffset+(o.boxWidth-o.lineWidths[h[r].line])/2,0,0)}i.translate(0,-o.ls),i.translate(N,0,0),i.translate(_.m.a.v[0]*h[r].an/200,_.m.a.v[1]*F/100,0),t+=h[r].l+o.tr/1e3*o.s}"html"===a?U=i.toCSS():"svg"===a?U=i.to2dCSS():Z=[i.props[0],i.props[1],i.props[2],i.props[3],i.props[4],i.props[5],i.props[6],i.props[7],i.props[8],i.props[9],i.props[10],i.props[11],i.props[12],i.props[13],i.props[14],i.props[15]],J=O,R=this.renderedLetters[r],!R||R.o===J&&R.sw===Y&&R.sc===X&&R.fc===q?"svg"!==a&&"html"!==a||R&&R.m===U?"canvas"!==a||R&&R.props[0]===Z[0]&&R.props[1]===Z[1]&&R.props[4]===Z[4]&&R.props[5]===Z[5]&&R.props[12]===Z[12]&&R.props[13]===Z[13]?T=R:(this.lettersChangedFlag=!0,T=new LetterProps(J,Y,X,q,null,Z)):(this.lettersChangedFlag=!0,T=new LetterProps(J,Y,X,q,U)):(this.lettersChangedFlag=!0,T=new LetterProps(J,Y,X,q,U,Z)),this.renderedLetters[r]=T}},ITextElement.prototype.emptyProp=new LetterProps,createElement(SVGBaseElement,SVGTextElement),SVGTextElement.prototype.init=ITextElement.prototype.init,SVGTextElement.prototype.createPathShape=ITextElement.prototype.createPathShape,SVGTextElement.prototype.getMeasures=ITextElement.prototype.getMeasures,SVGTextElement.prototype.prepareFrame=ITextElement.prototype.prepareFrame,SVGTextElement.prototype.createElements=function(){this._parent.createElements.call(this),this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)},SVGTextElement.prototype.buildNewText=function(){var t,e,r=this.currentTextDocumentData;this.renderedLetters=Array.apply(null,{length:this.currentTextDocumentData.l?this.currentTextDocumentData.l.length:0}),r.fc?this.layerElement.setAttribute("fill","rgb("+Math.round(255*r.fc[0])+","+Math.round(255*r.fc[1])+","+Math.round(255*r.fc[2])+")"):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke","rgb("+Math.round(255*r.sc[0])+","+Math.round(255*r.sc[1])+","+Math.round(255*r.sc[2])+")"),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.s);var s=this.globalData.fontManager.getFontByName(r.f);if(s.fClass)this.layerElement.setAttribute("class",s.fClass);else{this.layerElement.setAttribute("font-family",s.fFamily);var i=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",i)}var n=r.l||[];if(e=n.length){var o,h,l=this.mHelper,p="",m=this.data.singleShape;if(m)var f=0,c=0,d=r.lineWidths,u=r.boxWidth,y=!0;var g=0;for(t=0;e>t;t+=1){if(this.globalData.fontManager.chars?m&&0!==t||(o=this.textSpans[g]?this.textSpans[g]:document.createElementNS(svgNS,"path")):o=this.textSpans[g]?this.textSpans[g]:document.createElementNS(svgNS,"text"),o.style.display="inherit",o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),m&&n[t].n&&(f=0,c+=r.yOffset,c+=y?1:0,y=!1),l.reset(),this.globalData.fontManager.chars&&l.scale(r.s/100,r.s/100),m){switch(r.ps&&l.translate(r.ps[0],r.ps[1]+r.ascent,0),l.translate(0,-r.ls,0),r.j){case 1:l.translate(r.justifyOffset+(u-d[n[t].line]),0,0);break;case 2:l.translate(r.justifyOffset+(u-d[n[t].line])/2,0,0)}l.translate(f,c,0)}if(this.globalData.fontManager.chars){var v,b=this.globalData.fontManager.getCharData(r.t.charAt(t),s.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily);v=b?b.data:null,v&&v.shapes&&(h=v.shapes[0].it,m||(p=""),p+=this.createPathShape(l,h),m||o.setAttribute("d",p)),m||this.layerElement.appendChild(o)}else o.textContent=n[t].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.layerElement.appendChild(o),m&&o.setAttribute("transform",l.to2dCSS());m&&(f+=n[t].l,f+=r.tr/1e3*r.s),this.textSpans[g]=o,g+=1}if(!m)for(;g<this.textSpans.length;)this.textSpans[g].style.display="none",g+=1;m&&this.globalData.fontManager.chars&&(o.setAttribute("d",p),this.layerElement.appendChild(o))}},SVGTextElement.prototype.hide=function(){this.hidden||(this.layerElement.style.display="none",this.hidden=!0)},SVGTextElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);if(e===!1)return void this.hide();if(this.hidden&&(this.hidden=!1,this.layerElement.style.display="block"),!this.data.singleShape&&(this.getMeasures(),this.lettersChangedFlag)){var r,s,i=this.renderedLetters,a=this.currentTextDocumentData.l;s=a.length;var n;for(r=0;s>r;r+=1)a[r].n||(n=i[r],this.textSpans[r].setAttribute("transform",n.m),this.textSpans[r].setAttribute("opacity",n.o),n.sw&&this.textSpans[r].setAttribute("stroke-width",n.sw),n.sc&&this.textSpans[r].setAttribute("stroke",n.sc),n.fc&&this.textSpans[r].setAttribute("fill",n.fc));this.firstFrame&&(this.firstFrame=!1)}},SVGTextElement.prototype.destroy=function(){this._parent.destroy.call(this._parent)},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,s=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",r[0]-e[0]+" 0 0 0 "+e[0]+" "+(r[1]-e[1])+" 0 0 0 "+e[1]+" "+(r[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+s+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var t,e,r,s,i=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(s=this.elem.maskManager.masksProperties.length,r=0):(r=this.filterManager.effectElements[0].p.v-1,s=r+1),e=document.createElementNS(svgNS,"g"),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1),r;s>r;r+=1)t=document.createElementNS(svgNS,"path"),e.appendChild(t),this.paths.push({p:t,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=document.createElementNS(svgNS,"mask"),n="stms_"+randomString(10);a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=document.createElementNS(svgNS,"g");o.setAttribute("mask","url(#"+n+")"),i[0]&&o.appendChild(i[0]),this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(var i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,r,s,i=this.paths.length;for(e=0;i>e;e+=1)if(r=this.elem.maskManager.viewData[this.paths[e].m],s=this.paths[e].p,(t||this.filterManager.mdf||r.prop.mdf)&&s.setAttribute("d",r.lastPath),t||this.filterManager.effectElements[9].p.mdf||this.filterManager.effectElements[4].p.mdf||this.filterManager.effectElements[7].p.mdf||this.filterManager.effectElements[8].p.mdf||r.prop.mdf){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=s.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),m=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,f=Math.floor(p/m);for(l=0;f>l;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;s.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p.mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p.mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p.mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bm_floor(255*c[0])+","+bm_floor(255*c[1])+","+bm_floor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,s=this.filterManager.effectElements[2].p.v,i=s[0]+" "+r[0]+" "+e[0],a=s[1]+" "+r[1]+" "+e[1],n=s[2]+" "+r[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",i),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var r=document.createElementNS(svgNS,t);return r.setAttribute("type","table"),e.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(t,e,r,s,i){for(var a,n,o=0,h=256,l=Math.min(t,e),p=Math.max(t,e),m=Array.call(null,{length:h}),f=0,c=i-s,d=e-t;256>=o;)a=o/256,n=l>=a?0>d?i:s:a>=p?0>d?s:i:s+c*Math.pow((a-t)/d,1/r),m[f++]=n,o+=256/(h-1);return m.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[2].p.mdf||r[3].p.mdf||r[4].p.mdf||r[5].p.mdf||r[6].p.mdf)&&(e=this.getTableValue(r[2].p.v,r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[9].p.mdf||r[10].p.mdf||r[11].p.mdf||r[12].p.mdf||r[13].p.mdf)&&(e=this.getTableValue(r[9].p.v,r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[16].p.mdf||r[17].p.mdf||r[18].p.mdf||r[19].p.mdf||r[20].p.mdf)&&(e=this.getTableValue(r[16].p.v,r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[23].p.mdf||r[24].p.mdf||r[25].p.mdf||r[26].p.mdf||r[27].p.mdf)&&(e=this.getTableValue(r[23].p.v,r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[30].p.mdf||r[31].p.mdf||r[32].p.mdf||r[33].p.mdf||r[34].p.mdf)&&(e=this.getTableValue(r[30].p.v,r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){if((t||this.filterManager.effectElements[4].p.mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p.mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p.mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p.mdf||this.filterManager.effectElements[3].p.mdf){var r=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=r*Math.cos(s),a=r*Math.sin(s);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",a)}}},SVGEffects.prototype.renderFrame=function(t){var e,r=this.filters.length;for(e=0;r>e;e+=1)this.filters[e].renderFrame(t)},createElement(SVGBaseElement,ICompElement),ICompElement.prototype.hide=function(){if(!this.hidden){var t,e=this.elements.length;for(t=0;e>t;t+=1)this.elements[t]&&this.elements[t].hide();this.hidden=!0}},ICompElement.prototype.prepareFrame=function(t){if(this._parent.prepareFrame.call(this,t),this.isVisible!==!1||this.data.xt){if(this.tm){var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}else this.renderedFrame=t/this.data.sr;var r,s=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=0;s>r;r+=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st)}},ICompElement.prototype.renderFrame=function(t){var e,r=this._parent.renderFrame.call(this,t),s=this.layers.length;if(r===!1)return void this.hide();for(this.hidden=!1,e=0;s>e;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();this.firstFrame&&(this.firstFrame=!1)},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroy=function(){this._parent.destroy.call(this._parent);var t,e=this.layers.length;for(t=0;e>t;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.checkLayers=SVGRenderer.prototype.checkLayers,ICompElement.prototype.buildItem=SVGRenderer.prototype.buildItem,ICompElement.prototype.buildAllItems=SVGRenderer.prototype.buildAllItems,ICompElement.prototype.buildElementParenting=SVGRenderer.prototype.buildElementParenting,ICompElement.prototype.createItem=SVGRenderer.prototype.createItem,ICompElement.prototype.createImage=SVGRenderer.prototype.createImage,ICompElement.prototype.createComp=SVGRenderer.prototype.createComp,ICompElement.prototype.createSolid=SVGRenderer.prototype.createSolid,ICompElement.prototype.createShape=SVGRenderer.prototype.createShape,ICompElement.prototype.createText=SVGRenderer.prototype.createText,ICompElement.prototype.createBase=SVGRenderer.prototype.createBase,ICompElement.prototype.appendElementInPos=SVGRenderer.prototype.appendElementInPos,ICompElement.prototype.checkPendingElements=SVGRenderer.prototype.checkPendingElements,ICompElement.prototype.addPendingElement=SVGRenderer.prototype.addPendingElement,createElement(SVGBaseElement,IImageElement),IImageElement.prototype.createElements=function(){var t=this.globalData.getAssetsPath(this.assetData);this._parent.createElements.call(this),this.innerElem=document.createElementNS(svgNS,"image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio","xMidYMid slice"),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.maskedElement=this.innerElem,this.layerElement.appendChild(this.innerElem),this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)},IImageElement.prototype.hide=function(){this.hidden||(this.layerElement.style.display="none",this.hidden=!0)},IImageElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);return e===!1?void this.hide():(this.hidden&&(this.hidden=!1,this.layerElement.style.display="block"),void(this.firstFrame&&(this.firstFrame=!1)))},IImageElement.prototype.destroy=function(){this._parent.destroy.call(this._parent),this.innerElem=null},createElement(SVGBaseElement,IShapeElement),IShapeElement.prototype.lcEnum={1:"butt",2:"round",3:"butt"},IShapeElement.prototype.ljEnum={1:"miter",2:"round",3:"butt"},IShapeElement.prototype.buildExpressionInterface=function(){},IShapeElement.prototype.createElements=function(){this._parent.createElements.call(this),this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.dynamicProperties,0),(!this.data.hd||this.data.td)&&styleUnselectableDiv(this.layerElement)},IShapeElement.prototype.setGradientData=function(t,e,r){var s,i="gr_"+randomString(10);s=1===e.t?document.createElementNS(svgNS,"linearGradient"):document.createElementNS(svgNS,"radialGradient"),s.setAttribute("id",i),s.setAttribute("spreadMethod","pad"),s.setAttribute("gradientUnits","userSpaceOnUse");var a,n,o,h=[];for(o=4*e.g.p,n=0;o>n;n+=4)a=document.createElementNS(svgNS,"stop"),s.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url(#"+i+")"),this.globalData.defs.appendChild(s),r.gf=s,r.cst=h},IShapeElement.prototype.setGradientOpacity=function(t,e,r){if(t.g.k.k[0].s&&t.g.k.k[0].s.length>4*t.g.p||t.g.k.k.length>4*t.g.p){var s,i,a,n,o=document.createElementNS(svgNS,"mask"),h=document.createElementNS(svgNS,"path");o.appendChild(h);var l="op_"+randomString(10),p="mk_"+randomString(10);o.setAttribute("id",p),s=1===t.t?document.createElementNS(svgNS,"linearGradient"):document.createElementNS(svgNS,"radialGradient"),s.setAttribute("id",l),s.setAttribute("spreadMethod","pad"),s.setAttribute("gradientUnits","userSpaceOnUse"),n=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var m=[];for(a=4*t.g.p;n>a;a+=2)i=document.createElementNS(svgNS,"stop"),i.setAttribute("stop-color","rgb(255,255,255)"),s.appendChild(i),m.push(i);return h.setAttribute("gf"===t.ty?"fill":"stroke","url(#"+l+")"),this.globalData.defs.appendChild(s),this.globalData.defs.appendChild(o),e.of=s,e.ost=m,r.msElem=h,p}},IShapeElement.prototype.searchShapes=function(t,e,r,s,i,a){a=a||[];var n,o,h,l,p,m=[].concat(a),f=t.length-1,c=[],d=[];for(n=f;n>=0;n-=1)if("fl"==t[n].ty||"st"==t[n].ty||"gf"==t[n].ty||"gs"==t[n].ty){e[n]={},l={type:t[n].ty,d:"",ld:"",lvl:i,mdf:!1};var u=document.createElementNS(svgNS,"path");if(e[n].o=PropertyFactory.getProp(this,t[n].o,0,.01,s),("st"==t[n].ty||"gs"==t[n].ty)&&(u.setAttribute("stroke-linecap",this.lcEnum[t[n].lc]||"round"),u.setAttribute("stroke-linejoin",this.ljEnum[t[n].lj]||"round"),
-u.setAttribute("fill-opacity","0"),1==t[n].lj&&u.setAttribute("stroke-miterlimit",t[n].ml),e[n].w=PropertyFactory.getProp(this,t[n].w,0,null,s),t[n].d)){var y=PropertyFactory.getDashProp(this,t[n].d,"svg",s);y.k||(u.setAttribute("stroke-dasharray",y.dasharray),u.setAttribute("stroke-dashoffset",y.dashoffset)),e[n].d=y}if("fl"==t[n].ty||"st"==t[n].ty)e[n].c=PropertyFactory.getProp(this,t[n].c,1,255,s),r.appendChild(u);else{e[n].g=PropertyFactory.getGradientProp(this,t[n].g,s),2==t[n].t&&(e[n].h=PropertyFactory.getProp(this,t[n].h,1,.01,s),e[n].a=PropertyFactory.getProp(this,t[n].a,1,degToRads,s)),e[n].s=PropertyFactory.getProp(this,t[n].s,1,null,s),e[n].e=PropertyFactory.getProp(this,t[n].e,1,null,s),this.setGradientData(u,t[n],e[n],l);var g=this.setGradientOpacity(t[n],e[n],l);g&&u.setAttribute("mask","url(#"+g+")"),e[n].elem=u,r.appendChild(u)}2===t[n].r&&u.setAttribute("fill-rule","evenodd"),t[n].ln&&u.setAttribute("id",t[n].ln),t[n].cl&&u.setAttribute("class",t[n].cl),l.pElem=u,this.stylesList.push(l),e[n].style=l,c.push(l)}else if("gr"==t[n].ty){e[n]={it:[]};var v=document.createElementNS(svgNS,"g");r.appendChild(v),e[n].gr=v,this.searchShapes(t[n].it,e[n].it,v,s,i+1,m)}else if("tr"==t[n].ty)e[n]={transform:{op:PropertyFactory.getProp(this,t[n].o,0,.01,s),mProps:PropertyFactory.getProp(this,t[n],2,null,s)},elements:[]},p=e[n].transform,m.push(p);else if("sh"==t[n].ty||"rc"==t[n].ty||"el"==t[n].ty||"sr"==t[n].ty){e[n]={elements:[],caches:[],styles:[],transformers:m,lStr:""};var b=4;for("rc"==t[n].ty?b=5:"el"==t[n].ty?b=6:"sr"==t[n].ty&&(b=7),e[n].sh=ShapePropertyFactory.getShapeProp(this,t[n],b,s),e[n].lvl=i,this.shapes.push(e[n].sh),this.addShapeToModifiers(e[n]),h=this.stylesList.length,o=0;h>o;o+=1)this.stylesList[o].closed||e[n].elements.push({ty:this.stylesList[o].type,st:this.stylesList[o]})}else if("tm"==t[n].ty||"rd"==t[n].ty||"ms"==t[n].ty||"rp"==t[n].ty){var E=ShapeModifiers.getModifier(t[n].ty);E.init(this,t[n],s),this.shapeModifiers.push(E),d.push(E),e[n]=E}for(f=c.length,n=0;f>n;n+=1)c[n].closed=!0;for(f=d.length,n=0;f>n;n+=1)d[n].closed=!0},IShapeElement.prototype.addShapeToModifiers=function(t){var e,r=this.shapeModifiers.length;for(e=0;r>e;e+=1)this.shapeModifiers[e].addShape(t)},IShapeElement.prototype.renderModifiers=function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;e>t;t+=1)this.shapes[t].reset();for(e=this.shapeModifiers.length,t=e-1;t>=0;t-=1)this.shapeModifiers[t].processShapes(this.firstFrame)}},IShapeElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);return e===!1?void this.hide():(this.globalToLocal([0,0,0]),this.hidden&&(this.layerElement.style.display="block",this.hidden=!1),this.renderModifiers(),void this.renderShape(null,null,!0,null))},IShapeElement.prototype.hide=function(){if(!this.hidden){this.layerElement.style.display="none";var t,e=this.stylesList.length;for(t=e-1;t>=0;t-=1)"0"!==this.stylesList[t].ld&&(this.stylesList[t].ld="0",this.stylesList[t].pElem.style.display="none",this.stylesList[t].pElem.parentNode&&(this.stylesList[t].parent=this.stylesList[t].pElem.parentNode));this.hidden=!0}},IShapeElement.prototype.renderShape=function(t,e,r,s){var i,a;if(!t)for(t=this.shapesData,a=this.stylesList.length,i=0;a>i;i+=1)this.stylesList[i].d="",this.stylesList[i].mdf=!1;e||(e=this.viewData),a=t.length-1;var n;for(i=a;i>=0;i-=1)n=t[i].ty,"tr"==n?((this.firstFrame||e[i].transform.op.mdf&&s)&&s.setAttribute("opacity",e[i].transform.op.v),(this.firstFrame||e[i].transform.mProps.mdf&&s)&&s.setAttribute("transform",e[i].transform.mProps.v.to2dCSS())):"sh"==n||"el"==n||"rc"==n||"sr"==n?this.renderPath(t[i],e[i]):"fl"==n?this.renderFill(t[i],e[i]):"gf"==n?this.renderGradient(t[i],e[i]):"gs"==n?(this.renderGradient(t[i],e[i]),this.renderStroke(t[i],e[i])):"st"==n?this.renderStroke(t[i],e[i]):"gr"==n&&this.renderShape(t[i].it,e[i].it,!1,e[i].gr);if(r){for(a=this.stylesList.length,i=0;a>i;i+=1)"0"===this.stylesList[i].ld&&(this.stylesList[i].ld="1",this.stylesList[i].pElem.style.display="block"),(this.stylesList[i].mdf||this.firstFrame)&&(this.stylesList[i].pElem.setAttribute("d",this.stylesList[i].d),this.stylesList[i].msElem&&this.stylesList[i].msElem.setAttribute("d",this.stylesList[i].d));this.firstFrame&&(this.firstFrame=!1)}},IShapeElement.prototype.renderPath=function(t,e){var r,s,i,a,n,o,h,l,p=e.elements.length,m=e.lvl;for(l=0;p>l;l+=1){o=e.sh.mdf||this.firstFrame,n="M0 0";var f=e.sh.paths;if(a=f._length,e.elements[l].st.lvl<m){for(var c,d=this.mHelper.reset(),u=m-e.elements[l].st.lvl,y=e.transformers.length-1;u>0;)o=e.transformers[y].mProps.mdf||o,c=e.transformers[y].mProps.v.props,d.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),u--,y--;if(o){for(i=0;a>i;i+=1)if(h=f.shapes[i],h&&h._length){for(r=h._length,s=1;r>s;s+=1)1==s&&(n+=" M"+d.applyToPointStringified(h.v[0][0],h.v[0][1])),n+=" C"+d.applyToPointStringified(h.o[s-1][0],h.o[s-1][1])+" "+d.applyToPointStringified(h.i[s][0],h.i[s][1])+" "+d.applyToPointStringified(h.v[s][0],h.v[s][1]);1==r&&(n+=" M"+d.applyToPointStringified(h.v[0][0],h.v[0][1])),h.c&&(n+=" C"+d.applyToPointStringified(h.o[s-1][0],h.o[s-1][1])+" "+d.applyToPointStringified(h.i[0][0],h.i[0][1])+" "+d.applyToPointStringified(h.v[0][0],h.v[0][1]),n+="z")}e.caches[l]=n}else n=e.caches[l]}else if(o){for(i=0;a>i;i+=1)if(h=f.shapes[i],h&&h._length){for(r=h._length,s=1;r>s;s+=1)1==s&&(n+=" M"+h.v[0].join(",")),n+=" C"+h.o[s-1].join(",")+" "+h.i[s].join(",")+" "+h.v[s].join(",");1==r&&(n+=" M"+h.v[0].join(",")),h.c&&r&&(n+=" C"+h.o[s-1].join(",")+" "+h.i[0].join(",")+" "+h.v[0].join(","),n+="z")}e.caches[l]=n}else n=e.caches[l];e.elements[l].st.d+=n,e.elements[l].st.mdf=o||e.elements[l].st.mdf}},IShapeElement.prototype.renderFill=function(t,e){var r=e.style;(e.c.mdf||this.firstFrame)&&r.pElem.setAttribute("fill","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o.mdf||this.firstFrame)&&r.pElem.setAttribute("fill-opacity",e.o.v)},IShapeElement.prototype.renderGradient=function(t,e){var r=e.gf,s=e.of,i=e.s.v,a=e.e.v;if(e.o.mdf||this.firstFrame){var n="gf"===t.ty?"fill-opacity":"stroke-opacity";e.elem.setAttribute(n,e.o.v)}if(e.s.mdf||this.firstFrame){var o=1===t.t?"x1":"cx",h="x1"===o?"y1":"cy";r.setAttribute(o,i[0]),r.setAttribute(h,i[1]),s&&(s.setAttribute(o,i[0]),s.setAttribute(h,i[1]))}var l,p,m,f;if(e.g.cmdf||this.firstFrame){l=e.cst;var c=e.g.c;for(m=l.length,p=0;m>p;p+=1)f=l[p],f.setAttribute("offset",c[4*p]+"%"),f.setAttribute("stop-color","rgb("+c[4*p+1]+","+c[4*p+2]+","+c[4*p+3]+")")}if(s&&(e.g.omdf||this.firstFrame)){l=e.ost;var d=e.g.o;for(m=l.length,p=0;m>p;p+=1)f=l[p],f.setAttribute("offset",d[2*p]+"%"),f.setAttribute("stop-opacity",d[2*p+1])}if(1===t.t)(e.e.mdf||this.firstFrame)&&(r.setAttribute("x2",a[0]),r.setAttribute("y2",a[1]),s&&(s.setAttribute("x2",a[0]),s.setAttribute("y2",a[1])));else{var u;if((e.s.mdf||e.e.mdf||this.firstFrame)&&(u=Math.sqrt(Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)),r.setAttribute("r",u),s&&s.setAttribute("r",u)),e.e.mdf||e.h.mdf||e.a.mdf||this.firstFrame){u||(u=Math.sqrt(Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2)));var y=Math.atan2(a[1]-i[1],a[0]-i[0]),g=e.h.v>=1?.99:e.h.v<=-1?-.99:e.h.v,v=u*g,b=Math.cos(y+e.a.v)*v+i[0],E=Math.sin(y+e.a.v)*v+i[1];r.setAttribute("fx",b),r.setAttribute("fy",E),s&&(s.setAttribute("fx",b),s.setAttribute("fy",E))}}},IShapeElement.prototype.renderStroke=function(t,e){var r=e.style,s=e.d;s&&s.k&&(s.mdf||this.firstFrame)&&(r.pElem.setAttribute("stroke-dasharray",s.dasharray),r.pElem.setAttribute("stroke-dashoffset",s.dashoffset)),e.c&&(e.c.mdf||this.firstFrame)&&r.pElem.setAttribute("stroke","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o.mdf||this.firstFrame)&&r.pElem.setAttribute("stroke-opacity",e.o.v),(e.w.mdf||this.firstFrame)&&(r.pElem.setAttribute("stroke-width",e.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",e.w.v))},IShapeElement.prototype.destroy=function(){this._parent.destroy.call(this._parent),this.shapeData=null,this.viewData=null,this.parentContainer=null,this.placeholder=null},createElement(SVGBaseElement,ISolidElement),ISolidElement.prototype.createElements=function(){this._parent.createElements.call(this);var t=document.createElementNS(svgNS,"rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t),this.innerElem=t,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)},ISolidElement.prototype.hide=IImageElement.prototype.hide,ISolidElement.prototype.renderFrame=IImageElement.prototype.renderFrame,ISolidElement.prototype.destroy=IImageElement.prototype.destroy;var animationManager=function(){function t(t){for(var e=0,r=t.target;C>e;)x[e].animation===r&&(x.splice(e,1),e-=1,C-=1,r.isPaused||s()),e+=1}function e(t,e){if(!t)return null;for(var r=0;C>r;){if(x[r].elem==t&&null!==x[r].elem)return x[r].animation;r+=1}var s=new AnimationItem;return i(s,t),s.setData(t,e),s}function r(){M+=1,E()}function s(){M-=1,0===M&&(k=!0)}function i(e,i){e.addEventListener("destroy",t),e.addEventListener("_active",r),e.addEventListener("_idle",s),x.push({elem:i,animation:e}),C+=1}function a(t){var e=new AnimationItem;return i(e,null),e.setParams(t),e}function n(t,e){var r;for(r=0;C>r;r+=1)x[r].animation.setSpeed(t,e)}function o(t,e){var r;for(r=0;C>r;r+=1)x[r].animation.setDirection(t,e)}function h(t){var e;for(e=0;C>e;e+=1)x[e].animation.play(t)}function l(t,e){S=Date.now();var r;for(r=0;C>r;r+=1)x[r].animation.moveFrame(t,e)}function p(t){var e,r=t-S;for(e=0;C>e;e+=1)x[e].animation.advanceTime(r);S=t,k||requestAnimationFrame(p)}function m(t){S=t,requestAnimationFrame(p)}function f(t){var e;for(e=0;C>e;e+=1)x[e].animation.pause(t)}function c(t,e,r){var s;for(s=0;C>s;s+=1)x[s].animation.goToAndStop(t,e,r)}function d(t){var e;for(e=0;C>e;e+=1)x[e].animation.stop(t)}function u(t){var e;for(e=0;C>e;e+=1)x[e].animation.togglePause(t)}function y(t){var e;for(e=C-1;e>=0;e-=1)x[e].animation.destroy(t)}function g(t,r,s){var i,a=document.getElementsByClassName("bodymovin"),n=a.length;for(i=0;n>i;i+=1)s&&a[i].setAttribute("data-bm-type",s),e(a[i],t);if(r&&0===n){s||(s="svg");var o=document.getElementsByTagName("body")[0];o.innerHTML="";var h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),o.appendChild(h),e(h,t)}}function v(){var t;for(t=0;C>t;t+=1)x[t].animation.resize()}function b(){requestAnimationFrame(m)}function E(){k&&(k=!1,requestAnimationFrame(m))}var P={},x=[],S=0,C=0,k=!0,M=0;return setTimeout(b,0),P.registerAnimation=e,P.loadAnimation=a,P.setSpeed=n,P.setDirection=o,P.play=h,P.moveFrame=l,P.pause=f,P.stop=d,P.togglePause=u,P.searchAnimations=g,P.resize=v,P.start=b,P.goToAndStop=c,P.destroy=y,P}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.pendingElements=0,this.playCount=0,this.prerenderFramesFlag=!0,this.animationData={},this.layers=[],this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=randomString(10),this.scaleMode="fit",this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.subframeEnabled=subframeEnabled,this.segments=[],this.pendingSegment=!1,this._idle=!0,this.projectInterface=ProjectInterface()};AnimationItem.prototype.setParams=function(t){var e=this;t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var r=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(r){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;case"hybrid":case"html":default:this.renderer=new HybridRenderer(this,t.rendererSettings)}if(this.renderer.setProjectInterface(this.projectInterface),this.animType=r,""===t.loop||null===t.loop||(this.loop=t.loop===!1?!1:t.loop===!0?!0:parseInt(t.loop)),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.prerenderFramesFlag="prerender"in t?t.prerender:!0,this.autoloadSegments=t.hasOwnProperty("autoloadSegments")?t.autoloadSegments:!0,t.animationData)e.configAnimation(t.animationData);else if(t.path){"json"!=t.path.substr(-4)&&("/"!=t.path.substr(-1,1)&&(t.path+="/"),t.path+="data.json");var s=new XMLHttpRequest;this.path=-1!=t.path.lastIndexOf("\\")?t.path.substr(0,t.path.lastIndexOf("\\")+1):t.path.substr(0,t.path.lastIndexOf("/")+1),this.assetsPath=t.assetsPath,this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),s.open("GET",t.path,!0),s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)e.configAnimation(JSON.parse(s.responseText));else try{var t=JSON.parse(s.responseText);e.configAnimation(t)}catch(r){}}}},AnimationItem.prototype.setData=function(t,e){var r={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},s=t.attributes;r.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",r.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:"canvas";var i=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";""===i||(r.loop="false"===i?!1:"true"===i?!0:parseInt(i));var a=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:s.getNamedItem("bm-autoplay")?s.getNamedItem("bm-autoplay").value:!0;r.autoplay="false"!==a,r.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"";var n=s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"";"false"===n&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip),this.animationData.tf=this.totalFrames);var e,r,s=this.animationData.layers,i=s.length,a=t.layers,n=a.length;for(r=0;n>r;r+=1)for(e=0;i>e;){if(s[e].id==a[r].id){s[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(i=t.assets.length,e=0;i>e;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.renderFrame(null),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.animationData.tf);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=new XMLHttpRequest,s=this,i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,r.open("GET",i,!0),r.send(),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status)s.includeLayers(JSON.parse(r.responseText));else try{var t=JSON.parse(r.responseText);s.includeLayers(t)}catch(e){}}},AnimationItem.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.animationData.tf),this.loadNextSegment()},AnimationItem.prototype.configAnimation=function(t){this.renderer&&this.renderer.destroyed||(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.animationData.tf=this.totalFrames,this.renderer.configAnimation(t),t.assets||(t.assets=[]),t.comps&&(t.assets=t.assets.concat(t.comps),t.comps=null),this.renderer.searchExtraCompositions(t.assets),this.layers=this.animationData.layers,this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.trigger("config_ready"),this.imagePreloader=new ImagePreloader,this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(t.assets),this.loadSegments(),this.updaFrameModifier(),this.renderer.globalData.fontManager?this.waitForFontsLoaded():(dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()))},AnimationItem.prototype.waitForFontsLoaded=function(){function t(){this.renderer.globalData.fontManager.loaded?(dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()):setTimeout(t.bind(this),20)}return function(){t.bind(this)()}}(),AnimationItem.prototype.addPendingElement=function(){this.pendingElements+=1},AnimationItem.prototype.elementLoaded=function(){this.pendingElements--,this.checkLoaded()},AnimationItem.prototype.checkLoaded=function(){0===this.pendingElements&&(expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.isLoaded=!0,this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.subframeEnabled=t?!0:!1},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.subframeEnabled?this.currentRawFrame:Math.floor(this.currentRawFrame),this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){this.isLoaded!==!1&&this.renderer.renderFrame(this.currentFrame+this.firstFrame)},AnimationItem.prototype.play=function(t){t&&this.name!=t||this.isPaused===!0&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||this.isPaused===!1&&(this.isPaused=!0,this.pendingSegment||(this._idle=!0,this.trigger("_idle")))},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.currentFrame=this.currentRawFrame=0,this.playCount=0,this.gotoFrame())},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!=r||(this.setCurrentRawFrameValue(e?t:t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){return this.pendingSegment?(this.pendingSegment=!1,this.adjustSegment(this.segments.shift()),void(this.isPaused&&this.play())):void(this.isPaused!==!0&&this.isLoaded!==!1&&this.setCurrentRawFrameValue(this.currentRawFrame+t*this.frameModifier))},AnimationItem.prototype.updateAnimation=function(t){this.setCurrentRawFrameValue(this.totalFrames*t)},AnimationItem.prototype.moveFrame=function(t,e){e&&this.name!=e||this.setCurrentRawFrameValue(this.currentRawFrame+t)},AnimationItem.prototype.adjustSegment=function(t){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.01)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(0)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t-.01)),this.firstFrame=t,this.totalFrames=e-t,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if("object"==typeof t[0]){var r,s=t.length;for(r=0;s>r;r+=1)this.segments.push(t[r])}else this.segments.push(t);e&&this.adjustSegment(this.segments.shift()),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op-this.animationData.ip+this.animationData.ip*this.frameRate)]),t&&this.adjustSegment(this.segments.shift())},AnimationItem.prototype.checkSegments=function(){this.segments.length&&(this.pendingSegment=!0)},AnimationItem.prototype.remove=function(t){t&&this.name!=t||this.renderer.destroy()},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||this.renderer&&this.renderer.destroyed||(this.renderer.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){if(this.currentRawFrame=t,this.currentRawFrame>=this.totalFrames){if(this.checkSegments(),this.loop===!1)return this.currentRawFrame=this.totalFrames-.01,this.gotoFrame(),this.pause(),void this.trigger("complete");if(this.trigger("loopComplete"),this.playCount+=1,this.loop!==!0&&this.playCount==this.loop||this.pendingSegment)return this.currentRawFrame=this.totalFrames-.01,this.gotoFrame(),this.pause(),void this.trigger("complete");this.currentRawFrame=this.currentRawFrame%this.totalFrames}else if(this.currentRawFrame<0)return this.checkSegments(),this.playCount-=1,this.playCount<0&&(this.playCount=0),this.loop===!1||this.pendingSegment?(this.currentRawFrame=0,this.gotoFrame(),this.pause(),void this.trigger("complete")):(this.trigger("loopComplete"),this.currentRawFrame=(this.totalFrames+this.currentRawFrame)%this.totalFrames,void this.gotoFrame());this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=0>t?-1:1,this.updaFrameModifier()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;r>e;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getAssets=function(){return this.assets},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.addEventListener=_addEventListener,AnimationItem.prototype.removeEventListener=_removeEventListener,AnimationItem.prototype.triggerEvent=_triggerEvent,extendPrototype(BaseRenderer,CanvasRenderer),CanvasRenderer.prototype.createBase=function(t){return new CVBaseElement(t,this,this.globalData)},CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this,this.globalData)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this,this.globalData)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this,this.globalData)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this,this.globalData)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this,this.globalData)},CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13]){if(!this.renderConfig.clearCanvas)return void this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13]);this.transformMat.cloneFromProps(t),this.transformMat.transform(this.contextData.cTr.props[0],this.contextData.cTr.props[1],this.contextData.cTr.props[2],this.contextData.cTr.props[3],this.contextData.cTr.props[4],this.contextData.cTr.props[5],this.contextData.cTr.props[6],this.contextData.cTr.props[7],this.contextData.cTr.props[8],this.contextData.cTr.props[9],this.contextData.cTr.props[10],this.contextData.cTr.props[11],this.contextData.cTr.props[12],this.contextData.cTr.props[13],this.contextData.cTr.props[14],this.contextData.cTr.props[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var e=this.contextData.cTr.props;this.canvasContext.setTransform(e[0],e[1],e[4],e[5],e[12],e[13])}},CanvasRenderer.prototype.ctxOpacity=function(t){if(1!==t){if(!this.renderConfig.clearCanvas)return void(this.canvasContext.globalAlpha*=0>t?0:t);this.contextData.cO*=0>t?0:t,this.canvasContext.globalAlpha=this.contextData.cO}},CanvasRenderer.prototype.reset=function(){return this.renderConfig.clearCanvas?(this.contextData.cArrPos=0,this.contextData.cTr.reset(),void(this.contextData.cO=1)):void this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(!this.renderConfig.clearCanvas)return void this.canvasContext.save();t&&this.canvasContext.save();var e=this.contextData.cTr.props;(null===this.contextData.saved[this.contextData.cArrPos]||void 0===this.contextData.saved[this.contextData.cArrPos])&&(this.contextData.saved[this.contextData.cArrPos]=new Array(16));var r,s=this.contextData.saved[this.contextData.cArrPos];for(r=0;16>r;r+=1)s[r]=e[r];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1},CanvasRenderer.prototype.restore=function(t){if(!this.renderConfig.clearCanvas)return void this.canvasContext.restore();t&&this.canvasContext.restore(),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],s=this.contextData.cTr.props;for(e=0;16>e;e+=1)s[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.canvasContext.globalAlpha=r},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=document.createElement("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d")):this.canvasContext=this.renderConfig.context,this.data=t,this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.totalFrames=Math.floor(t.tf),this.globalData.compWidth=t.w,this.globalData.compHeight=t.h,this.globalData.frameRate=t.fr,this.globalData.frameId=0,this.globalData.compSize={w:t.w,h:t.h},this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.layers=t.layers,this.transformCanvas={},this.transformCanvas.w=t.w,this.transformCanvas.h=t.h,this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,document.body),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.elementLoaded=this.animationItem.elementLoaded.bind(this.animationItem),this.globalData.addPendingElement=this.animationItem.addPendingElement.bind(this.animationItem),this.globalData.transformCanvas=this.transformCanvas,this.elements=Array.apply(null,{length:t.layers.length}),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e;this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr);var r,s;if(-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var i=this.renderConfig.preserveAspectRatio.split(" "),a=i[1]||"meet",n=i[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,s=this.transformCanvas.w/this.transformCanvas.h,s>r&&"meet"===a||r>s&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(r>s&&"meet"===a||s>r&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(r>s&&"meet"===a||s>r&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(s>r&&"meet"===a||r>s&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(s>r&&"meet"===a||r>s&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1];var l,p=this.elements.length;for(l=0;p>l;l+=1)this.elements[l]&&0===this.elements[l].data.ty&&this.elements[l].resize(this.globalData.transformCanvas);
-
-},CanvasRenderer.prototype.destroy=function(){this.renderConfig.clearCanvas&&(this.animationItem.wrapper.innerHTML="");var t,e=this.layers?this.layers.length:0;for(t=e-1;t>=0;t-=1)this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t){if(!(this.renderedFrame==t&&this.renderConfig.clearCanvas===!0||this.destroyed||null===t)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem.firstFrame,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.renderConfig.clearCanvas===!0?(this.reset(),this.canvasContext.save(),this.canvasContext.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)):this.save(),this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip();var e,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=0;r>e;e++)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);for(e=r-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();this.renderConfig.clearCanvas!==!0?this.restore():this.canvasContext.restore()}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);e[t]=r,r.initExpressions(),0===this.layers[t].ty&&r.resize(this.globalData.transformCanvas)}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},CanvasRenderer.prototype.searchExtraCompositions=function(t){{var e,r=t.length;document.createElementNS(svgNS,"g")}for(e=0;r>e;e+=1)if(t[e].xt){var s=this.createComp(t[e],this.globalData.comp,this.globalData);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},extendPrototype(BaseRenderer,HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){var s=this.layers[e];if(s.ddd&&this.supports3d)this.addTo3dContainer(r,e);else{for(var i,a=0;e>a;)this.elements[a]&&this.elements[a]!==!0&&this.elements[a].getBaseElement&&(i=this.elements[a].getBaseElement()),a+=1;i?s.ddd&&this.supports3d||this.layerElement.insertBefore(r,i):s.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRenderer.prototype.createBase=function(t){return new SVGBaseElement(t,this.layerElement,this.globalData,this)},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.layerElement,this.globalData,this):new IShapeElement(t,this.layerElement,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.layerElement,this.globalData,this):new SVGTextElement(t,this.layerElement,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.layerElement,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.layerElement,this.globalData,this):new IImageElement(t,this.layerElement,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.layerElement,this.globalData,this):new ICompElement(t,this.layerElement,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.layerElement,this.globalData,this):new ISolidElement(t,this.layerElement,this.globalData,this)},HybridRenderer.prototype.getThreeDContainer=function(t){var e=document.createElement("div");styleDiv(e),e.style.width=this.globalData.compSize.w+"px",e.style.height=this.globalData.compSize.h+"px",e.style.transformOrigin=e.style.mozTransformOrigin=e.style.webkitTransformOrigin="50% 50%";var r=document.createElement("div");styleDiv(r),r.style.transform=r.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",e.appendChild(r),this.resizerElem.appendChild(e);var s={container:r,perspectiveElem:e,startPos:t,endPos:t};return this.threeDElements.push(s),s},HybridRenderer.prototype.build3dContainers=function(){var t,e,r=this.layers.length;for(t=0;r>t;t+=1)this.layers[t].ddd?(e||(e=this.getThreeDContainer(t)),e.endPos=Math.max(e.endPos,t)):e=null},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var r=0,s=this.threeDElements.length;s>r;){if(e<=this.threeDElements[r].endPos){for(var i,a=this.threeDElements[r].startPos;e>a;)this.elements[a]&&this.elements[a].getBaseElement&&(i=this.elements[a].getBaseElement()),a+=1;i?this.threeDElements[r].container.insertBefore(t,i):this.threeDElements[r].container.appendChild(t);break}r+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=document.createElement("div"),r=this.animationItem.wrapper;e.style.width=t.w+"px",e.style.height=t.h+"px",this.resizerElem=e,styleDiv(e),e.style.transformStyle=e.style.webkitTransformStyle=e.style.mozTransformStyle="flat",r.appendChild(e),e.style.overflow="hidden";var s=document.createElementNS(svgNS,"svg");s.setAttribute("width","1"),s.setAttribute("height","1"),styleDiv(s),this.resizerElem.appendChild(s);var i=document.createElementNS(svgNS,"defs");s.appendChild(i),this.globalData.defs=i,this.data=t,this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.elementLoaded=this.animationItem.elementLoaded.bind(this.animationItem),this.globalData.frameId=0,this.globalData.compSize={w:t.w,h:t.h},this.globalData.frameRate=t.fr,this.layers=t.layers,this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,s),this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;e>t;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,r,s,i=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight,n=i/a,o=this.globalData.compSize.w/this.globalData.compSize.h;o>n?(t=i/this.globalData.compSize.w,e=i/this.globalData.compSize.w,r=0,s=(a-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,r=(i-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,s=0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+r+","+s+",0,1)"},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,r=this.globalData.compSize.h,s=this.threeDElements.length;for(t=0;s>t;t+=1)this.threeDElements[t].perspectiveElem.style.perspective=this.threeDElements[t].perspectiveElem.style.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(r,2))+"px"}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length,s=document.createElement("div");for(e=0;r>e;e+=1)if(t[e].xt){var i=this.createComp(t[e],s,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},createElement(BaseElement,CVBaseElement),CVBaseElement.prototype.createElements=function(){this.checkParenting()},CVBaseElement.prototype.checkBlendMode=function(t){if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e="";switch(this.data.bm){case 0:e="normal";break;case 1:e="multiply";break;case 2:e="screen";break;case 3:e="overlay";break;case 4:e="darken";break;case 5:e="lighten";break;case 6:e="color-dodge";break;case 7:e="color-burn";break;case 8:e="hard-light";break;case 9:e="soft-light";break;case 10:e="difference";break;case 11:e="exclusion";break;case 12:e="hue";break;case 13:e="saturation";break;case 14:e="color";break;case 15:e="luminosity"}t.canvasContext.globalCompositeOperation=e}},CVBaseElement.prototype.renderFrame=function(t){if(3===this.data.ty)return!1;if(this.checkBlendMode(0===this.data.ty?this.parentGlobalData:this.globalData),!this.isVisible)return this.isVisible;this.finalTransform.opMdf=this.finalTransform.op.mdf,this.finalTransform.matMdf=this.finalTransform.mProp.mdf,this.finalTransform.opacity=this.finalTransform.op.v;var e,r=this.finalTransform.mat;if(this.hierarchy){var s,i=this.hierarchy.length;for(e=this.finalTransform.mProp.v.props,r.cloneFromProps(e),s=0;i>s;s+=1)this.finalTransform.matMdf=this.hierarchy[s].finalTransform.mProp.mdf?!0:this.finalTransform.matMdf,e=this.hierarchy[s].finalTransform.mProp.v.props,r.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}else t?(e=this.finalTransform.mProp.v.props,r.cloneFromProps(e)):r.cloneFromProps(this.finalTransform.mProp.v.props);return t&&(e=t.mat.props,r.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.finalTransform.opacity*=t.opacity,this.finalTransform.opMdf=t.opMdf?!0:this.finalTransform.opMdf,this.finalTransform.matMdf=t.matMdf?!0:this.finalTransform.matMdf),this.data.hasMask&&(this.globalData.renderer.save(!0),this.maskManager.renderFrame(0===this.data.ty?null:r)),this.data.hd&&(this.isVisible=!1),this.isVisible},CVBaseElement.prototype.addMasks=function(t){this.maskManager=new CVMaskElement(t,this,this.globalData)},CVBaseElement.prototype.destroy=function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager&&this.maskManager.destroy()},CVBaseElement.prototype.mHelper=new Matrix,createElement(CVBaseElement,CVCompElement),CVCompElement.prototype.ctxTransform=CanvasRenderer.prototype.ctxTransform,CVCompElement.prototype.ctxOpacity=CanvasRenderer.prototype.ctxOpacity,CVCompElement.prototype.save=CanvasRenderer.prototype.save,CVCompElement.prototype.restore=CanvasRenderer.prototype.restore,CVCompElement.prototype.reset=function(){this.contextData.cArrPos=0,this.contextData.cTr.reset(),this.contextData.cO=1},CVCompElement.prototype.resize=function(t){var e=Math.max(t.sx,t.sy);this.canvas.width=this.data.w*e,this.canvas.height=this.data.h*e,this.transformCanvas={sc:e,w:this.data.w*e,h:this.data.h*e,props:[e,0,0,0,0,e,0,0,0,0,1,0,0,0,0,1]};var r,s=this.elements.length;for(r=0;s>r;r+=1)this.elements[r]&&0===this.elements[r].data.ty&&this.elements[r].resize(t)},CVCompElement.prototype.prepareFrame=function(t){if(this.globalData.frameId=this.parentGlobalData.frameId,this.globalData.mdf=!1,this._parent.prepareFrame.call(this,t),this.isVisible!==!1||this.data.xt){var e=t;this.tm&&(e=this.tm.v,e===this.data.op&&(e=this.data.op-1)),this.renderedFrame=e/this.data.sr;var r,s=this.elements.length;for(this.completeLayers||this.checkLayers(t),r=0;s>r;r+=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(e/this.data.sr-this.layers[r].st),0===this.elements[r].data.ty&&this.elements[r].globalData.mdf&&(this.globalData.mdf=!0));this.globalData.mdf&&!this.data.xt&&(this.canvasContext.clearRect(0,0,this.data.w,this.data.h),this.ctxTransform(this.transformCanvas.props))}},CVCompElement.prototype.renderFrame=function(t){if(this._parent.renderFrame.call(this,t)!==!1){if(this.globalData.mdf){var e,r=this.layers.length;for(e=r-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}this.data.hasMask&&this.globalData.renderer.restore(!0),this.firstFrame&&(this.firstFrame=!1),this.parentGlobalData.renderer.save(),this.parentGlobalData.renderer.ctxTransform(this.finalTransform.mat.props),this.parentGlobalData.renderer.ctxOpacity(this.finalTransform.opacity),this.parentGlobalData.renderer.canvasContext.drawImage(this.canvas,0,0,this.data.w,this.data.h),this.parentGlobalData.renderer.restore(),this.globalData.mdf&&this.reset()}},CVCompElement.prototype.setElements=function(t){this.elements=t},CVCompElement.prototype.getElements=function(){return this.elements},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t].destroy();this.layers=null,this.elements=null,this._parent.destroy.call(this._parent)},CVCompElement.prototype.checkLayers=CanvasRenderer.prototype.checkLayers,CVCompElement.prototype.buildItem=CanvasRenderer.prototype.buildItem,CVCompElement.prototype.checkPendingElements=CanvasRenderer.prototype.checkPendingElements,CVCompElement.prototype.addPendingElement=CanvasRenderer.prototype.addPendingElement,CVCompElement.prototype.buildAllItems=CanvasRenderer.prototype.buildAllItems,CVCompElement.prototype.createItem=CanvasRenderer.prototype.createItem,CVCompElement.prototype.createImage=CanvasRenderer.prototype.createImage,CVCompElement.prototype.createComp=CanvasRenderer.prototype.createComp,CVCompElement.prototype.createSolid=CanvasRenderer.prototype.createSolid,CVCompElement.prototype.createShape=CanvasRenderer.prototype.createShape,CVCompElement.prototype.createText=CanvasRenderer.prototype.createText,CVCompElement.prototype.createBase=CanvasRenderer.prototype.createBase,CVCompElement.prototype.buildElementParenting=CanvasRenderer.prototype.buildElementParenting,createElement(CVBaseElement,CVImageElement),CVImageElement.prototype.createElements=function(){var t=function(){if(this.globalData.elementLoaded(),this.assetData.w!==this.img.width||this.assetData.h!==this.img.height){var t=document.createElement("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,r,s=t.getContext("2d"),i=this.img.width,a=this.img.height,n=i/a,o=this.assetData.w/this.assetData.h;n>o?(r=a,e=r*o):(e=i,r=e/o),s.drawImage(this.img,(i-e)/2,(a-r)/2,e,r,0,0,this.assetData.w,this.assetData.h),this.img=t}}.bind(this),e=function(){this.failed=!0,this.globalData.elementLoaded()}.bind(this);this.img=new Image,this.img.addEventListener("load",t,!1),this.img.addEventListener("error",e,!1);var r=this.globalData.getAssetsPath(this.assetData);this.img.src=r,this._parent.createElements.call(this)},CVImageElement.prototype.renderFrame=function(t){if(!this.failed&&this._parent.renderFrame.call(this,t)!==!1){var e=this.canvasContext;this.globalData.renderer.save();var r=this.finalTransform.mat.props;this.globalData.renderer.ctxTransform(r),this.globalData.renderer.ctxOpacity(this.finalTransform.opacity),e.drawImage(this.img,0,0),this.globalData.renderer.restore(this.data.hasMask),this.firstFrame&&(this.firstFrame=!1)}},CVImageElement.prototype.destroy=function(){this.img=null,this._parent.destroy.call(this._parent)},CVMaskElement.prototype.getMaskProperty=function(t){return this.viewData[t]},CVMaskElement.prototype.prepareFrame=function(t){var e,r=this.dynamicProperties.length;for(e=0;r>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.element.globalData.mdf=!0)},CVMaskElement.prototype.renderFrame=function(t){var e,r,s,i,a,n=this.element.canvasContext,o=this.data.masksProperties.length,h=!1;for(e=0;o>e;e++)if("n"!==this.masksProperties[e].mode){h===!1&&(n.beginPath(),h=!0),this.masksProperties[e].inv&&(n.moveTo(0,0),n.lineTo(this.element.globalData.compWidth,0),n.lineTo(this.element.globalData.compWidth,this.element.globalData.compHeight),n.lineTo(0,this.element.globalData.compHeight),n.lineTo(0,0)),a=this.viewData[e].v,r=t?t.applyToPointArray(a.v[0][0],a.v[0][1],0):a.v[0],n.moveTo(r[0],r[1]);var l,p=a._length;for(l=1;p>l;l++)r=t?t.applyToPointArray(a.o[l-1][0],a.o[l-1][1],0):a.o[l-1],s=t?t.applyToPointArray(a.i[l][0],a.i[l][1],0):a.i[l],i=t?t.applyToPointArray(a.v[l][0],a.v[l][1],0):a.v[l],n.bezierCurveTo(r[0],r[1],s[0],s[1],i[0],i[1]);r=t?t.applyToPointArray(a.o[l-1][0],a.o[l-1][1],0):a.o[l-1],s=t?t.applyToPointArray(a.i[0][0],a.i[0][1],0):a.i[0],i=t?t.applyToPointArray(a.v[0][0],a.v[0][1],0):a.v[0],n.bezierCurveTo(r[0],r[1],s[0],s[1],i[0],i[1])}h&&n.clip()},CVMaskElement.prototype.getMask=function(t){for(var e=0,r=this.masksProperties.length;r>e;){if(this.masksProperties[e].nm===t)return{maskPath:this.viewData[e].pv};e+=1}},CVMaskElement.prototype.destroy=function(){this.element=null},createElement(CVBaseElement,CVShapeElement),CVShapeElement.prototype.lcEnum={1:"butt",2:"round",3:"butt"},CVShapeElement.prototype.ljEnum={1:"miter",2:"round",3:"butt"},CVShapeElement.prototype.transformHelper={opacity:1,mat:new Matrix,matMdf:!1,opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createElements=function(){this._parent.createElements.call(this),this.searchShapes(this.shapesData,this.viewData,this.dynamicProperties)},CVShapeElement.prototype.searchShapes=function(t,e,r){var s,i,a,n,o=t.length-1,h=[],l=[];for(s=o;s>=0;s-=1)if("fl"==t[s].ty||"st"==t[s].ty){if(n={type:t[s].ty,elements:[]},e[s]={},("fl"==t[s].ty||"st"==t[s].ty)&&(e[s].c=PropertyFactory.getProp(this,t[s].c,1,255,r),e[s].c.k||(n.co="rgb("+bm_floor(e[s].c.v[0])+","+bm_floor(e[s].c.v[1])+","+bm_floor(e[s].c.v[2])+")")),e[s].o=PropertyFactory.getProp(this,t[s].o,0,.01,r),"st"==t[s].ty){if(n.lc=this.lcEnum[t[s].lc]||"round",n.lj=this.ljEnum[t[s].lj]||"round",1==t[s].lj&&(n.ml=t[s].ml),e[s].w=PropertyFactory.getProp(this,t[s].w,0,null,r),e[s].w.k||(n.wi=e[s].w.v),t[s].d){var p=PropertyFactory.getDashProp(this,t[s].d,"canvas",r);e[s].d=p,e[s].d.k||(n.da=e[s].d.dasharray,n["do"]=e[s].d.dashoffset)}}else n.r=2===t[s].r?"evenodd":"nonzero";this.stylesList.push(n),e[s].style=n,h.push(e[s].style)}else if("gr"==t[s].ty)e[s]={it:[]},this.searchShapes(t[s].it,e[s].it,r);else if("tr"==t[s].ty)e[s]={transform:{mat:new Matrix,opacity:1,matMdf:!1,opMdf:!1,op:PropertyFactory.getProp(this,t[s].o,0,.01,r),mProps:PropertyFactory.getProp(this,t[s],2,null,r)},elements:[]};else if("sh"==t[s].ty||"rc"==t[s].ty||"el"==t[s].ty||"sr"==t[s].ty){e[s]={nodes:[],trNodes:[],tr:[0,0,0,0,0,0]};var m=4;"rc"==t[s].ty?m=5:"el"==t[s].ty?m=6:"sr"==t[s].ty&&(m=7),e[s].sh=ShapePropertyFactory.getShapeProp(this,t[s],m,r),this.shapes.push(e[s].sh),this.addShapeToModifiers(e[s]),a=this.stylesList.length;var f=!1,c=!1;for(i=0;a>i;i+=1)this.stylesList[i].closed||(this.stylesList[i].elements.push(e[s]),"st"===this.stylesList[i].type?f=!0:c=!0);e[s].st=f,e[s].fl=c}else if("tm"==t[s].ty||"rd"==t[s].ty||"rp"==t[s].ty){var d=ShapeModifiers.getModifier(t[s].ty);d.init(this,t[s],r),this.shapeModifiers.push(d),l.push(d),e[s]=d}for(o=h.length,s=0;o>s;s+=1)h[s].closed=!0;for(o=l.length,s=0;o>s;s+=1)l[s].closed=!0},CVShapeElement.prototype.addShapeToModifiers=IShapeElement.prototype.addShapeToModifiers,CVShapeElement.prototype.renderModifiers=IShapeElement.prototype.renderModifiers,CVShapeElement.prototype.renderFrame=function(t){this._parent.renderFrame.call(this,t)!==!1&&(this.transformHelper.mat.reset(),this.transformHelper.opacity=this.finalTransform.opacity,this.transformHelper.matMdf=!1,this.transformHelper.opMdf=this.finalTransform.opMdf,this.renderModifiers(),this.renderShape(this.transformHelper,null,null,!0),this.data.hasMask&&this.globalData.renderer.restore(!0))},CVShapeElement.prototype.renderShape=function(t,e,r,s){var i,a;if(!e)for(e=this.shapesData,a=this.stylesList.length,i=0;a>i;i+=1)this.stylesList[i].d="",this.stylesList[i].mdf=!1;r||(r=this.viewData),a=e.length-1;var n,o;for(n=t,i=a;i>=0;i-=1)if("tr"==e[i].ty){n=r[i].transform;var h=r[i].transform.mProps.v.props;if(n.matMdf=n.mProps.mdf,n.opMdf=n.op.mdf,o=n.mat,o.cloneFromProps(h),t){var l=t.mat.props;n.opacity=t.opacity,n.opacity*=r[i].transform.op.v,n.matMdf=t.matMdf?!0:n.matMdf,n.opMdf=t.opMdf?!0:n.opMdf,o.transform(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15])}else n.opacity=n.op.o}else"sh"==e[i].ty||"el"==e[i].ty||"rc"==e[i].ty||"sr"==e[i].ty?this.renderPath(e[i],r[i],n):"fl"==e[i].ty?this.renderFill(e[i],r[i],n):"st"==e[i].ty?this.renderStroke(e[i],r[i],n):"gr"==e[i].ty?this.renderShape(n,e[i].it,r[i].it):"tm"==e[i].ty;if(s){a=this.stylesList.length;var p,m,f,c,d,u,y,g=this.globalData.renderer,v=this.globalData.canvasContext;for(g.save(),g.ctxTransform(this.finalTransform.mat.props),i=0;a>i;i+=1)if(y=this.stylesList[i].type,"st"!==y||0!==this.stylesList[i].wi){for(g.save(),d=this.stylesList[i].elements,"st"===y?(v.strokeStyle=this.stylesList[i].co,v.lineWidth=this.stylesList[i].wi,v.lineCap=this.stylesList[i].lc,v.lineJoin=this.stylesList[i].lj,v.miterLimit=this.stylesList[i].ml||0):v.fillStyle=this.stylesList[i].co,g.ctxOpacity(this.stylesList[i].coOp),"st"!==y&&v.beginPath(),m=d.length,p=0;m>p;p+=1){for("st"===y&&(v.beginPath(),this.stylesList[i].da?(v.setLineDash(this.stylesList[i].da),v.lineDashOffset=this.stylesList[i]["do"],this.globalData.isDashed=!0):this.globalData.isDashed&&(v.setLineDash(this.dashResetter),this.globalData.isDashed=!1)),u=d[p].trNodes,c=u.length,f=0;c>f;f+=1)"m"==u[f].t?v.moveTo(u[f].p[0],u[f].p[1]):"c"==u[f].t?v.bezierCurveTo(u[f].p1[0],u[f].p1[1],u[f].p2[0],u[f].p2[1],u[f].p3[0],u[f].p3[1]):v.closePath();"st"===y&&v.stroke()}"st"!==y&&v.fill(this.stylesList[i].r),g.restore()}g.restore(),this.firstFrame&&(this.firstFrame=!1)}},CVShapeElement.prototype.renderPath=function(t,e,r){var s,i,a,n,o=r.matMdf||e.sh.mdf||this.firstFrame;if(o){var h=e.sh.paths;n=h._length;var l=e.trNodes;for(l.length=0,a=0;n>a;a+=1){var p=h.shapes[a];if(p&&p.v){for(s=p._length,i=1;s>i;i+=1)1==i&&l.push({t:"m",p:r.mat.applyToPointArray(p.v[0][0],p.v[0][1],0)}),l.push({t:"c",p1:r.mat.applyToPointArray(p.o[i-1][0],p.o[i-1][1],0),p2:r.mat.applyToPointArray(p.i[i][0],p.i[i][1],0),p3:r.mat.applyToPointArray(p.v[i][0],p.v[i][1],0)});1==s&&l.push({t:"m",p:r.mat.applyToPointArray(p.v[0][0],p.v[0][1],0)}),p.c&&s&&(l.push({t:"c",p1:r.mat.applyToPointArray(p.o[i-1][0],p.o[i-1][1],0),p2:r.mat.applyToPointArray(p.i[0][0],p.i[0][1],0),p3:r.mat.applyToPointArray(p.v[0][0],p.v[0][1],0)}),l.push({t:"z"})),e.lStr=l}}if(e.st)for(i=0;16>i;i+=1)e.tr[i]=r.mat.props[i];e.trNodes=l}},CVShapeElement.prototype.renderFill=function(t,e,r){var s=e.style;(e.c.mdf||this.firstFrame)&&(s.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o.mdf||r.opMdf||this.firstFrame)&&(s.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderStroke=function(t,e,r){var s=e.style,i=e.d;i&&(i.mdf||this.firstFrame)&&(s.da=i.dasharray,s["do"]=i.dashoffset),(e.c.mdf||this.firstFrame)&&(s.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o.mdf||r.opMdf||this.firstFrame)&&(s.coOp=e.o.v*r.opacity),(e.w.mdf||this.firstFrame)&&(s.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.viewData.length=0,this._parent.destroy.call(this._parent)},createElement(CVBaseElement,CVSolidElement),CVSolidElement.prototype.renderFrame=function(t){if(this._parent.renderFrame.call(this,t)!==!1){var e=this.canvasContext;this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.opacity),e.fillStyle=this.data.sc,e.fillRect(0,0,this.data.sw,this.data.sh),this.globalData.renderer.restore(this.data.hasMask),this.firstFrame&&(this.firstFrame=!1)}},createElement(CVBaseElement,CVTextElement),CVTextElement.prototype.init=ITextElement.prototype.init,CVTextElement.prototype.getMeasures=ITextElement.prototype.getMeasures,CVTextElement.prototype.getMult=ITextElement.prototype.getMult,CVTextElement.prototype.prepareFrame=ITextElement.prototype.prepareFrame,CVTextElement.prototype.tHelper=document.createElement("canvas").getContext("2d"),CVTextElement.prototype.createElements=function(){this._parent.createElements.call(this)},CVTextElement.prototype.buildNewText=function(){var t=this.currentTextDocumentData;this.renderedLetters=Array.apply(null,{length:this.currentTextDocumentData.l?this.currentTextDocumentData.l.length:0});var e=!1;t.fc?(e=!0,this.values.fill="rgb("+Math.round(255*t.fc[0])+","+Math.round(255*t.fc[1])+","+Math.round(255*t.fc[2])+")"):this.values.fill="rgba(0,0,0,0)",this.fill=e;var r=!1;t.sc&&(r=!0,this.values.stroke="rgb("+Math.round(255*t.sc[0])+","+Math.round(255*t.sc[1])+","+Math.round(255*t.sc[2])+")",this.values.sWidth=t.sw);var s,i,a=this.globalData.fontManager.getFontByName(t.f),n=t.l,o=this.mHelper;this.stroke=r,this.values.fValue=t.s+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,i=t.t.length,this.tHelper.font=this.values.fValue;var h,l,p,m,f,c,d,u,y,g,v=this.data.singleShape;if(v)var b=0,E=0,P=t.lineWidths,x=t.boxWidth,S=!0;var C=0;for(s=0;i>s;s+=1){h=this.globalData.fontManager.getCharData(t.t.charAt(s),a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);var l;if(l=h?h.data:null,o.reset(),v&&n[s].n&&(b=0,E+=t.yOffset,E+=S?1:0,S=!1),l&&l.shapes){if(f=l.shapes[0].it,d=f.length,o.scale(t.s/100,t.s/100),v){switch(t.ps&&o.translate(t.ps[0],t.ps[1]+t.ascent,0),o.translate(0,-t.ls,0),t.j){case 1:o.translate(t.justifyOffset+(x-P[n[s].line]),0,0);break;case 2:o.translate(t.justifyOffset+(x-P[n[s].line])/2,0,0)}o.translate(b,E,0)}for(y=new Array(d),c=0;d>c;c+=1){for(m=f[c].ks.k.i.length,u=f[c].ks.k,g=[],p=1;m>p;p+=1)1==p&&g.push(o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[p][0],u.i[p][1],0),o.applyToY(u.i[p][0],u.i[p][1],0),o.applyToX(u.v[p][0],u.v[p][1],0),o.applyToY(u.v[p][0],u.v[p][1],0));g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[0][0],u.i[0][1],0),o.applyToY(u.i[0][0],u.i[0][1],0),o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),y[c]=g}}else y=[];v&&(b+=n[s].l),this.textSpans[C]?this.textSpans[C].elem=y:this.textSpans[C]={elem:y},C+=1}},CVTextElement.prototype.renderFrame=function(t){if(this._parent.renderFrame.call(this,t)!==!1){var e=this.canvasContext,r=this.finalTransform.mat.props;this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(r),this.globalData.renderer.ctxOpacity(this.finalTransform.opacity),e.font=this.values.fValue,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4,this.data.singleShape||this.getMeasures();var s,i,a,n,o,h,l=this.renderedLetters,p=this.currentTextDocumentData.l;i=p.length;var m,f,c,d=null,u=null,y=null;for(s=0;i>s;s+=1)if(!p[s].n){if(m=l[s],m&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(m.props),this.globalData.renderer.ctxOpacity(m.o)),this.fill){for(m&&m.fc?d!==m.fc&&(d=m.fc,e.fillStyle=m.fc):d!==this.values.fill&&(d=this.values.fill,e.fillStyle=this.values.fill),f=this.textSpans[s].elem,n=f.length,this.globalData.canvasContext.beginPath(),a=0;n>a;a+=1)for(c=f[a],h=c.length,this.globalData.canvasContext.moveTo(c[0],c[1]),o=2;h>o;o+=6)this.globalData.canvasContext.bezierCurveTo(c[o],c[o+1],c[o+2],c[o+3],c[o+4],c[o+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(m&&m.sw?y!==m.sw&&(y=m.sw,e.lineWidth=m.sw):y!==this.values.sWidth&&(y=this.values.sWidth,e.lineWidth=this.values.sWidth),m&&m.sc?u!==m.sc&&(u=m.sc,e.strokeStyle=m.sc):u!==this.values.stroke&&(u=this.values.stroke,e.strokeStyle=this.values.stroke),f=this.textSpans[s].elem,n=f.length,this.globalData.canvasContext.beginPath(),a=0;n>a;a+=1)for(c=f[a],h=c.length,this.globalData.canvasContext.moveTo(c[0],c[1]),o=2;h>o;o+=6)this.globalData.canvasContext.bezierCurveTo(c[o],c[o+1],c[o+2],c[o+3],c[o+4],c[o+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}m&&this.globalData.renderer.restore()}this.globalData.renderer.restore(this.data.hasMask),this.firstFrame&&(this.firstFrame=!1)}},createElement(BaseElement,HBaseElement),HBaseElement.prototype.checkBlendMode=function(){},HBaseElement.prototype.setBlendMode=BaseElement.prototype.setBlendMode,HBaseElement.prototype.getBaseElement=function(){return this.baseElement},HBaseElement.prototype.createElements=function(){this.data.hasMask?(this.layerElement=document.createElementNS(svgNS,"svg"),styleDiv(this.layerElement),this.baseElement=this.layerElement,this.maskedElement=this.layerElement):this.layerElement=this.parentContainer,this.transformedElement=this.layerElement,!this.data.ln||4!==this.data.ty&&0!==this.data.ty||(this.layerElement===this.parentContainer&&(this.layerElement=document.createElementNS(svgNS,"g"),this.baseElement=this.layerElement),this.layerElement.setAttribute("id",this.data.ln)),this.setBlendMode(),this.layerElement!==this.parentContainer&&(this.placeholder=null),this.checkParenting()},HBaseElement.prototype.renderFrame=function(t){if(3===this.data.ty)return!1;if(this.currentFrameNum===this.lastNum||!this.isVisible)return this.isVisible;this.lastNum=this.currentFrameNum,this.finalTransform.opMdf=this.finalTransform.op.mdf,this.finalTransform.matMdf=this.finalTransform.mProp.mdf,this.finalTransform.opacity=this.finalTransform.op.v,this.firstFrame&&(this.finalTransform.opMdf=!0,this.finalTransform.matMdf=!0);var e,r=this.finalTransform.mat;if(this.hierarchy){var s,i=this.hierarchy.length;for(e=this.finalTransform.mProp.v.props,r.cloneFromProps(e),s=0;i>s;s+=1)this.finalTransform.matMdf=this.hierarchy[s].finalTransform.mProp.mdf?!0:this.finalTransform.matMdf,e=this.hierarchy[s].finalTransform.mProp.v.props,r.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}else this.isVisible&&this.finalTransform.matMdf&&(t?(e=this.finalTransform.mProp.v.props,r.cloneFromProps(e)):r.cloneFromProps(this.finalTransform.mProp.v.props));return this.data.hasMask&&this.maskManager.renderFrame(r),t&&(e=t.mat.props,r.cloneFromProps(e),this.finalTransform.opacity*=t.opacity,this.finalTransform.opMdf=t.opMdf?!0:this.finalTransform.opMdf,this.finalTransform.matMdf=t.matMdf?!0:this.finalTransform.matMdf),this.finalTransform.matMdf&&(this.transformedElement.style.transform=this.transformedElement.style.webkitTransform=r.toCSS(),this.finalMat=r),this.finalTransform.opMdf&&(this.transformedElement.style.opacity=this.finalTransform.opacity),this.isVisible},HBaseElement.prototype.destroy=function(){this.layerElement=null,this.transformedElement=null,this.parentContainer=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},HBaseElement.prototype.getDomElement=function(){return this.layerElement},HBaseElement.prototype.addMasks=function(t){this.maskManager=new MaskElement(t,this,this.globalData)},HBaseElement.prototype.hide=function(){},HBaseElement.prototype.setMatte=function(){},HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,createElement(HBaseElement,HSolidElement),HSolidElement.prototype.createElements=function(){var t=document.createElement("div");styleDiv(t);var e=document.createElementNS(svgNS,"svg");styleDiv(e),e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),t.appendChild(e),this.layerElement=t,this.transformedElement=t,this.baseElement=t,this.innerElem=t,this.data.ln&&this.innerElem.setAttribute("id",this.data.ln),0!==this.data.bm&&this.setBlendMode();
-
-var r=document.createElementNS(svgNS,"rect");r.setAttribute("width",this.data.sw),r.setAttribute("height",this.data.sh),r.setAttribute("fill",this.data.sc),e.appendChild(r),this.data.hasMask&&(this.maskedElement=r),this.checkParenting()},HSolidElement.prototype.hide=IImageElement.prototype.hide,HSolidElement.prototype.renderFrame=IImageElement.prototype.renderFrame,HSolidElement.prototype.destroy=IImageElement.prototype.destroy,createElement(HBaseElement,HCompElement),HCompElement.prototype.createElements=function(){var t=document.createElement("div");if(styleDiv(t),this.data.ln&&t.setAttribute("id",this.data.ln),t.style.clip="rect(0px, "+this.data.w+"px, "+this.data.h+"px, 0px)",this.data.hasMask){var e=document.createElementNS(svgNS,"svg");styleDiv(e),e.setAttribute("width",this.data.w),e.setAttribute("height",this.data.h);var r=document.createElementNS(svgNS,"g");e.appendChild(r),t.appendChild(e),this.maskedElement=r,this.baseElement=t,this.layerElement=r,this.transformedElement=t}else this.layerElement=t,this.baseElement=this.layerElement,this.transformedElement=t;this.checkParenting()},HCompElement.prototype.hide=ICompElement.prototype.hide,HCompElement.prototype.prepareFrame=ICompElement.prototype.prepareFrame,HCompElement.prototype.setElements=ICompElement.prototype.setElements,HCompElement.prototype.getElements=ICompElement.prototype.getElements,HCompElement.prototype.destroy=ICompElement.prototype.destroy,HCompElement.prototype.renderFrame=function(t){var e,r=this._parent.renderFrame.call(this,t),s=this.layers.length;if(r===!1)return void this.hide();for(this.hidden=!1,e=0;s>e;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();this.firstFrame&&(this.firstFrame=!1)},HCompElement.prototype.checkLayers=BaseRenderer.prototype.checkLayers,HCompElement.prototype.buildItem=HybridRenderer.prototype.buildItem,HCompElement.prototype.checkPendingElements=HybridRenderer.prototype.checkPendingElements,HCompElement.prototype.addPendingElement=HybridRenderer.prototype.addPendingElement,HCompElement.prototype.buildAllItems=BaseRenderer.prototype.buildAllItems,HCompElement.prototype.createItem=HybridRenderer.prototype.createItem,HCompElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,HCompElement.prototype.createImage=HybridRenderer.prototype.createImage,HCompElement.prototype.createComp=HybridRenderer.prototype.createComp,HCompElement.prototype.createSolid=HybridRenderer.prototype.createSolid,HCompElement.prototype.createShape=HybridRenderer.prototype.createShape,HCompElement.prototype.createText=HybridRenderer.prototype.createText,HCompElement.prototype.createBase=HybridRenderer.prototype.createBase,HCompElement.prototype.appendElementInPos=HybridRenderer.prototype.appendElementInPos,createElement(HBaseElement,HShapeElement);var parent=HShapeElement.prototype._parent;extendPrototype(IShapeElement,HShapeElement),HShapeElement.prototype._parent=parent,HShapeElement.prototype.createElements=function(){var t=document.createElement("div");styleDiv(t);var e=document.createElementNS(svgNS,"svg");styleDiv(e);var r=this.comp.data?this.comp.data:this.globalData.compSize;if(e.setAttribute("width",r.w),e.setAttribute("height",r.h),this.data.hasMask){var s=document.createElementNS(svgNS,"g");t.appendChild(e),e.appendChild(s),this.maskedElement=s,this.layerElement=s,this.shapesContainer=s}else t.appendChild(e),this.layerElement=e,this.shapesContainer=document.createElementNS(svgNS,"g"),this.layerElement.appendChild(this.shapesContainer);this.data.hd||(this.baseElement=t),this.innerElem=t,this.data.ln&&this.innerElem.setAttribute("id",this.data.ln),this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.dynamicProperties,0),this.buildExpressionInterface(),this.layerElement=t,this.transformedElement=t,this.shapeCont=e,0!==this.data.bm&&this.setBlendMode(),this.checkParenting()},HShapeElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);if(e===!1)return void this.hide();if(this.hidden&&(this.layerElement.style.display="block",this.hidden=!1),this.renderModifiers(),this.addedTransforms.mdf=this.finalTransform.matMdf,this.addedTransforms.mats.length=1,this.addedTransforms.mats[0]=this.finalTransform.mat,this.renderShape(null,null,!0,null),this.isVisible&&(this.elemMdf||this.firstFrame)){var r=this.shapeCont.getBBox(),s=!1;this.currentBBox.w!==r.width&&(this.currentBBox.w=r.width,this.shapeCont.setAttribute("width",r.width),s=!0),this.currentBBox.h!==r.height&&(this.currentBBox.h=r.height,this.shapeCont.setAttribute("height",r.height),s=!0),(s||this.currentBBox.x!==r.x||this.currentBBox.y!==r.y)&&(this.currentBBox.w=r.width,this.currentBBox.h=r.height,this.currentBBox.x=r.x,this.currentBBox.y=r.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.shapeCont.style.transform=this.shapeCont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}},createElement(HBaseElement,HTextElement),HTextElement.prototype.init=ITextElement.prototype.init,HTextElement.prototype.getMeasures=ITextElement.prototype.getMeasures,HTextElement.prototype.createPathShape=ITextElement.prototype.createPathShape,HTextElement.prototype.prepareFrame=ITextElement.prototype.prepareFrame,HTextElement.prototype.createElements=function(){this.isMasked=this.checkMasks();var t=document.createElement("div");if(styleDiv(t),this.layerElement=t,this.transformedElement=t,this.isMasked){this.renderType="svg";var e=document.createElementNS(svgNS,"svg");styleDiv(e),this.cont=e,this.compW=this.comp.data.w,this.compH=this.comp.data.h,e.setAttribute("width",this.compW),e.setAttribute("height",this.compH);var r=document.createElementNS(svgNS,"g");e.appendChild(r),t.appendChild(e),this.maskedElement=r,this.innerElem=r}else this.renderType="html",this.innerElem=t;this.baseElement=t,this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.currentTextDocumentData;this.renderedLetters=Array.apply(null,{length:this.currentTextDocumentData.l?this.currentTextDocumentData.l.length:0}),this.innerElem.style.color=this.innerElem.style.fill=t.fc?"rgb("+Math.round(255*t.fc[0])+","+Math.round(255*t.fc[1])+","+Math.round(255*t.fc[2])+")":"rgba(0,0,0,0)",t.sc&&(this.innerElem.style.stroke="rgb("+Math.round(255*t.sc[0])+","+Math.round(255*t.sc[1])+","+Math.round(255*t.sc[2])+")",this.innerElem.style.strokeWidth=t.sw+"px");var e=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(this.innerElem.style.fontSize=t.s+"px",this.innerElem.style.lineHeight=t.s+"px",e.fClass)this.innerElem.className=e.fClass;else{this.innerElem.style.fontFamily=e.fFamily;var r=t.fWeight,s=t.fStyle;this.innerElem.style.fontStyle=s,this.innerElem.style.fontWeight=r}var i,a,n=t.l;a=n.length;var o,h,l,p,m=this.mHelper,f="",c=0;for(i=0;a>i;i+=1){if(this.globalData.fontManager.chars?(this.textPaths[c]?o=this.textPaths[c]:(o=document.createElementNS(svgNS,"path"),o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[c]?(h=this.textSpans[c],l=h.children[0]):(h=document.createElement("div"),l=document.createElementNS(svgNS,"svg"),l.appendChild(o),styleDiv(h)))):this.isMasked?o=this.textPaths[c]?this.textPaths[c]:document.createElementNS(svgNS,"text"):this.textSpans[c]?(h=this.textSpans[c],o=this.textPaths[c]):(h=document.createElement("span"),styleDiv(h),o=document.createElement("span"),styleDiv(o),h.appendChild(o)),this.globalData.fontManager.chars){var d,u=this.globalData.fontManager.getCharData(t.t.charAt(i),e.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(d=u?u.data:null,m.reset(),d&&d.shapes&&(p=d.shapes[0].it,m.scale(t.s/100,t.s/100),f=this.createPathShape(m,p),o.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(o);else if(this.innerElem.appendChild(h),d&&d.shapes){document.body.appendChild(l);var y=l.getBBox();l.setAttribute("width",y.width),l.setAttribute("height",y.height),l.setAttribute("viewBox",y.x+" "+y.y+" "+y.width+" "+y.height),l.style.transform=l.style.webkitTransform="translate("+y.x+"px,"+y.y+"px)",n[i].yOffset=y.y,h.appendChild(l)}else l.setAttribute("width",1),l.setAttribute("height",1)}else o.textContent=n[i].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked?this.innerElem.appendChild(o):(this.innerElem.appendChild(h),o.style.transform=o.style.webkitTransform="translate3d(0,"+-t.s/1.2+"px,0)");this.textSpans[c]=this.isMasked?o:h,this.textSpans[c].style.display="block",this.textPaths[c]=o,c+=1}for(;c<this.textSpans.length;)this.textSpans[c].style.display="none",c+=1},HTextElement.prototype.hide=SVGTextElement.prototype.hide,HTextElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);if(e===!1)return void this.hide();if(this.hidden&&(this.hidden=!1,this.innerElem.style.display="block",this.layerElement.style.display="block"),this.data.singleShape){if(!this.firstFrame&&!this.lettersChangedFlag)return;this.isMasked&&this.finalTransform.matMdf&&(this.cont.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),this.cont.style.transform=this.cont.style.webkitTransform="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)")}if(this.getMeasures(),this.lettersChangedFlag){var r,s,i=this.renderedLetters,a=this.currentTextDocumentData.l;s=a.length;var n;for(r=0;s>r;r+=1)a[r].n||(n=i[r],this.isMasked?this.textSpans[r].setAttribute("transform",n.m):this.textSpans[r].style.transform=this.textSpans[r].style.webkitTransform=n.m,this.textSpans[r].style.opacity=n.o,n.sw&&this.textPaths[r].setAttribute("stroke-width",n.sw),n.sc&&this.textPaths[r].setAttribute("stroke",n.sc),n.fc&&(this.textPaths[r].setAttribute("fill",n.fc),this.textPaths[r].style.color=n.fc));if(this.isVisible&&(this.elemMdf||this.firstFrame)&&this.innerElem.getBBox){var o=this.innerElem.getBBox();this.currentBBox.w!==o.width&&(this.currentBBox.w=o.width,this.cont.setAttribute("width",o.width)),this.currentBBox.h!==o.height&&(this.currentBBox.h=o.height,this.cont.setAttribute("height",o.height)),(this.currentBBox.w!==o.width||this.currentBBox.h!==o.height||this.currentBBox.x!==o.x||this.currentBBox.y!==o.y)&&(this.currentBBox.w=o.width,this.currentBBox.h=o.height,this.currentBBox.x=o.x,this.currentBBox.y=o.y,this.cont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.cont.style.transform=this.cont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}this.firstFrame&&(this.firstFrame=!1)}},HTextElement.prototype.destroy=SVGTextElement.prototype.destroy,createElement(HBaseElement,HImageElement),HImageElement.prototype.createElements=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;if(this.data.hasMask){var r=document.createElement("div");styleDiv(r);var s=document.createElementNS(svgNS,"svg");styleDiv(s),s.setAttribute("width",this.assetData.w),s.setAttribute("height",this.assetData.h),r.appendChild(s),this.imageElem=document.createElementNS(svgNS,"image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),s.appendChild(this.imageElem),this.layerElement=r,this.transformedElement=r,this.baseElement=r,this.innerElem=r,this.maskedElement=this.imageElem}else styleDiv(e),this.layerElement=e,this.baseElement=e,this.innerElem=e,this.transformedElement=e;e.src=t,this.data.ln&&this.innerElem.setAttribute("id",this.data.ln),this.checkParenting()},HImageElement.prototype.hide=HSolidElement.prototype.hide,HImageElement.prototype.renderFrame=HSolidElement.prototype.renderFrame,HImageElement.prototype.destroy=HSolidElement.prototype.destroy,createElement(HBaseElement,HCameraElement),HCameraElement.prototype.setup=function(){var t,e,r=this.comp.threeDElements.length;for(t=0;r>t;t+=1)e=this.comp.threeDElements[t],e.perspectiveElem.style.perspective=e.perspectiveElem.style.webkitPerspective=this.pe.v+"px",e.container.style.transformOrigin=e.container.style.mozTransformOrigin=e.container.style.webkitTransformOrigin="0px 0px 0px",e.perspectiveElem.style.transform=e.perspectiveElem.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,r=this.firstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;e>t;t+=1)r=this.hierarchy[t].finalTransform.mProp.mdf?!0:r;if(r||this.p&&this.p.mdf||this.px&&(this.px.mdf||this.py.mdf||this.pz.mdf)||this.rx.mdf||this.ry.mdf||this.rz.mdf||this.or.mdf||this.a&&this.a.mdf){if(this.mat.reset(),this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]],i=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),a=[s[0]/i,s[1]/i,s[2]/i],n=Math.sqrt(a[2]*a[2]+a[0]*a[0]),o=Math.atan2(a[1],n),h=Math.atan2(a[0],-a[2]);this.mat.rotateY(h).rotateX(-o)}if(this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v),this.hierarchy){var l;for(e=this.hierarchy.length,t=0;e>t;t+=1)l=this.hierarchy[t].finalTransform.mProp.iv.props,this.mat.transform(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],-l[12],-l[13],l[14],l[15])}e=this.comp.threeDElements.length;var p;for(t=0;e>t;t+=1)p=this.comp.threeDElements[t],p.container.style.transform=p.container.style.webkitTransform=this.mat.toCSS()}this.firstFrame=!1},HCameraElement.prototype.destroy=function(){};var Expressions=function(){function t(t){t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer)}var e={};return e.initExpressions=t,e}();expressionsPlugin=Expressions,function(){function t(){return this.pv}function e(t,e){t*=this.elem.globalData.frameRate;var r,s,i=0,a=this.keyframes.length-1,n=1,o=!0;e=void 0===e?this.offsetTime:0;for(var h="object"==typeof this.pv?[this.pv.length]:0;o;){if(r=this.keyframes[i],s=this.keyframes[i+1],i==a-1&&t>=s.t-e){r.h&&(r=s);break}if(s.t-e>t)break;a-1>i?i+=n:o=!1}var l,p,m,f,c,d=0;if(r.to){r.bezierData||bez.buildBezierData(r);var u=r.bezierData;if(t>=s.t-e||t<r.t-e){var y=t>=s.t-e?u.points.length-1:0;for(p=u.points[y].point.length,l=0;p>l;l+=1)h[l]=u.points[y].point[l]}else{r.__fnct?c=r.__fnct:(c=BezierFactory.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y,r.n).get,r.__fnct=c),m=c((t-(r.t-e))/(s.t-e-(r.t-e)));var g,v=u.segmentLength*m,b=0;for(n=1,o=!0,f=u.points.length;o;){if(b+=u.points[d].partialLength*n,0===v||0===m||d==u.points.length-1){for(p=u.points[d].point.length,l=0;p>l;l+=1)h[l]=u.points[d].point[l];break}if(v>=b&&v<b+u.points[d+1].partialLength){for(g=(v-b)/u.points[d+1].partialLength,p=u.points[d].point.length,l=0;p>l;l+=1)h[l]=u.points[d].point[l]+(u.points[d+1].point[l]-u.points[d].point[l])*g;break}f-1>d&&1==n||d>0&&-1==n?d+=n:o=!1}}}else{var E,P,x,S,C,k=!1;for(a=r.s.length,i=0;a>i;i+=1){if(1!==r.h&&(r.o.x instanceof Array?(k=!0,r.__fnct||(r.__fnct=[]),r.__fnct[i]||(E=r.o.x[i]||r.o.x[0],P=r.o.y[i]||r.o.y[0],x=r.i.x[i]||r.i.x[0],S=r.i.y[i]||r.i.y[0])):(k=!1,r.__fnct||(E=r.o.x,P=r.o.y,x=r.i.x,S=r.i.y)),k?r.__fnct[i]?c=r.__fnct[i]:(c=BezierFactory.getBezierEasing(E,P,x,S).get,r.__fnct[i]=c):r.__fnct?c=r.__fnct:(c=BezierFactory.getBezierEasing(E,P,x,S).get,r.__fnct=c),m=t>=s.t-e?1:t<r.t-e?0:c((t-(r.t-e))/(s.t-e-(r.t-e)))),this.sh&&1!==r.h){var M=r.s[i],A=r.e[i];-180>M-A?M+=360:M-A>180&&(M-=360),C=M+(A-M)*m}else C=1===r.h?r.s[i]:r.s[i]+(r.e[i]-r.s[i])*m;1===a?h=C:h[i]=C}}return h}function r(t){if(void 0!==this.vel)return this.vel;var e,r=-.01,s=this.getValueAtTime(t,0),i=this.getValueAtTime(t+r,0);if(s.length){e=Array.apply(null,{length:s.length});var a;for(a=0;a<s.length;a+=1)e[a]=(i[a]-s[a])/r}else e=(i-s)/r;return e}function s(t){this.propertyGroup=t}function i(t,e,r){e.x&&(r.k=!0,r.x=!0,r.getValue&&(r.getPreValue=r.getValue),r.getValue=ExpressionManager.initiateExpression.bind(r)(t,e,r))}var a=function(){function a(t,e){return this.textIndex=t+1,this.textTotal=e,this.getValue(),this.v}return function(n,o){this.pv=1,this.comp=n.comp,this.elem=n,this.mult=.01,this.type="textSelector",this.textTotal=o.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],i.bind(this)(n,o,this),this.getMult=a,this.getVelocityAtTime=r,this.getValueAtTime=this.kf?e.bind(this):t.bind(this),this.setGroupProperty=s}}(),n=PropertyFactory.getProp;PropertyFactory.getProp=function(a,o,h,l,p){var m=n(a,o,h,l,p);m.getVelocityAtTime=r,m.getValueAtTime=m.kf?e.bind(m):t.bind(m),m.setGroupProperty=s;var f=m.k;return void 0!==o.ix&&Object.defineProperty(m,"propertyIndex",{get:function(){return o.ix}}),i(a,o,m),!f&&m.x&&p.push(m),m};var o=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(r,a,n,h,l){var p=o(r,a,n,h,l);p.setGroupProperty=s,p.getValueAtTime=p.kf?e:t;var m=p.k;return void 0!==a.ix&&Object.defineProperty(p,"propertyIndex",{get:function(){return a.ix}}),3===n?i(r,a.pt,p):4===n&&i(r,a.ks,p),!m&&p.x&&h.push(p),p};var h=PropertyFactory.getTextSelectorProp;PropertyFactory.getTextSelectorProp=function(t,e,r){return 1===e.t?new a(t,e,r):h(t,e,r)}}();var ExpressionManager=function(){function duplicatePropertyValue(t,e){if(e=e||1,"number"==typeof t||t instanceof Number)return t*e;if(t.i)return JSON.parse(JSON.stringify(t));var r,s=Array.apply(null,{length:t.length}),i=t.length;for(r=0;i>r;r+=1)s[r]=t[r]*e;return s}function shapesEqual(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,s=t._length;for(r=0;s>r;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if(t.constructor===Array){var r,s=t.length,i=[];for(r=0;s>r;r+=1)i[r]=-t[r];return i}}function sum(t,e){var r=typeof t,s=typeof e;if("string"===r||"string"===s)return t+e;if(("number"===r||"boolean"===r||"string"===r||t instanceof Number)&&("number"===s||"boolean"===s||"string"===s||e instanceof Number))return t+e;if(t.constructor===Array&&("number"===s||"boolean"===s||"string"===s||e instanceof Number))return t[0]=t[0]+e,t;if(("number"===r||"boolean"===r||"string"===r||t instanceof Number)&&e.constructor===Array)return e[0]=t+e[0],e;if(t.constructor===Array&&e.constructor===Array){for(var i=0,a=t.length,n=e.length,o=[];a>i||n>i;)o[i]="number"==typeof t[i]&&"number"==typeof e[i]?t[i]+e[i]:void 0==e[i]?t[i]:t[i]||e[i],i+=1;return o}return 0}function sub(t,e){var r=typeof t,s=typeof e;if(("number"===r||"boolean"===r||"string"===r||t instanceof Number)&&("number"===s||"boolean"===s||"string"===s||e instanceof Number))return t-e;if(t.constructor===Array&&("number"===s||"boolean"===s||"string"===s||e instanceof Number))return t[0]=t[0]-e,t;if(("number"===r||"boolean"===r||"string"===r||t instanceof Number)&&e.constructor===Array)return e[0]=t-e[0],e;if(t.constructor===Array&&e.constructor===Array){for(var i=0,a=t.length,n=e.length,o=[];a>i||n>i;)o[i]="number"==typeof t[i]&&"number"==typeof e[i]?t[i]-e[i]:void 0==e[i]?t[i]:t[i]||e[i],i+=1;return o}return 0}function mul(t,e){var r,s=typeof t,i=typeof e;if(("number"===s||"boolean"===s||"string"===s||t instanceof Number)&&("number"===i||"boolean"===i||"string"===i||e instanceof Number))return t*e;var a,n;if(t.constructor===Array&&("number"===i||"boolean"===i||"string"===i||e instanceof Number)){for(n=t.length,r=Array.apply(null,{length:n}),a=0;n>a;a+=1)r[a]=t[a]*e;return r}if(("number"===s||"boolean"===s||"string"===s||t instanceof Number)&&e.constructor===Array){for(n=e.length,r=Array.apply(null,{length:n}),a=0;n>a;a+=1)r[a]=t*e[a];return r}return 0}function div(t,e){var r,s=typeof t,i=typeof e;if(("number"===s||"boolean"===s||"string"===s||t instanceof Number)&&("number"===i||"boolean"===i||"string"===i||e instanceof Number))return t/e;var a,n;if(t.constructor===Array&&("number"===i||"boolean"===i||"string"===i||e instanceof Number)){for(n=t.length,r=Array.apply(null,{length:n}),a=0;n>a;a+=1)r[a]=t[a]/e;return r}if(("number"===s||"boolean"===s||"string"===s||t instanceof Number)&&e.constructor===Array){for(n=e.length,r=Array.apply(null,{length:n}),a=0;n>a;a+=1)r[a]=t/e[a];return r}return 0}function clamp(t,e,r){if(e>r){var s=r;r=e,e=s}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}function degreesToRadians(t){return t*degToRads}function length(t,e){if("number"==typeof t)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var r,s=Math.min(t.length,e.length),i=0;for(r=0;s>r;r+=1)i+=Math.pow(e[r]-t[r],2);return Math.sqrt(i)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,s=t[0],i=t[1],a=t[2],n=Math.max(s,i,a),o=Math.min(s,i,a),h=(n+o)/2;if(n==o)e=r=0;else{var l=n-o;switch(r=h>.5?l/(2-n-o):l/(n+o),n){case s:e=(i-a)/l+(a>i?6:0);break;case i:e=(a-s)/l+2;break;case a:e=(s-i)/l+4}e/=6}return[e,r,h,t[3]]}function hslToRgb(t){function e(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(e-t)*r:.5>r?e:2/3>r?t+(e-t)*(2/3-r)*6:t}var r,s,i,a=t[0],n=t[1],o=t[2];if(0==n)r=s=i=o;else{var h=.5>o?o*(1+n):o+n-o*n,l=2*o-h;r=e(l,h,a+1/3),s=e(l,h,a),i=e(l,h,a-1/3)}return[r,s,i,t[3]]}function linear(t,e,r,s,i){if(void 0===s||void 0===i)return linear(t,0,1,e,r);if(e>=t)return s;if(t>=r)return i;var a=r===e?0:(t-e)/(r-e);if(!s.length)return s+(i-s)*a;var n,o=s.length,h=Array.apply(null,{length:o});for(n=0;o>n;n+=1)h[n]=s[n]+(i[n]-s[n])*a;return h}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,s=e.length;t||(t=Array.apply(null,{length:s}));var i=Array.apply(null,{length:s}),a=BMMath.random();for(r=0;s>r;r+=1)i[r]=t[r]+a*(e[r]-t[r]);return i}void 0===t&&(t=0);var n=BMMath.random();return t+n*(e-t)}function initiateExpression(elem,data,property){function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],s=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads,i=-Math.atan2(r[1],r[2])/degToRads;return[i,s,0]}function easeOut(t,e,r){return-(r-e)*t*(t-2)+e}function nearestKey(t){var e,r,s,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,t*=elem.comp.globalData.frameRate,t<data.k[0].t)r=1,s=data.k[0].t;else{for(e=0;i-1>e;e+=1){if(t===data.k[e].t){r=e+1,s=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){t-data.k[e].t>data.k[e+1].t-t?(r=e+2,s=data.k[e+1].t):(r=e+1,s=data.k[e].t);break}}-1===r&&(r=e+1,s=data.k[e].t)}else r=0,s=0;var a={};return a.index=r,a.time=s/elem.comp.globalData.frameRate,a}function key(t){if(!data.k.length||"number"==typeof data.k[0])return{time:0};t-=1;var e,r={time:data.k[t].t/elem.comp.globalData.frameRate};e=t!==data.k.length-1||data.k[t].h?data.k[t].s:data.k[t-1].e;var s,i=e.length;for(s=0;i>s;s+=1)r[s]=e[s];return r}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function toWorld(t){if(toworldMatrix.reset(),elem.finalTransform.mProp.applyToMatrix(toworldMatrix),elem.hierarchy&&elem.hierarchy.length){var e,r=elem.hierarchy.length;for(e=0;r>e;e+=1)elem.hierarchy[e].finalTransform.mProp.applyToMatrix(toworldMatrix);return toworldMatrix.applyToPointArray(t[0],t[1],t[2]||0)}return toworldMatrix.applyToPointArray(t[0],t[1],t[2]||0)}function fromWorld(t){fromworldMatrix.reset();var e=[];if(e.push(t),elem.finalTransform.mProp.applyToMatrix(fromworldMatrix),elem.hierarchy&&elem.hierarchy.length){var r,s=elem.hierarchy.length;for(r=0;s>r;r+=1)elem.hierarchy[r].finalTransform.mProp.applyToMatrix(fromworldMatrix);return fromworldMatrix.inversePoints(e)[0]}return fromworldMatrix.inversePoints(e)[0]}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function execute(){if(_needsRandom&&seedRandom(randSeed),this.frameExpressionId!==elem.globalData.frameId||"textSelector"===this.type){if(this.lock)return this.v=duplicatePropertyValue(this.pv,this.mult),!0;"textSelector"===this.type&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface),transform||(transform=elem.layerInterface("ADBE Transform Group")),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),hasParent=!(!elem.hierarchy||!elem.hierarchy.length),hasParent&&!parent&&(parent=elem.hierarchy[0].layerInterface),this.lock=!0,this.getPreValue&&this.getPreValue(),value=this.pv,time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),bindedFn(),this.frameExpressionId=elem.globalData.frameId;var t,e;if(this.mult)if("number"==typeof this.v||this.v instanceof Number||"string"==typeof this.v)this.v*=this.mult;else if(1===this.v.length)this.v=this.v[0]*this.mult;else for(e=this.v.length,value===this.v&&(this.v=2===e?[value[0],value[1]]:[value[0],value[1],value[2]]),t=0;e>t;t+=1)this.v[t]*=this.mult;if(1===this.v.length&&(this.v=this.v[0]),"number"==typeof this.v||this.v instanceof Number||"string"==typeof this.v)this.lastValue!==this.v&&(this.lastValue=this.v,this.mdf=!0);else if(this.v._length)shapesEqual(this.v,this.localShapeCollection.shapes[0])||(this.mdf=!0,this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(shape_pool.clone(this.v)));else for(e=this.v.length,t=0;e>t;t+=1)this.v[t]!==this.lastValue[t]&&(this.lastValue[t]=this.v[t],this.mdf=!0);this.lock=!1}}var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,content,effect,thisComp=elem.comp,thisProperty=property;elem.comp.frameDuration=1/elem.comp.globalData.frameRate;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,thisLayer,thisComp,fn=new Function,fn=eval("[function(){"+val+";this.v = $bm_rt;}]")[0],bindedFn=fn.bind(this),numKeys=property.kf?data.k.length:0,wiggle=function(t,e){var r,s,i=this.pv.length?this.pv.length:1,a=Array.apply(null,{len:i});for(s=0;i>s;s+=1)a[s]=0;t=5;var n=Math.floor(time*t);for(r=0,s=0;n>r;){for(s=0;i>s;s+=1)a[s]+=-e+2*e*BMMath.random();r+=1}var o=time*t,h=o-Math.floor(o),l=Array.apply({length:i});if(i>1){for(s=0;i>s;s+=1)l[s]=this.pv[s]+a[s]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this),loopIn=function(t,e,r){if(!this.k)return this.pv;var s=time*elem.comp.globalData.frameRate,i=this.keyframes,a=i[0].t;if(s>=a)return this.pv;var n,o;r?(n=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-a),o=a+n):((!e||e>i.length-1)&&(e=i.length-1),o=i[e].t,n=o-a);var h,l,p;if("pingpong"===t){var m=Math.floor((a-s)/n);if(m%2===0)return this.getValueAtTime(((a-s)%n+a)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(a/this.comp.globalData.frameRate,0),c=this.getValueAtTime(o/this.comp.globalData.frameRate,0),d=this.getValueAtTime((n-(a-s)%n+a)/this.comp.globalData.frameRate,0),u=Math.floor((a-s)/n)+1;if(this.pv.length){for(p=new Array(f.length),l=p.length,h=0;l>h;h+=1)p[h]=d[h]-(c[h]-f[h])*u;return p}return d-(c-f)*u}if("continue"===t){var y=this.getValueAtTime(a/this.comp.globalData.frameRate,0),g=this.getValueAtTime((a+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(p=new Array(y.length),l=p.length,h=0;l>h;h+=1)p[h]=y[h]+(y[h]-g[h])*(a-s)/.001;return p}return y+(y-g)*(a-s)/.001}}return this.getValueAtTime((n-(a-s)%n+a)/this.comp.globalData.frameRate,0)}.bind(this),loopInDuration=function(t,e){return loopIn(t,e,!0)}.bind(this),loopOut=function(t,e,r){if(!this.k||!this.keyframes)return this.pv;var s=time*elem.comp.globalData.frameRate,i=this.keyframes,a=i[i.length-1].t;if(a>=s)return this.pv;var n,o;r?(n=e?Math.abs(a-elem.comp.globalData.frameRate*e):Math.max(0,a-this.elem.data.ip),o=a-n):((!e||e>i.length-1)&&(e=i.length-1),o=i[i.length-1-e].t,n=a-o);var h,l,p;if("pingpong"===t){var m=Math.floor((s-o)/n);if(m%2!==0)return this.getValueAtTime((n-(s-o)%n+o)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(o/this.comp.globalData.frameRate,0),c=this.getValueAtTime(a/this.comp.globalData.frameRate,0),d=this.getValueAtTime(((s-o)%n+o)/this.comp.globalData.frameRate,0),u=Math.floor((s-o)/n);if(this.pv.length){for(p=new Array(f.length),l=p.length,h=0;l>h;h+=1)p[h]=(c[h]-f[h])*u+d[h];return p}return(c-f)*u+d}if("continue"===t){var y=this.getValueAtTime(a/this.comp.globalData.frameRate,0),g=this.getValueAtTime((a-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(p=new Array(y.length),l=p.length,h=0;l>h;h+=1)p[h]=y[h]+(y[h]-g[h])*((s-a)/this.comp.globalData.frameRate)/5e-4;return p}return y+(y-g)*((s-a)/.001)}}return this.getValueAtTime(((s-o)%n+o)/this.comp.globalData.frameRate,0)}.bind(this),loop_out=loopOut,loopOutDuration=function(t,e){return loopOut(t,e,!0)}.bind(this),valueAtTime=function(t){return this.getValueAtTime(t,0)}.bind(this),velocityAtTime=function(t){return this.getVelocityAtTime(t)}.bind(this),comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),toworldMatrix=new Matrix,fromworldMatrix=new Matrix,time,velocity,value,textIndex,textTotal,selectorValue,index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random());return execute}var ob={},Math=BMMath,window=null,document=null,add=sum,radians_to_degrees=radiansToDegrees,degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];return ob.initiateExpression=initiateExpression,ob}(),ShapeExpressionInterface=function(){function t(t,e,r){return d(t,e,r)}function e(t,e,r){return y(t,e,r)}function r(t,e,r){return g(t,e,r)}function s(t,e,r){return v(t,e,r)}function i(t,e,r){return b(t,e,r)}function a(t,e,r){return E(t,e,r)}function n(t,e,r){return P(t,e,r)}function o(t,e,r){return x(t,e,r)}function h(t,e,r){return S(t,e,r)}function l(t,e,r){return C(t,e,r)}function p(t,e,r){return k(t,e,r)}function m(t,e,r){return M(t,e,r)}function f(t,e,r){var s,i=[],a=t?t.length:0;for(s=0;a>s;s+=1)"gr"==t[s].ty?i.push(ShapeExpressionInterface.createGroupInterface(t[s],e[s],r)):"fl"==t[s].ty?i.push(ShapeExpressionInterface.createFillInterface(t[s],e[s],r)):"st"==t[s].ty?i.push(ShapeExpressionInterface.createStrokeInterface(t[s],e[s],r)):"tm"==t[s].ty?i.push(ShapeExpressionInterface.createTrimInterface(t[s],e[s],r)):"tr"==t[s].ty||("el"==t[s].ty?i.push(ShapeExpressionInterface.createEllipseInterface(t[s],e[s],r)):"sr"==t[s].ty?i.push(ShapeExpressionInterface.createStarInterface(t[s],e[s],r)):"sh"==t[s].ty?i.push(ShapeExpressionInterface.createPathInterface(t[s],e[s],r)):"rc"==t[s].ty?i.push(ShapeExpressionInterface.createRectInterface(t[s],e[s],r)):"rd"==t[s].ty?i.push(ShapeExpressionInterface.createRoundedInterface(t[s],e[s],r)):"rp"==t[s].ty&&i.push(ShapeExpressionInterface.createRepatearInterface(t[s],e[s],r)));return i}var c={createShapeInterface:t,createGroupInterface:e,createTrimInterface:i,createStrokeInterface:s,createTransformInterface:a,createEllipseInterface:n,createStarInterface:o,createRectInterface:h,createRoundedInterface:l,createRepatearInterface:p,createPathInterface:m,createFillInterface:r},d=function(){return function(t,e,r){function s(t){if("number"==typeof t)return i[t-1];for(var e=0,r=i.length;r>e;){if(i[e]._name===t)return i[e];e+=1}}
-var i;return s.propertyGroup=r,i=f(t,e,s),s}}(),u=function(){return function(t,e,r){var s,i=function(t){for(var e=0,r=s.length;r>e;){if(s[e]._name===t||s[e].mn===t||s[e].propertyIndex===t||s[e].ix===t||s[e].ind===t)return s[e];e+=1}return"number"==typeof t?s[t-1]:void 0};return i.propertyGroup=function(t){return 1===t?i:r(t-1)},s=f(t.it,e.it,i.propertyGroup),i.numProperties=s.length,i.propertyIndex=t.cix,i}}(),y=function(){return function(t,e,r){var s=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return s.content;case"ADBE Vector Transform Group":case 3:default:return s.transform}};s.propertyGroup=function(t){return 1===t?s:r(t-1)};var i=u(t,e,s.propertyGroup),a=ShapeExpressionInterface.createTransformInterface(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.content=i,s.transform=a,Object.defineProperty(s,"_name",{get:function(){return t.nm}}),s.numProperties=t.np,s.propertyIndex=t.ix,s.nm=t.nm,s.mn=t.mn,s}}(),g=function(){return function(t,e,r){function s(t){return"Color"===t||"color"===t?s.color:"Opacity"===t||"opacity"===t?s.opacity:void 0}return Object.defineProperty(s,"color",{get:function(){return ExpressionValue(e.c,1/e.c.mult,"color")}}),Object.defineProperty(s,"opacity",{get:function(){return ExpressionValue(e.o,100)}}),Object.defineProperty(s,"_name",{value:t.nm}),Object.defineProperty(s,"mn",{value:t.mn}),e.c.setGroupProperty(r),e.o.setGroupProperty(r),s}}(),v=function(){return function(t,e,r){function s(t){return 1===t?c:r(t-1)}function i(t){return 1===t?l:s(t-1)}function a(r){Object.defineProperty(l,t.d[r].nm,{get:function(){return ExpressionValue(e.d.dataProps[r].p)}})}function n(t){return"Color"===t||"color"===t?n.color:"Opacity"===t||"opacity"===t?n.opacity:"Stroke Width"===t||"stroke width"===t?n.strokeWidth:void 0}var o,h=t.d?t.d.length:0,l={};for(o=0;h>o;o+=1)a(o),e.d.dataProps[o].p.setGroupProperty(i);return Object.defineProperty(n,"color",{get:function(){return ExpressionValue(e.c,1/e.c.mult,"color")}}),Object.defineProperty(n,"opacity",{get:function(){return ExpressionValue(e.o,100)}}),Object.defineProperty(n,"strokeWidth",{get:function(){return ExpressionValue(e.w)}}),Object.defineProperty(n,"dash",{get:function(){return l}}),Object.defineProperty(n,"_name",{value:t.nm}),Object.defineProperty(n,"mn",{value:t.mn}),e.c.setGroupProperty(s),e.o.setGroupProperty(s),e.w.setGroupProperty(s),n}}(),b=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return e===t.e.ix||"End"===e||"end"===e?i.end:e===t.s.ix?i.start:e===t.o.ix?i.offset:void 0}return i.propertyIndex=t.ix,e.s.setGroupProperty(s),e.e.setGroupProperty(s),e.o.setGroupProperty(s),i.propertyIndex=t.ix,Object.defineProperty(i,"start",{get:function(){return ExpressionValue(e.s,1/e.s.mult)}}),Object.defineProperty(i,"end",{get:function(){return ExpressionValue(e.e,1/e.e.mult)}}),Object.defineProperty(i,"offset",{get:function(){return ExpressionValue(e.o)}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.mn=t.mn,i}}(),E=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return t.a.ix===e?i.anchorPoint:t.o.ix===e?i.opacity:t.p.ix===e?i.position:t.r.ix===e?i.rotation:t.s.ix===e?i.scale:t.sk&&t.sk.ix===e?i.skew:t.sa&&t.sa.ix===e?i.skewAxis:"Opacity"===e?i.opacity:"Position"===e?i.position:"Anchor Point"===e?i.anchorPoint:"Scale"===e?i.scale:"Rotation"===e||"ADBE Vector Rotation"===e?i.rotation:"Skew"===e?i.skew:"Skew Axis"===e?i.skewAxis:void 0}e.transform.mProps.o.setGroupProperty(s),e.transform.mProps.p.setGroupProperty(s),e.transform.mProps.a.setGroupProperty(s),e.transform.mProps.s.setGroupProperty(s),e.transform.mProps.r.setGroupProperty(s),e.transform.mProps.sk&&(e.transform.mProps.sk.setGroupProperty(s),e.transform.mProps.sa.setGroupProperty(s)),e.transform.op.setGroupProperty(s),Object.defineProperty(i,"opacity",{get:function(){return ExpressionValue(e.transform.mProps.o,1/e.transform.mProps.o.mult)}}),Object.defineProperty(i,"position",{get:function(){return ExpressionValue(e.transform.mProps.p)}}),Object.defineProperty(i,"anchorPoint",{get:function(){return ExpressionValue(e.transform.mProps.a)}});return Object.defineProperty(i,"scale",{get:function(){return ExpressionValue(e.transform.mProps.s,1/e.transform.mProps.s.mult)}}),Object.defineProperty(i,"rotation",{get:function(){return ExpressionValue(e.transform.mProps.r,1/e.transform.mProps.r.mult)}}),Object.defineProperty(i,"skew",{get:function(){return ExpressionValue(e.transform.mProps.sk)}}),Object.defineProperty(i,"skewAxis",{get:function(){return ExpressionValue(e.transform.mProps.sa)}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.ty="tr",i.mn=t.mn,i}}(),P=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return t.p.ix===e?i.position:t.s.ix===e?i.size:void 0}i.propertyIndex=t.ix;var a="tm"===e.sh.ty?e.sh.prop:e.sh;return a.s.setGroupProperty(s),a.p.setGroupProperty(s),Object.defineProperty(i,"size",{get:function(){return ExpressionValue(a.s)}}),Object.defineProperty(i,"position",{get:function(){return ExpressionValue(a.p)}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.mn=t.mn,i}}(),x=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return t.p.ix===e?i.position:t.r.ix===e?i.rotation:t.pt.ix===e?i.points:t.or.ix===e||"ADBE Vector Star Outer Radius"===e?i.outerRadius:t.os.ix===e?i.outerRoundness:!t.ir||t.ir.ix!==e&&"ADBE Vector Star Inner Radius"!==e?t.is&&t.is.ix===e?i.innerRoundness:void 0:i.innerRadius}var a="tm"===e.sh.ty?e.sh.prop:e.sh;return i.propertyIndex=t.ix,a.or.setGroupProperty(s),a.os.setGroupProperty(s),a.pt.setGroupProperty(s),a.p.setGroupProperty(s),a.r.setGroupProperty(s),t.ir&&(a.ir.setGroupProperty(s),a.is.setGroupProperty(s)),Object.defineProperty(i,"position",{get:function(){return ExpressionValue(a.p)}}),Object.defineProperty(i,"rotation",{get:function(){return ExpressionValue(a.r,1/a.r.mult)}}),Object.defineProperty(i,"points",{get:function(){return ExpressionValue(a.pt)}}),Object.defineProperty(i,"outerRadius",{get:function(){return ExpressionValue(a.or)}}),Object.defineProperty(i,"outerRoundness",{get:function(){return ExpressionValue(a.os)}}),Object.defineProperty(i,"innerRadius",{get:function(){return a.ir?ExpressionValue(a.ir):0}}),Object.defineProperty(i,"innerRoundness",{get:function(){return a.is?ExpressionValue(a.is,1/a.is.mult):0}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.mn=t.mn,i}}(),S=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return t.p.ix===e?i.position:t.r.ix===e?i.rotation:t.pt.ix===e?i.points:t.or.ix===e||"ADBE Vector Star Outer Radius"===e?i.outerRadius:t.os.ix===e?i.outerRoundness:!t.ir||t.ir.ix!==e&&"ADBE Vector Star Inner Radius"!==e?t.is&&t.is.ix===e?i.innerRoundness:void 0:i.innerRadius}var a="tm"===e.sh.ty?e.sh.prop:e.sh;return i.propertyIndex=t.ix,a.p.setGroupProperty(s),a.s.setGroupProperty(s),a.r.setGroupProperty(s),Object.defineProperty(i,"position",{get:function(){return ExpressionValue(a.p)}}),Object.defineProperty(i,"roundness",{get:function(){return ExpressionValue(a.r)}}),Object.defineProperty(i,"size",{get:function(){return ExpressionValue(a.s)}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.mn=t.mn,i}}(),C=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return t.r.ix===e||"Round Corners 1"===e?i.radius:void 0}var a=e;return i.propertyIndex=t.ix,a.rd.setGroupProperty(s),Object.defineProperty(i,"radius",{get:function(){return ExpressionValue(a.rd)}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.mn=t.mn,i}}(),k=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(e){return t.c.ix===e||"Copies"===e?i.copies:t.o.ix===e||"Offset"===e?i.offset:void 0}var a=e;return i.propertyIndex=t.ix,a.c.setGroupProperty(s),a.o.setGroupProperty(s),Object.defineProperty(i,"copies",{get:function(){return ExpressionValue(a.c)}}),Object.defineProperty(i,"offset",{get:function(){return ExpressionValue(a.o)}}),Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.mn=t.mn,i}}(),M=function(){return function(t,e,r){function s(t){return 1==t?i:r(--t)}function i(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t?i.path:void 0}var a="tm"===e.sh.ty?e.sh.prop:e.sh;return a.setGroupProperty(s),Object.defineProperty(i,"path",{get:function(){return a.k&&a.getValue(),a.v}}),Object.defineProperty(i,"shape",{get:function(){return a.k&&a.getValue(),a.v}}),Object.defineProperty(i,"_name",{value:t.nm}),Object.defineProperty(i,"ix",{value:t.ix}),Object.defineProperty(i,"mn",{value:t.mn}),i}}();return c}(),TextExpressionInterface=function(){return function(t){function e(){}return Object.defineProperty(e,"sourceText",{get:function(){return t.currentTextDocumentData.t?t.currentTextDocumentData.t:""}}),e}}(),LayerExpressionInterface=function(){function t(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,s=this._elem.hierarchy.length;for(r=0;s>r;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.applyToPointArray(t[0],t[1],t[2]||0)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function e(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,s=this._elem.hierarchy.length;for(r=0;s>r;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}return function(r){function s(t){a.mask=t.getMask.bind(t)}function i(t){a.effect=t}function a(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return a.shapeInterface;case 1:case"Transform":case"transform":case"ADBE Transform Group":return n;case 4:case"ADBE Effect Parade":return a.effect}}var n=TransformExpressionInterface(r.transform);return a.toWorld=t,a.toComp=t,a.fromComp=e,a._elem=r,Object.defineProperty(a,"hasParent",{get:function(){return!!r.hierarchy}}),Object.defineProperty(a,"parent",{get:function(){return r.hierarchy[0].layerInterface}}),Object.defineProperty(a,"rotation",{get:function(){return n.rotation}}),Object.defineProperty(a,"scale",{get:function(){return n.scale}}),Object.defineProperty(a,"position",{get:function(){return n.position}}),Object.defineProperty(a,"anchorPoint",{get:function(){return n.anchorPoint}}),Object.defineProperty(a,"transform",{get:function(){return n}}),Object.defineProperty(a,"width",{get:function(){return 0===r.data.ty?r.data.w:100}}),Object.defineProperty(a,"height",{get:function(){return 0===r.data.ty?r.data.h:100}}),Object.defineProperty(a,"source",{get:function(){return r.data.refId}}),Object.defineProperty(a,"_name",{value:r.data.nm}),Object.defineProperty(a,"content",{get:function(){return a.shapeInterface}}),Object.defineProperty(a,"active",{get:function(){return r.isVisible}}),Object.defineProperty(a,"text",{get:function(){return a.textInterface}}),a.registerMaskInterface=s,a.registerEffectsInterface=i,a}}(),CompExpressionInterface=function(){return function(t){function e(e){for(var r=0,s=t.layers.length;s>r;){if(t.layers[r].nm===e||t.layers[r].ind===e)return t.elements[r].layerInterface;r+=1}return{active:!1}}return Object.defineProperty(e,"_name",{value:t.data.nm}),e.layer=e,e.pixelAspect=1,e.height=t.globalData.compSize.h,e.width=t.globalData.compSize.w,e.pixelAspect=1,e.frameDuration=1/t.globalData.frameRate,e}}(),TransformExpressionInterface=function(){return function(t){function e(r){switch(r){case"scale":case"Scale":case"ADBE Scale":return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":return e.rotation;case"position":case"Position":case"ADBE Position":return t.position;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":return e.anchorPoint;case"opacity":case"Opacity":return e.opacity}}return Object.defineProperty(e,"rotation",{get:function(){return t.rotation}}),Object.defineProperty(e,"scale",{get:function(){return t.scale}}),Object.defineProperty(e,"position",{get:function(){return t.position}}),Object.defineProperty(e,"xPosition",{get:function(){return t.xPosition}}),Object.defineProperty(e,"yPosition",{get:function(){return t.yPosition}}),Object.defineProperty(e,"anchorPoint",{get:function(){return t.anchorPoint}}),Object.defineProperty(e,"opacity",{get:function(){return t.opacity}}),Object.defineProperty(e,"skew",{get:function(){return t.skew}}),Object.defineProperty(e,"skewAxis",{get:function(){return t.skewAxis}}),e}}(),ProjectInterface=function(){function t(t){this.compositions.push(t)}return function(){function e(t){for(var e=0,r=this.compositions.length;r>e;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),EffectsExpressionInterface=function(){function t(t,r){if(t.effects){var s,i=[],a=t.data.ef,n=t.effects.effectElements.length;for(s=0;n>s;s+=1)i.push(e(a[s],t.effects.effectElements[s],r,t));return function(e){for(var r=t.data.ef,s=0,a=r.length;a>s;){if(e===r[s].nm||e===r[s].mn||e===r[s].ix)return i[s];s+=1}}}}function e(t,s,i,a){var n,o=[],h=t.ef.length;for(n=0;h>n;n+=1)o.push(5===t.ef[n].ty?e(t.ef[n],s.effectElements[n],i,a):r(s.effectElements[n],t.ef[n].ty,a));var l=function(e){for(var r=t.ef,s=0,i=r.length;i>s;){if(e===r[s].nm||e===r[s].mn||e===r[s].ix)return 5===r[s].ty?o[s]:o[s]();s+=1}return o[0]()};return"ADBE Color Control"===t.mn&&Object.defineProperty(l,"color",{get:function(){return o[0]()}}),l.active=0!==t.en,l}function r(t,e,r){return function(){return 10===e?r.comp.compInterface(t.p.v):ExpressionValue(t.p)}}var s={createEffectsInterface:t};return s}(),ExpressionValue=function(){return function(t,e,r){var s;t.k&&t.getValue();var i,a,n;if(r){if("color"===r){for(a=4,s=Array.apply(null,{length:a}),n=Array.apply(null,{length:a}),i=0;a>i;i+=1)s[i]=n[i]=e&&3>i?t.v[i]*e:1;s.value=n}}else if("number"==typeof t.v||t.v instanceof Number)s=new Number(e?t.v*e:t.v),s.value=e?t.v*e:t.v;else{for(a=t.v.length,s=Array.apply(null,{length:a}),n=Array.apply(null,{length:a}),i=0;a>i;i+=1)s[i]=n[i]=e?t.v[i]*e:t.v[i];s.value=n}return s.numKeys=t.keyframes?t.keyframes.length:0,s.key=function(e){return s.numKeys?t.keyframes[e-1].t:0},s.valueAtTime=t.getValueAtTime,s.propertyGroup=t.propertyGroup,s}}();GroupEffect.prototype.getValue=function(){this.mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.mdf=this.dynamicProperties[t].mdf?!0:this.mdf},GroupEffect.prototype.init=function(t,e,r){this.data=t,this.mdf=!1,this.effectElements=[];var s,i,a=this.data.ef.length,n=this.data.ef;for(s=0;a>s;s+=1)switch(n[s].ty){case 0:i=new SliderEffect(n[s],e,r),this.effectElements.push(i);break;case 1:i=new AngleEffect(n[s],e,r),this.effectElements.push(i);break;case 2:i=new ColorEffect(n[s],e,r),this.effectElements.push(i);break;case 3:i=new PointEffect(n[s],e,r),this.effectElements.push(i);break;case 4:case 7:i=new CheckboxEffect(n[s],e,r),this.effectElements.push(i);break;case 10:i=new LayerIndexEffect(n[s],e,r),this.effectElements.push(i);break;case 11:i=new MaskIndexEffect(n[s],e,r),this.effectElements.push(i);break;case 5:i=new EffectsManager(n[s],e,r),this.effectElements.push(i);break;case 6:i=new NoValueEffect(n[s],e,r),this.effectElements.push(i)}};var bodymovinjs={};bodymovinjs.play=play,bodymovinjs.pause=pause,bodymovinjs.togglePause=togglePause,bodymovinjs.setSpeed=setSpeed,bodymovinjs.setDirection=setDirection,bodymovinjs.stop=stop,bodymovinjs.moveFrame=moveFrame,bodymovinjs.searchAnimations=searchAnimations,bodymovinjs.registerAnimation=registerAnimation,bodymovinjs.loadAnimation=loadAnimation,bodymovinjs.setSubframeRendering=setSubframeRendering,bodymovinjs.resize=resize,bodymovinjs.start=start,bodymovinjs.goToAndStop=goToAndStop,bodymovinjs.destroy=destroy,bodymovinjs.setQuality=setQuality,bodymovinjs.installPlugin=installPlugin,bodymovinjs.__getFactory=getFactory,bodymovinjs.version="4.6.10";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);return bodymovinjs});
\ No newline at end of file
diff --git a/build/player/bodymovin_light.js b/build/player/bodymovin_light.js
deleted file mode 100644
index f2471b1..0000000
--- a/build/player/bodymovin_light.js
+++ /dev/null
@@ -1,8579 +0,0 @@
-(function (root, factory) { if(typeof define === "function" && define.amd) { define( factory); } else if(typeof module === "object" && module.exports) { module.exports = factory(); } else { root.bodymovin = factory(); } }(window, function() {var svgNS = "http://www.w3.org/2000/svg";
-var subframeEnabled = true;
-var expressionsPlugin;
-var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
-var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
-
-var BMMath = {};
-(function(){
-    var propertyNames = Object.getOwnPropertyNames(Math);
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
-}());
-
-function ProjectInterface(){return {}};
-
-BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = Array.apply(null,{length:val.length});
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
-    }
-    return Math.abs(val);
-
-}
-var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
-var roundCorner = 0.5519;
-
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
-}
-roundValues(false);
-
-function roundTo2Decimals(val){
-    return Math.round(val*10000)/10000;
-}
-
-function roundTo3Decimals(val){
-    return Math.round(val*100)/100;
-}
-
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
-}
-
-function styleUnselectableDiv(element){
-    element.style.userSelect = 'none';
-    element.style.MozUserSelect = 'none';
-    element.style.webkitUserSelect = 'none';
-    element.style.oUserSelect = 'none';
-
-}
-
-function BMEnterFrameEvent(n,c,t,d){
-    this.type = n;
-    this.currentTime = c;
-    this.totalTime = t;
-    this.direction = d < 0 ? -1:1;
-}
-
-function BMCompleteEvent(n,d){
-    this.type = n;
-    this.direction = d < 0 ? -1:1;
-}
-
-function BMCompleteLoopEvent(n,c,t,d){
-    this.type = n;
-    this.currentLoop = c;
-    this.totalLoops = t;
-    this.direction = d < 0 ? -1:1;
-}
-
-function BMSegmentStartEvent(n,f,t){
-    this.type = n;
-    this.firstFrame = f;
-    this.totalFrames = t;
-}
-
-function BMDestroyEvent(n,t){
-    this.type = n;
-    this.target = t;
-}
-
-function _addEventListener(eventName, callback){
-
-    if (!this._cbs[eventName]){
-        this._cbs[eventName] = [];
-    }
-    this._cbs[eventName].push(callback);
-
-	return function() {
-		this.removeEventListener(eventName, callback);
-	}.bind(this);
-}
-
-function _removeEventListener(eventName,callback){
-
-    if (!callback){
-        this._cbs[eventName] = null;
-    }else if(this._cbs[eventName]){
-        var i = 0, len = this._cbs[eventName].length;
-        while(i<len){
-            if(this._cbs[eventName][i] === callback){
-                this._cbs[eventName].splice(i,1);
-                i -=1;
-                len -= 1;
-            }
-            i += 1;
-        }
-        if(!this._cbs[eventName].length){
-            this._cbs[eventName] = null;
-        }
-    }
-
-}
-
-function _triggerEvent(eventName, args){
-    if (this._cbs[eventName]) {
-        var len = this._cbs[eventName].length;
-        for (var i = 0; i < len; i++){
-            this._cbs[eventName][i](args);
-        }
-    }
-}
-
-function randomString(length, chars){
-    if(chars === undefined){
-        chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
-    }
-    var i;
-    var result = '';
-    for (i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
-    return result;
-}
-
-function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    if (arguments.length === 1) {
-        s = h.s, v = h.v, h = h.h;
-    }
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v, g = t, b = p; break;
-        case 1: r = q, g = v, b = p; break;
-        case 2: r = p, g = v, b = t; break;
-        case 3: r = p, g = q, b = v; break;
-        case 4: r = t, g = p, b = v; break;
-        case 5: r = v, g = p, b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
-}
-
-function RGBtoHSV(r, g, b) {
-    if (arguments.length === 1) {
-        g = r.g, b = r.b, r = r.r;
-    }
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
-
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
-
-    return [
-         h,
-         s,
-         v
-    ];
-}
-
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
-}
-
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
-}
-
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
-}
-
-function componentToHex(c) {
-    var hex = c.toString(16);
-    return hex.length == 1 ? '0' + hex : hex;
-}
-
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
-
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
-}());
-
-function fillToRgba(hex,alpha){
-    if(!cachedColors[hex]){
-        var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
-        cachedColors[hex] = parseInt(result[1], 16)+','+parseInt(result[2], 16)+','+parseInt(result[3], 16);
-    }
-    return 'rgba('+cachedColors[hex]+','+alpha+')';
-}
-
-var fillColorToString = (function(){
-
-    var colorMap = [];
-    return function(colorArr,alpha){
-        if(alpha !== undefined){
-            colorArr[3] = alpha;
-        }
-        if(!colorMap[colorArr[0]]){
-            colorMap[colorArr[0]] = {};
-        }
-        if(!colorMap[colorArr[0]][colorArr[1]]){
-            colorMap[colorArr[0]][colorArr[1]] = {};
-        }
-        if(!colorMap[colorArr[0]][colorArr[1]][colorArr[2]]){
-            colorMap[colorArr[0]][colorArr[1]][colorArr[2]] = {};
-        }
-        if(!colorMap[colorArr[0]][colorArr[1]][colorArr[2]][colorArr[3]]){
-            colorMap[colorArr[0]][colorArr[1]][colorArr[2]][colorArr[3]] = 'rgba(' + colorArr.join(',')+')';
-        }
-        return colorMap[colorArr[0]][colorArr[1]][colorArr[2]][colorArr[3]];
-    };
-}());
-
-function RenderedFrame(tr,o) {
-    this.tr = tr;
-    this.o = o;
-}
-
-function LetterProps(o,sw,sc,fc,m,p){
-    this.o = o;
-    this.sw = sw;
-    this.sc = sc;
-    this.fc = fc;
-    this.m = m;
-    this.props = p;
-}
-
-function iterateDynamicProperties(num){
-    var i, len = this.dynamicProperties;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue(num);
-    }
-}
-
-function reversePath(paths){
-    var newI = [], newO = [], newV = [];
-    var i, len, newPaths = {};
-    var init = 0;
-    if (paths.c) {
-        newI[0] = paths.o[0];
-        newO[0] = paths.i[0];
-        newV[0] = paths.v[0];
-        init = 1;
-    }
-    len = paths.i.length;
-    var cnt = len - 1;
-
-    for (i = init; i < len; i += 1) {
-        newI.push(paths.o[cnt]);
-        newO.push(paths.i[cnt]);
-        newV.push(paths.v[cnt]);
-        cnt -= 1;
-    }
-
-    newPaths.i = newI;
-    newPaths.o = newO;
-    newPaths.v = newV;
-
-    return newPaths;
-}
-/*!
- Transformation Matrix v2.0
- (c) Epistemex 2014-2015
- www.epistemex.com
- By Ken Fyrstenberg
- Contributions by leeoniya.
- License: MIT, header required.
- */
-
-/**
- * 2D transformation matrix object initialized with identity matrix.
- *
- * The matrix can synchronize a canvas context by supplying the context
- * as an argument, or later apply current absolute transform to an
- * existing context.
- *
- * All values are handled as floating point values.
- *
- * @param {CanvasRenderingContext2D} [context] - Optional context to sync with Matrix
- * @prop {number} a - scale x
- * @prop {number} b - shear y
- * @prop {number} c - shear x
- * @prop {number} d - scale y
- * @prop {number} e - translate x
- * @prop {number} f - translate y
- * @prop {CanvasRenderingContext2D|null} [context=null] - set or get current canvas context
- * @constructor
- */
-
-var Matrix = (function(){
-
-    function reset(){
-        this.props[0] = 1;
-        this.props[1] = 0;
-        this.props[2] = 0;
-        this.props[3] = 0;
-        this.props[4] = 0;
-        this.props[5] = 1;
-        this.props[6] = 0;
-        this.props[7] = 0;
-        this.props[8] = 0;
-        this.props[9] = 0;
-        this.props[10] = 1;
-        this.props[11] = 0;
-        this.props[12] = 0;
-        this.props[13] = 0;
-        this.props[14] = 0;
-        this.props[15] = 1;
-        return this;
-    }
-
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos, -mSin,  0, 0
-            , mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1);
-    }
-
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(1, 0, 0, 0
-            , 0, mCos, -mSin, 0
-            , 0, mSin,  mCos, 0
-            , 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos,  0,  mSin, 0
-            , 0, 1, 0, 0
-            , -mSin,  0,  mCos, 0
-            , 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos, -mSin,  0, 0
-            , mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(Math.tan(ax), Math.tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos, mSin,  0, 0
-            , -mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1)
-            ._t(1, 0,  0, 0
-            , Math.tan(ax),  1, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1)
-            ._t(mCos, -mSin,  0, 0
-            , mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1);
-        //return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, Math.tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);
-    }
-
-    function scale(sx, sy, sz) {
-        sz = isNaN(sz) ? 1 : sz;
-        if(sx == 1 && sy == 1 && sz == 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        if(a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0){
-            if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-
-                this.props[12] = this.props[12] * a2 + this.props[13] * e2 + this.props[14] * i2 + this.props[15] * m2 ;
-                this.props[13] = this.props[12] * b2 + this.props[13] * f2 + this.props[14] * j2 + this.props[15] * n2 ;
-                this.props[14] = this.props[12] * c2 + this.props[13] * g2 + this.props[14] * k2 + this.props[15] * o2 ;
-                this.props[15] = this.props[12] * d2 + this.props[13] * h2 + this.props[14] * l2 + this.props[15] * p2 ;
-            }
-            return this;
-        }
-
-        var a1 = this.props[0];
-        var b1 = this.props[1];
-        var c1 = this.props[2];
-        var d1 = this.props[3];
-        var e1 = this.props[4];
-        var f1 = this.props[5];
-        var g1 = this.props[6];
-        var h1 = this.props[7];
-        var i1 = this.props[8];
-        var j1 = this.props[9];
-        var k1 = this.props[10];
-        var l1 = this.props[11];
-        var m1 = this.props[12];
-        var n1 = this.props[13];
-        var o1 = this.props[14];
-        var p1 = this.props[15];
-
-        /* matrix order (canvas compatible):
-         * ace
-         * bdf
-         * 001
-         */
-        this.props[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        this.props[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        this.props[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        this.props[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
-
-        this.props[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        this.props[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        this.props[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        this.props[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
-
-        this.props[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        this.props[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        this.props[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        this.props[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
-
-        this.props[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        this.props[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        this.props[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        this.props[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
-
-        return this;
-    }
-
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-    }
-
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
-         x: x * me.a + y * me.c + me.e,
-         y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
-
-    function inversePoint(pt) {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        return [pt[0] * a + pt[1] * c + e, pt[0] * b + pt[1] * d + f, 0];
-    }
-
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
-    }
-
-    function applyToPointArray(x,y,z,dimensions){
-        if(dimensions && dimensions === 2) {
-            var arr = point_pool.newPoint();
-            arr[0] = x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12]; 
-            arr[1] = x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13]; 
-            return arr;    
-        }
-        return [x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]];
-    }
-    function applyToPointStringified(x, y) {
-        return (bm_rnd(x * this.props[0] + y * this.props[4] + this.props[12]))+','+(bm_rnd(x * this.props[1] + y * this.props[5] + this.props[13]));
-    }
-
-    function toArray() {
-        return [this.props[0],this.props[1],this.props[2],this.props[3],this.props[4],this.props[5],this.props[6],this.props[7],this.props[8],this.props[9],this.props[10],this.props[11],this.props[12],this.props[13],this.props[14],this.props[15]];
-    }
-
-    function toCSS() {
-        if(isSafari){
-            return "matrix3d(" + roundTo2Decimals(this.props[0]) + ',' + roundTo2Decimals(this.props[1]) + ',' + roundTo2Decimals(this.props[2]) + ',' + roundTo2Decimals(this.props[3]) + ',' + roundTo2Decimals(this.props[4]) + ',' + roundTo2Decimals(this.props[5]) + ',' + roundTo2Decimals(this.props[6]) + ',' + roundTo2Decimals(this.props[7]) + ',' + roundTo2Decimals(this.props[8]) + ',' + roundTo2Decimals(this.props[9]) + ',' + roundTo2Decimals(this.props[10]) + ',' + roundTo2Decimals(this.props[11]) + ',' + roundTo2Decimals(this.props[12]) + ',' + roundTo2Decimals(this.props[13]) + ',' + roundTo2Decimals(this.props[14]) + ',' + roundTo2Decimals(this.props[15]) + ')';
-        } else {
-            this.cssParts[1] = this.props.join(',');
-            return this.cssParts.join('');
-        }
-    }
-
-    function to2dCSS() {
-        return "matrix(" + this.props[0] + ',' + this.props[1] + ',' + this.props[4] + ',' + this.props[5] + ',' + this.props[12] + ',' + this.props[13] + ")";
-    }
-
-    function toString() {
-        return "" + this.toArray();
-    }
-
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toArray = toArray;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.toString = toString;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this._t = this.transform;
-
-        this.props = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
-
-        this.cssParts = ['matrix3d(','',')'];
-    }
-}());
-
-function Matrix() {
-
-
-}
-
-/*
- Copyright 2014 David Bau.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- */
-
-(function (pool, math) {
-//
-// The following constants are related to IEEE 754 limits.
-//
-    var global = this,
-        width = 256,        // each RC4 output is 0 <= x < 256
-        chunks = 6,         // at least six RC4 outputs for each double
-        digits = 52,        // there are 52 significant digits in a double
-        rngname = 'random', // rngname: name for Math.random and Math.seedrandom
-        startdenom = math.pow(width, chunks),
-        significance = math.pow(2, digits),
-        overflow = significance * 2,
-        mask = width - 1,
-        nodecrypto;         // node.js crypto module, initialized at the bottom.
-
-//
-// seedrandom()
-// This is the seedrandom function described above.
-//
-    function seedrandom(seed, options, callback) {
-        var key = [];
-        options = (options == true) ? { entropy: true } : (options || {});
-
-        // Flatten the seed string or build one from local entropy if needed.
-        var shortseed = mixkey(flatten(
-            options.entropy ? [seed, tostring(pool)] :
-                (seed == null) ? autoseed() : seed, 3), key);
-
-        // Use the seed to initialize an ARC4 generator.
-        var arc4 = new ARC4(key);
-
-        // This function returns a random double in [0, 1) that contains
-        // randomness in every bit of the mantissa of the IEEE 754 value.
-        var prng = function() {
-            var n = arc4.g(chunks),             // Start with a numerator n < 2 ^ 48
-                d = startdenom,                 //   and denominator d = 2 ^ 48.
-                x = 0;                          //   and no 'extra last byte'.
-            while (n < significance) {          // Fill up all significant digits by
-                n = (n + x) * width;              //   shifting numerator and
-                d *= width;                       //   denominator and generating a
-                x = arc4.g(1);                    //   new least-significant-byte.
-            }
-            while (n >= overflow) {             // To avoid rounding up, before adding
-                n /= 2;                           //   last byte, shift everything
-                d /= 2;                           //   right using integer math until
-                x >>>= 1;                         //   we have exactly the desired bits.
-            }
-            return (n + x) / d;                 // Form the number within [0, 1).
-        };
-
-        prng.int32 = function() { return arc4.g(4) | 0; }
-        prng.quick = function() { return arc4.g(4) / 0x100000000; }
-        prng.double = prng;
-
-        // Mix the randomness into accumulated entropy.
-        mixkey(tostring(arc4.S), pool);
-
-        // Calling convention: what to return as a function of prng, seed, is_math.
-        return (options.pass || callback ||
-        function(prng, seed, is_math_call, state) {
-            if (state) {
-                // Load the arc4 state from the given state if it has an S array.
-                if (state.S) { copy(state, arc4); }
-                // Only provide the .state method if requested via options.state.
-                prng.state = function() { return copy(arc4, {}); }
-            }
-
-            // If called as a method of Math (Math.seedrandom()), mutate
-            // Math.random because that is how seedrandom.js has worked since v1.0.
-            if (is_math_call) { math[rngname] = prng; return seed; }
-
-            // Otherwise, it is a newer calling convention, so return the
-            // prng directly.
-            else return prng;
-        })(
-            prng,
-            shortseed,
-            'global' in options ? options.global : (this == math),
-            options.state);
-    }
-    math['seed' + rngname] = seedrandom;
-
-//
-// ARC4
-//
-// An ARC4 implementation.  The constructor takes a key in the form of
-// an array of at most (width) integers that should be 0 <= x < (width).
-//
-// The g(count) method returns a pseudorandom integer that concatenates
-// the next (count) outputs from ARC4.  Its return value is a number x
-// that is in the range 0 <= x < (width ^ count).
-//
-    function ARC4(key) {
-        var t, keylen = key.length,
-            me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
-
-        // The empty key [] is treated as [0].
-        if (!keylen) { key = [keylen++]; }
-
-        // Set up S using the standard key scheduling algorithm.
-        while (i < width) {
-            s[i] = i++;
-        }
-        for (i = 0; i < width; i++) {
-            s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
-            s[j] = t;
-        }
-
-        // The "g" method returns the next (count) outputs as one number.
-        (me.g = function(count) {
-            // Using instance members instead of closure state nearly doubles speed.
-            var t, r = 0,
-                i = me.i, j = me.j, s = me.S;
-            while (count--) {
-                t = s[i = mask & (i + 1)];
-                r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
-            }
-            me.i = i; me.j = j;
-            return r;
-            // For robust unpredictability, the function call below automatically
-            // discards an initial batch of values.  This is called RC4-drop[256].
-            // See http://google.com/search?q=rsa+fluhrer+response&btnI
-        })(width);
-    }
-
-//
-// copy()
-// Copies internal state of ARC4 to or from a plain object.
-//
-    function copy(f, t) {
-        t.i = f.i;
-        t.j = f.j;
-        t.S = f.S.slice();
-        return t;
-    };
-
-//
-// flatten()
-// Converts an object tree to nested arrays of strings.
-//
-    function flatten(obj, depth) {
-        var result = [], typ = (typeof obj), prop;
-        if (depth && typ == 'object') {
-            for (prop in obj) {
-                try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
-            }
-        }
-        return (result.length ? result : typ == 'string' ? obj : obj + '\0');
-    }
-
-//
-// mixkey()
-// Mixes a string seed into a key that is an array of integers, and
-// returns a shortened string seed that is equivalent to the result key.
-//
-    function mixkey(seed, key) {
-        var stringseed = seed + '', smear, j = 0;
-        while (j < stringseed.length) {
-            key[mask & j] =
-                mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
-        }
-        return tostring(key);
-    }
-
-//
-// autoseed()
-// Returns an object for autoseeding, using window.crypto and Node crypto
-// module if available.
-//
-    function autoseed() {
-        try {
-            if (nodecrypto) { return tostring(nodecrypto.randomBytes(width)); }
-            var out = new Uint8Array(width);
-            (global.crypto || global.msCrypto).getRandomValues(out);
-            return tostring(out);
-        } catch (e) {
-            var browser = global.navigator,
-                plugins = browser && browser.plugins;
-            return [+new Date, global, plugins, global.screen, tostring(pool)];
-        }
-    }
-
-//
-// tostring()
-// Converts an array of charcodes to a string
-//
-    function tostring(a) {
-        return String.fromCharCode.apply(0, a);
-    }
-
-//
-// When seedrandom.js is loaded, we immediately mix a few bits
-// from the built-in RNG into the entropy pool.  Because we do
-// not want to interfere with deterministic PRNG state later,
-// seedrandom will not call math.random on its own again after
-// initialization.
-//
-    mixkey(math.random(), pool);
-
-//
-// Nodejs and AMD support: export the implementation as a module using
-// either convention.
-//
-
-// End anonymous scope, and pass initial values.
-})(
-    [],     // pool: entropy pool starts empty
-    BMMath    // math: package containing random, pow, and seedrandom
-);
-var BezierFactory = (function(){
-    /**
-     * BezierEasing - use bezier curve for transition easing function
-     * by Gaëtan Renaudeau 2014 - 2015 – MIT License
-     *
-     * Credits: is based on Firefox's nsSMILKeySpline.cpp
-     * Usage:
-     * var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ])
-     * spline.get(x) => returns the easing value | x must be in [0, 1] range
-     *
-     */
-
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
-
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
-    }
-
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
-
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
-
-    var float32ArraySupported = typeof Float32Array === "function";
-
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
-
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
-    }
-
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
-     * points is an array of [ mX1, mY1, mX2, mY2 ]
-     */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
-
-        this.get = this.get.bind(this);
-    }
-
-    BezierEasing.prototype = {
-
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
-
-        // Private part
-
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
-
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
-
-        /**
-         * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
-         */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
-
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
-
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
-
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
-
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
-
-    return ob;
-
-}())
-
-
-function matrixManagerFunction(){
-
-    var mat = new Matrix();
-
-    var returnMatrix2D = function(rX, scaleX, scaleY, tX, tY){
-        return mat.reset().translate(tX,tY).rotate(rX).scale(scaleX,scaleY).toCSS();
-    };
-
-    var getMatrix = function(animData){
-        return returnMatrix2D(animData.tr.r[2],animData.tr.s[0],animData.tr.s[1],animData.tr.p[0],animData.tr.p[1]);
-    };
-
-    return {
-        getMatrix : getMatrix
-    };
-
-}
-var MatrixManager = matrixManagerFunction;
-(function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = window.setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
-}());
-function createElement(parent,child,params){
-    if(child){
-        child.prototype = Object.create(parent.prototype);
-        child.prototype.constructor = child;
-        child.prototype._parent = parent.prototype;
-    }else{
-        var instance = Object.create(parent.prototype,params);
-        var getType = {};
-        if(instance && getType.toString.call(instance.init) === '[object Function]'){
-            instance.init();
-        }
-        return instance;
-    }
-}
-
-function extendPrototype(source,destination){
-    for (var attr in source.prototype) {
-        if (source.prototype.hasOwnProperty(attr)) destination.prototype[attr] = source.prototype[attr];
-    }
-}
-function bezFunction(){
-
-    var easingFunctions = [];
-    var math = Math;
-
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.0001 && det1 < 0.0001;
-    }
-
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
-        }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    /*function getEasingCurve(aa,bb,cc,dd,encodedFuncName) {
-        if(!encodedFuncName){
-            encodedFuncName = ('bez_' + aa+'_'+bb+'_'+cc+'_'+dd).replace(/\./g, 'p');
-        }
-        if(easingFunctions[encodedFuncName]){
-            return easingFunctions[encodedFuncName];
-        }
-        var A0, B0, C0;
-        var A1, B1, C1;
-        easingFunctions[encodedFuncName] = function(tt) {
-            var x = tt;
-            var i = 0, z;
-            while (++i < 20) {
-                C0 = 3 * aa;
-                B0 = 3 * (cc - aa) - C0;
-                A0 = 1 - C0 - B0;
-                z = (x * (C0 + x * (B0 + x * A0))) - tt;
-                if (bm_abs(z) < 1e-3) break;
-                x -= z / (C0 + x * (2 * B0 + 3 * A0 * x));
-            }
-            C1 = 3 * bb;
-            B1 = 3 * (dd - bb) - C1;
-            A1 = 1 - C1 - B1;
-            var polyB = x * (C1 + x * (B1 + x * A1));
-            //return c * polyB + b;
-            return polyB;
-        };
-        return easingFunctions[encodedFuncName];
-    }*/
-    var getBezierLength = (function(){
-
-        function Segment(l,p){
-            this.l = l;
-            this.p = p;
-        }
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = {
-                addedLength: 0,
-                segments: []
-            };
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.segments.push(new Segment(addedLength,perc));
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (keyData){
-            var pt1 = keyData.s;
-            var pt2 = keyData.e;
-            var pt3 = keyData.to;
-            var pt4 = keyData.ti;
-            var bezierName = (pt1.join('_')+'_'+pt2.join('_')+'_'+pt3.join('_')+'_'+pt4.join('_')).replace(/\./g, 'p');
-            if(storedData[bezierName]){
-                keyData.bezierData = storedData[bezierName];
-                return;
-            }
-        var curveSegments = defaultCurveSegments;
-        var k, i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point,lastPoint = null;
-            if(pt1.length === 2 && (pt1[0] != pt2[0] || pt1[1] != pt2[1]) && pointOnLine2D(pt1[0],pt1[1],pt2[0],pt2[1],pt1[0]+pt3[0],pt1[1]+pt3[1]) && pointOnLine2D(pt1[0],pt1[1],pt2[0],pt2[1],pt2[0]+pt4[0],pt2[1]+pt4[1])){
-                curveSegments = 2;
-            }
-            var bezierData = new BezierData(curveSegments);
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-            point = new Array(len);
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                point[i] = ptCoord;
-                    if(lastPoint !== null){
-                    ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                }
-            ptDistance = bm_sqrt(ptDistance);
-                addedLength += ptDistance;
-                bezierData.points[k] = new PointData(ptDistance,point);
-                lastPoint = point;
-            }
-            bezierData.segmentLength = addedLength;
-            keyData.bezierData = bezierData;
-            storedData[bezierName] = bezierData;
-
-        }
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var segments = bezierData.segments;
-        var len = segments.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(lengthPos == segments[initPos].l){
-            return segments[initPos].p;
-        }else{
-            var dir = segments[initPos].l > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(segments[initPos].l <= lengthPos && segments[initPos+1].l > lengthPos){
-                    lPerc = (lengthPos - segments[initPos].l)/(segments[initPos+1].l-segments[initPos].l);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    flag = false;
-                }
-            }
-            return segments[initPos].p + (segments[initPos+1].p - segments[initPos].p)*lPerc;
-        }
-    }
-
-    function SegmentPoints(){
-        this.pt1 = new Array(2);
-        this.pt2 = new Array(2);
-        this.pt3 = new Array(2);
-        this.pt4 = new Array(2);
-    }
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        var pts = new SegmentPoints();
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        //Math.round(num * 100) / 100
-        for(i=0;i<len;i+=1){
-            pts.pt1[i] =  Math.round((u0*u0*u0* pt1[i] + (t0*u0*u0 + u0*t0*u0 + u0*u0*t0) * pt3[i] + (t0*t0*u0 + u0*t0*t0 + t0*u0*t0)* pt4[i] + t0*t0*t0* pt2[i])* 1000) / 1000;
-            pts.pt3[i] = Math.round((u0*u0*u1*pt1[i] + (t0*u0*u1 + u0*t0*u1 + u0*u0*t1)* pt3[i] + (t0*t0*u1 + u0*t0*t1 + t0*u0*t1)* pt4[i] + t0*t0*t1* pt2[i])* 1000) / 1000;
-            pts.pt4[i] = Math.round((u0*u1*u1* pt1[i] + (t0*u1*u1 + u0*t1*u1 + u0*u1*t1)* pt3[i] + (t0*t1*u1 + u0*t1*t1 + t0*u1*t1)* pt4[i] + t0*t1*t1* pt2[i])* 1000) / 1000;
-            pts.pt2[i] = Math.round((u1*u1*u1* pt1[i] + (t1*u1*u1 + u1*t1*u1 + u1*u1*t1)* pt3[i] + (t1*t1*u1 + u1*t1*t1 + t1*u1*t1)*pt4[i] + t1*t1*t1* pt2[i])* 1000) / 1000;
-        }
-        return pts;
-    }
-
-    return {
-        //getEasingCurve : getEasingCurve,
-        getBezierLength : getBezierLength,
-        getNewSegment : getNewSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
-    };
-}
-
-var bez = bezFunction();
-function dataFunctionManager(){
-
-    //var tCanvasHelper = document.createElement('canvas').getContext('2d');
-
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
-        }
-    }
-
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                return comps[i].layers;
-            }
-            i += 1;
-        }
-    }
-
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
-            }
-        }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
-    }
-
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
-        }
-    }
-
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
-        }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
-        }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
-    }
-
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        }
-    }())
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        }
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        }
-    }());
-
-    /*function blitPaths(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] /= blitter;
-            path.i[i][1] /= blitter;
-            path.o[i][0] /= blitter;
-            path.o[i][1] /= blitter;
-            path.v[i][0] /= blitter;
-            path.v[i][1] /= blitter;
-        }
-    }
-
-    function blitShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    blitPaths(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            blitPaths(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            blitPaths(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                blitShapes(arr[i].it);
-            }else if(arr[i].ty == 'rc'){
-                blitProperty(arr[i].p);
-                blitProperty(arr[i].s);
-            }else if(arr[i].ty == 'st'){
-                blitProperty(arr[i].w);
-            }else if(arr[i].ty == 'tr'){
-                blitProperty(arr[i].p);
-                blitProperty(arr[i].sk);
-                blitProperty(arr[i].a);
-            }else if(arr[i].ty == 'el'){
-                blitProperty(arr[i].p);
-                blitProperty(arr[i].s);
-            }else if(arr[i].ty == 'rd'){
-                blitProperty(arr[i].r);
-            }else{
-
-                //console.log(arr[i].ty );
-            }
-        }
-    }
-
-    function blitText(data, fontManager){
-
-    }
-
-    function blitValue(val){
-        if(typeof(val) === 'number'){
-            val /= blitter;
-        } else {
-            var i = val.length-1;
-            while(i>=0){
-                val[i] /= blitter;
-                i-=1;
-            }
-        }
-        return val;
-    }
-
-    function blitProperty(data){
-        if(!data.k.length){
-            data.k = blitValue(data.k);
-        }else if(typeof(data.k[0]) === 'number'){
-            data.k = blitValue(data.k);
-        } else {
-            var i, len = data.k.length;
-            for(i=0;i<len;i+=1){
-                if(data.k[i].s){
-                    //console.log('pre S: ', data.k[i].s);
-                    data.k[i].s = blitValue(data.k[i].s);
-                    //console.log('post S: ', data.k[i].s);
-                }
-                if(data.k[i].e){
-                    //console.log('pre E: ', data.k[i].e);
-                    data.k[i].e = blitValue(data.k[i].e);
-                    //console.log('post E: ', data.k[i].e);
-                }
-            }
-        }
-    }
-
-    function blitLayers(layers,comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData)){
-                continue;
-            }
-            blitProperty(layerData.ks.a);
-            blitProperty(layerData.ks.p);
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        blitPaths(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                blitPaths(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                blitPaths(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.w = Math.round(layerData.w/blitter);
-                layerData.h = Math.round(layerData.h/blitter);
-                blitLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                blitShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                blitText(layerData, fontManager);
-            }else if(layerData.ty == 1){
-                layerData.sh /= blitter;
-                layerData.sw /= blitter;
-            } else {
-            }
-        }
-    }
-
-    function blitAnimation(animationData,comps, fontManager){
-        blitLayers(animationData.layers,comps, fontManager);
-    }*/
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
-    }
-
-    function completeText(data, fontManager){
-        var letters;
-        var keys = data.t.d.k;
-        var k, kLen = keys.length;
-        for(k=0;k<kLen;k+=1){
-            var documentData = data.t.d.k[k].s;
-            letters = [];
-            var i, len;
-            var newLineFlag, index = 0, val;
-            var anchorGrouping = data.t.m.g;
-            var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-            var lineWidth = 0;
-            var maxLineWidth = 0;
-            var j, jLen;
-            var fontData = fontManager.getFontByName(documentData.f);
-            var charData, cLength = 0;
-            var styles = fontData.fStyle.split(' ');
-
-            var fWeight = 'normal', fStyle = 'normal';
-            len = styles.length;
-            for(i=0;i<len;i+=1){
-                if (styles[i].toLowerCase() === 'italic') {
-                    fStyle = 'italic';
-                }else if (styles[i].toLowerCase() === 'bold') {
-                    fWeight = '700';
-                } else if (styles[i].toLowerCase() === 'black') {
-                    fWeight = '900';
-                } else if (styles[i].toLowerCase() === 'medium') {
-                    fWeight = '500';
-                } else if (styles[i].toLowerCase() === 'regular' || styles[i].toLowerCase() === 'normal') {
-                    fWeight = '400';
-                } else if (styles[i].toLowerCase() === 'light' || styles[i].toLowerCase() === 'thin') {
-                    fWeight = '200';
-                }
-            }
-            documentData.fWeight = fWeight;
-            documentData.fStyle = fStyle;
-            len = documentData.t.length;
-            if(documentData.sz){
-                var boxWidth = documentData.sz[0];
-                var lastSpaceIndex = -1;
-                for(i=0;i<len;i+=1){
-                    newLineFlag = false;
-                    if(documentData.t.charAt(i) === ' '){
-                        lastSpaceIndex = i;
-                    }else if(documentData.t.charCodeAt(i) === 13){
-                        lineWidth = 0;
-                        newLineFlag = true;
-                    }
-                    if(fontManager.chars){
-                        charData = fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, fontData.fFamily);
-                        cLength = newLineFlag ? 0 : charData.w*documentData.s/100;
-                    }else{
-                        //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                        cLength = fontManager.measureText(documentData.t.charAt(i), documentData.f, documentData.s);
-                    }
-                    if(lineWidth + cLength > boxWidth){
-                        if(lastSpaceIndex === -1){
-                            //i -= 1;
-                            documentData.t = documentData.t.substr(0,i) + "\r" + documentData.t.substr(i);
-                            len += 1;
-                        } else {
-                            i = lastSpaceIndex;
-                            documentData.t = documentData.t.substr(0,i) + "\r" + documentData.t.substr(i+1);
-                        }
-                        lastSpaceIndex = -1;
-                        lineWidth = 0;
-                    }else {
-                        lineWidth += cLength;
-                    }
-                }
-                len = documentData.t.length;
-            }
-            lineWidth = 0;
-            cLength = 0;
-            for (i = 0;i < len ;i += 1) {
-                newLineFlag = false;
-                if(documentData.t.charAt(i) === ' '){
-                    val = '\u00A0';
-                }else if(documentData.t.charCodeAt(i) === 13){
-                    lineWidths.push(lineWidth);
-                    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-                    lineWidth = 0;
-                    val = '';
-                    newLineFlag = true;
-                    currentLine += 1;
-                }else{
-                    val = documentData.t.charAt(i);
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.s/100;
-                }else{
-                    //var charWidth = fontManager.measureText(val, documentData.f, documentData.s);
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-                    cLength = fontManager.measureText(val, documentData.f, documentData.s);
-                }
-
-                //
-                lineWidth += cLength;
-                letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine});
-                if(anchorGrouping == 2){
-                    currentSize += cLength;
-                    if(val == '' || val == '\u00A0' || i == len - 1){
-                        if(val == '' || val == '\u00A0'){
-                            currentSize -= cLength;
-                        }
-                        while(currentPos<=i){
-                            letters[currentPos].an = currentSize;
-                            letters[currentPos].ind = index;
-                            letters[currentPos].extra = cLength;
-                            currentPos += 1;
-                        }
-                        index += 1;
-                        currentSize = 0;
-                    }
-                }else if(anchorGrouping == 3){
-                    currentSize += cLength;
-                    if(val == '' || i == len - 1){
-                        if(val == ''){
-                            currentSize -= cLength;
-                        }
-                        while(currentPos<=i){
-                            letters[currentPos].an = currentSize;
-                            letters[currentPos].ind = index;
-                            letters[currentPos].extra = cLength;
-                            currentPos += 1;
-                        }
-                        currentSize = 0;
-                        index += 1;
-                    }
-                }else{
-                    letters[index].ind = index;
-                    letters[index].extra = 0;
-                    index += 1;
-                }
-            }
-            documentData.l = letters;
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidths.push(lineWidth);
-            if(documentData.sz){
-                documentData.boxWidth = documentData.sz[0];
-                documentData.justifyOffset = 0;
-            }else{
-                documentData.boxWidth = maxLineWidth;
-                switch(documentData.j){
-                    case 1:
-                        documentData.justifyOffset = - documentData.boxWidth;
-                        break;
-                    case 2:
-                        documentData.justifyOffset = - documentData.boxWidth/2;
-                        break;
-                    default:
-                        documentData.justifyOffset = 0;
-                }
-            }
-            documentData.lineWidths = lineWidths;
-
-            var animators = data.t.a;
-            jLen = animators.length;
-            var based, ind, indexes = [];
-            for(j=0;j<jLen;j+=1){
-                if(animators[j].a.sc){
-                    documentData.strokeColorAnim = true;
-                }
-                if(animators[j].a.sw){
-                    documentData.strokeWidthAnim = true;
-                }
-                if(animators[j].a.fc || animators[j].a.fh || animators[j].a.fs || animators[j].a.fb){
-                    documentData.fillColorAnim = true;
-                }
-                ind = 0;
-                based = animators[j].s.b;
-                for(i=0;i<len;i+=1){
-                    letters[i].anIndexes[j] = ind;
-                    if((based == 1 && letters[i].val != '') || (based == 2 && letters[i].val != '' && letters[i].val != '\u00A0') || (based == 3 && (letters[i].n || letters[i].val == '\u00A0' || i == len - 1)) || (based == 4 && (letters[i].n || i == len - 1))){
-                        if(animators[j].s.rn === 1){
-                            indexes.push(ind);
-                        }
-                        ind += 1;
-                    }
-                }
-                data.t.a[j].s.totalChars = ind;
-                var currentInd = -1, newInd;
-                if(animators[j].s.rn === 1){
-                    for(i = 0; i < len; i += 1){
-                        if(currentInd != letters[i].anIndexes[j]){
-                            currentInd = letters[i].anIndexes[j];
-                            newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                        }
-                        letters[i].anIndexes[j] = newInd;
-                    }
-                }
-            }
-            if(jLen === 0 && !('m' in data.t.p)){
-                data.singleShape = true;
-            }
-            documentData.yOffset = documentData.lh || documentData.s*1.2;
-            documentData.ls = documentData.ls || 0;
-            documentData.ascent = fontData.ascent*documentData.s/100;
-        }
-
-    }
-
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-
-    return moduleOb;
-}
-
-var dataManager = dataFunctionManager();
-var FontManager = (function(){
-
-    var maxWaitingTime = 5000;
-
-    function setUpNode(font, family){
-        var parentNode = document.createElement('span');
-        parentNode.style.fontFamily    = family;
-        var node = document.createElement('span');
-        // Characters that vary significantly among different fonts
-        node.innerHTML = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = font + ', '+family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 't'){
-                if(window.Typekit && window.Typekit.load && this.typekitLoaded === 0){
-                    this.typekitLoaded = 1;
-                    try{window.Typekit.load({
-                        async: true,
-                        active: function() {
-                            this.typekitLoaded = 2;
-                        }.bind(this)
-                    });}catch(e){}
-                }
-                if(this.typekitLoaded === 2) {
-                    this.fonts[i].loaded = true;
-                }
-            } else if(this.fonts[i].fOrigin === 'n'){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(checkLoadedFonts.bind(this),20);
-        }else{
-            setTimeout(function(){this.loaded = true;}.bind(this),0);
-
-        }
-    };
-
-    function createHelper(def, fontData){
-        var tHelper = document.createElementNS(svgNS,'text');
-        tHelper.style.fontSize = '100px';
-        tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.className = fontData.fClass;
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = document.createElement('canvas').getContext('2d');
-        tCanvasHelper.font = '100px '+ fontData.fFamily;
-        return tCanvasHelper;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.loaded = true;
-            return;
-        }
-        if(this.chars){
-            this.loaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        for(i=0; i<len; i+= 1){
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-            }else if(fontArr[i].fOrigin === 'p'){
-                var s = document.createElement('style');
-                s.type = "text/css";
-                s.innerHTML = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                defs.appendChild(s);
-            } else if(fontArr[i].fOrigin === 'g'){
-                //<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
-                var l = document.createElement('link');
-                l.type = "text/css";
-                l.rel = "stylesheet";
-                l.href = fontArr[i].fPath;
-                defs.appendChild(l);
-            } else if(fontArr[i].fOrigin === 't'){
-                //<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
-                var sc = document.createElement('script');
-                sc.setAttribute('src',fontArr[i].fPath);
-                defs.appendChild(sc);
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            this.fonts.push(fontArr[i]);
-        }
-        checkLoadedFonts.bind(this)();
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-    }
-
-    function measureText(char, fontName, size){
-        var fontData = this.getFontByName(fontName);
-        var tHelper = fontData.helper;
-        //tHelper.textContent = char;
-        return tHelper.measureText(char).width*size/100;
-        //return tHelper.getComputedTextLength()*size/100;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return 'sans-serif';
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.loaded = false;
-        this.initTime = Date.now();
-    };
-    Font.prototype.addChars = addChars;
-    Font.prototype.addFonts = addFonts;
-    Font.prototype.getCharData = getCharData;
-    Font.prototype.getFontByName = getFontByName;
-    Font.prototype.measureText = measureText;
-
-    return Font;
-
-}());
-var PropertyFactory = (function(){
-
-    var initFrame = -999999;
-
-    function getValue(){
-        if(this.elem.globalData.frameId === this.frameId){
-            return;
-        }
-        this.mdf = false;
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        if(!(frameNum === this.lastFrame || (this.lastFrame !== initFrame && ((this.lastFrame >= this.keyframes[this.keyframes.length- 1].t-this.offsetTime && frameNum >= this.keyframes[this.keyframes.length- 1].t-this.offsetTime) || (this.lastFrame < this.keyframes[0].t-this.offsetTime && frameNum < this.keyframes[0].t-this.offsetTime))))){
-            var i = this.lastFrame < frameNum ? this._lastIndex : 0;
-            var len = this.keyframes.length- 1,flag = true;
-            var keyData, nextKeyData;
-
-            while(flag){
-                keyData = this.keyframes[i];
-                nextKeyData = this.keyframes[i+1];
-                if(i == len-1 && frameNum >= nextKeyData.t - this.offsetTime){
-                    if(keyData.h){
-                        keyData = nextKeyData;
-                    }
-                    break;
-                }
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-
-            this._lastIndex = i;
-
-            var k, kLen,perc,jLen, j, fnc;
-            if(keyData.to){
-
-                if(!keyData.bezierData){
-                    bez.buildBezierData(keyData);
-                }
-                var bezierData = keyData.bezierData;
-                if(frameNum >= nextKeyData.t-this.offsetTime || frameNum < keyData.t-this.offsetTime){
-                    var ind = frameNum >= nextKeyData.t-this.offsetTime ? bezierData.points.length - 1 : 0;
-                    kLen = bezierData.points[ind].point.length;
-                    for(k = 0; k < kLen; k += 1){
-                        this.pv[k] = bezierData.points[ind].point[k];
-                        this.v[k] = this.mult ? this.pv[k]*this.mult : this.pv[k];
-                        if(this.lastPValue[k] !== this.pv[k]) {
-                            this.mdf = true;
-                            this.lastPValue[k] = this.pv[k];
-                        }
-                    }
-                    this._lastBezierData = null;
-                }else{
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y,keyData.n).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                    var distanceInLine = bezierData.segmentLength*perc;
-
-                    var segmentPerc;
-                    var addedLength =  (this.lastFrame < frameNum && this._lastBezierData === bezierData) ? this._lastAddedLength : 0;
-                    j =  (this.lastFrame < frameNum && this._lastBezierData === bezierData) ? this._lastPoint : 0;
-                    flag = true;
-                    jLen = bezierData.points.length;
-                    while(flag){
-                        addedLength +=bezierData.points[j].partialLength;
-                        if(distanceInLine === 0 || perc === 0 || j == bezierData.points.length - 1){
-                            kLen = bezierData.points[j].point.length;
-                            for(k=0;k<kLen;k+=1){
-                                this.pv[k] = bezierData.points[j].point[k];
-                                this.v[k] = this.mult ? this.pv[k]*this.mult : this.pv[k];
-                                if(this.lastPValue[k] !== this.pv[k]) {
-                                    this.mdf = true;
-                                    this.lastPValue[k] = this.pv[k];
-                                }
-                            }
-                            break;
-                        }else if(distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j+1].partialLength){
-                            segmentPerc = (distanceInLine-addedLength)/(bezierData.points[j+1].partialLength);
-                            kLen = bezierData.points[j].point.length;
-                            for(k=0;k<kLen;k+=1){
-                                this.pv[k] = bezierData.points[j].point[k] + (bezierData.points[j+1].point[k] - bezierData.points[j].point[k])*segmentPerc;
-                                this.v[k] = this.mult ? this.pv[k] * this.mult : this.pv[k];
-                                if(this.lastPValue[k] !== this.pv[k]) {
-                                    this.mdf = true;
-                                    this.lastPValue[k] = this.pv[k];
-                                }
-                            }
-                            break;
-                        }
-                        if(j < jLen - 1){
-                            j += 1;
-                        }else{
-                            flag = false;
-                        }
-                    }
-                    this._lastPoint = j;
-                    this._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                    this._lastBezierData = bezierData;
-                }
-            }else{
-                var outX,outY,inX,inY, keyValue;
-                len = keyData.s.length;
-                for(i=0;i<len;i+=1){
-                    if(keyData.h !== 1){
-                        if(frameNum >= nextKeyData.t-this.offsetTime){
-                            perc = 1;
-                        }else if(frameNum < keyData.t-this.offsetTime){
-                            perc = 0;
-                        }else{
-                            if(keyData.o.x instanceof Array){
-                                if(!keyData.__fnct){
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = keyData.o.x[i] || keyData.o.x[0];
-                                    outY = keyData.o.y[i] || keyData.o.y[0];
-                                    inX = keyData.i.x[i] || keyData.i.x[0];
-                                    inY = keyData.i.y[i] || keyData.i.y[0];
-                                    fnc = BezierFactory.getBezierEasing(outX,outY,inX,inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX,outY,inX,inY).get;
-                                    keyData.__fnct = fnc;
-                                } else{
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                        }
-                    }
-                    if(this.sh && keyData.h !== 1){
-                        var initP = keyData.s[i];
-                        var endP = keyData.e[i];
-                        if(initP-endP < -180){
-                            initP += 360;
-                        } else if(initP-endP > 180){
-                            initP -= 360;
-                        }
-                        keyValue = initP+(endP-initP)*perc;
-                    } else {
-                        keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i]+(keyData.e[i]-keyData.s[i])*perc;
-                    }
-                    if(len === 1){
-                        this.v = this.mult ? keyValue*this.mult : keyValue;
-                        this.pv = keyValue;
-                        if(this.lastPValue != this.pv){
-                            this.mdf = true;
-                            this.lastPValue = this.pv;
-                        }
-                    }else{
-                        this.v[i] = this.mult ? keyValue*this.mult : keyValue;
-                        this.pv[i] = keyValue;
-                        if(this.lastPValue[i] !== this.pv[i]){
-                            this.mdf = true;
-                            this.lastPValue[i] = this.pv[i];
-                        }
-                    }
-                }
-            }
-        }
-        this.lastFrame = frameNum;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function getNoValue(){}
-
-    function ValueProperty(elem,data, mult){
-        this.mult = mult;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this.mdf = false;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.getValue = getNoValue;
-    }
-
-    function MultiDimensionalProperty(elem,data, mult){
-        this.mult = mult;
-        this.data = data;
-        this.mdf = false;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        this.v = Array.apply(null, {length:data.k.length});
-        this.pv = Array.apply(null, {length:data.k.length});
-        this.lastValue = Array.apply(null, {length:data.k.length});
-        var arr = Array.apply(null, {length:data.k.length});
-        this.vel = arr.map(function () { return 0 });
-        var i, len = data.k.length;
-        for(i = 0;i<len;i+=1){
-            this.v[i] = mult ? data.k[i] * mult : data.k[i];
-            this.pv[i] = data.k[i];
-        }
-        this.getValue = getNoValue;
-    }
-
-    function KeyframedValueProperty(elem, data, mult){
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.lastValue = -99999;
-        this.lastPValue = -99999;
-        this.frameId = -1;
-        this._lastIndex = 0;
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.lastFrame = initFrame;
-        this.v = mult ? data.k[0].s[0]*mult : data.k[0].s[0];
-        this.pv = data.k[0].s[0];
-        this.getValue = getValue;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult){
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for(i=0;i<len-1;i+=1){
-            if(data.k[i].to && data.k[i].s && data.k[i].e ){
-                s = data.k[i].s;
-                e = data.k[i].e;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                if((s.length === 2 && !(s[0] === e[0] && s[1] === e[1]) && bez.pointOnLine2D(s[0],s[1],e[0],e[1],s[0] + to[0],s[1] + to[1]) && bez.pointOnLine2D(s[0],s[1],e[0],e[1],e[0] + ti[0],e[1] + ti[1])) || (s.length === 3 && !(s[0] === e[0] && s[1] === e[1] && s[2] === e[2]) && bez.pointOnLine3D(s[0],s[1],s[2],e[0],e[1],e[2],s[0] + to[0],s[1] + to[1],s[2] + to[2]) && bez.pointOnLine3D(s[0],s[1],s[2],e[0],e[1],e[2],e[0] + ti[0],e[1] + ti[1],e[2] + ti[2]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-            }
-        }
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this.mult = mult;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.getValue = getValue;
-        this.frameId = -1;
-        this._lastIndex = 0;
-        this.v = Array.apply(null, {length:data.k[0].s.length});
-        this.pv = Array.apply(null, {length:data.k[0].s.length});
-        this.lastValue = Array.apply(null, {length:data.k[0].s.length});
-        this.lastPValue = Array.apply(null, {length:data.k[0].s.length});
-        this.lastFrame = initFrame;
-    }
-
-    var TransformProperty = (function() {
-        function positionGetter() {
-            return ExpressionValue(this.p);
-        }
-        function xPositionGetter() {
-            return ExpressionValue(this.px);
-        }
-        function yPositionGetter() {
-            return ExpressionValue(this.py);
-        }
-        function zPositionGetter() {
-            return ExpressionValue(this.pz);
-        }
-        function anchorGetter() {
-            return ExpressionValue(this.a);
-        }
-        function orientationGetter() {
-            return ExpressionValue(this.or);
-        }
-        function rotationGetter() {
-            return ExpressionValue(this.r, 1/degToRads);
-        }
-        function scaleGetter() {
-            return ExpressionValue(this.s, 100);
-        }
-        function opacityGetter() {
-            return ExpressionValue(this.o, 100);
-        }
-        function skewGetter() {
-            return ExpressionValue(this.sk);
-        }
-        function skewAxisGetter() {
-            return ExpressionValue(this.sa);
-        }
-        function applyToMatrix(mat) {
-            var i, len = this.dynamicProperties.length;
-            for(i = 0; i < len; i += 1) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i].mdf) {
-                    this.mdf = true;
-                }
-            }
-            if (this.a) {
-                mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if (this.s) {
-                mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.r) {
-                mat.rotate(-this.r.v);
-            } else {
-                mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
-            }
-            if (this.data.p.s) {
-                if (this.data.p.z) {
-                    mat.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    mat.translate(this.px.v, this.py.v, 0);
-                }
-            } else {
-                mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-            }
-        }
-        function processKeys(){
-            if (this.elem.globalData.frameId === this.frameId) {
-                return;
-            }
-
-            this.mdf = false;
-            var i, len = this.dynamicProperties.length;
-
-            for(i = 0; i < len; i += 1) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i].mdf) {
-                    this.mdf = true;
-                }
-            }
-            if (this.mdf) {
-                this.v.reset();
-                if (this.a) {
-                    this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-                }
-                if(this.s) {
-                    this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-                }
-                if (this.sk) {
-                    this.v.skewFromAxis(-this.sk.v, this.sa.v);
-                }
-                if (this.r) {
-                    this.v.rotate(-this.r.v);
-                } else {
-                    this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
-                }
-                if (this.autoOriented && this.p.keyframes && this.p.getValueAtTime) {
-                    var v1,v2;
-                    if (this.p.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / this.elem.globalData.frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / this.elem.globalData.frameRate, 0);
-                    } else if(this.p.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / this.elem.globalData.frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.01) / this.elem.globalData.frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p.lastFrame+this.p.offsetTime - 0.01) / this.elem.globalData.frameRate, this.p.offsetTime);
-                    }
-                    this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-                }
-                if(this.data.p.s){
-                    if(this.data.p.z) {
-                        this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                    } else {
-                        this.v.translate(this.px.v, this.py.v, 0);
-                    }
-                }else{
-                    this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-                }
-            }
-            //console.log(this.v.to2dCSS())
-            this.frameId = this.elem.globalData.frameId;
-        }
-
-        function setInverted(){
-            this.inverted = true;
-            this.iv = new Matrix();
-            if(!this.k){
-                if(this.data.p.s){
-                    this.iv.translate(this.px.v,this.py.v,-this.pz.v);
-                }else{
-                    this.iv.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-                }
-                if(this.r){
-                    this.iv.rotate(-this.r.v);
-                }else{
-                    this.iv.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
-                }
-                if(this.s){
-                    this.iv.scale(this.s.v[0],this.s.v[1],1);
-                }
-                if(this.a){
-                    this.iv.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]);
-                }
-            }
-        }
-
-        function autoOrient(){
-            //
-            //var prevP = this.getValueAtTime();
-        }
-
-        return function TransformProperty(elem,data,arr){
-            this.elem = elem;
-            this.frameId = -1;
-            this.type = 'transform';
-            this.dynamicProperties = [];
-            this.mdf = false;
-            this.data = data;
-            this.getValue = processKeys;
-            this.applyToMatrix = applyToMatrix;
-            this.setInverted = setInverted;
-            this.autoOrient = autoOrient;
-            this.v = new Matrix();
-            if(data.p.s){
-                this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this.dynamicProperties);
-                this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this.dynamicProperties);
-                if(data.p.z){
-                    this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this.dynamicProperties);
-                }
-            }else{
-                this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            }
-            if(data.r) {
-                this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this.dynamicProperties);
-            } else if(data.rx) {
-                this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this.dynamicProperties);
-                this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this.dynamicProperties);
-                this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this.dynamicProperties);
-                this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this.dynamicProperties);
-            }
-            if(data.sk){
-                this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this.dynamicProperties);
-                this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this.dynamicProperties);
-            }
-            if(data.a) {
-                this.a = PropertyFactory.getProp(elem,data.a,1,0,this.dynamicProperties);
-            }
-            if(data.s) {
-                this.s = PropertyFactory.getProp(elem,data.s,1,0.01,this.dynamicProperties);
-            }
-            if(data.o){
-                this.o = PropertyFactory.getProp(elem,data.o,0,0.01,arr);
-            } else {
-                this.o = {mdf:false,v:1};
-            }
-            if(this.dynamicProperties.length){
-                arr.push(this);
-            }else{
-                if(this.a){
-                    this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]);
-                }
-                if(this.s){
-                    this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]);
-                }
-                if(this.sk){
-                    this.v.skewFromAxis(-this.sk.v,this.sa.v);
-                }
-                if(this.r){
-                    this.v.rotate(-this.r.v);
-                }else{
-                    this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
-                }
-                if(this.data.p.s){
-                    if(data.p.z) {
-                        this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                    } else {
-                        this.v.translate(this.px.v, this.py.v, 0);
-                    }
-                }else{
-                    this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-                }
-            }
-            Object.defineProperty(this, "position", { get: positionGetter});
-            Object.defineProperty(this, "xPosition", { get: xPositionGetter});
-            Object.defineProperty(this, "yPosition", { get: yPositionGetter});
-            Object.defineProperty(this, "orientation", { get: orientationGetter});
-            Object.defineProperty(this, "anchorPoint", { get: anchorGetter});
-            Object.defineProperty(this, "rotation", { get: rotationGetter});
-            Object.defineProperty(this, "scale", { get: scaleGetter});
-            Object.defineProperty(this, "opacity", { get: opacityGetter});
-            Object.defineProperty(this, "skew", { get: skewGetter});
-            Object.defineProperty(this, "skewAxis", { get: skewAxisGetter});
-        }
-    }());
-
-    function getProp(elem,data,type, mult, arr) {
-        var p;
-        if(type === 2){
-            p = new TransformProperty(elem, data, arr);
-        } else if(data.a === 0){
-            if(type === 0) {
-                p = new ValueProperty(elem,data,mult);
-            } else {
-                p = new MultiDimensionalProperty(elem,data, mult);
-            }
-        } else if(data.a === 1){
-            if(type === 0) {
-                p = new KeyframedValueProperty(elem,data,mult);
-            } else {
-                p = new KeyframedMultidimensionalProperty(elem,data, mult);
-            }
-        } else if(!data.k.length){
-            p = new ValueProperty(elem,data, mult);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult);
-                    break;
-            }
-        }
-        if(p.k){
-            arr.push(p);
-        }
-        return p;
-    }
-
-    var getGradientProp = (function(){
-
-        function getValue(forceRender){
-            this.prop.getValue();
-            this.cmdf = false;
-            this.omdf = false;
-            if(this.prop.mdf || forceRender){
-                var i, len = this.data.p*4;
-                var mult, val;
-                for(i=0;i<len;i+=1){
-                    mult = i%4 === 0 ? 100 : 255;
-                    val = Math.round(this.prop.v[i]*mult);
-                    if(this.c[i] !== val){
-                        this.c[i] = val;
-                        this.cmdf = true;
-                    }
-                }
-                if(this.o.length){
-                    len = this.prop.v.length;
-                    for(i=this.data.p*4;i<len;i+=1){
-                        mult = i%2 === 0 ? 100 : 1;
-                        val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                        if(this.o[i-this.data.p*4] !== val){
-                            this.o[i-this.data.p*4] = val;
-                            this.omdf = true;
-                        }
-                    }
-                }
-            }
-
-        }
-
-        function gradientProp(elem,data,arr){
-            this.prop = getProp(elem,data.k,1,null,[]);
-            this.data = data;
-            this.k = this.prop.k;
-            this.c = Array.apply(null,{length:data.p*4});
-            var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-            this.o = Array.apply(null,{length:cLength});
-            this.cmdf = false;
-            this.omdf = false;
-            this.getValue = getValue;
-            if(this.prop.k){
-                arr.push(this);
-            }
-            this.getValue(true);
-        }
-
-        return function getGradientProp(elem,data,arr){
-            return new gradientProp(elem,data,arr);
-        }
-    }());
-
-
-
-
-    var DashProperty = (function(){
-
-        function processKeys(forceRender){
-            var i = 0, len = this.dataProps.length;
-
-            if(this.elem.globalData.frameId === this.frameId && !forceRender){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-            while(i<len){
-                if(this.dataProps[i].p.mdf){
-                    this.mdf = true;
-                    break;
-                }
-                i+=1;
-            }
-            if(this.mdf || forceRender){
-                if(this.renderer === 'svg') {
-                    this.dasharray = '';
-                }
-                for(i=0;i<len;i+=1){
-                    if(this.dataProps[i].n != 'o'){
-                        if(this.renderer === 'svg') {
-                            this.dasharray += ' ' + this.dataProps[i].p.v;
-                        }else{
-                            this.dasharray[i] = this.dataProps[i].p.v;
-                        }
-                    }else{
-                        this.dashoffset = this.dataProps[i].p.v;
-                    }
-                }
-            }
-        }
-
-        return function(elem, data,renderer, dynamicProperties){
-            this.elem = elem;
-            this.frameId = -1;
-            this.dataProps = new Array(data.length);
-            this.renderer = renderer;
-            this.mdf = false;
-            this.k = false;
-            if(this.renderer === 'svg'){
-                this.dasharray = '';
-            }else{
-
-                this.dasharray = new Array(data.length - 1);
-            }
-            this.dashoffset = 0;
-            var i, len = data.length, prop;
-            for(i=0;i<len;i+=1){
-                prop = PropertyFactory.getProp(elem,data[i].v,0, 0, dynamicProperties);
-                this.k = prop.k ? true : this.k;
-                this.dataProps[i] = {n:data[i].n,p:prop};
-            }
-            this.getValue = processKeys;
-            if(this.k){
-                dynamicProperties.push(this);
-            }else{
-                this.getValue(true);
-            }
-
-        }
-    }());
-
-    function getDashProp(elem, data,renderer, dynamicProperties) {
-        return new DashProperty(elem, data,renderer, dynamicProperties);
-    };
-
-    var TextSelectorProp = (function(){
-        var max = Math.max;
-        var min = Math.min;
-        var floor = Math.floor;
-        function updateRange(){
-            if(this.dynamicProperties.length){
-                var i, len = this.dynamicProperties.length;
-                for(i=0;i<len;i+=1){
-                    this.dynamicProperties[i].getValue();
-                    if(this.dynamicProperties[i].mdf){
-                        this.mdf = true;
-                    }
-                }
-            }
-            var totalChars = this.data.totalChars;
-            var divisor = this.data.r === 2 ? 1 : 100/totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-
-        function getMult(ind){
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var easer = BezierFactory.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get;
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if(type == 2){
-                if(e === s){
-                    mult = ind >= e ? 1 : 0;
-                }else{
-                    mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
-                }
-                mult = easer(mult);
-            }else if(type == 3){
-                if(e === s){
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
-                }
-
-                mult = easer(mult);
-            }else if(type == 4){
-                if(e === s){
-                    mult = 0;
-                }else{
-                    mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
-                    if(mult<.5){
-                        mult *= 2;
-                    }else{
-                        mult = 1 - 2*(mult-0.5);
-                    }
-                }
-                mult = easer(mult);
-            }else if(type == 5){
-                if(e === s){
-                    mult = 0;
-                }else{
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0,ind+0.5-s),e-s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x*x)/(a*a));
-                }
-                mult = easer(mult);
-            }else if(type == 6){
-                if(e === s){
-                    mult = 0;
-                }else{
-                    ind = min(max(0,ind+0.5-s),e-s);
-                    mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind)/(e-s)))))/2;
-                    /*
-                     ind = Math.min(Math.max(s,ind),e-1);
-                     mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind-s)/(e-1-s)))))/2;
-                     mult = Math.max(mult,(1/(e-1-s))/(e-1-s));*/
-                }
-                mult = easer(mult);
-            }else {
-                if(ind >= floor(s)){
-                    if(ind-s < 0){
-                        mult = 1 - (s - ind);
-                    }else{
-                        mult = max(0,min(e-ind,1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        }
-
-        return function TextSelectorProp(elem,data, arr){
-            this.mdf = false;
-            this.k = false;
-            this.data = data;
-            this.dynamicProperties = [];
-            this.getValue = updateRange;
-            this.getMult = getMult;
-            this.comp = elem.comp;
-            this.finalS = 0;
-            this.finalE = 0;
-            this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this.dynamicProperties);
-            if('e' in data){
-                this.e = PropertyFactory.getProp(elem,data.e,0,0,this.dynamicProperties);
-            }else{
-                this.e = {v:data.r === 2 ? data.totalChars : 100};
-            }
-            this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this.dynamicProperties);
-            this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this.dynamicProperties);
-            this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this.dynamicProperties);
-            this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this.dynamicProperties);
-            if(this.dynamicProperties.length){
-                arr.push(this);
-            }else{
-                this.getValue();
-            }
-        }
-    }());
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
-    };
-
-    var ob = {};
-    ob.getProp = getProp;
-    ob.getDashProp = getDashProp;
-    ob.getTextSelectorProp = getTextSelectorProp;
-    ob.getGradientProp = getGradientProp;
-    return ob;
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = Array.apply(null,{length:this._maxLength});
-	this.o = Array.apply(null,{length:this._maxLength});
-	this.i = Array.apply(null,{length:this._maxLength});
-};
-
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	while(len > this._maxLength){
-		this.doubleArrayLength();
-	}
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newPoint();
-		this.o[i] = point_pool.newPoint();
-		this.i[i] = point_pool.newPoint();
-		i += 1;
-	}
-	this._length = len;
-};
-
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(Array.apply(null,{length:this._maxLength}))
-	this.i = this.i.concat(Array.apply(null,{length:this._maxLength}))
-	this.o = this.o.concat(Array.apply(null,{length:this._maxLength}))
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newPoint();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-var ShapePropertyFactory = (function(){
-
-    var initFrame = -999999;
-
-    function interpolateShape() {
-        if(this.elem.globalData.frameId === this.frameId){
-            return;
-        }
-        this.mdf = false;
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        if(!((this.lastFrame !== initFrame && ((this.lastFrame < this.keyframes[0].t-this.offsetTime && frameNum < this.keyframes[0].t-this.offsetTime) || (this.lastFrame > this.keyframes[this.keyframes.length - 1].t-this.offsetTime && frameNum > this.keyframes[this.keyframes.length - 1].t-this.offsetTime))))){
-            var keyPropS,keyPropE,isHold;
-            if(frameNum < this.keyframes[0].t-this.offsetTime){
-                keyPropS = this.keyframes[0].s[0];
-                isHold = true;
-                this._lastIndex = 0;
-            }else if(frameNum >= this.keyframes[this.keyframes.length - 1].t-this.offsetTime){
-                if(this.keyframes[this.keyframes.length - 2].h === 1){
-                    keyPropS = this.keyframes[this.keyframes.length - 1].s[0];
-                }else{
-                    keyPropS = this.keyframes[this.keyframes.length - 2].e[0];
-                }
-                isHold = true;
-            }else{
-                var i = this.lastFrame < initFrame ? this._lastIndex : 0;
-                var len = this.keyframes.length- 1,flag = true,keyData,nextKeyData, j, jLen, k, kLen;
-                while(flag){
-                    keyData = this.keyframes[i];
-                    nextKeyData = this.keyframes[i+1];
-                    if((nextKeyData.t - this.offsetTime) > frameNum){
-                        break;
-                    }
-                    if(i < len - 1){
-                        i += 1;
-                    }else{
-                        flag = false;
-                    }
-                }
-                isHold = keyData.h === 1;
-                this._lastIndex = i;
-
-                var perc;
-                if(!isHold){
-                    if(frameNum >= nextKeyData.t-this.offsetTime){
-                        perc = 1;
-                    }else if(frameNum < keyData.t-this.offsetTime){
-                        perc = 0;
-                    }else{
-                        var fnc;
-                        if(keyData.__fnct){
-                            fnc = keyData.__fnct;
-                        }else{
-                            fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                            keyData.__fnct = fnc;
-                        }
-                        perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                    }
-                    keyPropE = keyData.e[0];
-                }
-                keyPropS = keyData.s[0];
-            }
-            jLen = this.v._length;
-            kLen = keyPropS.i[0].length;
-            var hasModified = false;
-            var vertexValue;
-            for(j=0;j<jLen;j+=1){
-                for(k=0;k<kLen;k+=1){
-                    if(isHold){
-                        vertexValue = keyPropS.i[j][k];
-                        if(this.v.i[j][k] !== vertexValue){
-                            this.v.i[j][k] = vertexValue;
-                            this.pv.i[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.o[j][k];
-                        if(this.v.o[j][k] !== vertexValue){
-                            this.v.o[j][k] = vertexValue;
-                            this.pv.o[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.v[j][k];
-                        if(this.v.v[j][k] !== vertexValue){
-                            this.v.v[j][k] = vertexValue;
-                            this.pv.v[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                    }else{
-                        vertexValue = keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                        if(this.v.i[j][k] !== vertexValue){
-                            this.v.i[j][k] = vertexValue;
-                            this.pv.i[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                        if(this.v.o[j][k] !== vertexValue){
-                            this.v.o[j][k] = vertexValue;
-                            this.pv.o[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                        if(this.v.v[j][k] !== vertexValue){
-                            this.v.v[j][k] = vertexValue;
-                            this.pv.v[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                    }
-                }
-            }
-            this.mdf = hasModified;
-            this.v.c = keyPropS.c;
-            this.paths = this.localShapeCollection;
-        }
-
-        this.lastFrame = frameNum;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function getShapeValue(){
-        return this.v;
-    }
-
-    function resetShape(){
-        this.paths = this.localShapeCollection;
-        if(!this.k){
-            this.mdf = false;
-        }
-    }
-
-    function ShapeProperty(elem, data, type){
-        this.comp = elem.comp;
-        this.k = false;
-        this.mdf = false;
-        this.v = shape_pool.newShape();
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v.v = pathData.v;
-        this.v.i = pathData.i;
-        this.v.o = pathData.o;
-        this.v.c = pathData.c;
-        this.v._length = this.v.v.length;
-        this.getValue = getShapeValue;
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-    }
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.offsetTime = elem.data.st;
-        this._lastIndex = 0;
-        this.getValue = interpolateShape;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newShape();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-    }
-
-    var EllShapeProperty = (function(){
-
-        var cPoint = roundCorner;
-
-        function convertEllToPath(){
-            var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-            if(this.d !== 3){
-                this.v.v[0][0] = p0;
-                this.v.v[0][1] = p1-s1;
-                this.v.v[1][0] = p0 + s0;
-                this.v.v[1][1] = p1;
-                this.v.v[2][0] = p0;
-                this.v.v[2][1] = p1+s1;
-                this.v.v[3][0] = p0 - s0;
-                this.v.v[3][1] = p1;
-                this.v.i[0][0] = p0 - s0*cPoint;
-                this.v.i[0][1] = p1 - s1;
-                this.v.i[1][0] = p0 + s0;
-                this.v.i[1][1] = p1 - s1*cPoint;
-                this.v.i[2][0] = p0 + s0*cPoint;
-                this.v.i[2][1] = p1 + s1;
-                this.v.i[3][0] = p0 - s0;
-                this.v.i[3][1] = p1 + s1*cPoint;
-                this.v.o[0][0] = p0 + s0*cPoint;
-                this.v.o[0][1] = p1 - s1;
-                this.v.o[1][0] = p0 + s0;
-                this.v.o[1][1] = p1 + s1*cPoint;
-                this.v.o[2][0] = p0 - s0*cPoint;
-                this.v.o[2][1] = p1 + s1;
-                this.v.o[3][0] = p0 - s0;
-                this.v.o[3][1] = p1 - s1*cPoint;
-            }else{
-                this.v.v[0][0] = p0;
-                this.v.v[0][1] = p1-s1;
-                this.v.v[1][0] = p0 - s0;
-                this.v.v[1][1] = p1;
-                this.v.v[2][0] = p0;
-                this.v.v[2][1] = p1+s1;
-                this.v.v[3][0] = p0 + s0;
-                this.v.v[3][1] = p1;
-                this.v.i[0][0] = p0 + s0*cPoint;
-                this.v.i[0][1] = p1 - s1;
-                this.v.i[1][0] = p0 - s0;
-                this.v.i[1][1] = p1 - s1*cPoint;
-                this.v.i[2][0] = p0 - s0*cPoint;
-                this.v.i[2][1] = p1 + s1;
-                this.v.i[3][0] = p0 + s0;
-                this.v.i[3][1] = p1 + s1*cPoint;
-                this.v.o[0][0] = p0 - s0*cPoint;
-                this.v.o[0][1] = p1 - s1;
-                this.v.o[1][0] = p0 - s0;
-                this.v.o[1][1] = p1 + s1*cPoint;
-                this.v.o[2][0] = p0 + s0*cPoint;
-                this.v.o[2][1] = p1 + s1;
-                this.v.o[3][0] = p0 + s0;
-                this.v.o[3][1] = p1 - s1*cPoint;
-            }
-        }
-
-        function processKeys(frameNum){
-            var i, len = this.dynamicProperties.length;
-            if(this.elem.globalData.frameId === this.frameId){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-
-            for(i=0;i<len;i+=1){
-                this.dynamicProperties[i].getValue(frameNum);
-                if(this.dynamicProperties[i].mdf){
-                    this.mdf = true;
-                }
-            }
-            if(this.mdf){
-                this.convertEllToPath();
-            }
-        }
-
-        return function EllShapeProperty(elem,data) {
-            /*this.v = {
-                v: Array.apply(null,{length:4}),
-                i: Array.apply(null,{length:4}),
-                o: Array.apply(null,{length:4}),
-                c: true
-            };*/
-            this.v = shape_pool.newShape();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.dynamicProperties = [];
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.mdf = false;
-            this.getValue = processKeys;
-            this.convertEllToPath = convertEllToPath;
-            this.reset = resetShape;
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this.dynamicProperties);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.convertEllToPath();
-            }
-        }
-    }());
-
-    var StarShapeProperty = (function() {
-
-        function convertPolygonToPath(){
-            var numPts = Math.floor(this.pt.v);
-            var angle = Math.PI*2/numPts;
-            /*this.v.v.length = numPts;
-            this.v.i.length = numPts;
-            this.v.o.length = numPts;*/
-            var rad = this.or.v;
-            var roundness = this.os.v;
-            var perimSegment = 2*Math.PI*rad/(numPts*4);
-            var i, currentAng = -Math.PI/ 2;
-            var dir = this.data.d === 3 ? -1 : 1;
-            currentAng += this.r.v;
-            this.v._length = 0;
-            for(i=0;i<numPts;i+=1){
-                var x = rad * Math.cos(currentAng);
-                var y = rad * Math.sin(currentAng);
-                var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                x +=  + this.p.v[0];
-                y +=  + this.p.v[1];
-                this.v.setTripleAt(x,y,x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir,x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir, i, true);
-                /*this.v.v[i] = [x,y];
-                this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
-                this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];*/
-                currentAng += angle*dir;
-            }
-            this.paths.length = 0;
-            this.paths[0] = this.v;
-        }
-
-        function convertStarToPath() {
-            var numPts = Math.floor(this.pt.v)*2;
-            var angle = Math.PI*2/numPts;
-            /*this.v.v.length = numPts;
-            this.v.i.length = numPts;
-            this.v.o.length = numPts;*/
-            var longFlag = true;
-            var longRad = this.or.v;
-            var shortRad = this.ir.v;
-            var longRound = this.os.v;
-            var shortRound = this.is.v;
-            var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-            var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-            var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-            currentAng += this.r.v;
-            var dir = this.data.d === 3 ? -1 : 1;
-            this.v._length = 0;
-            for(i=0;i<numPts;i+=1){
-                rad = longFlag ? longRad : shortRad;
-                roundness = longFlag ? longRound : shortRound;
-                perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                var x = rad * Math.cos(currentAng);
-                var y = rad * Math.sin(currentAng);
-                var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                x +=  + this.p.v[0];
-                y +=  + this.p.v[1];
-                this.v.setTripleAt(x,y,x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir,x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir, i, true);
-
-                /*this.v.v[i] = [x,y];
-                this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
-                this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                this.v._length = numPts;*/
-                longFlag = !longFlag;
-                currentAng += angle*dir;
-            }
-        }
-
-        function processKeys() {
-            if(this.elem.globalData.frameId === this.frameId){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-            var i, len = this.dynamicProperties.length;
-
-            for(i=0;i<len;i+=1){
-                this.dynamicProperties[i].getValue();
-                if(this.dynamicProperties[i].mdf){
-                    this.mdf = true;
-                }
-            }
-            if(this.mdf){
-                this.convertToPath();
-            }
-        }
-
-        return function StarShapeProperty(elem,data) {
-            /*this.v = {
-                v: [],
-                i: [],
-                o: [],
-                c: true
-            };*/
-            this.v = shape_pool.newShape();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.dynamicProperties = [];
-            this.mdf = false;
-            this.getValue = processKeys;
-            this.reset = resetShape;
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this.dynamicProperties);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this.dynamicProperties);
-                this.convertToPath = convertStarToPath;
-            } else {
-                this.convertToPath = convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this.dynamicProperties);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this.dynamicProperties);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this.dynamicProperties);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this.dynamicProperties);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.convertToPath();
-            }
-        }
-    }());
-
-    var RectShapeProperty = (function() {
-        function processKeys(frameNum){
-            if(this.elem.globalData.frameId === this.frameId){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-            var i, len = this.dynamicProperties.length;
-
-            for(i=0;i<len;i+=1){
-                this.dynamicProperties[i].getValue(frameNum);
-                if(this.dynamicProperties[i].mdf){
-                    this.mdf = true;
-                }
-            }
-            if(this.mdf){
-                this.convertRectToPath();
-            }
-
-        }
-
-        function convertRectToPath(){
-            var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-            var round = bm_min(v0,v1,this.r.v);
-            var cPoint = round*(1-roundCorner);
-            this.v._length = 0;
-
-            if(this.d === 2 || this.d === 1) {
-                this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                if(round!== 0){
-                    this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                    this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                    this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                    this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                    this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                    this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                } else {
-                    this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                    this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                }
-            }else{
-                this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                if(round!== 0){
-                    this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                    this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                    this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                    this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                    this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                    this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                    this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                } else {
-                    this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                    this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                    this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                }
-            }
-        }
-
-        return function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newShape();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.dynamicProperties = [];
-            this.mdf = false;
-            this.getValue = processKeys;
-            this.convertRectToPath = convertRectToPath;
-            this.reset = resetShape;
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this.dynamicProperties);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this.dynamicProperties);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.convertRectToPath();
-            }
-        }
-    }());
-
-    function getShapeProp(elem,data,type, arr){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(dataProp.a === 1 || keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            arr.push(prop);
-        }
-        return prop;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data, dynamicProperties){
-        return new modifiers[nm](elem, data, dynamicProperties);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if(!this.closed){
-        this.shapes.push({shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()});
-        this.addShapeToModifier(data.sh);
-    }
-}
-ShapeModifier.prototype.init = function(elem,data,dynamicProperties){
-    this.elem = elem;
-    this.frameId = -1;
-    this.shapes = [];
-    this.dynamicProperties = [];
-    this.mdf = false;
-    this.closed = false;
-    this.k = false;
-    this.isTrimming = false;
-    this.comp = elem.comp;
-    this.initModifierProperties(elem,data);
-    if(this.dynamicProperties.length){
-        this.k = true;
-        dynamicProperties.push(this);
-    }else{
-        this.getValue(true);
-    }
-}
-function TrimModifier(){};
-extendPrototype(ShapeModifier,TrimModifier);
-TrimModifier.prototype.processKeys = function(forceRender){
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
-    }
-    this.mdf = forceRender ? true : false;
-    this.frameId = this.elem.globalData.frameId;
-    var i, len = this.dynamicProperties.length;
-
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        if(this.dynamicProperties[i].mdf){
-            this.mdf = true;
-        }
-    }
-    if(this.mdf || forceRender){
-        var o = (this.o.v%360)/360;
-        if(o < 0){
-            o += 1;
-        }
-        var s = this.s.v + o;
-        var e = this.e.v + o;
-        if(s == e){
-
-        }
-        if(s>e){
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        this.sValue = s;
-        this.eValue = e;
-        this.oValue = o;
-    }
-}
-TrimModifier.prototype.initModifierProperties = function(elem,data){
-    this.sValue = 0;
-    this.eValue = 0;
-    this.oValue = 0;
-    this.getValue = this.processKeys;
-    this.s = PropertyFactory.getProp(elem,data.s,0,0.01,this.dynamicProperties);
-    this.e = PropertyFactory.getProp(elem,data.e,0,0.01,this.dynamicProperties);
-    this.o = PropertyFactory.getProp(elem,data.o,0,0,this.dynamicProperties);
-    this.m = data.m;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-};
-
-TrimModifier.prototype.getSegmentsLength = function(shapeData){
-    var closed = shapeData.c;
-    var pathV = shapeData.v;
-    var pathO = shapeData.o;
-    var pathI = shapeData.i;
-    var i, len = shapeData._length;
-    var lengths = [];
-    var totalLength = 0;
-    for(i=0;i<len-1;i+=1){
-        lengths[i] = bez.getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-        totalLength += lengths[i].addedLength;
-    }
-    if(closed){
-        lengths[i] = bez.getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-        totalLength += lengths[i].addedLength;
-    }
-    return {lengths:lengths,totalLength:totalLength};
-}
-
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
-    var segments = []
-    if(e <= 1){
-        segments.push({
-            s: s,
-            e: e
-        })
-    }else if(s >= 1){
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        })
-    }else{
-        segments.push({
-            s: s,
-            e: 1
-        })
-        segments.push({
-            s: 0,
-            e: e - 1
-        })
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
-    for(i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
-        } else {
-            var shapeS, shapeE;
-            if(segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
-        }
-    }
-    if(!shapeSegments.length){
-        shapeSegments.push([0,0]);
-    }
-    return shapeSegments;
-}
-
-TrimModifier.prototype.processShapes = function(firstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var s = this.sValue;
-    var e = this.eValue;
-    var pathsData,pathData, totalShapeLength, totalModifierLength = 0;
-
-    if(e === s){
-        for(i=0;i<len;i+=1){
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape.mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-        }
-    } else if(!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            if(!shapeData.shape.mdf && !this.mdf && !firstFrame && this.m !== 2){
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if(!shapeData.shape.mdf && shapeData.pathsData){
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = [];
-                    for(j=0;j<jLen;j+=1){
-                        pathData = this.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape.mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0;
-        var j, jLen;
-        for(i = len - 1; i >= 0; i -= 1){
-            shapeData = this.shapes[i];
-            if (shapeData.shape.mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                if(this.m === 2 && len > 1) {
-                    var edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]]
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if(shapeE <= 1){
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        })
-                    }else if(shapeS >= 1){
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        })
-                    }else{
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        })
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength*(shapeE - 1)
-                        })
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        var lastPos;
-                        if(segments.length > 1){
-                            if(shapeData.shape.v.c){
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData,segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData,segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if(this.mdf){
-        for(i=0;i<len;i+=1){
-            this.shapes[i].shape.mdf = true;
-        }
-    }
-    if(!this.dynamicProperties.length){
-        this.mdf = false;
-    }
-}
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for(i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i])
-    }
-}
-
-TrimModifier.prototype.addSegment = function(pt1,pt2,pt3,pt4,shapePath,pos, newShape) {
-    /*console.log(pt1, 'vertex: v, at: ', pos);
-    console.log(pt2, 'vertex: o, at: ', pos);
-    console.log(pt3, 'vertex: i, at: ', pos + 1);
-    console.log(pt4, 'vertex: v, at: ', pos + 1);
-    console.log('newShape: ', newShape);*/
-    shapePath.setXYAt(pt2[0],pt2[1],'o',pos);
-    shapePath.setXYAt(pt3[0],pt3[1],'i',pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0],pt1[1],'v',pos);
-    }
-    shapePath.setXYAt(pt4[0],pt4[1],'v',pos + 1);
-}
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath){
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
-    var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if(!shapePath){
-        shapePath = shape_pool.newShape();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
-    }
-    shapes.push(shapePath);
-    for(i=0;i<len;i+=1){
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for(j=1;j<jLen;j+=1){
-            currentLengthData = lengths[j-1];
-            if(addedLength + currentLengthData.addedLength < shapeSegment.s){
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e){
-                shapePath.c = false;
-                break;
-            } else {
-                if(shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength){
-                    this.addSegment(shapePaths[i].v[j-1],shapePaths[i].o[j-1],shapePaths[i].i[j],shapePaths[i].v[j],shapePath,segmentCount,newShape);
-                    newShape = false;
-                } else {
-                    segment = bez.getNewSegment(shapePaths[i].v[j-1],shapePaths[i].v[j],shapePaths[i].o[j-1],shapePaths[i].i[j], (shapeSegment.s - addedLength)/currentLengthData.addedLength,(shapeSegment.e - addedLength)/currentLengthData.addedLength, lengths[j-1]);
-                    this.addSegment(segment.pt1,segment.pt3,segment.pt4,segment.pt2,shapePath,segmentCount,newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if(shapePaths[i].c){
-            currentLengthData = lengths[j-1];
-            if(addedLength <= shapeSegment.e){
-                var segmentLength = lengths[j-1].addedLength;
-                if(shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength){
-                    this.addSegment(shapePaths[i].v[j-1],shapePaths[i].o[j-1],shapePaths[i].i[0],shapePaths[i].v[0],shapePath,segmentCount,newShape);
-                    newShape = false;
-                }else{
-                    segment = bez.getNewSegment(shapePaths[i].v[j-1],shapePaths[i].v[0],shapePaths[i].o[j-1],shapePaths[i].i[0], (shapeSegment.s - addedLength)/segmentLength,(shapeSegment.e - addedLength)/segmentLength, lengths[j-1]);
-                    this.addSegment(segment.pt1,segment.pt3,segment.pt4,segment.pt2,shapePath,segmentCount,newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if(shapePath._length){
-            shapePath.setXYAt(shapePath.v[initPos][0],shapePath.v[initPos][1],'i',initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0],shapePath.v[shapePath._length - 1][1],'o',shapePath._length - 1);
-        }
-        if(addedLength > shapeSegment.e){
-            break;
-        }
-        if(i<len-1){
-            shapePath = shape_pool.newShape();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
-    }
-    return shapes;
-
-}
-
-
-ShapeModifiers.registerModifier('tm',TrimModifier);
-function RoundCornersModifier(){};
-extendPrototype(ShapeModifier,RoundCornersModifier);
-RoundCornersModifier.prototype.processKeys = function(forceRender){
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
-    }
-    this.mdf = forceRender ? true : false;
-    this.frameId = this.elem.globalData.frameId;
-    var i, len = this.dynamicProperties.length;
-
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        if(this.dynamicProperties[i].mdf){
-            this.mdf = true;
-        }
-    }
-}
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this.dynamicProperties);
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-};
-
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newShape();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                /*newV = [currentV[0]+(closerV[0]-currentV[0])*newPosPerc,currentV[1]-(currentV[1]-closerV[1])*newPosPerc];
-                newI = newV;
-                newO = [newV[0]-(newV[0]-currentV[0])*roundCorner,newV[1]-(newV[1]-currentV[1])*roundCorner];
-                cloned_path.v[index] = newV;
-                cloned_path.i[index] = newI;
-                cloned_path.o[index] = newO;*/
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-
-                /*newV = [currentV[0]+(closerV[0]-currentV[0])*newPosPerc,currentV[1]+(closerV[1]-currentV[1])*newPosPerc];
-                newI = [newV[0]-(newV[0]-currentV[0])*roundCorner,newV[1]-(newV[1]-currentV[1])*roundCorner];
-                newO = newV;
-                cloned_path.v[index] = newV;
-                cloned_path.i[index] = newI;
-                cloned_path.o[index] = newO;*/
-                index += 1;
-            }
-        } else {
-            /*cloned_path.v[index] = path.v[i];
-            cloned_path.o[index] = path.o[i];
-            cloned_path.i[index] = path.i[i];*/
-            cloned_path.setTripleAt(path.v[i][0],path.v[i][1],path.o[i][0],path.o[i][1],path.i[i][0],path.i[i][1],index);
-            index += 1;
-        }
-    }
-    return cloned_path;
-}
-
-RoundCornersModifier.prototype.processShapes = function(firstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape.mdf && !this.mdf && !firstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape.mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
-        }
-
-    }
-    if(!this.dynamicProperties.length){
-        this.mdf = false;
-    }
-}
-
-
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function RepeaterModifier(){};
-extendPrototype(ShapeModifier,RepeaterModifier);
-RepeaterModifier.prototype.processKeys = function(forceRender){
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
-    }
-    this.mdf = forceRender ? true : false;
-    this.frameId = this.elem.globalData.frameId;
-    var i, len = this.dynamicProperties.length;
-
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        if(this.dynamicProperties[i].mdf){
-            this.mdf = true;
-        }
-    }
-};
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this.dynamicProperties);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this.dynamicProperties);
-    this.tr = PropertyFactory.getProp(elem,data.tr,2,null,this.dynamicProperties);
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
-};
-
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-}
-
-RepeaterModifier.prototype.processShapes = function(firstFrame){
-    if(!this.dynamicProperties.length){
-        this.mdf = false;
-    }
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var shapeData, localShapeCollection, currentPath;
-    var copies = Math.ceil(this.c.v);
-    var offset = this.o.v;
-    var offsetModulo = offset%1;
-    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-    var k, pathData, shapeCollection, shapeCollectionList;
-    var tMat = this.tr.v.props;
-    var pProps = this.pMatrix.props;
-    var rProps = this.rMatrix.props;
-    var sProps = this.sMatrix.props;
-    var iteration = 0;
-    var l, lLen, tProps,transformers, maxLvl;
-    for(i=0;i<len;i+=1){
-        shapeData = this.shapes[i];
-        localShapeCollection = shapeData.localShapeCollection;
-        if(!(!shapeData.shape.mdf && !this.mdf && !firstFrame)){
-            localShapeCollection.releaseShapes();
-            shapeData.shape.mdf = true;
-            shapeCollection = shapeData.shape.paths;
-            shapeCollectionList = shapeCollection.shapes;
-            jLen = shapeCollection._length;
-            iteration = 0;
-            this.pMatrix.reset();
-            this.rMatrix.reset();
-            this.sMatrix.reset();
-            this.tMatrix.reset();
-            this.matrix.reset();
-
-            if(offset > 0) {
-                while(iteration<roundOffset){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                    iteration += 1;
-                }
-                if(offsetModulo){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                    iteration += offsetModulo;
-                }
-            } else if(roundOffset < 0) {
-                while(iteration>roundOffset){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                    iteration -= 1;
-                }
-                if(offsetModulo){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                    iteration -= offsetModulo;
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                currentPath = shapeCollectionList[j];
-                for(k=0;k<copies;k+=1) {
-                    if(k !== 0) {
-                        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                    }
-                    if(shapeData.data.transformers) {
-                        shapeData.data.lvl = 0;
-                        maxLvl = 0;
-                        lLen = shapeData.data.elements.length;
-                        for(l = 0; l < lLen; l += 1) {
-                            maxLvl = Math.max(maxLvl, shapeData.data.elements[l].st.lvl);
-                        } 
-                        transformers = shapeData.data.transformers;
-                        lLen = transformers.length;
-                        for(l = lLen - 1; l >= maxLvl; l -= 1) {
-                            tProps = transformers[l].mProps.v.props;
-                            this.matrix.transform(tProps[0],tProps[1],tProps[2],tProps[3],tProps[4],tProps[5],tProps[6],tProps[7],tProps[8],tProps[9],tProps[10],tProps[11],tProps[12],tProps[13],tProps[14],tProps[15]);
-                        }
-                    }
-                    if(iteration !== 0){
-                        this.matrix.transform(rProps[0],rProps[1],rProps[2],rProps[3],rProps[4],rProps[5],rProps[6],rProps[7],rProps[8],rProps[9],rProps[10],rProps[11],rProps[12],rProps[13],rProps[14],rProps[15]);
-                        this.matrix.transform(sProps[0],sProps[1],sProps[2],sProps[3],sProps[4],sProps[5],sProps[6],sProps[7],sProps[8],sProps[9],sProps[10],sProps[11],sProps[12],sProps[13],sProps[14],sProps[15]);
-                        this.matrix.transform(pProps[0],pProps[1],pProps[2],pProps[3],pProps[4],pProps[5],pProps[6],pProps[7],pProps[8],pProps[9],pProps[10],pProps[11],pProps[12],pProps[13],pProps[14],pProps[15]);
-                    }
-                    localShapeCollection.addShape(this.processPath(currentPath, this.matrix));
-                    this.matrix.reset();
-                    iteration += 1;
-                }
-            }
-        }
-        shapeData.shape.paths = localShapeCollection;
-    }
-};
-
-RepeaterModifier.prototype.processPath = function(path, transform) {
-    var clonedPath = shape_pool.clone(path, transform);
-    return clonedPath;
-};
-
-
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = Array.apply(null,{length:this._maxLength});
-};
-
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(Array.apply(null,{length:this._maxLength}));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
-};
-
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
-};
-var ImagePreloader = (function(){
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-        }
-    }
-
-    function getAssetsPath(assetData){
-        var path = '';
-        if(this.assetsPath){
-            var imagePath = assetData.p;
-            if(imagePath.indexOf('images/') !== -1){
-                imagePath = imagePath.split('/')[1];
-            }
-            path = this.assetsPath + imagePath;
-        } else {
-            path = this.path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function loadImage(path){
-        var img = document.createElement('img');
-        img.addEventListener('load', imageLoaded.bind(this), false);
-        img.addEventListener('error', imageLoaded.bind(this), false);
-        img.src = path;
-    }
-    function loadAssets(assets){
-        this.totalAssets = assets.length;
-        var i;
-        for(i=0;i<this.totalAssets;i+=1){
-            if(!assets[i].layers){
-                loadImage.bind(this)(getAssetsPath.bind(this)(assets[i]));
-                this.totalImages += 1;
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    return function ImagePreloader(){
-        this.loadAssets = loadAssets;
-        this.setAssetsPath = setAssetsPath;
-        this.setPath = setPath;
-        this.assetsPath = '';
-        this.path = '';
-        this.totalAssets = 0;
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-    }
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	}
-	if (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = document.createElementNS(svgNS,'filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 0 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}())
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(Array.apply(null,{length:arr.length}))
-	}
-
-	return {
-		double: double
-	}
-}());
-var point_pool = (function(){
-	var ob = {
-		newPoint: newPoint,
-		release: release
-		/*,getLength:function(){return _length}
-		,getCont:function(){return cont}*/
-	}
-
-	var _length = 0;
-	var _maxLength = 8;
-	var pool = Array.apply(null,{length:_maxLength});
-
-	//var cont = 0;
-
-	function newPoint(){
-		//window.bm_newPoint = window.bm_newPoint ? window.bm_newPoint + 1 : 1;
-		var point;
-		if(_length){
-			_length -= 1;
-			point = pool[_length];
-			//window.bm_reuse = window.bm_reuse ? window.bm_reuse + 1 : 1;
-		} else {
-			point = [0.1,0.1];
-			//cont++;
-			//console.log('new');
-			//window.bm_new = window.bm_new ? window.bm_new + 1 : 1;
-			//point._tst = cont++;
-		}
-		return point;
-	}
-
-	function release(point) {
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = point;
-		_length += 1;
-		//window.bm_release = window.bm_release ? window.bm_release + 1 : 1;
-		//console.log('release');
-	}
-
-
-	return ob;
-}());
-var shape_pool = (function(){
-	var ob = {
-		clone: clone,
-		newShape: newShape,
-		release: release,
-		releaseArray: releaseArray
-	}
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = Array.apply(null,{length:_maxLength});
-
-	function newShape(){
-		var shapePath;
-		if(_length){
-			_length -= 1;
-			shapePath = pool[_length];
-		} else {
-			shapePath = new ShapePath();
-		}
-		return shapePath;
-	}
-
-	function release(shapePath) {
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-		pool[_length] = shapePath;
-		_length += 1;
-	}
-
-	function releaseArray(shapePathsCollection, length) {
-		while(length--) {
-			release(shapePathsCollection[length]);
-		}
-	}
-
-	function clone(shape, transform) {
-		var i, len = shape._length;
-		var cloned = newShape();
-		cloned._length = shape._length;
-		cloned.c = shape.c;
-
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			if(transform){
-				pt = transform.applyToPointArray(shape.v[i][0],shape.v[i][1],0,2);
-				cloned.setXYAt(pt[0],pt[1],'v',i);
-				point_pool.release(pt);
-				pt = transform.applyToPointArray(shape.o[i][0],shape.o[i][1],0,2);
-				cloned.setXYAt(pt[0],pt[1],'o',i);
-				point_pool.release(pt);
-				pt = transform.applyToPointArray(shape.i[i][0],shape.i[i][1],0,2);
-				cloned.setXYAt(pt[0],pt[1],'i',i);
-				point_pool.release(pt);
-			}else{
-				cloned.setTripleAt(shape.v[i][0],shape.v[i][1],shape.o[i][0],shape.o[i][1],shape.i[i][0],shape.i[i][1], i);
-			}
-		}
-		return cloned
-	}
-
-
-	return ob;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release,
-		clone: clone
-	}
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = Array.apply(null,{length:_maxLength});
-
-	var cont = 0;
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	function clone(shapeCollection, originCollection) {
-		release(shapeCollection);
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-
-	return ob;
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
-    }
-    this.checkPendingElements();
-};
-
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 13:
-            return this.createCamera(layer);
-        case 99:
-            return null;
-    }
-    return this.createBase(layer);
-};
-
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-}
-
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
-        this.buildItem(i);
-    }
-    this.checkPendingElements();
-};
-
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
-        }
-    }
-};
-
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
-};
-
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy){
-    hierarchy = hierarchy || [];
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while(i<len){
-        if(layers[i].ind == parentName){
-            if(!elements[i] || elements[i] === true){
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else if(layers[i].parent !== undefined){
-                hierarchy.push(elements[i]);
-                elements[i]._isParent = true;
-                this.buildElementParenting(element,layers[i].parent, hierarchy);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i]._isParent = true;
-                element.setHierarchy(hierarchy);
-            }
-
-
-        }
-        i += 1;
-    }
-};
-
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
-};
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.globalData = {
-        frameNum: -1
-    };
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        progressiveLoad: (config && config.progressiveLoad) || false
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-
-}
-
-extendPrototype(BaseRenderer,SVGRenderer);
-
-SVGRenderer.prototype.createBase = function (data) {
-    return new SVGBaseElement(data, this.layerElement,this.globalData,this);
-};
-
-SVGRenderer.prototype.createShape = function (data) {
-    return new IShapeElement(data, this.layerElement,this.globalData,this);
-};
-
-SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data, this.layerElement,this.globalData,this);
-
-};
-
-SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data, this.layerElement,this.globalData,this);
-};
-
-SVGRenderer.prototype.createComp = function (data) {
-    return new ICompElement(data, this.layerElement,this.globalData,this);
-
-};
-
-SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data, this.layerElement,this.globalData,this);
-};
-
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.layerElement = document.createElementNS(svgNS,'svg');
-    this.layerElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    this.layerElement.setAttribute('width',animData.w);
-    this.layerElement.setAttribute('height',animData.h);
-    this.layerElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    this.layerElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    this.layerElement.style.width = '100%';
-    this.layerElement.style.height = '100%';
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.layerElement);
-    //Mask animation
-    var defs = document.createElementNS(svgNS, 'defs');
-    this.globalData.defs = defs;
-    this.layerElement.appendChild(defs);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.frameId = 0;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    };
-    this.data = animData;
-    this.globalData.frameRate = animData.fr;
-    var maskElement = document.createElementNS(svgNS, 'clipPath');
-    var rect = document.createElementNS(svgNS,'rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = 'animationMask_'+randomString(10);
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    var maskedElement = document.createElementNS(svgNS,'g');
-    maskedElement.setAttribute("clip-path", "url(#"+maskId+")");
-    this.layerElement.appendChild(maskedElement);
-    defs.appendChild(maskElement);
-    this.layerElement = maskedElement;
-    this.layers = animData.layers;
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts,defs);
-    this.elements = Array.apply(null,{length:animData.layers.length});
-};
-
-
-SVGRenderer.prototype.destroy = function () {
-    this.animationItem.wrapper.innerHTML = '';
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
-};
-
-SVGRenderer.prototype.updateContainerSize = function () {
-};
-
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
-
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
-    }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
-    }
-};
-
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame == num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    //clearPoints();
-    /*console.log('-------');
-    console.log('FRAME ',num);*/
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
-        }
-        i += 1;
-    }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
-    }
-};
-
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-SVGRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    var floatingContainer = document.createElementNS(svgNS,'g');
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
-            comp.initExpressions();
-            //comp.compInterface = CompExpressionInterface(comp);
-            //Expressions.addLayersInterface(comp.elements, this.globalData.projectInterface);
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
-
-function MaskElement(data,element,globalData) {
-    this.dynamicProperties = [];
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.paths = [];
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties;
-    this.viewData = new Array(this.masksProperties.length);
-    this.maskElement = null;
-    this.firstFrame = true;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties.length;
-
-
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = randomString(10);
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count == 0){
-            rect = document.createElementNS(svgNS, 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w);
-            rect.setAttribute('height', this.element.comp.data.h);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = document.createElementNS(svgNS, 'path');
-        if(properties[i].mode == 'n') {
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.dynamicProperties),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3,this.dynamicProperties,null),
-                elem: path
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        if(properties[i].mode == 's'){
-            path.setAttribute('fill', '#000000');
-        }else{
-            path.setAttribute('fill', '#ffffff');
-        }
-        path.setAttribute('clip-rule','nonzero');
-
-        if(properties[i].x.k !== 0){
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.dynamicProperties);
-            var filterID = 'fi_'+randomString(10);
-            expansor = document.createElementNS(svgNS,'filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = document.createElementNS(svgNS,'feMorphology');
-            feMorph.setAttribute('operator','dilate');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            if(properties[i].mode == 's'){
-                path.setAttribute('stroke', '#000000');
-            }else{
-                path.setAttribute('stroke', '#ffffff');
-            }
-        }else{
-            feMorph = null;
-            x = null;
-        }
-
-
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = document.createElementNS(svgNS,'g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = document.createElementNS(svgNS,'mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.dynamicProperties),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3,this.dynamicProperties,null)
-        };
-        if(rect){
-            this.viewData[i].invRect = rect;
-        }
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-    }
-
-    this.maskElement = document.createElementNS(svgNS, maskType);
-
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
-    }
-
-    this.maskElement.setAttribute('id', layerId);
-    if(count > 0){
-        this.element.maskedElement.setAttribute(maskRef, "url(#" + layerId + ")");
-    }
-
-    defs.appendChild(this.maskElement);
-};
-
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
-};
-
-MaskElement.prototype.prepareFrame = function(){
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-
-    }
-};
-
-MaskElement.prototype.renderFrame = function (finalMat) {
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop.mdf || this.firstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op.mdf || this.firstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp.mdf || this.firstFrame)){
-                this.viewData[i].invRect.setAttribute('x', -finalMat.props[12]);
-                this.viewData[i].invRect.setAttribute('y', -finalMat.props[13]);
-            }
-            if(this.storedData[i].x && (this.storedData[i].x.mdf || this.firstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
-    }
-    this.firstFrame = false;
-};
-
-MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
-};
-
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
-};
-
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[i][0]+','+pathNodes.i[i][1] + " "+pathNodes.v[i][0]+','+pathNodes.v[i][1];
-        pathString += " C"+bm_rnd(pathNodes.o[i-1][0])+','+bm_rnd(pathNodes.o[i-1][1]) + " "+bm_rnd(pathNodes.i[i][0])+','+bm_rnd(pathNodes.i[i][1]) + " "+bm_rnd(pathNodes.v[i][0])+','+bm_rnd(pathNodes.v[i][1]);
-    }
-        //pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    if(pathNodes.c && len > 1){
-        pathString += " C"+bm_rnd(pathNodes.o[i-1][0])+','+bm_rnd(pathNodes.o[i-1][1]) + " "+bm_rnd(pathNodes.i[0][0])+','+bm_rnd(pathNodes.i[0][1]) + " "+bm_rnd(pathNodes.v[0][0])+','+bm_rnd(pathNodes.v[0][1]);
-    }
-    //pathNodes.__renderedString = pathString;
-
-
-    if(viewData.lastPath !== pathString){
-        if(viewData.elem){
-            if(!pathNodes.c){
-                viewData.elem.setAttribute('d','');
-            }else if(pathData.inv){
-                viewData.elem.setAttribute('d',this.solidPath + pathString);
-            }else{
-                viewData.elem.setAttribute('d',pathString);
-            }
-        }
-        viewData.lastPath = pathString;
-    }
-};
-
-MaskElement.prototype.getMask = function(nm){
-    var i = 0, len = this.masksProperties.length;
-    while(i<len){
-        if(this.masksProperties[i].nm === nm){
-            return {
-                maskPath: this.viewData[i].prop.pv
-            }
-        }
-        i += 1;
-    }
-};
-
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.paths = null;
-    this.masksProperties = null;
-};
-function BaseElement(){
-};
-BaseElement.prototype.checkMasks = function(){
-    if(!this.data.hasMask){
-        return false;
-    }
-    var i = 0, len = this.data.masksProperties.length;
-    while(i<len) {
-        if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-            return true;
-        }
-        i += 1;
-    }
-    return false;
-}
-
-BaseElement.prototype.checkParenting = function(){
-    if(this.data.parent !== undefined){
-        this.comp.buildElementParenting(this, this.data.parent);
-    }
-}
-
-BaseElement.prototype.prepareFrame = function(num){
-    if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-    {
-        if(this.isVisible !== true){
-            this.elemMdf = true;
-            this.globalData.mdf = true;
-            this.isVisible = true;
-            this.firstFrame = true;
-            if(this.data.hasMask){
-                this.maskManager.firstFrame = true;
-            }
-        }
-    }else{
-        if(this.isVisible !== false){
-            this.elemMdf = true;
-            this.globalData.mdf = true;
-            this.isVisible = false;
-        }
-    }
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        if(this.isVisible || (this._isParent && this.dynamicProperties[i].type === 'transform')){
-            this.dynamicProperties[i].getValue();
-            if(this.dynamicProperties[i].mdf){
-                this.elemMdf = true;
-                this.globalData.mdf = true;
-            }
-        }
-    }
-    if(this.data.hasMask && this.isVisible){
-        this.maskManager.prepareFrame(num*this.data.sr);
-    }
-    
-    /* TODO check this
-    if(this.data.sy){
-        if(this.data.sy[0].renderedData[num]){
-            if(this.data.sy[0].renderedData[num].c){
-                this.feFlood.setAttribute('flood-color','rgb('+Math.round(this.data.sy[0].renderedData[num].c[0])+','+Math.round(this.data.sy[0].renderedData[num].c[1])+','+Math.round(this.data.sy[0].renderedData[num].c[2])+')');
-            }
-            if(this.data.sy[0].renderedData[num].s){
-                this.feMorph.setAttribute('radius',this.data.sy[0].renderedData[num].s);
-            }
-        }
-    }
-    */
-
-
-    this.currentFrameNum = num*this.data.sr;
-    return this.isVisible;
-};
-
-BaseElement.prototype.globalToLocal = function(pt){
-    var transforms = [];
-    transforms.push(this.finalTransform);
-    var flag = true;
-    var comp = this.comp;
-    while(flag){
-        if(comp.finalTransform){
-            if(comp.data.hasMask){
-                transforms.splice(0,0,comp.finalTransform);
-            }
-            comp = comp.comp;
-        } else {
-            flag = false;
-        }
-    }
-    var i, len = transforms.length,ptNew;
-    for(i=0;i<len;i+=1){
-        ptNew = transforms[i].mat.applyToPointArray(0,0,0);
-        //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-        pt = [pt[0] - ptNew[0],pt[1] - ptNew[1],0];
-    }
-    return pt;
-};
-
-BaseElement.prototype.initExpressions = function(){
-    this.layerInterface = LayerExpressionInterface(this);
-    //layers[i].layerInterface = LayerExpressionInterface(layers[i]);
-    //layers[i].layerInterface = LayerExpressionInterface(layers[i]);
-    if(this.data.hasMask){
-        this.layerInterface.registerMaskInterface(this.maskManager);
-    }
-    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-    this.layerInterface.registerEffectsInterface(effectsInterface);
-
-    if(this.data.ty === 0 || this.data.xt){
-        this.compInterface = CompExpressionInterface(this);
-    } else if(this.data.ty === 4){
-        this.layerInterface.shapeInterface = ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.layerInterface);
-    } else if(this.data.ty === 5){
-        this.layerInterface.textInterface = TextExpressionInterface(this);
-    }
-}
-
-BaseElement.prototype.setBlendMode = function(){
-    var blendModeValue = '';
-    switch(this.data.bm){
-        case 1:
-            blendModeValue = 'multiply';
-            break;
-        case 2:
-            blendModeValue = 'screen';
-            break;
-        case 3:
-            blendModeValue = 'overlay';
-            break;
-        case 4:
-            blendModeValue = 'darken';
-            break;
-        case 5:
-            blendModeValue = 'lighten';
-            break;
-        case 6:
-            blendModeValue = 'color-dodge';
-            break;
-        case 7:
-            blendModeValue = 'color-burn';
-            break;
-        case 8:
-            blendModeValue = 'hard-light';
-            break;
-        case 9:
-            blendModeValue = 'soft-light';
-            break;
-        case 10:
-            blendModeValue = 'difference';
-            break;
-        case 11:
-            blendModeValue = 'exclusion';
-            break;
-        case 12:
-            blendModeValue = 'hue';
-            break;
-        case 13:
-            blendModeValue = 'saturation';
-            break;
-        case 14:
-            blendModeValue = 'color';
-            break;
-        case 15:
-            blendModeValue = 'luminosity';
-            break;
-    }
-    var elem = this.baseElement || this.layerElement;
-
-    elem.style['mix-blend-mode'] = blendModeValue;
-}
-
-BaseElement.prototype.init = function(){
-    if(!this.data.sr){
-        this.data.sr = 1;
-    }
-    this.dynamicProperties = [];
-    if(this.data.ef){
-        this.effects = new EffectsManager(this.data,this,this.dynamicProperties);
-        //this.effect = this.effectsManager.bind(this.effectsManager);
-    }
-    //this.elemInterface = buildLayerExpressionInterface(this);
-    this.hidden = false;
-    this.firstFrame = true;
-    this.isVisible = false;
-    this._isParent = false;
-    this.currentFrameNum = -99999;
-    this.lastNum = -99999;
-    if(this.data.ks){
-        this.finalTransform = {
-            mProp: PropertyFactory.getProp(this,this.data.ks,2,null,this.dynamicProperties),
-            matMdf: false,
-            opMdf: false,
-            mat: new Matrix(),
-            opacity: 1
-        };
-        if(this.data.ao){
-            this.finalTransform.mProp.autoOriented = true;
-        }
-        this.finalTransform.op = this.finalTransform.mProp.o;
-        this.transform = this.finalTransform.mProp;
-        if(this.data.ty !== 11){
-            this.createElements();
-        }
-        if(this.data.hasMask){
-            this.addMasks(this.data);
-        }
-    }
-    this.elemMdf = false;
-};
-BaseElement.prototype.getType = function(){
-    return this.type;
-};
-
-BaseElement.prototype.resetHierarchy = function(){
-    if(!this.hierarchy){
-        this.hierarchy = [];
-    }else{
-        this.hierarchy.length = 0;
-    }
-};
-
-BaseElement.prototype.getHierarchy = function(){
-    if(!this.hierarchy){
-        this.hierarchy = [];
-    }
-    return this.hierarchy;
-};
-
-BaseElement.prototype.setHierarchy = function(hierarchy){
-    this.hierarchy = hierarchy;
-};
-
-BaseElement.prototype.getLayerSize = function(){
-    if(this.data.ty === 5){
-        return {w:this.data.textData.width,h:this.data.textData.height};
-    }else{
-        return {w:this.data.width,h:this.data.height};
-    }
-};
-
-BaseElement.prototype.hide = function(){
-
-};
-
-BaseElement.prototype.mHelper = new Matrix();
-function SVGBaseElement(data,parentContainer,globalData,comp, placeholder){
-    this.globalData = globalData;
-    this.comp = comp;
-    this.data = data;
-    this.matteElement = null;
-    this.transformedElement = null;
-    this.parentContainer = parentContainer;
-    this.layerId = placeholder ? placeholder.layerId : 'ly_'+randomString(10);
-    this.placeholder = placeholder;
-    this.init();
-};
-
-createElement(BaseElement, SVGBaseElement);
-
-SVGBaseElement.prototype.createElements = function(){
-    this.layerElement = document.createElementNS(svgNS,'g');
-    this.transformedElement = this.layerElement;
-    if(this.data.hasMask){
-        this.maskedElement = this.layerElement;
-    }
-    var layerElementParent = null;
-    if(this.data.td){
-        if(this.data.td == 3 || this.data.td == 1){
-            var masker = document.createElementNS(svgNS,'mask');
-            masker.setAttribute('id',this.layerId);
-            masker.setAttribute('mask-type',this.data.td == 3 ? 'luminance':'alpha');
-            masker.appendChild(this.layerElement);
-            layerElementParent = masker;
-            this.globalData.defs.appendChild(masker);
-            ////// This is only for IE and Edge when mask if of type alpha
-            if(!featureSupport.maskType && this.data.td == 1){
-                masker.setAttribute('mask-type','luminance');
-                var filId = randomString(10);
-                var fil = filtersFactory.createFilter(filId);
-                this.globalData.defs.appendChild(fil);
-                fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                var gg = document.createElementNS(svgNS,'g');
-                gg.appendChild(this.layerElement);
-                layerElementParent = gg;
-                masker.appendChild(gg);
-                gg.setAttribute('filter','url(#'+filId+')');
-            }
-        }else if(this.data.td == 2){
-            var maskGroup = document.createElementNS(svgNS,'mask');
-            maskGroup.setAttribute('id',this.layerId);
-            maskGroup.setAttribute('mask-type','alpha');
-            var maskGrouper = document.createElementNS(svgNS,'g');
-            maskGroup.appendChild(maskGrouper);
-            var filId = randomString(10);
-            var fil = filtersFactory.createFilter(filId);
-            ////
-
-            var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-            feColorMatrix.setAttribute('type','matrix');
-            feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-            feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-            fil.appendChild(feColorMatrix);
-
-            ////
-            /*var feCTr = document.createElementNS(svgNS,'feComponentTransfer');
-            feCTr.setAttribute('in','SourceGraphic');
-            fil.appendChild(feCTr);
-            var feFunc = document.createElementNS(svgNS,'feFuncA');
-            feFunc.setAttribute('type','table');
-            feFunc.setAttribute('tableValues','1.0 0.0');
-            feCTr.appendChild(feFunc);*/
-            this.globalData.defs.appendChild(fil);
-            var alphaRect = document.createElementNS(svgNS,'rect');
-            alphaRect.setAttribute('width',this.comp.data.w);
-            alphaRect.setAttribute('height',this.comp.data.h);
-            alphaRect.setAttribute('x','0');
-            alphaRect.setAttribute('y','0');
-            alphaRect.setAttribute('fill','#ffffff');
-            alphaRect.setAttribute('opacity','0');
-            maskGrouper.setAttribute('filter','url(#'+filId+')');
-            maskGrouper.appendChild(alphaRect);
-            maskGrouper.appendChild(this.layerElement);
-            layerElementParent = maskGrouper;
-            if(!featureSupport.maskType){
-                maskGroup.setAttribute('mask-type','luminance');
-                fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                var gg = document.createElementNS(svgNS,'g');
-                maskGrouper.appendChild(alphaRect);
-                gg.appendChild(this.layerElement);
-                layerElementParent = gg;
-                maskGrouper.appendChild(gg);
-            }
-            this.globalData.defs.appendChild(maskGroup);
-        }
-    }else if(this.data.hasMask || this.data.tt){
-        if(this.data.tt){
-            this.matteElement = document.createElementNS(svgNS,'g');
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        }else{
-            this.baseElement = this.layerElement;
-        }
-    }else{
-        this.baseElement = this.layerElement;
-    }
-    if((this.data.ln || this.data.cl) && (this.data.ty === 4 || this.data.ty === 0)){
-        if(this.data.ln){
-            this.layerElement.setAttribute('id',this.data.ln);
-        }
-        if(this.data.cl){
-            this.layerElement.setAttribute('class',this.data.cl);
-        }
-    }
-    if(this.data.ty === 0){
-            var cp = document.createElementNS(svgNS, 'clipPath');
-            var pt = document.createElementNS(svgNS,'path');
-            pt.setAttribute('d','M0,0 L'+this.data.w+',0'+' L'+this.data.w+','+this.data.h+' L0,'+this.data.h+'z');
-            var clipId = 'cp_'+randomString(8);
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-        if(this.checkMasks()){
-            var cpGroup = document.createElementNS(svgNS,'g');
-            cpGroup.setAttribute('clip-path','url(#'+clipId+')');
-            cpGroup.appendChild(this.layerElement);
-            this.transformedElement = cpGroup;
-            if(layerElementParent){
-                layerElementParent.appendChild(this.transformedElement);
-            } else {
-                this.baseElement = this.transformedElement;
-            }
-        } else {
-            this.layerElement.setAttribute('clip-path','url(#'+clipId+')');
-        }
-        
-    }
-    if(this.data.bm !== 0){
-        this.setBlendMode();
-    }
-    if(this.layerElement !== this.parentContainer){
-        this.placeholder = null;
-    }
-    /* Todo performance killer
-    if(this.data.sy){
-        var filterID = 'st_'+randomString(10);
-        var c = this.data.sy[0].c.k;
-        var r = this.data.sy[0].s.k;
-        var expansor = document.createElementNS(svgNS,'filter');
-        expansor.setAttribute('id',filterID);
-        var feFlood = document.createElementNS(svgNS,'feFlood');
-        this.feFlood = feFlood;
-        if(!c[0].e){
-            feFlood.setAttribute('flood-color','rgb('+c[0]+','+c[1]+','+c[2]+')');
-        }
-        feFlood.setAttribute('result','base');
-        expansor.appendChild(feFlood);
-        var feMorph = document.createElementNS(svgNS,'feMorphology');
-        feMorph.setAttribute('operator','dilate');
-        feMorph.setAttribute('in','SourceGraphic');
-        feMorph.setAttribute('result','bigger');
-        this.feMorph = feMorph;
-        if(!r.length){
-            feMorph.setAttribute('radius',this.data.sy[0].s.k);
-        }
-        expansor.appendChild(feMorph);
-        var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-        feColorMatrix.setAttribute('result','mask');
-        feColorMatrix.setAttribute('in','bigger');
-        feColorMatrix.setAttribute('type','matrix');
-        feColorMatrix.setAttribute('values','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0');
-        expansor.appendChild(feColorMatrix);
-        var feComposite = document.createElementNS(svgNS,'feComposite');
-        feComposite.setAttribute('result','drop');
-        feComposite.setAttribute('in','base');
-        feComposite.setAttribute('in2','mask');
-        feComposite.setAttribute('operator','in');
-        expansor.appendChild(feComposite);
-        var feBlend = document.createElementNS(svgNS,'feBlend');
-        feBlend.setAttribute('in','SourceGraphic');
-        feBlend.setAttribute('in2','drop');
-        feBlend.setAttribute('mode','normal');
-        expansor.appendChild(feBlend);
-        this.globalData.defs.appendChild(expansor);
-        var cont = document.createElementNS(svgNS,'g');
-        if(this.layerElement === this.parentContainer){
-            this.layerElement = cont;
-        }else{
-            cont.appendChild(this.layerElement);
-        }
-        cont.setAttribute('filter','url(#'+filterID+')');
-        if(this.data.td){
-            cont.setAttribute('data-td',this.data.td);
-        }
-        if(this.data.td == 3){
-            this.globalData.defs.appendChild(cont);
-        }else if(this.data.td == 2){
-            maskGrouper.appendChild(cont);
-        }else if(this.data.td == 1){
-            masker.appendChild(cont);
-        }else{
-            if(this.data.hasMask && this.data.tt){
-                this.matteElement.appendChild(cont);
-            }else{
-                this.appendNodeToParent(cont);
-            }
-        }
-    }*/
-    if(this.data.ef){
-        this.effectsManager = new SVGEffects(this);
-    }
-    this.checkParenting();
-};
-
-
-SVGBaseElement.prototype.setBlendMode = BaseElement.prototype.setBlendMode;
-
-SVGBaseElement.prototype.renderFrame = function(parentTransform){
-    if(this.data.ty === 3 || this.data.hd || !this.isVisible){
-        return false;
-    }
-
-    this.lastNum = this.currentFrameNum;
-    this.finalTransform.opMdf = this.firstFrame || this.finalTransform.op.mdf;
-    this.finalTransform.matMdf = this.firstFrame || this.finalTransform.mProp.mdf;
-    this.finalTransform.opacity = this.finalTransform.op.v;
-
-    var mat;
-    var finalMat = this.finalTransform.mat;
-
-    if(this.hierarchy){
-        var i = 0, len = this.hierarchy.length;
-        if(!this.finalTransform.matMdf) {
-            while(i < len) {
-                if(this.hierarchy[i].finalTransform.mProp.mdf) {
-                    this.finalTransform.matMdf = true;
-                    break;
-                }
-                i += 1;
-            }
-        }
-        
-        if(this.finalTransform.matMdf) {
-            mat = this.finalTransform.mProp.v.props;
-            finalMat.cloneFromProps(mat);
-            for(i=0;i<len;i+=1){
-                mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
-            }
-        }
-        
-    }else if(this.isVisible){
-        finalMat = this.finalTransform.mProp.v;
-    }
-    if(this.finalTransform.matMdf && this.layerElement){
-        this.transformedElement.setAttribute('transform',finalMat.to2dCSS());
-    }
-    if(this.finalTransform.opMdf && this.layerElement){
-        this.transformedElement.setAttribute('opacity',this.finalTransform.op.v);
-    }
-
-    if(this.data.hasMask){
-        this.maskManager.renderFrame(finalMat);
-    }
-    if(this.effectsManager){
-        this.effectsManager.renderFrame(this.firstFrame);
-    }
-    return this.isVisible;
-};
-
-SVGBaseElement.prototype.destroy = function(){
-    this.layerElement = null;
-    this.parentContainer = null;
-    if(this.matteElement) {
-        this.matteElement = null;
-    }
-    if(this.maskManager) {
-        this.maskManager.destroy();
-    }
-};
-
-SVGBaseElement.prototype.getBaseElement = function(){
-    return this.baseElement;
-};
-SVGBaseElement.prototype.addMasks = function(data){
-    this.maskManager = new MaskElement(data,this,this.globalData);
-};
-
-SVGBaseElement.prototype.setMatte = function(id){
-    if(!this.matteElement){
-        return;
-    }
-    this.matteElement.setAttribute("mask", "url(#" + id + ")");
-};
-
-SVGBaseElement.prototype.setMatte = function(id){
-    if(!this.matteElement){
-        return;
-    }
-    this.matteElement.setAttribute("mask", "url(#" + id + ")");
-};
-
-SVGBaseElement.prototype.hide = function(){
-
-};
-
-function ITextElement(data, animationItem,parentContainer,globalData){
-}
-ITextElement.prototype.init = function(){
-    this._parent.init.call(this);
-
-    this.lettersChangedFlag = false;
-    this.currentTextDocumentData = {};
-    var data = this.data;
-    this.viewData = {
-        m:{
-            a: PropertyFactory.getProp(this,data.t.m.a,1,0,this.dynamicProperties)
-        }
-    };
-    var textData = this.data.t;
-    if(textData.a.length){
-        this.viewData.a = Array.apply(null,{length:textData.a.length});
-        var i, len = textData.a.length, animatorData, animatorProps;
-        for(i=0;i<len;i+=1){
-            animatorProps = textData.a[i];
-            animatorData = {
-                a: {},
-                s: {}
-            };
-            if('r' in animatorProps.a) {
-                animatorData.a.r = PropertyFactory.getProp(this,animatorProps.a.r,0,degToRads,this.dynamicProperties);
-            }
-            if('rx' in animatorProps.a) {
-                animatorData.a.rx = PropertyFactory.getProp(this,animatorProps.a.rx,0,degToRads,this.dynamicProperties);
-            }
-            if('ry' in animatorProps.a) {
-                animatorData.a.ry = PropertyFactory.getProp(this,animatorProps.a.ry,0,degToRads,this.dynamicProperties);
-            }
-            if('sk' in animatorProps.a) {
-                animatorData.a.sk = PropertyFactory.getProp(this,animatorProps.a.sk,0,degToRads,this.dynamicProperties);
-            }
-            if('sa' in animatorProps.a) {
-                animatorData.a.sa = PropertyFactory.getProp(this,animatorProps.a.sa,0,degToRads,this.dynamicProperties);
-            }
-            if('s' in animatorProps.a) {
-                animatorData.a.s = PropertyFactory.getProp(this,animatorProps.a.s,1,0.01,this.dynamicProperties);
-            }
-            if('a' in animatorProps.a) {
-                animatorData.a.a = PropertyFactory.getProp(this,animatorProps.a.a,1,0,this.dynamicProperties);
-            }
-            if('o' in animatorProps.a) {
-                animatorData.a.o = PropertyFactory.getProp(this,animatorProps.a.o,0,0.01,this.dynamicProperties);
-            }
-            if('p' in animatorProps.a) {
-                animatorData.a.p = PropertyFactory.getProp(this,animatorProps.a.p,1,0,this.dynamicProperties);
-            }
-            if('sw' in animatorProps.a) {
-                animatorData.a.sw = PropertyFactory.getProp(this,animatorProps.a.sw,0,0,this.dynamicProperties);
-            }
-            if('sc' in animatorProps.a) {
-                animatorData.a.sc = PropertyFactory.getProp(this,animatorProps.a.sc,1,0,this.dynamicProperties);
-            }
-            if('fc' in animatorProps.a) {
-                animatorData.a.fc = PropertyFactory.getProp(this,animatorProps.a.fc,1,0,this.dynamicProperties);
-            }
-            if('fh' in animatorProps.a) {
-                animatorData.a.fh = PropertyFactory.getProp(this,animatorProps.a.fh,0,0,this.dynamicProperties);
-            }
-            if('fs' in animatorProps.a) {
-                animatorData.a.fs = PropertyFactory.getProp(this,animatorProps.a.fs,0,0.01,this.dynamicProperties);
-            }
-            if('fb' in animatorProps.a) {
-                animatorData.a.fb = PropertyFactory.getProp(this,animatorProps.a.fb,0,0.01,this.dynamicProperties);
-            }
-            if('t' in animatorProps.a) {
-                animatorData.a.t = PropertyFactory.getProp(this,animatorProps.a.t,0,0,this.dynamicProperties);
-            }
-            animatorData.s = PropertyFactory.getTextSelectorProp(this,animatorProps.s,this.dynamicProperties);
-            animatorData.s.t = animatorProps.s.t;
-            this.viewData.a[i] = animatorData;
-        }
-    }else{
-        this.viewData.a = [];
-    }
-    if(textData.p && 'm' in textData.p){
-        this.viewData.p = {
-            f: PropertyFactory.getProp(this,textData.p.f,0,0,this.dynamicProperties),
-            l: PropertyFactory.getProp(this,textData.p.l,0,0,this.dynamicProperties),
-            r: textData.p.r,
-            m: this.maskManager.getMaskProperty(textData.p.m)
-        };
-        this.maskPath = true;
-    } else {
-        this.maskPath = false;
-    }
-};
-ITextElement.prototype.prepareFrame = function(num) {
-    var i = 0, len = this.data.t.d.k.length;
-    var textDocumentData = this.data.t.d.k[i].s;
-    i += 1;
-    while(i<len){
-        if(this.data.t.d.k[i].t > num){
-            break;
-        }
-        textDocumentData = this.data.t.d.k[i].s;
-        i += 1;
-    }
-    this.lettersChangedFlag = false;
-    if(textDocumentData !== this.currentTextDocumentData){
-        this.currentTextDocumentData = textDocumentData;
-        this.lettersChangedFlag = true;
-        this.buildNewText();
-    }
-    this._parent.prepareFrame.call(this, num);
-}
-
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        kLen = shapes[j].ks.k.i.length;
-        pathNodes = shapes[j].ks.k;
-        for(k=1;k<kLen;k+=1){
-            if(k==1){
-                shapeStr += " M"+matrixHelper.applyToPointStringified(pathNodes.v[0][0],pathNodes.v[0][1]);
-            }
-            shapeStr += " C"+matrixHelper.applyToPointStringified(pathNodes.o[k-1][0],pathNodes.o[k-1][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.i[k][0],pathNodes.i[k][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.v[k][0],pathNodes.v[k][1]);
-        }
-        shapeStr += " C"+matrixHelper.applyToPointStringified(pathNodes.o[k-1][0],pathNodes.o[k-1][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.i[0][0],pathNodes.i[0][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.v[0][0],pathNodes.v[0][1]);
-        shapeStr += 'z';
-    }
-    return shapeStr;
-};
-
-ITextElement.prototype.getMeasures = function(){
-
-    var matrixHelper = this.mHelper;
-    var renderType = this.renderType;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var documentData = this.currentTextDocumentData;
-    var letters = documentData.l;
-    if(this.maskPath) {
-        var mask = this.viewData.p.m;
-        if(!this.viewData.p.n || this.viewData.p.mdf){
-            var paths = mask.v;
-            if(this.viewData.p.r){
-                paths = reversePath(paths);
-            }
-            var pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths.v.length - 1;
-            var pathData;
-            var totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                pathData = {
-                    s: paths.v[i],
-                    e: paths.v[i + 1],
-                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
-                    ti: [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]
-                };
-                bez.buildBezierData(pathData);
-                pathInfo.tLength += pathData.bezierData.segmentLength;
-                pathInfo.segments.push(pathData);
-                totalLength += pathData.bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                pathData = {
-                    s: paths.v[i],
-                    e: paths.v[0],
-                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
-                    ti: [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]
-                };
-                bez.buildBezierData(pathData);
-                pathInfo.tLength += pathData.bezierData.segmentLength;
-                pathInfo.segments.push(pathData);
-                totalLength += pathData.bezierData.segmentLength;
-            }
-            this.viewData.p.pi = pathInfo;
-        }
-        var pathInfo = this.viewData.p.pi;
-
-        var currentLength = this.viewData.p.f.v, segmentInd = 0, pointInd = 1, currentPoint, prevPoint, points;
-        var segmentLength = 0, flag = true;
-        var segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].bezierData.points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].bezierData.points;
-                    pointInd = points.length - 1;
-                }
-            }
-
-        }
-        points = segments[segmentInd].bezierData.points;
-        prevPoint = points[pointInd - 1];
-        currentPoint = points[pointInd];
-        var partialLength = currentPoint.partialLength;
-        var perc, tanAngle;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.s*1.2*.714;
-    var firstLine = true;
-    var renderedData = this.viewData, animatorProps, animatorSelector;
-    var j, jLen;
-    var lettersValue = Array.apply(null,{length:len}), letterValue;
-
-    jLen = renderedData.a.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw,letterSc,letterFc,letterM,letterP,letterO;
-    for( i = 0; i < len; i += 1) {
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this.maskPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
-                points = segments[segmentInd].bezierData.points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
-            }
-            lettersValue[i] = this.emptyProp;
-        }else{
-            if(this.maskPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += renderedData.m.a.v[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = renderedData.a[j].a;
-                    if ('p' in animatorProps) {
-                        animatorSelector = renderedData.a[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
-
-                    }
-                    if ('a' in animatorProps) {
-                        animatorSelector = renderedData.a[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
-
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-renderedData.m.a.v[0]*letters[i].an/200, -(renderedData.m.a.v[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].bezierData.points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].bezierData.points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
-            } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-renderedData.m.a.v[0]*letters[i].an/200, -renderedData.m.a.v[1]*yOff/100, 0);
-            }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-                if ('t' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                    if(this.maskPath) {
-                        if(mult.length) {
-                            currentLength += animatorProps.t*mult[0];
-                        } else {
-                            currentLength += animatorProps.t*mult;
-                        }
-                    }else{
-                        if(mult.length) {
-                            xPos += animatorProps.t.v*mult[0];
-                        } else {
-                            xPos += animatorProps.t.v*mult;
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-                if ('a' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-                if ('s' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = renderedData.a[j].a;
-                animatorSelector = renderedData.a[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                if ('sk' in animatorProps) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if ('r' in animatorProps) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if ('ry' in animatorProps) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if ('rx' in animatorProps) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if ('o' in animatorProps) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && 'sw' in animatorProps) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && 'sc' in animatorProps) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = Math.round(255*(sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0]));
-                        } else {
-                            sc[k] = Math.round(255*(sc[k] + (animatorProps.sc.v[k] - sc[k])*mult));
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim) {
-                    if('fc' in animatorProps){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                                //console.log('mult',mult);
-                                //console.log(Math.round(fc[k] + (animatorProps.fc.v[k] - fc[k])*mult));
-                            }
-                        }
-                    }
-                    if('fh' in animatorProps){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if('fs' in animatorProps){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if('fb' in animatorProps){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-
-                if ('p' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                    if(this.maskPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this.maskPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, renderedData.m.a.v[1]*yOff/100 + yPos,0);
-                if (data.t.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= renderedData.m.a.v[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.s;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(renderedData.m.a.v[0]*letters[i].an/200,renderedData.m.a.v[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.s;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                letterP = [matrixHelper.props[0],matrixHelper.props[1],matrixHelper.props[2],matrixHelper.props[3],matrixHelper.props[4],matrixHelper.props[5],matrixHelper.props[6],matrixHelper.props[7],matrixHelper.props[8],matrixHelper.props[9],matrixHelper.props[10],matrixHelper.props[11],matrixHelper.props[12],matrixHelper.props[13],matrixHelper.props[14],matrixHelper.props[15]];
-            }
-            letterO = elemOpacity;
-
-            lastLetter = this.renderedLetters[i];
-            if(lastLetter && (lastLetter.o !== letterO || lastLetter.sw !== letterSw || lastLetter.sc !== letterSc || lastLetter.fc !== letterFc)){
-                this.lettersChangedFlag = true;
-                letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            }else{
-                if((renderType === 'svg' || renderType === 'html') && (!lastLetter || lastLetter.m !== letterM)){
-                    this.lettersChangedFlag = true;
-                    letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM);
-                }else if(renderType === 'canvas' && (!lastLetter || (lastLetter.props[0] !== letterP[0] || lastLetter.props[1] !== letterP[1] || lastLetter.props[4] !== letterP[4] || lastLetter.props[5] !== letterP[5] || lastLetter.props[12] !== letterP[12] || lastLetter.props[13] !== letterP[13]))){
-                    this.lettersChangedFlag = true;
-                    letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,null,letterP);
-                } else {
-                    letterValue = lastLetter;
-                }
-            }
-            this.renderedLetters[i] = letterValue;
-        }
-    }
-};
-
-ITextElement.prototype.emptyProp = new LetterProps();
-
-function SVGTextElement(data,parentContainer,globalData,comp, placeholder){
-    this.textSpans = [];
-    this.renderType = 'svg';
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-}
-createElement(SVGBaseElement, SVGTextElement);
-
-SVGTextElement.prototype.init = ITextElement.prototype.init;
-SVGTextElement.prototype.createPathShape = ITextElement.prototype.createPathShape;
-SVGTextElement.prototype.getMeasures = ITextElement.prototype.getMeasures;
-SVGTextElement.prototype.prepareFrame = ITextElement.prototype.prepareFrame;
-
-SVGTextElement.prototype.createElements = function(){
-
-    this._parent.createElements.call(this);
-
-
-    if(this.data.ln){
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.layerElement.setAttribute('class',this.data.cl);
-    }
-};
-
-SVGTextElement.prototype.buildNewText = function(){
-    var i, len;
-
-    var documentData = this.currentTextDocumentData;
-    this.renderedLetters = Array.apply(null,{length:this.currentTextDocumentData.l ? this.currentTextDocumentData.l.length : 0});
-    if(documentData.fc) {
-        this.layerElement.setAttribute('fill', 'rgb(' + Math.round(documentData.fc[0]*255) + ',' + Math.round(documentData.fc[1]*255) + ',' + Math.round(documentData.fc[2]*255) + ')');
-    }else{
-        this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
-    if(documentData.sc){
-        this.layerElement.setAttribute('stroke', 'rgb(' + Math.round(documentData.sc[0]*255) + ',' + Math.round(documentData.sc[1]*255) + ',' + Math.round(documentData.sc[2]*255) + ')');
-        this.layerElement.setAttribute('stroke-width', documentData.sw);
-    }
-    this.layerElement.setAttribute('font-size', documentData.s);
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(fontData.fClass){
-        this.layerElement.setAttribute('class',fontData.fClass);
-    } else {
-        this.layerElement.setAttribute('font-family', fontData.fFamily);
-        var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-        this.layerElement.setAttribute('font-style', fStyle);
-        this.layerElement.setAttribute('font-weight', fWeight);
-    }
-
-
-
-    var letters = documentData.l || [];
-    len = letters.length;
-    if(!len){
-        return;
-    }
-    var tSpan;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    if (singleShape) {
-        var xPos = 0, yPos = 0, lineWidths = documentData.lineWidths, boxWidth = documentData.boxWidth, firstLine = true;
-    }
-    var cnt = 0;
-    for (i = 0;i < len ;i += 1) {
-        if(this.globalData.fontManager.chars){
-            if(!singleShape || i === 0){
-                tSpan = this.textSpans[cnt] ? this.textSpans[cnt] : document.createElementNS(svgNS,'path');
-            }
-        }else{
-            tSpan = this.textSpans[cnt] ? this.textSpans[cnt] : document.createElementNS(svgNS,'text');
-        }
-        tSpan.style.display = 'inherit';
-        tSpan.setAttribute('stroke-linecap', 'butt');
-        tSpan.setAttribute('stroke-linejoin','round');
-        tSpan.setAttribute('stroke-miterlimit','4');
-        //tSpan.setAttribute('visibility', 'hidden');
-        if(singleShape && letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            firstLine = false;
-        }
-        matrixHelper.reset();
-        if(this.globalData.fontManager.chars) {
-            matrixHelper.scale(documentData.s / 100, documentData.s / 100);
-        }
-        if (singleShape) {
-            if(documentData.ps){
-                matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-            }
-            matrixHelper.translate(0,-documentData.ls,0);
-            switch(documentData.j){
-                case 1:
-                    matrixHelper.translate(documentData.justifyOffset + (boxWidth - lineWidths[letters[i].line]),0,0);
-                    break;
-                case 2:
-                    matrixHelper.translate(documentData.justifyOffset + (boxWidth - lineWidths[letters[i].line])/2,0,0);
-                    break;
-            }
-            matrixHelper.translate(xPos, yPos, 0);
-        }
-        if(this.globalData.fontManager.chars){
-            var charData = this.globalData.fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-            var shapeData;
-            if(charData){
-                shapeData = charData.data;
-            } else {
-                shapeData = null;
-            }
-            if(shapeData && shapeData.shapes){
-                shapes = shapeData.shapes[0].it;
-                if(!singleShape){
-                    shapeStr = '';
-                }
-                shapeStr += this.createPathShape(matrixHelper,shapes);
-                if(!singleShape){
-
-                    tSpan.setAttribute('d',shapeStr);
-                }
-            }
-            if(!singleShape){
-                this.layerElement.appendChild(tSpan);
-            }
-        }else{
-            tSpan.textContent = letters[i].val;
-            tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            this.layerElement.appendChild(tSpan);
-            if(singleShape){
-                tSpan.setAttribute('transform',matrixHelper.to2dCSS());
-            }
-        }
-        if(singleShape) {
-            xPos += letters[i].l;
-            xPos += documentData.tr/1000*documentData.s;
-        }
-        //
-        this.textSpans[cnt] = tSpan;
-        cnt += 1;
-    }
-    if(!singleShape){
-        while(cnt < this.textSpans.length){
-            this.textSpans[cnt].style.display = 'none';
-            cnt += 1;
-        }
-    }
-    if(singleShape && this.globalData.fontManager.chars){
-        tSpan.setAttribute('d',shapeStr);
-        this.layerElement.appendChild(tSpan);
-    }
-}
-
-SVGTextElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.layerElement.style.display = 'none';
-        this.hidden = true;
-    }
-};
-
-SVGTextElement.prototype.renderFrame = function(parentMatrix){
-
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    if(this.hidden){
-        this.hidden = false;
-        this.layerElement.style.display = 'block';
-    }
-
-    if(this.data.singleShape){
-        return;
-    }
-    this.getMeasures();
-    if(!this.lettersChangedFlag){
-        return;
-    }
-    var  i,len;
-    var renderedLetters = this.renderedLetters;
-
-    var letters = this.currentTextDocumentData.l;
-
-    len = letters.length;
-    var renderedLetter;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            continue;
-        }
-        renderedLetter = renderedLetters[i];
-        this.textSpans[i].setAttribute('transform',renderedLetter.m);
-        this.textSpans[i].setAttribute('opacity',renderedLetter.o);
-        if(renderedLetter.sw){
-            this.textSpans[i].setAttribute('stroke-width',renderedLetter.sw);
-        }
-        if(renderedLetter.sc){
-            this.textSpans[i].setAttribute('stroke',renderedLetter.sc);
-        }
-        if(renderedLetter.fc){
-            this.textSpans[i].setAttribute('fill',renderedLetter.fc);
-        }
-    }
-    if(this.firstFrame) {
-        this.firstFrame = false;
-    }
-}
-
-
-SVGTextElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
-};
-function SVGTintFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    feColorMatrix.setAttribute('values','0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f2');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-    if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = document.createElementNS(svgNS,'feMerge');
-        filter.appendChild(feMerge);
-        var feMergeNode;
-        feMergeNode = document.createElementNS(svgNS,'feMergeNode');
-        feMergeNode.setAttribute('in','SourceGraphic');
-        feMerge.appendChild(feMergeNode);
-        feMergeNode = document.createElementNS(svgNS,'feMergeNode');
-        feMergeNode.setAttribute('in','f2');
-        feMerge.appendChild(feMergeNode);
-    }
-}
-
-SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
-        var colorBlack = this.filterManager.effectElements[0].p.v;
-        var colorWhite = this.filterManager.effectElements[1].p.v;
-        var opacity = this.filterManager.effectElements[2].p.v/100;
-        this.matrixFilter.setAttribute('values',(colorWhite[0]- colorBlack[0])+' 0 0 0 '+ colorBlack[0] +' '+ (colorWhite[1]- colorBlack[1]) +' 0 0 0 '+ colorBlack[1] +' '+ (colorWhite[2]- colorBlack[2]) +' 0 0 0 '+ colorBlack[2] +' 0 0 0 ' + opacity + ' 0');
-    }
-};
-function SVGFillFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-}
-SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
-        var color = this.filterManager.effectElements[2].p.v;
-        var opacity = this.filterManager.effectElements[6].p.v;
-        this.matrixFilter.setAttribute('values','0 0 0 0 '+color[0]+' 0 0 0 0 '+color[1]+' 0 0 0 0 '+color[2]+' 0 0 0 '+opacity+' 0');
-    }
-};
-function SVGStrokeEffect(elem, filterManager){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.elem = elem;
-    this.paths = [];
-}
-
-SVGStrokeEffect.prototype.initialize = function(){
-
-    var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-    var path,groupPath, i, len;
-    if(this.filterManager.effectElements[1].p.v === 1){
-        len = this.elem.maskManager.masksProperties.length;
-        i = 0;
-    } else {
-        i = this.filterManager.effectElements[0].p.v - 1;
-        len = i + 1;
-    }
-    groupPath = document.createElementNS(svgNS,'g'); 
-    groupPath.setAttribute('fill','none');
-    groupPath.setAttribute('stroke-linecap','round');
-    groupPath.setAttribute('stroke-dashoffset',1);
-    for(i;i<len;i+=1){
-        path = document.createElementNS(svgNS,'path');
-        groupPath.appendChild(path);
-        this.paths.push({p:path,m:i});
-    }
-    if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = document.createElementNS(svgNS,'mask');
-        var id = 'stms_' + randomString(10);
-        mask.setAttribute('id',id);
-        mask.setAttribute('mask-type','alpha');
-        mask.appendChild(groupPath);
-        this.elem.globalData.defs.appendChild(mask);
-        var g = document.createElementNS(svgNS,'g');
-        g.setAttribute('mask','url(#'+id+')');
-        if(elemChildren[0]){
-            g.appendChild(elemChildren[0]);
-        }
-        this.elem.layerElement.appendChild(g);
-        this.masker = mask;
-        groupPath.setAttribute('stroke','#fff');
-    } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(this.filterManager.effectElements[10].p.v === 2){
-            var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-            while(elemChildren.length){
-                this.elem.layerElement.removeChild(elemChildren[0]);
-            }
-        }
-        this.elem.layerElement.appendChild(groupPath);
-        this.elem.layerElement.removeAttribute('mask');
-        groupPath.setAttribute('stroke','#fff');
-    }
-    this.initialized = true;
-    this.pathMasker = groupPath;
-}
-
-SVGStrokeEffect.prototype.renderFrame = function(forceRender){
-    if(!this.initialized){
-        this.initialize();
-    }
-    var i, len = this.paths.length;
-    var mask, path;
-    for(i=0;i<len;i+=1){
-        mask = this.elem.maskManager.viewData[this.paths[i].m];
-        path = this.paths[i].p;
-        if(forceRender || this.filterManager.mdf || mask.prop.mdf){
-            path.setAttribute('d',mask.lastPath);
-        }
-        if(forceRender || this.filterManager.effectElements[9].p.mdf || this.filterManager.effectElements[4].p.mdf || this.filterManager.effectElements[7].p.mdf || this.filterManager.effectElements[8].p.mdf || mask.prop.mdf){
-            var dasharrayValue;
-            if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
-                var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var l = path.getTotalLength();
-                dasharrayValue = '0 0 0 ' + l*s + ' ';
-                var lineLength = l*(e-s);
-                var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-                var units = Math.floor(lineLength/segment);
-                var j;
-                for(j=0;j<units;j+=1){
-                    dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
-                }
-                dasharrayValue += '0 ' + l*10 + ' 0 0';
-            } else {
-                dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-            }
-            path.setAttribute('stroke-dasharray',dasharrayValue);
-        }
-    }
-    if(forceRender || this.filterManager.effectElements[4].p.mdf){
-        this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
-    }
-    
-    if(forceRender || this.filterManager.effectElements[6].p.mdf){
-        this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
-    }
-    if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p.mdf){
-            var color = this.filterManager.effectElements[3].p.v;
-            this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
-        }
-    }
-};
-function SVGTritoneFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    feColorMatrix.setAttribute('values','0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    var feComponentTransfer = document.createElementNS(svgNS,'feComponentTransfer');
-    feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-    filter.appendChild(feComponentTransfer);
-    this.matrixFilter = feComponentTransfer;
-    var feFuncR = document.createElementNS(svgNS,'feFuncR');
-    feFuncR.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncR);
-    this.feFuncR = feFuncR;
-    var feFuncG = document.createElementNS(svgNS,'feFuncG');
-    feFuncG.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncG);
-    this.feFuncG = feFuncG;
-    var feFuncB = document.createElementNS(svgNS,'feFuncB');
-    feFuncB.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncB);
-    this.feFuncB = feFuncB;
-}
-
-SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
-        var color1 = this.filterManager.effectElements[0].p.v;
-        var color2 = this.filterManager.effectElements[1].p.v;
-        var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0]
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1]
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2]
-        this.feFuncR.setAttribute('tableValues', tableR);
-        this.feFuncG.setAttribute('tableValues', tableG);
-        this.feFuncB.setAttribute('tableValues', tableB);
-        //var opacity = this.filterManager.effectElements[2].p.v/100;
-        //this.matrixFilter.setAttribute('values',(colorWhite[0]- colorBlack[0])+' 0 0 0 '+ colorBlack[0] +' '+ (colorWhite[1]- colorBlack[1]) +' 0 0 0 '+ colorBlack[1] +' '+ (colorWhite[2]- colorBlack[2]) +' 0 0 0 '+ colorBlack[2] +' 0 0 0 ' + opacity + ' 0');
-    }
-};
-function SVGProLevelsFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = document.createElementNS(svgNS,'feComponentTransfer');
-    var feFuncR, feFuncG, feFuncB;
-    
-    if(effectElements[9].p.k || effectElements[9].p.v !== 0 || effectElements[10].p.k || effectElements[10].p.v !== 1 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 0 || effectElements[13].p.k || effectElements[13].p.v !== 1){
-        this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
-    }
-    if(effectElements[16].p.k || effectElements[16].p.v !== 0 || effectElements[17].p.k || effectElements[17].p.v !== 1 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 0 || effectElements[20].p.k || effectElements[20].p.v !== 1){
-        this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
-    }
-    if(effectElements[23].p.k || effectElements[23].p.v !== 0 || effectElements[24].p.k || effectElements[24].p.v !== 1 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 0 || effectElements[27].p.k || effectElements[27].p.v !== 1){
-        this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-    if(effectElements[30].p.k || effectElements[30].p.v !== 0 || effectElements[31].p.k || effectElements[31].p.v !== 1 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 0 || effectElements[34].p.k || effectElements[34].p.v !== 1){
-        this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
-    }
-    
-    if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        feComponentTransfer = document.createElementNS(svgNS,'feComponentTransfer');
-    }
-
-    if(effectElements[2].p.k || effectElements[2].p.v !== 0 || effectElements[3].p.k || effectElements[3].p.v !== 1 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 0 || effectElements[6].p.k || effectElements[6].p.v !== 1){
-
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
-        this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
-        this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-}
-
-SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = document.createElementNS(svgNS,type);
-    feFunc.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFunc);
-    return feFunc;
-};
-
-SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
-    var cnt = 0;
-    var segments = 256;
-    var perc;
-    var min = Math.min(inputBlack, inputWhite);
-    var max = Math.max(inputBlack, inputWhite);
-    var table = Array.call(null,{length:segments});
-    var colorValue;
-    var pos = 0;
-    var outputDelta = outputWhite - outputBlack; 
-    var inputDelta = inputWhite - inputBlack; 
-    while(cnt <= 256) {
-        perc = cnt/256;
-        if(perc <= min){
-            colorValue = inputDelta < 0 ? outputWhite : outputBlack;
-        } else if(perc >= max){
-            colorValue = inputDelta < 0 ? outputBlack : outputWhite;
-        } else {
-            colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
-        }
-        table[pos++] = colorValue;
-        cnt += 256/(segments-1);
-    }
-    return table.join(' ');
-};
-
-SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
-        var val, cnt, perc, bezier;
-        var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[2].p.mdf || effectElements[3].p.mdf || effectElements[4].p.mdf || effectElements[5].p.mdf || effectElements[6].p.mdf)){
-            val = this.getTableValue(effectElements[2].p.v,effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v);
-            this.feFuncRComposed.setAttribute('tableValues',val);
-            this.feFuncGComposed.setAttribute('tableValues',val);
-            this.feFuncBComposed.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncR && (forceRender || effectElements[9].p.mdf || effectElements[10].p.mdf || effectElements[11].p.mdf || effectElements[12].p.mdf || effectElements[13].p.mdf)){
-            val = this.getTableValue(effectElements[9].p.v,effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v);
-            this.feFuncR.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncG && (forceRender || effectElements[16].p.mdf || effectElements[17].p.mdf || effectElements[18].p.mdf || effectElements[19].p.mdf || effectElements[20].p.mdf)){
-            val = this.getTableValue(effectElements[16].p.v,effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v);
-            this.feFuncG.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncB && (forceRender || effectElements[23].p.mdf || effectElements[24].p.mdf || effectElements[25].p.mdf || effectElements[26].p.mdf || effectElements[27].p.mdf)){
-            val = this.getTableValue(effectElements[23].p.v,effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v);
-            this.feFuncB.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncA && (forceRender || effectElements[30].p.mdf || effectElements[31].p.mdf || effectElements[32].p.mdf || effectElements[33].p.mdf || effectElements[34].p.mdf)){
-            val = this.getTableValue(effectElements[30].p.v,effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v);
-            this.feFuncA.setAttribute('tableValues',val);
-        }
-        
-    }
-};
-function SVGDropShadowEffect(filter, filterManager){
-    /*<feGaussianBlur in="SourceAlpha" stdDeviation="3"/> <!-- stdDeviation is how much to blur -->
-  <feOffset dx="2" dy="2" result="offsetblur"/> <!-- how much to offset -->
-  <feMerge> 
-    <feMergeNode/> <!-- this contains the offset blurred image -->
-    <feMergeNode in="SourceGraphic"/> <!-- this contains the element that the filter is applied to -->
-  </feMerge>*/
-  /*<feFlood flood-color="#3D4574" flood-opacity="0.5" result="offsetColor"/>*/
-    filter.setAttribute('x','-100%');
-    filter.setAttribute('y','-100%');
-    filter.setAttribute('width','400%');
-    filter.setAttribute('height','400%');
-    this.filterManager = filterManager;
-
-    var feGaussianBlur = document.createElementNS(svgNS,'feGaussianBlur');
-    feGaussianBlur.setAttribute('in','SourceAlpha');
-    feGaussianBlur.setAttribute('result','drop_shadow_1');
-    feGaussianBlur.setAttribute('stdDeviation','0');
-    this.feGaussianBlur = feGaussianBlur;
-    filter.appendChild(feGaussianBlur);
-
-    var feOffset = document.createElementNS(svgNS,'feOffset');
-    feOffset.setAttribute('dx','25');
-    feOffset.setAttribute('dy','0');
-    feOffset.setAttribute('in','drop_shadow_1');
-    feOffset.setAttribute('result','drop_shadow_2');
-    this.feOffset = feOffset;
-    filter.appendChild(feOffset);
-    var feFlood = document.createElementNS(svgNS,'feFlood');
-    feFlood.setAttribute('flood-color','#00ff00');
-    feFlood.setAttribute('flood-opacity','1');
-    feFlood.setAttribute('result','drop_shadow_3');
-    this.feFlood = feFlood;
-    filter.appendChild(feFlood);
-
-    var feComposite = document.createElementNS(svgNS,'feComposite');
-    feComposite.setAttribute('in','drop_shadow_3');
-    feComposite.setAttribute('in2','drop_shadow_2');
-    feComposite.setAttribute('operator','in');
-    feComposite.setAttribute('result','drop_shadow_4');
-    filter.appendChild(feComposite);
-
-
-    var feMerge = document.createElementNS(svgNS,'feMerge');
-    filter.appendChild(feMerge);
-    var feMergeNode;
-    feMergeNode = document.createElementNS(svgNS,'feMergeNode');
-    feMerge.appendChild(feMergeNode);
-    feMergeNode = document.createElementNS(svgNS,'feMergeNode');
-    feMergeNode.setAttribute('in','SourceGraphic');
-    this.feMergeNode = feMergeNode;
-    this.feMerge = feMerge;
-    this.originalNodeAdded = false;
-    feMerge.appendChild(feMergeNode);
-}
-
-SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
-        if(forceRender || this.filterManager.effectElements[4].p.mdf){
-            this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
-        }
-        if(forceRender || this.filterManager.effectElements[0].p.mdf){
-            var col = this.filterManager.effectElements[0].p.v;
-            this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
-        }
-        if(forceRender || this.filterManager.effectElements[1].p.mdf){
-            this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
-        }
-        if(forceRender || this.filterManager.effectElements[2].p.mdf || this.filterManager.effectElements[3].p.mdf){
-            var distance = this.filterManager.effectElements[3].p.v
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads
-            var x = distance * Math.cos(angle)
-            var y = distance * Math.sin(angle)
-            this.feOffset.setAttribute('dx', x);
-            this.feOffset.setAttribute('dy', y);
-        }
-        /*if(forceRender || this.filterManager.effectElements[5].p.mdf){
-            if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
-                this.feMerge.removeChild(this.feMergeNode);
-                this.originalNodeAdded = false;
-            } else if(this.filterManager.effectElements[5].p.v === 0 && !this.originalNodeAdded) {
-                this.feMerge.appendChild(this.feMergeNode);
-                this.originalNodeAdded = true;
-            }
-        }*/
-    }
-};
-function SVGEffects(elem){
-    var i, len = elem.data.ef.length;
-    var filId = randomString(10);
-    var fil = filtersFactory.createFilter(filId);
-    var count = 0;
-    this.filters = [];
-    var filterManager;
-    for(i=0;i<len;i+=1){
-        if(elem.data.ef[i].ty === 20){
-            count += 1;
-            filterManager = new SVGTintFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
-        }else if(elem.data.ef[i].ty === 21){
-            count += 1;
-            filterManager = new SVGFillFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
-        }else if(elem.data.ef[i].ty === 22){
-            filterManager = new SVGStrokeEffect(elem, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
-        }else if(elem.data.ef[i].ty === 23){
-            count += 1;
-            filterManager = new SVGTritoneFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
-        }else if(elem.data.ef[i].ty === 24){
-            count += 1;
-            filterManager = new SVGProLevelsFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
-        }else if(elem.data.ef[i].ty === 25){
-            count += 1;
-            filterManager = new SVGDropShadowEffect(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
-        }
-    }
-    if(count){
-        elem.globalData.defs.appendChild(fil);
-        elem.layerElement.setAttribute('filter','url(#'+filId+')');
-    }
-}
-
-SVGEffects.prototype.renderFrame = function(firstFrame){
-    var i, len = this.filters.length;
-    for(i=0;i<len;i+=1){
-        this.filters[i].renderFrame(firstFrame);
-    }
-};
-function ICompElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? Array.apply(null,{length:this.layers.length}) : [];
-    if(this.data.tm){
-        this.tm = PropertyFactory.getProp(this,this.data.tm,0,globalData.frameRate,this.dynamicProperties);
-    }
-    if(this.data.xt){
-        this.layerElement = document.createElementNS(svgNS,'g');
-        this.buildAllItems();
-    } else if(!globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-}
-createElement(SVGBaseElement, ICompElement);
-
-ICompElement.prototype.hide = function(){
-    if(!this.hidden){
-        var i,len = this.elements.length;
-        for( i = 0; i < len; i+=1 ){
-            if(this.elements[i]){
-                this.elements[i].hide();
-            }
-        }
-        this.hidden = true;
-    }
-};
-
-ICompElement.prototype.prepareFrame = function(num){
-    this._parent.prepareFrame.call(this,num);
-    if(this.isVisible===false && !this.data.xt){
-        return;
-    }
-
-    if(this.tm){
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
-    }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
-    }
-    for( i = 0; i < len; i+=1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-        }
-    }
-};
-
-ICompElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    var i,len = this.layers.length;
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-
-    this.hidden = false;
-    for( i = 0; i < len; i+=1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-};
-
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
-};
-
-ICompElement.prototype.getElements = function(){
-    return this.elements;
-};
-
-ICompElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-};
-
-ICompElement.prototype.checkLayers = SVGRenderer.prototype.checkLayers;
-ICompElement.prototype.buildItem = SVGRenderer.prototype.buildItem;
-ICompElement.prototype.buildAllItems = SVGRenderer.prototype.buildAllItems;
-ICompElement.prototype.buildElementParenting = SVGRenderer.prototype.buildElementParenting;
-ICompElement.prototype.createItem = SVGRenderer.prototype.createItem;
-ICompElement.prototype.createImage = SVGRenderer.prototype.createImage;
-ICompElement.prototype.createComp = SVGRenderer.prototype.createComp;
-ICompElement.prototype.createSolid = SVGRenderer.prototype.createSolid;
-ICompElement.prototype.createShape = SVGRenderer.prototype.createShape;
-ICompElement.prototype.createText = SVGRenderer.prototype.createText;
-ICompElement.prototype.createBase = SVGRenderer.prototype.createBase;
-ICompElement.prototype.appendElementInPos = SVGRenderer.prototype.appendElementInPos;
-ICompElement.prototype.checkPendingElements = SVGRenderer.prototype.checkPendingElements;
-ICompElement.prototype.addPendingElement = SVGRenderer.prototype.addPendingElement;
-function IImageElement(data,parentContainer,globalData,comp,placeholder){
-    this.assetData = globalData.getAssetData(data.refId);
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp,placeholder);
-}
-createElement(SVGBaseElement, IImageElement);
-
-IImageElement.prototype.createElements = function(){
-
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
-
-    this._parent.createElements.call(this);
-
-    this.innerElem = document.createElementNS(svgNS,'image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio','xMidYMid slice');
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    this.maskedElement = this.innerElem;
-    this.layerElement.appendChild(this.innerElem);
-    if(this.data.ln){
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.layerElement.setAttribute('class',this.data.cl);
-    }
-
-};
-
-IImageElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.layerElement.style.display = 'none';
-        this.hidden = true;
-    }
-};
-
-IImageElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    if(this.hidden){
-        this.hidden = false;
-        this.layerElement.style.display = 'block';
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-};
-
-IImageElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
-    this.innerElem =  null;
-};
-function IShapeElement(data,parentContainer,globalData,comp, placeholder){
-    this.shapes = [];
-    this.shapesData = data.shapes;
-    this.stylesList = [];
-    this.viewData = [];
-    this.shapeModifiers = [];
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-}
-createElement(SVGBaseElement, IShapeElement);
-
-IShapeElement.prototype.lcEnum = {
-    '1': 'butt',
-    '2': 'round',
-    '3': 'butt'
-}
-
-IShapeElement.prototype.ljEnum = {
-    '1': 'miter',
-    '2': 'round',
-    '3': 'butt'
-}
-
-IShapeElement.prototype.buildExpressionInterface = function(){};
-
-IShapeElement.prototype.createElements = function(){
-    //TODO check if I can use symbol so i can set its viewBox
-    this._parent.createElements.call(this);
-    this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.dynamicProperties, 0);
-    if(!this.data.hd || this.data.td){
-        styleUnselectableDiv(this.layerElement);
-    }
-    //this.elemInterface.registerShapeExpressionInterface(ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.elemInterface));
-};
-
-IShapeElement.prototype.setGradientData = function(pathElement,arr,data){
-
-    var gradientId = 'gr_'+randomString(10);
-    var gfill;
-    if(arr.t === 1){
-        gfill = document.createElementNS(svgNS,'linearGradient');
-    } else {
-        gfill = document.createElementNS(svgNS,'radialGradient');
-    }
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = arr.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = document.createElementNS(svgNS,'stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( arr.ty === 'gf' ? 'fill':'stroke','url(#'+gradientId+')');
-    this.globalData.defs.appendChild(gfill);
-    data.gf = gfill;
-    data.cst = stops;
-}
-
-IShapeElement.prototype.setGradientOpacity = function(arr, data, styleOb){
-    if((arr.g.k.k[0].s && arr.g.k.k[0].s.length > arr.g.p*4) || arr.g.k.k.length > arr.g.p*4){
-        var opFill;
-        var stop, j, jLen;
-        var mask = document.createElementNS(svgNS,"mask");
-        var maskElement = document.createElementNS(svgNS, 'path');
-        mask.appendChild(maskElement);
-        var opacityId = 'op_'+randomString(10);
-        var maskId = 'mk_'+randomString(10);
-        mask.setAttribute('id',maskId);
-        if(arr.t === 1){
-            opFill = document.createElementNS(svgNS,'linearGradient');
-        } else {
-            opFill = document.createElementNS(svgNS,'radialGradient');
-        }
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = arr.g.k.k[0].s ? arr.g.k.k[0].s.length : arr.g.k.k.length;
-        var stops = [];
-        for(j=arr.g.p*4;j<jLen;j+=2){
-            stop = document.createElementNS(svgNS,'stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            //stop.setAttribute('offset',Math.round(arr.y[j][0]*100)+'%');
-            //stop.setAttribute('style','stop-color:rgb(255,255,255);stop-opacity:'+arr.y[j][1]);
-            opFill.appendChild(stop);
-            stops.push(stop);
-        }
-        maskElement.setAttribute( arr.ty === 'gf' ? 'fill':'stroke','url(#'+opacityId+')');
-        this.globalData.defs.appendChild(opFill);
-        this.globalData.defs.appendChild(mask);
-        data.of = opFill;
-        data.ost = stops;
-        styleOb.msElem = maskElement;
-        return maskId;
-    }
-};
-
-IShapeElement.prototype.searchShapes = function(arr,data,container,dynamicProperties, level, transformers){
-    transformers = transformers || [];
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownArrays = [], ownModifiers = [], styleOb, currentTransform;
-    for(i=len;i>=0;i-=1){
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            data[i] = {};
-            styleOb = {
-                type: arr[i].ty,
-                d: '',
-                ld: '',
-                lvl: level,
-                mdf: false
-            };
-            var pathElement = document.createElementNS(svgNS, "path");
-            data[i].o = PropertyFactory.getProp(this,arr[i].o,0,0.01,dynamicProperties);
-            if(arr[i].ty == 'st' || arr[i].ty == 'gs') {
-                pathElement.setAttribute('stroke-linecap', this.lcEnum[arr[i].lc] || 'round');
-                ////pathElement.style.strokeLinecap = this.lcEnum[arr[i].lc] || 'round';
-                pathElement.setAttribute('stroke-linejoin',this.ljEnum[arr[i].lj] || 'round');
-                ////pathElement.style.strokeLinejoin = this.ljEnum[arr[i].lj] || 'round';
-                pathElement.setAttribute('fill-opacity','0');
-                ////pathElement.style.fillOpacity = 0;
-                if(arr[i].lj == 1) {
-                    pathElement.setAttribute('stroke-miterlimit',arr[i].ml);
-                    ////pathElement.style.strokeMiterlimit = arr[i].ml;
-                }
-
-                data[i].w = PropertyFactory.getProp(this,arr[i].w,0,null,dynamicProperties);
-                if(arr[i].d){
-                    var d = PropertyFactory.getDashProp(this,arr[i].d,'svg',dynamicProperties);
-                    if(!d.k){
-                        pathElement.setAttribute('stroke-dasharray', d.dasharray);
-                        ////pathElement.style.strokeDasharray = d.dasharray;
-                        pathElement.setAttribute('stroke-dashoffset', d.dashoffset);
-                        ////pathElement.style.strokeDashoffset = d.dashoffset;
-                    }
-                    data[i].d = d;
-                }
-
-            }
-            if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
-                data[i].c = PropertyFactory.getProp(this,arr[i].c,1,255,dynamicProperties);
-                container.appendChild(pathElement);
-            } else {
-                data[i].g = PropertyFactory.getGradientProp(this,arr[i].g,dynamicProperties);
-                if(arr[i].t == 2){
-                    data[i].h = PropertyFactory.getProp(this,arr[i].h,1,0.01,dynamicProperties);
-                    data[i].a = PropertyFactory.getProp(this,arr[i].a,1,degToRads,dynamicProperties);
-                }
-                data[i].s = PropertyFactory.getProp(this,arr[i].s,1,null,dynamicProperties);
-                data[i].e = PropertyFactory.getProp(this,arr[i].e,1,null,dynamicProperties);
-                this.setGradientData(pathElement,arr[i],data[i], styleOb);
-                var maskId = this.setGradientOpacity(arr[i],data[i], styleOb);
-                if(maskId){
-                    pathElement.setAttribute('mask','url(#'+maskId+')');
-                }
-                data[i].elem = pathElement;
-                container.appendChild(pathElement);
-            }
-            if(arr[i].r === 2) {
-                pathElement.setAttribute('fill-rule', 'evenodd');
-            }
-
-            if(arr[i].ln){
-                pathElement.setAttribute('id',arr[i].ln);
-            }
-            if(arr[i].cl){
-                pathElement.setAttribute('class',arr[i].cl);
-            }
-            styleOb.pElem = pathElement;
-            this.stylesList.push(styleOb);
-            data[i].style = styleOb;
-            ownArrays.push(styleOb);
-        }else if(arr[i].ty == 'gr'){
-            data[i] = {
-                it: []
-            };
-            var g = document.createElementNS(svgNS,'g');
-            container.appendChild(g);
-            data[i].gr = g;
-            this.searchShapes(arr[i].it,data[i].it,g,dynamicProperties, level + 1, ownTransformers);
-        }else if(arr[i].ty == 'tr'){
-            data[i] = {
-                transform : {
-                    op: PropertyFactory.getProp(this,arr[i].o,0,0.01,dynamicProperties),
-                    mProps: PropertyFactory.getProp(this,arr[i],2,null,dynamicProperties)
-                },
-                elements: []
-            };
-            currentTransform = data[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            data[i] = {
-                elements : [],
-                caches:[],
-                styles : [],
-                transformers: ownTransformers,
-                lStr: ''
-            };
-            var ty = 4;
-            if(arr[i].ty == 'rc'){
-                ty = 5;
-            }else if(arr[i].ty == 'el'){
-                ty = 6;
-            }else if(arr[i].ty == 'sr'){
-                ty = 7;
-            }
-            data[i].sh = ShapePropertyFactory.getShapeProp(this,arr[i],ty,dynamicProperties);
-            data[i].lvl = level;
-            this.shapes.push(data[i].sh);
-            this.addShapeToModifiers(data[i]);
-            jLen = this.stylesList.length;
-            for(j=0;j<jLen;j+=1){
-                if(!this.stylesList[j].closed){
-                    data[i].elements.push({
-                        ty:this.stylesList[j].type,
-                        st: this.stylesList[j]
-                    });
-                }
-            }
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'rp'){
-            var modifier = ShapeModifiers.getModifier(arr[i].ty);
-            modifier.init(this,arr[i],dynamicProperties);
-            this.shapeModifiers.push(modifier);
-            ownModifiers.push(modifier);
-            data[i] = modifier;
-        }
-    }
-    len = ownArrays.length;
-    for(i=0;i<len;i+=1){
-        ownArrays[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-IShapeElement.prototype.addShapeToModifiers = function(data) {
-    var i, len = this.shapeModifiers.length;
-    for(i=0;i<len;i+=1){
-        this.shapeModifiers[i].addShape(data);
-    }
-};
-
-IShapeElement.prototype.renderModifiers = function() {
-    if(!this.shapeModifiers.length){
-        return;
-    }
-    var i, len = this.shapes.length;
-    for(i=0;i<len;i+=1){
-        this.shapes[i].reset();
-    }
-
-
-    len = this.shapeModifiers.length;
-
-    for(i=len-1;i>=0;i-=1){
-        this.shapeModifiers[i].processShapes(this.firstFrame);
-    }
-};
-
-IShapeElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    this.globalToLocal([0,0,0]);
-    if(this.hidden){
-        this.layerElement.style.display = 'block';
-        this.hidden = false;
-    }
-    this.renderModifiers();
-    this.renderShape(null,null,true, null);
-};
-
-IShapeElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.layerElement.style.display = 'none';
-        var i, len = this.stylesList.length;
-        for(i=len-1;i>=0;i-=1){
-            if(this.stylesList[i].ld !== '0'){
-                this.stylesList[i].ld = '0';
-                this.stylesList[i].pElem.style.display = 'none';
-                if(this.stylesList[i].pElem.parentNode){
-                    this.stylesList[i].parent = this.stylesList[i].pElem.parentNode;
-                    //this.stylesList[i].pElem.parentNode.removeChild(this.stylesList[i].pElem);
-                }
-            }
-        }
-        this.hidden = true;
-    }
-};
-
-IShapeElement.prototype.renderShape = function(items,data,isMain, container){
-    var i, len;
-    if(!items){
-        items = this.shapesData;
-        len = this.stylesList.length;
-        for(i=0;i<len;i+=1){
-            this.stylesList[i].d = '';
-            this.stylesList[i].mdf = false;
-        }
-    }
-    if(!data){
-        data = this.viewData;
-    }
-    ///
-    ///
-    len = items.length - 1;
-    var ty;
-    for(i=len;i>=0;i-=1){
-        ty = items[i].ty;
-        if(ty == 'tr'){
-            if(this.firstFrame || data[i].transform.op.mdf && container){
-                container.setAttribute('opacity',data[i].transform.op.v);
-            }
-            if(this.firstFrame || data[i].transform.mProps.mdf && container){
-                container.setAttribute('transform',data[i].transform.mProps.v.to2dCSS());
-            }
-        }else if(ty == 'sh' || ty == 'el' || ty == 'rc' || ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(ty == 'fl'){
-            this.renderFill(items[i],data[i]);
-        }else if(ty == 'gf'){
-            this.renderGradient(items[i],data[i]);
-        }else if(ty == 'gs'){
-            this.renderGradient(items[i],data[i]);
-            this.renderStroke(items[i],data[i]);
-        }else if(ty == 'st'){
-            this.renderStroke(items[i],data[i]);
-        }else if(ty == 'gr'){
-            this.renderShape(items[i].it,data[i].it,false, data[i].gr);
-        }else if(ty == 'tm'){
-            //
-        }
-    }
-    if(isMain) {
-        len = this.stylesList.length;
-        for (i = 0; i < len; i += 1) {
-            if (this.stylesList[i].ld === '0') {
-                this.stylesList[i].ld = '1';
-                this.stylesList[i].pElem.style.display = 'block';
-                //this.stylesList[i].parent.appendChild(this.stylesList[i].pElem);
-            }
-            if (this.stylesList[i].mdf || this.firstFrame) {
-                this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d);
-                if(this.stylesList[i].msElem){
-                    this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                }
-            }
-        }
-        if (this.firstFrame) {
-            this.firstFrame = false;
-        }
-    }
-
-};
-
-IShapeElement.prototype.renderPath = function(pathData,viewData){
-    var len, i, j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = viewData.elements.length;
-    var lvl = viewData.lvl;
-    for(l=0;l<lLen;l+=1){
-        redraw = viewData.sh.mdf || this.firstFrame;
-        pathStringTransformed = 'M0 0';
-        var paths = viewData.sh.paths;
-        jLen = paths._length;
-        if(viewData.elements[l].st.lvl < lvl){
-            var mat = this.mHelper.reset(), props;
-            var iterations = lvl - viewData.elements[l].st.lvl;
-            var k = viewData.transformers.length-1;
-            while(iterations > 0) {
-                redraw = viewData.transformers[k].mProps.mdf || redraw;
-                props = viewData.transformers[k].mProps.v.props;
-                mat.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
-                iterations --;
-                k --;
-            }
-            if(redraw){
-                for(j=0;j<jLen;j+=1){
-                    pathNodes = paths.shapes[j];
-                    if(pathNodes && pathNodes._length){
-                        len = pathNodes._length;
-                        for (i = 1; i < len; i += 1) {
-                            if (i == 1) {
-                                pathStringTransformed += " M" + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            }
-                            pathStringTransformed += " C" + mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + mat.applyToPointStringified(pathNodes.i[i][0], pathNodes.i[i][1]) + " " + mat.applyToPointStringified(pathNodes.v[i][0], pathNodes.v[i][1]);
-                        }
-                        if (len == 1) {
-                            pathStringTransformed += " M" + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                        }
-                        if (pathNodes.c) {
-                            pathStringTransformed += " C" + mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + mat.applyToPointStringified(pathNodes.i[0][0], pathNodes.i[0][1]) + " " + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            pathStringTransformed += 'z';
-                        }
-                    }
-                }
-                viewData.caches[l] = pathStringTransformed;
-            } else {
-                pathStringTransformed = viewData.caches[l];
-            }
-        } else {
-            if(redraw){
-                for(j=0;j<jLen;j+=1){
-                    pathNodes = paths.shapes[j];
-                    if(pathNodes && pathNodes._length){
-                        len = pathNodes._length;
-                        for (i = 1; i < len; i += 1) {
-                            if (i == 1) {
-                                //pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                                pathStringTransformed += " M" + pathNodes.v[0].join(',');
-                            }
-                            //pathStringTransformed += " C" + groupTransform.mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.i[i][0], pathNodes.i[i][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.v[i][0], pathNodes.v[i][1]);
-                            pathStringTransformed += " C" + pathNodes.o[i - 1].join(',') + " " + pathNodes.i[i].join(',') + " " + pathNodes.v[i].join(',');
-                        }
-                        if (len == 1) {
-                            //pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            pathStringTransformed += " M" + pathNodes.v[0].join(',');
-                        }
-                        if (pathNodes.c && len) {
-                            //pathStringTransformed += " C" + groupTransform.mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.i[0][0], pathNodes.i[0][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            pathStringTransformed += " C" + pathNodes.o[i - 1].join(',') + " " + pathNodes.i[0].join(',') + " " + pathNodes.v[0].join(',');
-                            pathStringTransformed += 'z';
-                        }
-                    }
-                }
-                viewData.caches[l] = pathStringTransformed;
-            } else {
-                pathStringTransformed = viewData.caches[l];
-            }
-        }
-        viewData.elements[l].st.d += pathStringTransformed;
-        viewData.elements[l].st.mdf = redraw || viewData.elements[l].st.mdf;
-    }
-
-};
-
-IShapeElement.prototype.renderFill = function(styleData,viewData){
-    var styleElem = viewData.style;
-
-    if(viewData.c.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-        ////styleElem.pElem.style.fill = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('fill-opacity',viewData.o.v);
-    }
-};
-
-IShapeElement.prototype.renderGradient = function(styleData,viewData){
-    var gfill = viewData.gf;
-    var opFill = viewData.of;
-    var pt1 = viewData.s.v,pt2 = viewData.e.v;
-
-    if(viewData.o.mdf || this.firstFrame){
-        var attr = styleData.ty === 'gf' ? 'fill-opacity':'stroke-opacity';
-        viewData.elem.setAttribute(attr,viewData.o.v);
-    }
-    //clippedElement.setAttribute('transform','matrix(1,0,0,1,-100,0)');
-    if(viewData.s.mdf || this.firstFrame){
-        var attr1 = styleData.t === 1 ? 'x1':'cx';
-        var attr2 = attr1 === 'x1' ? 'y1':'cy';
-        gfill.setAttribute(attr1,pt1[0]);
-        gfill.setAttribute(attr2,pt1[1]);
-        if(opFill){
-            opFill.setAttribute(attr1,pt1[0]);
-            opFill.setAttribute(attr2,pt1[1]);
-        }
-    }
-    var stops, i, len, stop;
-    if(viewData.g.cmdf || this.firstFrame){
-        stops = viewData.cst;
-        var cValues = viewData.g.c;
-        len = stops.length;
-        for(i=0;i<len;i+=1){
-            stop = stops[i];
-            stop.setAttribute('offset',cValues[i*4]+'%');
-            stop.setAttribute('stop-color','rgb('+cValues[i*4+1]+','+cValues[i*4+2]+','+cValues[i*4+3]+')');
-        }
-    }
-    if(opFill && (viewData.g.omdf || this.firstFrame)){
-        stops = viewData.ost;
-        var oValues = viewData.g.o;
-        len = stops.length;
-        for(i=0;i<len;i+=1){
-            stop = stops[i];
-            stop.setAttribute('offset',oValues[i*2]+'%');
-            stop.setAttribute('stop-opacity',oValues[i*2+1]);
-        }
-    }
-    if(styleData.t === 1){
-        if(viewData.e.mdf  || this.firstFrame){
-            gfill.setAttribute('x2',pt2[0]);
-            gfill.setAttribute('y2',pt2[1]);
-            if(opFill){
-                opFill.setAttribute('x2',pt2[0]);
-                opFill.setAttribute('y2',pt2[1]);
-            }
-        }
-    } else {
-        var rad;
-        if(viewData.s.mdf || viewData.e.mdf || this.firstFrame){
-            rad = Math.sqrt(Math.pow(pt1[0]-pt2[0],2)+Math.pow(pt1[1]-pt2[1],2));
-            gfill.setAttribute('r',rad);
-            if(opFill){
-                opFill.setAttribute('r',rad);
-            }
-        }
-        if(viewData.e.mdf || viewData.h.mdf || viewData.a.mdf || this.firstFrame){
-            if(!rad){
-                rad = Math.sqrt(Math.pow(pt1[0]-pt2[0],2)+Math.pow(pt1[1]-pt2[1],2));
-            }
-            var ang = Math.atan2(pt2[1]-pt1[1], pt2[0]-pt1[0]);
-
-            var percent = viewData.h.v >= 1 ? 0.99 : viewData.h.v <= -1 ? -0.99:viewData.h.v;
-            var dist = rad*percent;
-            var x = Math.cos(ang + viewData.a.v)*dist + pt1[0];
-            var y = Math.sin(ang + viewData.a.v)*dist + pt1[1];
-            gfill.setAttribute('fx',x);
-            gfill.setAttribute('fy',y);
-            if(opFill){
-                opFill.setAttribute('fx',x);
-                opFill.setAttribute('fy',y);
-            }
-        }
-        //gfill.setAttribute('fy','200');
-    }
-};
-
-IShapeElement.prototype.renderStroke = function(styleData,viewData){
-    var styleElem = viewData.style;
-    //TODO fix dashes
-    var d = viewData.d;
-    var dasharray,dashoffset;
-    if(d && d.k && (d.mdf || this.firstFrame)){
-        styleElem.pElem.setAttribute('stroke-dasharray', d.dasharray);
-        ////styleElem.pElem.style.strokeDasharray = d.dasharray;
-        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset);
-        ////styleElem.pElem.style.strokeDashoffset = d.dashoffset;
-    }
-    if(viewData.c && (viewData.c.mdf || this.firstFrame)){
-        styleElem.pElem.setAttribute('stroke','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-        ////styleElem.pElem.style.stroke = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('stroke-opacity',viewData.o.v);
-    }
-    if(viewData.w.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('stroke-width',viewData.w.v);
-        if(styleElem.msElem){
-            styleElem.msElem.setAttribute('stroke-width',viewData.w.v);
-        }
-        ////styleElem.pElem.style.strokeWidth = viewData.w.v;
-    }
-};
-
-IShapeElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
-    this.shapeData = null;
-    this.viewData = null;
-    this.parentContainer = null;
-    this.placeholder = null;
-};
-
-function ISolidElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-}
-createElement(SVGBaseElement, ISolidElement);
-
-ISolidElement.prototype.createElements = function(){
-    this._parent.createElements.call(this);
-
-    var rect = document.createElementNS(svgNS,'rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
-    this.innerElem = rect;
-    if(this.data.ln){
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.layerElement.setAttribute('class',this.data.cl);
-    }
-};
-
-ISolidElement.prototype.hide = IImageElement.prototype.hide;
-ISolidElement.prototype.renderFrame = IImageElement.prototype.renderFrame;
-ISolidElement.prototype.destroy = IImageElement.prototype.destroy;
-
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var idled = true;
-    var playingAnimationsNum = 0;
-
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();   
-                }
-            }
-            i += 1;
-        }
-    }
-
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
-    }
-
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
-    }
-
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
-        if(playingAnimationsNum === 0){
-            idled = true;
-        }
-    }
-
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
-    }
-
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
-    }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
-    }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
-    }
-
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-
-    function moveFrame (value, animation) {
-        initTime = Date.now();
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.moveFrame(value,animation);
-        }
-    }
-
-    function resume(nowTime) {
-
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(!idled) {
-            requestAnimationFrame(resume);
-        }
-    }
-
-    function first(nowTime){
-        initTime = nowTime;
-        requestAnimationFrame(resume);
-    }
-
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
-    }
-
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
-    }
-
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
-    }
-
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
-    }
-
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
-    }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = document.getElementsByClassName('bodymovin');
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerHTML = '';
-            var div = document.createElement('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
-    }
-
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
-    }
-
-    function start(){
-        requestAnimationFrame(first);
-    }
-
-    function activate(){
-        if(idled){
-            idled = false;
-            requestAnimationFrame(first);
-        }
-    }
-
-    //start();
-
-    setTimeout(start,0);
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.moveFrame = moveFrame;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    return moduleOb;
-}());
-var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.pendingElements = 0;
-    this.playCount = 0;
-    this.prerenderFramesFlag = true;
-    this.animationData = {};
-    this.layers = [];
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = randomString(10);
-    this.scaleMode = 'fit';
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.subframeEnabled = subframeEnabled;
-    this.segments = [];
-    this.pendingSegment = false;
-    this._idle = true;
-    this.projectInterface = ProjectInterface();
-};
-
-AnimationItem.prototype.setParams = function(params) {
-    var self = this;
-    if(params.context){
-        this.context = params.context;
-    }
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        case 'hybrid':
-        case 'html':
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-
-    if(params.loop === '' || params.loop === null){
-    }else if(params.loop === false){
-        this.loop = false;
-    }else if(params.loop === true){
-        this.loop = true;
-    }else{
-        this.loop = parseInt(params.loop);
-    }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.prerenderFramesFlag = 'prerender' in params ? params.prerender : true;
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    if(params.animationData){
-        self.configAnimation(params.animationData);
-    }else if(params.path){
-        if(params.path.substr(-4) != 'json'){
-            if (params.path.substr(-1, 1) != '/') {
-                params.path += '/';
-            }
-            params.path += 'data.json';
-        }
-
-        var xhr = new XMLHttpRequest();
-        if(params.path.lastIndexOf('\\') != -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        }else{
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.assetsPath = params.assetsPath;
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-        xhr.open('GET', params.path, true);
-        xhr.send();
-        xhr.onreadystatechange = function () {
-            if (xhr.readyState == 4) {
-                if(xhr.status == 200){
-                    self.configAnimation(JSON.parse(xhr.responseText));
-                }else{
-                    try{
-                        var response = JSON.parse(xhr.responseText);
-                        self.configAnimation(response);
-                    }catch(err){
-                    }
-                }
-            }
-        };
-    }
-};
-
-AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
-    }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
-
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
-
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
-};
-
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
-        this.animationData.tf = this.totalFrames;
-    }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
-    }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    //this.totalFrames = 50;
-    //this.animationData.tf = 50;
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.renderer.renderFrame(null);
-    this.loadNextSegment();
-};
-
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.animationData.tf;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var xhr = new XMLHttpRequest();
-    var self = this;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    xhr.open('GET', segmentPath, true);
-    xhr.send();
-    xhr.onreadystatechange = function () {
-        if (xhr.readyState == 4) {
-            if(xhr.status == 200){
-                self.includeLayers(JSON.parse(xhr.responseText));
-            }else{
-                try{
-                    var response = JSON.parse(xhr.responseText);
-                    self.includeLayers(response);
-                }catch(err){
-                }
-            }
-        }
-    };
-};
-
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.animationData.tf;
-    }
-    this.loadNextSegment();
-};
-
-AnimationItem.prototype.configAnimation = function (animData) {
-    if(this.renderer && this.renderer.destroyed){
-        return;
-    }
-    //console.log(JSON.parse(JSON.stringify(animData)));
-    //animData.w = Math.round(animData.w/blitter);
-    //animData.h = Math.round(animData.h/blitter);
-    this.animationData = animData;
-    this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-    this.animationData.tf = this.totalFrames;
-    this.renderer.configAnimation(animData);
-    if(!animData.assets){
-        animData.assets = [];
-    }
-    if(animData.comps) {
-        animData.assets = animData.assets.concat(animData.comps);
-        animData.comps = null;
-    }
-    this.renderer.searchExtraCompositions(animData.assets);
-
-    this.layers = this.animationData.layers;
-    this.assets = this.animationData.assets;
-    this.frameRate = this.animationData.fr;
-    this.firstFrame = Math.round(this.animationData.ip);
-    this.frameMult = this.animationData.fr / 1000;
-    this.trigger('config_ready');
-    this.imagePreloader = new ImagePreloader();
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(animData.assets);
-    this.loadSegments();
-    this.updaFrameModifier();
-    if(this.renderer.globalData.fontManager){
-        this.waitForFontsLoaded();
-    }else{
-        dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-        this.checkLoaded();
-    }
-};
-
-AnimationItem.prototype.waitForFontsLoaded = (function(){
-    function checkFontsLoaded(){
-        if(this.renderer.globalData.fontManager.loaded){
-            dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-            //this.renderer.buildItems(this.animationData.layers);
-            this.checkLoaded();
-        }else{
-            setTimeout(checkFontsLoaded.bind(this),20);
-        }
-    }
-
-    return function(){
-        checkFontsLoaded.bind(this)();
-    }
-}());
-
-AnimationItem.prototype.addPendingElement = function () {
-    this.pendingElements += 1;
-}
-
-AnimationItem.prototype.elementLoaded = function () {
-    this.pendingElements--;
-    this.checkLoaded();
-};
-
-AnimationItem.prototype.checkLoaded = function () {
-    if (this.pendingElements === 0) {
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function(){
-            this.trigger('DOMLoaded');
-        }.bind(this),0);
-        this.isLoaded = true;
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
-    }
-};
-
-AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
-};
-
-AnimationItem.prototype.setSubframe = function(flag){
-    this.subframeEnabled = flag ? true : false;
-}
-
-AnimationItem.prototype.gotoFrame = function () {
-    if(this.subframeEnabled){
-        this.currentFrame = this.currentRawFrame;
-    }else{
-        this.currentFrame = Math.floor(this.currentRawFrame);
-    }
-
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
-};
-
-AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    //console.log('this.currentFrame:',this.currentFrame + this.firstFrame);
-    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-};
-
-AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.isPaused = false;
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
-};
-
-AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        if(!this.pendingSegment){
-            this._idle = true;
-            this.trigger('_idle');
-        }
-    }
-};
-
-AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
-};
-
-AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.currentFrame = this.currentRawFrame = 0;
-    this.playCount = 0;
-    this.gotoFrame();
-};
-
-AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
-};
-
-AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
-};
-
-AnimationItem.prototype.advanceTime = function (value) {
-    if(this.pendingSegment){
-        this.pendingSegment = false;
-        this.adjustSegment(this.segments.shift());
-        if(this.isPaused){
-            this.play();
-        }
-        return;
-    }
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    this.setCurrentRawFrameValue(this.currentRawFrame + value * this.frameModifier);
-};
-
-AnimationItem.prototype.updateAnimation = function (perc) {
-    this.setCurrentRawFrameValue(this.totalFrames * perc);
-};
-
-AnimationItem.prototype.moveFrame = function (value, name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.setCurrentRawFrameValue(this.currentRawFrame+value);
-};
-
-AnimationItem.prototype.adjustSegment = function(arr){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.01);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0);
-    }
-    this.trigger('segmentStart');
-};
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init - 0.01;
-        }
-    }
-
-    this.firstFrame = init;
-    this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
-}
-
-AnimationItem.prototype.playSegments = function (arr,forceFlag) {
-    if(typeof arr[0] === 'object'){
-        var i, len = arr.length;
-        for(i=0;i<len;i+=1){
-            this.segments.push(arr[i]);
-        }
-    }else{
-        this.segments.push(arr);
-    }
-    if(forceFlag){
-        this.adjustSegment(this.segments.shift());
-    }
-    if(this.isPaused){
-        this.play();
-    }
-};
-
-AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if(forceFlag){
-        this.adjustSegment(this.segments.shift());
-    }
-};
-AnimationItem.prototype.checkSegments = function(){
-    if(this.segments.length){
-        this.pendingSegment = true;
-    }
-}
-
-AnimationItem.prototype.remove = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.renderer.destroy();
-};
-
-AnimationItem.prototype.destroy = function (name) {
-    if((name && this.name != name) || (this.renderer && this.renderer.destroyed)){
-        return;
-    }
-    this.renderer.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-};
-
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    //console.log(this.totalFrames);
-    if (this.currentRawFrame >= this.totalFrames) {
-        this.checkSegments();
-        if(this.loop === false){
-            this.currentRawFrame = this.totalFrames - 0.01;
-            this.gotoFrame();
-            this.pause();
-            this.trigger('complete');
-            return;
-        }else{
-            this.trigger('loopComplete');
-            this.playCount += 1;
-            if((this.loop !== true && this.playCount == this.loop) || this.pendingSegment){
-                this.currentRawFrame = this.totalFrames - 0.01;
-                this.gotoFrame();
-                this.pause();
-                this.trigger('complete');
-                return;
-            } else {
-                this.currentRawFrame = this.currentRawFrame % this.totalFrames;
-            }
-        }
-    } else if (this.currentRawFrame < 0) {
-        this.checkSegments();
-        this.playCount -= 1;
-        if(this.playCount < 0){
-            this.playCount = 0;
-        }
-        if(this.loop === false  || this.pendingSegment){
-            this.currentRawFrame = 0;
-            this.gotoFrame();
-            this.pause();
-            this.trigger('complete');
-            return;
-        }else{
-            this.trigger('loopComplete');
-            this.currentRawFrame = (this.totalFrames + this.currentRawFrame) % this.totalFrames;
-            this.gotoFrame();
-            return;
-        }
-    }
-
-    this.gotoFrame();
-};
-
-AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
-};
-
-AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
-};
-
-AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-};
-
-AnimationItem.prototype.getPath = function () {
-    return this.path;
-};
-
-AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
-    }
-    return path;
-};
-
-AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
-    }
-};
-
-AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
-};
-
-AnimationItem.prototype.show = function () {
-    this.renderer.show();
-};
-
-AnimationItem.prototype.getAssets = function () {
-    return this.assets;
-};
-
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
-    }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
-};
-
-AnimationItem.prototype.addEventListener = _addEventListener;
-AnimationItem.prototype.removeEventListener = _removeEventListener;
-AnimationItem.prototype.triggerEvent = _triggerEvent;
-var bodymovinjs = {}; function play(animation){ animationManager.play(animation); } function pause(animation){ animationManager.pause(animation); } function togglePause(animation){ animationManager.togglePause(animation); } function setSpeed(value,animation){ animationManager.setSpeed(value, animation); } function setDirection(value,animation){ animationManager.setDirection(value, animation); } function stop(animation){ animationManager.stop(animation); } function moveFrame(value){ animationManager.moveFrame(value); } function searchAnimations(){ if(standalone === true){ animationManager.searchAnimations(animationData,standalone, renderer); }else{ animationManager.searchAnimations(); } } function registerAnimation(elem){ return animationManager.registerAnimation(elem); } function resize(){ animationManager.resize(); } function start(){ animationManager.start(); } function goToAndStop(val,isFrame, animation){ animationManager.goToAndStop(val,isFrame, animation); } function setSubframeRendering(flag){ subframeEnabled = flag; } function loadAnimation(params){ if(standalone === true){ params.animationData = JSON.parse(animationData); } return animationManager.loadAnimation(params); } function destroy(animation){ return animationManager.destroy(animation); } function setQuality(value){ if(typeof value === 'string'){ switch(value){ case 'high': defaultCurveSegments = 200; break; case 'medium': defaultCurveSegments = 50; break; case 'low': defaultCurveSegments = 10; break; } }else if(!isNaN(value) && value > 1){ defaultCurveSegments = value; } if(defaultCurveSegments >= 50){ roundValues(false); }else{ roundValues(true); } } function installPlugin(type,plugin){ if(type==='expressions'){ expressionsPlugin = plugin; } } function getFactory(name){ switch(name){ case "propertyFactory": return PropertyFactory;case "shapePropertyFactory": return ShapePropertyFactory; case "matrix": return Matrix; } } bodymovinjs.play = play; bodymovinjs.pause = pause; bodymovinjs.togglePause = togglePause; bodymovinjs.setSpeed = setSpeed; bodymovinjs.setDirection = setDirection; bodymovinjs.stop = stop; bodymovinjs.moveFrame = moveFrame; bodymovinjs.searchAnimations = searchAnimations; bodymovinjs.registerAnimation = registerAnimation; bodymovinjs.loadAnimation = loadAnimation; bodymovinjs.setSubframeRendering = setSubframeRendering; bodymovinjs.resize = resize; bodymovinjs.start = start; bodymovinjs.goToAndStop = goToAndStop; bodymovinjs.destroy = destroy; bodymovinjs.setQuality = setQuality; bodymovinjs.installPlugin = installPlugin; bodymovinjs.__getFactory = getFactory; bodymovinjs.version = '4.6.10'; function checkReady(){ if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); searchAnimations(); } } function getQueryVariable(variable) { var vars = queryString.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } } var standalone = '__[STANDALONE]__'; var animationData = '__[ANIMATIONDATA]__'; var renderer = ''; if(standalone) { var scripts = document.getElementsByTagName('script'); var index = scripts.length - 1; var myScript = scripts[index] || { src: '' }; var queryString = myScript.src.replace(/^[^\?]+\??/,''); renderer = getQueryVariable('renderer'); } var readyStateCheckInterval = setInterval(checkReady, 100); return bodymovinjs; }));  
\ No newline at end of file
diff --git a/build/player/bodymovin_light.min.js b/build/player/bodymovin_light.min.js
deleted file mode 100644
index 14ef325..0000000
--- a/build/player/bodymovin_light.min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-!function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof module&&module.exports?module.exports=e():t.bodymovin=e()}(window,function(){function t(){return{}}function e(t){gt=t?Math.round:function(t){return t}}function s(t){return Math.round(1e4*t)/1e4}function i(t){t.style.userSelect="none",t.style.MozUserSelect="none",t.style.webkitUserSelect="none",t.style.oUserSelect="none"}function a(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=0>i?-1:1}function r(t,e){this.type=t,this.direction=0>e?-1:1}function n(t,e,s,i){this.type=t,this.currentLoop=e,this.totalLoops=s,this.direction=0>i?-1:1}function h(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function o(t,e){this.type=t,this.target=e}function p(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)}function l(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;i>s;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}function f(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;s>i;i++)this._cbs[t][i](e)}function m(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var s,i="";for(s=t;s>0;--s)i+=e[Math.round(Math.random()*(e.length-1))];return i}function d(t,e,s){var i,a,r,n,h,o,p,l;switch(1===arguments.length&&(e=t.s,s=t.v,t=t.h),n=Math.floor(6*t),h=6*t-n,o=s*(1-e),p=s*(1-h*e),l=s*(1-(1-h)*e),n%6){case 0:i=s,a=l,r=o;break;case 1:i=p,a=s,r=o;break;case 2:i=o,a=s,r=l;break;case 3:i=o,a=p,r=s;break;case 4:i=l,a=o,r=s;break;case 5:i=s,a=o,r=p}return[i,a,r]}function c(t,e,s){1===arguments.length&&(e=t.g,s=t.b,t=t.r);var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(s>e?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function u(t,e){var s=c(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),d(s[0],s[1],s[2])}function g(t,e){var s=c(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),d(s[0],s[1],s[2])}function v(t,e){var s=c(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&(s[0]+=1),d(s[0],s[1],s[2])}function y(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.props=r}function b(t){var e,s,i=[],a=[],r=[],n={},h=0;t.c&&(i[0]=t.o[0],a[0]=t.i[0],r[0]=t.v[0],h=1),s=t.i.length;var o=s-1;for(e=h;s>e;e+=1)i.push(t.o[o]),a.push(t.i[o]),r.push(t.v[o]),o-=1;return n.i=i,n.o=a,n.v=r,n}function k(){}function P(t,e,s){if(!e){var i=Object.create(t.prototype,s),a={};return i&&"[object Function]"===a.toString.call(i.init)&&i.init(),i}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype._parent=t.prototype}function A(t,e){for(var s in t.prototype)t.prototype.hasOwnProperty(s)&&(e.prototype[s]=t.prototype[s])}function M(){function t(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return n>-1e-4&&1e-4>n}function e(t,e,s,i,a,r,n,h,o){var p,l=Math.sqrt(Math.pow(i-t,2)+Math.pow(a-e,2)+Math.pow(r-s,2)),f=Math.sqrt(Math.pow(n-t,2)+Math.pow(h-e,2)+Math.pow(o-s,2)),m=Math.sqrt(Math.pow(n-i,2)+Math.pow(h-a,2)+Math.pow(o-r,2));return p=l>f?l>m?l-f-m:m-f-l:m>f?m-f-l:f-l-m,p>-1e-4&&1e-4>p}function s(t){this.segmentLength=0,this.points=new Array(t)}function i(t,e){this.partialLength=t,this.point=e}function a(t,e){var s=e.segments,i=s.length,a=At((i-1)*t),r=t*e.addedLength,n=0;if(r==s[a].l)return s[a].p;for(var h=s[a].l>r?-1:1,o=!0;o;)s[a].l<=r&&s[a+1].l>r?(n=(r-s[a].l)/(s[a+1].l-s[a].l),o=!1):a+=h,(0>a||a>=i-1)&&(o=!1);return s[a].p+(s[a+1].p-s[a].p)*n}function r(){this.pt1=new Array(2),this.pt2=new Array(2),this.pt3=new Array(2),this.pt4=new Array(2)}function n(t,e,s,i,n,h,o){var p=new r;n=0>n?0:n>1?1:n;var l=a(n,o);h=h>1?1:h;var f,m=a(h,o),d=t.length,c=1-l,u=1-m;for(f=0;d>f;f+=1)p.pt1[f]=Math.round(1e3*(c*c*c*t[f]+(l*c*c+c*l*c+c*c*l)*s[f]+(l*l*c+c*l*l+l*c*l)*i[f]+l*l*l*e[f]))/1e3,p.pt3[f]=Math.round(1e3*(c*c*u*t[f]+(l*c*u+c*l*u+c*c*m)*s[f]+(l*l*u+c*l*m+l*c*m)*i[f]+l*l*m*e[f]))/1e3,p.pt4[f]=Math.round(1e3*(c*u*u*t[f]+(l*u*u+c*m*u+c*u*m)*s[f]+(l*m*u+c*m*m+l*u*m)*i[f]+l*m*m*e[f]))/1e3,p.pt2[f]=Math.round(1e3*(u*u*u*t[f]+(m*u*u+u*m*u+u*u*m)*s[f]+(m*m*u+u*m*m+m*u*m)*i[f]+m*m*m*e[f]))/1e3;return p}var h=(Math,function(){function t(t,e){this.l=t,this.p=e}return function(e,s,i,a){var r,n,h,o,p,l,f=wt,m=0,d=[],c=[],u={addedLength:0,segments:[]};for(h=i.length,r=0;f>r;r+=1){for(p=r/(f-1),l=0,n=0;h>n;n+=1)o=kt(1-p,3)*e[n]+3*kt(1-p,2)*p*i[n]+3*(1-p)*kt(p,2)*a[n]+kt(p,3)*s[n],d[n]=o,null!==c[n]&&(l+=kt(d[n]-c[n],2)),c[n]=d[n];l&&(l=Pt(l),m+=l),u.segments.push(new t(m,p))}return u.addedLength=m,u}}()),o=function(){var e={};return function(a){var r=a.s,n=a.e,h=a.to,o=a.ti,p=(r.join("_")+"_"+n.join("_")+"_"+h.join("_")+"_"+o.join("_")).replace(/\./g,"p");if(e[p])return void(a.bezierData=e[p]);var l,f,m,d,c,u,g,v=wt,y=0,b=null;2===r.length&&(r[0]!=n[0]||r[1]!=n[1])&&t(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&t(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])&&(v=2);var k=new s(v);for(m=h.length,l=0;v>l;l+=1){for(g=new Array(m),c=l/(v-1),u=0,f=0;m>f;f+=1)d=kt(1-c,3)*r[f]+3*kt(1-c,2)*c*(r[f]+h[f])+3*(1-c)*kt(c,2)*(n[f]+o[f])+kt(c,3)*n[f],g[f]=d,null!==b&&(u+=kt(g[f]-b[f],2));u=Pt(u),y+=u,k.points[l]=new i(u,g),b=g}k.segmentLength=y,a.bezierData=k,e[p]=k}}();return{getBezierLength:h,getNewSegment:n,buildBezierData:o,pointOnLine2D:t,pointOnLine3D:e}}function E(){function t(a,r,h){var o,p,l,f,m,d,c,u,g=a.length;for(f=0;g>f;f+=1)if(o=a[f],"ks"in o&&!o.completed){if(o.completed=!0,o.tt&&(a[f-1].td=o.tt),p=[],l=-1,o.hasMask){var v=o.masksProperties;for(d=v.length,m=0;d>m;m+=1)if(v[m].pt.k.i)i(v[m].pt.k);else for(u=v[m].pt.k.length,c=0;u>c;c+=1)v[m].pt.k[c].s&&i(v[m].pt.k[c].s[0]),v[m].pt.k[c].e&&i(v[m].pt.k[c].e[0])}0===o.ty?(o.layers=e(o.refId,r),t(o.layers,r,h)):4===o.ty?s(o.shapes):5==o.ty&&n(o,h)}}function e(t,e){for(var s=0,i=e.length;i>s;){if(e[s].id===t)return e[s].layers;s+=1}}function s(t){var e,a,r,n=t.length,h=!1;for(e=n-1;e>=0;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)i(t[e].ks.k);else for(r=t[e].ks.k.length,a=0;r>a;a+=1)t[e].ks.k[a].s&&i(t[e].ks.k[a].s[0]),t[e].ks.k[a].e&&i(t[e].ks.k[a].e[0]);h=!0}else"gr"==t[e].ty&&s(t[e].it)}function i(t){var e,s=t.i.length;for(e=0;s>e;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function a(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]?!0:s[0]>t[0]?!1:t[1]>s[1]?!0:s[1]>t[1]?!1:t[2]>s[2]?!0:s[2]>t[2]?!1:void 0}function r(e,s){e.__complete||(o(e),h(e),p(e),t(e.layers,e.assets,s),e.__complete=!0)}function n(t,e){var s,i,a=t.t.d.k,r=a.length;for(i=0;r>i;i+=1){var n=t.t.d.k[i].s;s=[];var h,o,p,l,f,m,d,c=0,u=t.t.m.g,g=0,v=0,y=0,b=[],k=0,P=0,A=e.getFontByName(n.f),M=0,E=A.fStyle.split(" "),w="normal",S="normal";for(o=E.length,h=0;o>h;h+=1)"italic"===E[h].toLowerCase()?S="italic":"bold"===E[h].toLowerCase()?w="700":"black"===E[h].toLowerCase()?w="900":"medium"===E[h].toLowerCase()?w="500":"regular"===E[h].toLowerCase()||"normal"===E[h].toLowerCase()?w="400":("light"===E[h].toLowerCase()||"thin"===E[h].toLowerCase())&&(w="200");if(n.fWeight=w,n.fStyle=S,o=n.t.length,n.sz){var F=n.sz[0],x=-1;for(h=0;o>h;h+=1)p=!1," "===n.t.charAt(h)?x=h:13===n.t.charCodeAt(h)&&(k=0,p=!0),e.chars?(d=e.getCharData(n.t.charAt(h),A.fStyle,A.fFamily),M=p?0:d.w*n.s/100):M=e.measureText(n.t.charAt(h),n.f,n.s),k+M>F?(-1===x?(n.t=n.t.substr(0,h)+"\r"+n.t.substr(h),o+=1):(h=x,n.t=n.t.substr(0,h)+"\r"+n.t.substr(h+1)),x=-1,k=0):k+=M;o=n.t.length}for(k=0,M=0,h=0;o>h;h+=1)if(p=!1," "===n.t.charAt(h)?l="\xa0":13===n.t.charCodeAt(h)?(b.push(k),P=k>P?k:P,k=0,l="",p=!0,y+=1):l=n.t.charAt(h),e.chars?(d=e.getCharData(n.t.charAt(h),A.fStyle,e.getFontByName(n.f).fFamily),M=p?0:d.w*n.s/100):M=e.measureText(l,n.f,n.s),k+=M,s.push({l:M,an:M,add:g,n:p,anIndexes:[],val:l,line:y}),2==u){if(g+=M,""==l||"\xa0"==l||h==o-1){for((""==l||"\xa0"==l)&&(g-=M);h>=v;)s[v].an=g,s[v].ind=c,s[v].extra=M,v+=1;c+=1,g=0}}else if(3==u){if(g+=M,""==l||h==o-1){for(""==l&&(g-=M);h>=v;)s[v].an=g,s[v].ind=c,s[v].extra=M,v+=1;g=0,c+=1}}else s[c].ind=c,s[c].extra=0,c+=1;if(n.l=s,P=k>P?k:P,b.push(k),n.sz)n.boxWidth=n.sz[0],n.justifyOffset=0;else switch(n.boxWidth=P,n.j){case 1:n.justifyOffset=-n.boxWidth;break;case 2:n.justifyOffset=-n.boxWidth/2;break;default:n.justifyOffset=0}n.lineWidths=b;var D=t.t.a;m=D.length;var C,_,T=[];for(f=0;m>f;f+=1){for(D[f].a.sc&&(n.strokeColorAnim=!0),D[f].a.sw&&(n.strokeWidthAnim=!0),(D[f].a.fc||D[f].a.fh||D[f].a.fs||D[f].a.fb)&&(n.fillColorAnim=!0),_=0,C=D[f].s.b,h=0;o>h;h+=1)s[h].anIndexes[f]=_,(1==C&&""!=s[h].val||2==C&&""!=s[h].val&&"\xa0"!=s[h].val||3==C&&(s[h].n||"\xa0"==s[h].val||h==o-1)||4==C&&(s[h].n||h==o-1))&&(1===D[f].s.rn&&T.push(_),_+=1);t.t.a[f].s.totalChars=_;var I,L=-1;if(1===D[f].s.rn)for(h=0;o>h;h+=1)L!=s[h].anIndexes[f]&&(L=s[h].anIndexes[f],I=T.splice(Math.floor(Math.random()*T.length),1)[0]),s[h].anIndexes[f]=I}0!==m||"m"in t.t.p||(t.singleShape=!0),n.yOffset=n.lh||1.2*n.s,n.ls=n.ls||0,n.ascent=A.ascent*n.s/100}}var h=function(){function t(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function e(e){var s,i=e.length;for(s=0;i>s;s+=1)5===e[s].ty&&t(e[s])}var s=[4,4,14];return function(t){if(a(s,t.v)&&(e(t.layers),t.assets)){var i,r=t.assets.length;for(i=0;r>i;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),o=function(){function t(e){var s,i,a,r=e.length;for(s=0;r>s;s+=1)if("gr"===e[s].ty)t(e[s].it);else if("fl"===e[s].ty||"st"===e[s].ty)if(e[s].c.k&&e[s].c.k[0].i)for(a=e[s].c.k.length,i=0;a>i;i+=1)e[s].c.k[i].s&&(e[s].c.k[i].s[0]/=255,e[s].c.k[i].s[1]/=255,e[s].c.k[i].s[2]/=255,e[s].c.k[i].s[3]/=255),e[s].c.k[i].e&&(e[s].c.k[i].e[0]/=255,e[s].c.k[i].e[1]/=255,e[s].c.k[i].e[2]/=255,e[s].c.k[i].e[3]/=255);else e[s].c.k[0]/=255,e[s].c.k[1]/=255,e[s].c.k[2]/=255,e[s].c.k[3]/=255}function e(e){var s,i=e.length;for(s=0;i>s;s+=1)4===e[s].ty&&t(e[s].shapes)}var s=[4,1,9];return function(t){if(a(s,t.v)&&(e(t.layers),t.assets)){var i,r=t.assets.length;for(i=0;r>i;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),p=function(){function t(e){var s,i,a,r=e.length,n=!1;for(s=r-1;s>=0;s-=1)if("sh"==e[s].ty){if(e[s].ks.k.i)e[s].ks.k.c=e[s].closed;else for(a=e[s].ks.k.length,i=0;a>i;i+=1)e[s].ks.k[i].s&&(e[s].ks.k[i].s[0].c=e[s].closed),e[s].ks.k[i].e&&(e[s].ks.k[i].e[0].c=e[s].closed);n=!0}else"gr"==e[s].ty&&t(e[s].it)}function e(e){var s,i,a,r,n,h,o=e.length;for(i=0;o>i;i+=1){if(s=e[i],s.hasMask){var p=s.masksProperties;for(r=p.length,a=0;r>a;a+=1)if(p[a].pt.k.i)p[a].pt.k.c=p[a].cl;else for(h=p[a].pt.k.length,n=0;h>n;n+=1)p[a].pt.k[n].s&&(p[a].pt.k[n].s[0].c=p[a].cl),p[a].pt.k[n].e&&(p[a].pt.k[n].e[0].c=p[a].cl)}4===s.ty&&t(s.shapes)}}var s=[4,4,18];return function(t){if(a(s,t.v)&&(e(t.layers),t.assets)){var i,r=t.assets.length;for(i=0;r>i;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),l={};return l.completeData=r,l}function w(){this.c=!1,this._length=0,this._maxLength=8,this.v=Array.apply(null,{length:this._maxLength}),this.o=Array.apply(null,{length:this._maxLength}),this.i=Array.apply(null,{length:this._maxLength})}function S(){}function F(){}function x(){}function D(){}function C(){this._length=0,this._maxLength=4,this.shapes=Array.apply(null,{length:this._maxLength})}function _(){}function T(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.globalData={frameNum:-1},this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",progressiveLoad:e&&e.progressiveLoad||!1},this.elements=[],this.pendingElements=[],this.destroyed=!1}function I(t,e,s){this.dynamicProperties=[],this.data=t,this.element=e,this.globalData=s,this.paths=[],this.storedData=[],this.masksProperties=this.data.masksProperties,this.viewData=new Array(this.masksProperties.length),this.maskElement=null,this.firstFrame=!0;var i,a,r,n,h,o,p,l,f=this.globalData.defs,d=this.masksProperties.length,c=this.masksProperties,u=0,g=[],v=m(10),y="clipPath",b="clip-path";for(i=0;d>i;i++)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k)&&(y="mask",b="mask"),"s"!=c[i].mode&&"i"!=c[i].mode||0!=u?h=null:(h=document.createElementNS(vt,"rect"),h.setAttribute("fill","#ffffff"),h.setAttribute("width",this.element.comp.data.w),h.setAttribute("height",this.element.comp.data.h),g.push(h)),a=document.createElementNS(vt,"path"),"n"!=c[i].mode){if(u+=1,"s"==c[i].mode?a.setAttribute("fill","#000000"):a.setAttribute("fill","#ffffff"),a.setAttribute("clip-rule","nonzero"),0!==c[i].x.k){y="mask",b="mask",l=It.getProp(this.element,c[i].x,0,null,this.dynamicProperties);var k="fi_"+m(10);o=document.createElementNS(vt,"filter"),o.setAttribute("id",k),p=document.createElementNS(vt,"feMorphology"),p.setAttribute("operator","dilate"),p.setAttribute("in","SourceGraphic"),p.setAttribute("radius","0"),o.appendChild(p),f.appendChild(o),"s"==c[i].mode?a.setAttribute("stroke","#000000"):a.setAttribute("stroke","#ffffff")}else p=null,l=null;if(this.storedData[i]={elem:a,x:l,expan:p,lastPath:"",lastOperator:"",filterId:k,lastRadius:0},"i"==c[i].mode){n=g.length;var P=document.createElementNS(vt,"g");for(r=0;n>r;r+=1)P.appendChild(g[r]);var A=document.createElementNS(vt,"mask");A.setAttribute("mask-type","alpha"),A.setAttribute("id",v+"_"+u),A.appendChild(a),f.appendChild(A),P.setAttribute("mask","url(#"+v+"_"+u+")"),g.length=0,g.push(P)}else g.push(a);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:a,lastPath:"",op:It.getProp(this.element,c[i].o,0,.01,this.dynamicProperties),prop:Lt.getShapeProp(this.element,c[i],3,this.dynamicProperties,null)},h&&(this.viewData[i].invRect=h),this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:It.getProp(this.element,c[i].o,0,.01,this.dynamicProperties),prop:Lt.getShapeProp(this.element,c[i],3,this.dynamicProperties,null),elem:a},f.appendChild(a);for(this.maskElement=document.createElementNS(vt,y),d=g.length,i=0;d>i;i+=1)this.maskElement.appendChild(g[i]);this.maskElement.setAttribute("id",v),u>0&&this.element.maskedElement.setAttribute(b,"url(#"+v+")"),f.appendChild(this.maskElement)}function L(){}function N(t,e,s,i,a){this.globalData=s,this.comp=i,this.data=t,this.matteElement=null,this.transformedElement=null,this.parentContainer=e,this.layerId=a?a.layerId:"ly_"+m(10),this.placeholder=a,this.init()}function V(t,e,s,i){}function z(t,e,s,i,a){this.textSpans=[],this.renderType="svg",this._parent.constructor.call(this,t,e,s,i,a)}function R(t,e){this.filterManager=e;var s=document.createElementNS(vt,"feColorMatrix");if(s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),s.setAttribute("result","f1"),t.appendChild(s),s=document.createElementNS(vt,"feColorMatrix"),s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result","f2"),t.appendChild(s),this.matrixFilter=s,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i=document.createElementNS(vt,"feMerge");t.appendChild(i);var a;a=document.createElementNS(vt,"feMergeNode"),a.setAttribute("in","SourceGraphic"),i.appendChild(a),a=document.createElementNS(vt,"feMergeNode"),a.setAttribute("in","f2"),i.appendChild(a)}}function j(t,e){this.filterManager=e;var s=document.createElementNS(vt,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(s),this.matrixFilter=s}function O(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function B(t,e){this.filterManager=e;var s=document.createElementNS(vt,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),s.setAttribute("result","f1"),t.appendChild(s);var i=document.createElementNS(vt,"feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var a=document.createElementNS(vt,"feFuncR");a.setAttribute("type","table"),i.appendChild(a),this.feFuncR=a;var r=document.createElementNS(vt,"feFuncG");r.setAttribute("type","table"),i.appendChild(r),this.feFuncG=r;var n=document.createElementNS(vt,"feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function G(t,e){this.filterManager=e;var s=this.filterManager.effectElements,i=document.createElementNS(vt,"feComponentTransfer");(s[9].p.k||0!==s[9].p.v||s[10].p.k||1!==s[10].p.v||s[11].p.k||1!==s[11].p.v||s[12].p.k||0!==s[12].p.v||s[13].p.k||1!==s[13].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(s[16].p.k||0!==s[16].p.v||s[17].p.k||1!==s[17].p.v||s[18].p.k||1!==s[18].p.v||s[19].p.k||0!==s[19].p.v||s[20].p.k||1!==s[20].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(s[23].p.k||0!==s[23].p.v||s[24].p.k||1!==s[24].p.v||s[25].p.k||1!==s[25].p.v||s[26].p.k||0!==s[26].p.v||s[27].p.k||1!==s[27].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(s[30].p.k||0!==s[30].p.v||s[31].p.k||1!==s[31].p.v||s[32].p.k||1!==s[32].p.v||s[33].p.k||0!==s[33].p.v||s[34].p.k||1!==s[34].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=document.createElementNS(vt,"feComponentTransfer")),(s[2].p.k||0!==s[2].p.v||s[3].p.k||1!==s[3].p.v||s[4].p.k||1!==s[4].p.v||s[5].p.k||0!==s[5].p.v||s[6].p.k||1!==s[6].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function X(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","400%"),t.setAttribute("height","400%"),this.filterManager=e;var s=document.createElementNS(vt,"feGaussianBlur");s.setAttribute("in","SourceAlpha"),s.setAttribute("result","drop_shadow_1"),s.setAttribute("stdDeviation","0"),this.feGaussianBlur=s,t.appendChild(s);var i=document.createElementNS(vt,"feOffset");i.setAttribute("dx","25"),i.setAttribute("dy","0"),i.setAttribute("in","drop_shadow_1"),i.setAttribute("result","drop_shadow_2"),this.feOffset=i,t.appendChild(i);var a=document.createElementNS(vt,"feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var r=document.createElementNS(vt,"feComposite");r.setAttribute("in","drop_shadow_3"),r.setAttribute("in2","drop_shadow_2"),r.setAttribute("operator","in"),r.setAttribute("result","drop_shadow_4"),t.appendChild(r);var n=document.createElementNS(vt,"feMerge");t.appendChild(n);var h;h=document.createElementNS(vt,"feMergeNode"),n.appendChild(h),h=document.createElementNS(vt,"feMergeNode"),h.setAttribute("in","SourceGraphic"),this.feMergeNode=h,this.feMerge=n,this.originalNodeAdded=!1,n.appendChild(h)}function q(t){var e,s=t.data.ef.length,i=m(10),a=Rt.createFilter(i),r=0;this.filters=[];var n;for(e=0;s>e;e+=1)20===t.data.ef[e].ty?(r+=1,n=new R(a,t.effects.effectElements[e]),this.filters.push(n)):21===t.data.ef[e].ty?(r+=1,n=new j(a,t.effects.effectElements[e]),this.filters.push(n)):22===t.data.ef[e].ty?(n=new O(t,t.effects.effectElements[e]),this.filters.push(n)):23===t.data.ef[e].ty?(r+=1,n=new B(a,t.effects.effectElements[e]),this.filters.push(n)):24===t.data.ef[e].ty?(r+=1,n=new G(a,t.effects.effectElements[e]),this.filters.push(n)):25===t.data.ef[e].ty&&(r+=1,n=new X(a,t.effects.effectElements[e]),this.filters.push(n));r&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url(#"+i+")"))}function Y(t,e,s,i,a){this._parent.constructor.call(this,t,e,s,i,a),this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?Array.apply(null,{length:this.layers.length}):[],this.data.tm&&(this.tm=It.getProp(this,this.data.tm,0,s.frameRate,this.dynamicProperties)),this.data.xt?(this.layerElement=document.createElementNS(vt,"g"),this.buildAllItems()):s.progressiveLoad||this.buildAllItems()}function W(t,e,s,i,a){this.assetData=s.getAssetData(t.refId),this._parent.constructor.call(this,t,e,s,i,a)}function H(t,e,s,i,a){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.viewData=[],this.shapeModifiers=[],this._parent.constructor.call(this,t,e,s,i,a)}function U(t,e,s,i,a){this._parent.constructor.call(this,t,e,s,i,a)}function Z(t){Xt.play(t)}function J(t){Xt.pause(t)}function K(t){Xt.togglePause(t)}function Q(t,e){Xt.setSpeed(t,e)}function $(t,e){Xt.setDirection(t,e)}function tt(t){Xt.stop(t)}function et(t){Xt.moveFrame(t)}function st(){Wt===!0?Xt.searchAnimations(Ht,Wt,Ut):Xt.searchAnimations()}function it(t){return Xt.registerAnimation(t)}function at(){Xt.resize()}function rt(){Xt.start()}function nt(t,e,s){Xt.goToAndStop(t,e,s)}function ht(t){yt=t}function ot(t){return Wt===!0&&(t.animationData=JSON.parse(Ht)),Xt.loadAnimation(t)}function pt(t){return Xt.destroy(t)}function lt(t){if("string"==typeof t)switch(t){case"high":wt=200;break;case"medium":wt=50;break;case"low":wt=10}else!isNaN(t)&&t>1&&(wt=t);e(wt>=50?!1:!0)}function ft(t,e){"expressions"===t&&(ut=e)}function mt(t){switch(t){case"propertyFactory":return It;case"shapePropertyFactory":return Lt;case"matrix":return k}}function dt(){"complete"===document.readyState&&(clearInterval($t),st())}function ct(t){for(var e=Qt.split("&"),s=0;s<e.length;s++){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}var ut,gt,vt="http://www.w3.org/2000/svg",yt=!0,bt=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),kt=(Math.round,Math.pow),Pt=Math.sqrt,At=(Math.abs,Math.floor),Mt=(Math.max,Math.min),Et={};!function(){var t,e=Object.getOwnPropertyNames(Math),s=e.length;for(t=0;s>t;t+=1)Et[e[t]]=Math[e[t]]}(),Et.random=Math.random,Et.abs=function(t){var e=typeof t;if("object"===e&&t.length){var s,i=Array.apply(null,{length:t.length}),a=t.length;for(s=0;a>s;s+=1)i[s]=Math.abs(t[s]);return i}return Math.abs(t)};var wt=150,St=Math.PI/180,Ft=.5519;e(!1);var xt=function(){var t,e,s=[];for(t=0;256>t;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e;return function(t,e,i){return 0>t&&(t=0),0>e&&(e=0),0>i&&(i=0),"#"+s[t]+s[e]+s[i]}}(),k=(function(){var t=[];return function(e,s){return void 0!==s&&(e[3]=s),t[e[0]]||(t[e[0]]={}),t[e[0]][e[1]]||(t[e[0]][e[1]]={}),t[e[0]][e[1]][e[2]]||(t[e[0]][e[1]][e[2]]={}),t[e[0]][e[1]][e[2]][e[3]]||(t[e[0]][e[1]][e[2]][e[3]]="rgba("+e.join(",")+")"),t[e[0]][e[1]][e[2]][e[3]]}}(),function(){function t(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function e(t){if(0===t)return this;var e=Math.cos(t),s=Math.sin(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function i(t){if(0===t)return this;var e=Math.cos(t),s=Math.sin(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function a(t){if(0===t)return this;var e=Math.cos(t),s=Math.sin(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function r(t){if(0===t)return this;var e=Math.cos(t),s=Math.sin(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function n(t,e){return this._t(1,e,t,1,0,0)}function h(t,e){return this.shear(Math.tan(t),Math.tan(e))}function o(t,e){var s=Math.cos(e),i=Math.sin(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function p(t,e,s){return s=isNaN(s)?1:s,1==t&&1==e&&1==s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function l(t,e,s,i,a,r,n,h,o,p,l,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=p,this.props[10]=l,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function f(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function m(t,e,s,i,a,r,n,h,o,p,l,f,m,d,c,u){if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===p&&1===l&&0===f)return(0!==m||0!==d||0!==c)&&(this.props[12]=this.props[12]*t+this.props[13]*a+this.props[14]*o+this.props[15]*m,this.props[13]=this.props[12]*e+this.props[13]*r+this.props[14]*p+this.props[15]*d,this.props[14]=this.props[12]*s+this.props[13]*n+this.props[14]*l+this.props[15]*c,this.props[15]=this.props[12]*i+this.props[13]*h+this.props[14]*f+this.props[15]*u),this;var g=this.props[0],v=this.props[1],y=this.props[2],b=this.props[3],k=this.props[4],P=this.props[5],A=this.props[6],M=this.props[7],E=this.props[8],w=this.props[9],S=this.props[10],F=this.props[11],x=this.props[12],D=this.props[13],C=this.props[14],_=this.props[15];return this.props[0]=g*t+v*a+y*o+b*m,this.props[1]=g*e+v*r+y*p+b*d,this.props[2]=g*s+v*n+y*l+b*c,this.props[3]=g*i+v*h+y*f+b*u,this.props[4]=k*t+P*a+A*o+M*m,this.props[5]=k*e+P*r+A*p+M*d,this.props[6]=k*s+P*n+A*l+M*c,this.props[7]=k*i+P*h+A*f+M*u,this.props[8]=E*t+w*a+S*o+F*m,this.props[9]=E*e+w*r+S*p+F*d,this.props[10]=E*s+w*n+S*l+F*c,this.props[11]=E*i+w*h+S*f+F*u,this.props[12]=x*t+D*a+C*o+_*m,this.props[13]=x*e+D*r+C*p+_*d,this.props[14]=x*s+D*n+C*l+_*c,this.props[15]=x*i+D*h+C*f+_*u,this}function d(t){var e;for(e=0;16>e;e+=1)t.props[e]=this.props[e]}function c(t){var e;for(e=0;16>e;e+=1)this.props[e]=t[e]}function u(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function g(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function v(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function y(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function b(t){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],s=this.props[5]/e,i=-this.props[1]/e,a=-this.props[4]/e,r=this.props[0]/e,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,h=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e;return[t[0]*s+t[1]*a+n,t[0]*i+t[1]*r+h,0]}function k(t){var e,s=t.length,i=[];for(e=0;s>e;e+=1)i[e]=b(t[e]);return i}function P(t,e,s,i){if(i&&2===i){var a=Ot.newPoint();return a[0]=t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],a[1]=t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],a}return[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function A(t,e){return gt(t*this.props[0]+e*this.props[4]+this.props[12])+","+gt(t*this.props[1]+e*this.props[5]+this.props[13])}function M(){return[this.props[0],this.props[1],this.props[2],this.props[3],this.props[4],this.props[5],this.props[6],this.props[7],this.props[8],this.props[9],this.props[10],this.props[11],this.props[12],this.props[13],this.props[14],this.props[15]]}function E(){return bt?"matrix3d("+s(this.props[0])+","+s(this.props[1])+","+s(this.props[2])+","+s(this.props[3])+","+s(this.props[4])+","+s(this.props[5])+","+s(this.props[6])+","+s(this.props[7])+","+s(this.props[8])+","+s(this.props[9])+","+s(this.props[10])+","+s(this.props[11])+","+s(this.props[12])+","+s(this.props[13])+","+s(this.props[14])+","+s(this.props[15])+")":(this.cssParts[1]=this.props.join(","),this.cssParts.join(""))}function w(){return"matrix("+this.props[0]+","+this.props[1]+","+this.props[4]+","+this.props[5]+","+this.props[12]+","+this.props[13]+")"}function S(){return""+this.toArray()}return function(){this.reset=t,this.rotate=e,this.rotateX=i,this.rotateY=a,this.rotateZ=r,this.skew=h,this.skewFromAxis=o,this.shear=n,this.scale=p,this.setTransform=l,this.translate=f,this.transform=m,this.applyToPoint=u,this.applyToX=g,this.applyToY=v,this.applyToZ=y,this.applyToPointArray=P,this.applyToPointStringified=A,this.toArray=M,this.toCSS=E,this.to2dCSS=w,this.toString=S,this.clone=d,this.cloneFromProps=c,this.inversePoints=k,this.inversePoint=b,this._t=this.transform,this.props=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.cssParts=["matrix3d(","",")"]}}());!function(t,e){function s(s,p,l){var d=[];p=1==p?{entropy:!0}:p||{};var y=n(r(p.entropy?[s,o(t)]:null==s?h():s,3),d),b=new i(d),k=function(){for(var t=b.g(m),e=u,s=0;g>t;)t=(t+s)*f,e*=f,s=b.g(1);for(;t>=v;)t/=2,e/=2,s>>>=1;return(t+s)/e};return k.int32=function(){return 0|b.g(4)},k.quick=function(){return b.g(4)/4294967296},k["double"]=k,n(o(b.S),t),(p.pass||l||function(t,s,i,r){return r&&(r.S&&a(r,b),t.state=function(){return a(b,{})}),i?(e[c]=t,s):t})(k,y,"global"in p?p.global:this==e,p.state)}function i(t){var e,s=t.length,i=this,a=0,r=i.i=i.j=0,n=i.S=[];for(s||(t=[s++]);f>a;)n[a]=a++;for(a=0;f>a;a++)n[a]=n[r=y&r+t[a%s]+(e=n[a])],n[r]=e;(i.g=function(t){for(var e,s=0,a=i.i,r=i.j,n=i.S;t--;)e=n[a=y&a+1],s=s*f+n[y&(n[a]=n[r=y&r+e])+(n[r]=e)];return i.i=a,i.j=r,s})(f)}function a(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function r(t,e){var s,i=[],a=typeof t;if(e&&"object"==a)for(s in t)try{i.push(r(t[s],e-1))}catch(n){}return i.length?i:"string"==a?t:t+"\x00"}function n(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return o(e)}function h(){try{if(p)return o(p.randomBytes(f));var e=new Uint8Array(f);return(l.crypto||l.msCrypto).getRandomValues(e),o(e)}catch(s){var i=l.navigator,a=i&&i.plugins;return[+new Date,l,a,l.screen,o(t)]}}function o(t){return String.fromCharCode.apply(0,t)}var p,l=this,f=256,m=6,d=52,c="random",u=e.pow(f,m),g=e.pow(2,d),v=2*g,y=f-1;e["seed"+c]=s,n(e.random(),t)}([],Et);var Dt=function(){function t(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(l[r])return l[r];var n=new o([t,e,s,i]);return l[r]=n,n}function e(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function i(t){return 3*t}function a(t,a,r){return((e(a,r)*t+s(a,r))*t+i(a))*t}function r(t,a,r){return 3*e(a,r)*t*t+2*s(a,r)*t+i(a)}function n(t,e,s,i,r){var n,h,o=0;do h=e+(s-e)/2,n=a(h,i,r)-t,n>0?s=h:e=h;while(Math.abs(n)>d&&++o<c);return h}function h(t,e,s,i){for(var n=0;f>n;++n){var h=r(e,s,i);if(0===h)return e;var o=a(e,s,i)-t;e-=o/h}return e}function o(t){this._p=t,this._mSampleValues=v?new Float32Array(u):new Array(u),this._precomputed=!1,this.get=this.get.bind(this)}var p={};p.getBezierEasing=t;var l={},f=4,m=.001,d=1e-7,c=10,u=11,g=1/(u-1),v="function"==typeof Float32Array;return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),e===s&&i===r?t:0===t?0:1===t?1:a(this._getTForX(t),s,r)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,(t!==e||s!==i)&&this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;u>s;++s)this._mSampleValues[s]=a(s*g,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,o=1,p=u-1;o!==p&&i[o]<=t;++o)a+=g;--o;var l=(t-i[o])/(i[o+1]-i[o]),f=a+l*g,d=r(f,e,s);return d>=m?h(t,f,e,s):0===d?f:n(t,a,a+g,e,s)}},p}();!function(){for(var t=0,e=["ms","moz","webkit","o"],s=0;s<e.length&&!window.requestAnimationFrame;++s)window.requestAnimationFrame=window[e[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[s]+"CancelAnimationFrame"]||window[e[s]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,s){var i=(new Date).getTime(),a=Math.max(0,16-(i-t)),r=window.setTimeout(function(){e(i+a)},a);
-
-return t=i+a,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var Ct=M(),_t=E(),Tt=function(){function t(t,e){var s=document.createElement("span");s.style.fontFamily=e;var i=document.createElement("span");i.innerHTML="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=t+", "+e,{node:i,w:a,parent:s}}function e(){var t,s,i,a=this.fonts.length,r=a;for(t=0;a>t;t+=1)if(this.fonts[t].loaded)r-=1;else if("t"===this.fonts[t].fOrigin){if(window.Typekit&&window.Typekit.load&&0===this.typekitLoaded){this.typekitLoaded=1;try{window.Typekit.load({async:!0,active:function(){this.typekitLoaded=2}.bind(this)})}catch(n){}}2===this.typekitLoaded&&(this.fonts[t].loaded=!0)}else"n"===this.fonts[t].fOrigin?this.fonts[t].loaded=!0:(s=this.fonts[t].monoCase.node,i=this.fonts[t].monoCase.w,s.offsetWidth!==i?(r-=1,this.fonts[t].loaded=!0):(s=this.fonts[t].sansCase.node,i=this.fonts[t].sansCase.w,s.offsetWidth!==i&&(r-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==r&&Date.now()-this.initTime<o?setTimeout(e.bind(this),20):setTimeout(function(){this.loaded=!0}.bind(this),0)}function s(t,e){var s=document.createElementNS(vt,"text");s.style.fontSize="100px",s.style.fontFamily=e.fFamily,s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.className=e.fClass):s.style.fontFamily=e.fFamily,t.appendChild(s);var i=document.createElement("canvas").getContext("2d");return i.font="100px "+e.fFamily,i}function i(i,a){if(!i)return void(this.loaded=!0);if(this.chars)return this.loaded=!0,void(this.fonts=i.list);var r,n=i.list,h=n.length;for(r=0;h>r;r+=1){if(n[r].loaded=!1,n[r].monoCase=t(n[r].fFamily,"monospace"),n[r].sansCase=t(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin){var o=document.createElement("style");o.type="text/css",o.innerHTML="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",a.appendChild(o)}else if("g"===n[r].fOrigin){var p=document.createElement("link");p.type="text/css",p.rel="stylesheet",p.href=n[r].fPath,a.appendChild(p)}else if("t"===n[r].fOrigin){var l=document.createElement("script");l.setAttribute("src",n[r].fPath),a.appendChild(l)}}else n[r].loaded=!0;n[r].helper=s(a,n[r]),this.fonts.push(n[r])}e.bind(this)()}function a(t){if(t){this.chars||(this.chars=[]);var e,s,i,a=t.length,r=this.chars.length;for(e=0;a>e;e+=1){for(s=0,i=!1;r>s;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}}function r(t,e,s){for(var i=0,a=this.chars.length;a>i;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}}function n(t,e,s){var i=this.getFontByName(e),a=i.helper;return a.measureText(t).width*s/100}function h(t){for(var e=0,s=this.fonts.length;s>e;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return"sans-serif"}var o=5e3,p=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.loaded=!1,this.initTime=Date.now()};return p.prototype.addChars=a,p.prototype.addFonts=i,p.prototype.getCharData=r,p.prototype.getFontByName=h,p.prototype.measureText=n,p}(),It=function(){function t(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t=this.comp.renderedFrame-this.offsetTime;if(!(t===this.lastFrame||this.lastFrame!==p&&(this.lastFrame>=this.keyframes[this.keyframes.length-1].t-this.offsetTime&&t>=this.keyframes[this.keyframes.length-1].t-this.offsetTime||this.lastFrame<this.keyframes[0].t-this.offsetTime&&t<this.keyframes[0].t-this.offsetTime))){for(var e,s,i=this.lastFrame<t?this._lastIndex:0,a=this.keyframes.length-1,r=!0;r;){if(e=this.keyframes[i],s=this.keyframes[i+1],i==a-1&&t>=s.t-this.offsetTime){e.h&&(e=s);break}if(s.t-this.offsetTime>t)break;a-1>i?i+=1:r=!1}this._lastIndex=i;var n,h,o,l,f,m;if(e.to){e.bezierData||Ct.buildBezierData(e);var d=e.bezierData;if(t>=s.t-this.offsetTime||t<e.t-this.offsetTime){var c=t>=s.t-this.offsetTime?d.points.length-1:0;for(h=d.points[c].point.length,n=0;h>n;n+=1)this.pv[n]=d.points[c].point[n],this.v[n]=this.mult?this.pv[n]*this.mult:this.pv[n],this.lastPValue[n]!==this.pv[n]&&(this.mdf=!0,this.lastPValue[n]=this.pv[n]);this._lastBezierData=null}else{e.__fnct?m=e.__fnct:(m=Dt.getBezierEasing(e.o.x,e.o.y,e.i.x,e.i.y,e.n).get,e.__fnct=m),o=m((t-(e.t-this.offsetTime))/(s.t-this.offsetTime-(e.t-this.offsetTime)));var u,g=d.segmentLength*o,v=this.lastFrame<t&&this._lastBezierData===d?this._lastAddedLength:0;for(f=this.lastFrame<t&&this._lastBezierData===d?this._lastPoint:0,r=!0,l=d.points.length;r;){if(v+=d.points[f].partialLength,0===g||0===o||f==d.points.length-1){for(h=d.points[f].point.length,n=0;h>n;n+=1)this.pv[n]=d.points[f].point[n],this.v[n]=this.mult?this.pv[n]*this.mult:this.pv[n],this.lastPValue[n]!==this.pv[n]&&(this.mdf=!0,this.lastPValue[n]=this.pv[n]);break}if(g>=v&&g<v+d.points[f+1].partialLength){for(u=(g-v)/d.points[f+1].partialLength,h=d.points[f].point.length,n=0;h>n;n+=1)this.pv[n]=d.points[f].point[n]+(d.points[f+1].point[n]-d.points[f].point[n])*u,this.v[n]=this.mult?this.pv[n]*this.mult:this.pv[n],this.lastPValue[n]!==this.pv[n]&&(this.mdf=!0,this.lastPValue[n]=this.pv[n]);break}l-1>f?f+=1:r=!1}this._lastPoint=f,this._lastAddedLength=v-d.points[f].partialLength,this._lastBezierData=d}}else{var y,b,k,P,A;for(a=e.s.length,i=0;a>i;i+=1){if(1!==e.h&&(t>=s.t-this.offsetTime?o=1:t<e.t-this.offsetTime?o=0:(e.o.x instanceof Array?(e.__fnct||(e.__fnct=[]),e.__fnct[i]?m=e.__fnct[i]:(y=e.o.x[i]||e.o.x[0],b=e.o.y[i]||e.o.y[0],k=e.i.x[i]||e.i.x[0],P=e.i.y[i]||e.i.y[0],m=Dt.getBezierEasing(y,b,k,P).get,e.__fnct[i]=m)):e.__fnct?m=e.__fnct:(y=e.o.x,b=e.o.y,k=e.i.x,P=e.i.y,m=Dt.getBezierEasing(y,b,k,P).get,e.__fnct=m),o=m((t-(e.t-this.offsetTime))/(s.t-this.offsetTime-(e.t-this.offsetTime))))),this.sh&&1!==e.h){var M=e.s[i],E=e.e[i];-180>M-E?M+=360:M-E>180&&(M-=360),A=M+(E-M)*o}else A=1===e.h?e.s[i]:e.s[i]+(e.e[i]-e.s[i])*o;1===a?(this.v=this.mult?A*this.mult:A,this.pv=A,this.lastPValue!=this.pv&&(this.mdf=!0,this.lastPValue=this.pv)):(this.v[i]=this.mult?A*this.mult:A,this.pv[i]=A,this.lastPValue[i]!==this.pv[i]&&(this.mdf=!0,this.lastPValue[i]=this.pv[i]))}}}this.lastFrame=t,this.frameId=this.elem.globalData.frameId}}function e(){}function s(t,s,i){this.mult=i,this.v=i?s.k*i:s.k,this.pv=s.k,this.mdf=!1,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.getValue=e}function i(t,s,i){this.mult=i,this.data=s,this.mdf=!1,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1,this.v=Array.apply(null,{length:s.k.length}),this.pv=Array.apply(null,{length:s.k.length}),this.lastValue=Array.apply(null,{length:s.k.length});var a=Array.apply(null,{length:s.k.length});this.vel=a.map(function(){return 0});var r,n=s.k.length;for(r=0;n>r;r+=1)this.v[r]=i?s.k[r]*i:s.k[r],this.pv[r]=s.k[r];this.getValue=e}function a(e,s,i){this.keyframes=s.k,this.offsetTime=e.data.st,this.lastValue=-99999,this.lastPValue=-99999,this.frameId=-1,this._lastIndex=0,this.k=!0,this.kf=!0,this.data=s,this.mult=i,this.elem=e,this.comp=e.comp,this.lastFrame=p,this.v=i?s.k[0].s[0]*i:s.k[0].s[0],this.pv=s.k[0].s[0],this.getValue=t}function r(e,s,i){var a,r,n,h,o,l=s.k.length;for(a=0;l-1>a;a+=1)s.k[a].to&&s.k[a].s&&s.k[a].e&&(r=s.k[a].s,n=s.k[a].e,h=s.k[a].to,o=s.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&Ct.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&Ct.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&Ct.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&Ct.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(s.k[a].to=null,s.k[a].ti=null));this.keyframes=s.k,this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this.mult=i,this.elem=e,this.comp=e.comp,this.getValue=t,this.frameId=-1,this._lastIndex=0,this.v=Array.apply(null,{length:s.k[0].s.length}),this.pv=Array.apply(null,{length:s.k[0].s.length}),this.lastValue=Array.apply(null,{length:s.k[0].s.length}),this.lastPValue=Array.apply(null,{length:s.k[0].s.length}),this.lastFrame=p}function n(t,e,n,h,o){var p;if(2===n)p=new l(t,e,o);else if(0===e.a)p=0===n?new s(t,e,h):new i(t,e,h);else if(1===e.a)p=0===n?new a(t,e,h):new r(t,e,h);else if(e.k.length)if("number"==typeof e.k[0])p=new i(t,e,h);else switch(n){case 0:p=new a(t,e,h);break;case 1:p=new r(t,e,h)}else p=new s(t,e,h);return p.k&&o.push(p),p}function h(t,e,s,i){return new m(t,e,s,i)}function o(t,e,s){return new d(t,e,s)}var p=-999999,l=function(){function t(){return ExpressionValue(this.p)}function e(){return ExpressionValue(this.px)}function s(){return ExpressionValue(this.py)}function i(){return ExpressionValue(this.a)}function a(){return ExpressionValue(this.or)}function r(){return ExpressionValue(this.r,1/St)}function n(){return ExpressionValue(this.s,100)}function h(){return ExpressionValue(this.o,100)}function o(){return ExpressionValue(this.sk)}function p(){return ExpressionValue(this.sa)}function l(t){var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function f(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0);if(this.mdf){if(this.v.reset(),this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r?this.v.rotate(-this.r.v):this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented&&this.p.keyframes&&this.p.getValueAtTime){var s,i;this.p.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/this.elem.globalData.frameRate,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/this.elem.globalData.frameRate,0)):this.p.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/this.elem.globalData.frameRate,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.01)/this.elem.globalData.frameRate,0)):(s=this.p.pv,i=this.p.getValueAtTime((this.p.lastFrame+this.p.offsetTime-.01)/this.elem.globalData.frameRate,this.p.offsetTime)),this.v.rotate(-Math.atan2(s[1]-i[1],s[0]-i[0]))}this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function m(){this.inverted=!0,this.iv=new k,this.k||(this.data.p.s?this.iv.translate(this.px.v,this.py.v,-this.pz.v):this.iv.translate(this.p.v[0],this.p.v[1],-this.p.v[2]),this.r?this.iv.rotate(-this.r.v):this.iv.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.s&&this.iv.scale(this.s.v[0],this.s.v[1],1),this.a&&this.iv.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]))}function d(){}return function(c,u,g){this.elem=c,this.frameId=-1,this.type="transform",this.dynamicProperties=[],this.mdf=!1,this.data=u,this.getValue=f,this.applyToMatrix=l,this.setInverted=m,this.autoOrient=d,this.v=new k,u.p.s?(this.px=It.getProp(c,u.p.x,0,0,this.dynamicProperties),this.py=It.getProp(c,u.p.y,0,0,this.dynamicProperties),u.p.z&&(this.pz=It.getProp(c,u.p.z,0,0,this.dynamicProperties))):this.p=It.getProp(c,u.p,1,0,this.dynamicProperties),u.r?this.r=It.getProp(c,u.r,0,St,this.dynamicProperties):u.rx&&(this.rx=It.getProp(c,u.rx,0,St,this.dynamicProperties),this.ry=It.getProp(c,u.ry,0,St,this.dynamicProperties),this.rz=It.getProp(c,u.rz,0,St,this.dynamicProperties),this.or=It.getProp(c,u.or,1,St,this.dynamicProperties)),u.sk&&(this.sk=It.getProp(c,u.sk,0,St,this.dynamicProperties),this.sa=It.getProp(c,u.sa,0,St,this.dynamicProperties)),u.a&&(this.a=It.getProp(c,u.a,1,0,this.dynamicProperties)),u.s&&(this.s=It.getProp(c,u.s,1,.01,this.dynamicProperties)),this.o=u.o?It.getProp(c,u.o,0,.01,g):{mdf:!1,v:1},this.dynamicProperties.length?g.push(this):(this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r?this.v.rotate(-this.r.v):this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?u.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])),Object.defineProperty(this,"position",{get:t}),Object.defineProperty(this,"xPosition",{get:e}),Object.defineProperty(this,"yPosition",{get:s}),Object.defineProperty(this,"orientation",{get:a}),Object.defineProperty(this,"anchorPoint",{get:i}),Object.defineProperty(this,"rotation",{get:r}),Object.defineProperty(this,"scale",{get:n}),Object.defineProperty(this,"opacity",{get:h}),Object.defineProperty(this,"skew",{get:o}),Object.defineProperty(this,"skewAxis",{get:p})}}(),f=function(){function t(t){if(this.prop.getValue(),this.cmdf=!1,this.omdf=!1,this.prop.mdf||t){var e,s,i,a=4*this.data.p;for(e=0;a>e;e+=1)s=e%4===0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this.cmdf=!0);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;a>e;e+=1)s=e%2===0?100:1,i=e%2===0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this.omdf=!0)}}function e(e,s,i){this.prop=n(e,s.k,1,null,[]),this.data=s,this.k=this.prop.k,this.c=Array.apply(null,{length:4*s.p});var a=s.k.k[0].s?s.k.k[0].s.length-4*s.p:s.k.k.length-4*s.p;this.o=Array.apply(null,{length:a}),this.cmdf=!1,this.omdf=!1,this.getValue=t,this.prop.k&&i.push(this),this.getValue(!0)}return function(t,s,i){return new e(t,s,i)}}(),m=function(){function t(t){var e=0,s=this.dataProps.length;if(this.elem.globalData.frameId!==this.frameId||t){for(this.mdf=!1,this.frameId=this.elem.globalData.frameId;s>e;){if(this.dataProps[e].p.mdf){this.mdf=!0;break}e+=1}if(this.mdf||t)for("svg"===this.renderer&&(this.dasharray=""),e=0;s>e;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dasharray+=" "+this.dataProps[e].p.v:this.dasharray[e]=this.dataProps[e].p.v:this.dashoffset=this.dataProps[e].p.v}}return function(e,s,i,a){this.elem=e,this.frameId=-1,this.dataProps=new Array(s.length),this.renderer=i,this.mdf=!1,this.k=!1,this.dasharray="svg"===this.renderer?"":new Array(s.length-1),this.dashoffset=0;var r,n,h=s.length;for(r=0;h>r;r+=1)n=It.getProp(e,s[r].v,0,0,a),this.k=n.k?!0:this.k,this.dataProps[r]={n:s[r].n,p:n};this.getValue=t,this.k?a.push(this):this.getValue(!0)}}(),d=function(){function t(){if(this.dynamicProperties.length){var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0)}var s=this.data.totalChars,i=2===this.data.r?1:100/s,a=this.o.v/i,r=this.s.v/i+a,n=this.e.v/i+a;if(r>n){var h=r;r=n,n=h}this.finalS=r,this.finalE=n}function e(t){var e=Dt.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get,r=0,n=this.finalS,h=this.finalE,o=this.data.sh;if(2==o)r=h===n?t>=h?1:0:s(0,i(.5/(h-n)+(t-n)/(h-n),1)),r=e(r);else if(3==o)r=h===n?t>=h?0:1:1-s(0,i(.5/(h-n)+(t-n)/(h-n),1)),r=e(r);else if(4==o)h===n?r=0:(r=s(0,i(.5/(h-n)+(t-n)/(h-n),1)),.5>r?r*=2:r=1-2*(r-.5)),r=e(r);else if(5==o){if(h===n)r=0;else{var p=h-n;t=i(s(0,t+.5-n),h-n);var l=-p/2+t,f=p/2;r=Math.sqrt(1-l*l/(f*f))}r=e(r)}else 6==o?(h===n?r=0:(t=i(s(0,t+.5-n),h-n),r=(1+Math.cos(Math.PI+2*Math.PI*t/(h-n)))/2),r=e(r)):(t>=a(n)&&(r=0>t-n?1-(n-t):s(0,i(h-t,1))),r=e(r));return r*this.a.v}var s=Math.max,i=Math.min,a=Math.floor;return function(s,i,a){this.mdf=!1,this.k=!1,this.data=i,this.dynamicProperties=[],this.getValue=t,this.getMult=e,this.comp=s.comp,this.finalS=0,this.finalE=0,this.s=It.getProp(s,i.s||{k:0},0,0,this.dynamicProperties),this.e="e"in i?It.getProp(s,i.e,0,0,this.dynamicProperties):{v:2===i.r?i.totalChars:100},this.o=It.getProp(s,i.o||{k:0},0,0,this.dynamicProperties),this.xe=It.getProp(s,i.xe||{k:0},0,0,this.dynamicProperties),this.ne=It.getProp(s,i.ne||{k:0},0,0,this.dynamicProperties),this.a=It.getProp(s,i.a,0,.01,this.dynamicProperties),this.dynamicProperties.length?a.push(this):this.getValue()}}(),c={};return c.getProp=n,c.getDashProp=h,c.getTextSelectorProp=o,c.getGradientProp=f,c}();w.prototype.setPathData=function(t,e){for(this.c=t;e>this._maxLength;)this.doubleArrayLength();for(var s=0;e>s;)this.v[s]=Ot.newPoint(),this.o[s]=Ot.newPoint(),this.i[s]=Ot.newPoint(),s+=1;this._length=e},w.prototype.doubleArrayLength=function(){this.v=this.v.concat(Array.apply(null,{length:this._maxLength})),this.i=this.i.concat(Array.apply(null,{length:this._maxLength})),this.o=this.o.concat(Array.apply(null,{length:this._maxLength})),this._maxLength*=2},w.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!a)&&(r[i]=Ot.newPoint()),r[i][0]=t,r[i][1]=e},w.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)};var Lt=function(){function t(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t=this.comp.renderedFrame-this.offsetTime;if(this.lastFrame===n||!(this.lastFrame<this.keyframes[0].t-this.offsetTime&&t<this.keyframes[0].t-this.offsetTime||this.lastFrame>this.keyframes[this.keyframes.length-1].t-this.offsetTime&&t>this.keyframes[this.keyframes.length-1].t-this.offsetTime)){var e,s,i;if(t<this.keyframes[0].t-this.offsetTime)e=this.keyframes[0].s[0],i=!0,this._lastIndex=0;else if(t>=this.keyframes[this.keyframes.length-1].t-this.offsetTime)e=1===this.keyframes[this.keyframes.length-2].h?this.keyframes[this.keyframes.length-1].s[0]:this.keyframes[this.keyframes.length-2].e[0],i=!0;else{for(var a,r,h,o,p,l,f=this.lastFrame<n?this._lastIndex:0,m=this.keyframes.length-1,d=!0;d&&(a=this.keyframes[f],r=this.keyframes[f+1],!(r.t-this.offsetTime>t));)m-1>f?f+=1:d=!1;i=1===a.h,this._lastIndex=f;var c;if(!i){if(t>=r.t-this.offsetTime)c=1;else if(t<a.t-this.offsetTime)c=0;else{var u;a.__fnct?u=a.__fnct:(u=Dt.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y).get,a.__fnct=u),c=u((t-(a.t-this.offsetTime))/(r.t-this.offsetTime-(a.t-this.offsetTime)))}s=a.e[0]}e=a.s[0]}o=this.v._length,l=e.i[0].length;var g,v=!1;for(h=0;o>h;h+=1)for(p=0;l>p;p+=1)i?(g=e.i[h][p],this.v.i[h][p]!==g&&(this.v.i[h][p]=g,this.pv.i[h][p]=g,v=!0),g=e.o[h][p],this.v.o[h][p]!==g&&(this.v.o[h][p]=g,this.pv.o[h][p]=g,v=!0),g=e.v[h][p],this.v.v[h][p]!==g&&(this.v.v[h][p]=g,this.pv.v[h][p]=g,v=!0)):(g=e.i[h][p]+(s.i[h][p]-e.i[h][p])*c,this.v.i[h][p]!==g&&(this.v.i[h][p]=g,this.pv.i[h][p]=g,v=!0),g=e.o[h][p]+(s.o[h][p]-e.o[h][p])*c,this.v.o[h][p]!==g&&(this.v.o[h][p]=g,this.pv.o[h][p]=g,v=!0),g=e.v[h][p]+(s.v[h][p]-e.v[h][p])*c,this.v.v[h][p]!==g&&(this.v.v[h][p]=g,this.pv.v[h][p]=g,v=!0));this.mdf=v,this.v.c=e.c,this.paths=this.localShapeCollection}this.lastFrame=t,this.frameId=this.elem.globalData.frameId}}function e(){return this.v}function s(){this.paths=this.localShapeCollection,this.k||(this.mdf=!1)}function i(t,i,a){this.comp=t.comp,this.k=!1,this.mdf=!1,this.v=Bt.newShape();var r=3===a?i.pt.k:i.ks.k;this.v.v=r.v,this.v.i=r.i,this.v.o=r.o,this.v.c=r.c,this.v._length=this.v.v.length,this.getValue=e,this.pv=Bt.clone(this.v),this.localShapeCollection=Gt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=s}function a(e,i,a){this.comp=e.comp,this.elem=e,this.offsetTime=e.data.st,this._lastIndex=0,this.getValue=t,this.keyframes=3===a?i.pt.k:i.ks.k,this.k=!0,this.kf=!0;{var r=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length}this.v=Bt.newShape(),this.v.setPathData(this.keyframes[0].s[0].c,r),this.pv=Bt.clone(this.v),this.localShapeCollection=Gt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=n,this.reset=s}function r(t,e,s,r){var n;if(3===s||4===s){var l=3===s?e.pt:e.ks,f=l.k;n=1===l.a||f.length?new a(t,e,s):new i(t,e,s)}else 5===s?n=new p(t,e):6===s?n=new h(t,e):7===s&&(n=new o(t,e));return n.k&&r.push(n),n}var n=-999999,h=function(){function t(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,a=this.s.v[1]/2;3!==this.d?(this.v.v[0][0]=t,this.v.v[0][1]=e-a,this.v.v[1][0]=t+s,this.v.v[1][1]=e,this.v.v[2][0]=t,this.v.v[2][1]=e+a,this.v.v[3][0]=t-s,this.v.v[3][1]=e,this.v.i[0][0]=t-s*i,this.v.i[0][1]=e-a,this.v.i[1][0]=t+s,this.v.i[1][1]=e-a*i,this.v.i[2][0]=t+s*i,this.v.i[2][1]=e+a,this.v.i[3][0]=t-s,this.v.i[3][1]=e+a*i,this.v.o[0][0]=t+s*i,this.v.o[0][1]=e-a,this.v.o[1][0]=t+s,this.v.o[1][1]=e+a*i,this.v.o[2][0]=t-s*i,this.v.o[2][1]=e+a,this.v.o[3][0]=t-s,this.v.o[3][1]=e-a*i):(this.v.v[0][0]=t,this.v.v[0][1]=e-a,this.v.v[1][0]=t-s,this.v.v[1][1]=e,this.v.v[2][0]=t,this.v.v[2][1]=e+a,this.v.v[3][0]=t+s,this.v.v[3][1]=e,this.v.i[0][0]=t+s*i,this.v.i[0][1]=e-a,this.v.i[1][0]=t-s,this.v.i[1][1]=e-a*i,this.v.i[2][0]=t-s*i,this.v.i[2][1]=e+a,this.v.i[3][0]=t+s,this.v.i[3][1]=e+a*i,this.v.o[0][0]=t-s*i,this.v.o[0][1]=e-a,this.v.o[1][0]=t-s,this.v.o[1][1]=e+a*i,this.v.o[2][0]=t+s*i,this.v.o[2][1]=e+a,this.v.o[3][0]=t+s,this.v.o[3][1]=e-a*i)}function e(t){var e,s=this.dynamicProperties.length;if(this.elem.globalData.frameId!==this.frameId){for(this.mdf=!1,this.frameId=this.elem.globalData.frameId,e=0;s>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.mdf&&this.convertEllToPath()}}var i=Ft;return function(i,a){this.v=Bt.newShape(),this.v.setPathData(!0,4),this.localShapeCollection=Gt.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=a.d,this.dynamicProperties=[],this.elem=i,this.comp=i.comp,this.frameId=-1,this.mdf=!1,this.getValue=e,this.convertEllToPath=t,this.reset=s,this.p=It.getProp(i,a.p,1,0,this.dynamicProperties),this.s=It.getProp(i,a.s,1,0,this.dynamicProperties),this.dynamicProperties.length?this.k=!0:this.convertEllToPath()}}(),o=function(){function t(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=-Math.PI/2,h=3===this.data.d?-1:1;for(n+=this.r.v,this.v._length=0,t=0;e>t;t+=1){var o=i*Math.cos(n),p=i*Math.sin(n),l=0===o&&0===p?0:p/Math.sqrt(o*o+p*p),f=0===o&&0===p?0:-o/Math.sqrt(o*o+p*p);o+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(o,p,o-l*r*a*h,p-f*r*a*h,o+l*r*a*h,p+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}function e(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,p=this.os.v,l=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(this.v._length=0,t=0;a>t;t+=1){e=n?h:o,s=n?p:l,i=n?f:m;var u=e*Math.cos(d),g=e*Math.sin(d),v=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),y=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-v*i*s*c,g-y*i*s*c,u+v*i*s*c,g+y*i*s*c,t,!0),n=!n,d+=r*c}}function i(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1,this.frameId=this.elem.globalData.frameId;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0);this.mdf&&this.convertToPath()}}return function(a,r){this.v=Bt.newShape(),this.v.setPathData(!0,0),this.elem=a,this.comp=a.comp,this.data=r,this.frameId=-1,this.d=r.d,this.dynamicProperties=[],this.mdf=!1,this.getValue=i,this.reset=s,1===r.sy?(this.ir=It.getProp(a,r.ir,0,0,this.dynamicProperties),this.is=It.getProp(a,r.is,0,.01,this.dynamicProperties),this.convertToPath=e):this.convertToPath=t,this.pt=It.getProp(a,r.pt,0,0,this.dynamicProperties),this.p=It.getProp(a,r.p,1,0,this.dynamicProperties),this.r=It.getProp(a,r.r,0,St,this.dynamicProperties),this.or=It.getProp(a,r.or,0,0,this.dynamicProperties),this.os=It.getProp(a,r.os,0,.01,this.dynamicProperties),this.localShapeCollection=Gt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:this.convertToPath()}}(),p=function(){function t(t){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.mdf&&this.convertRectToPath()}}function e(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=Mt(s,i,this.r.v),r=a*(1-Ft);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))}return function(i,a){this.v=Bt.newShape(),this.v.c=!0,this.localShapeCollection=Gt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=i,this.comp=i.comp,this.frameId=-1,this.d=a.d,this.dynamicProperties=[],this.mdf=!1,this.getValue=t,this.convertRectToPath=e,this.reset=s,this.p=It.getProp(i,a.p,1,0,this.dynamicProperties),this.s=It.getProp(i,a.s,1,0,this.dynamicProperties),this.r=It.getProp(i,a.r,0,0,this.dynamicProperties),this.dynamicProperties.length?this.k=!0:this.convertRectToPath()}}(),l={};return l.getShapeProp=r,l}(),Nt=function(){function t(t,e){i[t]||(i[t]=e)}function e(t,e,s,a){return new i[t](e,s,a)}var s={},i={};return s.registerModifier=t,s.getModifier=e,s}();S.prototype.initModifierProperties=function(){},S.prototype.addShapeToModifier=function(){},S.prototype.addShape=function(t){this.closed||(this.shapes.push({shape:t.sh,data:t,localShapeCollection:Gt.newShapeCollection()}),this.addShapeToModifier(t.sh))},S.prototype.init=function(t,e,s){this.elem=t,this.frameId=-1,this.shapes=[],this.dynamicProperties=[],this.mdf=!1,this.closed=!1,this.k=!1,this.isTrimming=!1,this.comp=t.comp,this.initModifierProperties(t,e),this.dynamicProperties.length?(this.k=!0,s.push(this)):this.getValue(!0)},A(S,F),F.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0);if(this.mdf||t){var i=this.o.v%360/360;0>i&&(i+=1);var a=this.s.v+i,r=this.e.v+i;if(a>r){var n=a;a=r,r=n}this.sValue=a,this.eValue=r,this.oValue=i}}},F.prototype.initModifierProperties=function(t,e){this.sValue=0,this.eValue=0,this.oValue=0,this.getValue=this.processKeys,this.s=It.getProp(t,e.s,0,.01,this.dynamicProperties),this.e=It.getProp(t,e.e,0,.01,this.dynamicProperties),this.o=It.getProp(t,e.o,0,0,this.dynamicProperties),this.m=e.m,this.dynamicProperties.length||this.getValue(!0)},F.prototype.getSegmentsLength=function(t){var e,s=t.c,i=t.v,a=t.o,r=t.i,n=t._length,h=[],o=0;for(e=0;n-1>e;e+=1)h[e]=Ct.getBezierLength(i[e],i[e+1],a[e],r[e+1]),o+=h[e].addedLength;return s&&(h[e]=Ct.getBezierLength(i[e],i[0],a[e],r[0]),o+=h[e].addedLength),{lengths:h,totalLength:o}},F.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];1>=e?r.push({s:t,e:e}):t>=1?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],p=r.length;for(n=0;p>n;n+=1)if(h=r[n],h.e*a<i||h.s*a>i+s);else{var l,f;l=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([l,f])}return o.length||o.push([0,0]),o},F.prototype.processShapes=function(t){var e,s,i,a,r,n,h,o=this.shapes.length,p=this.sValue,l=this.eValue,f=0;if(l===p)for(s=0;o>s;s+=1)this.shapes[s].localShapeCollection.releaseShapes(),this.shapes[s].shape.mdf=!0,this.shapes[s].shape.paths=this.shapes[s].localShapeCollection;else if(1===l&&0===p||0===l&&1===p){if(this.mdf)for(s=0;o>s;s+=1)this.shapes[s].shape.mdf=!0}else{var m,d,c=[];for(s=0;o>s;s+=1)if(m=this.shapes[s],m.shape.mdf||this.mdf||t||2===this.m){if(e=m.shape.paths,a=e._length,h=0,!m.shape.mdf&&m.pathsData)h=m.totalShapeLength;else{for(r=[],i=0;a>i;i+=1)n=this.getSegmentsLength(e.shapes[i]),r.push(n),h+=n.totalLength;m.totalShapeLength=h,m.pathsData=r}f+=h,m.shape.mdf=!0}else m.shape.paths=m.localShapeCollection;var i,a,u=p,g=l,v=0;for(s=o-1;s>=0;s-=1)if(m=this.shapes[s],m.shape.mdf){if(d=m.localShapeCollection,d.releaseShapes(),2===this.m&&o>1){var y=this.calculateShapeEdges(p,l,m.totalShapeLength,v,f);v+=m.totalShapeLength}else y=[[u,g]];for(a=y.length,i=0;a>i;i+=1){u=y[i][0],g=y[i][1],c.length=0,1>=g?c.push({s:m.totalShapeLength*u,e:m.totalShapeLength*g}):u>=1?c.push({s:m.totalShapeLength*(u-1),e:m.totalShapeLength*(g-1)}):(c.push({s:m.totalShapeLength*u,e:m.totalShapeLength}),c.push({s:0,e:m.totalShapeLength*(g-1)}));var b=this.addShapes(m,c[0]);if(c[0].s!==c[0].e){if(c.length>1)if(m.shape.v.c){var k=b.pop();this.addPaths(b,d),b=this.addShapes(m,c[1],k)}else this.addPaths(b,d),b=this.addShapes(m,c[1]);this.addPaths(b,d)}}m.shape.paths=d}}this.dynamicProperties.length||(this.mdf=!1)},F.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;i>s;s+=1)e.addShape(t[s])},F.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},F.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,p,l,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(s?(h=s._length,l=s._length):(s=Bt.newShape(),h=0,l=0),u.push(s),i=0;d>i;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;r>a;a+=1)if(n=o[a-1],c+n.addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(p=Ct.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegment(p.pt1,p.pt3,p.pt4,p.pt2,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c){if(n=o[a-1],c<=e.e){var v=o[a-1].addedLength;e.s<=c&&e.e>=c+v?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(p=Ct.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/v,(e.e-c)/v,o[a-1]),
-this.addSegment(p.pt1,p.pt3,p.pt4,p.pt2,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[l][0],s.v[l][1],"i",l),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;d-1>i&&(s=Bt.newShape(),g=!0,u.push(s),h=0)}return u},Nt.registerModifier("tm",F),A(S,x),x.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0)}},x.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=It.getProp(t,e.r,0,null,this.dynamicProperties),this.dynamicProperties.length||this.getValue(!0)},x.prototype.processPath=function(t,e){var s=Bt.newShape();s.c=t.c;var i,a,r,n,h,o,p,l,f,m,d,c,u,g=t._length,v=0;for(i=0;g>i;i+=1)a=t.v[i],n=t.o[i],r=t.i[i],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==i&&i!==g-1||t.c?(h=0===i?t.v[g-1]:t.v[i-1],o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)),p=o?Math.min(o/2,e)/o:0,l=c=a[0]+(h[0]-a[0])*p,f=u=a[1]-(a[1]-h[1])*p,m=l-(l-a[0])*Ft,d=f-(f-a[1])*Ft,s.setTripleAt(l,f,m,d,c,u,v),v+=1,h=i===g-1?t.v[0]:t.v[i+1],o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)),p=o?Math.min(o/2,e)/o:0,l=m=a[0]+(h[0]-a[0])*p,f=d=a[1]+(h[1]-a[1])*p,c=l-(l-a[0])*Ft,u=f-(f-a[1])*Ft,s.setTripleAt(l,f,m,d,c,u,v),v+=1):(s.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],v),v+=1):(s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],v),v+=1);return s},x.prototype.processShapes=function(t){var e,s,i,a,r=this.shapes.length,n=this.rd.v;if(0!==n){var h,o,p;for(s=0;r>s;s+=1){if(h=this.shapes[s],o=h.shape.paths,p=h.localShapeCollection,h.shape.mdf||this.mdf||t)for(p.releaseShapes(),h.shape.mdf=!0,e=h.shape.paths.shapes,a=h.shape.paths._length,i=0;a>i;i+=1)p.addShape(this.processPath(e[i],n));h.shape.paths=h.localShapeCollection}}this.dynamicProperties.length||(this.mdf=!1)},Nt.registerModifier("rd",x),A(S,D),D.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0)}},D.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=It.getProp(t,e.c,0,null,this.dynamicProperties),this.o=It.getProp(t,e.o,0,null,this.dynamicProperties),this.tr=It.getProp(t,e.tr,2,null,this.dynamicProperties),this.dynamicProperties.length||this.getValue(!0),this.pMatrix=new k,this.rMatrix=new k,this.sMatrix=new k,this.tMatrix=new k,this.matrix=new k},D.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},D.prototype.processShapes=function(t){this.dynamicProperties.length||(this.mdf=!1);var e,s,i,a,r,n,h,o,p,l,f,m,d,c,u=this.shapes.length,g=Math.ceil(this.c.v),v=this.o.v,y=v%1,b=v>0?Math.floor(v):Math.ceil(v),k=(this.tr.v.props,this.pMatrix.props),P=this.rMatrix.props,A=this.sMatrix.props,M=0;for(e=0;u>e;e+=1){if(a=this.shapes[e],r=a.localShapeCollection,a.shape.mdf||this.mdf||t){if(r.releaseShapes(),a.shape.mdf=!0,o=a.shape.paths,p=o.shapes,i=o._length,M=0,this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset(),v>0){for(;b>M;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),M+=1;y&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,y,!1),M+=y)}else if(0>b){for(;M>b;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),M-=1;y&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-y,!0),M-=y)}for(s=0;i>s;s+=1)for(n=p[s],h=0;g>h;h+=1){if(0!==h&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),a.data.transformers){for(a.data.lvl=0,c=0,f=a.data.elements.length,l=0;f>l;l+=1)c=Math.max(c,a.data.elements[l].st.lvl);for(d=a.data.transformers,f=d.length,l=f-1;l>=c;l-=1)m=d[l].mProps.v.props,this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15])}0!==M&&(this.matrix.transform(P[0],P[1],P[2],P[3],P[4],P[5],P[6],P[7],P[8],P[9],P[10],P[11],P[12],P[13],P[14],P[15]),this.matrix.transform(A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9],A[10],A[11],A[12],A[13],A[14],A[15]),this.matrix.transform(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15])),r.addShape(this.processPath(n,this.matrix)),this.matrix.reset(),M+=1}}a.shape.paths=r}},D.prototype.processPath=function(t,e){var s=Bt.clone(t,e);return s},Nt.registerModifier("rp",D),C.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(Array.apply(null,{length:this._maxLength})),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},C.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)Bt.release(this.shapes[t]);this._length=0};var Vt=function(){function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages}function e(t){var e="";if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e}function s(e){var s=document.createElement("img");s.addEventListener("load",t.bind(this),!1),s.addEventListener("error",t.bind(this),!1),s.src=e}function i(t){this.totalAssets=t.length;var i;for(i=0;i<this.totalAssets;i+=1)t[i].layers||(s.bind(this)(e.bind(this)(t[i])),this.totalImages+=1)}function a(t){this.path=t||""}function r(t){this.assetsPath=t||""}return function(){this.loadAssets=i,this.setAssetsPath=r,this.setPath=a,this.assetsPath="",this.path="",this.totalAssets=0,this.totalImages=0,this.loadedAssets=0}}(),zt=function(){var t={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),t}(),Rt=function(){function t(t){var e=document.createElementNS(vt,"filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e}function e(){var t=document.createElementNS(vt,"feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 0 1"),t}var s={};return s.createFilter=t,s.createAlphaToLuminanceFilter=e,s}(),jt=function(){function t(t){return t.concat(Array.apply(null,{length:t.length}))}return{"double":t}}(),Ot=function(){function t(){var t;return i?(i-=1,t=r[i]):t=[.1,.1],t}function e(t){i===a&&(r=jt["double"](r),a=2*a),r[i]=t,i+=1}var s={newPoint:t,release:e},i=0,a=8,r=Array.apply(null,{length:a});return s}(),Bt=function(){function t(){var t;return r?(r-=1,t=h[r]):t=new w,t}function e(t){r===n&&(h=jt["double"](h),n=2*n);var e,s=t._length;for(e=0;s>e;e+=1)Ot.release(t.v[e]),Ot.release(t.i[e]),Ot.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1,h[r]=t,r+=1}function s(t,s){for(;s--;)e(t[s])}function i(e,s){var i,a=e._length,r=t();r._length=e._length,r.c=e.c;var n;for(i=0;a>i;i+=1)s?(n=s.applyToPointArray(e.v[i][0],e.v[i][1],0,2),r.setXYAt(n[0],n[1],"v",i),Ot.release(n),n=s.applyToPointArray(e.o[i][0],e.o[i][1],0,2),r.setXYAt(n[0],n[1],"o",i),Ot.release(n),n=s.applyToPointArray(e.i[i][0],e.i[i][1],0,2),r.setXYAt(n[0],n[1],"i",i),Ot.release(n)):r.setTripleAt(e.v[i][0],e.v[i][1],e.o[i][0],e.o[i][1],e.i[i][0],e.i[i][1],i);return r}var a={clone:i,newShape:t,release:e,releaseArray:s},r=0,n=4,h=Array.apply(null,{length:n});return a}(),Gt=function(){function t(){var t;return a?(a-=1,t=n[a]):t=new C,t}function e(t){var e,s=t._length;for(e=0;s>e;e+=1)Bt.release(t.shapes[e]);t._length=0,a===r&&(n=jt["double"](n),r=2*r),n[a]=t,a+=1}function s(t,s){e(t),a===r&&(n=jt["double"](n),r=2*r),n[a]=t,a+=1}var i={newShapeCollection:t,release:e,clone:s},a=0,r=4,n=Array.apply(null,{length:r});return i}();_.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;e>=0;e--)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements()},_.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t);case 99:return null}return this.createBase(t)},_.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},_.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;e>t;t+=1)this.buildItem(t);this.checkPendingElements()},_.prototype.includeLayers=function(t){this.completeLayers=!1;var e,s,i=t.length,a=this.layers.length;for(e=0;i>e;e+=1)for(s=0;a>s;){if(this.layers[s].id==t[e].id){this.layers[s]=t[e];break}s+=1}},_.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},_.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},_.prototype.buildElementParenting=function(t,e,s){s=s||[];for(var i=this.elements,a=this.layers,r=0,n=a.length;n>r;)a[r].ind==e&&(i[r]&&i[r]!==!0?void 0!==a[r].parent?(s.push(i[r]),i[r]._isParent=!0,this.buildElementParenting(t,a[r].parent,s)):(s.push(i[r]),i[r]._isParent=!0,t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},_.prototype.addPendingElement=function(t){this.pendingElements.push(t)},A(_,T),T.prototype.createBase=function(t){return new N(t,this.layerElement,this.globalData,this)},T.prototype.createShape=function(t){return new H(t,this.layerElement,this.globalData,this)},T.prototype.createText=function(t){return new z(t,this.layerElement,this.globalData,this)},T.prototype.createImage=function(t){return new W(t,this.layerElement,this.globalData,this)},T.prototype.createComp=function(t){return new Y(t,this.layerElement,this.globalData,this)},T.prototype.createSolid=function(t){return new U(t,this.layerElement,this.globalData,this)},T.prototype.configAnimation=function(t){this.layerElement=document.createElementNS(vt,"svg"),this.layerElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.layerElement.setAttribute("width",t.w),this.layerElement.setAttribute("height",t.h),this.layerElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.layerElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.layerElement.style.width="100%",this.layerElement.style.height="100%",this.animationItem.wrapper.appendChild(this.layerElement);var e=document.createElementNS(vt,"defs");this.globalData.defs=e,this.layerElement.appendChild(e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.frameId=0,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h},this.data=t,this.globalData.frameRate=t.fr;var s=document.createElementNS(vt,"clipPath"),i=document.createElementNS(vt,"rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a="animationMask_"+m(10);s.setAttribute("id",a),s.appendChild(i);var r=document.createElementNS(vt,"g");r.setAttribute("clip-path","url(#"+a+")"),this.layerElement.appendChild(r),e.appendChild(s),this.layerElement=r,this.layers=t.layers,this.globalData.fontManager=new Tt,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.elements=Array.apply(null,{length:t.layers.length})},T.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;e>t;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},T.prototype.updateContainerSize=function(){},T.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,ut&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&this.elements[t-1]!==!0?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},T.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;s>e;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},T.prototype.renderFrame=function(t){if(this.renderedFrame!=t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t;var e,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);for(e=s-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},T.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;e>a;)this.elements[a]&&this.elements[a]!==!0&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},T.prototype.hide=function(){this.layerElement.style.display="none"},T.prototype.show=function(){this.layerElement.style.display="block"},T.prototype.searchExtraCompositions=function(t){var e,s=t.length,i=document.createElementNS(vt,"g");for(e=0;s>e;e+=1)if(t[e].xt){var a=this.createComp(t[e],i,this.globalData.comp,null);a.initExpressions(),this.globalData.projectInterface.registerComposition(a)}},I.prototype.getMaskProperty=function(t){return this.viewData[t].prop},I.prototype.prepareFrame=function(){var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue()},I.prototype.renderFrame=function(t){var e,s=this.masksProperties.length;for(e=0;s>e;e++)if((this.viewData[e].prop.mdf||this.firstFrame)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op.mdf||this.firstFrame)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp.mdf||this.firstFrame)&&(this.viewData[e].invRect.setAttribute("x",-t.props[12]),this.viewData[e].invRect.setAttribute("y",-t.props[13])),this.storedData[e].x&&(this.storedData[e].x.mdf||this.firstFrame))){var i=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url(#"+this.storedData[e].filterId+")")),i.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}this.firstFrame=!1},I.prototype.getMaskelement=function(){return this.maskElement},I.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},I.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;a>i;i+=1)r+=" C"+gt(e.o[i-1][0])+","+gt(e.o[i-1][1])+" "+gt(e.i[i][0])+","+gt(e.i[i][1])+" "+gt(e.v[i][0])+","+gt(e.v[i][1]);e.c&&a>1&&(r+=" C"+gt(e.o[i-1][0])+","+gt(e.o[i-1][1])+" "+gt(e.i[0][0])+","+gt(e.i[0][1])+" "+gt(e.v[0][0])+","+gt(e.v[0][1])),s.lastPath!==r&&(s.elem&&(e.c?t.inv?s.elem.setAttribute("d",this.solidPath+r):s.elem.setAttribute("d",r):s.elem.setAttribute("d","")),s.lastPath=r)},I.prototype.getMask=function(t){for(var e=0,s=this.masksProperties.length;s>e;){if(this.masksProperties[e].nm===t)return{maskPath:this.viewData[e].prop.pv};e+=1}},I.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.paths=null,this.masksProperties=null},L.prototype.checkMasks=function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;e>t;){if("n"!==this.data.masksProperties[t].mode&&this.data.masksProperties[t].cl!==!1)return!0;t+=1}return!1},L.prototype.checkParenting=function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent)},L.prototype.prepareFrame=function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isVisible!==!0&&(this.elemMdf=!0,this.globalData.mdf=!0,this.isVisible=!0,this.firstFrame=!0,this.data.hasMask&&(this.maskManager.firstFrame=!0)):this.isVisible!==!1&&(this.elemMdf=!0,this.globalData.mdf=!0,this.isVisible=!1);var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)(this.isVisible||this._isParent&&"transform"===this.dynamicProperties[e].type)&&(this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.elemMdf=!0,this.globalData.mdf=!0));return this.data.hasMask&&this.isVisible&&this.maskManager.prepareFrame(t*this.data.sr),this.currentFrameNum=t*this.data.sr,this.isVisible},L.prototype.globalToLocal=function(t){var e=[];e.push(this.finalTransform);for(var s=!0,i=this.comp;s;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):s=!1;var a,r,n=e.length;for(a=0;n>a;a+=1)r=e[a].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},L.prototype.initExpressions=function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?this.layerInterface.shapeInterface=ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.layerInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this))},L.prototype.setBlendMode=function(){var t="";switch(this.data.bm){case 1:t="multiply";break;case 2:t="screen";break;case 3:t="overlay";break;case 4:t="darken";break;case 5:t="lighten";break;case 6:t="color-dodge";break;case 7:t="color-burn";break;case 8:t="hard-light";break;case 9:t="soft-light";break;case 10:t="difference";break;case 11:t="exclusion";break;case 12:t="hue";break;case 13:t="saturation";break;case 14:t="color";break;case 15:t="luminosity"}var e=this.baseElement||this.layerElement;e.style["mix-blend-mode"]=t},L.prototype.init=function(){this.data.sr||(this.data.sr=1),this.dynamicProperties=[],this.data.ef&&(this.effects=new EffectsManager(this.data,this,this.dynamicProperties)),this.hidden=!1,this.firstFrame=!0,this.isVisible=!1,this._isParent=!1,this.currentFrameNum=-99999,this.lastNum=-99999,this.data.ks&&(this.finalTransform={mProp:It.getProp(this,this.data.ks,2,null,this.dynamicProperties),matMdf:!1,opMdf:!1,mat:new k,opacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.finalTransform.op=this.finalTransform.mProp.o,this.transform=this.finalTransform.mProp,11!==this.data.ty&&this.createElements(),this.data.hasMask&&this.addMasks(this.data)),this.elemMdf=!1},L.prototype.getType=function(){return this.type},L.prototype.resetHierarchy=function(){this.hierarchy?this.hierarchy.length=0:this.hierarchy=[]},L.prototype.getHierarchy=function(){return this.hierarchy||(this.hierarchy=[]),this.hierarchy},L.prototype.setHierarchy=function(t){this.hierarchy=t},L.prototype.getLayerSize=function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}},L.prototype.hide=function(){},L.prototype.mHelper=new k,P(L,N),N.prototype.createElements=function(){this.layerElement=document.createElementNS(vt,"g"),this.transformedElement=this.layerElement,this.data.hasMask&&(this.maskedElement=this.layerElement);var t=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var e=document.createElementNS(vt,"mask");if(e.setAttribute("id",this.layerId),e.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e),!zt.maskType&&1==this.data.td){e.setAttribute("mask-type","luminance");var s=m(10),i=Rt.createFilter(s);this.globalData.defs.appendChild(i),i.appendChild(Rt.createAlphaToLuminanceFilter());var a=document.createElementNS(vt,"g");a.appendChild(this.layerElement),t=a,e.appendChild(a),a.setAttribute("filter","url(#"+s+")")}}else if(2==this.data.td){var r=document.createElementNS(vt,"mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=document.createElementNS(vt,"g");r.appendChild(n);var s=m(10),i=Rt.createFilter(s),h=document.createElementNS(vt,"feColorMatrix");h.setAttribute("type","matrix"),h.setAttribute("color-interpolation-filters","sRGB"),h.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1"),i.appendChild(h),this.globalData.defs.appendChild(i);var o=document.createElementNS(vt,"rect");if(o.setAttribute("width",this.comp.data.w),o.setAttribute("height",this.comp.data.h),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("fill","#ffffff"),o.setAttribute("opacity","0"),n.setAttribute("filter","url(#"+s+")"),n.appendChild(o),n.appendChild(this.layerElement),t=n,!zt.maskType){r.setAttribute("mask-type","luminance"),i.appendChild(Rt.createAlphaToLuminanceFilter());var a=document.createElementNS(vt,"g");n.appendChild(o),a.appendChild(this.layerElement),t=a,n.appendChild(a)}this.globalData.defs.appendChild(r)}}else(this.data.hasMask||this.data.tt)&&this.data.tt?(this.matteElement=document.createElementNS(vt,"g"),this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(!this.data.ln&&!this.data.cl||4!==this.data.ty&&0!==this.data.ty||(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)),0===this.data.ty){var p=document.createElementNS(vt,"clipPath"),l=document.createElementNS(vt,"path");l.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f="cp_"+m(8);if(p.setAttribute("id",f),p.appendChild(l),this.globalData.defs.appendChild(p),this.checkMasks()){var d=document.createElementNS(vt,"g");d.setAttribute("clip-path","url(#"+f+")"),d.appendChild(this.layerElement),this.transformedElement=d,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url(#"+f+")")}0!==this.data.bm&&this.setBlendMode(),this.layerElement!==this.parentContainer&&(this.placeholder=null),this.data.ef&&(this.effectsManager=new q(this)),this.checkParenting()},N.prototype.setBlendMode=L.prototype.setBlendMode,N.prototype.renderFrame=function(t){if(3===this.data.ty||this.data.hd||!this.isVisible)return!1;this.lastNum=this.currentFrameNum,this.finalTransform.opMdf=this.firstFrame||this.finalTransform.op.mdf,this.finalTransform.matMdf=this.firstFrame||this.finalTransform.mProp.mdf,this.finalTransform.opacity=this.finalTransform.op.v;var e,s=this.finalTransform.mat;if(this.hierarchy){var i=0,a=this.hierarchy.length;if(!this.finalTransform.matMdf)for(;a>i;){if(this.hierarchy[i].finalTransform.mProp.mdf){this.finalTransform.matMdf=!0;break}i+=1}if(this.finalTransform.matMdf)for(e=this.finalTransform.mProp.v.props,s.cloneFromProps(e),i=0;a>i;i+=1)e=this.hierarchy[i].finalTransform.mProp.v.props,s.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}else this.isVisible&&(s=this.finalTransform.mProp.v);return this.finalTransform.matMdf&&this.layerElement&&this.transformedElement.setAttribute("transform",s.to2dCSS()),this.finalTransform.opMdf&&this.layerElement&&this.transformedElement.setAttribute("opacity",this.finalTransform.op.v),this.data.hasMask&&this.maskManager.renderFrame(s),this.effectsManager&&this.effectsManager.renderFrame(this.firstFrame),this.isVisible},N.prototype.destroy=function(){this.layerElement=null,this.parentContainer=null,this.matteElement&&(this.matteElement=null),this.maskManager&&this.maskManager.destroy()},N.prototype.getBaseElement=function(){return this.baseElement},N.prototype.addMasks=function(t){this.maskManager=new I(t,this,this.globalData)},N.prototype.setMatte=function(t){this.matteElement&&this.matteElement.setAttribute("mask","url(#"+t+")")},N.prototype.setMatte=function(t){this.matteElement&&this.matteElement.setAttribute("mask","url(#"+t+")")},N.prototype.hide=function(){},V.prototype.init=function(){this._parent.init.call(this),this.lettersChangedFlag=!1,this.currentTextDocumentData={};var t=this.data;this.viewData={m:{a:It.getProp(this,t.t.m.a,1,0,this.dynamicProperties)}};var e=this.data.t;if(e.a.length){this.viewData.a=Array.apply(null,{length:e.a.length});var s,i,a,r=e.a.length;for(s=0;r>s;s+=1)a=e.a[s],i={a:{},s:{}},"r"in a.a&&(i.a.r=It.getProp(this,a.a.r,0,St,this.dynamicProperties)),"rx"in a.a&&(i.a.rx=It.getProp(this,a.a.rx,0,St,this.dynamicProperties)),"ry"in a.a&&(i.a.ry=It.getProp(this,a.a.ry,0,St,this.dynamicProperties)),"sk"in a.a&&(i.a.sk=It.getProp(this,a.a.sk,0,St,this.dynamicProperties)),"sa"in a.a&&(i.a.sa=It.getProp(this,a.a.sa,0,St,this.dynamicProperties)),"s"in a.a&&(i.a.s=It.getProp(this,a.a.s,1,.01,this.dynamicProperties)),"a"in a.a&&(i.a.a=It.getProp(this,a.a.a,1,0,this.dynamicProperties)),"o"in a.a&&(i.a.o=It.getProp(this,a.a.o,0,.01,this.dynamicProperties)),"p"in a.a&&(i.a.p=It.getProp(this,a.a.p,1,0,this.dynamicProperties)),"sw"in a.a&&(i.a.sw=It.getProp(this,a.a.sw,0,0,this.dynamicProperties)),"sc"in a.a&&(i.a.sc=It.getProp(this,a.a.sc,1,0,this.dynamicProperties)),"fc"in a.a&&(i.a.fc=It.getProp(this,a.a.fc,1,0,this.dynamicProperties)),"fh"in a.a&&(i.a.fh=It.getProp(this,a.a.fh,0,0,this.dynamicProperties)),"fs"in a.a&&(i.a.fs=It.getProp(this,a.a.fs,0,.01,this.dynamicProperties)),"fb"in a.a&&(i.a.fb=It.getProp(this,a.a.fb,0,.01,this.dynamicProperties)),"t"in a.a&&(i.a.t=It.getProp(this,a.a.t,0,0,this.dynamicProperties)),i.s=It.getTextSelectorProp(this,a.s,this.dynamicProperties),i.s.t=a.s.t,this.viewData.a[s]=i}else this.viewData.a=[];e.p&&"m"in e.p?(this.viewData.p={f:It.getProp(this,e.p.f,0,0,this.dynamicProperties),l:It.getProp(this,e.p.l,0,0,this.dynamicProperties),r:e.p.r,m:this.maskManager.getMaskProperty(e.p.m)},this.maskPath=!0):this.maskPath=!1},V.prototype.prepareFrame=function(t){var e=0,s=this.data.t.d.k.length,i=this.data.t.d.k[e].s;for(e+=1;s>e&&!(this.data.t.d.k[e].t>t);)i=this.data.t.d.k[e].s,e+=1;this.lettersChangedFlag=!1,i!==this.currentTextDocumentData&&(this.currentTextDocumentData=i,this.lettersChangedFlag=!0,this.buildNewText()),this._parent.prepareFrame.call(this,t)},V.prototype.createPathShape=function(t,e){var s,i,a,r,n=e.length,h="";for(s=0;n>s;s+=1){for(a=e[s].ks.k.i.length,r=e[s].ks.k,i=1;a>i;i+=1)1==i&&(h+=" M"+t.applyToPointStringified(r.v[0][0],r.v[0][1])),h+=" C"+t.applyToPointStringified(r.o[i-1][0],r.o[i-1][1])+" "+t.applyToPointStringified(r.i[i][0],r.i[i][1])+" "+t.applyToPointStringified(r.v[i][0],r.v[i][1]);h+=" C"+t.applyToPointStringified(r.o[i-1][0],r.o[i-1][1])+" "+t.applyToPointStringified(r.i[0][0],r.i[0][1])+" "+t.applyToPointStringified(r.v[0][0],r.v[0][1]),h+="z"}return h},V.prototype.getMeasures=function(){var t,e,s,i,a=this.mHelper,r=this.renderType,n=this.data,h=this.currentTextDocumentData,o=h.l;if(this.maskPath){var p=this.viewData.p.m;if(!this.viewData.p.n||this.viewData.p.mdf){var l=p.v;this.viewData.p.r&&(l=b(l));var f={tLength:0,segments:[]};i=l.v.length-1;var m,d=0;for(s=0;i>s;s+=1)m={s:l.v[s],e:l.v[s+1],to:[l.o[s][0]-l.v[s][0],l.o[s][1]-l.v[s][1]],ti:[l.i[s+1][0]-l.v[s+1][0],l.i[s+1][1]-l.v[s+1][1]]},Ct.buildBezierData(m),f.tLength+=m.bezierData.segmentLength,f.segments.push(m),d+=m.bezierData.segmentLength;s=i,p.v.c&&(m={s:l.v[s],e:l.v[0],to:[l.o[s][0]-l.v[s][0],l.o[s][1]-l.v[s][1]],ti:[l.i[0][0]-l.v[0][0],l.i[0][1]-l.v[0][1]]},Ct.buildBezierData(m),f.tLength+=m.bezierData.segmentLength,f.segments.push(m),d+=m.bezierData.segmentLength),this.viewData.p.pi=f}var c,k,P,f=this.viewData.p.pi,A=this.viewData.p.f.v,M=0,E=1,w=0,S=!0,F=f.segments;if(0>A&&p.v.c)for(f.tLength<Math.abs(A)&&(A=-Math.abs(A)%f.tLength),M=F.length-1,P=F[M].bezierData.points,E=P.length-1;0>A;)A+=P[E].partialLength,E-=1,0>E&&(M-=1,P=F[M].bezierData.points,E=P.length-1);P=F[M].bezierData.points,k=P[E-1],c=P[E];var x,D,C=c.partialLength}i=o.length,t=0,e=0;var _,T,I,L,N,V=1.2*h.s*.714,z=!0,R=this.viewData,j=Array.apply(null,{length:i});L=R.a.length;var O,B,G,X,q,Y,W,H,U,Z,J,K,Q,$,tt,et,st=-1,it=A,at=M,rt=E,nt=-1,ht=0;for(s=0;i>s;s+=1)if(a.reset(),Y=1,o[s].n)t=0,e+=h.yOffset,e+=z?1:0,A=it,z=!1,ht=0,this.maskPath&&(M=at,E=rt,P=F[M].bezierData.points,k=P[E-1],c=P[E],C=c.partialLength,w=0),j[s]=this.emptyProp;else{if(this.maskPath){if(nt!==o[s].line){switch(h.j){case 1:A+=d-h.lineWidths[o[s].line];break;case 2:A+=(d-h.lineWidths[o[s].line])/2}nt=o[s].line}st!==o[s].ind&&(o[st]&&(A+=o[st].extra),A+=o[s].an/2,st=o[s].ind),A+=R.m.a.v[0]*o[s].an/200;var ot=0;for(I=0;L>I;I+=1)_=R.a[I].a,"p"in _&&(T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),ot+=B.length?_.p.v[0]*B[0]:_.p.v[0]*B),"a"in _&&(T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),ot+=B.length?_.a.v[0]*B[0]:_.a.v[0]*B);for(S=!0;S;)w+C>=A+ot||!P?(x=(A+ot-w)/c.partialLength,X=k.point[0]+(c.point[0]-k.point[0])*x,q=k.point[1]+(c.point[1]-k.point[1])*x,a.translate(-R.m.a.v[0]*o[s].an/200,-(R.m.a.v[1]*V/100)),S=!1):P&&(w+=c.partialLength,E+=1,E>=P.length&&(E=0,M+=1,F[M]?P=F[M].bezierData.points:p.v.c?(E=0,M=0,P=F[M].bezierData.points):(w-=c.partialLength,P=null)),P&&(k=c,c=P[E],C=c.partialLength));G=o[s].an/2-o[s].add,a.translate(-G,0,0)}else G=o[s].an/2-o[s].add,a.translate(-G,0,0),a.translate(-R.m.a.v[0]*o[s].an/200,-R.m.a.v[1]*V/100,0);for(ht+=o[s].l/2,I=0;L>I;I+=1)_=R.a[I].a,"t"in _&&(T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),this.maskPath?A+=B.length?_.t*B[0]:_.t*B:t+=B.length?_.t.v*B[0]:_.t.v*B);for(ht+=o[s].l/2,h.strokeWidthAnim&&(H=h.sw||0),h.strokeColorAnim&&(W=h.sc?[h.sc[0],h.sc[1],h.sc[2]]:[0,0,0]),h.fillColorAnim&&(U=[h.fc[0],h.fc[1],h.fc[2]]),I=0;L>I;I+=1)_=R.a[I].a,"a"in _&&(T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),B.length?a.translate(-_.a.v[0]*B[0],-_.a.v[1]*B[1],_.a.v[2]*B[2]):a.translate(-_.a.v[0]*B,-_.a.v[1]*B,_.a.v[2]*B));for(I=0;L>I;I+=1)_=R.a[I].a,"s"in _&&(T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),B.length?a.scale(1+(_.s.v[0]-1)*B[0],1+(_.s.v[1]-1)*B[1],1):a.scale(1+(_.s.v[0]-1)*B,1+(_.s.v[1]-1)*B,1));for(I=0;L>I;I+=1){if(_=R.a[I].a,T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),"sk"in _&&(B.length?a.skewFromAxis(-_.sk.v*B[0],_.sa.v*B[1]):a.skewFromAxis(-_.sk.v*B,_.sa.v*B)),"r"in _&&a.rotateZ(B.length?-_.r.v*B[2]:-_.r.v*B),"ry"in _&&a.rotateY(B.length?_.ry.v*B[1]:_.ry.v*B),"rx"in _&&a.rotateX(B.length?_.rx.v*B[0]:_.rx.v*B),"o"in _&&(Y+=B.length?(_.o.v*B[0]-Y)*B[0]:(_.o.v*B-Y)*B),h.strokeWidthAnim&&"sw"in _&&(H+=B.length?_.sw.v*B[0]:_.sw.v*B),h.strokeColorAnim&&"sc"in _)for(Z=0;3>Z;Z+=1)W[Z]=Math.round(B.length?255*(W[Z]+(_.sc.v[Z]-W[Z])*B[0]):255*(W[Z]+(_.sc.v[Z]-W[Z])*B));
-
-if(h.fillColorAnim){if("fc"in _)for(Z=0;3>Z;Z+=1)U[Z]=B.length?U[Z]+(_.fc.v[Z]-U[Z])*B[0]:U[Z]+(_.fc.v[Z]-U[Z])*B;"fh"in _&&(U=B.length?v(U,_.fh.v*B[0]):v(U,_.fh.v*B)),"fs"in _&&(U=B.length?u(U,_.fs.v*B[0]):u(U,_.fs.v*B)),"fb"in _&&(U=B.length?g(U,_.fb.v*B[0]):g(U,_.fb.v*B))}}for(I=0;L>I;I+=1)_=R.a[I].a,"p"in _&&(T=R.a[I].s,B=T.getMult(o[s].anIndexes[I],n.t.a[I].s.totalChars),this.maskPath?B.length?a.translate(0,_.p.v[1]*B[0],-_.p.v[2]*B[1]):a.translate(0,_.p.v[1]*B,-_.p.v[2]*B):B.length?a.translate(_.p.v[0]*B[0],_.p.v[1]*B[1],-_.p.v[2]*B[2]):a.translate(_.p.v[0]*B,_.p.v[1]*B,-_.p.v[2]*B));if(h.strokeWidthAnim&&(J=0>H?0:H),h.strokeColorAnim&&(K="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),h.fillColorAnim&&(Q="rgb("+Math.round(255*U[0])+","+Math.round(255*U[1])+","+Math.round(255*U[2])+")"),this.maskPath){if(a.translate(0,-h.ls),a.translate(0,R.m.a.v[1]*V/100+e,0),n.t.p.p){D=(c.point[1]-k.point[1])/(c.point[0]-k.point[0]);var pt=180*Math.atan(D)/Math.PI;c.point[0]<k.point[0]&&(pt+=180),a.rotate(-pt*Math.PI/180)}a.translate(X,q,0),A-=R.m.a.v[0]*o[s].an/200,o[s+1]&&st!==o[s+1].ind&&(A+=o[s].an/2,A+=h.tr/1e3*h.s)}else{switch(a.translate(t,e,0),h.ps&&a.translate(h.ps[0],h.ps[1]+h.ascent,0),h.j){case 1:a.translate(h.justifyOffset+(h.boxWidth-h.lineWidths[o[s].line]),0,0);break;case 2:a.translate(h.justifyOffset+(h.boxWidth-h.lineWidths[o[s].line])/2,0,0)}a.translate(0,-h.ls),a.translate(G,0,0),a.translate(R.m.a.v[0]*o[s].an/200,R.m.a.v[1]*V/100,0),t+=o[s].l+h.tr/1e3*h.s}"html"===r?$=a.toCSS():"svg"===r?$=a.to2dCSS():tt=[a.props[0],a.props[1],a.props[2],a.props[3],a.props[4],a.props[5],a.props[6],a.props[7],a.props[8],a.props[9],a.props[10],a.props[11],a.props[12],a.props[13],a.props[14],a.props[15]],et=Y,O=this.renderedLetters[s],!O||O.o===et&&O.sw===J&&O.sc===K&&O.fc===Q?"svg"!==r&&"html"!==r||O&&O.m===$?"canvas"!==r||O&&O.props[0]===tt[0]&&O.props[1]===tt[1]&&O.props[4]===tt[4]&&O.props[5]===tt[5]&&O.props[12]===tt[12]&&O.props[13]===tt[13]?N=O:(this.lettersChangedFlag=!0,N=new y(et,J,K,Q,null,tt)):(this.lettersChangedFlag=!0,N=new y(et,J,K,Q,$)):(this.lettersChangedFlag=!0,N=new y(et,J,K,Q,$,tt)),this.renderedLetters[s]=N}},V.prototype.emptyProp=new y,P(N,z),z.prototype.init=V.prototype.init,z.prototype.createPathShape=V.prototype.createPathShape,z.prototype.getMeasures=V.prototype.getMeasures,z.prototype.prepareFrame=V.prototype.prepareFrame,z.prototype.createElements=function(){this._parent.createElements.call(this),this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)},z.prototype.buildNewText=function(){var t,e,s=this.currentTextDocumentData;this.renderedLetters=Array.apply(null,{length:this.currentTextDocumentData.l?this.currentTextDocumentData.l.length:0}),s.fc?this.layerElement.setAttribute("fill","rgb("+Math.round(255*s.fc[0])+","+Math.round(255*s.fc[1])+","+Math.round(255*s.fc[2])+")"):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke","rgb("+Math.round(255*s.sc[0])+","+Math.round(255*s.sc[1])+","+Math.round(255*s.sc[2])+")"),this.layerElement.setAttribute("stroke-width",s.sw)),this.layerElement.setAttribute("font-size",s.s);var i=this.globalData.fontManager.getFontByName(s.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var a=s.fWeight,r=s.fStyle;this.layerElement.setAttribute("font-style",r),this.layerElement.setAttribute("font-weight",a)}var n=s.l||[];if(e=n.length){var h,o,p=this.mHelper,l="",f=this.data.singleShape;if(f)var m=0,d=0,c=s.lineWidths,u=s.boxWidth,g=!0;var v=0;for(t=0;e>t;t+=1){if(this.globalData.fontManager.chars?f&&0!==t||(h=this.textSpans[v]?this.textSpans[v]:document.createElementNS(vt,"path")):h=this.textSpans[v]?this.textSpans[v]:document.createElementNS(vt,"text"),h.style.display="inherit",h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),f&&n[t].n&&(m=0,d+=s.yOffset,d+=g?1:0,g=!1),p.reset(),this.globalData.fontManager.chars&&p.scale(s.s/100,s.s/100),f){switch(s.ps&&p.translate(s.ps[0],s.ps[1]+s.ascent,0),p.translate(0,-s.ls,0),s.j){case 1:p.translate(s.justifyOffset+(u-c[n[t].line]),0,0);break;case 2:p.translate(s.justifyOffset+(u-c[n[t].line])/2,0,0)}p.translate(m,d,0)}if(this.globalData.fontManager.chars){var y,b=this.globalData.fontManager.getCharData(s.t.charAt(t),i.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily);y=b?b.data:null,y&&y.shapes&&(o=y.shapes[0].it,f||(l=""),l+=this.createPathShape(p,o),f||h.setAttribute("d",l)),f||this.layerElement.appendChild(h)}else h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.layerElement.appendChild(h),f&&h.setAttribute("transform",p.to2dCSS());f&&(m+=n[t].l,m+=s.tr/1e3*s.s),this.textSpans[v]=h,v+=1}if(!f)for(;v<this.textSpans.length;)this.textSpans[v].style.display="none",v+=1;f&&this.globalData.fontManager.chars&&(h.setAttribute("d",l),this.layerElement.appendChild(h))}},z.prototype.hide=function(){this.hidden||(this.layerElement.style.display="none",this.hidden=!0)},z.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);if(e===!1)return void this.hide();if(this.hidden&&(this.hidden=!1,this.layerElement.style.display="block"),!this.data.singleShape&&(this.getMeasures(),this.lettersChangedFlag)){var s,i,a=this.renderedLetters,r=this.currentTextDocumentData.l;i=r.length;var n;for(s=0;i>s;s+=1)r[s].n||(n=a[s],this.textSpans[s].setAttribute("transform",n.m),this.textSpans[s].setAttribute("opacity",n.o),n.sw&&this.textSpans[s].setAttribute("stroke-width",n.sw),n.sc&&this.textSpans[s].setAttribute("stroke",n.sc),n.fc&&this.textSpans[s].setAttribute("fill",n.fc));this.firstFrame&&(this.firstFrame=!1)}},z.prototype.destroy=function(){this._parent.destroy.call(this._parent)},R.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e=this.filterManager.effectElements[0].p.v,s=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",s[0]-e[0]+" 0 0 0 "+e[0]+" "+(s[1]-e[1])+" 0 0 0 "+e[1]+" "+(s[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},j.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e=this.filterManager.effectElements[2].p.v,s=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+s+" 0")}},O.prototype.initialize=function(){var t,e,s,i,a=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,s=0):(s=this.filterManager.effectElements[0].p.v-1,i=s+1),e=document.createElementNS(vt,"g"),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1),s;i>s;s+=1)t=document.createElementNS(vt,"path"),e.appendChild(t),this.paths.push({p:t,m:s});if(3===this.filterManager.effectElements[10].p.v){var r=document.createElementNS(vt,"mask"),n="stms_"+m(10);r.setAttribute("id",n),r.setAttribute("mask-type","alpha"),r.appendChild(e),this.elem.globalData.defs.appendChild(r);var h=document.createElementNS(vt,"g");h.setAttribute("mask","url(#"+n+")"),a[0]&&h.appendChild(a[0]),this.elem.layerElement.appendChild(h),this.masker=r,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(var a=this.elem.layerElement.children||this.elem.layerElement.childNodes;a.length;)this.elem.layerElement.removeChild(a[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},O.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,s,i,a=this.paths.length;for(e=0;a>e;e+=1)if(s=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager.mdf||s.prop.mdf)&&i.setAttribute("d",s.lastPath),t||this.filterManager.effectElements[9].p.mdf||this.filterManager.effectElements[4].p.mdf||this.filterManager.effectElements[7].p.mdf||this.filterManager.effectElements[8].p.mdf||s.prop.mdf){var r;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=i.getTotalLength();r="0 0 0 "+o*n+" ";var p,l=o*(h-n),f=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,m=Math.floor(l/f);for(p=0;m>p;p+=1)r+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";r+="0 "+10*o+" 0 0"}else r="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;i.setAttribute("stroke-dasharray",r)}if((t||this.filterManager.effectElements[4].p.mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p.mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p.mdf)){var d=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+At(255*d[0])+","+At(255*d[1])+","+At(255*d[2])+")")}},B.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e=this.filterManager.effectElements[0].p.v,s=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,a=i[0]+" "+s[0]+" "+e[0],r=i[1]+" "+s[1]+" "+e[1],n=i[2]+" "+s[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",a),this.feFuncG.setAttribute("tableValues",r),this.feFuncB.setAttribute("tableValues",n)}},G.prototype.createFeFunc=function(t,e){var s=document.createElementNS(vt,t);return s.setAttribute("type","table"),e.appendChild(s),s},G.prototype.getTableValue=function(t,e,s,i,a){for(var r,n,h=0,o=256,p=Math.min(t,e),l=Math.max(t,e),f=Array.call(null,{length:o}),m=0,d=a-i,c=e-t;256>=h;)r=h/256,n=p>=r?0>c?a:i:r>=l?0>c?i:a:i+d*Math.pow((r-t)/c,1/s),f[m++]=n,h+=256/(o-1);return f.join(" ")},G.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){var e,s=this.filterManager.effectElements;this.feFuncRComposed&&(t||s[2].p.mdf||s[3].p.mdf||s[4].p.mdf||s[5].p.mdf||s[6].p.mdf)&&(e=this.getTableValue(s[2].p.v,s[3].p.v,s[4].p.v,s[5].p.v,s[6].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||s[9].p.mdf||s[10].p.mdf||s[11].p.mdf||s[12].p.mdf||s[13].p.mdf)&&(e=this.getTableValue(s[9].p.v,s[10].p.v,s[11].p.v,s[12].p.v,s[13].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||s[16].p.mdf||s[17].p.mdf||s[18].p.mdf||s[19].p.mdf||s[20].p.mdf)&&(e=this.getTableValue(s[16].p.v,s[17].p.v,s[18].p.v,s[19].p.v,s[20].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||s[23].p.mdf||s[24].p.mdf||s[25].p.mdf||s[26].p.mdf||s[27].p.mdf)&&(e=this.getTableValue(s[23].p.v,s[24].p.v,s[25].p.v,s[26].p.v,s[27].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||s[30].p.mdf||s[31].p.mdf||s[32].p.mdf||s[33].p.mdf||s[34].p.mdf)&&(e=this.getTableValue(s[30].p.v,s[31].p.v,s[32].p.v,s[33].p.v,s[34].p.v),this.feFuncA.setAttribute("tableValues",e))}},X.prototype.renderFrame=function(t){if(t||this.filterManager.mdf){if((t||this.filterManager.effectElements[4].p.mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p.mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",xt(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p.mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p.mdf||this.filterManager.effectElements[3].p.mdf){var s=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*St,a=s*Math.cos(i),r=s*Math.sin(i);this.feOffset.setAttribute("dx",a),this.feOffset.setAttribute("dy",r)}}},q.prototype.renderFrame=function(t){var e,s=this.filters.length;for(e=0;s>e;e+=1)this.filters[e].renderFrame(t)},P(N,Y),Y.prototype.hide=function(){if(!this.hidden){var t,e=this.elements.length;for(t=0;e>t;t+=1)this.elements[t]&&this.elements[t].hide();this.hidden=!0}},Y.prototype.prepareFrame=function(t){if(this._parent.prepareFrame.call(this,t),this.isVisible!==!1||this.data.xt){if(this.tm){var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}else this.renderedFrame=t/this.data.sr;var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=0;i>s;s+=1)(this.completeLayers||this.elements[s])&&this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st)}},Y.prototype.renderFrame=function(t){var e,s=this._parent.renderFrame.call(this,t),i=this.layers.length;if(s===!1)return void this.hide();for(this.hidden=!1,e=0;i>e;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();this.firstFrame&&(this.firstFrame=!1)},Y.prototype.setElements=function(t){this.elements=t},Y.prototype.getElements=function(){return this.elements},Y.prototype.destroy=function(){this._parent.destroy.call(this._parent);var t,e=this.layers.length;for(t=0;e>t;t+=1)this.elements[t]&&this.elements[t].destroy()},Y.prototype.checkLayers=T.prototype.checkLayers,Y.prototype.buildItem=T.prototype.buildItem,Y.prototype.buildAllItems=T.prototype.buildAllItems,Y.prototype.buildElementParenting=T.prototype.buildElementParenting,Y.prototype.createItem=T.prototype.createItem,Y.prototype.createImage=T.prototype.createImage,Y.prototype.createComp=T.prototype.createComp,Y.prototype.createSolid=T.prototype.createSolid,Y.prototype.createShape=T.prototype.createShape,Y.prototype.createText=T.prototype.createText,Y.prototype.createBase=T.prototype.createBase,Y.prototype.appendElementInPos=T.prototype.appendElementInPos,Y.prototype.checkPendingElements=T.prototype.checkPendingElements,Y.prototype.addPendingElement=T.prototype.addPendingElement,P(N,W),W.prototype.createElements=function(){var t=this.globalData.getAssetsPath(this.assetData);this._parent.createElements.call(this),this.innerElem=document.createElementNS(vt,"image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio","xMidYMid slice"),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.maskedElement=this.innerElem,this.layerElement.appendChild(this.innerElem),this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)},W.prototype.hide=function(){this.hidden||(this.layerElement.style.display="none",this.hidden=!0)},W.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);return e===!1?void this.hide():(this.hidden&&(this.hidden=!1,this.layerElement.style.display="block"),void(this.firstFrame&&(this.firstFrame=!1)))},W.prototype.destroy=function(){this._parent.destroy.call(this._parent),this.innerElem=null},P(N,H),H.prototype.lcEnum={1:"butt",2:"round",3:"butt"},H.prototype.ljEnum={1:"miter",2:"round",3:"butt"},H.prototype.buildExpressionInterface=function(){},H.prototype.createElements=function(){this._parent.createElements.call(this),this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.dynamicProperties,0),(!this.data.hd||this.data.td)&&i(this.layerElement)},H.prototype.setGradientData=function(t,e,s){var i,a="gr_"+m(10);i=1===e.t?document.createElementNS(vt,"linearGradient"):document.createElementNS(vt,"radialGradient"),i.setAttribute("id",a),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var r,n,h,o=[];for(h=4*e.g.p,n=0;h>n;n+=4)r=document.createElementNS(vt,"stop"),i.appendChild(r),o.push(r);t.setAttribute("gf"===e.ty?"fill":"stroke","url(#"+a+")"),this.globalData.defs.appendChild(i),s.gf=i,s.cst=o},H.prototype.setGradientOpacity=function(t,e,s){if(t.g.k.k[0].s&&t.g.k.k[0].s.length>4*t.g.p||t.g.k.k.length>4*t.g.p){var i,a,r,n,h=document.createElementNS(vt,"mask"),o=document.createElementNS(vt,"path");h.appendChild(o);var p="op_"+m(10),l="mk_"+m(10);h.setAttribute("id",l),i=1===t.t?document.createElementNS(vt,"linearGradient"):document.createElementNS(vt,"radialGradient"),i.setAttribute("id",p),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse"),n=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var f=[];for(r=4*t.g.p;n>r;r+=2)a=document.createElementNS(vt,"stop"),a.setAttribute("stop-color","rgb(255,255,255)"),i.appendChild(a),f.push(a);return o.setAttribute("gf"===t.ty?"fill":"stroke","url(#"+p+")"),this.globalData.defs.appendChild(i),this.globalData.defs.appendChild(h),e.of=i,e.ost=f,s.msElem=o,l}},H.prototype.searchShapes=function(t,e,s,i,a,r){r=r||[];var n,h,o,p,l,f=[].concat(r),m=t.length-1,d=[],c=[];for(n=m;n>=0;n-=1)if("fl"==t[n].ty||"st"==t[n].ty||"gf"==t[n].ty||"gs"==t[n].ty){e[n]={},p={type:t[n].ty,d:"",ld:"",lvl:a,mdf:!1};var u=document.createElementNS(vt,"path");if(e[n].o=It.getProp(this,t[n].o,0,.01,i),("st"==t[n].ty||"gs"==t[n].ty)&&(u.setAttribute("stroke-linecap",this.lcEnum[t[n].lc]||"round"),u.setAttribute("stroke-linejoin",this.ljEnum[t[n].lj]||"round"),u.setAttribute("fill-opacity","0"),1==t[n].lj&&u.setAttribute("stroke-miterlimit",t[n].ml),e[n].w=It.getProp(this,t[n].w,0,null,i),t[n].d)){var g=It.getDashProp(this,t[n].d,"svg",i);g.k||(u.setAttribute("stroke-dasharray",g.dasharray),u.setAttribute("stroke-dashoffset",g.dashoffset)),e[n].d=g}if("fl"==t[n].ty||"st"==t[n].ty)e[n].c=It.getProp(this,t[n].c,1,255,i),s.appendChild(u);else{e[n].g=It.getGradientProp(this,t[n].g,i),2==t[n].t&&(e[n].h=It.getProp(this,t[n].h,1,.01,i),e[n].a=It.getProp(this,t[n].a,1,St,i)),e[n].s=It.getProp(this,t[n].s,1,null,i),e[n].e=It.getProp(this,t[n].e,1,null,i),this.setGradientData(u,t[n],e[n],p);var v=this.setGradientOpacity(t[n],e[n],p);v&&u.setAttribute("mask","url(#"+v+")"),e[n].elem=u,s.appendChild(u)}2===t[n].r&&u.setAttribute("fill-rule","evenodd"),t[n].ln&&u.setAttribute("id",t[n].ln),t[n].cl&&u.setAttribute("class",t[n].cl),p.pElem=u,this.stylesList.push(p),e[n].style=p,d.push(p)}else if("gr"==t[n].ty){e[n]={it:[]};var y=document.createElementNS(vt,"g");s.appendChild(y),e[n].gr=y,this.searchShapes(t[n].it,e[n].it,y,i,a+1,f)}else if("tr"==t[n].ty)e[n]={transform:{op:It.getProp(this,t[n].o,0,.01,i),mProps:It.getProp(this,t[n],2,null,i)},elements:[]},l=e[n].transform,f.push(l);else if("sh"==t[n].ty||"rc"==t[n].ty||"el"==t[n].ty||"sr"==t[n].ty){e[n]={elements:[],caches:[],styles:[],transformers:f,lStr:""};var b=4;for("rc"==t[n].ty?b=5:"el"==t[n].ty?b=6:"sr"==t[n].ty&&(b=7),e[n].sh=Lt.getShapeProp(this,t[n],b,i),e[n].lvl=a,this.shapes.push(e[n].sh),this.addShapeToModifiers(e[n]),o=this.stylesList.length,h=0;o>h;h+=1)this.stylesList[h].closed||e[n].elements.push({ty:this.stylesList[h].type,st:this.stylesList[h]})}else if("tm"==t[n].ty||"rd"==t[n].ty||"ms"==t[n].ty||"rp"==t[n].ty){var k=Nt.getModifier(t[n].ty);k.init(this,t[n],i),this.shapeModifiers.push(k),c.push(k),e[n]=k}for(m=d.length,n=0;m>n;n+=1)d[n].closed=!0;for(m=c.length,n=0;m>n;n+=1)c[n].closed=!0},H.prototype.addShapeToModifiers=function(t){var e,s=this.shapeModifiers.length;for(e=0;s>e;e+=1)this.shapeModifiers[e].addShape(t)},H.prototype.renderModifiers=function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;e>t;t+=1)this.shapes[t].reset();for(e=this.shapeModifiers.length,t=e-1;t>=0;t-=1)this.shapeModifiers[t].processShapes(this.firstFrame)}},H.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);return e===!1?void this.hide():(this.globalToLocal([0,0,0]),this.hidden&&(this.layerElement.style.display="block",this.hidden=!1),this.renderModifiers(),void this.renderShape(null,null,!0,null))},H.prototype.hide=function(){if(!this.hidden){this.layerElement.style.display="none";var t,e=this.stylesList.length;for(t=e-1;t>=0;t-=1)"0"!==this.stylesList[t].ld&&(this.stylesList[t].ld="0",this.stylesList[t].pElem.style.display="none",this.stylesList[t].pElem.parentNode&&(this.stylesList[t].parent=this.stylesList[t].pElem.parentNode));this.hidden=!0}},H.prototype.renderShape=function(t,e,s,i){var a,r;if(!t)for(t=this.shapesData,r=this.stylesList.length,a=0;r>a;a+=1)this.stylesList[a].d="",this.stylesList[a].mdf=!1;e||(e=this.viewData),r=t.length-1;var n;for(a=r;a>=0;a-=1)n=t[a].ty,"tr"==n?((this.firstFrame||e[a].transform.op.mdf&&i)&&i.setAttribute("opacity",e[a].transform.op.v),(this.firstFrame||e[a].transform.mProps.mdf&&i)&&i.setAttribute("transform",e[a].transform.mProps.v.to2dCSS())):"sh"==n||"el"==n||"rc"==n||"sr"==n?this.renderPath(t[a],e[a]):"fl"==n?this.renderFill(t[a],e[a]):"gf"==n?this.renderGradient(t[a],e[a]):"gs"==n?(this.renderGradient(t[a],e[a]),this.renderStroke(t[a],e[a])):"st"==n?this.renderStroke(t[a],e[a]):"gr"==n&&this.renderShape(t[a].it,e[a].it,!1,e[a].gr);if(s){for(r=this.stylesList.length,a=0;r>a;a+=1)"0"===this.stylesList[a].ld&&(this.stylesList[a].ld="1",this.stylesList[a].pElem.style.display="block"),(this.stylesList[a].mdf||this.firstFrame)&&(this.stylesList[a].pElem.setAttribute("d",this.stylesList[a].d),this.stylesList[a].msElem&&this.stylesList[a].msElem.setAttribute("d",this.stylesList[a].d));this.firstFrame&&(this.firstFrame=!1)}},H.prototype.renderPath=function(t,e){var s,i,a,r,n,h,o,p,l=e.elements.length,f=e.lvl;for(p=0;l>p;p+=1){h=e.sh.mdf||this.firstFrame,n="M0 0";var m=e.sh.paths;if(r=m._length,e.elements[p].st.lvl<f){for(var d,c=this.mHelper.reset(),u=f-e.elements[p].st.lvl,g=e.transformers.length-1;u>0;)h=e.transformers[g].mProps.mdf||h,d=e.transformers[g].mProps.v.props,c.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),u--,g--;if(h){for(a=0;r>a;a+=1)if(o=m.shapes[a],o&&o._length){for(s=o._length,i=1;s>i;i+=1)1==i&&(n+=" M"+c.applyToPointStringified(o.v[0][0],o.v[0][1])),n+=" C"+c.applyToPointStringified(o.o[i-1][0],o.o[i-1][1])+" "+c.applyToPointStringified(o.i[i][0],o.i[i][1])+" "+c.applyToPointStringified(o.v[i][0],o.v[i][1]);1==s&&(n+=" M"+c.applyToPointStringified(o.v[0][0],o.v[0][1])),o.c&&(n+=" C"+c.applyToPointStringified(o.o[i-1][0],o.o[i-1][1])+" "+c.applyToPointStringified(o.i[0][0],o.i[0][1])+" "+c.applyToPointStringified(o.v[0][0],o.v[0][1]),n+="z")}e.caches[p]=n}else n=e.caches[p]}else if(h){for(a=0;r>a;a+=1)if(o=m.shapes[a],o&&o._length){for(s=o._length,i=1;s>i;i+=1)1==i&&(n+=" M"+o.v[0].join(",")),n+=" C"+o.o[i-1].join(",")+" "+o.i[i].join(",")+" "+o.v[i].join(",");1==s&&(n+=" M"+o.v[0].join(",")),o.c&&s&&(n+=" C"+o.o[i-1].join(",")+" "+o.i[0].join(",")+" "+o.v[0].join(","),n+="z")}e.caches[p]=n}else n=e.caches[p];e.elements[p].st.d+=n,e.elements[p].st.mdf=h||e.elements[p].st.mdf}},H.prototype.renderFill=function(t,e){var s=e.style;(e.c.mdf||this.firstFrame)&&s.pElem.setAttribute("fill","rgb("+At(e.c.v[0])+","+At(e.c.v[1])+","+At(e.c.v[2])+")"),(e.o.mdf||this.firstFrame)&&s.pElem.setAttribute("fill-opacity",e.o.v)},H.prototype.renderGradient=function(t,e){var s=e.gf,i=e.of,a=e.s.v,r=e.e.v;if(e.o.mdf||this.firstFrame){var n="gf"===t.ty?"fill-opacity":"stroke-opacity";e.elem.setAttribute(n,e.o.v)}if(e.s.mdf||this.firstFrame){var h=1===t.t?"x1":"cx",o="x1"===h?"y1":"cy";s.setAttribute(h,a[0]),s.setAttribute(o,a[1]),i&&(i.setAttribute(h,a[0]),i.setAttribute(o,a[1]))}var p,l,f,m;if(e.g.cmdf||this.firstFrame){p=e.cst;var d=e.g.c;for(f=p.length,l=0;f>l;l+=1)m=p[l],m.setAttribute("offset",d[4*l]+"%"),m.setAttribute("stop-color","rgb("+d[4*l+1]+","+d[4*l+2]+","+d[4*l+3]+")")}if(i&&(e.g.omdf||this.firstFrame)){p=e.ost;var c=e.g.o;for(f=p.length,l=0;f>l;l+=1)m=p[l],m.setAttribute("offset",c[2*l]+"%"),m.setAttribute("stop-opacity",c[2*l+1])}if(1===t.t)(e.e.mdf||this.firstFrame)&&(s.setAttribute("x2",r[0]),s.setAttribute("y2",r[1]),i&&(i.setAttribute("x2",r[0]),i.setAttribute("y2",r[1])));else{var u;if((e.s.mdf||e.e.mdf||this.firstFrame)&&(u=Math.sqrt(Math.pow(a[0]-r[0],2)+Math.pow(a[1]-r[1],2)),s.setAttribute("r",u),i&&i.setAttribute("r",u)),e.e.mdf||e.h.mdf||e.a.mdf||this.firstFrame){u||(u=Math.sqrt(Math.pow(a[0]-r[0],2)+Math.pow(a[1]-r[1],2)));var g=Math.atan2(r[1]-a[1],r[0]-a[0]),v=e.h.v>=1?.99:e.h.v<=-1?-.99:e.h.v,y=u*v,b=Math.cos(g+e.a.v)*y+a[0],k=Math.sin(g+e.a.v)*y+a[1];s.setAttribute("fx",b),s.setAttribute("fy",k),i&&(i.setAttribute("fx",b),i.setAttribute("fy",k))}}},H.prototype.renderStroke=function(t,e){var s=e.style,i=e.d;i&&i.k&&(i.mdf||this.firstFrame)&&(s.pElem.setAttribute("stroke-dasharray",i.dasharray),s.pElem.setAttribute("stroke-dashoffset",i.dashoffset)),e.c&&(e.c.mdf||this.firstFrame)&&s.pElem.setAttribute("stroke","rgb("+At(e.c.v[0])+","+At(e.c.v[1])+","+At(e.c.v[2])+")"),(e.o.mdf||this.firstFrame)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w.mdf||this.firstFrame)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))},H.prototype.destroy=function(){this._parent.destroy.call(this._parent),this.shapeData=null,this.viewData=null,this.parentContainer=null,this.placeholder=null},P(N,U),U.prototype.createElements=function(){this._parent.createElements.call(this);var t=document.createElementNS(vt,"rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t),this.innerElem=t,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl)},U.prototype.hide=W.prototype.hide,U.prototype.renderFrame=W.prototype.renderFrame,U.prototype.destroy=W.prototype.destroy;var Xt=function(){function t(t){for(var e=0,s=t.target;E>e;)A[e].animation===s&&(A.splice(e,1),e-=1,E-=1,s.isPaused||i()),e+=1}function e(t,e){if(!t)return null;for(var s=0;E>s;){if(A[s].elem==t&&null!==A[s].elem)return A[s].animation;s+=1}var i=new qt;return a(i,t),i.setData(t,e),i}function s(){S+=1,k()}function i(){S-=1,0===S&&(w=!0)}function a(e,a){e.addEventListener("destroy",t),e.addEventListener("_active",s),e.addEventListener("_idle",i),A.push({elem:a,animation:e}),E+=1}function r(t){var e=new qt;return a(e,null),e.setParams(t),e}function n(t,e){var s;for(s=0;E>s;s+=1)A[s].animation.setSpeed(t,e)}function h(t,e){var s;for(s=0;E>s;s+=1)A[s].animation.setDirection(t,e)}function o(t){var e;for(e=0;E>e;e+=1)A[e].animation.play(t)}function p(t,e){M=Date.now();var s;for(s=0;E>s;s+=1)A[s].animation.moveFrame(t,e)}function l(t){var e,s=t-M;for(e=0;E>e;e+=1)A[e].animation.advanceTime(s);M=t,w||requestAnimationFrame(l)}function f(t){M=t,requestAnimationFrame(l)}function m(t){var e;for(e=0;E>e;e+=1)A[e].animation.pause(t)}function d(t,e,s){var i;for(i=0;E>i;i+=1)A[i].animation.goToAndStop(t,e,s)}function c(t){var e;for(e=0;E>e;e+=1)A[e].animation.stop(t)}function u(t){var e;for(e=0;E>e;e+=1)A[e].animation.togglePause(t)}function g(t){var e;for(e=E-1;e>=0;e-=1)A[e].animation.destroy(t)}function v(t,s,i){var a,r=document.getElementsByClassName("bodymovin"),n=r.length;for(a=0;n>a;a+=1)i&&r[a].setAttribute("data-bm-type",i),e(r[a],t);if(s&&0===n){i||(i="svg");var h=document.getElementsByTagName("body")[0];h.innerHTML="";var o=document.createElement("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),h.appendChild(o),e(o,t)}}function y(){var t;for(t=0;E>t;t+=1)A[t].animation.resize()}function b(){requestAnimationFrame(f)}function k(){w&&(w=!1,requestAnimationFrame(f))}var P={},A=[],M=0,E=0,w=!0,S=0;return setTimeout(b,0),P.registerAnimation=e,P.loadAnimation=r,P.setSpeed=n,P.setDirection=h,P.play=o,P.moveFrame=p,P.pause=m,P.stop=c,P.togglePause=u,P.searchAnimations=v,P.resize=y,P.start=b,P.goToAndStop=d,P.destroy=g,P}(),qt=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.pendingElements=0,this.playCount=0,this.prerenderFramesFlag=!0,this.animationData={},this.layers=[],this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=m(10),this.scaleMode="fit",this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.subframeEnabled=yt,this.segments=[],this.pendingSegment=!1,this._idle=!0,this.projectInterface=t()};qt.prototype.setParams=function(t){var e=this;t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var s=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(s){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new T(this,t.rendererSettings);break;case"hybrid":case"html":default:this.renderer=new HybridRenderer(this,t.rendererSettings)}if(this.renderer.setProjectInterface(this.projectInterface),this.animType=s,""===t.loop||null===t.loop||(this.loop=t.loop===!1?!1:t.loop===!0?!0:parseInt(t.loop)),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.prerenderFramesFlag="prerender"in t?t.prerender:!0,this.autoloadSegments=t.hasOwnProperty("autoloadSegments")?t.autoloadSegments:!0,t.animationData)e.configAnimation(t.animationData);else if(t.path){"json"!=t.path.substr(-4)&&("/"!=t.path.substr(-1,1)&&(t.path+="/"),t.path+="data.json");var i=new XMLHttpRequest;this.path=-1!=t.path.lastIndexOf("\\")?t.path.substr(0,t.path.lastIndexOf("\\")+1):t.path.substr(0,t.path.lastIndexOf("/")+1),this.assetsPath=t.assetsPath,this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),i.open("GET",t.path,!0),i.send(),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status)e.configAnimation(JSON.parse(i.responseText));else try{var t=JSON.parse(i.responseText);e.configAnimation(t)}catch(s){}}}},qt.prototype.setData=function(t,e){var s={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===a||(s.loop="false"===a?!1:"true"===a?!0:parseInt(a));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:i.getNamedItem("bm-autoplay")?i.getNamedItem("bm-autoplay").value:!0;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"";var n=i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"";
-
-"false"===n&&(s.prerender=!1),this.setParams(s)},qt.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip),this.animationData.tf=this.totalFrames);var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;n>s;s+=1)for(e=0;a>e;){if(i[e].id==r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;a>e;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,_t.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),ut&&ut.initExpressions(this),this.renderer.renderFrame(null),this.loadNextSegment()},qt.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.animationData.tf);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=new XMLHttpRequest,i=this,a=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,s.open("GET",a,!0),s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i.includeLayers(JSON.parse(s.responseText));else try{var t=JSON.parse(s.responseText);i.includeLayers(t)}catch(e){}}},qt.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.animationData.tf),this.loadNextSegment()},qt.prototype.configAnimation=function(t){this.renderer&&this.renderer.destroyed||(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.animationData.tf=this.totalFrames,this.renderer.configAnimation(t),t.assets||(t.assets=[]),t.comps&&(t.assets=t.assets.concat(t.comps),t.comps=null),this.renderer.searchExtraCompositions(t.assets),this.layers=this.animationData.layers,this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.trigger("config_ready"),this.imagePreloader=new Vt,this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(t.assets),this.loadSegments(),this.updaFrameModifier(),this.renderer.globalData.fontManager?this.waitForFontsLoaded():(_t.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()))},qt.prototype.waitForFontsLoaded=function(){function t(){this.renderer.globalData.fontManager.loaded?(_t.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()):setTimeout(t.bind(this),20)}return function(){t.bind(this)()}}(),qt.prototype.addPendingElement=function(){this.pendingElements+=1},qt.prototype.elementLoaded=function(){this.pendingElements--,this.checkLoaded()},qt.prototype.checkLoaded=function(){0===this.pendingElements&&(ut&&ut.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.isLoaded=!0,this.gotoFrame(),this.autoplay&&this.play())},qt.prototype.resize=function(){this.renderer.updateContainerSize()},qt.prototype.setSubframe=function(t){this.subframeEnabled=t?!0:!1},qt.prototype.gotoFrame=function(){this.currentFrame=this.subframeEnabled?this.currentRawFrame:Math.floor(this.currentRawFrame),this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},qt.prototype.renderFrame=function(){this.isLoaded!==!1&&this.renderer.renderFrame(this.currentFrame+this.firstFrame)},qt.prototype.play=function(t){t&&this.name!=t||this.isPaused===!0&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger("_active")))},qt.prototype.pause=function(t){t&&this.name!=t||this.isPaused===!1&&(this.isPaused=!0,this.pendingSegment||(this._idle=!0,this.trigger("_idle")))},qt.prototype.togglePause=function(t){t&&this.name!=t||(this.isPaused===!0?this.play():this.pause())},qt.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.currentFrame=this.currentRawFrame=0,this.playCount=0,this.gotoFrame())},qt.prototype.goToAndStop=function(t,e,s){s&&this.name!=s||(this.setCurrentRawFrameValue(e?t:t*this.frameModifier),this.pause())},qt.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},qt.prototype.advanceTime=function(t){return this.pendingSegment?(this.pendingSegment=!1,this.adjustSegment(this.segments.shift()),void(this.isPaused&&this.play())):void(this.isPaused!==!0&&this.isLoaded!==!1&&this.setCurrentRawFrameValue(this.currentRawFrame+t*this.frameModifier))},qt.prototype.updateAnimation=function(t){this.setCurrentRawFrameValue(this.totalFrames*t)},qt.prototype.moveFrame=function(t,e){e&&this.name!=e||this.setCurrentRawFrameValue(this.currentRawFrame+t)},qt.prototype.adjustSegment=function(t){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.01)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(0)),this.trigger("segmentStart")},qt.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t-.01)),this.firstFrame=t,this.totalFrames=e-t,-1!==s&&this.goToAndStop(s,!0)},qt.prototype.playSegments=function(t,e){if("object"==typeof t[0]){var s,i=t.length;for(s=0;i>s;s+=1)this.segments.push(t[s])}else this.segments.push(t);e&&this.adjustSegment(this.segments.shift()),this.isPaused&&this.play()},qt.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op-this.animationData.ip+this.animationData.ip*this.frameRate)]),t&&this.adjustSegment(this.segments.shift())},qt.prototype.checkSegments=function(){this.segments.length&&(this.pendingSegment=!0)},qt.prototype.remove=function(t){t&&this.name!=t||this.renderer.destroy()},qt.prototype.destroy=function(t){t&&this.name!=t||this.renderer&&this.renderer.destroyed||(this.renderer.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null)},qt.prototype.setCurrentRawFrameValue=function(t){if(this.currentRawFrame=t,this.currentRawFrame>=this.totalFrames){if(this.checkSegments(),this.loop===!1)return this.currentRawFrame=this.totalFrames-.01,this.gotoFrame(),this.pause(),void this.trigger("complete");if(this.trigger("loopComplete"),this.playCount+=1,this.loop!==!0&&this.playCount==this.loop||this.pendingSegment)return this.currentRawFrame=this.totalFrames-.01,this.gotoFrame(),this.pause(),void this.trigger("complete");this.currentRawFrame=this.currentRawFrame%this.totalFrames}else if(this.currentRawFrame<0)return this.checkSegments(),this.playCount-=1,this.playCount<0&&(this.playCount=0),this.loop===!1||this.pendingSegment?(this.currentRawFrame=0,this.gotoFrame(),this.pause(),void this.trigger("complete")):(this.trigger("loopComplete"),this.currentRawFrame=(this.totalFrames+this.currentRawFrame)%this.totalFrames,void this.gotoFrame());this.gotoFrame()},qt.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},qt.prototype.setDirection=function(t){this.playDirection=0>t?-1:1,this.updaFrameModifier()},qt.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection},qt.prototype.getPath=function(){return this.path},qt.prototype.getAssetsPath=function(t){var e="";if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},qt.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;s>e;){if(t==this.assets[e].id)return this.assets[e];e+=1}},qt.prototype.hide=function(){this.renderer.hide()},qt.prototype.show=function(){this.renderer.show()},qt.prototype.getAssets=function(){return this.assets},qt.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new a(t,this.currentFrame,this.totalFrames,this.frameMult));break;case"loopComplete":this.triggerEvent(t,new n(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new r(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new h(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new o(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new a(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new n(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new r(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new h(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new o(t,this))},qt.prototype.addEventListener=p,qt.prototype.removeEventListener=l,qt.prototype.triggerEvent=f;var Yt={};Yt.play=Z,Yt.pause=J,Yt.togglePause=K,Yt.setSpeed=Q,Yt.setDirection=$,Yt.stop=tt,Yt.moveFrame=et,Yt.searchAnimations=st,Yt.registerAnimation=it,Yt.loadAnimation=ot,Yt.setSubframeRendering=ht,Yt.resize=at,Yt.start=rt,Yt.goToAndStop=nt,Yt.destroy=pt,Yt.setQuality=lt,Yt.installPlugin=ft,Yt.__getFactory=mt,Yt.version="4.6.10";var Wt="__[STANDALONE]__",Ht="__[ANIMATIONDATA]__",Ut="";if(Wt){var Zt=document.getElementsByTagName("script"),Jt=Zt.length-1,Kt=Zt[Jt]||{src:""},Qt=Kt.src.replace(/^[^\?]+\??/,"");Ut=ct("renderer")}var $t=setInterval(dt,100);return Yt});
\ No newline at end of file
diff --git a/build/player/lottie.js b/build/player/lottie.js
new file mode 100644
index 0000000..970263f
--- /dev/null
+++ b/build/player/lottie.js
Binary files differ
diff --git a/build/player/lottie.min.js b/build/player/lottie.min.js
new file mode 100644
index 0000000..48f338a
--- /dev/null
+++ b/build/player/lottie.min.js
@@ -0,0 +1,8 @@
+"undefined"!=typeof navigator&&function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(t):(t.lottie=e(t),t.bodymovin=t.lottie)}(window||{},function(window){"use strict";function ProjectInterface(){return{}}function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,i,r){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=r<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,i,r){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=r<0?-1:1}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function BMDestroyEvent(t,e){this.type=t,this.target=e}function randomString(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var i,r="";for(i=t;i>0;--i)r+=e[Math.round(Math.random()*(e.length-1))];return r}function HSVtoRGB(t,e,i){var r,s,a,n,o,h,l,p;switch(n=Math.floor(6*t),o=6*t-n,h=i*(1-e),l=i*(1-o*e),p=i*(1-(1-o)*e),n%6){case 0:r=i,s=p,a=h;break;case 1:r=l,s=i,a=h;break;case 2:r=h,s=i,a=p;break;case 3:r=h,s=l,a=i;break;case 4:r=p,s=h,a=i;break;case 5:r=i,s=h,a=l}return[r,s,a]}function RGBtoHSV(t,e,i){var r,s=Math.max(t,e,i),a=Math.min(t,e,i),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:r=0;break;case t:r=e-i+n*(e<i?6:0),r/=6*n;break;case e:r=i-t+2*n,r/=6*n;break;case i:r=t-e+4*n,r/=6*n}return[r,o,h]}function addSaturationToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}function BaseEvent(){}function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}function extendPrototype(t,e){var i,r,s=t.length;for(i=0;i<s;i+=1){r=t[i].prototype;for(var a in r)r.hasOwnProperty(a)&&(e.prototype[a]=r[a])}}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){function t(t,e,i,r,s,a){var n=t*r+e*s+i*a-s*r-a*t-i*e;return n>-.001&&n<.001}function e(e,i,r,s,a,n,o,h,l){if(0===r&&0===n&&0===l)return t(e,i,s,a,o,h);var p,m=Math.sqrt(Math.pow(s-e,2)+Math.pow(a-i,2)+Math.pow(n-r,2)),f=Math.sqrt(Math.pow(o-e,2)+Math.pow(h-i,2)+Math.pow(l-r,2)),c=Math.sqrt(Math.pow(o-s,2)+Math.pow(h-a,2)+Math.pow(l-n,2));return p=m>f?m>c?m-f-c:c-f-m:c>f?c-f-m:f-m-c,p>-1e-4&&p<1e-4}function i(t){var e,i=segments_length_pool.newElement(),r=t.c,s=t.v,a=t.o,n=t.i,o=t._length,l=i.lengths,p=0;for(e=0;e<o-1;e+=1)l[e]=h(s[e],s[e+1],a[e],n[e+1]),p+=l[e].addedLength;return r&&(l[e]=h(s[e],s[0],a[e],n[0]),p+=l[e].addedLength),i.totalLength=p,i}function r(t){this.segmentLength=0,this.points=new Array(t)}function s(t,e){this.partialLength=t,this.point=e}function a(t,e){var i=e.percents,r=e.lengths,s=i.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===r[a])return i[a];for(var h=r[a]>n?-1:1,l=!0;l;)if(r[a]<=n&&r[a+1]>n?(o=(n-r[a])/(r[a+1]-r[a]),l=!1):a+=h,a<0||a>=s-1){if(a===s-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}function n(t,e,i,r,s,n){var o=a(s,n),h=1-o,l=Math.round(1e3*(h*h*h*t[0]+(o*h*h+h*o*h+h*h*o)*i[0]+(o*o*h+h*o*o+o*h*o)*r[0]+o*o*o*e[0]))/1e3,p=Math.round(1e3*(h*h*h*t[1]+(o*h*h+h*o*h+h*h*o)*i[1]+(o*o*h+h*o*o+o*h*o)*r[1]+o*o*o*e[1]))/1e3;return[l,p]}function o(t,e,i,r,s,n,o){s=s<0?0:s>1?1:s;var h=a(s,o);n=n>1?1:n;var l,m=a(n,o),f=t.length,c=1-h,d=1-m,u=c*c*c,y=h*c*c*3,g=h*h*c*3,v=h*h*h,b=c*c*d,E=h*c*d+c*h*d+c*c*m,x=h*h*d+c*h*m+h*c*m,S=h*h*m,P=c*d*d,C=h*d*d+c*m*d+c*d*m,_=h*m*d+c*m*m+h*d*m,A=h*m*m,D=d*d*d,T=m*d*d+d*m*d+d*d*m,M=m*m*d+d*m*m+m*d*m,k=m*m*m;for(l=0;l<f;l+=1)p[4*l]=Math.round(1e3*(u*t[l]+y*i[l]+g*r[l]+v*e[l]))/1e3,p[4*l+1]=Math.round(1e3*(b*t[l]+E*i[l]+x*r[l]+S*e[l]))/1e3,p[4*l+2]=Math.round(1e3*(P*t[l]+C*i[l]+_*r[l]+A*e[l]))/1e3,p[4*l+3]=Math.round(1e3*(D*t[l]+T*i[l]+M*r[l]+k*e[l]))/1e3;return p}var h=(Math,function(){return function(t,e,i,r){var s,a,n,o,h,l,p=defaultCurveSegments,m=0,f=[],c=[],d=bezier_length_pool.newElement();for(n=i.length,s=0;s<p;s+=1){for(h=s/(p-1),l=0,a=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*i[a]+3*(1-h)*bm_pow(h,2)*r[a]+bm_pow(h,3)*e[a],f[a]=o,null!==c[a]&&(l+=bm_pow(f[a]-c[a],2)),c[a]=f[a];l&&(l=bm_sqrt(l),m+=l),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d}}()),l=function(){var e={};return function(i){var a=i.s,n=i.e,o=i.to,h=i.ti,l=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+o[0]+"_"+o[1]+"_"+h[0]+"_"+h[1]).replace(/\./g,"p");if(e[l])return void(i.bezierData=e[l]);var p,m,f,c,d,u,y,g=defaultCurveSegments,v=0,b=null;2===a.length&&(a[0]!=n[0]||a[1]!=n[1])&&t(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&t(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])&&(g=2);var E=new r(g);for(f=o.length,p=0;p<g;p+=1){for(y=createSizedArray(f),d=p/(g-1),u=0,m=0;m<f;m+=1)c=bm_pow(1-d,3)*a[m]+3*bm_pow(1-d,2)*d*(a[m]+o[m])+3*(1-d)*bm_pow(d,2)*(n[m]+h[m])+bm_pow(d,3)*n[m],y[m]=c,null!==b&&(u+=bm_pow(y[m]-b[m],2));u=bm_sqrt(u),v+=u,E.points[p]=new s(u,y),b=y}E.segmentLength=v,i.bezierData=E,e[l]=E}}(),p=createTypedArray("float32",8);return{getSegmentsLength:i,getNewSegment:o,getPointInSegment:n,buildBezierData:l,pointOnLine2D:t,pointOnLine3D:e}}function dataFunctionManager(){function t(s,a,o){var h,l,p,m,f,c,d,u,y=s.length;for(m=0;m<y;m+=1)if(h=s[m],"ks"in h&&!h.completed){if(h.completed=!0,h.tt&&(s[m-1].td=h.tt),l=[],p=-1,h.hasMask){var g=h.masksProperties;for(c=g.length,f=0;f<c;f+=1)if(g[f].pt.k.i)r(g[f].pt.k);else for(u=g[f].pt.k.length,d=0;d<u;d+=1)g[f].pt.k[d].s&&r(g[f].pt.k[d].s[0]),g[f].pt.k[d].e&&r(g[f].pt.k[d].e[0])}0===h.ty?(h.layers=e(h.refId,a),t(h.layers,a,o)):4===h.ty?i(h.shapes):5==h.ty&&n(h,o)}}function e(t,e){for(var i=0,r=e.length;i<r;){if(e[i].id===t)return e[i].layers.__used?JSON.parse(JSON.stringify(e[i].layers)):(e[i].layers.__used=!0,e[i].layers);i+=1}}function i(t){var e,s,a,n=t.length,o=!1;for(e=n-1;e>=0;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)r(t[e].ks.k);else for(a=t[e].ks.k.length,s=0;s<a;s+=1)t[e].ks.k[s].s&&r(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&r(t[e].ks.k[s].e[0]);o=!0}else"gr"==t[e].ty&&i(t[e].it)}function r(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function s(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&void 0))}function a(e,i){e.__complete||(l(e),o(e),h(e),p(e),t(e.layers,e.assets,i),e.__complete=!0)}function n(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var o=function(){function t(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function e(e){var i,r=e.length;for(i=0;i<r;i+=1)5===e[i].ty&&t(e[i])}var i=[4,4,14];return function(t){if(s(i,t.v)&&(e(t.layers),t.assets)){var r,a=t.assets.length;for(r=0;r<a;r+=1)t.assets[r].layers&&e(t.assets[r].layers)}}}(),h=function(){var t=[4,7,99];return function(e){if(e.chars&&!s(t,e.v)){var i,a,n,o,h,l=e.chars.length;for(i=0;i<l;i+=1)if(e.chars[i].data&&e.chars[i].data.shapes)for(h=e.chars[i].data.shapes[0].it,n=h.length,a=0;a<n;a+=1)o=h[a].ks.k,o.__converted||(r(h[a].ks.k),o.__converted=!0)}}}(),l=function(){function t(e){var i,r,s,a=e.length;for(i=0;i<a;i+=1)if("gr"===e[i].ty)t(e[i].it);else if("fl"===e[i].ty||"st"===e[i].ty)if(e[i].c.k&&e[i].c.k[0].i)for(s=e[i].c.k.length,r=0;r<s;r+=1)e[i].c.k[r].s&&(e[i].c.k[r].s[0]/=255,e[i].c.k[r].s[1]/=255,e[i].c.k[r].s[2]/=255,e[i].c.k[r].s[3]/=255),e[i].c.k[r].e&&(e[i].c.k[r].e[0]/=255,e[i].c.k[r].e[1]/=255,e[i].c.k[r].e[2]/=255,e[i].c.k[r].e[3]/=255);else e[i].c.k[0]/=255,e[i].c.k[1]/=255,e[i].c.k[2]/=255,e[i].c.k[3]/=255}function e(e){var i,r=e.length;for(i=0;i<r;i+=1)4===e[i].ty&&t(e[i].shapes)}var i=[4,1,9];return function(t){if(s(i,t.v)&&(e(t.layers),t.assets)){var r,a=t.assets.length;for(r=0;r<a;r+=1)t.assets[r].layers&&e(t.assets[r].layers)}}}(),p=function(){function t(e){var i,r,s,a=e.length,n=!1;for(i=a-1;i>=0;i-=1)if("sh"==e[i].ty){if(e[i].ks.k.i)e[i].ks.k.c=e[i].closed;else for(s=e[i].ks.k.length,r=0;r<s;r+=1)e[i].ks.k[r].s&&(e[i].ks.k[r].s[0].c=e[i].closed),e[i].ks.k[r].e&&(e[i].ks.k[r].e[0].c=e[i].closed);n=!0}else"gr"==e[i].ty&&t(e[i].it)}function e(e){var i,r,s,a,n,o,h=e.length;for(r=0;r<h;r+=1){if(i=e[r],i.hasMask){var l=i.masksProperties;for(a=l.length,s=0;s<a;s+=1)if(l[s].pt.k.i)l[s].pt.k.c=l[s].cl;else for(o=l[s].pt.k.length,n=0;n<o;n+=1)l[s].pt.k[n].s&&(l[s].pt.k[n].s[0].c=l[s].cl),l[s].pt.k[n].e&&(l[s].pt.k[n].e[0].c=l[s].cl)}4===i.ty&&t(i.shapes)}}var i=[4,4,18];return function(t){if(s(i,t.v)&&(e(t.layers),t.assets)){var r,a=t.assets.length;for(r=0;r<a;r+=1)t.assets[r].layers&&e(t.assets[r].layers)}}}(),m={};return m.completeData=a,m}function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,i){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(t);var r,s,a=e.length||0;for(r=0;r<a;r+=1)s=PropertyFactory.getProp(t,e[r].v,0,0,this),this.k=s.k||this.k,this.dataProps[r]={n:e[r].n,p:s};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(t),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function TextAnimatorDataProperty(t,e,i){var r={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,i):r,rx:a.rx?s(t,a.rx,0,degToRads,i):r,ry:a.ry?s(t,a.ry,0,degToRads,i):r,sk:a.sk?s(t,a.sk,0,degToRads,i):r,sa:a.sa?s(t,a.sa,0,degToRads,i):r,s:a.s?s(t,a.s,1,.01,i):r,a:a.a?s(t,a.a,1,0,i):r,o:a.o?s(t,a.o,0,.01,i):r,p:a.p?s(t,a.p,1,0,i):r,sw:a.sw?s(t,a.sw,0,0,i):r,sc:a.sc?s(t,a.sc,1,0,i):r,fc:a.fc?s(t,a.fc,1,0,i):r,fh:a.fh?s(t,a.fh,0,0,i):r,fs:a.fs?s(t,a.fs,0,.01,i):r,fb:a.fb?s(t,a.fb,0,.01,i):r,t:a.t?s(t,a.t,0,0,i):r},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function LetterProps(t,e,i,r,s,a){this.o=t,this.sw=e,this.sc=i,this.fc=r,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!r,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=-1,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__test:!0},this.copyFromDocumentData(this.data.d.k[0].s),this.searchProperty()||(this.completeTextData(this.currentData),this.keysIndex=0)}function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var i=createNS("g");this.svgElement.appendChild(i),this.layerElement=i;var r=createNS("defs");this.svgElement.appendChild(r),this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||e.hideOnTransparent!==!1,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||""},this.globalData={_mdf:!1,frameNum:-1,defs:r,frameId:0,compSize:{w:0,h:0},renderConfig:this.renderConfig,fontManager:new FontManager},this.elements=[],this.pendingElements=[],this.destroyed=!1}function MaskElement(t,e,i){this.data=t,this.element=e,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var r,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,l,p,m,f,c=this.masksProperties,d=0,u=[],y=randomString(10),g="clipPath",v="clip-path";for(r=0;r<a;r++)if(("a"!==c[r].mode&&"n"!==c[r].mode||c[r].inv||100!==c[r].o.k)&&(g="mask",v="mask"),"s"!=c[r].mode&&"i"!=c[r].mode||0!==d?l=null:(l=createNS("rect"),l.setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w),l.setAttribute("height",this.element.comp.data.h),u.push(l)),n=createNS("path"),"n"!=c[r].mode){d+=1,n.setAttribute("fill","s"===c[r].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero");var b;if(0!==c[r].x.k?(g="mask",v="mask",f=PropertyFactory.getProp(this.element,c[r].x,0,null,this.element),b="fi_"+randomString(10),p=createNS("filter"),p.setAttribute("id",b),m=createNS("feMorphology"),m.setAttribute("operator","dilate"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),p.appendChild(m),s.appendChild(p),n.setAttribute("stroke","s"===c[r].mode?"#000000":"#ffffff")):(m=null,f=null),this.storedData[r]={elem:n,x:f,expan:m,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==c[r].mode){h=u.length;var E=createNS("g");for(o=0;o<h;o+=1)E.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(n),s.appendChild(x),E.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(E)}else u.push(n);c[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[r],3),invRect:l},this.viewData[r].prop.k||this.drawPath(c[r],this.viewData[r].prop.v,this.viewData[r])}else this.viewData[r]={op:PropertyFactory.getProp(this.element,c[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[r],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=u.length,r=0;r<a;r+=1)this.maskElement.appendChild(u[r]);d>0&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!1,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var r=0,s=t.length;r<s;){if(t[r].mProps.dynamicProperties.length){this._isAnimated=!0;break}r+=1}}function SVGTransformData(t,e,i){this.transform={mProps:t,op:e,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i}function SVGGradientFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,i)}function SVGGradientStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,i),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function BaseElement(){}function NullElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initFrame(),this.initTransform(t,e,i),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i)}function ISolidElement(t,e,i){this.initElement(t,e,i)}function SVGCompElement(t,e,i){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextElement(t,e,i){this.textSpans=[],this.renderType="svg",this.initElement(t,e,i)}function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");if(i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),i.setAttribute("result","f1"),t.appendChild(i),i=createNS("feColorMatrix"),i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result","f2"),t.appendChild(i),this.matrixFilter=i,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var r=createNS("feMerge");t.appendChild(r);var s;s=createNS("feMergeNode"),s.setAttribute("in","SourceGraphic"),r.appendChild(s),s=createNS("feMergeNode"),s.setAttribute("in","f2"),r.appendChild(s)}}function SVGFillFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(i),this.matrixFilter=i}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),i.setAttribute("result","f1"),t.appendChild(i);var r=createNS("feComponentTransfer");r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),this.matrixFilter=r;var s=createNS("feFuncR");s.setAttribute("type","table"),r.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),r.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),r.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var i=this.filterManager.effectElements,r=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",r)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",r)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",r)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",r)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),r=createNS("feComponentTransfer")),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&(r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),this.feFuncRComposed=this.createFeFunc("feFuncR",r),this.feFuncGComposed=this.createFeFunc("feFuncG",r),this.feFuncBComposed=this.createFeFunc("feFuncB",r))}function SVGDropShadowEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","400%"),t.setAttribute("height","400%"),this.filterManager=e;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,t.appendChild(i);var r=createNS("feOffset");r.setAttribute("dx","25"),r.setAttribute("dy","0"),r.setAttribute("in","drop_shadow_1"),r.setAttribute("result","drop_shadow_2"),this.feOffset=r,t.appendChild(r);var s=createNS("feFlood");s.setAttribute("flood-color","#00ff00"),s.setAttribute("flood-opacity","1"),s.setAttribute("result","drop_shadow_3"),this.feFlood=s,t.appendChild(s);var a=createNS("feComposite");a.setAttribute("in","drop_shadow_3"),a.setAttribute("in2","drop_shadow_2"),a.setAttribute("operator","in"),a.setAttribute("result","drop_shadow_4"),t.appendChild(a);var n=createNS("feMerge");t.appendChild(n);var o;o=createNS("feMergeNode"),n.appendChild(o),o=createNS("feMergeNode"),o.setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=n,this.originalNodeAdded=!1,n.appendChild(o)}function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGEffects(t){var e,i=t.data.ef?t.data.ef.length:0,r=randomString(10),s=filtersFactory.createFilter(r),a=0;this.filters=[];var n;for(e=0;e<i;e+=1)n=null,20===t.data.ef[e].ty?(a+=1,n=new SVGTintFilter(s,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(a+=1,n=new SVGFillFilter(s,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?n=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(a+=1,n=new SVGTritoneFilter(s,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(a+=1,n=new SVGProLevelsFilter(s,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(a+=1,n=new SVGDropShadowEffect(s,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty&&(n=new SVGMatte3Effect(s,t.effectsManager.effectElements[e],t)),n&&this.filters.push(n);a&&(t.globalData.defs.appendChild(s),t.layerElement.setAttribute("filter","url("+locationHref+"#"+r+")")),this.filters.length&&t.addRenderableComponent(this)}function EffectsManager(){}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",className:e&&e.className||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1};this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",hideOnTransparent:!e||e.hideOnTransparent!==!1},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0}function CVShapeData(t,e){this.nodes=[],this.trNodes=[],this.tr=[0,0,0,0,0,0];var i=4;"rc"==e.ty?i=5:"el"==e.ty?i=6:"sr"==e.ty&&(i=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,i,t),this.st=!1,this.fl=!1}function CVContextData(){this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;var t,e=15;for(this.savedOp=createTypedArray("float32",e),t=0;t<e;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=e}function CVBaseElement(){}function CVImageElement(t,e,i){this.failed=!1,this.img=new Image,this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i),this.globalData.addPendingElement()}function CVCompElement(t,e,i){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var i,r=this.masksProperties.length,s=!1;for(i=0;i<r;i++)"n"!==this.masksProperties[i].mode&&(s=!0),this.viewData[i]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);this.hasMasks=s,s&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.initElement(t,e,i)}function CVSolidElement(t,e,i){this.initElement(t,e,i)}function CVTextElement(t,e,i){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,i)}function CVEffects(){}function HBaseElement(t,e,i){}function HSolidElement(t,e,i){this.initElement(t,e,i)}function HCompElement(t,e,i){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,i){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,i)}function HImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i)}function HCameraElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initHierarchy();var r=PropertyFactory.getProp;if(this.pe=r(this,t.pe,0,0,this),t.ks.p.s?(this.px=r(this,t.ks.p.x,1,0,this),this.py=r(this,t.ks.p.y,1,0,this),this.pz=r(this,t.ks.p.z,1,0,this)):this.p=r(this,t.ks.p,1,0,this),t.ks.a&&(this.a=r(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var s,a=t.ks.or.k.length;for(s=0;s<a;s+=1)t.ks.or.k[s].to=null,t.ks.or.k[s].ti=null}this.or=r(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=r(this,t.ks.rx,0,degToRads,this),this.ry=r(this,t.ks.ry,0,degToRads,this),this.rz=r(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0}function HEffects(){}function SliderEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function AngleEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function ColorEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function PointEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function LayerIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function MaskIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function CheckboxEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var i=t.ef||[];this.effectElements=[];var r,s,a=i.length;for(r=0;r<a;r++)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}function setLocationHref(t){locationHref=t}function play(t){animationManager.play(t)}function pause(t){animationManager.pause(t)}function togglePause(t){animationManager.togglePause(t)}function setSpeed(t,e){animationManager.setSpeed(t,e)}function setDirection(t,e){animationManager.setDirection(t,e)}function stop(t){animationManager.stop(t)}function searchAnimations(){standalone===!0?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function registerAnimation(t){return animationManager.registerAnimation(t)}function resize(){animationManager.resize()}function goToAndStop(t,e,i){animationManager.goToAndStop(t,e,i)}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return standalone===!0&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function destroy(t){return animationManager.destroy(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&t>1&&(defaultCurveSegments=t);roundValues(!(defaultCurveSegments>=50))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i<e.length;i++){var r=e[i].split("=");if(decodeURIComponent(r[0])==t)return decodeURIComponent(r[1])}}var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};!function(){var t,e=Object.getOwnPropertyNames(Math),i=e.length;for(t=0;t<i;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){var e=typeof t;if("object"===e&&t.length){var i,r=createSizedArray(t.length),s=t.length;for(i=0;i<s;i+=1)r[i]=Math.abs(t[i]);return r}return Math.abs(t)};
+var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;roundValues(!1);var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1==e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t].length,r=0;r<i;r++)this._cbs[t][r](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var i=0,r=this._cbs[t].length;i<r;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,r-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray=function(){function t(t,e){var i,r=0,s=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(r=0;r<e;r+=1)s.push(i);return s}function e(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?e:t}();DynamicPropertyContainer.prototype={addDynamicProperty:function(t){this.dynamicProperties.indexOf(t)===-1&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var Matrix=function(){function t(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function e(t){if(0===t)return this;var e=T(t),i=M(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}function i(t){if(0===t)return this;var e=T(t),i=M(t);return this._t(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1)}function r(t){if(0===t)return this;var e=T(t),i=M(t);return this._t(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1)}function s(t){if(0===t)return this;var e=T(t),i=M(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}function a(t,e){return this._t(1,e,t,1,0,0)}function n(t,e){return this.shear(k(t),k(e))}function o(t,e){var i=T(e),r=M(e);return this._t(i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,k(t),1,0,0,0,0,1,0,0,0,0,1)._t(i,-r,0,0,r,i,0,0,0,0,1,0,0,0,0,1)}function h(t,e,i){return i=isNaN(i)?1:i,1==t&&1==e&&1==i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}function l(t,e,i,r,s,a,n,o,h,l,p,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=r,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function p(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}function m(t,e,i,r,s,a,n,o,h,l,p,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===i&&0===r&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]=y[15]*u,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],E=y[3],x=y[4],S=y[5],P=y[6],C=y[7],_=y[8],A=y[9],D=y[10],T=y[11],M=y[12],k=y[13],w=y[14],F=y[15];return y[0]=g*t+v*s+b*h+E*f,y[1]=g*e+v*a+b*l+E*c,y[2]=g*i+v*n+b*p+E*d,y[3]=g*r+v*o+b*m+E*u,y[4]=x*t+S*s+P*h+C*f,y[5]=x*e+S*a+P*l+C*c,y[6]=x*i+S*n+P*p+C*d,y[7]=x*r+S*o+P*m+C*u,y[8]=_*t+A*s+D*h+T*f,y[9]=_*e+A*a+D*l+T*c,y[10]=_*i+A*n+D*p+T*d,y[11]=_*r+A*o+D*m+T*u,y[12]=M*t+k*s+w*h+F*f,y[13]=M*e+k*a+w*l+F*c,y[14]=M*i+k*n+w*p+F*d,y[15]=M*r+k*o+w*m+F*u,this._identityCalculated=!1,this}function f(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function c(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function d(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e]}function u(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function y(t,e,i){return{x:t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}}function g(t,e,i){return t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12]}function v(t,e,i){return t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13]}function b(t,e,i){return t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}function E(t){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],i=this.props[5]/e,r=-this.props[1]/e,s=-this.props[4]/e,a=this.props[0]/e,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,o=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e;return[t[0]*i+t[1]*s+n,t[0]*r+t[1]*a+o,0]}function x(t){var e,i=t.length,r=[];for(e=0;e<i;e+=1)r[e]=E(t[e]);return r}function S(t,e,i){var r=createTypedArray("float32",6);if(this.isIdentity())r[0]=t[0],r[1]=t[1],r[2]=e[0],r[3]=e[1],r[4]=i[0],r[5]=i[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];r[0]=t[0]*s+t[1]*n+h,r[1]=t[0]*a+t[1]*o+l,r[2]=e[0]*s+e[1]*n+h,r[3]=e[0]*a+e[1]*o+l,r[4]=i[0]*s+i[1]*n+h,r[5]=i[0]*a+i[1]*o+l}return r}function P(t,e,i){var r;return r=this.isIdentity()?[t,e,i]:[t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]]}function C(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}function _(){for(var t=0,e=this.props,i="matrix3d(",r=1e4;t<16;)i+=w(e[t]*r)/r,i+=15===t?")":",",t+=1;return i}function A(t){var e=1e4;return t<1e-6&&t>0||t>-1e-6&&t<0?w(t*e)/e:t}function D(){var t=this.props,e=A(t[0]),i=A(t[1]),r=A(t[4]),s=A(t[5]),a=A(t[12]),n=A(t[13]);return"matrix("+e+","+i+","+r+","+s+","+a+","+n+")"}var T=Math.cos,M=Math.sin,k=Math.tan,w=Math.round;return function(){this.reset=t,this.rotate=e,this.rotateX=i,this.rotateY=r,this.rotateZ=s,this.skew=n,this.skewFromAxis=o,this.shear=a,this.scale=h,this.setTransform=l,this.translate=p,this.transform=m,this.applyToPoint=y,this.applyToX=g,this.applyToY=v,this.applyToZ=b,this.applyToPointArray=P,this.applyToTriplePoints=S,this.applyToPointStringified=C,this.toCSS=_,this.to2dCSS=D,this.clone=d,this.cloneFromProps=u,this.equals=c,this.inversePoints=x,this.inversePoint=E,this._t=this.transform,this.isIdentity=f,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(t,e){function i(i,l,p){var c=[];l=l===!0?{entropy:!0}:l||{};var v=n(a(l.entropy?[i,h(t)]:null===i?o():i,3),c),b=new r(c),E=function(){for(var t=b.g(f),e=u,i=0;t<y;)t=(t+i)*m,e*=m,i=b.g(1);for(;t>=g;)t/=2,e/=2,i>>>=1;return(t+i)/e};return E.int32=function(){return 0|b.g(4)},E.quick=function(){return b.g(4)/4294967296},E["double"]=E,n(h(b.S),t),(l.pass||p||function(t,i,r,a){return a&&(a.S&&s(a,b),t.state=function(){return s(b,{})}),r?(e[d]=t,i):t})(E,v,"global"in l?l.global:this==e,l.state)}function r(t){var e,i=t.length,r=this,s=0,a=r.i=r.j=0,n=r.S=[];for(i||(t=[i++]);s<m;)n[s]=s++;for(s=0;s<m;s++)n[s]=n[a=v&a+t[s%i]+(e=n[s])],n[a]=e;r.g=function(t){for(var e,i=0,s=r.i,a=r.j,n=r.S;t--;)e=n[s=v&s+1],i=i*m+n[v&(n[s]=n[a=v&a+e])+(n[a]=e)];return r.i=s,r.j=a,i}}function s(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function a(t,e){var i,r=[],s=typeof t;if(e&&"object"==s)for(i in t)try{r.push(a(t[i],e-1))}catch(n){}return r.length?r:"string"==s?t:t+"\0"}function n(t,e){for(var i,r=t+"",s=0;s<r.length;)e[v&s]=v&(i^=19*e[v&s])+r.charCodeAt(s++);return h(e)}function o(){try{if(l)return h(l.randomBytes(m));var e=new Uint8Array(m);return(p.crypto||p.msCrypto).getRandomValues(e),h(e)}catch(i){var r=p.navigator,s=r&&r.plugins;return[+new Date,p,s,p.screen,h(t)]}}function h(t){return String.fromCharCode.apply(0,t)}var l,p=this,m=256,f=6,c=52,d="random",u=e.pow(m,f),y=e.pow(2,c),g=2*y,v=m-1;e["seed"+d]=i,n(e.random(),t)}([],BMMath);var BezierFactory=function(){function t(t,e,i,r,s){var a=s||("bez_"+t+"_"+e+"_"+i+"_"+r).replace(/\./g,"p");if(p[a])return p[a];var n=new h([t,e,i,r]);return p[a]=n,n}function e(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function r(t){return 3*t}function s(t,s,a){return((e(s,a)*t+i(s,a))*t+r(s))*t}function a(t,s,a){return 3*e(s,a)*t*t+2*i(s,a)*t+r(s)}function n(t,e,i,r,a){var n,o,h=0;do o=e+(i-e)/2,n=s(o,r,a)-t,n>0?i=o:e=o;while(Math.abs(n)>c&&++h<d);return o}function o(t,e,i,r){for(var n=0;n<m;++n){var o=a(e,i,r);if(0===o)return e;var h=s(e,i,r)-t;e-=h/o}return e}function h(t){this._p=t,this._mSampleValues=g?new Float32Array(u):new Array(u),this._precomputed=!1,this.get=this.get.bind(this)}var l={};l.getBezierEasing=t;var p={},m=4,f=.001,c=1e-7,d=10,u=11,y=1/(u-1),g="function"==typeof Float32Array;return h.prototype={get:function(t){var e=this._p[0],i=this._p[1],r=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===i&&r===a?t:0===t?0:1===t?1:s(this._getTForX(t),i,a)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],r=this._p[3];this._precomputed=!0,t===e&&i===r||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<u;++i)this._mSampleValues[i]=s(i*y,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],r=this._mSampleValues,s=0,h=1,l=u-1;h!==l&&r[h]<=t;++h)s+=y;--h;var p=(t-r[h])/(r[h+1]-r[h]),m=s+p*y,c=a(m,e,i);return c>=f?o(t,m,e,i):0===c?m:n(t,s,s+y,e,i)}},l}();!function(){for(var t=0,e=["ms","moz","webkit","o"],i=0;i<e.length&&!window.requestAnimationFrame;++i)window.requestAnimationFrame=window[e[i]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[i]+"CancelAnimationFrame"]||window[e[i]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,i){var r=(new Date).getTime(),s=Math.max(0,16-(r-t)),a=setTimeout(function(){e(r+s)},s);return t=r+s,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction(),dataManager=dataFunctionManager(),FontManager=function(){function t(t,e){var i=createTag("span");i.style.fontFamily=e;var r=createTag("span");r.innerHTML="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(r),document.body.appendChild(i);var s=r.offsetWidth;return r.style.fontFamily=t+", "+e,{node:r,w:s,parent:i}}function e(){var t,i,r,s=this.fonts.length,a=s;for(t=0;t<s;t+=1)if(this.fonts[t].loaded)a-=1;else if("t"===this.fonts[t].fOrigin||2===this.fonts[t].origin){if(window.Typekit&&window.Typekit.load&&0===this.typekitLoaded){this.typekitLoaded=1;try{window.Typekit.load({async:!0,active:function(){this.typekitLoaded=2}.bind(this)})}catch(n){}}2===this.typekitLoaded&&(this.fonts[t].loaded=!0)}else"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(i=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,i.offsetWidth!==r?(a-=1,this.fonts[t].loaded=!0):(i=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,i.offsetWidth!==r&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<l?setTimeout(e.bind(this),20):setTimeout(function(){this.loaded=!0}.bind(this),0)}function i(t,e){var i=createNS("text");i.style.fontSize="100px",i.setAttribute("font-family",e.fFamily),i.setAttribute("font-style",e.fStyle),i.setAttribute("font-weight",e.fWeight),i.textContent="1",e.fClass?(i.style.fontFamily="inherit",i.className=e.fClass):i.style.fontFamily=e.fFamily,t.appendChild(i);var r=createTag("canvas").getContext("2d");return r.font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,i}function r(r,s){if(!r)return void(this.loaded=!0);if(this.chars)return this.loaded=!0,void(this.fonts=r.list);var a,n=r.list,o=n.length;for(a=0;a<o;a+=1){if(n[a].loaded=!1,n[a].monoCase=t(n[a].fFamily,"monospace"),n[a].sansCase=t(n[a].fFamily,"sans-serif"),n[a].fPath){if("p"===n[a].fOrigin||3===n[a].origin){var h=createTag("style");h.type="text/css",h.innerHTML="@font-face {font-family: "+n[a].fFamily+"; font-style: normal; src: url('"+n[a].fPath+"');}",s.appendChild(h)}else if("g"===n[a].fOrigin||1===n[a].origin){var l=createTag("link");l.type="text/css",l.rel="stylesheet",l.href=n[a].fPath,document.body.appendChild(l)}else if("t"===n[a].fOrigin||2===n[a].origin){var p=createTag("script");p.setAttribute("src",n[a].fPath),s.appendChild(p)}}else n[a].loaded=!0;n[a].helper=i(s,n[a]),n[a].cache={},this.fonts.push(n[a])}setTimeout(function(){e.bind(this)()}.bind(this),100)}function s(t){if(t){this.chars||(this.chars=[]);var e,i,r,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(i=0,r=!1;i<a;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(r=!0),i+=1;r||(this.chars.push(t[e]),a+=1)}}}function a(t,e,i){for(var r=0,s=this.chars.length;r<s;){if(this.chars[r].ch===t&&this.chars[r].style===e&&this.chars[r].fFamily===i)return this.chars[r];r+=1}return console&&console.warn&&console.warn("Missing character from exported characters list: ",t,e,i),p}function n(t,e,i){var r=this.getFontByName(e),s=t.charCodeAt(0);if(!r.cache[s+1]){var a=r.helper;a.textContent=t,r.cache[s+1]=a.getComputedTextLength()/100}return r.cache[s+1]*i}function o(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]}function h(){return m}var l=5e3,p={w:0,size:0,shapes:[]},m=[];m=m.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var f=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.loaded=!1,this.initTime=Date.now()};return f.getCombinedCharacterCodes=h,f.prototype.addChars=s,f.prototype.addFonts=r,f.prototype.getCharData=a,f.prototype.getFontByName=o,f.prototype.measureText=n,f}(),PropertyFactory=function(){function t(t,s){var a,n=this.offsetTime;"multidimensional"===this.propType&&(a=createTypedArray("float32",this.pv.length));for(var o,h,l=s.lastIndex,p=l,m=this.keyframes.length-1,f=!0;f;){if(o=this.keyframes[p],h=this.keyframes[p+1],p==m-1&&t>=h.t-n){o.h&&(o=h),l=0;break}if(h.t-n>t){l=p;break}p<m-1?p+=1:(l=0,f=!1)}var c,d,u,y,g,v;if(o.to){o.bezierData||bez.buildBezierData(o);var b=o.bezierData;if(t>=h.t-n||t<o.t-n){var E=t>=h.t-n?b.points.length-1:0;for(d=b.points[E].point.length,c=0;c<d;c+=1)a[c]=b.points[E].point[c];s._lastBezierData=null}else{o.__fnct?v=o.__fnct:(v=BezierFactory.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n).get,o.__fnct=v),u=v((t-(o.t-n))/(h.t-n-(o.t-n)));var x,S=b.segmentLength*u,P=s.lastFrame<t&&s._lastBezierData===b?s._lastAddedLength:0;for(g=s.lastFrame<t&&s._lastBezierData===b?s._lastPoint:0,f=!0,y=b.points.length;f;){if(P+=b.points[g].partialLength,0===S||0===u||g==b.points.length-1){for(d=b.points[g].point.length,c=0;c<d;c+=1)a[c]=b.points[g].point[c];break}if(S>=P&&S<P+b.points[g+1].partialLength){for(x=(S-P)/b.points[g+1].partialLength,d=b.points[g].point.length,c=0;c<d;c+=1)a[c]=b.points[g].point[c]+(b.points[g+1].point[c]-b.points[g].point[c])*x;break}g<y-1?g+=1:f=!1}s._lastPoint=g,s._lastAddedLength=P-b.points[g].partialLength,s._lastBezierData=b}}else{var C,_,A,D,T;if(m=o.s.length,this.sh&&1!==o.h)if(t>=h.t-n)a[0]=o.e[0],a[1]=o.e[1],a[2]=o.e[2];else if(t<=o.t-n)a[0]=o.s[0],a[1]=o.s[1],a[2]=o.s[2];else{var M=r(o.s),k=r(o.e),w=(t-(o.t-n))/(h.t-n-(o.t-n));i(a,e(M,k,w))}else for(p=0;p<m;p+=1)1!==o.h&&(t>=h.t-n?u=1:t<o.t-n?u=0:(o.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[p]?v=o.__fnct[p]:(C=o.o.x[p]||o.o.x[0],_=o.o.y[p]||o.o.y[0],A=o.i.x[p]||o.i.x[0],D=o.i.y[p]||o.i.y[0],v=BezierFactory.getBezierEasing(C,_,A,D).get,o.__fnct[p]=v)):o.__fnct?v=o.__fnct:(C=o.o.x,_=o.o.y,A=o.i.x,D=o.i.y,v=BezierFactory.getBezierEasing(C,_,A,D).get,o.__fnct=v),u=v((t-(o.t-n))/(h.t-n-(o.t-n))))),T=1===o.h?o.s[p]:o.s[p]+(o.e[p]-o.s[p])*u,1===m?a=T:a[p]=T}return s.lastIndex=l,a}function e(t,e,i){var r,s,a,n,o,h=[],l=t[0],p=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];return s=l*c+p*d+m*u+f*y,s<0&&(s=-s,c=-c,d=-d,u=-u,y=-y),1-s>1e-6?(r=Math.acos(s),a=Math.sin(r),n=Math.sin((1-i)*r)/a,o=Math.sin(i*r)/a):(n=1-i,o=i),h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}function i(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=Math.atan2(2*r*a-2*i*s,1-2*r*r-2*s*s),o=Math.asin(2*i*r+2*s*a),h=Math.atan2(2*i*a-2*r*s,1-2*i*i-2*s*s);t[0]=n/degToRads,t[1]=o/degToRads,t[2]=h/degToRads}function r(t){var e=t[0]*degToRads,i=t[1]*degToRads,r=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(r/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(r/2),p=s*a*n-o*h*l,m=o*h*n+s*a*l,f=o*a*n+s*h*l,c=s*h*n-o*a*l;return[m,f,c,p]}function s(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==c&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastIndex=this._caching.lastFrame<t?this._caching.lastIndex:0;var r=this.interpolateValue(t,this._caching);this.pv=r}return this._caching.lastFrame=t,this.pv}function a(t){var e;if("unidimensional"===this.propType)e=t*this.mult,d(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,r=this.v.length;i<r;)e=t[i]*this.mult,d(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function n(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length){if(this.lock)return void this.setVValue(this.pv);this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function o(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,i,r){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=n,this.setVValue=a,this.addEffect=o}function l(t,e,i,r){this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,h=e.k.length;this.v=createTypedArray("float32",h),this.pv=createTypedArray("float32",h);createTypedArray("float32",h);for(this.vel=createTypedArray("float32",h),s=0;s<h;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=n,this.setVValue=a,this.addEffect=o}function p(e,i,r,h){this.propType="unidimensional",this.keyframes=i.k,this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:c,lastIndex:0,value:0},this.k=!0,this.kf=!0,this.data=i,this.mult=r||1,this.elem=e,this.container=h,this.comp=e.comp,this.v=c,this.pv=c,this._isFirstFrame=!0,this.getValue=n,this.setVValue=a,this.interpolateValue=t,this.effectsSequence=[s.bind(this)],this.addEffect=o}function m(e,i,r,h){this.propType="multidimensional";var l,p,m,f,d,u=i.k.length;for(l=0;l<u-1;l+=1)i.k[l].to&&i.k[l].s&&i.k[l].e&&(p=i.k[l].s,m=i.k[l].e,f=i.k[l].to,d=i.k[l].ti,(2===p.length&&(p[0]!==m[0]||p[1]!==m[1])&&bez.pointOnLine2D(p[0],p[1],m[0],m[1],p[0]+f[0],p[1]+f[1])&&bez.pointOnLine2D(p[0],p[1],m[0],m[1],m[0]+d[0],m[1]+d[1])||3===p.length&&(p[0]!==m[0]||p[1]!==m[1]||p[2]!==m[2])&&bez.pointOnLine3D(p[0],p[1],p[2],m[0],m[1],m[2],p[0]+f[0],p[1]+f[1],p[2]+f[2])&&bez.pointOnLine3D(p[0],p[1],p[2],m[0],m[1],m[2],m[0]+d[0],m[1]+d[1],m[2]+d[2]))&&(i.k[l].to=null,i.k[l].ti=null),p[0]===m[0]&&p[1]===m[1]&&0===f[0]&&0===f[1]&&0===d[0]&&0===d[1]&&(2===p.length||p[2]===m[2]&&0===f[2]&&0===d[2])&&(i.k[l].to=null,i.k[l].ti=null));this.effectsSequence=[s.bind(this)],this.keyframes=i.k,this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=e,this.container=h,this.comp=e.comp,this.getValue=n,this.setVValue=a,this.interpolateValue=t,this.frameId=-1;var y=i.k[0].s.length;for(this.v=createTypedArray("float32",y),this.pv=createTypedArray("float32",y),l=0;l<y;l+=1)this.v[l]=c,this.pv[l]=c;this._caching={lastFrame:c,lastIndex:0,value:createTypedArray("float32",y)},this.addEffect=o}function f(t,e,i,r,s){var a;if(0===e.a)a=0===i?new h(t,e,r,s):new l(t,e,r,s);else if(1===e.a)a=0===i?new p(t,e,r,s):new m(t,e,r,s);else if(e.k.length)if("number"==typeof e.k[0])a=new l(t,e,r,s);else switch(i){case 0:a=new p(t,e,r,s);break;case 1:a=new m(t,e,r,s)}else a=new h(t,e,r,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}var c=initialDefaultFrame,d=Math.abs,u={getProp:f};return u}(),TransformPropertyFactory=function(){function t(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function e(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented&&this.p.keyframes&&this.p.getValueAtTime){var e,i;this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/this.elem.globalData.frameRate,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/this.elem.globalData.frameRate,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/this.elem.globalData.frameRate,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.01)/this.elem.globalData.frameRate,0)):(e=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/this.elem.globalData.frameRate,this.p.offsetTime)),this.v.rotate(-Math.atan2(e[1]-i[1],e[0]-i[0]))}this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function i(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}}function r(){}function s(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}function a(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p,1,0,this),e.r)this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this);else if(e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var r,s=e.or.k.length;for(r=0;r<s;r+=1)e.or.k[r].to=e.or.k[r].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),e.a&&(this.a=PropertyFactory.getProp(t,e.a,1,0,this)),e.s&&(this.s=PropertyFactory.getProp(t,e.s,1,.01,this)),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}function n(t,e,i){return new a(t,e,i)}return a.prototype={applyToMatrix:t,getValue:e,precalculateMatrix:i,autoOrient:r},extendPrototype([DynamicPropertyContainer],a),a.prototype.addDynamicProperty=s,a.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:n}}();ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=point_pool.newElement(),this.o[i]=point_pool.newElement(),this.i[i]=point_pool.newElement(),i+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,i,r,s){var a;switch(this._length=Math.max(this._length,r+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[r]||a[r]&&!s)&&(a[r]=point_pool.newElement()),a[r][0]=t,a[r][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,r,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,r,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,r=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],r[0][0],r[0][1],i[0][0],i[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],r[n][0],r[n][1],i[n][0],i[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){function t(t,e,i){var r,s,a,n,o,h,l,p,m,f=i.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)r=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)r=1===c[c.length-2].h?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],u=c[y+1],!(u.t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(a=1===d.h,f=y,!a){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var b;d.__fnct?b=d.__fnct:(b=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=b),p=b((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=d.e[0]}r=d.s[0]}for(h=e._length,l=r.i[0].length,i.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<l;o+=1)m=a?r.i[n][o]:r.i[n][o]+(s.i[n][o]-r.i[n][o])*p,e.i[n][o]=m,m=a?r.o[n][o]:r.o[n][o]+(s.o[n][o]-r.o[n][o])*p,e.o[n][o]=m,m=a?r.v[n][o]:r.v[n][o]+(s.v[n][o]-r.v[n][o])*p,e.v[n][o]=m}function e(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime,r=this._caching.lastFrame;return r!==m&&(r<e&&t<e||r>i&&t>i)||(this._caching.lastIndex=r<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function i(){this.paths=this.localShapeCollection}function r(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,r=t._length;for(i=0;i<r;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0}function s(){if(!this.lock&&this.elem.globalData.frameId!==this.frameId){this.lock=!0,this.frameId=this.elem.globalData.frameId,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,i=this.effectsSequence.length;for(t=0;t<i;t+=1)e=this.effectsSequence[t](e);r(this.v,e)||(this.v=shape_pool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection),this.lock=!1}}function a(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var s=3===r?e.pt.k:e.ks.k;this.v=shape_pool.clone(s),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=i,this.effectsSequence=[]}function n(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,r,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?r.pt.k:r.ks.k,this.k=!0,this.kf=!0;var a=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=m,this.reset=i,this._caching={lastFrame:m,lastIndex:0},this.effectsSequence=[e.bind(this)]}function h(t,e,i){var r;if(3===i||4===i){var s=3===i?e.pt:e.ks,n=s.k;r=1===s.a||n.length?new o(t,e,i):new a(t,e,i)}else 5===i?r=new d(t,e):6===i?r=new f(t,e):7===i&&(r=new c(t,e));return r.k&&t.addDynamicProperty(r),r}function l(){return a}function p(){return o}var m=-999999;a.prototype.interpolateShape=t,a.prototype.getValue=s,a.prototype.getValue=s,a.prototype.addEffect=n,o.prototype.getValue=s,o.prototype.interpolateShape=t,o.prototype.addEffect=n;var f=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}var e=roundCorner;return t.prototype={reset:i,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],i=this.p.v[1],r=this.s.v[0]/2,s=this.s.v[1]/2,a=3!==this.d,n=this.v;
+n.v[0][0]=t,n.v[0][1]=i-s,n.v[1][0]=a?t+r:t-r,n.v[1][1]=i,n.v[2][0]=t,n.v[2][1]=i+s,n.v[3][0]=a?t-r:t+r,n.v[3][1]=i,n.i[0][0]=a?t-r*e:t+r*e,n.i[0][1]=i-s,n.i[1][0]=a?t+r:t-r,n.i[1][1]=i-s*e,n.i[2][0]=a?t+r*e:t-r*e,n.i[2][1]=i+s,n.i[3][0]=a?t-r:t+r,n.i[3][1]=i+s*e,n.o[0][0]=a?t+r*e:t-r*e,n.o[0][1]=i-s,n.o[1][0]=a?t+r:t-r,n.o[1][1]=i+s*e,n.o[2][0]=a?t-r*e:t+r*e,n.o[2][1]=i+s,n.o[3][0]=a?t-r:t+r,n.o[3][1]=i-s*e}},extendPrototype([DynamicPropertyContainer],t),t}(),c=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:i,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,i,r,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<s;t+=1){e=n?o:h,i=n?l:p,r=n?m:f;var u=e*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*r*i*d,y-v*r*i*d,u+g*r*i*d,y+v*r*i*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),i=2*Math.PI/e,r=this.or.v,s=this.os.v,a=2*Math.PI*r/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,this.v._length=0,t=0;t<e;t+=1){var h=r*Math.cos(n),l=r*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),m=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-m*a*s*o,h+p*a*s*o,l+m*a*s*o,t,!0),n+=i*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),d=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,r=this.s.v[1]/2,s=bm_min(i,r,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-r+s,t+i,e-r+s,t+i,e-r+a,0,!0),this.v.setTripleAt(t+i,e+r-s,t+i,e+r-a,t+i,e+r-s,1,!0),0!==s?(this.v.setTripleAt(t+i-s,e+r,t+i-s,e+r,t+i-a,e+r,2,!0),this.v.setTripleAt(t-i+s,e+r,t-i+a,e+r,t-i+s,e+r,3,!0),this.v.setTripleAt(t-i,e+r-s,t-i,e+r-s,t-i,e+r-a,4,!0),this.v.setTripleAt(t-i,e-r+s,t-i,e-r+a,t-i,e-r+s,5,!0),this.v.setTripleAt(t-i+s,e-r,t-i+s,e-r,t-i+a,e-r,6,!0),this.v.setTripleAt(t+i-s,e-r,t+i-a,e-r,t+i-s,e-r,7,!0)):(this.v.setTripleAt(t-i,e+r,t-i+a,e+r,t-i,e+r,2),this.v.setTripleAt(t-i,e-r,t-i,e-r+a,t-i,e-r,3))):(this.v.setTripleAt(t+i,e-r+s,t+i,e-r+a,t+i,e-r+s,0,!0),0!==s?(this.v.setTripleAt(t+i-s,e-r,t+i-s,e-r,t+i-a,e-r,1,!0),this.v.setTripleAt(t-i+s,e-r,t-i+a,e-r,t-i+s,e-r,2,!0),this.v.setTripleAt(t-i,e-r+s,t-i,e-r+s,t-i,e-r+a,3,!0),this.v.setTripleAt(t-i,e+r-s,t-i,e+r-a,t-i,e+r-s,4,!0),this.v.setTripleAt(t-i+s,e+r,t-i+s,e+r,t-i+a,e+r,5,!0),this.v.setTripleAt(t+i-s,e+r,t+i-a,e+r,t+i-s,e+r,6,!0),this.v.setTripleAt(t+i,e+r-s,t+i,e+r-s,t+i,e+r-a,7,!0)):(this.v.setTripleAt(t-i,e-r,t-i+a,e-r,t-i,e-r,1,!0),this.v.setTripleAt(t-i,e+r,t-i,e+r-a,t-i,e+r,2,!0),this.v.setTripleAt(t+i,e+r,t+i-a,e+r,t+i,e+r,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:i},extendPrototype([DynamicPropertyContainer],t),t}(),u={};return u.getShapeProp=h,u.getConstructorFunction=l,u.getKeyframedConstructorFunction=p,u}(),ShapeModifiers=function(){function t(t,e){r[t]||(r[t]=e)}function e(t,e,i){return new r[t](e,i)}var i={},r={};return i.registerModifier=t,i.getModifier=e,i}();ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,r,s){var a=[];e<=1?a.push({s:t,e:e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1)if(o=a[n],o.e*s<r||o.s*s>r+i);else{var p,m;p=o.s*s<=r?0:(o.s*s-r)/i,m=o.e*s>=r+i?1:(o.e*s-r)/i,h.push([p,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e<i;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,i;if(this._mdf||t){var r=this.o.v%360/360;if(r<0&&(r+=1),e=this.s.v+r,i=this.e.v+r,e>i){var s=e;e=i,i=s}e=Math.round(1e3*e)/1e3,i=Math.round(1e3*i)/1e3,this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var a,n,o,h,l,p,m,f=this.shapes.length,c=0;if(i===e)for(n=0;n<f;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection;else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(n=0;n<f;n+=1)this.shapes[n].shape._mdf=!0}else{var d,u,y=[];for(n=0;n<f;n+=1)if(d=this.shapes[n],d.shape._mdf||this._mdf||t||2===this.m){if(a=d.shape.paths,h=a._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(a.shapes[o]),l.push(p),m+=p.totalLength;d.totalShapeLength=m,d.pathsData=l}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,b=i,E=0;for(n=f-1;n>=0;n-=1)if(d=this.shapes[n],d.shape._mdf){for(u=d.localShapeCollection,u.releaseShapes(),2===this.m&&f>1?(g=this.calculateShapeEdges(e,i,d.totalShapeLength,E,c),E+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*b}):v>=1?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(y.length>1)if(d.shape.v.c){var S=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],S)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)e.addShape(t[i])},TrimModifier.prototype.addSegment=function(t,e,i,r,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(i[0],i[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(r[0],r[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,i,r){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),r&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)},TrimModifier.prototype.addShapes=function(t,e,i){var r,s,a,n,o,h,l,p,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(i?(o=i._length,p=i._length):(i=shape_pool.newElement(),o=0,p=0),u.push(i),r=0;r<c;r+=1){for(h=m[r].lengths,i.c=f[r].c,a=f[r].c?h.length:h.length+1,s=1;s<a;s+=1)if(n=h[s-1],d+n.addedLength<e.s)d+=n.addedLength,i.c=!1;else{if(d>e.e){i.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[r].v[s-1],f[r].o[s-1],f[r].i[s],f[r].v[s],i,o,y),y=!1):(l=bez.getNewSegment(f[r].v[s-1],f[r].v[s],f[r].o[s-1],f[r].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1),d+=n.addedLength,o+=1}if(f[r].c){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[r].v[s-1],f[r].o[s-1],f[r].i[0],f[r].v[0],i,o,y),y=!1):(l=bez.getNewSegment(f[r].v[s-1],f[r].v[0],f[r].o[s-1],f[r].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1)}else i.c=!1;d+=n.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[p][0],i.v[p][1],"i",p),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),d>e.e)break;r<c-1&&(i=shape_pool.newElement(),y=!0,u.push(i),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var i=shape_pool.newElement();i.c=t.c;var r,s,a,n,o,h,l,p,m,f,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)),l=h?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,m=u=s[1]-(s[1]-o[1])*l,f=p-(p-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)),l=h?Math.min(h/2,e)/h:0,p=f=s[0]+(o[0]-s[0])*l,m=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g),g+=1):(i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g),g+=1):(i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1);return i},RoundCornersModifier.prototype.processShapes=function(t){var e,i,r,s,a=this.shapes.length,n=this.rd.v;if(0!==n){var o,h,l;for(i=0;i<a;i+=1){if(o=this.shapes[i],h=o.shape.paths,l=o.localShapeCollection,o.shape._mdf||this._mdf||t)for(l.releaseShapes(),o.shape._mdf=!0,e=o.shape.paths.shapes,s=o.shape.paths._length,r=0;r<s;r+=1)l.addShape(this.processPath(e[r],n));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,i,r,s,a){var n=a?-1:1,o=r.s.v[0]+(1-r.s.v[0])*(1-s),h=r.s.v[1]+(1-r.s.v[1])*(1-s);t.translate(r.p.v[0]*n*s,r.p.v[1]*n*s,r.p.v[2]),e.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),e.rotate(-r.r.v*n*s),e.translate(r.a.v[0],r.a.v[1],r.a.v[2]),i.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),i.scale(a?1/o:o,a?1/h:h),i.translate(r.a.v[0],r.a.v[1],r.a.v[2])},RepeaterModifier.prototype.init=function(t,e,i,r){this.elem=t,this.arr=e,this.pos=i,this.elemsData=r,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);for(var s=0;i>0;)i-=1,this._elements.unshift(e[i]),s+=1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=(t.length,JSON.parse(JSON.stringify(t)));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,i,r,s,a;if(this._mdf||t){var n=Math.ceil(this.c.v);if(this._groups.length<n){for(;this._groups.length<n;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}a=0;var h;for(r=0;r<=this._groups.length-1;r+=1)h=a<n,this._groups[r]._render=h,this.changeGroupRender(this._groups[r].it,h),a+=1;this._currentCopies=n;var l=this.o.v,p=l%1,m=l>0?Math.floor(l):Math.ceil(l),f=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u=0;if(l>0){for(;u<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),u+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),u+=p)}else if(l<0){for(;u>m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),u-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),u-=p)}r=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;for(var y,g;a;){if(e=this.elemsData[r].it,i=e[e.length-1].transform.mProps.v.props,g=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,0!==u){for((0!==r&&1===s||r!==this._currentCopies-1&&s===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),y=0;y<g;y+=1)i[y]=this.matrix.props[y];this.matrix.reset()}else for(this.matrix.reset(),y=0;y<g;y+=1)i[y]=this.matrix.props[y];u+=1,a-=1,r+=s}}else for(a=this._currentCopies,r=0,s=1;a;)e=this.elemsData[r].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,r+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var i,r=0,s=this.o.length/2;r<s;){if(i=Math.abs(t[4*r]-t[4*e+2*r]),i>.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,i,r,s=4*this.data.p;for(e=0;e<s;e+=1)i=e%4===0?100:255,r=Math.round(this.prop.v[e]*i),this.c[e]!==r&&(this.c[e]=r,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)i=e%2===0?100:1,r=e%2===0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==r&&(this.o[e-4*this.data.p]=r,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,i,r){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+r.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+r.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+r.applyToPointStringified(n[s][0],n[s][1])+" "+r.applyToPointStringified(o[s][0],o[s][1]);return i&&e&&(h+=" C"+r.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+r.applyToPointStringified(n[0][0],n[0][1])+" "+r.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},ImagePreloader=function(){function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function e(t){var e="";if(this.assetsPath){var i=t.p;i.indexOf("images/")!==-1&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e}function i(e){var i=createTag("img");i.addEventListener("load",t.bind(this),!1),i.addEventListener("error",t.bind(this),!1),i.src=e}function r(t,r){this.imagesLoadedCb=r,this.totalAssets=t.length;var s;for(s=0;s<this.totalAssets;s+=1)t[s].layers||(i.bind(this)(e.bind(this)(t[s])),this.totalImages+=1)}function s(t){this.path=t||""}function a(t){this.assetsPath=t||""}function n(){this.imagesLoadedCb=null}return function(){this.loadAssets=r,this.setAssetsPath=a,this.setPath=s,this.destroy=n,this.assetsPath="",this.path="",this.totalAssets=0,this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null}}(),featureSupport=function(){var t={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),t}(),filtersFactory=function(){function t(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e}function e(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t}var i={};return i.createFilter=t,i.createAlphaToLuminanceFilter=e,i}();TextAnimatorProperty.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,r=PropertyFactory.getProp;for(t=0;t<i;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:r(this._elem,this._textData.p.f,0,0,this),l:r(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=r(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,r,s,a,n,o,h,l,p,m,f,c,d,u,y,g,v,b,E,x=this._moreOptions.alignment.v,S=this._animatorsData,P=this._textData,C=this.mHelper,_=this._renderType,A=this.renderedLetters.length,D=(this.data,t.l);if(this._hasMaskedPath){if(E=this._pathData.m,!this._pathData.n||this._pathData._mdf){var T=E.v;this._pathData.r&&(T=T.reverse()),n={tLength:0,segments:[]},a=T._length-1;var M;for(g=0,s=0;s<a;s+=1)M={s:T.v[s],e:T.v[s+1],to:[T.o[s][0]-T.v[s][0],T.o[s][1]-T.v[s][1]],ti:[T.i[s+1][0]-T.v[s+1][0],T.i[s+1][1]-T.v[s+1][1]]},bez.buildBezierData(M),n.tLength+=M.bezierData.segmentLength,n.segments.push(M),g+=M.bezierData.segmentLength;s=a,E.v.c&&(M={s:T.v[s],e:T.v[0],to:[T.o[s][0]-T.v[s][0],T.o[s][1]-T.v[s][1]],ti:[T.i[0][0]-T.v[0][0],T.i[0][1]-T.v[0][1]]},bez.buildBezierData(M),n.tLength+=M.bezierData.segmentLength,n.segments.push(M),g+=M.bezierData.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,f=0,m=1,l=0,p=!0,u=n.segments,o<0&&E.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),f=u.length-1,d=u[f].bezierData.points,m=d.length-1;o<0;)o+=d[m].partialLength,m-=1,m<0&&(f-=1,d=u[f].bezierData.points,m=d.length-1);d=u[f].bezierData.points,c=d[m-1],h=d[m],y=h.partialLength}a=D.length,i=0,r=0;var k,w,F,I,V,R=1.2*t.finalSize*.714,B=!0;I=S.length;var L,G,z,N,O,H,j,q,W,Y,X,J,K,U=-1,Z=o,Q=f,$=m,tt=-1,et=0,it="",rt=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,at=0,nt=2===t.j?-.5:-1,ot=0,ht=!0;for(s=0;s<a;s+=1)if(D[s].n){for(st&&(st+=at);ot<s;)D[ot].animatorJustifyOffset=st,ot+=1;st=0,ht=!0}else{for(F=0;F<I;F+=1)k=S[F].a,k.t.propType&&(ht&&2===t.j&&(at+=k.t.v*nt),w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),st+=L.length?k.t.v*L[0]*nt:k.t.v*L*nt);ht=!1}for(st&&(st+=at);ot<s;)D[ot].animatorJustifyOffset=st,ot+=1}for(s=0;s<a;s+=1){if(C.reset(),O=1,D[s].n)i=0,r+=t.yOffset,r+=B?1:0,o=Z,B=!1,et=0,this._hasMaskedPath&&(f=Q,m=$,d=u[f].bezierData.points,c=d[m-1],h=d[m],y=h.partialLength,l=0),K=Y=J=it="",rt=this.defaultPropsArray;else{if(this._hasMaskedPath){if(tt!==D[s].line){switch(t.j){case 1:o+=g-t.lineWidths[D[s].line];break;case 2:o+=(g-t.lineWidths[D[s].line])/2}tt=D[s].line}U!==D[s].ind&&(D[U]&&(o+=D[U].extra),o+=D[s].an/2,U=D[s].ind),o+=x[0]*D[s].an/200;var lt=0;for(F=0;F<I;F+=1)k=S[F].a,k.p.propType&&(w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),lt+=L.length?k.p.v[0]*L[0]:k.p.v[0]*L),k.a.propType&&(w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),lt+=L.length?k.a.v[0]*L[0]:k.a.v[0]*L);for(p=!0;p;)l+y>=o+lt||!d?(v=(o+lt-l)/h.partialLength,z=c.point[0]+(h.point[0]-c.point[0])*v,N=c.point[1]+(h.point[1]-c.point[1])*v,C.translate(-x[0]*D[s].an/200,-(x[1]*R/100)),p=!1):d&&(l+=h.partialLength,m+=1,m>=d.length&&(m=0,f+=1,u[f]?d=u[f].bezierData.points:E.v.c?(m=0,f=0,d=u[f].bezierData.points):(l-=h.partialLength,d=null)),d&&(c=h,h=d[m],y=h.partialLength));G=D[s].an/2-D[s].add,C.translate(-G,0,0)}else G=D[s].an/2-D[s].add,C.translate(-G,0,0),C.translate(-x[0]*D[s].an/200,-x[1]*R/100,0);for(et+=D[s].l/2,F=0;F<I;F+=1)k=S[F].a,k.t.propType&&(w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),0===i&&0===t.j||(this._hasMaskedPath?o+=L.length?k.t.v*L[0]:k.t.v*L:i+=L.length?k.t.v*L[0]:k.t.v*L));for(et+=D[s].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(H=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),F=0;F<I;F+=1)k=S[F].a,k.a.propType&&(w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),L.length?C.translate(-k.a.v[0]*L[0],-k.a.v[1]*L[1],k.a.v[2]*L[2]):C.translate(-k.a.v[0]*L,-k.a.v[1]*L,k.a.v[2]*L));for(F=0;F<I;F+=1)k=S[F].a,k.s.propType&&(w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),L.length?C.scale(1+(k.s.v[0]-1)*L[0],1+(k.s.v[1]-1)*L[1],1):C.scale(1+(k.s.v[0]-1)*L,1+(k.s.v[1]-1)*L,1));for(F=0;F<I;F+=1){if(k=S[F].a,w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),k.sk.propType&&(L.length?C.skewFromAxis(-k.sk.v*L[0],k.sa.v*L[1]):C.skewFromAxis(-k.sk.v*L,k.sa.v*L)),k.r.propType&&(L.length?C.rotateZ(-k.r.v*L[2]):C.rotateZ(-k.r.v*L)),k.ry.propType&&(L.length?C.rotateY(k.ry.v*L[1]):C.rotateY(k.ry.v*L)),k.rx.propType&&(L.length?C.rotateX(k.rx.v*L[0]):C.rotateX(k.rx.v*L)),k.o.propType&&(O+=L.length?(k.o.v*L[0]-O)*L[0]:(k.o.v*L-O)*L),t.strokeWidthAnim&&k.sw.propType&&(j+=L.length?k.sw.v*L[0]:k.sw.v*L),t.strokeColorAnim&&k.sc.propType)for(W=0;W<3;W+=1)L.length?H[W]=H[W]+(k.sc.v[W]-H[W])*L[0]:H[W]=H[W]+(k.sc.v[W]-H[W])*L;if(t.fillColorAnim&&t.fc){if(k.fc.propType)for(W=0;W<3;W+=1)L.length?q[W]=q[W]+(k.fc.v[W]-q[W])*L[0]:q[W]=q[W]+(k.fc.v[W]-q[W])*L;k.fh.propType&&(q=L.length?addHueToRGB(q,k.fh.v*L[0]):addHueToRGB(q,k.fh.v*L)),k.fs.propType&&(q=L.length?addSaturationToRGB(q,k.fs.v*L[0]):addSaturationToRGB(q,k.fs.v*L)),k.fb.propType&&(q=L.length?addBrightnessToRGB(q,k.fb.v*L[0]):addBrightnessToRGB(q,k.fb.v*L))}}for(F=0;F<I;F+=1)k=S[F].a,k.p.propType&&(w=S[F].s,L=w.getMult(D[s].anIndexes[F],P.a[F].s.totalChars),this._hasMaskedPath?L.length?C.translate(0,k.p.v[1]*L[0],-k.p.v[2]*L[1]):C.translate(0,k.p.v[1]*L,-k.p.v[2]*L):L.length?C.translate(k.p.v[0]*L[0],k.p.v[1]*L[1],-k.p.v[2]*L[2]):C.translate(k.p.v[0]*L,k.p.v[1]*L,-k.p.v[2]*L));if(t.strokeWidthAnim&&(Y=j<0?0:j),t.strokeColorAnim&&(X="rgb("+Math.round(255*H[0])+","+Math.round(255*H[1])+","+Math.round(255*H[2])+")"),t.fillColorAnim&&t.fc&&(J="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(C.translate(0,-t.ls),C.translate(0,x[1]*R/100+r,0),P.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var pt=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(pt+=180),C.rotate(-pt*Math.PI/180)}C.translate(z,N,0),o-=x[0]*D[s].an/200,D[s+1]&&U!==D[s+1].ind&&(o+=D[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(C.translate(i,r,0),t.ps&&C.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:C.translate(D[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[s].line]),0,0);break;case 2:C.translate(D[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[s].line])/2,0,0)}C.translate(0,-t.ls),C.translate(G,0,0),C.translate(x[0]*D[s].an/200,x[1]*R/100,0),i+=D[s].l+t.tr/1e3*t.finalSize}"html"===_?it=C.toCSS():"svg"===_?it=C.to2dCSS():rt=[C.props[0],C.props[1],C.props[2],C.props[3],C.props[4],C.props[5],C.props[6],C.props[7],C.props[8],C.props[9],C.props[10],C.props[11],C.props[12],C.props[13],C.props[14],C.props[15]],K=O}A<=s?(V=new LetterProps(K,Y,X,J,it,rt),this.renderedLetters.push(V),A+=1,this.lettersChangedFlag=!0):(V=this.renderedLetters[s],this.lettersChangedFlag=V.update(K,Y,X,J,it,rt)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,i,r,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var n=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,n=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,n=!0),this.sc!==i&&(this.sc=i,this._mdf.sc=!0,n=!0),this.fc!==r&&(this.fc=r,this._mdf.fc=!0,n=!0),this.m!==s&&(this.m=s,this._mdf.m=!0,n=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,this._mdf.p=!0,n=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyFromDocumentData=function(t){for(var e in t)this.currentData[e]=t[e]},TextProperty.prototype.setCurrentData=function(t,e){this.currentData!==t?(t.__complete||this.completeTextData(t),this.copyFromDocumentData(t),this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this.currentData.fillColorAnim=t.fillColorAnim||this.currentData.fillColorAnim,this.currentData.strokeColorAnim=t.strokeColorAnim||this.currentData.strokeColorAnim,this.currentData.strokeWidthAnim=t.strokeWidthAnim||this.currentData.strokeWidthAnim,this._mdf=!0):e!==this.currentData.t&&(this._mdf=!0,this.completeTextData(t))},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){var e=this.currentData.t;if(this.lock)return void this.setCurrentData(this.currentData,e);this.lock=!0,this._mdf=!1;var i,r=this.effectsSequence.length,s=t||this.currentData;for(i=0;i<r;i+=1)s=this.effectsSequence[i](s);this.setCurrentData(s,e),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}},TextProperty.prototype.getKeyframeValue=function(t){for(var e,i=this.data.d.k,r=this.elem.comp.renderedFrame,s=0,a=i.length;s<=a-1&&(e=i[s].s,!(s===a-1||i[s+1].t>r));)s+=1;return this.keysIndex!==s&&(t=e,this.keysIndex=s),t},TextProperty.prototype.buildFinalText=function(t){for(var e=FontManager.getCombinedCharacterCodes(),i=[],r=0,s=t.length;r<s;)e.indexOf(t.charCodeAt(r))!==-1?i[i.length-1]+=t.charAt(r):i.push(t.charAt(r)),r+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,i,r,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],m=0,f=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),E=0,x=b.fStyle?b.fStyle.split(" "):[],S="normal",P="normal";i=x.length;var C;for(e=0;e<i;e+=1)switch(C=x[e].toLowerCase()){case"italic":P="italic";break;case"bold":S="700";break;case"black":S="900";break;case"medium":S="500";break;case"regular":case"normal":S="400";break;case"light":case"thin":S="200"}t.fWeight=b.fWeight||S,t.fStyle=P,i=t.t.length,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),t.finalLineHeight=t.lh;var _=t.tr/1e3*t.finalSize;if(t.sz)for(var A,D,T=!0,M=t.sz[0],k=t.sz[1];T;){D=this.buildFinalText(t.t),A=0,g=0,i=D.length,_=t.tr/1e3*t.finalSize;var w=-1;for(e=0;e<i;e+=1)r=!1," "===D[e]?w=e:13===D[e].charCodeAt(0)&&(g=0,r=!0,A+=t.finalLineHeight||1.2*t.finalSize),h.chars?(o=h.getCharData(D[e],b.fStyle,b.fFamily),E=r?0:o.w*t.finalSize/100):E=h.measureText(D[e],t.f,t.finalSize),g+E>M&&" "!==D[e]?(w===-1?i+=1:e=w,A+=t.finalLineHeight||1.2*t.finalSize,D.splice(e,w===e?1:0,"\r"),w=-1,g=0):(g+=E,g+=_);A+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&k<A?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=D,i=t.finalText.length,T=!1)}g=-_,E=0;var F,I=0;for(e=0;e<i;e+=1)if(r=!1,F=t.finalText[e]," "===F?s="\xa0":13===F.charCodeAt(0)?(I=0,y.push(g),v=g>v?g:v,g=-2*_,s="",r=!0,u+=1):s=t.finalText[e],h.chars?(o=h.getCharData(F,b.fStyle,h.getFontByName(t.f).fFamily),E=r?0:o.w*t.finalSize/100):E=h.measureText(s,t.f,t.finalSize)," "===F?I+=E+_:(g+=E+_+I,I=0),p.push({l:E,an:E,add:c,n:r,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=E,""===s||"\xa0"===s||e===i-1){for(""!==s&&"\xa0"!==s||(c-=E);d<=e;)p[d].an=c,
+p[d].ind=m,p[d].extra=E,d+=1;m+=1,c=0}}else if(3==f){if(c+=E,""===s||e===i-1){for(""===s&&(c-=E);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=E,d+=1;c=0,m+=1}}else p[m].ind=m,p[m].extra=0,m+=1;if(t.l=p,v=g>v?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var V,R,B=l.a;n=B.length;var L,G,z=[];for(a=0;a<n;a+=1){for(V=B[a],V.a.sc&&(t.strokeColorAnim=!0),V.a.sw&&(t.strokeWidthAnim=!0),(V.a.fc||V.a.fh||V.a.fs||V.a.fb)&&(t.fillColorAnim=!0),G=0,L=V.s.b,e=0;e<i;e+=1)R=p[e],R.anIndexes[a]=G,(1==L&&""!==R.val||2==L&&""!==R.val&&"\xa0"!==R.val||3==L&&(R.n||"\xa0"==R.val||e==i-1)||4==L&&(R.n||e==i-1))&&(1===V.s.rn&&z.push(G),G+=1);l.a[a].s.totalChars=G;var N,O=-1;if(1===V.s.rn)for(e=0;e<i;e+=1)R=p[e],O!=R.anIndexes[a]&&(O=R.anIndexes[a],N=z.splice(Math.floor(Math.random()*z.length),1)[0]),R.anIndexes[a]=N}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex===-1?0:this.keysIndex:e;var i=this.data.d.k[e].s;for(var r in t)i[r]=t[r];this.recalculate(e)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=this.kf?-1:0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex)};var TextSelectorProp=function(){function t(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),"e"in e?this.e=PropertyFactory.getProp(t,e.e,0,0,this):this.e={v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}function e(e,i,r){return new t(e,i,r)}var i=Math.max,r=Math.min,s=Math.floor;return t.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=BezierFactory.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get,a=0,n=this.finalS,o=this.finalE,h=this.data.sh;if(2==h)a=o===n?t>=o?1:0:i(0,r(.5/(o-n)+(t-n)/(o-n),1)),a=e(a);else if(3==h)a=o===n?t>=o?0:1:1-i(0,r(.5/(o-n)+(t-n)/(o-n),1)),a=e(a);else if(4==h)o===n?a=0:(a=i(0,r(.5/(o-n)+(t-n)/(o-n),1)),a<.5?a*=2:a=1-2*(a-.5)),a=e(a);else if(5==h){if(o===n)a=0;else{var l=o-n;t=r(i(0,t+.5-n),o-n);var p=-l/2+t,m=l/2;a=Math.sqrt(1-p*p/(m*m))}a=e(a)}else 6==h?(o===n?a=0:(t=r(i(0,t+.5-n),o-n),a=(1+Math.cos(Math.PI+2*Math.PI*t/(o-n)))/2),a=e(a)):(t>=s(n)&&(a=t-n<0?1-(n-t):i(0,r(o-t,1))),a=e(a));return a*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this._currentTextLength,i=this.o.v/e,r=this.s.v/e+i,s=this.e.v/e+i;if(r>s){var a=r;r=s,s=a}this.finalS=r,this.finalE=s}},extendPrototype([DynamicPropertyContainer],t),{getTextSelectorProp:e}}(),pool_factory=function(){return function(t,e,i,r){function s(){var t;return n?(n-=1,t=h[n]):t=e(),t}function a(t){n===o&&(h=pooling["double"](h),o=2*o),i&&i(t),h[n]=t,n+=1}var n=0,o=t,h=createSizedArray(o),l={newElement:s,release:a};return l}}(),pooling=function(){function t(t){return t.concat(createSizedArray(t.length))}return{"double":t}}(),point_pool=function(){function t(){return createTypedArray("float32",2)}return pool_factory(8,t)}(),shape_pool=function(){function t(){return new ShapePath}function e(t){var e,i=t._length;for(e=0;e<i;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}function i(t){var e,i=r.newElement(),s=void 0===t._length?t.v.length:t._length;i.setLength(s),i.c=t.c;for(e=0;e<s;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i}var r=pool_factory(4,t,e);return r.clone=i,r}(),shapeCollection_pool=function(){function t(){var t;return r?(r-=1,t=a[r]):t=new ShapeCollection,t}function e(t){var e,i=t._length;for(e=0;e<i;e+=1)shape_pool.release(t.shapes[e]);t._length=0,r===s&&(a=pooling["double"](a),s=2*s),a[r]=t,r+=1}var i={newShapeCollection:t,release:e},r=0,s=4,a=createSizedArray(s);return i}(),segments_length_pool=function(){function t(){return{lengths:[],totalLength:0}}function e(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}return pool_factory(8,t,e)}(),bezier_length_pool=function(){function t(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}}return pool_factory(8,t)}();BaseRenderer.prototype.checkLayers=function(t){var e,i,r=this.layers.length;for(this.completeLayers=!0,e=r-1;e>=0;e--)this.elements[e]||(i=this.layers[e],i.ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,i,r=t.length,s=this.layers.length;for(e=0;e<r;e+=1)for(i=0;i<s;){if(this.layers[i].id==t[e].id){this.layers[i]=t[e];break}i+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,i){for(var r=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(r[a]&&r[a]!==!0?(i.push(r[a]),r[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,i):t.setHierarchy(i)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var r=this.createComp(t[e]);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.nm=t.nm,this.globalData.compSize.w=t.w,this.globalData.compSize.h=t.h,this.globalData.frameRate=t.fr,this.data=t;var i=createNS("clipPath"),r=createNS("rect");r.setAttribute("width",t.w),r.setAttribute("height",t.h),r.setAttribute("x",0),r.setAttribute("y",0);var s="animationMask_"+randomString(10);i.setAttribute("id",s),i.appendChild(r),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(i),this.layers=t.layers,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var i=this.createItem(this.layers[t]);e[t]=i,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,t),this.layers[t].tt&&(this.elements[t-1]&&this.elements[t-1]!==!0?i.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(i)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,i=this.elements.length;e<i;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=i-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<i;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){for(var r,s=0;s<e;)this.elements[s]&&this.elements[s]!==!0&&this.elements[s].getBaseElement()&&(r=this.elements[s].getBaseElement()),s+=1;r?this.layerElement.insertBefore(i,r):this.layerElement.appendChild(i)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,i=this.element.finalTransform.mat,r=this.masksProperties.length;for(e=0;e<r;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&(this.viewData[e].invRect.setAttribute("x",-i.props[12]),this.viewData[e].invRect.setAttribute("y",-i.props[13])),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,i){var r,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,r=1;r<s;r+=1)a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[r][0]+","+e.i[r][1]+" "+e.v[r][0]+","+e.v[r][1];if(e.c&&s>1&&(a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==a){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),i.elem.setAttribute("d",n)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var i,r=this.dynamicProperties.length;for(i=0;i<r;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){this.dynamicProperties.indexOf(t)===-1&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),11!==this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<r;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<r;i+=1)t=this.hierarchy[i].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var i=!0,r=this.comp;i;)r.finalTransform?(r.data.hasMask&&e.splice(0,0,r.finalTransform),r=r.comp):i=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},function(){var t={initElement:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide()},hide:function(){if(!this.hidden&&(!this.isInRange||this.isTransparent)){var t=this.baseElement||this.layerElement;t.style.display="none",this.hidden=!0}},show:function(){if(this.isInRange&&!this.isTransparent){if(!this.data.hd){var t=this.baseElement||this.layerElement;t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}};extendPrototype([RenderableElement,createProxyFunction(t)],RenderableDOMElement)}(),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,i){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,e),this.setGradientOpacity(e,i),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var i="gr_"+randomString(10),r=createNS(1===e.t?"linearGradient":"radialGradient");r.setAttribute("id",i),r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),r.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url(#"+i+")"),this.gf=r,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var i,r,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o="op_"+randomString(10),h="mk_"+randomString(10);a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(r=4*t.g.p;r<s;r+=2)i=createNS("stop"),i.setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(i),p.push(i);n.setAttribute("gf"===t.ty?"fill":"stroke","url(#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){function t(t){t.ty;switch(t.ty){case"fl":return r;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return i;case"tr":return e}}function e(t,e,i){(i||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(i||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function i(t,e,i){var r,s,a,n,l,p,m,f,c,d,u,y=e.styles.length,g=e.lvl;for(p=0;p<y;p+=1){if(n=e.sh._mdf||i,e.styles[p].lvl<g){for(f=h.reset(),d=g-e.styles[p].lvl,u=e.transformers.length-1;!n&&d>0;)n=e.transformers[u].mProps._mdf||n,d--,u--;if(n)for(d=g-e.styles[p].lvl,u=e.transformers.length-1;d>0;)c=e.transformers[u].mProps.v.props,f.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),d--,u--}else f=o;if(m=e.sh.paths,s=m._length,n){for(a="",r=0;r<s;r+=1)l=m.shapes[r],l&&l._length&&(a+=buildShapeString(l,l._length,l.c,f));e.caches[p]=a}else a=e.caches[p];e.styles[p].d+=a,e.styles[p]._mdf=n||e.styles[p]._mdf}}function r(t,e,i){var r=e.style;(e.c._mdf||i)&&r.pElem.setAttribute("fill","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,i){a(t,e,i),n(t,e,i)}function a(t,e,i){var r=e.gf,s=e.g._hasOpacity,a=e.s.v,n=e.e.v;if(e.o._mdf||i){var o="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(o,e.o.v)}if(e.s._mdf||i){var h=1===t.t?"x1":"cx",l="x1"===h?"y1":"cy";r.setAttribute(h,a[0]),r.setAttribute(l,a[1]),s&&!e.g._collapsable&&(e.of.setAttribute(h,a[0]),e.of.setAttribute(l,a[1]))}var p,m,f,c;if(e.g._cmdf||i){p=e.cst;var d=e.g.c;for(f=p.length,m=0;m<f;m+=1)c=p[m],c.setAttribute("offset",d[4*m]+"%"),c.setAttribute("stop-color","rgb("+d[4*m+1]+","+d[4*m+2]+","+d[4*m+3]+")")}if(s&&(e.g._omdf||i)){var u=e.g.o;for(p=e.g._collapsable?e.cst:e.ost,f=p.length,m=0;m<f;m+=1)c=p[m],e.g._collapsable||c.setAttribute("offset",u[2*m]+"%"),c.setAttribute("stop-opacity",u[2*m+1])}if(1===t.t)(e.e._mdf||i)&&(r.setAttribute("x2",n[0]),r.setAttribute("y2",n[1]),s&&!e.g._collapsable&&(e.of.setAttribute("x2",n[0]),e.of.setAttribute("y2",n[1])));else{var y;if((e.s._mdf||e.e._mdf||i)&&(y=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),r.setAttribute("r",y),s&&!e.g._collapsable&&e.of.setAttribute("r",y)),e.e._mdf||e.h._mdf||e.a._mdf||i){y||(y=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)));var g=Math.atan2(n[1]-a[1],n[0]-a[0]),v=e.h.v>=1?.99:e.h.v<=-1?-.99:e.h.v,b=y*v,E=Math.cos(g+e.a.v)*b+a[0],x=Math.sin(g+e.a.v)*b+a[1];r.setAttribute("fx",E),r.setAttribute("fy",x),s&&!e.g._collapsable&&(e.of.setAttribute("fx",E),e.of.setAttribute("fy",x))}}}function n(t,e,i){var r=e.style,s=e.d;s&&(s._mdf||i)&&s.dashStr&&(r.pElem.setAttribute("stroke-dasharray",s.dashStr),r.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||i)&&r.pElem.setAttribute("stroke","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(r.pElem.setAttribute("stroke-width",e.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",e.w.v))}var o=new Matrix,h=new Matrix,l={createRenderFunction:t};return l}();BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&this.data.masksProperties[t].cl!==!1)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},blendModeEnums:{1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},getBlendMode:function(){return this.blendModeEnums[this.data.bm]||""},setBlendMode:function(){var t=this.getBlendMode(),e=this.baseElement||this.layerElement;e.style["mix-blend-mode"]=t},initBaseData:function(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId="ly_"+randomString(10),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,i,r=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),r=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=randomString(10),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),i.appendChild(this.layerElement),r=i,s.appendChild(i),i.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=randomString(10),e=filtersFactory.createFilter(t);var o=createNS("feColorMatrix");o.setAttribute("type","matrix"),o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1"),e.appendChild(o),this.globalData.defs.appendChild(e);var h=createNS("rect");h.setAttribute("width",this.comp.data.w),h.setAttribute("height",this.comp.data.h),h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("fill","#ffffff"),h.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(h),n.appendChild(this.layerElement),r=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),n.appendChild(h),i.appendChild(this.layerElement),r=i,n.appendChild(i)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),r=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var l=createNS("clipPath"),p=createNS("path");p.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m="cp_"+randomString(8);if(l.setAttribute("id",m),l.appendChild(p),this.globalData.defs.appendChild(l),this.checkMasks()){var f=createNS("g");f.setAttribute("clip-path","url("+locationHref+"#"+m+")"),f.appendChild(this.layerElement),this.transformedElement=f,r?r.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+m+")")}0!==this.data.bm&&this.setBlendMode(),this.renderableEffectsManager=new SVGEffects(this)},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},addMasks:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=0,i=this.shapeModifiers.length;e<i;)if(this.shapeModifiers[e].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(e=this.shapeModifiers.length,t=e-1;t>=0;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"butt"},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,r=e.length;i<r;){if(e[i].elem===t)return e[i].pos;i+=1}return 0},addProcessedElement:function(t,e){for(var i=this.processedElements,r=i.length;r;)if(r-=1,i[r].elem===t)return void(i[r].pos=e);i.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var i,r,s=e.length,a="";for(i=0;i<s;i+=1)r=e[i].ks.k,a+=buildShapeString(r,r.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,i,r,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(r,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){
+if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i,r=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=0;i<r;i+=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio","xMidYMid slice"),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextElement),SVGTextElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextElement.prototype.buildTextContents=function(t){for(var e=0,i=t.length,r=[],s="";e<i;)t[e]===String.fromCharCode(13)?(r.push(s),s=""):s+=t[e],e+=1;return r.push(s),r},SVGTextElement.prototype.buildNewText=function(){var t,e,i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var r=this.globalData.fontManager.getFontByName(i.f);if(r.fClass)this.layerElement.setAttribute("class",r.fClass);else{this.layerElement.setAttribute("font-family",r.fFamily);var s=i.fWeight,a=i.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}var n=i.l||[],o=this.globalData.fontManager.chars;if(e=n.length){var h,l,p=this.mHelper,m="",f=this.data.singleShape,c=0,d=0,u=!0,y=i.tr/1e3*i.finalSize;if(!f||o||i.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)o&&f&&0!==t||(h=b>t?this.textSpans[t]:createNS(o?"path":"text"),b<=t&&(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=h,this.layerElement.appendChild(h)),h.style.display="inherit"),p.reset(),p.scale(i.finalSize/100,i.finalSize/100),f&&(n[t].n&&(c=-y,d+=i.yOffset,d+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(i,p,n[t].line,c,d),c+=n[t].l||0,c+=y),o?(v=this.globalData.fontManager.getCharData(i.finalText[t],r.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily),g=v&&v.data||{},l=g.shapes?g.shapes[0].it:[],f?m+=this.createPathShape(p,l):h.setAttribute("d",this.createPathShape(p,l))):(f&&h.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));f&&h.setAttribute("d",m)}else{var E=this.textContainer,x="start";switch(i.j){case 1:x="end";break;case 2:x="middle"}E.setAttribute("text-anchor",x),E.setAttribute("letter-spacing",y);var S=this.buildTextContents(i.finalText);for(e=S.length,d=i.ps?i.ps[1]+i.ascent:0,t=0;t<e;t+=1)h=this.textSpans[t]||createNS("tspan"),h.textContent=S[t],h.setAttribute("x",0),h.setAttribute("y",d),h.style.display="inherit",E.appendChild(h),this.textSpans[t]=h,d+=i.finalLineHeight;this.layerElement.appendChild(E)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0}},SVGTextElement.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){this._sizeChanged=!0;var t,e,i=this.textAnimator.renderedLetters,r=this.textProperty.currentData.l;e=r.length;var s,a;for(t=0;t<e;t+=1)r[t].n||(s=i[t],a=this.textSpans[t],s._mdf.m&&a.setAttribute("transform",s.m),s._mdf.o&&a.setAttribute("opacity",s.o),s._mdf.sw&&a.setAttribute("stroke-width",s.sw),s._mdf.sc&&a.setAttribute("stroke",s.sc),s._mdf.fc&&a.setAttribute("fill",s.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,i,r,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(i=0;i<a;i+=1){for(r=this.stylesList[i],o=!1,n.length=0,t=0;t<s;t+=1)e=this.shapes[t],e.styles.indexOf(r)!==-1&&(n.push(e),o=e._isAnimated||o);n.length>1&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var i,r=new SVGStyleData(t,e),s=r.pElem;if("st"===t.ty)i=new SVGStrokeStyleData(this,t,r);else if("fl"===t.ty)i=new SVGFillStyleData(this,t,r);else if("gf"===t.ty||"gs"===t.ty){var a="gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData;i=new a(this,t,r),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),s.setAttribute("mask","url(#"+i.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),this.stylesList.push(r),this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var i=TransformPropertyFactory.getTransformProperty(this,t,this),r=new SVGTransformData(i,i.o,e);return this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createShapeElement=function(t,e,i){var r=4;"rc"===t.ty?r=5:"el"===t.ty?r=6:"sr"===t.ty&&(r=7);var s=ShapePropertyFactory.getShapeProp(this,t,r,this),a=new SVGShapeData(e,i,s);return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var i=0,r=this.animatedContents.length;i<r;){if(this.animatedContents[i].element===e)return;i+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,i=t.styles,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||i.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,i,r,s,a,n){var o,h,l,p,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;o>=0;o-=1){if(f=this.searchProcessedElement(t[o]),f?e[o]=i[f-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&r.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"==t[o].ty){if(f)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&r.appendChild(e[o].gr)}else"tr"==t[o].ty?(f||(e[o]=this.createTransformElement(t[o],r)),p=e[o].transform,c.push(p)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty?(f?(m=e[o],m.closed=!1):(m=ShapeModifiers.getModifier(t[o].ty),m.init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"==t[o].ty&&(f?(m=e[o],m.closed=!0):(m=ShapeModifiers.getModifier(t[o].ty),e[o]=m,m.init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,i=this.animatedContents.length;for(t=0;t<i;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapeData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",i[0]-e[0]+" 0 0 0 "+e[0]+" "+(i[1]-e[1])+" 0 0 0 "+e[1]+" "+(i[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,i=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var t,e,i,r,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(r=this.elem.maskManager.masksProperties.length,i=0):(i=this.filterManager.effectElements[0].p.v-1,r=i+1),e=createNS("g"),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1),i;i<r;i+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:i});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n="stms_"+randomString(10);a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");o.setAttribute("mask","url("+locationHref+"#"+n+")"),s[0]&&o.appendChild(s[0]),this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,i,r,s=this.paths.length;for(e=0;e<s;e+=1)if(this.paths[e].m!==-1&&(i=this.elem.maskManager.viewData[this.paths[e].m],r=this.paths[e].p,(t||this.filterManager._mdf||i.prop._mdf)&&r.setAttribute("d",i.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||i.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=r.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),m=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,f=Math.floor(p/m);for(l=0;l<f;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;r.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bm_floor(255*c[0])+","+bm_floor(255*c[1])+","+bm_floor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v,s=r[0]+" "+i[0]+" "+e[0],a=r[1]+" "+i[1]+" "+e[1],n=r[2]+" "+i[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var i=createNS(t);return i.setAttribute("type","table"),e.appendChild(i),i},SVGProLevelsFilter.prototype.getTableValue=function(t,e,i,r,s){for(var a,n,o=0,h=256,l=Math.min(t,e),p=Math.max(t,e),m=Array.call(null,{length:h}),f=0,c=s-r,d=e-t;o<=256;)a=o/256,n=a<=l?d<0?s:r:a>=p?d<0?r:s:r+c*Math.pow((a-t)/d,1/i),m[f++]=n,o+=256/(h-1);return m.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,r=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=i*Math.cos(r),a=i*Math.sin(r);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[],_svgMatteMaskCounter=0;SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e<i;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var i=t.layerElement.parentNode;if(i){for(var r=i.children,s=0,a=r.length;s<a&&r[s]!==t.layerElement;)s+=1;var n;s<=a-2&&(n=r[s+1]);var o=createNS("use");o.setAttribute("href","#"+e),n?i.insertBefore(o,n):i.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var i="matte_"+randomString(5)+"_"+_svgMatteMaskCounter++,r=createNS("mask");r.setAttribute("id",e.layerId),r.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(r);var a=createNS("symbol");a.setAttribute("id",i),this.replaceInParent(e,i),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+i),r.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=0,i=this.elem.comp.elements.length;e<i;)this.elem.comp.elements[e].data.ind===t&&this.setElementAsMask(this.elem,this.elem.comp.elements[e]),e+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)};var animationManager=function(){function t(t){for(var e=0,i=t.target;e<S;)E[e].animation===i&&(E.splice(e,1),e-=1,S-=1,i.isPaused||r()),e+=1}function e(t,e){if(!t)return null;for(var i=0;i<S;){if(E[i].elem==t&&null!==E[i].elem)return E[i].animation;i+=1}var r=new AnimationItem;return s(r,t),r.setData(t,e),r}function i(){C+=1,v()}function r(){C-=1,0===C&&(P=!0)}function s(e,s){e.addEventListener("destroy",t),e.addEventListener("_active",i),e.addEventListener("_idle",r),E.push({elem:s,animation:e}),S+=1}function a(t){var e=new AnimationItem;return s(e,null),e.setParams(t),e}function n(t,e){var i;for(i=0;i<S;i+=1)E[i].animation.setSpeed(t,e)}function o(t,e){var i;for(i=0;i<S;i+=1)E[i].animation.setDirection(t,e)}function h(t){var e;for(e=0;e<S;e+=1)E[e].animation.play(t)}function l(t){var e,i=t-x;for(e=0;e<S;e+=1)E[e].animation.advanceTime(i);x=t,P?_=!0:window.requestAnimationFrame(l)}function p(t){x=t,window.requestAnimationFrame(l)}function m(t){var e;for(e=0;e<S;e+=1)E[e].animation.pause(t)}function f(t,e,i){var r;for(r=0;r<S;r+=1)E[r].animation.goToAndStop(t,e,i)}function c(t){var e;for(e=0;e<S;e+=1)E[e].animation.stop(t)}function d(t){var e;for(e=0;e<S;e+=1)E[e].animation.togglePause(t)}function u(t){var e;for(e=S-1;e>=0;e-=1)E[e].animation.destroy(t)}function y(t,i,r){var s,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),n=a.length;for(s=0;s<n;s+=1)r&&a[s].setAttribute("data-bm-type",r),e(a[s],t);if(i&&0===n){r||(r="svg");var o=document.getElementsByTagName("body")[0];o.innerHTML="";var h=createTag("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",r),o.appendChild(h),e(h,t)}}function g(){var t;for(t=0;t<S;t+=1)E[t].animation.resize()}function v(){P&&(P=!1,_&&(window.requestAnimationFrame(p),_=!1))}var b={},E=[],x=0,S=0,P=!0,C=0,_=!0;return b.registerAnimation=e,b.loadAnimation=a,b.setSpeed=n,b.setDirection=o,b.play=h,b.pause=m,b.stop=c,b.togglePause=d,b.searchAnimations=y,b.resize=g,b.goToAndStop=f,b.destroy=u,b}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.pendingElements=0,this.playCount=0,this.animationData={},this.layers=[],this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=randomString(10),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.subframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this.projectInterface=ProjectInterface()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){var e=this;t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var i=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(i){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}if(this.renderer.setProjectInterface(this.projectInterface),this.animType=i,""===t.loop||null===t.loop||(t.loop===!1?this.loop=!1:t.loop===!0?this.loop=!0:this.loop=parseInt(t.loop)),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,t.animationData)e.configAnimation(t.animationData);else if(t.path){"json"!=t.path.substr(-4)&&("/"!=t.path.substr(-1,1)&&(t.path+="/"),t.path+="data.json");var r=new XMLHttpRequest;t.path.lastIndexOf("\\")!=-1?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),r.open("GET",t.path,!0),r.send(),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status)e.configAnimation(JSON.parse(r.responseText));else try{var t=JSON.parse(r.responseText);e.configAnimation(t)}catch(i){}}}},AnimationItem.prototype.setData=function(t,e){var i={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",i.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:"canvas";var s=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";""===s||("false"===s?i.loop=!1:"true"===s?i.loop=!0:i.loop=parseInt(s));var a=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:!r.getNamedItem("bm-autoplay")||r.getNamedItem("bm-autoplay").value;i.autoplay="false"!==a,i.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"";var n=r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"";"false"===n&&(i.prerender=!1),this.setParams(i)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip),this.animationData.tf=this.totalFrames);var e,i,r=this.animationData.layers,s=r.length,a=t.layers,n=a.length;for(i=0;i<n;i+=1)for(e=0;e<s;){if(r[e].id==a[i].id){r[e]=a[i];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.renderFrame(-1),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.animationData.tf);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=new XMLHttpRequest,r=this,s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,i.open("GET",s,!0),i.send(),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status)r.includeLayers(JSON.parse(i.responseText));else try{var t=JSON.parse(i.responseText);r.includeLayers(t)}catch(e){}}},AnimationItem.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.animationData.tf),this.loadNextSegment()},AnimationItem.prototype.configAnimation=function(t){var e=this;this.renderer&&(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.animationData.tf=this.totalFrames,this.renderer.configAnimation(t),t.assets||(t.assets=[]),t.comps&&(t.assets=t.assets.concat(t.comps),t.comps=null),this.renderer.searchExtraCompositions(t.assets),this.layers=this.animationData.layers,this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.trigger("config_ready"),this.imagePreloader=new ImagePreloader,this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(t.assets,function(t){t||e.trigger("loaded_images")}),this.loadSegments(),this.updaFrameModifier(),this.renderer.globalData.fontManager?this.waitForFontsLoaded():(dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()))},AnimationItem.prototype.waitForFontsLoaded=function(){function t(){this.renderer.globalData.fontManager.loaded?(dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()):setTimeout(t.bind(this),20)}return function(){t.bind(this)()}}(),AnimationItem.prototype.addPendingElement=function(){this.pendingElements+=1},AnimationItem.prototype.elementLoaded=function(){this.pendingElements--,this.checkLoaded()},AnimationItem.prototype.checkLoaded=function(){0===this.pendingElements&&(expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.isLoaded=!0,this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.subframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.subframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){this.isLoaded!==!1&&this.renderer.renderFrame(this.currentFrame+this.firstFrame)},AnimationItem.prototype.play=function(t){t&&this.name!=t||this.isPaused===!0&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||this.isPaused===!1&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"))},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,i){i&&this.name!=i||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,i){this.goToAndStop(t,e,i),this.play()},AnimationItem.prototype.advanceTime=function(t){if(this.isPaused!==!0&&this.isLoaded!==!1){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e%this.totalFrames)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&this.loop!==!0?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,i!==-1&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if("object"==typeof t[0]){var i,r=t.length;for(i=0;i<r;i+=1)this.segments.push(t[i])}else this.segments.push(t);e&&this.checkSegments(0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),
+!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(this.assetsPath){var i=t.p;i.indexOf("images/")!==-1&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getAssets=function(){return this.assets},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13]){if(!this.renderConfig.clearCanvas)return void this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13]);this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var i=this.contextData.cTr.props;this.canvasContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13])}},CanvasRenderer.prototype.ctxOpacity=function(t){return this.renderConfig.clearCanvas?(this.contextData.cO*=t<0?0:t,void(this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO))):(this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO))},CanvasRenderer.prototype.reset=function(){return this.renderConfig.clearCanvas?void this.contextData.reset():void this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(!this.renderConfig.clearCanvas)return void this.canvasContext.save();t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i,r=this.contextData.saved[this.contextData.cArrPos];for(i=0;i<16;i+=1)r[i]=e[i];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1},CanvasRenderer.prototype.restore=function(t){if(!this.renderConfig.clearCanvas)return void this.canvasContext.restore();t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,i=this.contextData.saved[this.contextData.cArrPos],r=this.contextData.cTr.props;for(e=0;e<16;e+=1)r[e]=i[e];this.canvasContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13]),i=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=i,this.globalData.currentGlobalAlpha!==i&&(this.canvasContext.globalAlpha=i,this.globalData.currentGlobalAlpha=i)},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=createTag("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className)):this.canvasContext=this.renderConfig.context,this.data=t,this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.totalFrames=Math.floor(t.tf),this.globalData.compWidth=t.w,this.globalData.compHeight=t.h,this.globalData.frameRate=t.fr,this.globalData.frameId=0,this.globalData.compSize={w:t.w,h:t.h},this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,document.body),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.elementLoaded=this.animationItem.elementLoaded.bind(this.animationItem),this.globalData.addPendingElement=this.animationItem.addPendingElement.bind(this.animationItem),this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){this.reset();var t,e;this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr);var i,r;if(this.renderConfig.preserveAspectRatio.indexOf("meet")!==-1||this.renderConfig.preserveAspectRatio.indexOf("slice")!==-1){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);i=t/e,r=this.transformCanvas.w/this.transformCanvas.h,r>i&&"meet"===a||r<i&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)),"xMid"===o&&(r<i&&"meet"===a||r>i&&"slice"===a)?this.transformCanvas.tx=(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(r<i&&"meet"===a||r>i&&"slice"===a)?this.transformCanvas.tx=(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,"YMid"===h&&(r>i&&"meet"===a||r<i&&"slice"===a)?this.transformCanvas.ty=(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r>i&&"meet"===a||r<i&&"slice"===a)?this.transformCanvas.ty=(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:this.transformCanvas.ty=0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip()},CanvasRenderer.prototype.destroy=function(){this.renderConfig.clearCanvas&&(this.animationItem.wrapper.innerHTML="");var t,e=this.layers?this.layers.length:0;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t){if(!(this.renderedFrame==t&&this.renderConfig.clearCanvas===!0||this.destroyed||t===-1)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!1,this.globalData.projectInterface.currentFrame=t;var e,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=0;e<i;e++)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),e=i-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){var r=this.layers[e];if(r.ddd&&this.supports3d)this.addTo3dContainer(i,e);else if(this.threeDElements)this.addTo3dContainer(i,e);else{for(var s,a,n,o=0;o<e;)this.elements[o]&&this.elements[o]!==!0&&this.elements[o].getBaseElement&&(a=this.elements[o],n=this.layers[o].ddd?this.getThreeDContainerByPos(o):a.getBaseElement(),s=n||s),o+=1;s?r.ddd&&this.supports3d||this.layerElement.insertBefore(i,s):r.ddd&&this.supports3d||this.layerElement.appendChild(i)}}},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextElement(t,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRenderer.prototype.createNull=SVGRenderer.prototype.createNull,HybridRenderer.prototype.getThreeDContainerByPos=function(t){for(var e=0,i=this.threeDElements.length;e<i;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}},HybridRenderer.prototype.createThreeDContainer=function(t,e){var i=createTag("div");styleDiv(i);var r=createTag("div");styleDiv(r),"3d"===e&&(i.style.width=this.globalData.compSize.w+"px",i.style.height=this.globalData.compSize.h+"px",i.style.transformOrigin=i.style.mozTransformOrigin=i.style.webkitTransformOrigin="50% 50%",r.style.transform=r.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),i.appendChild(r);var s={container:r,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(s),s},HybridRenderer.prototype.build3dContainers=function(){var t,e,i=this.layers.length,r="";for(t=0;t<i;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?("3d"!==r&&(r="3d",e=this.createThreeDContainer(t,"3d")),e.endPos=Math.max(e.endPos,t)):("2d"!==r&&(r="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t));for(i=this.threeDElements.length,t=i-1;t>=0;t--)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var i=0,r=this.threeDElements.length;i<r;){if(e<=this.threeDElements[i].endPos){for(var s,a=this.threeDElements[i].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a].getBaseElement()),a+=1;s?this.threeDElements[i].container.insertBefore(t,s):this.threeDElements[i].container.appendChild(t);break}i+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=createTag("div"),i=this.animationItem.wrapper;e.style.width=t.w+"px",e.style.height=t.h+"px",this.resizerElem=e,styleDiv(e),e.style.transformStyle=e.style.webkitTransformStyle=e.style.mozTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),i.appendChild(e),e.style.overflow="hidden";var r=createNS("svg");r.setAttribute("width","1"),r.setAttribute("height","1"),styleDiv(r),this.resizerElem.appendChild(r);var s=createNS("defs");r.appendChild(s),this.globalData.defs=s,this.data=t,this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.elementLoaded=this.animationItem.elementLoaded.bind(this.animationItem),this.globalData.frameId=0,this.globalData.compSize={w:t.w,h:t.h},this.globalData.frameRate=t.fr,this.layers=t.layers,this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,r),this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,i,r,s=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight,n=s/a,o=this.globalData.compSize.w/this.globalData.compSize.h;o>n?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,i=0,r=(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,i=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,r=0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+r+",0,1)"},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,r=this.threeDElements.length;for(t=0;t<r;t+=1)this.threeDElements[t].perspectiveElem.style.perspective=this.threeDElements[t].perspectiveElem.style.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(i,2))+"px"}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length,r=createTag("div");for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e],r,this.globalData.comp,null);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var i=0;for(i=this._length;i<t;i+=1)this.saved[i]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=this.getBlendMode();t.canvasContext.globalCompositeOperation=e}},addMasks:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){this.hidden||(this.renderTransform(),this.renderRenderable(),this.setBlendMode(),this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.imageLoaded=function(){if(this.globalData.elementLoaded(),this.assetData.w!==this.img.width||this.assetData.h!==this.img.height){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,i,r=t.getContext("2d"),s=this.img.width,a=this.img.height,n=s/a,o=this.assetData.w/this.assetData.h;n>o?(i=a,e=i*o):(e=s,i=e/o),r.drawImage(this.img,(s-e)/2,(a-i)/2,e,i,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.imageFailed=function(){this.failed=!0,this.globalData.elementLoaded()},CVImageElement.prototype.createContent=function(){var t=this.img;t.addEventListener("load",this.imageLoaded.bind(this),!1),t.addEventListener("error",this.imageFailed.bind(this),!1);var e=this.globalData.getAssetsPath(this.assetData);t.src=e},CVImageElement.prototype.renderInnerContent=function(t){this.failed||this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,i,r,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compWidth,0),a.lineTo(this.element.globalData.compWidth,this.element.globalData.compHeight),a.lineTo(0,this.element.globalData.compHeight),a.lineTo(0,0)),r=this.viewData[t].v,e=s.applyToPointArray(r.v[0][0],r.v[0][1],0),a.moveTo(e[0],e[1]);var o,h=r._length;for(o=1;o<h;o++)i=s.applyToTriplePoints(r.o[o-1],r.i[o],r.v[o]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);i=s.applyToTriplePoints(r.o[o-1],r.i[0],r.v[0]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,mat:new Matrix,_matMdf:!1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0)},CVShapeElement.prototype.createStyleElement=function(t){var e={data:t,type:t.ty,elements:[]},i={};if("fl"!=t.ty&&"st"!=t.ty||(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(e.co="rgb("+bm_floor(i.c.v[0])+","+bm_floor(i.c.v[1])+","+bm_floor(i.c.v[2])+")")),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"==t.ty){if(e.lc=this.lcEnum[t.lc]||"round",e.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(e.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(e.wi=i.w.v),t.d){var r=new DashProperty(this,t.d,"canvas");i.d=r,i.d.k||(e.da=i.d.dashArray,e["do"]=i.d.dashoffset[0])}}else e.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(e),i.style=e,i},CVShapeElement.prototype.createGroupElement=function(t){var e={it:[],prevViewData:[]};return e},CVShapeElement.prototype.createTransformElement=function(t){var e={transform:{mat:new Matrix,opacity:1,_matMdf:!1,_opMdf:!1,op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)},elements:[]};return e},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t);this.shapes.push(e),this.addShapeToModifiers(e);var i,r=this.stylesList.length,s=!1,a=!1;for(i=0;i<r;i+=1)this.stylesList[i].closed||(this.stylesList[i].elements.push(e),"st"===this.stylesList[i].type?s=!0:a=!0);return e.st=s,e.fl=a,e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},CVShapeElement.prototype.searchShapes=function(t,e,i,r){var s,a,n,o,h,l=t.length-1,p=[],m=[];for(s=l;s>=0;s-=1){if(o=this.searchProcessedElement(t[s]),o?e[s]=i[o-1]:t[s]._render=r,"fl"==t[s].ty||"st"==t[s].ty)o?e[s].style.closed=!1:e[s]=this.createStyleElement(t[s]),p.push(e[s].style);else if("gr"==t[s].ty){if(o)for(n=e[s].it.length,a=0;a<n;a+=1)e[s].prevViewData[a]=e[s].it[a];else e[s]=this.createGroupElement(t[s]);this.searchShapes(t[s].it,e[s].it,e[s].prevViewData,r)}else"tr"==t[s].ty?o||(e[s]=this.createTransformElement(t[s])):"sh"==t[s].ty||"rc"==t[s].ty||"el"==t[s].ty||"sr"==t[s].ty?o||(e[s]=this.createShapeElement(t[s])):"tm"==t[s].ty||"rd"==t[s].ty?(o?(h=e[s],h.closed=!1):(h=ShapeModifiers.getModifier(t[s].ty),h.init(this,t[s]),e[s]=h,this.shapeModifiers.push(h)),m.push(h)):"rp"==t[s].ty&&(o?(h=e[s],h.closed=!0):(h=ShapeModifiers.getModifier(t[s].ty),e[s]=h,h.init(this,t,s,e),this.shapeModifiers.push(h),r=!1),m.push(h));this.addProcessedElement(t[s],s+1)}for(l=p.length,s=0;s<l;s+=1)p[s].closed=!0;for(l=m.length,s=0;s<l;s+=1)m[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.mat.reset(),this.transformHelper.opacity=1,this.transformHelper._matMdf=!1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){var i,r;(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0),(t._matMdf||e.mProps._mdf||this._isFirstFrame)&&(r=e.mat,r.cloneFromProps(e.mProps.v.props),e._matMdf=!0,i=t.mat.props,r.transform(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]))},CVShapeElement.prototype.drawLayer=function(){var t,e,i,r,s,a,n,o,h,l=this.stylesList.length,p=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(h=this.stylesList[t],o=h.type,("st"!==o||0!==h.wi)&&h.data._render&&0!==h.coOp){if(p.save(),a=h.elements,"st"===o?(m.strokeStyle=h.co,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle=h.co,p.ctxOpacity(h.coOp),0!==this.globalData.currentGlobalAlpha){for("st"!==o&&m.beginPath(),i=a.length,e=0;e<i;e+=1){for("st"===o&&(m.beginPath(),h.da?(m.setLineDash(h.da),m.lineDashOffset=h["do"],this.globalData.isDashed=!0):this.globalData.isDashed&&(m.setLineDash(this.dashResetter),this.globalData.isDashed=!1)),n=a[e].trNodes,s=n.length,r=0;r<s;r+=1)"m"==n[r].t?m.moveTo(n[r].p[0],n[r].p[1]):"c"==n[r].t?m.bezierCurveTo(n[r].pts[0],n[r].pts[1],n[r].pts[2],n[r].pts[3],n[r].pts[4],n[r].pts[5]):m.closePath();"st"===o&&m.stroke()}"st"!==o&&m.fill(h.r)}p.restore()}},CVShapeElement.prototype.renderShape=function(t,e,i,r){var s,a,n=e.length-1;for(a=t,s=n;s>=0;s-=1)"tr"==e[s].ty?(a=i[s].transform,this.renderShapeTransform(t,a)):"sh"==e[s].ty||"el"==e[s].ty||"rc"==e[s].ty||"sr"==e[s].ty?this.renderPath(e[s],i[s],a):"fl"==e[s].ty?this.renderFill(e[s],i[s],a):"st"==e[s].ty?this.renderStroke(e[s],i[s],a):"gr"==e[s].ty?this.renderShape(a,e[s].it,i[s].it):"tm"==e[s].ty;r&&this.drawLayer()},CVShapeElement.prototype.renderPath=function(t,e,i){var r,s,a,n,o=i._matMdf||e.sh._mdf||this._isFirstFrame;if(o){var h=e.sh.paths,l=i.mat;n=t._render===!1?0:h._length;var p=e.trNodes;for(p.length=0,a=0;a<n;a+=1){var m=h.shapes[a];if(m&&m.v){for(r=m._length,s=1;s<r;s+=1)1==s&&p.push({t:"m",p:l.applyToPointArray(m.v[0][0],m.v[0][1],0)}),p.push({t:"c",pts:l.applyToTriplePoints(m.o[s-1],m.i[s],m.v[s])});1==r&&p.push({t:"m",p:l.applyToPointArray(m.v[0][0],m.v[0][1],0)}),m.c&&r&&(p.push({t:"c",pts:l.applyToTriplePoints(m.o[s-1],m.i[0],m.v[0])}),p.push({t:"z"})),e.lStr=p}}if(e.st)for(s=0;s<16;s+=1)e.tr[s]=i.mat.props[s];e.trNodes=p}},CVShapeElement.prototype.renderFill=function(t,e,i){var r=e.style;(e.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(r.coOp=e.o.v*i.opacity)},CVShapeElement.prototype.renderStroke=function(t,e,i){var r=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(r.da=s.dashArray,r["do"]=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(r.coOp=e.o.v*i.opacity),(e.w._mdf||this._isFirstFrame)&&(r.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var i=!1;t.sc&&(i=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var r,s,a=this.globalData.fontManager.getFontByName(t.f),n=t.l,o=this.mHelper;this.stroke=i,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var h,l,p,m,f,c,d,u,y,g,v=this.data.singleShape,b=t.tr/1e3*t.finalSize,E=0,x=0,S=!0,P=0;for(r=0;r<s;r+=1){for(h=this.globalData.fontManager.getCharData(t.finalText[r],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily),l=h&&h.data||{},o.reset(),v&&n[r].n&&(E=-b,x+=t.yOffset,x+=S?1:0,S=!1),f=l.shapes?l.shapes[0].it:[],d=f.length,o.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,o,n[r].line,E,x),y=createSizedArray(d),c=0;c<d;c+=1){for(m=f[c].ks.k.i.length,u=f[c].ks.k,g=[],p=1;p<m;p+=1)1==p&&g.push(o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[p][0],u.i[p][1],0),o.applyToY(u.i[p][0],u.i[p][1],0),o.applyToX(u.v[p][0],u.v[p][1],0),o.applyToY(u.v[p][0],u.v[p][1],0));g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[0][0],u.i[0][1],0),o.applyToY(u.i[0][0],u.i[0][1],0),o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),y[c]=g}v&&(E+=n[r].l,E+=b),this.textSpans[P]?this.textSpans[P].elem=y:this.textSpans[P]={elem:y},P+=1}},CVTextElement.prototype.renderInnerContent=function(){var t=this.canvasContext;this.finalTransform.mat.props;t.font=this.values.fValue,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var e,i,r,s,a,n,o=this.textAnimator.renderedLetters,h=this.textProperty.currentData.l;i=h.length;var l,p,m,f=null,c=null,d=null;for(e=0;e<i;e+=1)if(!h[e].n){if(l=o[e],l&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(l.p),this.globalData.renderer.ctxOpacity(l.o)),this.fill){for(l&&l.fc?f!==l.fc&&(f=l.fc,t.fillStyle=l.fc):f!==this.values.fill&&(f=this.values.fill,t.fillStyle=this.values.fill),p=this.textSpans[e].elem,s=p.length,this.globalData.canvasContext.beginPath(),r=0;r<s;r+=1)for(m=p[r],n=m.length,this.globalData.canvasContext.moveTo(m[0],m[1]),
+a=2;a<n;a+=6)this.globalData.canvasContext.bezierCurveTo(m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(l&&l.sw?d!==l.sw&&(d=l.sw,t.lineWidth=l.sw):d!==this.values.sWidth&&(d=this.values.sWidth,t.lineWidth=this.values.sWidth),l&&l.sc?c!==l.sc&&(c=l.sc,t.strokeStyle=l.sc):c!==this.values.stroke&&(c=this.values.stroke,t.strokeStyle=this.values.stroke),p=this.textSpans[e].elem,s=p.length,this.globalData.canvasContext.beginPath(),r=0;r<s;r+=1)for(m=p[r],n=m.length,this.globalData.canvasContext.moveTo(m[0],m[1]),a=2;a<n;a+=6)this.globalData.canvasContext.bezierCurveTo(m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}l&&this.globalData.renderer.restore()}},CVEffects.prototype.renderFrame=function(){},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&(this.transformedElement.style.transform=this.transformedElement.style.webkitTransform=this.finalTransform.mat.toCSS()),this.finalTransform._opMdf&&(this.transformedElement.style.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},addMasks:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?(t=createNS("rect"),t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(t=createTag("div"),t.style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([HybridRenderer,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var i,r=0;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(i=this.elements[r].getBaseElement()),r+=1;i?this.layerElement.insertBefore(t,i):this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)e=t[i].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var i,r,s,a,n,o=t.sh.v,h=t.transformers,l=o._length;if(!(l<=1)){for(i=0;i<l-1;i+=1)r=this.getTransformedPoint(h,o.v[i]),s=this.getTransformedPoint(h,o.o[i]),a=this.getTransformedPoint(h,o.i[i+1]),n=this.getTransformedPoint(h,o.v[i+1]),this.checkBounds(r,s,a,n,e);o.c&&(r=this.getTransformedPoint(h,o.v[i]),s=this.getTransformedPoint(h,o.o[i]),a=this.getTransformedPoint(h,o.i[0]),n=this.getTransformedPoint(h,o.v[0]),this.checkBounds(r,s,a,n,e))}},HShapeElement.prototype.checkBounds=function(t,e,i,r,s){this.getBoundsOfCurve(t,e,i,r);var a=this.shapeBoundingBox;s.x=bm_min(a.left,s.x),s.xMax=bm_max(a.right,s.xMax),s.y=bm_min(a.top,s.y),s.yMax=bm_max(a.bottom,s.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,i,r){for(var s,a,n,o,h,l,p,m=[[t[0],r[0]],[t[1],r[1]]],f=0;f<2;++f)if(a=6*t[f]-12*e[f]+6*i[f],s=-3*t[f]+9*e[f]-9*i[f]+3*r[f],n=3*e[f]-3*t[f],a=0|a,s=0|s,n=0|n,0!==s)h=a*a-4*n*s,h<0||(l=(-a+bm_sqrt(h))/(2*s),0<l&&l<1&&m[f].push(this.calculateF(l,t,e,i,r,f)),p=(-a-bm_sqrt(h))/(2*s),0<p&&p<1&&m[f].push(this.calculateF(p,t,e,i,r,f)));else{if(0===a)continue;o=-n/a,0<o&&o<1&&m[f].push(this.calculateF(o,t,e,i,r,f))}this.shapeBoundingBox.left=bm_min.apply(null,m[0]),this.shapeBoundingBox.top=bm_min.apply(null,m[1]),this.shapeBoundingBox.right=bm_max.apply(null,m[0]),this.shapeBoundingBox.bottom=bm_max.apply(null,m[1])},HShapeElement.prototype.calculateF=function(t,e,i,r,s,a){return bm_pow(1-t,3)*e[a]+3*bm_pow(1-t,2)*t*i[a]+3*(1-t)*bm_pow(t,2)*r[a]+bm_pow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)t[i]&&t[i].sh?this.calculateShapeBoundingBox(t[i],e):t[i]&&t[i].it&&this.calculateBoundingBox(t[i].it,e)},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var i=!1;this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),i=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),i=!0),(i||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y)&&(this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.shapeCont.style.transform=this.shapeCont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style;e.color=e.fill=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)",t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var i=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",i.fClass)this.innerElem.className=i.fClass;else{e.fontFamily=i.fFamily;var r=t.fWeight,s=t.fStyle;e.fontStyle=s,e.fontWeight=r}var a,n,o=t.l;n=o.length;var h,l,p,m,f=this.mHelper,c="",d=0;for(a=0;a<n;a+=1){if(this.globalData.fontManager.chars?(this.textPaths[d]?h=this.textPaths[d]:(h=createNS("path"),h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[d]?(l=this.textSpans[d],p=l.children[0]):(l=createTag("div"),p=createNS("svg"),p.appendChild(h),styleDiv(l)))):this.isMasked?h=this.textPaths[d]?this.textPaths[d]:createNS("text"):this.textSpans[d]?(l=this.textSpans[d],h=this.textPaths[d]):(l=createTag("span"),styleDiv(l),h=createTag("span"),styleDiv(h),l.appendChild(h)),this.globalData.fontManager.chars){var u,y=this.globalData.fontManager.getCharData(t.finalText[a],i.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(u=y?y.data:null,f.reset(),u&&u.shapes&&(m=u.shapes[0].it,f.scale(t.finalSize/100,t.finalSize/100),c=this.createPathShape(f,m),h.setAttribute("d",c)),this.isMasked)this.innerElem.appendChild(h);else{if(this.innerElem.appendChild(l),u&&u.shapes){document.body.appendChild(p);var g=p.getBBox();p.setAttribute("width",g.width+2),p.setAttribute("height",g.height+2),p.setAttribute("viewBox",g.x-1+" "+(g.y-1)+" "+(g.width+2)+" "+(g.height+2)),p.style.transform=p.style.webkitTransform="translate("+(g.x-1)+"px,"+(g.y-1)+"px)",o[a].yOffset=g.y-1}else p.setAttribute("width",1),p.setAttribute("height",1);l.appendChild(p)}}else h.textContent=o[a].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked?this.innerElem.appendChild(h):(this.innerElem.appendChild(l),h.style.transform=h.style.webkitTransform="translate3d(0,"+-t.finalSize/1.2+"px,0)");this.isMasked?this.textSpans[d]=h:this.textSpans[d]=l,this.textSpans[d].style.display="block",this.textPaths[d]=h,d+=1}for(;d<this.textSpans.length;)this.textSpans[d].style.display="none",d+=1},HTextElement.prototype.renderInnerContent=function(){if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;this.isMasked&&this.finalTransform._matMdf&&(this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)")}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var t,e,i=0,r=this.textAnimator.renderedLetters,s=this.textProperty.currentData.l;e=s.length;var a,n,o;for(t=0;t<e;t+=1)s[t].n?i+=1:(n=this.textSpans[t],o=this.textPaths[t],a=r[i],i+=1,a._mdf.m&&(this.isMasked?n.setAttribute("transform",a.m):n.style.transform=n.style.webkitTransform=a.m),n.style.opacity=a.o,a.sw&&a._mdf.sw&&o.setAttribute("stroke-width",a.sw),a.sc&&a._mdf.sc&&o.setAttribute("stroke",a.sc),a.fc&&a._mdf.fc&&(o.setAttribute("fill",a.fc),o.style.color=a.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height));var l=1;this.currentBBox.w===h.width+2*l&&this.currentBBox.h===h.height+2*l&&this.currentBBox.x===h.x-l&&this.currentBBox.y===h.y-l||(this.currentBBox.w=h.width+2*l,this.currentBBox.h=h.height+2*l,this.currentBBox.x=h.x-l,this.currentBBox.y=h.y-l,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,i=this.comp.threeDElements.length;for(t=0;t<i;t+=1)e=this.comp.threeDElements[t],"3d"===e.type&&(e.perspectiveElem.style.perspective=e.perspectiveElem.style.webkitPerspective=this.pe.v+"px",e.container.style.transformOrigin=e.container.style.mozTransformOrigin=e.container.style.webkitTransformOrigin="0px 0px 0px",e.perspectiveElem.style.transform=e.perspectiveElem.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)")},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,i=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)i=this.hierarchy[t].finalTransform.mProp._mdf||i;if(i||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy){for(e=this.hierarchy.length-1,t=e;t>=0;t-=1){var r=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-r.p.v[0],-r.p.v[1],r.p.v[2]),this.mat.rotateX(-r.rx.v).rotateY(-r.ry.v).rotateZ(r.rz.v),this.mat.scale(1/r.s.v[0],1/r.s.v[1],1/r.s.v[2]),this.mat.translate(r.a.v[0],r.a.v[1],r.a.v[2])}}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]],a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}if(this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v),!this._prevMat.equals(this.mat)&&this.comp.threeDElements){e=this.comp.threeDElements.length;var p;for(t=0;t<e;t+=1)p=this.comp.threeDElements[t],"3d"===p.type&&(p.container.style.transform=p.container.style.webkitTransform=this.mat.toCSS());this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.initExpressions=function(){},HCameraElement.prototype.getBaseElement=function(){return null},HEffects.prototype.renderFrame=function(){};var Expressions=function(){function t(t){t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer)}var e={};return e.initExpressions=t,e}();expressionsPlugin=Expressions;var ExpressionManager=function(){function duplicatePropertyValue(t,e){if(e=e||1,"number"==typeof t||t instanceof Number)return t*e;if(t.i)return shape_pool.clone(t);var i,r=createTypedArray("float32",t.length),s=t.length;for(i=0;i<s;i+=1)r[i]=t[i]*e;return r}function isTypeOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if(isTypeOfArray(t)){var i,r=t.length,s=[];for(i=0;i<r;i+=1)s[i]=-t[i];return s}}function sum(t,e){var i=typeof t,r=typeof e;if("string"===i||"string"===r)return t+e;if(isNumerable(i,t)&&isNumerable(r,e))return t+e;if(isTypeOfArray(t)&&isNumerable(r,e))return t=t.slice(0),t[0]=t[0]+e,t;if(isNumerable(i,t)&&isTypeOfArray(e))return e=e.slice(0),e[0]=t+e[0],e;if(isTypeOfArray(t)&&isTypeOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function sub(t,e){var i=typeof t,r=typeof e;if(isNumerable(i,t)&&isNumerable(r,e))return"string"===i&&(t=parseInt(t)),"string"===r&&(e=parseInt(e)),t-e;if(isTypeOfArray(t)&&isNumerable(r,e))return t=t.slice(0),t[0]=t[0]-e,t;if(isNumerable(i,t)&&isTypeOfArray(e))return e=e.slice(0),e[0]=t-e[0],e;if(isTypeOfArray(t)&&isTypeOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var i,r=typeof t,s=typeof e;if(isNumerable(r,t)&&isNumerable(s,e))return t*e;var a,n;if(isTypeOfArray(t)&&isNumerable(s,e)){for(n=t.length,i=createTypedArray("float32",n),a=0;a<n;a+=1)i[a]=t[a]*e;return i}if(isNumerable(r,t)&&isTypeOfArray(e)){for(n=e.length,i=createTypedArray("float32",n),a=0;a<n;a+=1)i[a]=t*e[a];return i}return 0}function div(t,e){var i,r=typeof t,s=typeof e;if(isNumerable(r,t)&&isNumerable(s,e))return t/e;var a,n;if(isTypeOfArray(t)&&isNumerable(s,e)){for(n=t.length,i=createTypedArray("float32",n),a=0;a<n;a+=1)i[a]=t[a]/e;return i}if(isNumerable(r,t)&&isTypeOfArray(e)){for(n=e.length,i=createTypedArray("float32",n),a=0;a<n;a+=1)i[a]=t/e[a];return i}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}function clamp(t,e,i){if(e>i){var r=i;i=e,e=r}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}function degreesToRadians(t){return t*degToRads}function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,r=Math.min(t.length,e.length),s=0;for(i=0;i<r;i+=1)s+=Math.pow(e[i]-t[i],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,i,r=t[0],s=t[1],a=t[2],n=Math.max(r,s,a),o=Math.min(r,s,a),h=(n+o)/2;if(n==o)e=i=0;else{var l=n-o;switch(i=h>.5?l/(2-n-o):l/(n+o),n){case r:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-r)/l+2;break;case a:e=(r-s)/l+4}e/=6}return[e,i,h,t[3]]}function hue2rgb(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,r,s=t[0],a=t[1],n=t[2];if(0===a)e=i=r=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),i=hue2rgb(h,o,s),r=hue2rgb(h,o,s-1/3)}return[e,i,r,t[3]]}function linear(t,e,i,r,s){if(void 0===r||void 0===s)return linear(t,0,1,e,i);if(t<=e)return r;if(t>=i)return s;var a=i===e?0:(t-e)/(i-e);if(!r.length)return r+(s-r)*a;var n,o=r.length,h=createTypedArray("float32",o);for(n=0;n<o;n+=1)h[n]=r[n]+(s[n]-r[n])*a;return h}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var i,r=e.length;t||(t=createTypedArray("float32",r));var s=createTypedArray("float32",r),a=BMMath.random();for(i=0;i<r;i+=1)s[i]=t[i]+a*(e[i]-t[i]);return s}void 0===t&&(t=0);var n=BMMath.random();return t+n*(e-t)}function createPath(t,e,i,r){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!r,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e?e[s]:l,h=i?i[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}function lookAt(t,e){var i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],r=Math.atan2(i[0],Math.sqrt(i[1]*i[1]+i[2]*i[2]))/degToRads,s=-Math.atan2(i[1],i[2])/degToRads;return[s,r,0]}function easeOut(t,e,i,r,s){return void 0===r?(r=e,s=i):t=(t-e)/(i-e),-(s-r)*t*(t-2)+r}function easeIn(t,e,i,r,s){return void 0===r?(r=e,s=i):t=(t-e)/(i-e),(s-r)*t*t+r}function nearestKey(t){var e,i,r,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(i=-1,t*=elem.comp.globalData.frameRate,t<data.k[0].t)i=1,r=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){i=e+1,r=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){t-data.k[e].t>data.k[e+1].t-t?(i=e+2,r=data.k[e+1].t):(i=e+1,r=data.k[e].t);break}}i===-1&&(i=e+1,r=data.k[e].t)}else i=0,r=0;var a={};return a.index=i,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,r;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate};var s;for(s=t!==data.k.length-1||data.k[t].h?data.k[t].s:data.k[t-1].e,r=s.length,i=0;i<r;i+=1)e[i]=s[i];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),anchorPoint=transform.anchorPoint),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),hasParent=!(!elem.hierarchy||!elem.hierarchy.length),hasParent&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=shape_pool.clone(scoped_bm_rt.v)),scoped_bm_rt)}var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=val.indexOf("random")!==-1,elemType=elem.data.ty,transform,content,effect,thisProperty=property;elem.comp.frameDuration=1/elem.comp.globalData.frameRate;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,loopIn,loop_in,loopOut,loop_out,toWorld,fromWorld,fromComp,fromCompToSurface,anchorPoint,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[];if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,wiggle=function(t,e){var i,r,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);t=5;var n=Math.floor(time*t);for(i=0,r=0;i<n;){for(r=0;r<s;r+=1)a[r]+=-e+2*e*BMMath.random();i+=1}var o=time*t,h=o-Math.floor(o),l=createTypedArray("float32",s);if(s>1){for(r=0;r<s;r+=1)l[r]=this.pv[r]+a[r]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,textIndex,textTotal,selectorValue,index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random());return executeExpression}var ob={},Math=BMMath,window=null,document=null,add=sum,radians_to_degrees=radiansToDegrees,degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];return ob.initiateExpression=initiateExpression,ob}();!function(){function t(){return this.pv}function e(t,e,i){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var r=this.comp.renderedFrame,s=this.keyframes,a=s[s.length-1].t;if(r<=a)return this.pv;var n,o;i?(n=e?Math.abs(a-elem.comp.globalData.frameRate*e):Math.max(0,a-this.elem.data.ip),o=a-n):((!e||e>s.length-1)&&(e=s.length-1),o=s[s.length-1-e].t,n=a-o);var h,l,p;if("pingpong"===t){var m=Math.floor((r-o)/n);if(m%2!==0)return this.getValueAtTime((n-(r-o)%n+o)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(o/this.comp.globalData.frameRate,0),c=this.getValueAtTime(a/this.comp.globalData.frameRate,0),d=this.getValueAtTime(((r-o)%n+o)/this.comp.globalData.frameRate,0),u=Math.floor((r-o)/n);if(this.pv.length){for(p=new Array(f.length),l=p.length,h=0;h<l;h+=1)p[h]=(c[h]-f[h])*u+d[h];return p}return(c-f)*u+d}if("continue"===t){var y=this.getValueAtTime(a/this.comp.globalData.frameRate,0),g=this.getValueAtTime((a-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(p=new Array(y.length),l=p.length,h=0;h<l;h+=1)p[h]=y[h]+(y[h]-g[h])*((r-a)/this.comp.globalData.frameRate)/5e-4;return p}return y+(y-g)*((r-a)/.001)}}return this.getValueAtTime(((r-o)%n+o)/this.comp.globalData.frameRate,0)}function i(t,e,i){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var r=this.comp.renderedFrame,s=this.keyframes,a=s[0].t;if(r>=a)return this.pv;var n,o;i?(n=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-a),o=a+n):((!e||e>s.length-1)&&(e=s.length-1),o=s[e].t,n=o-a);var h,l,p;if("pingpong"===t){var m=Math.floor((a-r)/n);if(m%2===0)return this.getValueAtTime(((a-r)%n+a)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(a/this.comp.globalData.frameRate,0),c=this.getValueAtTime(o/this.comp.globalData.frameRate,0),d=this.getValueAtTime((n-(a-r)%n+a)/this.comp.globalData.frameRate,0),u=Math.floor((a-r)/n)+1;if(this.pv.length){for(p=new Array(f.length),l=p.length,h=0;h<l;h+=1)p[h]=d[h]-(c[h]-f[h])*u;return p}return d-(c-f)*u}if("continue"===t){var y=this.getValueAtTime(a/this.comp.globalData.frameRate,0),g=this.getValueAtTime((a+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(p=new Array(y.length),l=p.length,h=0;h<l;h+=1)p[h]=y[h]+(y[h]-g[h])*(a-r)/.001;return p}return y+(y-g)*(a-r)/.001}}return this.getValueAtTime((n-(a-r)%n+a)/this.comp.globalData.frameRate,0)}function r(t){return t!==this._cachingAtTime.lastFrame&&(t*=this.elem.globalData.frameRate,t-=this.offsetTime,this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value}function s(t){var e=-.01,i=this.getValueAtTime(t),r=this.getValueAtTime(t+e),s=0;if(i.length){var a;for(a=0;a<i.length;a+=1)s+=Math.pow(r[a]-i[a],2);s=100*Math.sqrt(s)}else s=0;return s}function a(t){if(void 0!==this.vel)return this.vel;var e,i=-.001,r=this.getValueAtTime(t),s=this.getValueAtTime(t+i);if(r.length){e=createTypedArray("float32",r.length);var a;for(a=0;a<r.length;a+=1)e[a]=(s[a]-r[a])/i}else e=(s-r)/i;return e}function n(t){this.propertyGroup=t}function o(t,e,i){e.x&&(i.k=!0,i.x=!0,i.initiateExpression=ExpressionManager.initiateExpression,i.effectsSequence.push(i.initiateExpression(t,e,i).bind(i)))}function h(t){console.warn("Transform at time not supported")}function l(t){}function p(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastTime=t,t*=this.elem.globalData.frameRate,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue}function m(){}var f=function(){function e(t,e){return this.textIndex=t+1,this.textTotal=e,this.getValue(),this.v}return function(i,s){this.pv=1,this.comp=i.comp,this.elem=i,this.mult=.01,this.propType="textSelector",this.textTotal=s.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],o.bind(this)(i,s,this),this.getMult=e,this.getVelocityAtTime=a,this.kf?this.getValueAtTime=r.bind(this):this.getValueAtTime=t.bind(this),this.setGroupProperty=n}}(),c=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,i){var r=c(t,e,i);return r.dynamicProperties.length?r.getValueAtTime=h.bind(r):r.getValueAtTime=l.bind(r),r.setGroupProperty=n,r};var d=PropertyFactory.getProp;PropertyFactory.getProp=function(h,l,p,m,f){var c=d(h,l,p,m,f);c.kf?c.getValueAtTime=r.bind(c):c.getValueAtTime=t.bind(c),c.setGroupProperty=n,c.loopOut=e,c.loopIn=i,c.getVelocityAtTime=a.bind(c),c.getSpeedAtTime=s.bind(c),c.numKeys=1===l.a?l.k.length:0,c.propertyIndex=l.ix;var u=0;return 0!==p&&(u=createTypedArray("float32",1===l.a?l.k[0].s.length:l.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:u},o(h,l,c),c.k&&f.addDynamicProperty(c),c};var u=ShapePropertyFactory.getConstructorFunction(),y=ShapePropertyFactory.getKeyframedConstructorFunction();m.prototype={vertices:function(t,e){var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var r,s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)"i"===t||"o"===t?o[r]=[a[r][0]-n[r][0],a[r][1]-n[r][1]]:o[r]=[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(i));for(var r,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,m=i.c&&o===h-1?0:o+1,f=(n-l)/a[o].addedLength;r=bez.getPointInSegment(i.v[p],i.v[m],i.o[p],i.i[m],f,a[o]);break}l+=a[o].addedLength,o+=1}return r||(r=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),r},vectorOnPath:function(t,e,i){t=1==t?this.v.c?0:.999:t;var r=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-r[0],n=s[1]-r[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2)),h="tangent"===i?[a/o,n/o]:[-n/o,a/o];return h},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:n,getValueAtTime:t
+},extendPrototype([m],u),extendPrototype([m],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var g=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,i,r,s){var a=g(t,e,i,r,s);return a.propertyIndex=e.ix,a.lock=!1,3===i?o(t,e.pt,a):4===i&&o(t,e.ks,a),a.k&&t.addDynamicProperty(a),a};var v=TextSelectorProp.getTextSelectorProp;TextSelectorProp.getTextSelectorProp=function(t,e,i){return 1===e.t?new f(t,e,i):v(t,e,i)}}(),function(){function t(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0}TextProperty.prototype.getExpressionValue=function(t){var e=this.calculateExpression(t.t);return t.t=e,t},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=t}();var ShapeExpressionInterface=function(){function t(t,e,n){var c,d=[],u=t?t.length:0;for(c=0;c<u;c+=1)"gr"==t[c].ty?d.push(i(t[c],e[c],n)):"fl"==t[c].ty?d.push(r(t[c],e[c],n)):"st"==t[c].ty?d.push(s(t[c],e[c],n)):"tm"==t[c].ty?d.push(a(t[c],e[c],n)):"tr"==t[c].ty||("el"==t[c].ty?d.push(o(t[c],e[c],n)):"sr"==t[c].ty?d.push(h(t[c],e[c],n)):"sh"==t[c].ty?d.push(f(t[c],e[c],n)):"rc"==t[c].ty?d.push(l(t[c],e[c],n)):"rd"==t[c].ty?d.push(p(t[c],e[c],n)):"rp"==t[c].ty&&d.push(m(t[c],e[c],n)));return d}function e(e,i,r){var s,a=function(t){for(var e=0,i=s.length;e<i;){if(s[e]._name===t||s[e].mn===t||s[e].propertyIndex===t||s[e].ix===t||s[e].ind===t)return s[e];e+=1}if("number"==typeof t)return s[t-1]};return a.propertyGroup=function(t){return 1===t?a:r(t-1)},s=t(e.it,i.it,a.propertyGroup),a.numProperties=s.length,a.propertyIndex=e.cix,a._name=e.nm,a}function i(t,i,r){var s=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return s.content;default:return s.transform}};s.propertyGroup=function(t){return 1===t?s:r(t-1)};var a=e(t,i,s.propertyGroup),o=n(t.it[t.it.length-1],i.it[i.it.length-1],s.propertyGroup);return s.content=a,s.transform=o,Object.defineProperty(s,"_name",{get:function(){return t.nm}}),s.numProperties=t.np,s.propertyIndex=t.ix,s.nm=t.nm,s.mn=t.mn,s}function r(t,e,i){function r(t){return"Color"===t||"color"===t?r.color:"Opacity"===t||"opacity"===t?r.opacity:void 0}return Object.defineProperties(r,{color:{get:function(){return ExpressionValue(e.c,1/e.c.mult,"color")}},opacity:{get:function(){return ExpressionValue(e.o,100)}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(i),e.o.setGroupProperty(i),r}function s(t,e,i){function r(t){return 1===t?ob:i(t-1)}function s(t){return 1===t?l:r(t-1)}function a(i){Object.defineProperty(l,t.d[i].nm,{get:function(){return ExpressionValue(e.d.dataProps[i].p)}})}function n(t){return"Color"===t||"color"===t?n.color:"Opacity"===t||"opacity"===t?n.opacity:"Stroke Width"===t||"stroke width"===t?n.strokeWidth:void 0}var o,h=t.d?t.d.length:0,l={};for(o=0;o<h;o+=1)a(o),e.d.dataProps[o].p.setGroupProperty(s);return Object.defineProperties(n,{color:{get:function(){return ExpressionValue(e.c,1/e.c.mult,"color")}},opacity:{get:function(){return ExpressionValue(e.o,100)}},strokeWidth:{get:function(){return ExpressionValue(e.w)}},dash:{get:function(){return l}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(r),e.o.setGroupProperty(r),e.w.setGroupProperty(r),n}function a(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){return e===t.e.ix||"End"===e||"end"===e?s.end:e===t.s.ix?s.start:e===t.o.ix?s.offset:void 0}return s.propertyIndex=t.ix,e.s.setGroupProperty(r),e.e.setGroupProperty(r),e.o.setGroupProperty(r),s.propertyIndex=t.ix,Object.defineProperties(s,{start:{get:function(){return ExpressionValue(e.s,1/e.s.mult)}},end:{get:function(){return ExpressionValue(e.e,1/e.e.mult)}},offset:{get:function(){return ExpressionValue(e.o)}},_name:{value:t.nm}}),s.mn=t.mn,s}function n(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){return t.a.ix===e||"Anchor Point"===e?s.anchorPoint:t.o.ix===e||"Opacity"===e?s.opacity:t.p.ix===e||"Position"===e?s.position:t.r.ix===e||"Rotation"===e||"ADBE Vector Rotation"===e?s.rotation:t.s.ix===e||"Scale"===e?s.scale:t.sk&&t.sk.ix===e||"Skew"===e?s.skew:t.sa&&t.sa.ix===e||"Skew Axis"===e?s.skewAxis:void 0}return e.transform.mProps.o.setGroupProperty(r),e.transform.mProps.p.setGroupProperty(r),e.transform.mProps.a.setGroupProperty(r),e.transform.mProps.s.setGroupProperty(r),e.transform.mProps.r.setGroupProperty(r),e.transform.mProps.sk&&(e.transform.mProps.sk.setGroupProperty(r),e.transform.mProps.sa.setGroupProperty(r)),e.transform.op.setGroupProperty(r),Object.defineProperties(s,{opacity:{get:function(){return ExpressionValue(e.transform.mProps.o,1/e.transform.mProps.o.mult)}},position:{get:function(){return ExpressionValue(e.transform.mProps.p)}},anchorPoint:{get:function(){return ExpressionValue(e.transform.mProps.a)}},scale:{get:function(){return ExpressionValue(e.transform.mProps.s,1/e.transform.mProps.s.mult)}},rotation:{get:function(){return ExpressionValue(e.transform.mProps.r,1/e.transform.mProps.r.mult)}},skew:{get:function(){return ExpressionValue(e.transform.mProps.sk)}},skewAxis:{get:function(){return ExpressionValue(e.transform.mProps.sa)}},_name:{value:t.nm}}),s.ty="tr",s.mn=t.mn,s}function o(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){return t.p.ix===e?s.position:t.s.ix===e?s.size:void 0}s.propertyIndex=t.ix;var a="tm"===e.sh.ty?e.sh.prop:e.sh;return a.s.setGroupProperty(r),a.p.setGroupProperty(r),Object.defineProperties(s,{size:{get:function(){return ExpressionValue(a.s)}},position:{get:function(){return ExpressionValue(a.p)}},_name:{value:t.nm}}),s.mn=t.mn,s}function h(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){return t.p.ix===e?s.position:t.r.ix===e?s.rotation:t.pt.ix===e?s.points:t.or.ix===e||"ADBE Vector Star Outer Radius"===e?s.outerRadius:t.os.ix===e?s.outerRoundness:!t.ir||t.ir.ix!==e&&"ADBE Vector Star Inner Radius"!==e?t.is&&t.is.ix===e?s.innerRoundness:void 0:s.innerRadius}var a="tm"===e.sh.ty?e.sh.prop:e.sh;return s.propertyIndex=t.ix,a.or.setGroupProperty(r),a.os.setGroupProperty(r),a.pt.setGroupProperty(r),a.p.setGroupProperty(r),a.r.setGroupProperty(r),t.ir&&(a.ir.setGroupProperty(r),a.is.setGroupProperty(r)),Object.defineProperties(s,{position:{get:function(){return ExpressionValue(a.p)}},rotation:{get:function(){return ExpressionValue(a.r,1/a.r.mult)}},points:{get:function(){return ExpressionValue(a.pt)}},outerRadius:{get:function(){return ExpressionValue(a.or)}},outerRoundness:{get:function(){return ExpressionValue(a.os)}},innerRadius:{get:function(){return a.ir?ExpressionValue(a.ir):0}},innerRoundness:{get:function(){return a.is?ExpressionValue(a.is,1/a.is.mult):0}},_name:{value:t.nm}}),s.mn=t.mn,s}function l(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){return t.p.ix===e?s.position:t.r.ix===e?s.roundness:t.s.ix===e||"Size"===e||"ADBE Vector Rect Size"===e?s.size:void 0}var a="tm"===e.sh.ty?e.sh.prop:e.sh;return s.propertyIndex=t.ix,a.p.setGroupProperty(r),a.s.setGroupProperty(r),a.r.setGroupProperty(r),Object.defineProperties(s,{position:{get:function(){return ExpressionValue(a.p)}},roundness:{get:function(){return ExpressionValue(a.r)}},size:{get:function(){return ExpressionValue(a.s)}},_name:{value:t.nm}}),s.mn=t.mn,s}function p(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){if(t.r.ix===e||"Round Corners 1"===e)return s.radius}var a=e;return s.propertyIndex=t.ix,a.rd.setGroupProperty(r),Object.defineProperties(s,{radius:{get:function(){return ExpressionValue(a.rd)}},_name:{value:t.nm}}),s.mn=t.mn,s}function m(t,e,i){function r(t){return 1==t?s:i(--t)}function s(e){return t.c.ix===e||"Copies"===e?s.copies:t.o.ix===e||"Offset"===e?s.offset:void 0}var a=e;return s.propertyIndex=t.ix,a.c.setGroupProperty(r),a.o.setGroupProperty(r),Object.defineProperties(s,{copies:{get:function(){return ExpressionValue(a.c)}},offset:{get:function(){return ExpressionValue(a.o)}},_name:{value:t.nm}}),s.mn=t.mn,s}function f(t,e,i){function r(t){return 1==t?s:i(--t)}function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}var a=e.sh;return a.setGroupProperty(r),Object.defineProperties(s,{path:{get:function(){return a.k&&a.getValue(),a}},shape:{get:function(){return a.k&&a.getValue(),a}},_name:{value:t.nm},ix:{value:t.ix},mn:{value:t.mn}}),s}return function(e,i,r){function s(t){if("number"==typeof t)return a[t-1];for(var e=0,i=a.length;e<i;){if(a[e]._name===t)return a[e];e+=1}}var a;return s.propertyGroup=r,a=t(e,i,s),s}}(),TextExpressionInterface=function(){return function(t){function e(){}var i,r;return Object.defineProperty(e,"sourceText",{get:function(){var e=t.textProperty.currentData.t;return e!==i&&(t.textProperty.currentData.t=i,r=new String(e),r.value=e?e:new String(e)),r}}),e}}(),LayerExpressionInterface=function(){function t(t,e){var i=new Matrix;i.reset();var r;if(r=e?this._elem.finalTransform.mProp:this._elem.finalTransform.mProp,r.applyToMatrix(i),this._elem.hierarchy&&this._elem.hierarchy.length){var s,a=this._elem.hierarchy.length;for(s=0;s<a;s+=1)this._elem.hierarchy[s].finalTransform.mProp.applyToMatrix(i);return i.applyToPointArray(t[0],t[1],t[2]||0)}return i.applyToPointArray(t[0],t[1],t[2]||0)}function e(t,e){var i=new Matrix;i.reset();var r;if(r=e?this._elem.finalTransform.mProp:this._elem.finalTransform.mProp,r.applyToMatrix(i),this._elem.hierarchy&&this._elem.hierarchy.length){var s,a=this._elem.hierarchy.length;for(s=0;s<a;s+=1)this._elem.hierarchy[s].finalTransform.mProp.applyToMatrix(i);return i.inversePoint(t)}return i.inversePoint(t)}function i(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function r(){return[1,1,1,1]}return function(s){function a(t){o.mask=new MaskManagerInterface(t,s)}function n(t){o.effect=t}function o(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return o.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return h;case 4:case"ADBE Effect Parade":return o.effect}}var h;o.toWorld=t,o.fromWorld=e,o.toComp=t,o.fromComp=i,o.sampleImage=r,o.sourceRectAtTime=s.sourceRectAtTime.bind(s),o._elem=s,h=TransformExpressionInterface(s.finalTransform.mProp);var l=getDescriptor(h,"anchorPoint");return Object.defineProperties(o,{hasParent:{get:function(){return s.hierarchy.length}},parent:{get:function(){return s.hierarchy[0].layerInterface}},rotation:getDescriptor(h,"rotation"),scale:getDescriptor(h,"scale"),position:getDescriptor(h,"position"),opacity:getDescriptor(h,"opacity"),anchorPoint:l,anchor_point:l,transform:{get:function(){return h}},active:{get:function(){return s.isInRange}}}),o.startTime=s.data.st,o.index=s.data.ind,o.source=s.data.refId,o.height=0===s.data.ty?s.data.h:100,o.width=0===s.data.ty?s.data.w:100,o.registerMaskInterface=a,o.registerEffectsInterface=n,o}}(),CompExpressionInterface=function(){return function(t){function e(e){for(var i=0,r=t.layers.length;i<r;){if(t.layers[i].nm===e||t.layers[i].ind===e)return t.elements[i].layerInterface;i+=1}return{active:!1}}return Object.defineProperty(e,"_name",{value:t.data.nm}),e.layer=e,e.pixelAspect=1,e.height=t.globalData.compSize.h,e.width=t.globalData.compSize.w,e.pixelAspect=1,e.frameDuration=1/t.globalData.frameRate,e}}(),TransformExpressionInterface=function(){return function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}return Object.defineProperty(e,"rotation",{get:function(){return t.r?ExpressionValue(t.r,1/degToRads):ExpressionValue(t.rz,1/degToRads)}}),Object.defineProperty(e,"xRotation",{get:function(){return ExpressionValue(t.rx,1/degToRads)}}),Object.defineProperty(e,"yRotation",{get:function(){return ExpressionValue(t.ry,1/degToRads)}}),Object.defineProperty(e,"scale",{get:function(){return ExpressionValue(t.s,100)}}),Object.defineProperty(e,"position",{get:function(){return t.p?ExpressionValue(t.p):[t.px.v,t.py.v,t.pz?t.pz.v:0]}}),Object.defineProperty(e,"xPosition",{get:function(){return ExpressionValue(t.px)}}),Object.defineProperty(e,"yPosition",{get:function(){return ExpressionValue(t.py)}}),Object.defineProperty(e,"zPosition",{get:function(){return ExpressionValue(t.pz)}}),Object.defineProperty(e,"anchorPoint",{get:function(){return ExpressionValue(t.a)}}),Object.defineProperty(e,"opacity",{get:function(){return ExpressionValue(t.o,100)}}),Object.defineProperty(e,"skew",{get:function(){return ExpressionValue(t.sk)}}),Object.defineProperty(e,"skewAxis",{get:function(){return ExpressionValue(t.sa)}}),Object.defineProperty(e,"orientation",{get:function(){return ExpressionValue(t.or)}}),e}}(),ProjectInterface=function(){function t(t){this.compositions.push(t)}return function(){function e(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].prepareFrame(this.compositions[e].data.xt?this.currentFrame:this.compositions[e].renderedFrame),this.compositions[e].compInterface;e+=1}}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),EffectsExpressionInterface=function(){function t(t,i){if(t.effectsManager){var r,s=[],a=t.data.ef,n=t.effectsManager.effectElements.length;for(r=0;r<n;r+=1)s.push(e(a[r],t.effectsManager.effectElements[r],i,t));return function(e){for(var i=t.data.ef||[],r=0,a=i.length;r<a;){if(e===i[r].nm||e===i[r].mn||e===i[r].ix)return s[r];r+=1}}}}function e(t,r,s,a){function n(t){return 1===t?p:s(t-1)}var o,h=[],l=t.ef.length;for(o=0;o<l;o+=1)5===t.ef[o].ty?h.push(e(t.ef[o],r.effectElements[o],r.effectElements[o].propertyGroup,a)):h.push(i(r.effectElements[o],t.ef[o].ty,a,n));var p=function(e){for(var i=t.ef,r=0,s=i.length;r<s;){if(e===i[r].nm||e===i[r].mn||e===i[r].ix)return 5===i[r].ty?h[r]:h[r]();r+=1}return h[0]()};return p.propertyGroup=n,"ADBE Color Control"===t.mn&&Object.defineProperty(p,"color",{get:function(){return h[0]()}}),Object.defineProperty(p,"numProperties",{get:function(){return t.np}}),p.active=0!==t.en,p}function i(t,e,i,r){function s(){return 10===e?i.comp.compInterface(t.p.v):ExpressionValue(t.p)}return t.p.setGroupProperty&&t.p.setGroupProperty(r),s}var r={createEffectsInterface:t};return r}(),MaskManagerInterface=function(){function t(t,e){this._mask=t,this._data=e}Object.defineProperty(t.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}});var e=function(e,i){var r,s=createSizedArray(e.viewData.length),a=e.viewData.length;for(r=0;r<a;r+=1)s[r]=new t(e.viewData[r],e.masksProperties[r]);var n=function(t){for(r=0;r<a;){if(e.masksProperties[r].nm===t)return s[r];r+=1}};return n};return e}(),ExpressionValue=function(){return function(t,e,i){e=e||1;var r;t.k&&t.getValue();var s,a,n,o;if(i){if("color"===i){for(a=4,r=createTypedArray("float32",a),n=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=n[s]=s<3?t.v[s]*e:1;r.value=n}}else if("unidimensional"===t.propType)o=t.v*e,r=new Number(o),r.value=o;else{for(a=t.pv.length,r=createTypedArray("float32",a),n=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=n[s]=t.v[s]*e;r.value=n}return r.numKeys=t.keyframes?t.keyframes.length:0,r.key=function(e){return r.numKeys?t.keyframes[e-1].t:0},r.valueAtTime=t.getValueAtTime,r.speedAtTime=t.getSpeedAtTime,r.velocityAtTime=t.getVelocityAtTime,r.propertyGroup=t.propertyGroup,r}}();extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,r,s=this.data.ef.length,a=this.data.ef;for(i=0;i<s;i+=1){switch(r=null,a[i].ty){case 0:r=new SliderEffect(a[i],e,this);break;case 1:r=new AngleEffect(a[i],e,this);break;case 2:r=new ColorEffect(a[i],e,this);break;case 3:r=new PointEffect(a[i],e,this);break;case 4:case 7:r=new CheckboxEffect(a[i],e,this);break;case 10:r=new LayerIndexEffect(a[i],e,this);break;case 11:r=new MaskIndexEffect(a[i],e,this);break;case 5:r=new EffectsManager(a[i],e,this);break;default:r=new NoValueEffect(a[i],e,this)}r&&this.effectElements.push(r)}};var lottiejs={};lottiejs.play=play,lottiejs.pause=pause,lottiejs.setLocationHref=setLocationHref,lottiejs.togglePause=togglePause,lottiejs.setSpeed=setSpeed,lottiejs.setDirection=setDirection,lottiejs.stop=stop,lottiejs.searchAnimations=searchAnimations,lottiejs.registerAnimation=registerAnimation,lottiejs.loadAnimation=loadAnimation,lottiejs.setSubframeRendering=setSubframeRendering,lottiejs.resize=resize,lottiejs.goToAndStop=goToAndStop,lottiejs.destroy=destroy,lottiejs.setQuality=setQuality,lottiejs.inBrowser=inBrowser,lottiejs.installPlugin=installPlugin,lottiejs.__getFactory=getFactory,lottiejs.version="5.1.13";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);return lottiejs});
\ No newline at end of file
diff --git a/build/player/lottie_light.js b/build/player/lottie_light.js
new file mode 100644
index 0000000..ef4fbde
--- /dev/null
+++ b/build/player/lottie_light.js
Binary files differ
diff --git a/build/player/lottie_light.min.js b/build/player/lottie_light.min.js
new file mode 100644
index 0000000..582d9df
--- /dev/null
+++ b/build/player/lottie_light.min.js
@@ -0,0 +1,5 @@
+"undefined"!=typeof navigator&&function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(t):(t.lottie=e(t),t.bodymovin=t.lottie)}(window||{},function(t){"use strict";function e(){return{}}function s(t){Ot=t?Math.round:function(t){return t}}function i(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function a(t,e){this.type=t,this.direction=e<0?-1:1}function r(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function n(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function h(t,e){this.type=t,this.target=e}function o(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var s,i="";for(s=t;s>0;--s)i+=e[Math.round(Math.random()*(e.length-1))];return i}function l(t,e,s){var i,a,r,n,h,o,l,p;switch(n=Math.floor(6*t),h=6*t-n,o=s*(1-e),l=s*(1-h*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function p(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function f(t,e){var s=p(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),l(s[0],s[1],s[2])}function m(t,e){var s=p(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),l(s[0],s[1],s[2])}function d(t,e){var s=p(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&(s[0]+=1),l(s[0],s[1],s[2])}function c(){}function u(t){return Array.apply(null,{length:t})}function g(t){return document.createElementNS(Bt,t)}function v(t){return document.createElement(t)}function y(){}function b(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1){i=t[s].prototype;for(var r in i)i.hasOwnProperty(r)&&(e.prototype[r]=i[r])}}function _(t){function e(){}return e.prototype=t,e}function k(){function t(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return n>-.001&&n<.001}function e(e,s,i,a,r,n,h,o,l){if(0===i&&0===n&&0===l)return t(e,s,a,r,h,o);var p,f=Math.sqrt(Math.pow(a-e,2)+Math.pow(r-s,2)+Math.pow(n-i,2)),m=Math.sqrt(Math.pow(h-e,2)+Math.pow(o-s,2)+Math.pow(l-i,2)),d=Math.sqrt(Math.pow(h-a,2)+Math.pow(o-r,2)+Math.pow(l-n,2));return p=f>m?f>d?f-m-d:d-m-f:d>m?d-m-f:m-f-d,p>-1e-4&&p<1e-4}function s(t){var e,s=be.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,l=s.lengths,p=0;for(e=0;e<h-1;e+=1)l[e]=o(a[e],a[e+1],r[e],n[e+1]),p+=l[e].addedLength;return i&&(l[e]=o(a[e],a[0],r[e],n[0]),p+=l[e].addedLength),s.totalLength=p,s}function i(t){this.segmentLength=0,this.points=new Array(t)}function a(t,e){this.partialLength=t,this.point=e}function r(t,e){var s=e.percents,i=e.lengths,a=s.length,r=Yt((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||r>=a-1){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}function n(t,e,s,i,a,n){var h=r(a,n),o=1-h,l=Math.round(1e3*(o*o*o*t[0]+(h*o*o+o*h*o+o*o*h)*s[0]+(h*h*o+o*h*h+h*o*h)*i[0]+h*h*h*e[0]))/1e3,p=Math.round(1e3*(o*o*o*t[1]+(h*o*o+o*h*o+o*o*h)*s[1]+(h*h*o+o*h*h+h*o*h)*i[1]+h*h*h*e[1]))/1e3;return[l,p]}function h(t,e,s,i,a,n,h){a=a<0?0:a>1?1:a;var o=r(a,h);n=n>1?1:n;var l,f=r(n,h),m=t.length,d=1-o,c=1-f,u=d*d*d,g=o*d*d*3,v=o*o*d*3,y=o*o*o,b=d*d*c,_=o*d*c+d*o*c+d*d*f,k=o*o*c+d*o*f+o*d*f,A=o*o*f,M=d*c*c,P=o*c*c+d*f*c+d*c*f,C=o*f*c+d*f*f+o*c*f,D=o*f*f,x=c*c*c,E=f*c*c+c*f*c+c*c*f,F=f*f*c+c*f*f+f*c*f,S=f*f*f;for(l=0;l<m;l+=1)p[4*l]=Math.round(1e3*(u*t[l]+g*s[l]+v*i[l]+y*e[l]))/1e3,p[4*l+1]=Math.round(1e3*(b*t[l]+_*s[l]+k*i[l]+A*e[l]))/1e3,p[4*l+2]=Math.round(1e3*(M*t[l]+P*s[l]+C*i[l]+D*e[l]))/1e3,p[4*l+3]=Math.round(1e3*(x*t[l]+E*s[l]+F*i[l]+S*e[l]))/1e3;return p}var o=(Math,function(){return function(t,e,s,i){var a,r,n,h,o,l,p=Ut,f=0,m=[],d=[],c=_e.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),l=0,r=0;r<n;r+=1)h=Wt(1-o,3)*t[r]+3*Wt(1-o,2)*o*s[r]+3*(1-o)*Wt(o,2)*i[r]+Wt(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=Wt(m[r]-d[r],2)),d[r]=m[r];l&&(l=Xt(l),f+=l),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c}}()),l=function(){var e={};return function(s){var r=s.s,n=s.e,h=s.to,o=s.ti,l=(r[0]+"_"+r[1]+"_"+n[0]+"_"+n[1]+"_"+h[0]+"_"+h[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(e[l])return void(s.bezierData=e[l]);var p,f,m,d,c,g,v,y=Ut,b=0,_=null;2===r.length&&(r[0]!=n[0]||r[1]!=n[1])&&t(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&t(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])&&(y=2);var k=new i(y);for(m=h.length,p=0;p<y;p+=1){for(v=u(m),c=p/(y-1),g=0,f=0;f<m;f+=1)d=Wt(1-c,3)*r[f]+3*Wt(1-c,2)*c*(r[f]+h[f])+3*(1-c)*Wt(c,2)*(n[f]+o[f])+Wt(c,3)*n[f],v[f]=d,null!==_&&(g+=Wt(v[f]-_[f],2));g=Xt(g),b+=g,k.points[p]=new a(g,v),_=v}k.segmentLength=b,s.bezierData=k,e[l]=k}}(),p=$t("float32",8);return{getSegmentsLength:s,getNewSegment:h,getPointInSegment:n,buildBezierData:l,pointOnLine2D:t,pointOnLine3D:e}}function A(){function t(a,r,h){var o,l,p,f,m,d,c,u,g=a.length;for(f=0;f<g;f+=1)if(o=a[f],"ks"in o&&!o.completed){if(o.completed=!0,o.tt&&(a[f-1].td=o.tt),l=[],p=-1,o.hasMask){var v=o.masksProperties;for(d=v.length,m=0;m<d;m+=1)if(v[m].pt.k.i)i(v[m].pt.k);else for(u=v[m].pt.k.length,c=0;c<u;c+=1)v[m].pt.k[c].s&&i(v[m].pt.k[c].s[0]),v[m].pt.k[c].e&&i(v[m].pt.k[c].e[0])}0===o.ty?(o.layers=e(o.refId,r),t(o.layers,r,h)):4===o.ty?s(o.shapes):5==o.ty&&n(o,h)}}function e(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}}function s(t){var e,a,r,n=t.length,h=!1;for(e=n-1;e>=0;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)i(t[e].ks.k);else for(r=t[e].ks.k.length,a=0;a<r;a+=1)t[e].ks.k[a].s&&i(t[e].ks.k[a].s[0]),t[e].ks.k[a].e&&i(t[e].ks.k[a].e[0]);h=!0}else"gr"==t[e].ty&&s(t[e].it)}function i(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function a(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&void 0))}function r(e,s){e.__complete||(l(e),h(e),o(e),p(e),t(e.layers,e.assets,s),e.__complete=!0)}function n(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var h=function(){function t(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function e(e){var s,i=e.length;for(s=0;s<i;s+=1)5===e[s].ty&&t(e[s])}var s=[4,4,14];return function(t){if(a(s,t.v)&&(e(t.layers),t.assets)){var i,r=t.assets.length;for(i=0;i<r;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),o=function(){var t=[4,7,99];return function(e){if(e.chars&&!a(t,e.v)){var s,r,n,h,o,l=e.chars.length;for(s=0;s<l;s+=1)if(e.chars[s].data&&e.chars[s].data.shapes)for(o=e.chars[s].data.shapes[0].it,n=o.length,r=0;r<n;r+=1)h=o[r].ks.k,h.__converted||(i(o[r].ks.k),h.__converted=!0)}}}(),l=function(){function t(e){var s,i,a,r=e.length;for(s=0;s<r;s+=1)if("gr"===e[s].ty)t(e[s].it);else if("fl"===e[s].ty||"st"===e[s].ty)if(e[s].c.k&&e[s].c.k[0].i)for(a=e[s].c.k.length,i=0;i<a;i+=1)e[s].c.k[i].s&&(e[s].c.k[i].s[0]/=255,e[s].c.k[i].s[1]/=255,e[s].c.k[i].s[2]/=255,e[s].c.k[i].s[3]/=255),e[s].c.k[i].e&&(e[s].c.k[i].e[0]/=255,e[s].c.k[i].e[1]/=255,e[s].c.k[i].e[2]/=255,e[s].c.k[i].e[3]/=255);else e[s].c.k[0]/=255,e[s].c.k[1]/=255,e[s].c.k[2]/=255,e[s].c.k[3]/=255}function e(e){var s,i=e.length;for(s=0;s<i;s+=1)4===e[s].ty&&t(e[s].shapes)}var s=[4,1,9];return function(t){if(a(s,t.v)&&(e(t.layers),t.assets)){var i,r=t.assets.length;for(i=0;i<r;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),p=function(){function t(e){var s,i,a,r=e.length,n=!1;for(s=r-1;s>=0;s-=1)if("sh"==e[s].ty){if(e[s].ks.k.i)e[s].ks.k.c=e[s].closed;else for(a=e[s].ks.k.length,i=0;i<a;i+=1)e[s].ks.k[i].s&&(e[s].ks.k[i].s[0].c=e[s].closed),e[s].ks.k[i].e&&(e[s].ks.k[i].e[0].c=e[s].closed);n=!0}else"gr"==e[s].ty&&t(e[s].it)}function e(e){var s,i,a,r,n,h,o=e.length;for(i=0;i<o;i+=1){if(s=e[i],s.hasMask){var l=s.masksProperties;for(r=l.length,a=0;a<r;a+=1)if(l[a].pt.k.i)l[a].pt.k.c=l[a].cl;else for(h=l[a].pt.k.length,n=0;n<h;n+=1)l[a].pt.k[n].s&&(l[a].pt.k[n].s[0].c=l[a].cl),l[a].pt.k[n].e&&(l[a].pt.k[n].e[0].c=l[a].cl)}4===s.ty&&t(s.shapes)}}var s=[4,4,18];return function(t){if(a(s,t.v)&&(e(t.layers),t.assets)){var i,r=t.assets.length;for(i=0;i<r;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),f={};return f.completeData=r,f}function M(){this.c=!1,this._length=0,this._maxLength=8,this.v=u(this._maxLength),this.o=u(this._maxLength),this.i=u(this._maxLength)}function P(){}function C(){}function D(){}function x(){}function E(){this._length=0,this._maxLength=4,this.shapes=u(this._maxLength)}function F(t,e,s){this.elem=t,this.frameId=-1,this.dataProps=u(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=$t("float32",e.length?e.length-1:0),this.dashoffset=$t("float32",1),this.initDynamicPropertyContainer(t);var i,a,r=e.length||0;for(i=0;i<r;i+=1)a=re.getProp(t,e[i].v,0,0,this),this.k=a.k||this.k,this.dataProps[i]={n:e[i].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function S(t,e){this.data=e,this.c=$t("uint8c",4*e.p);var s=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=$t("float32",s),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=s,this.initDynamicPropertyContainer(t),this.prop=re.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function w(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=u(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function T(t,e,s){var i={propType:!1},a=re.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,Zt,s):i,rx:r.rx?a(t,r.rx,0,Zt,s):i,ry:r.ry?a(t,r.ry,0,Zt,s):i,sk:r.sk?a(t,r.sk,0,Zt,s):i,sa:r.sa?a(t,r.sa,0,Zt,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=de.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function I(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function L(t,e){this._frameId=jt,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=-1,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__test:!0},this.copyFromDocumentData(this.data.d.k[0].s),this.searchProperty()||(this.completeTextData(this.currentData),this.keysIndex=0)}function z(){}function R(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=g("svg");var s=g("g");this.svgElement.appendChild(s),this.layerElement=s;var i=g("defs");this.svgElement.appendChild(i),this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||e.hideOnTransparent!==!1,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||""},this.globalData={_mdf:!1,frameNum:-1,defs:i,frameId:0,compSize:{w:0,h:0},renderConfig:this.renderConfig,fontManager:new ae},this.elements=[],this.pendingElements=[],this.destroyed=!1}function N(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a=this.globalData.defs,r=this.masksProperties?this.masksProperties.length:0;this.viewData=u(r),this.solidPath="";var n,h,l,p,f,m,d,c=this.masksProperties,v=0,y=[],b=o(10),_="clipPath",k="clip-path";for(i=0;i<r;i++)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k)&&(_="mask",k="mask"),"s"!=c[i].mode&&"i"!=c[i].mode||0!==v?p=null:(p=g("rect"),p.setAttribute("fill","#ffffff"),p.setAttribute("width",this.element.comp.data.w),p.setAttribute("height",this.element.comp.data.h),y.push(p)),n=g("path"),"n"!=c[i].mode){v+=1,n.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero");var A;if(0!==c[i].x.k?(_="mask",k="mask",d=re.getProp(this.element,c[i].x,0,null,this.element),A="fi_"+o(10),f=g("filter"),f.setAttribute("id",A),m=g("feMorphology"),m.setAttribute("operator","dilate"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),f.appendChild(m),a.appendChild(f),n.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):(m=null,d=null),this.storedData[i]={elem:n,x:d,expan:m,lastPath:"",lastOperator:"",filterId:A,lastRadius:0},"i"==c[i].mode){l=y.length;var M=g("g");for(h=0;h<l;h+=1)M.appendChild(y[h]);var P=g("mask");P.setAttribute("mask-type","alpha"),P.setAttribute("id",b+"_"+v),P.appendChild(n),a.appendChild(P),M.setAttribute("mask","url("+qt+"#"+b+"_"+v+")"),y.length=0,y.push(M)}else y.push(n);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:re.getProp(this.element,c[i].o,0,.01,this.element),prop:he.getShapeProp(this.element,c[i],3),invRect:p},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:re.getProp(this.element,c[i].o,0,.01,this.element),prop:he.getShapeProp(this.element,c[i],3),elem:n,lastPath:""},a.appendChild(n);for(this.maskElement=g(_),r=y.length,i=0;i<r;i+=1)this.maskElement.appendChild(y[i]);v>0&&(this.maskElement.setAttribute("id",b),this.element.maskedElement.setAttribute(k,"url("+qt+"#"+b+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function V(){}function O(){}function B(){}function q(){}function j(){}function G(t,e){this.elem=t,this.pos=e}function W(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!1,this.pElem=g("path"),this.msElem=null}function X(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function Y(t,e,s){this.transform={mProps:t,op:e,container:s},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function H(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=re.getProp(t,e.o,0,.01,this),this.w=re.getProp(t,e.w,0,null,this),this.d=new F(t,e.d||{},"svg",this),this.c=re.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}function J(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=re.getProp(t,e.o,0,.01,this),this.c=re.getProp(t,e.c,1,255,this),this.style=s}function U(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}function Z(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=re.getProp(t,e.w,0,null,this),this.d=new F(t,e.d||{},"svg",this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}function K(){this.it=[],this.prevViewData=[],this.gr=g("g")}function Q(){}function $(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function tt(){}function et(){}function st(){}function it(){}function at(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s)}function rt(t,e,s){this.initElement(t,e,s)}function nt(t,e,s){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?u(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?re.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ht(t,e,s){this.textSpans=[],this.renderType="svg",this.initElement(t,e,s)}function ot(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}function lt(t,e){this.filterManager=e;var s=g("feColorMatrix");if(s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),s.setAttribute("result","f1"),t.appendChild(s),s=g("feColorMatrix"),s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result","f2"),t.appendChild(s),this.matrixFilter=s,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i=g("feMerge");t.appendChild(i);var a;a=g("feMergeNode"),a.setAttribute("in","SourceGraphic"),i.appendChild(a),a=g("feMergeNode"),a.setAttribute("in","f2"),i.appendChild(a)}}function pt(t,e){this.filterManager=e;var s=g("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(s),this.matrixFilter=s}function ft(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function mt(t,e){this.filterManager=e;var s=g("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),s.setAttribute("result","f1"),t.appendChild(s);var i=g("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var a=g("feFuncR");a.setAttribute("type","table"),i.appendChild(a),this.feFuncR=a;var r=g("feFuncG");r.setAttribute("type","table"),i.appendChild(r),this.feFuncG=r;var n=g("feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function dt(t,e){this.filterManager=e;var s=this.filterManager.effectElements,i=g("feComponentTransfer");(s[10].p.k||0!==s[10].p.v||s[11].p.k||1!==s[11].p.v||s[12].p.k||1!==s[12].p.v||s[13].p.k||0!==s[13].p.v||s[14].p.k||1!==s[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(s[17].p.k||0!==s[17].p.v||s[18].p.k||1!==s[18].p.v||s[19].p.k||1!==s[19].p.v||s[20].p.k||0!==s[20].p.v||s[21].p.k||1!==s[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(s[24].p.k||0!==s[24].p.v||s[25].p.k||1!==s[25].p.v||s[26].p.k||1!==s[26].p.v||s[27].p.k||0!==s[27].p.v||s[28].p.k||1!==s[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(s[31].p.k||0!==s[31].p.v||s[32].p.k||1!==s[32].p.v||s[33].p.k||1!==s[33].p.v||s[34].p.k||0!==s[34].p.v||s[35].p.k||1!==s[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=g("feComponentTransfer")),(s[3].p.k||0!==s[3].p.v||s[4].p.k||1!==s[4].p.v||s[5].p.k||1!==s[5].p.v||s[6].p.k||0!==s[6].p.v||s[7].p.k||1!==s[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function ct(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","400%"),t.setAttribute("height","400%"),this.filterManager=e;var s=g("feGaussianBlur");s.setAttribute("in","SourceAlpha"),s.setAttribute("result","drop_shadow_1"),s.setAttribute("stdDeviation","0"),this.feGaussianBlur=s,t.appendChild(s);var i=g("feOffset");i.setAttribute("dx","25"),i.setAttribute("dy","0"),i.setAttribute("in","drop_shadow_1"),i.setAttribute("result","drop_shadow_2"),this.feOffset=i,t.appendChild(i);var a=g("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var r=g("feComposite");r.setAttribute("in","drop_shadow_3"),r.setAttribute("in2","drop_shadow_2"),r.setAttribute("operator","in"),r.setAttribute("result","drop_shadow_4"),t.appendChild(r);var n=g("feMerge");t.appendChild(n);var h;h=g("feMergeNode"),n.appendChild(h),h=g("feMergeNode"),h.setAttribute("in","SourceGraphic"),this.feMergeNode=h,this.feMerge=n,this.originalNodeAdded=!1,n.appendChild(h)}function ut(t,e,s){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=s,s.matteElement=g("g"),s.matteElement.appendChild(s.layerElement),s.matteElement.appendChild(s.transformedElement),s.baseElement=s.matteElement}function gt(t){var e,s=t.data.ef?t.data.ef.length:0,i=o(10),a=me.createFilter(i),r=0;this.filters=[];var n;for(e=0;e<s;e+=1)n=null,20===t.data.ef[e].ty?(r+=1,n=new lt(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(r+=1,n=new pt(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?n=new ft(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(r+=1,n=new mt(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(r+=1,n=new dt(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(r+=1,n=new ct(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty&&(n=new ut(a,t.effectsManager.effectElements[e],t)),n&&this.filters.push(n);r&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+qt+"#"+i+")")),this.filters.length&&t.addRenderableComponent(this)}function vt(){}function yt(t){qt=t}function bt(t){Pe.play(t)}function _t(t){Pe.pause(t)}function kt(t){Pe.togglePause(t)}function At(t,e){Pe.setSpeed(t,e)}function Mt(t,e){Pe.setDirection(t,e)}function Pt(t){Pe.stop(t)}function Ct(){xe===!0?Pe.searchAnimations(Ee,xe,Fe):Pe.searchAnimations()}function Dt(t){return Pe.registerAnimation(t)}function xt(){Pe.resize()}function Et(t,e,s){Pe.goToAndStop(t,e,s)}function Ft(t){Gt=t}function St(t){return xe===!0&&(t.animationData=JSON.parse(Ee)),Pe.loadAnimation(t)}function wt(t){return Pe.destroy(t)}function Tt(t){if("string"==typeof t)switch(t){case"high":Ut=200;break;case"medium":Ut=50;break;case"low":Ut=10}else!isNaN(t)&&t>1&&(Ut=t);s(!(Ut>=50))}function It(){return"undefined"!=typeof navigator}function Lt(t,e){"expressions"===t&&(Vt=e)}function zt(t){switch(t){case"propertyFactory":return re;case"shapePropertyFactory":return he;case"matrix":return te}}function Rt(){"complete"===document.readyState&&(clearInterval(Le),Ct())}function Nt(t){for(var e=Ie.split("&"),s=0;s<e.length;s++){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}var Vt,Ot,Bt="http://www.w3.org/2000/svg",qt="",jt=-999999,Gt=!0,Wt=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Math.round,Math.pow),Xt=Math.sqrt,Yt=(Math.abs,Math.floor),Ht=(Math.max,Math.min),Jt={};!function(){var t,e=Object.getOwnPropertyNames(Math),s=e.length;for(t=0;t<s;t+=1)Jt[e[t]]=Math[e[t]]}(),Jt.random=Math.random,Jt.abs=function(t){var e=typeof t;if("object"===e&&t.length){var s,i=u(t.length),a=t.length;for(s=0;s<a;s+=1)i[s]=Math.abs(t[s]);return i}return Math.abs(t)};var Ut=150,Zt=Math.PI/180,Kt=.5519;s(!1);var Qt=function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e;return function(t,e,i){return t<0&&(t=0),e<0&&(e=0),i<0&&(i=0),"#"+s[t]+s[e]+s[i]}}();c.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var $t=function(){function t(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a}function e(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?e:t}();y.prototype={addDynamicProperty:function(t){this.dynamicProperties.indexOf(t)===-1&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var te=function(){function t(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function e(t){if(0===t)return this;var e=E(t),s=F(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=E(t),s=F(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function i(t){if(0===t)return this;var e=E(t),s=F(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function a(t){if(0===t)return this;var e=E(t),s=F(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function r(t,e){return this._t(1,e,t,1,0,0)}function n(t,e){return this.shear(S(t),S(e))}function h(t,e){var s=E(e),i=F(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,S(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function o(t,e,s){return s=isNaN(s)?1:s,1==t&&1==e&&1==s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function l(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function p(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function f(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]=g[15]*u,this._identityCalculated=!1,this;var v=g[0],y=g[1],b=g[2],_=g[3],k=g[4],A=g[5],M=g[6],P=g[7],C=g[8],D=g[9],x=g[10],E=g[11],F=g[12],S=g[13],w=g[14],T=g[15];return g[0]=v*t+y*a+b*o+_*m,g[1]=v*e+y*r+b*l+_*d,g[2]=v*s+y*n+b*p+_*c,g[3]=v*i+y*h+b*f+_*u,g[4]=k*t+A*a+M*o+P*m,g[5]=k*e+A*r+M*l+P*d,g[6]=k*s+A*n+M*p+P*c,g[7]=k*i+A*h+M*f+P*u,g[8]=C*t+D*a+x*o+E*m,g[9]=C*e+D*r+x*l+E*d,g[10]=C*s+D*n+x*p+E*c,g[11]=C*i+D*h+x*f+E*u,g[12]=F*t+S*a+w*o+T*m,g[13]=F*e+S*r+w*l+T*d,g[14]=F*s+S*n+w*p+T*c,g[15]=F*i+S*h+w*f+T*u,this._identityCalculated=!1,this}function m(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function d(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function c(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e]}function u(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function g(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function v(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function y(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function b(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function _(t){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],s=this.props[5]/e,i=-this.props[1]/e,a=-this.props[4]/e,r=this.props[0]/e,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,h=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e;return[t[0]*s+t[1]*a+n,t[0]*i+t[1]*r+h,0]}function k(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=_(t[e]);return i}function A(t,e,s){var i=$t("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function M(t,e,s){var i;return i=this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function P(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function C(){for(var t=0,e=this.props,s="matrix3d(",i=1e4;t<16;)s+=w(e[t]*i)/i,s+=15===t?")":",",t+=1;return s}function D(t){var e=1e4;return t<1e-6&&t>0||t>-1e-6&&t<0?w(t*e)/e:t}function x(){var t=this.props,e=D(t[0]),s=D(t[1]),i=D(t[4]),a=D(t[5]),r=D(t[12]),n=D(t[13]);return"matrix("+e+","+s+","+i+","+a+","+r+","+n+")"}var E=Math.cos,F=Math.sin,S=Math.tan,w=Math.round;return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=i,this.rotateZ=a,this.skew=n,this.skewFromAxis=h,this.shear=r,this.scale=o,this.setTransform=l,this.translate=p,this.transform=f,this.applyToPoint=g,this.applyToX=v,this.applyToY=y,this.applyToZ=b,this.applyToPointArray=M,this.applyToTriplePoints=A,this.applyToPointStringified=P,this.toCSS=C,this.to2dCSS=x,this.clone=c,this.cloneFromProps=u,this.equals=d,this.inversePoints=k,this.inversePoint=_,this._t=this.transform,this.isIdentity=m,this._identity=!0,this._identityCalculated=!1,this.props=$t("float32",16),this.reset()}}();!function(t,e){function s(s,l,p){var d=[];l=l===!0?{entropy:!0}:l||{};var y=n(r(l.entropy?[s,o(t)]:null===s?h():s,3),d),b=new i(d),_=function(){for(var t=b.g(m),e=u,s=0;t<g;)t=(t+s)*f,e*=f,s=b.g(1);for(;t>=v;)t/=2,e/=2,s>>>=1;return(t+s)/e};return _.int32=function(){return 0|b.g(4)},_.quick=function(){return b.g(4)/4294967296},_["double"]=_,n(o(b.S),t),(l.pass||p||function(t,s,i,r){return r&&(r.S&&a(r,b),t.state=function(){return a(b,{})}),i?(e[c]=t,s):t})(_,y,"global"in l?l.global:this==e,l.state)}function i(t){var e,s=t.length,i=this,a=0,r=i.i=i.j=0,n=i.S=[];for(s||(t=[s++]);a<f;)n[a]=a++;for(a=0;a<f;a++)n[a]=n[r=y&r+t[a%s]+(e=n[a])],n[r]=e;i.g=function(t){for(var e,s=0,a=i.i,r=i.j,n=i.S;t--;)e=n[a=y&a+1],s=s*f+n[y&(n[a]=n[r=y&r+e])+(n[r]=e)];return i.i=a,i.j=r,s}}function a(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function r(t,e){var s,i=[],a=typeof t;if(e&&"object"==a)for(s in t)try{i.push(r(t[s],e-1))}catch(n){}return i.length?i:"string"==a?t:t+"\0"}function n(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return o(e)}function h(){try{if(l)return o(l.randomBytes(f));var e=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(e),o(e)}catch(s){var i=p.navigator,a=i&&i.plugins;return[+new Date,p,a,p.screen,o(t)]}}function o(t){return String.fromCharCode.apply(0,t)}var l,p=this,f=256,m=6,d=52,c="random",u=e.pow(f,m),g=e.pow(2,d),v=2*g,y=f-1;e["seed"+c]=s,n(e.random(),t)}([],Jt);var ee=function(){function t(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");
+if(p[r])return p[r];var n=new o([t,e,s,i]);return p[r]=n,n}function e(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function i(t){return 3*t}function a(t,a,r){return((e(a,r)*t+s(a,r))*t+i(a))*t}function r(t,a,r){return 3*e(a,r)*t*t+2*s(a,r)*t+i(a)}function n(t,e,s,i,r){var n,h,o=0;do h=e+(s-e)/2,n=a(h,i,r)-t,n>0?s=h:e=h;while(Math.abs(n)>d&&++o<c);return h}function h(t,e,s,i){for(var n=0;n<f;++n){var h=r(e,s,i);if(0===h)return e;var o=a(e,s,i)-t;e-=o/h}return e}function o(t){this._p=t,this._mSampleValues=v?new Float32Array(u):new Array(u),this._precomputed=!1,this.get=this.get.bind(this)}var l={};l.getBezierEasing=t;var p={},f=4,m=.001,d=1e-7,c=10,u=11,g=1/(u-1),v="function"==typeof Float32Array;return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),e===s&&i===r?t:0===t?0:1===t?1:a(this._getTForX(t),s,r)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<u;++s)this._mSampleValues[s]=a(s*g,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,o=1,l=u-1;o!==l&&i[o]<=t;++o)a+=g;--o;var p=(t-i[o])/(i[o+1]-i[o]),f=a+p*g,d=r(f,e,s);return d>=m?h(t,f,e,s):0===d?f:n(t,a,a+g,e,s)}},l}();!function(){for(var e=0,s=["ms","moz","webkit","o"],i=0;i<s.length&&!t.requestAnimationFrame;++i)t.requestAnimationFrame=t[s[i]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[s[i]+"CancelAnimationFrame"]||t[s[i]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t,s){var i=(new Date).getTime(),a=Math.max(0,16-(i-e)),r=setTimeout(function(){t(i+a)},a);return e=i+a,r}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}();var se=k(),ie=A(),ae=function(){function e(t,e){var s=v("span");s.style.fontFamily=e;var i=v("span");i.innerHTML="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=t+", "+e,{node:i,w:a,parent:s}}function s(){var e,i,a,r=this.fonts.length,n=r;for(e=0;e<r;e+=1)if(this.fonts[e].loaded)n-=1;else if("t"===this.fonts[e].fOrigin||2===this.fonts[e].origin){if(t.Typekit&&t.Typekit.load&&0===this.typekitLoaded){this.typekitLoaded=1;try{t.Typekit.load({async:!0,active:function(){this.typekitLoaded=2}.bind(this)})}catch(h){}}2===this.typekitLoaded&&(this.fonts[e].loaded=!0)}else"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(i=this.fonts[e].monoCase.node,a=this.fonts[e].monoCase.w,i.offsetWidth!==a?(n-=1,this.fonts[e].loaded=!0):(i=this.fonts[e].sansCase.node,a=this.fonts[e].sansCase.w,i.offsetWidth!==a&&(n-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==n&&Date.now()-this.initTime<p?setTimeout(s.bind(this),20):setTimeout(function(){this.loaded=!0}.bind(this),0)}function i(t,e){var s=g("text");s.style.fontSize="100px",s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",e.fStyle),s.setAttribute("font-weight",e.fWeight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.className=e.fClass):s.style.fontFamily=e.fFamily,t.appendChild(s);var i=v("canvas").getContext("2d");return i.font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,s}function a(t,a){if(!t)return void(this.loaded=!0);if(this.chars)return this.loaded=!0,void(this.fonts=t.list);var r,n=t.list,h=n.length;for(r=0;r<h;r+=1){if(n[r].loaded=!1,n[r].monoCase=e(n[r].fFamily,"monospace"),n[r].sansCase=e(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){var o=v("style");o.type="text/css",o.innerHTML="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",a.appendChild(o)}else if("g"===n[r].fOrigin||1===n[r].origin){var l=v("link");l.type="text/css",l.rel="stylesheet",l.href=n[r].fPath,document.body.appendChild(l)}else if("t"===n[r].fOrigin||2===n[r].origin){var p=v("script");p.setAttribute("src",n[r].fPath),a.appendChild(p)}}else n[r].loaded=!0;n[r].helper=i(a,n[r]),n[r].cache={},this.fonts.push(n[r])}setTimeout(function(){s.bind(this)()}.bind(this),100)}function r(t){if(t){this.chars||(this.chars=[]);var e,s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}}function n(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return console&&console.warn&&console.warn("Missing character from exported characters list: ",t,e,s),f}function h(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s}function o(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]}function l(){return m}var p=5e3,f={w:0,size:0,shapes:[]},m=[];m=m.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var d=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.loaded=!1,this.initTime=Date.now()};return d.getCombinedCharacterCodes=l,d.prototype.addChars=r,d.prototype.addFonts=a,d.prototype.getCharData=n,d.prototype.getFontByName=o,d.prototype.measureText=h,d}(),re=function(){function t(t,a){var r,n=this.offsetTime;"multidimensional"===this.propType&&(r=$t("float32",this.pv.length));for(var h,o,l=a.lastIndex,p=l,f=this.keyframes.length-1,m=!0;m;){if(h=this.keyframes[p],o=this.keyframes[p+1],p==f-1&&t>=o.t-n){h.h&&(h=o),l=0;break}if(o.t-n>t){l=p;break}p<f-1?p+=1:(l=0,m=!1)}var d,c,u,g,v,y;if(h.to){h.bezierData||se.buildBezierData(h);var b=h.bezierData;if(t>=o.t-n||t<h.t-n){var _=t>=o.t-n?b.points.length-1:0;for(c=b.points[_].point.length,d=0;d<c;d+=1)r[d]=b.points[_].point[d];a._lastBezierData=null}else{h.__fnct?y=h.__fnct:(y=ee.getBezierEasing(h.o.x,h.o.y,h.i.x,h.i.y,h.n).get,h.__fnct=y),u=y((t-(h.t-n))/(o.t-n-(h.t-n)));var k,A=b.segmentLength*u,M=a.lastFrame<t&&a._lastBezierData===b?a._lastAddedLength:0;for(v=a.lastFrame<t&&a._lastBezierData===b?a._lastPoint:0,m=!0,g=b.points.length;m;){if(M+=b.points[v].partialLength,0===A||0===u||v==b.points.length-1){for(c=b.points[v].point.length,d=0;d<c;d+=1)r[d]=b.points[v].point[d];break}if(A>=M&&A<M+b.points[v+1].partialLength){for(k=(A-M)/b.points[v+1].partialLength,c=b.points[v].point.length,d=0;d<c;d+=1)r[d]=b.points[v].point[d]+(b.points[v+1].point[d]-b.points[v].point[d])*k;break}v<g-1?v+=1:m=!1}a._lastPoint=v,a._lastAddedLength=M-b.points[v].partialLength,a._lastBezierData=b}}else{var P,C,D,x,E;if(f=h.s.length,this.sh&&1!==h.h)if(t>=o.t-n)r[0]=h.e[0],r[1]=h.e[1],r[2]=h.e[2];else if(t<=h.t-n)r[0]=h.s[0],r[1]=h.s[1],r[2]=h.s[2];else{var F=i(h.s),S=i(h.e),w=(t-(h.t-n))/(o.t-n-(h.t-n));s(r,e(F,S,w))}else for(p=0;p<f;p+=1)1!==h.h&&(t>=o.t-n?u=1:t<h.t-n?u=0:(h.o.x.constructor===Array?(h.__fnct||(h.__fnct=[]),h.__fnct[p]?y=h.__fnct[p]:(P=h.o.x[p]||h.o.x[0],C=h.o.y[p]||h.o.y[0],D=h.i.x[p]||h.i.x[0],x=h.i.y[p]||h.i.y[0],y=ee.getBezierEasing(P,C,D,x).get,h.__fnct[p]=y)):h.__fnct?y=h.__fnct:(P=h.o.x,C=h.o.y,D=h.i.x,x=h.i.y,y=ee.getBezierEasing(P,C,D,x).get,h.__fnct=y),u=y((t-(h.t-n))/(o.t-n-(h.t-n))))),E=1===h.h?h.s[p]:h.s[p]+(h.e[p]-h.s[p])*u,1===f?r=E:r[p]=E}return a.lastIndex=l,r}function e(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];return a=l*d+p*c+f*u+m*g,a<0&&(a=-a,d=-d,c=-c,u=-u,g=-g),1-a>1e-6?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,h=Math.sin(s*i)/r):(n=1-s,h=s),o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}function s(t,e){var s=e[0],i=e[1],a=e[2],r=e[3],n=Math.atan2(2*i*r-2*s*a,1-2*i*i-2*a*a),h=Math.asin(2*s*i+2*a*r),o=Math.atan2(2*s*r-2*i*a,1-2*s*s-2*a*a);t[0]=n/Zt,t[1]=h/Zt,t[2]=o/Zt}function i(t){var e=t[0]*Zt,s=t[1]*Zt,i=t[2]*Zt,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2),p=a*r*n-h*o*l,f=h*o*n+a*r*l,m=h*r*n+a*o*l,d=a*o*n-h*r*l;return[f,m,d,p]}function a(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==d&&(this._caching.lastFrame>=s&&t>=s||this._caching.lastFrame<e&&t<e))){this._caching.lastIndex=this._caching.lastFrame<t?this._caching.lastIndex:0;var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function r(t){var e;if("unidimensional"===this.propType)e=t*this.mult,c(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,c(this.v[s]-e)>1e-5&&(this.v[s]=e,this._mdf=!0),s+=1}function n(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length){if(this.lock)return void this.setVValue(this.pv);this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function h(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=n,this.setVValue=r,this.addEffect=h}function l(t,e,s,i){this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a,o=e.k.length;this.v=$t("float32",o),this.pv=$t("float32",o);$t("float32",o);for(this.vel=$t("float32",o),a=0;a<o;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=n,this.setVValue=r,this.addEffect=h}function p(e,s,i,o){this.propType="unidimensional",this.keyframes=s.k,this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:d,lastIndex:0,value:0},this.k=!0,this.kf=!0,this.data=s,this.mult=i||1,this.elem=e,this.container=o,this.comp=e.comp,this.v=d,this.pv=d,this._isFirstFrame=!0,this.getValue=n,this.setVValue=r,this.interpolateValue=t,this.effectsSequence=[a.bind(this)],this.addEffect=h}function f(e,s,i,o){this.propType="multidimensional";var l,p,f,m,c,u=s.k.length;for(l=0;l<u-1;l+=1)s.k[l].to&&s.k[l].s&&s.k[l].e&&(p=s.k[l].s,f=s.k[l].e,m=s.k[l].to,c=s.k[l].ti,(2===p.length&&(p[0]!==f[0]||p[1]!==f[1])&&se.pointOnLine2D(p[0],p[1],f[0],f[1],p[0]+m[0],p[1]+m[1])&&se.pointOnLine2D(p[0],p[1],f[0],f[1],f[0]+c[0],f[1]+c[1])||3===p.length&&(p[0]!==f[0]||p[1]!==f[1]||p[2]!==f[2])&&se.pointOnLine3D(p[0],p[1],p[2],f[0],f[1],f[2],p[0]+m[0],p[1]+m[1],p[2]+m[2])&&se.pointOnLine3D(p[0],p[1],p[2],f[0],f[1],f[2],f[0]+c[0],f[1]+c[1],f[2]+c[2]))&&(s.k[l].to=null,s.k[l].ti=null),p[0]===f[0]&&p[1]===f[1]&&0===m[0]&&0===m[1]&&0===c[0]&&0===c[1]&&(2===p.length||p[2]===f[2]&&0===m[2]&&0===c[2])&&(s.k[l].to=null,s.k[l].ti=null));this.effectsSequence=[a.bind(this)],this.keyframes=s.k,this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=e,this.container=o,this.comp=e.comp,this.getValue=n,this.setVValue=r,this.interpolateValue=t,this.frameId=-1;var g=s.k[0].s.length;for(this.v=$t("float32",g),this.pv=$t("float32",g),l=0;l<g;l+=1)this.v[l]=d,this.pv[l]=d;this._caching={lastFrame:d,lastIndex:0,value:$t("float32",g)},this.addEffect=h}function m(t,e,s,i,a){var r;if(0===e.a)r=0===s?new o(t,e,i,a):new l(t,e,i,a);else if(1===e.a)r=0===s?new p(t,e,i,a):new f(t,e,i,a);else if(e.k.length)if("number"==typeof e.k[0])r=new l(t,e,i,a);else switch(s){case 0:r=new p(t,e,i,a);break;case 1:r=new f(t,e,i,a)}else r=new o(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}var d=jt,c=Math.abs,u={getProp:m};return u}(),ne=function(){function t(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function e(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented&&this.p.keyframes&&this.p.getValueAtTime){var e,s;this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/this.elem.globalData.frameRate,0),s=this.p.getValueAtTime(this.p.keyframes[0].t/this.elem.globalData.frameRate,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/this.elem.globalData.frameRate,0),s=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.01)/this.elem.globalData.frameRate,0)):(e=this.p.pv,s=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/this.elem.globalData.frameRate,this.p.offsetTime)),this.v.rotate(-Math.atan2(e[1]-s[1],e[0]-s[0]))}this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function s(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}}function i(){}function a(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}function r(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new te,this.pre=new te,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p.s?(this.px=re.getProp(t,e.p.x,0,0,this),this.py=re.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=re.getProp(t,e.p.z,0,0,this))):this.p=re.getProp(t,e.p,1,0,this),e.r)this.r=re.getProp(t,e.r,0,Zt,this);else if(e.rx){if(this.rx=re.getProp(t,e.rx,0,Zt,this),this.ry=re.getProp(t,e.ry,0,Zt,this),this.rz=re.getProp(t,e.rz,0,Zt,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=re.getProp(t,e.or,1,Zt,this),this.or.sh=!0}e.sk&&(this.sk=re.getProp(t,e.sk,0,Zt,this),this.sa=re.getProp(t,e.sa,0,Zt,this)),e.a&&(this.a=re.getProp(t,e.a,1,0,this)),e.s&&(this.s=re.getProp(t,e.s,1,.01,this)),e.o?this.o=re.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}function n(t,e,s){return new r(t,e,s)}return r.prototype={applyToMatrix:t,getValue:e,precalculateMatrix:s,autoOrient:i},b([y],r),r.prototype.addDynamicProperty=a,r.prototype._addDynamicProperty=y.prototype.addDynamicProperty,{getTransformProperty:n}}();M.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=ge.newElement(),this.o[s]=ge.newElement(),this.i[s]=ge.newElement(),s+=1},M.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},M.prototype.doubleArrayLength=function(){this.v=this.v.concat(u(this._maxLength)),this.i=this.i.concat(u(this._maxLength)),this.o=this.o.concat(u(this._maxLength)),this._maxLength*=2},M.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!a)&&(r[i]=ge.newElement()),r[i][0]=t,r[i][1]=e},M.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},M.prototype.reverse=function(){var t=new M;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var he=function(){function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=1===d[d.length-2].h?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,v=d.length-1,y=!0;y&&(c=d[g],u=d[g+1],!(u.t-this.offsetTime>t));)g<v-1?g+=1:y=!1;if(r=1===c.h,m=g,!r){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var b;c.__fnct?b=c.__fnct:(b=ee.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=b),p=b((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function e(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==f&&(i<e&&t<e||i>s&&t>s)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function s(){this.paths=this.localShapeCollection}function i(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0}function a(){if(!this.lock&&this.elem.globalData.frameId!==this.frameId){this.lock=!0,this.frameId=this.elem.globalData.frameId,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,s=this.effectsSequence.length;for(t=0;t<s;t+=1)e=this.effectsSequence[t](e);i(this.v,e)||(this.v=ve.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection),this.lock=!1}}function r(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var a=3===i?e.pt.k:e.ks.k;this.v=ve.clone(a),this.pv=ve.clone(this.v),this.localShapeCollection=ye.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=s,this.effectsSequence=[]}function n(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,i,a){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===a?i.pt.k:i.ks.k,this.k=!0,this.kf=!0;var r=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=ve.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,r),this.pv=ve.clone(this.v),this.localShapeCollection=ye.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=f,this.reset=s,this._caching={lastFrame:f,lastIndex:0},this.effectsSequence=[e.bind(this)]}function o(t,e,s){var i;if(3===s||4===s){var a=3===s?e.pt:e.ks,n=a.k;i=1===a.a||n.length?new h(t,e,s):new r(t,e,s)}else 5===s?i=new c(t,e):6===s?i=new m(t,e):7===s&&(i=new d(t,e));return i.k&&t.addDynamicProperty(i),i}function l(){return r}function p(){return h}var f=-999999;r.prototype.interpolateShape=t,r.prototype.getValue=a,r.prototype.getValue=a,r.prototype.addEffect=n,h.prototype.getValue=a,h.prototype.interpolateShape=t,h.prototype.addEffect=n;var m=function(){function t(t,e){this.v=ve.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=ye.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=re.getProp(t,e.p,1,0,this),this.s=re.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}var e=Kt;return t.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],s=this.p.v[1],i=this.s.v[0]/2,a=this.s.v[1]/2,r=3!==this.d,n=this.v;n.v[0][0]=t,n.v[0][1]=s-a,n.v[1][0]=r?t+i:t-i,n.v[1][1]=s,n.v[2][0]=t,n.v[2][1]=s+a,n.v[3][0]=r?t-i:t+i,n.v[3][1]=s,n.i[0][0]=r?t-i*e:t+i*e,n.i[0][1]=s-a,n.i[1][0]=r?t+i:t-i,n.i[1][1]=s-a*e,n.i[2][0]=r?t+i*e:t-i*e,n.i[2][1]=s+a,n.i[3][0]=r?t-i:t+i,n.i[3][1]=s+a*e,n.o[0][0]=r?t+i*e:t-i*e,n.o[0][1]=s-a,n.o[1][0]=r?t+i:t-i,n.o[1][1]=s+a*e,n.o[2][0]=r?t-i*e:t+i*e,n.o[2][1]=s+a,n.o[3][0]=r?t-i:t+i,n.o[3][1]=s-a*e}},b([y],t),t}(),d=function(){function t(t,e){this.v=ve.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=re.getProp(t,e.ir,0,0,this),this.is=re.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=re.getProp(t,e.pt,0,0,this),this.p=re.getProp(t,e.p,1,0,this),this.r=re.getProp(t,e.r,0,Zt,this),this.or=re.getProp(t,e.or,0,0,this),this.os=re.getProp(t,e.os,0,.01,this),this.localShapeCollection=ye.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<a;t+=1){e=n?h:o,s=n?l:p,i=n?f:m;var u=e*Math.cos(d),g=e*Math.sin(d),v=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),y=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-v*i*s*c,g-y*i*s*c,u+v*i*s*c,g+y*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=-Math.PI/2,h=3===this.data.d?-1:1;for(n+=this.r.v,this.v._length=0,t=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},b([y],t),t}(),c=function(){function t(t,e){this.v=ve.newElement(),this.v.c=!0,this.localShapeCollection=ye.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=re.getProp(t,e.p,1,0,this),this.s=re.getProp(t,e.s,1,0,this),this.r=re.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=Ht(s,i,this.r.v),r=a*(1-Kt);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:s},b([y],t),t}(),u={};return u.getShapeProp=o,u.getConstructorFunction=l,u.getKeyframedConstructorFunction=p,u}(),oe=function(){function t(t,e){i[t]||(i[t]=e)}function e(t,e,s){return new i[t](e,s)}var s={},i={};return s.registerModifier=t,s.getModifier=e,s}();P.prototype.initModifierProperties=function(){},P.prototype.addShapeToModifier=function(){},P.prototype.addShape=function(t){if(!this.closed){var e={shape:t.sh,data:t,localShapeCollection:ye.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},P.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=jt,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},P.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},b([y],P),b([P],C),C.prototype.initModifierProperties=function(t,e){this.s=re.getProp(t,e.s,0,.01,this),this.e=re.getProp(t,e.e,0,.01,this),this.o=re.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},C.prototype.addShapeToModifier=function(t){t.pathsData=[]},C.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):t>=1?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1)if(h=r[n],h.e*a<i||h.s*a>i+s);else{var p,f;p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},C.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)be.release(t[e]);return t.length=0,t},C.prototype.processShapes=function(t){var e,s;if(this._mdf||t){var i=this.o.v%360/360;if(i<0&&(i+=1),e=this.s.v+i,s=this.e.v+i,e>s){var a=e;e=s,s=a}e=Math.round(1e3*e)/1e3,s=Math.round(1e3*s)/1e3,this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var r,n,h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(n=0;n<m;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection;else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(n=0;n<m;n+=1)this.shapes[n].shape._mdf=!0}else{var c,u,g=[];for(n=0;n<m;n+=1)if(c=this.shapes[n],c.shape._mdf||this._mdf||t||2===this.m){if(r=c.shape.paths,o=r._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=se.getSegmentsLength(r.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var v,y=e,b=s,_=0;for(n=m-1;n>=0;n-=1)if(c=this.shapes[n],c.shape._mdf){for(u=c.localShapeCollection,u.releaseShapes(),2===this.m&&m>1?(v=this.calculateShapeEdges(e,s,c.totalShapeLength,_,d),_+=c.totalShapeLength):v=[[y,b]],o=v.length,h=0;h<o;h+=1){y=v[h][0],b=v[h][1],g.length=0,b<=1?g.push({s:c.totalShapeLength*y,e:c.totalShapeLength*b}):y>=1?g.push({s:c.totalShapeLength*(y-1),e:c.totalShapeLength*(b-1)}):(g.push({s:c.totalShapeLength*y,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(b-1)}));var k=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(c.shape.v.c){var A=k.pop();this.addPaths(k,u),k=this.addShapes(c,g[1],A)}else this.addPaths(k,u),k=this.addShapes(c,g[1]);this.addPaths(k,u)}}c.shape.paths=u}}},C.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},C.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},C.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},C.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(s?(h=s._length,p=s._length):(s=ve.newElement(),h=0,p=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(n=o[a-1],c+n.addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=se.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c){if(n=o[a-1],c<=e.e){var v=o[a-1].addedLength;e.s<=c&&e.e>=c+v?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=se.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/v,(e.e-c)/v,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=ve.newElement(),g=!0,u.push(s),h=0)}return u},oe.registerModifier("tm",C),b([P],D),D.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=re.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},D.prototype.processPath=function(t,e){var s=ve.newElement();s.c=t.c;var i,a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,v=0;
+for(i=0;i<g;i+=1)a=t.v[i],n=t.o[i],r=t.i[i],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==i&&i!==g-1||t.c?(h=0===i?t.v[g-1]:t.v[i-1],o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)),l=o?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*Kt,d=f-(f-a[1])*Kt,s.setTripleAt(p,f,m,d,c,u,v),v+=1,h=i===g-1?t.v[0]:t.v[i+1],o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)),l=o?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*Kt,u=f-(f-a[1])*Kt,s.setTripleAt(p,f,m,d,c,u,v),v+=1):(s.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],v),v+=1):(s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],v),v+=1);return s},D.prototype.processShapes=function(t){var e,s,i,a,r=this.shapes.length,n=this.rd.v;if(0!==n){var h,o,l;for(s=0;s<r;s+=1){if(h=this.shapes[s],o=h.shape.paths,l=h.localShapeCollection,h.shape._mdf||this._mdf||t)for(l.releaseShapes(),h.shape._mdf=!0,e=h.shape.paths.shapes,a=h.shape.paths._length,i=0;i<a;i+=1)l.addShape(this.processPath(e[i],n));h.shape.paths=h.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)},oe.registerModifier("rd",D),b([P],x),x.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=re.getProp(t,e.c,0,null,this),this.o=re.getProp(t,e.o,0,null,this),this.tr=ne.getTransformProperty(t,e.tr,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new te,this.rMatrix=new te,this.sMatrix=new te,this.tMatrix=new te,this.matrix=new te},x.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},x.prototype.init=function(t,e,s,i){this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);for(var a=0;s>0;)s-=1,this._elements.unshift(e[s]),a+=1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},x.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},x.prototype.cloneElements=function(t){var e=(t.length,JSON.parse(JSON.stringify(t)));return this.resetElements(e),e},x.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},x.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n=Math.ceil(this.c.v);if(this._groups.length<n){for(;this._groups.length<n;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}r=0;var o;for(i=0;i<=this._groups.length-1;i+=1)o=r<n,this._groups[i]._render=o,this.changeGroupRender(this._groups[i].it,o),r+=1;this._currentCopies=n;var l=this.o.v,p=l%1,f=l>0?Math.floor(l):Math.ceil(l),m=(this.tr.v.props,this.pMatrix.props),d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u=0;if(l>0){for(;u<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),u+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),u+=p)}else if(l<0){for(;u>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),u-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),u-=p)}i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;for(var g,v;r;){if(e=this.elemsData[i].it,s=e[e.length-1].transform.mProps.v.props,v=s.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,0!==u){for((0!==i&&1===a||i!==this._currentCopies-1&&a===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),g=0;g<v;g+=1)s[g]=this.matrix.props[g];this.matrix.reset()}else for(this.matrix.reset(),g=0;g<v;g+=1)s[g]=this.matrix.props[g];u+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)e=this.elemsData[i].it,s=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},x.prototype.addShape=function(){},oe.registerModifier("rp",x),E.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(u(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},E.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)ve.release(this.shapes[t]);this._length=0},F.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},b([y],F),S.prototype.comparePoints=function(t,e){for(var s,i=0,a=this.o.length/2;i<a;){if(s=Math.abs(t[4*i]-t[4*e+2*i]),s>.01)return!1;i+=1}return!0},S.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},S.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4===0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2===0?100:1,i=e%2===0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},b([y],S);var le=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},pe=function(){function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function e(t){var e="";if(this.assetsPath){var s=t.p;s.indexOf("images/")!==-1&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e}function s(e){var s=v("img");s.addEventListener("load",t.bind(this),!1),s.addEventListener("error",t.bind(this),!1),s.src=e}function i(t,i){this.imagesLoadedCb=i,this.totalAssets=t.length;var a;for(a=0;a<this.totalAssets;a+=1)t[a].layers||(s.bind(this)(e.bind(this)(t[a])),this.totalImages+=1)}function a(t){this.path=t||""}function r(t){this.assetsPath=t||""}function n(){this.imagesLoadedCb=null}return function(){this.loadAssets=i,this.setAssetsPath=r,this.setPath=a,this.destroy=n,this.assetsPath="",this.path="",this.totalAssets=0,this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null}}(),fe=function(){var t={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),t}(),me=function(){function t(t){var e=g("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e}function e(){var t=g("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t}var s={};return s.createFilter=t,s.createAlphaToLuminanceFilter=e,s}();w.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=re.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new T(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},w.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,c,u,g,v,y,b,_,k,A,M,P=this._moreOptions.alignment.v,C=this._animatorsData,D=this._textData,x=this.mHelper,E=this._renderType,F=this.renderedLetters.length,S=(this.data,t.l);if(this._hasMaskedPath){if(M=this._pathData.m,!this._pathData.n||this._pathData._mdf){var w=M.v;this._pathData.r&&(w=w.reverse()),n={tLength:0,segments:[]},r=w._length-1;var T;for(_=0,a=0;a<r;a+=1)T={s:w.v[a],e:w.v[a+1],to:[w.o[a][0]-w.v[a][0],w.o[a][1]-w.v[a][1]],ti:[w.i[a+1][0]-w.v[a+1][0],w.i[a+1][1]-w.v[a+1][1]]},se.buildBezierData(T),n.tLength+=T.bezierData.segmentLength,n.segments.push(T),_+=T.bezierData.segmentLength;a=r,M.v.c&&(T={s:w.v[a],e:w.v[0],to:[w.o[a][0]-w.v[a][0],w.o[a][1]-w.v[a][1]],ti:[w.i[0][0]-w.v[0][0],w.i[0][1]-w.v[0][1]]},se.buildBezierData(T),n.tLength+=T.bezierData.segmentLength,n.segments.push(T),_+=T.bezierData.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,u=0,c=1,l=0,p=!0,y=n.segments,h<0&&M.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),u=y.length-1,v=y[u].bezierData.points,c=v.length-1;h<0;)h+=v[c].partialLength,c-=1,c<0&&(u-=1,v=y[u].bezierData.points,c=v.length-1);v=y[u].bezierData.points,g=v[c-1],o=v[c],b=o.partialLength}r=S.length,s=0,i=0;var L,z,R,N,V,O=1.2*t.finalSize*.714,B=!0;N=C.length;var q,j,G,W,X,Y,H,J,U,Z,K,Q,$,tt=-1,et=h,st=u,it=c,at=-1,rt=0,nt="",ht=this.defaultPropsArray;if(2===t.j||1===t.j){var ot=0,lt=0,pt=2===t.j?-.5:-1,ft=0,mt=!0;for(a=0;a<r;a+=1)if(S[a].n){for(ot&&(ot+=lt);ft<a;)S[ft].animatorJustifyOffset=ot,ft+=1;ot=0,mt=!0}else{for(R=0;R<N;R+=1)L=C[R].a,L.t.propType&&(mt&&2===t.j&&(lt+=L.t.v*pt),z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),ot+=q.length?L.t.v*q[0]*pt:L.t.v*q*pt);mt=!1}for(ot&&(ot+=lt);ft<a;)S[ft].animatorJustifyOffset=ot,ft+=1}for(a=0;a<r;a+=1){if(x.reset(),X=1,S[a].n)s=0,i+=t.yOffset,i+=B?1:0,h=et,B=!1,rt=0,this._hasMaskedPath&&(u=st,c=it,v=y[u].bezierData.points,g=v[c-1],o=v[c],b=o.partialLength,l=0),$=Z=Q=nt="",ht=this.defaultPropsArray;else{if(this._hasMaskedPath){if(at!==S[a].line){switch(t.j){case 1:h+=_-t.lineWidths[S[a].line];break;case 2:h+=(_-t.lineWidths[S[a].line])/2}at=S[a].line}tt!==S[a].ind&&(S[tt]&&(h+=S[tt].extra),h+=S[a].an/2,tt=S[a].ind),h+=P[0]*S[a].an/200;var dt=0;for(R=0;R<N;R+=1)L=C[R].a,L.p.propType&&(z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),dt+=q.length?L.p.v[0]*q[0]:L.p.v[0]*q),L.a.propType&&(z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),dt+=q.length?L.a.v[0]*q[0]:L.a.v[0]*q);for(p=!0;p;)l+b>=h+dt||!v?(k=(h+dt-l)/o.partialLength,G=g.point[0]+(o.point[0]-g.point[0])*k,W=g.point[1]+(o.point[1]-g.point[1])*k,x.translate(-P[0]*S[a].an/200,-(P[1]*O/100)),p=!1):v&&(l+=o.partialLength,c+=1,c>=v.length&&(c=0,u+=1,y[u]?v=y[u].bezierData.points:M.v.c?(c=0,u=0,v=y[u].bezierData.points):(l-=o.partialLength,v=null)),v&&(g=o,o=v[c],b=o.partialLength));j=S[a].an/2-S[a].add,x.translate(-j,0,0)}else j=S[a].an/2-S[a].add,x.translate(-j,0,0),x.translate(-P[0]*S[a].an/200,-P[1]*O/100,0);for(rt+=S[a].l/2,R=0;R<N;R+=1)L=C[R].a,L.t.propType&&(z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?h+=q.length?L.t.v*q[0]:L.t.v*q:s+=q.length?L.t.v*q[0]:L.t.v*q));for(rt+=S[a].l/2,t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(Y=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(J=[t.fc[0],t.fc[1],t.fc[2]]),R=0;R<N;R+=1)L=C[R].a,L.a.propType&&(z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),q.length?x.translate(-L.a.v[0]*q[0],-L.a.v[1]*q[1],L.a.v[2]*q[2]):x.translate(-L.a.v[0]*q,-L.a.v[1]*q,L.a.v[2]*q));for(R=0;R<N;R+=1)L=C[R].a,L.s.propType&&(z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),q.length?x.scale(1+(L.s.v[0]-1)*q[0],1+(L.s.v[1]-1)*q[1],1):x.scale(1+(L.s.v[0]-1)*q,1+(L.s.v[1]-1)*q,1));for(R=0;R<N;R+=1){if(L=C[R].a,z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),L.sk.propType&&(q.length?x.skewFromAxis(-L.sk.v*q[0],L.sa.v*q[1]):x.skewFromAxis(-L.sk.v*q,L.sa.v*q)),L.r.propType&&(q.length?x.rotateZ(-L.r.v*q[2]):x.rotateZ(-L.r.v*q)),L.ry.propType&&(q.length?x.rotateY(L.ry.v*q[1]):x.rotateY(L.ry.v*q)),L.rx.propType&&(q.length?x.rotateX(L.rx.v*q[0]):x.rotateX(L.rx.v*q)),L.o.propType&&(X+=q.length?(L.o.v*q[0]-X)*q[0]:(L.o.v*q-X)*q),t.strokeWidthAnim&&L.sw.propType&&(H+=q.length?L.sw.v*q[0]:L.sw.v*q),t.strokeColorAnim&&L.sc.propType)for(U=0;U<3;U+=1)q.length?Y[U]=Y[U]+(L.sc.v[U]-Y[U])*q[0]:Y[U]=Y[U]+(L.sc.v[U]-Y[U])*q;if(t.fillColorAnim&&t.fc){if(L.fc.propType)for(U=0;U<3;U+=1)q.length?J[U]=J[U]+(L.fc.v[U]-J[U])*q[0]:J[U]=J[U]+(L.fc.v[U]-J[U])*q;L.fh.propType&&(J=q.length?d(J,L.fh.v*q[0]):d(J,L.fh.v*q)),L.fs.propType&&(J=q.length?f(J,L.fs.v*q[0]):f(J,L.fs.v*q)),L.fb.propType&&(J=q.length?m(J,L.fb.v*q[0]):m(J,L.fb.v*q))}}for(R=0;R<N;R+=1)L=C[R].a,L.p.propType&&(z=C[R].s,q=z.getMult(S[a].anIndexes[R],D.a[R].s.totalChars),this._hasMaskedPath?q.length?x.translate(0,L.p.v[1]*q[0],-L.p.v[2]*q[1]):x.translate(0,L.p.v[1]*q,-L.p.v[2]*q):q.length?x.translate(L.p.v[0]*q[0],L.p.v[1]*q[1],-L.p.v[2]*q[2]):x.translate(L.p.v[0]*q,L.p.v[1]*q,-L.p.v[2]*q));if(t.strokeWidthAnim&&(Z=H<0?0:H),t.strokeColorAnim&&(K="rgb("+Math.round(255*Y[0])+","+Math.round(255*Y[1])+","+Math.round(255*Y[2])+")"),t.fillColorAnim&&t.fc&&(Q="rgb("+Math.round(255*J[0])+","+Math.round(255*J[1])+","+Math.round(255*J[2])+")"),this._hasMaskedPath){if(x.translate(0,-t.ls),x.translate(0,P[1]*O/100+i,0),D.p.p){A=(o.point[1]-g.point[1])/(o.point[0]-g.point[0]);var ct=180*Math.atan(A)/Math.PI;o.point[0]<g.point[0]&&(ct+=180),x.rotate(-ct*Math.PI/180)}x.translate(G,W,0),h-=P[0]*S[a].an/200,S[a+1]&&tt!==S[a+1].ind&&(h+=S[a].an/2,h+=t.tr/1e3*t.finalSize)}else{switch(x.translate(s,i,0),t.ps&&x.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:x.translate(S[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[S[a].line]),0,0);break;case 2:x.translate(S[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[S[a].line])/2,0,0)}x.translate(0,-t.ls),x.translate(j,0,0),x.translate(P[0]*S[a].an/200,P[1]*O/100,0),s+=S[a].l+t.tr/1e3*t.finalSize}"html"===E?nt=x.toCSS():"svg"===E?nt=x.to2dCSS():ht=[x.props[0],x.props[1],x.props[2],x.props[3],x.props[4],x.props[5],x.props[6],x.props[7],x.props[8],x.props[9],x.props[10],x.props[11],x.props[12],x.props[13],x.props[14],x.props[15]],$=X}F<=a?(V=new I($,Z,K,Q,nt,ht),this.renderedLetters.push(V),F+=1,this.lettersChangedFlag=!0):(V=this.renderedLetters[a],this.lettersChangedFlag=V.update($,Z,K,Q,nt,ht)||this.lettersChangedFlag)}}},w.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},w.prototype.mHelper=new te,w.prototype.defaultPropsArray=[],b([y],w),I.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var n=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,n=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,n=!0),this.sc!==s&&(this.sc=s,this._mdf.sc=!0,n=!0),this.fc!==i&&(this.fc=i,this._mdf.fc=!0,n=!0),this.m!==a&&(this.m=a,this._mdf.m=!0,n=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,this._mdf.p=!0,n=!0),n},L.prototype.defaultBoxWidth=[0,0],L.prototype.copyFromDocumentData=function(t){for(var e in t)this.currentData[e]=t[e]},L.prototype.setCurrentData=function(t,e){this.currentData!==t?(t.__complete||this.completeTextData(t),this.copyFromDocumentData(t),this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this.currentData.fillColorAnim=t.fillColorAnim||this.currentData.fillColorAnim,this.currentData.strokeColorAnim=t.strokeColorAnim||this.currentData.strokeColorAnim,this.currentData.strokeWidthAnim=t.strokeWidthAnim||this.currentData.strokeWidthAnim,this._mdf=!0):e!==this.currentData.t&&(this._mdf=!0,this.completeTextData(t))},L.prototype.searchProperty=function(){return this.searchKeyframes()},L.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},L.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},L.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){var e=this.currentData.t;if(this.lock)return void this.setCurrentData(this.currentData,e);this.lock=!0,this._mdf=!1;var s,i=this.effectsSequence.length,a=t||this.currentData;for(s=0;s<i;s+=1)a=this.effectsSequence[s](a);this.setCurrentData(a,e),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}},L.prototype.getKeyframeValue=function(t){for(var e,s=this.data.d.k,i=this.elem.comp.renderedFrame,a=0,r=s.length;a<=r-1&&(e=s[a].s,!(a===r-1||s[a+1].t>i));)a+=1;return this.keysIndex!==a&&(t=e,this.keysIndex=a),t},L.prototype.buildFinalText=function(t){for(var e=ae.getCombinedCharacterCodes(),s=[],i=0,a=t.length;i<a;)e.indexOf(t.charCodeAt(i))!==-1?s[s.length-1]+=t.charAt(i):s.push(t.charAt(i)),i+=1;return s},L.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],v=0,y=0,b=o.getFontByName(t.f),_=0,k=b.fStyle?b.fStyle.split(" "):[],A="normal",M="normal";s=k.length;var P;for(e=0;e<s;e+=1)switch(P=k[e].toLowerCase()){case"italic":M="italic";break;case"bold":A="700";break;case"black":A="900";break;case"medium":A="500";break;case"regular":case"normal":A="400";break;case"light":case"thin":A="200"}t.fWeight=b.fWeight||A,t.fStyle=M,s=t.t.length,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),t.finalLineHeight=t.lh;var C=t.tr/1e3*t.finalSize;if(t.sz)for(var D,x,E=!0,F=t.sz[0],S=t.sz[1];E;){x=this.buildFinalText(t.t),D=0,v=0,s=x.length,C=t.tr/1e3*t.finalSize;var w=-1;for(e=0;e<s;e+=1)i=!1," "===x[e]?w=e:13===x[e].charCodeAt(0)&&(v=0,i=!0,D+=t.finalLineHeight||1.2*t.finalSize),o.chars?(h=o.getCharData(x[e],b.fStyle,b.fFamily),_=i?0:h.w*t.finalSize/100):_=o.measureText(x[e],t.f,t.finalSize),v+_>F&&" "!==x[e]?(w===-1?s+=1:e=w,D+=t.finalLineHeight||1.2*t.finalSize,x.splice(e,w===e?1:0,"\r"),w=-1,v=0):(v+=_,v+=C);D+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&S<D?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=x,s=t.finalText.length,E=!1)}v=-C,_=0;var T,I=0;for(e=0;e<s;e+=1)if(i=!1,T=t.finalText[e]," "===T?a="\xa0":13===T.charCodeAt(0)?(I=0,g.push(v),y=v>y?v:y,v=-2*C,a="",i=!0,u+=1):a=t.finalText[e],o.chars?(h=o.getCharData(T,b.fStyle,o.getFontByName(t.f).fFamily),_=i?0:h.w*t.finalSize/100):_=o.measureText(a,t.f,t.finalSize)," "===T?I+=_+C:(v+=_+C+I,I=0),p.push({l:_,an:_,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=_,""===a||"\xa0"===a||e===s-1){for(""!==a&&"\xa0"!==a||(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;f+=1,d=0}}else if(3==m){if(d+=_,""===a||e===s-1){for(""===a&&(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,y=v>y?v:y,g.push(v),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=y,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var L,z,R=l.a;n=R.length;var N,V,O=[];for(r=0;r<n;r+=1){for(L=R[r],L.a.sc&&(t.strokeColorAnim=!0),L.a.sw&&(t.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(t.fillColorAnim=!0),V=0,N=L.s.b,e=0;e<s;e+=1)z=p[e],z.anIndexes[r]=V,(1==N&&""!==z.val||2==N&&""!==z.val&&"\xa0"!==z.val||3==N&&(z.n||"\xa0"==z.val||e==s-1)||4==N&&(z.n||e==s-1))&&(1===L.s.rn&&O.push(V),V+=1);l.a[r].s.totalChars=V;var B,q=-1;if(1===L.s.rn)for(e=0;e<s;e+=1)z=p[e],q!=z.anIndexes[r]&&(q=z.anIndexes[r],B=O.splice(Math.floor(Math.random()*O.length),1)[0]),z.anIndexes[r]=B}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},L.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex===-1?0:this.keysIndex:e;var s=this.data.d.k[e].s;for(var i in t)s[i]=t[i];this.recalculate(e)},L.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=this.kf?-1:0,this._isFirstFrame=!0,this.getValue(e)},L.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex)},L.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex)};var de=function(){function t(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=re.getProp(t,e.s||{k:0},0,0,this),"e"in e?this.e=re.getProp(t,e.e,0,0,this):this.e={v:100},this.o=re.getProp(t,e.o||{k:0},0,0,this),this.xe=re.getProp(t,e.xe||{k:0},0,0,this),this.ne=re.getProp(t,e.ne||{k:0},0,0,this),this.a=re.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}function e(e,s,i){return new t(e,s,i)}var s=Math.max,i=Math.min,a=Math.floor;return t.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=ee.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get,r=0,n=this.finalS,h=this.finalE,o=this.data.sh;if(2==o)r=h===n?t>=h?1:0:s(0,i(.5/(h-n)+(t-n)/(h-n),1)),r=e(r);else if(3==o)r=h===n?t>=h?0:1:1-s(0,i(.5/(h-n)+(t-n)/(h-n),1)),r=e(r);else if(4==o)h===n?r=0:(r=s(0,i(.5/(h-n)+(t-n)/(h-n),1)),r<.5?r*=2:r=1-2*(r-.5)),r=e(r);else if(5==o){if(h===n)r=0;else{var l=h-n;t=i(s(0,t+.5-n),h-n);var p=-l/2+t,f=l/2;r=Math.sqrt(1-p*p/(f*f))}r=e(r)}else 6==o?(h===n?r=0:(t=i(s(0,t+.5-n),h-n),r=(1+Math.cos(Math.PI+2*Math.PI*t/(h-n)))/2),r=e(r)):(t>=a(n)&&(r=t-n<0?1-(n-t):s(0,i(h-t,1))),r=e(r));return r*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this._currentTextLength,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(i>a){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},b([y],t),{getTextSelectorProp:e}}(),ce=function(){return function(t,e,s,i){function a(){var t;return n?(n-=1,t=o[n]):t=e(),t}function r(t){n===h&&(o=ue["double"](o),h=2*h),s&&s(t),o[n]=t,n+=1}var n=0,h=t,o=u(h),l={newElement:a,release:r};return l}}(),ue=function(){function t(t){return t.concat(u(t.length))}return{"double":t}}(),ge=function(){function t(){return $t("float32",2)}return ce(8,t)}(),ve=function(){function t(){return new M}function e(t){var e,s=t._length;for(e=0;e<s;e+=1)ge.release(t.v[e]),ge.release(t.i[e]),ge.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}function s(t){var e,s=i.newElement(),a=void 0===t._length?t.v.length:t._length;s.setLength(a),s.c=t.c;for(e=0;e<a;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s}var i=ce(4,t,e);return i.clone=s,i}(),ye=function(){function t(){var t;return i?(i-=1,t=r[i]):t=new E,t}function e(t){var e,s=t._length;for(e=0;e<s;e+=1)ve.release(t.shapes[e]);t._length=0,i===a&&(r=ue["double"](r),a=2*a),r[i]=t,i+=1}var s={newShapeCollection:t,release:e},i=0,a=4,r=u(a);return s}(),be=function(){function t(){return{lengths:[],totalLength:0}}function e(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)_e.release(t.lengths[e]);t.lengths.length=0}return ce(8,t,e)}(),_e=function(){function t(){return{addedLength:0,percents:$t("float32",Ut),lengths:$t("float32",Ut)}}return ce(8,t)}();z.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;e>=0;e--)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},z.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t)}return this.createNull(t)},z.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},z.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},z.prototype.includeLayers=function(t){this.completeLayers=!1;var e,s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id==t[e].id){this.layers[s]=t[e];break}s+=1}},z.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},z.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},z.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&i[r]!==!0?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},z.prototype.addPendingElement=function(t){this.pendingElements.push(t)},z.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},b([z],R),R.prototype.createNull=function(t){return new $(t,this.globalData,this)},R.prototype.createShape=function(t){return new ot(t,this.globalData,this)},R.prototype.createText=function(t){return new ht(t,this.globalData,this)},R.prototype.createImage=function(t){return new at(t,this.globalData,this)},R.prototype.createComp=function(t){return new nt(t,this.globalData,this)},R.prototype.createSolid=function(t){return new rt(t,this.globalData,this)},R.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.nm=t.nm,this.globalData.compSize.w=t.w,this.globalData.compSize.h=t.h,this.globalData.frameRate=t.fr,this.data=t;var s=g("clipPath"),i=g("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a="animationMask_"+o(10);s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+qt+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.elements=u(t.layers.length)},R.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},R.prototype.updateContainerSize=function(){},R.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,Vt&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&this.elements[t-1]!==!0?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},R.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},R.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;e>=0;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},R.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&this.elements[a]!==!0&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},R.prototype.hide=function(){this.layerElement.style.display="none"},R.prototype.show=function(){this.layerElement.style.display="block"},N.prototype.getMaskProperty=function(t){return this.viewData[t].prop},N.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&(this.viewData[e].invRect.setAttribute("x",-s.props[12]),this.viewData[e].invRect.setAttribute("y",-s.props[13])),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+qt+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v));
+}},N.prototype.getMaskelement=function(){return this.maskElement},N.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},N.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&a>1&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},N.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},V.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},O.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){this.dynamicProperties.indexOf(t)===-1&&this.dynamicProperties.push(t)}},B.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?ne.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new te},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),11!==this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s=!0,i=this.comp;s;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):s=!1;var a,r,n=e.length;for(a=0;a<n;a+=1)r=e[a].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new te},q.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},function(){var t={initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide()},hide:function(){if(!this.hidden&&(!this.isInRange||this.isTransparent)){var t=this.baseElement||this.layerElement;t.style.display="none",this.hidden=!0}},show:function(){if(this.isInRange&&!this.isTransparent){if(!this.data.hd){var t=this.baseElement||this.layerElement;t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}};b([q,_(t)],j)}(),W.prototype.reset=function(){this.d="",this._mdf=!1},X.prototype.setAsAnimated=function(){this._isAnimated=!0},b([y],H),b([y],J),U.prototype.initGradientData=function(t,e,s){this.o=re.getProp(t,e.o,0,.01,this),this.s=re.getProp(t,e.s,1,null,this),this.e=re.getProp(t,e.e,1,null,this),this.h=re.getProp(t,e.h||{k:0},0,.01,this),this.a=re.getProp(t,e.a||{k:0},0,Zt,this),this.g=new S(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated},U.prototype.setGradientData=function(t,e){var s="gr_"+o(10),i=g(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",s),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var a,r,n,h=[];for(n=4*e.g.p,r=0;r<n;r+=4)a=g("stop"),i.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url(#"+s+")"),this.gf=i,this.cst=h},U.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var s,i,a,r=g("mask"),n=g("path");r.appendChild(n);var h="op_"+o(10),l="mk_"+o(10);r.setAttribute("id",l);var p=g(1===t.t?"linearGradient":"radialGradient");p.setAttribute("id",h),p.setAttribute("spreadMethod","pad"),p.setAttribute("gradientUnits","userSpaceOnUse"),a=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var f=this.stops;for(i=4*t.g.p;i<a;i+=2)s=g("stop"),s.setAttribute("stop-color","rgb(255,255,255)"),p.appendChild(s),f.push(s);n.setAttribute("gf"===t.ty?"fill":"stroke","url(#"+h+")"),this.of=p,this.ms=r,this.ost=f,this.maskId=l,e.msElem=n}},b([y],U),b([U,y],Z);var ke=function(){function t(t){t.ty;switch(t.ty){case"fl":return i;case"gf":return r;case"gs":return a;case"st":return n;case"sh":case"el":case"rc":case"sr":return s;case"tr":return e}}function e(t,e,s){(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function s(t,e,s){var i,a,r,n,l,p,f,m,d,c,u,g=e.styles.length,v=e.lvl;for(p=0;p<g;p+=1){if(n=e.sh._mdf||s,e.styles[p].lvl<v){for(m=o.reset(),c=v-e.styles[p].lvl,u=e.transformers.length-1;!n&&c>0;)n=e.transformers[u].mProps._mdf||n,c--,u--;if(n)for(c=v-e.styles[p].lvl,u=e.transformers.length-1;c>0;)d=e.transformers[u].mProps.v.props,m.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),c--,u--}else m=h;if(f=e.sh.paths,a=f._length,n){for(r="",i=0;i<a;i+=1)l=f.shapes[i],l&&l._length&&(r+=le(l,l._length,l.c,m));e.caches[p]=r}else r=e.caches[p];e.styles[p].d+=r,e.styles[p]._mdf=n||e.styles[p]._mdf}}function i(t,e,s){var i=e.style;(e.c._mdf||s)&&i.pElem.setAttribute("fill","rgb("+Yt(e.c.v[0])+","+Yt(e.c.v[1])+","+Yt(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function a(t,e,s){r(t,e,s),n(t,e,s)}function r(t,e,s){var i=e.gf,a=e.g._hasOpacity,r=e.s.v,n=e.e.v;if(e.o._mdf||s){var h="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(h,e.o.v)}if(e.s._mdf||s){var o=1===t.t?"x1":"cx",l="x1"===o?"y1":"cy";i.setAttribute(o,r[0]),i.setAttribute(l,r[1]),a&&!e.g._collapsable&&(e.of.setAttribute(o,r[0]),e.of.setAttribute(l,r[1]))}var p,f,m,d;if(e.g._cmdf||s){p=e.cst;var c=e.g.c;for(m=p.length,f=0;f<m;f+=1)d=p[f],d.setAttribute("offset",c[4*f]+"%"),d.setAttribute("stop-color","rgb("+c[4*f+1]+","+c[4*f+2]+","+c[4*f+3]+")")}if(a&&(e.g._omdf||s)){var u=e.g.o;for(p=e.g._collapsable?e.cst:e.ost,m=p.length,f=0;f<m;f+=1)d=p[f],e.g._collapsable||d.setAttribute("offset",u[2*f]+"%"),d.setAttribute("stop-opacity",u[2*f+1])}if(1===t.t)(e.e._mdf||s)&&(i.setAttribute("x2",n[0]),i.setAttribute("y2",n[1]),a&&!e.g._collapsable&&(e.of.setAttribute("x2",n[0]),e.of.setAttribute("y2",n[1])));else{var g;if((e.s._mdf||e.e._mdf||s)&&(g=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2)),i.setAttribute("r",g),a&&!e.g._collapsable&&e.of.setAttribute("r",g)),e.e._mdf||e.h._mdf||e.a._mdf||s){g||(g=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2)));var v=Math.atan2(n[1]-r[1],n[0]-r[0]),y=e.h.v>=1?.99:e.h.v<=-1?-.99:e.h.v,b=g*y,_=Math.cos(v+e.a.v)*b+r[0],k=Math.sin(v+e.a.v)*b+r[1];i.setAttribute("fx",_),i.setAttribute("fy",k),a&&!e.g._collapsable&&(e.of.setAttribute("fx",_),e.of.setAttribute("fy",k))}}}function n(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||s)&&a.dashStr&&(i.pElem.setAttribute("stroke-dasharray",a.dashStr),i.pElem.setAttribute("stroke-dashoffset",a.dashoffset[0])),e.c&&(e.c._mdf||s)&&i.pElem.setAttribute("stroke","rgb("+Yt(e.c.v[0])+","+Yt(e.c.v[1])+","+Yt(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||s)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}var h=new te,o=new te,l={createRenderFunction:t};return l}();Q.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&this.data.masksProperties[t].cl!==!1)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},blendModeEnums:{1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},getBlendMode:function(){return this.blendModeEnums[this.data.bm]||""},setBlendMode:function(){var t=this.getBlendMode(),e=this.baseElement||this.layerElement;e.style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId="ly_"+o(10),this.data.sr||(this.data.sr=1),this.effectsManager=new vt(this.data,this,this.dynamicProperties)},getType:function(){return this.type}},$.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},$.prototype.renderFrame=function(){},$.prototype.getBaseElement=function(){return null},$.prototype.destroy=function(){},$.prototype.sourceRectAtTime=function(){},$.prototype.hide=function(){},b([Q,B,V,O],$),tt.prototype={initRendererElement:function(){this.layerElement=g("g")},createContainerElements:function(){this.matteElement=g("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=g("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),fe.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=o(10),e=me.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(me.createAlphaToLuminanceFilter()),s=g("g"),s.appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+qt+"#"+t+")"))}else if(2==this.data.td){var r=g("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=g("g");r.appendChild(n),t=o(10),e=me.createFilter(t);var h=g("feColorMatrix");h.setAttribute("type","matrix"),h.setAttribute("color-interpolation-filters","sRGB"),h.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1"),e.appendChild(h),this.globalData.defs.appendChild(e);var l=g("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+qt+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,fe.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(me.createAlphaToLuminanceFilter()),s=g("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=g("clipPath"),f=g("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m="cp_"+o(8);if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=g("g");d.setAttribute("clip-path","url("+qt+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+qt+"#"+m+")")}0!==this.data.bm&&this.setBlendMode(),this.renderableEffectsManager=new gt(this)},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},addMasks:function(){this.maskManager=new N(this.data,this,this.globalData)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+qt+"#"+t+")")}},et.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=0,s=this.shapeModifiers.length;e<s;)if(this.shapeModifiers[e].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(e=this.shapeModifiers.length,t=e-1;t>=0;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"butt"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(i-=1,s[i].elem===t)return void(s[i].pos=e);s.push(new G(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},st.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new L(this,t.t,this.dynamicProperties),this.textAnimator=new w(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},st.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},st.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=le(i,i.i.length,!0,t);return r},st.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},st.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},st.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},st.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},st.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},st.prototype.emptyProp=new I,st.prototype.destroy=function(){},b([Q,B,V,O,j],it),it.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.addMasks(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},it.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=0;s<i;s+=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},it.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},it.prototype.setElements=function(t){this.elements=t},it.prototype.getElements=function(){return this.elements},it.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},it.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},b([Q,B,tt,V,O,j],at),at.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=g("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio","xMidYMid slice"),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},b([at],rt),rt.prototype.createContent=function(){var t=g("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},b([R,it,tt],nt),b([Q,B,tt,V,O,j,st],ht),ht.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=g("text"))},ht.prototype.buildTextContents=function(t){for(var e=0,s=t.length,i=[],a="";e<s;)t[e]===String.fromCharCode(13)?(i.push(a),a=""):a+=t[e],e+=1;return i.push(a),i},ht.prototype.buildNewText=function(){var t,e,s=this.textProperty.currentData;this.renderedLetters=u(s?s.l.length:0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",s.sw)),this.layerElement.setAttribute("font-size",s.finalSize);var i=this.globalData.fontManager.getFontByName(s.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var a=s.fWeight,r=s.fStyle;this.layerElement.setAttribute("font-style",r),this.layerElement.setAttribute("font-weight",a)}var n=s.l||[],h=this.globalData.fontManager.chars;if(e=n.length){var o,l,p=this.mHelper,f="",m=this.data.singleShape,d=0,c=0,v=!0,y=s.tr/1e3*s.finalSize;if(!m||h||s.sz){var b,_,k=this.textSpans.length;for(t=0;t<e;t+=1)h&&m&&0!==t||(o=k>t?this.textSpans[t]:g(h?"path":"text"),k<=t&&(o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=o,this.layerElement.appendChild(o)),o.style.display="inherit"),p.reset(),p.scale(s.finalSize/100,s.finalSize/100),m&&(n[t].n&&(d=-y,c+=s.yOffset,c+=v?1:0,v=!1),this.applyTextPropertiesToMatrix(s,p,n[t].line,d,c),d+=n[t].l||0,d+=y),h?(_=this.globalData.fontManager.getCharData(s.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily),b=_&&_.data||{},l=b.shapes?b.shapes[0].it:[],m?f+=this.createPathShape(p,l):o.setAttribute("d",this.createPathShape(p,l))):(m&&o.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),o.textContent=n[t].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&o.setAttribute("d",f)}else{var A=this.textContainer,M="start";switch(s.j){case 1:M="end";break;case 2:M="middle"}A.setAttribute("text-anchor",M),A.setAttribute("letter-spacing",y);var P=this.buildTextContents(s.finalText);for(e=P.length,c=s.ps?s.ps[1]+s.ascent:0,t=0;t<e;t+=1)o=this.textSpans[t]||g("tspan"),o.textContent=P[t],o.setAttribute("x",0),o.setAttribute("y",c),o.style.display="inherit",A.appendChild(o),this.textSpans[t]=o,c+=s.finalLineHeight;this.layerElement.appendChild(A)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0}},ht.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},ht.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){this._sizeChanged=!0;var t,e,s=this.textAnimator.renderedLetters,i=this.textProperty.currentData.l;e=i.length;var a,r;for(t=0;t<e;t+=1)i[t].n||(a=s[t],r=this.textSpans[t],a._mdf.m&&r.setAttribute("transform",a.m),a._mdf.o&&r.setAttribute("opacity",a.o),a._mdf.sw&&r.setAttribute("stroke-width",a.sw),a._mdf.sc&&r.setAttribute("stroke",a.sc),a._mdf.fc&&r.setAttribute("fill",a.fc))}},b([Q,B,tt,et,V,O,j],ot),ot.prototype.initSecondaryElement=function(){},ot.prototype.identityMatrix=new te,ot.prototype.buildExpressionInterface=function(){},ot.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},ot.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,n.length=0,t=0;t<a;t+=1)e=this.shapes[t],e.styles.indexOf(i)!==-1&&(n.push(e),h=e._isAnimated||h);n.length>1&&h&&this.setShapesAsAnimated(n)}},ot.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},ot.prototype.createStyleElement=function(t,e){var s,i=new W(t,e),a=i.pElem;if("st"===t.ty)s=new H(this,t,i);else if("fl"===t.ty)s=new J(this,t,i);else if("gf"===t.ty||"gs"===t.ty){var r="gf"===t.ty?U:Z;s=new r(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url(#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},ot.prototype.createGroupElement=function(t){var e=new K;return t.ln&&e.gr.setAttribute("id",t.ln),e},ot.prototype.createTransformElement=function(t,e){var s=ne.getTransformProperty(this,t,this),i=new Y(s,s.o,e);return this.addToAnimatedContents(t,i),i},ot.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=he.getShapeProp(this,t,i,this),r=new X(e,s,a);return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(t,r),r},ot.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:ke.createRenderFunction(t),element:e,data:t})},ot.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},ot.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},ot.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;h>=0;h-=1){if(m=this.searchProcessedElement(t[h]),m?e[h]=s[m-1]:t[h]._render=n,"fl"==t[h].ty||"st"==t[h].ty||"gf"==t[h].ty||"gs"==t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"==t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"==t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"==t[h].ty||"rc"==t[h].ty||"el"==t[h].ty||"sr"==t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"==t[h].ty||"rd"==t[h].ty||"ms"==t[h].ty?(m?(f=e[h],f.closed=!1):(f=oe.getModifier(t[h].ty),f.init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"==t[h].ty&&(m?(f=e[h],f.closed=!0):(f=oe.getModifier(t[h].ty),e[h]=f,f.init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},ot.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},ot.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&e.fn(e.data,e.element,this._isFirstFrame)},ot.prototype.destroy=function(){this.destroyBaseElement(),this.shapeData=null,this.itemsData=null},lt.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,s=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",s[0]-e[0]+" 0 0 0 "+e[0]+" "+(s[1]-e[1])+" 0 0 0 "+e[1]+" "+(s[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},pt.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,s=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+s+" 0")}},ft.prototype.initialize=function(){var t,e,s,i,a=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,s=0):(s=this.filterManager.effectElements[0].p.v-1,i=s+1),e=g("g"),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1),s;s<i;s+=1)t=g("path"),e.appendChild(t),this.paths.push({p:t,m:s});if(3===this.filterManager.effectElements[10].p.v){var r=g("mask"),n="stms_"+o(10);r.setAttribute("id",n),r.setAttribute("mask-type","alpha"),r.appendChild(e),this.elem.globalData.defs.appendChild(r);var h=g("g");h.setAttribute("mask","url("+qt+"#"+n+")"),a[0]&&h.appendChild(a[0]),this.elem.layerElement.appendChild(h),this.masker=r,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(a=this.elem.layerElement.children||this.elem.layerElement.childNodes;a.length;)this.elem.layerElement.removeChild(a[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},ft.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,s,i,a=this.paths.length;for(e=0;e<a;e+=1)if(this.paths[e].m!==-1&&(s=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager._mdf||s.prop._mdf)&&i.setAttribute("d",s.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||s.prop._mdf)){var r;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=i.getTotalLength();r="0 0 0 "+o*n+" ";var l,p=o*(h-n),f=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,m=Math.floor(p/f);for(l=0;l<m;l+=1)r+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";r+="0 "+10*o+" 0 0"}else r="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;i.setAttribute("stroke-dasharray",r)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var d=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+Yt(255*d[0])+","+Yt(255*d[1])+","+Yt(255*d[2])+")")}},mt.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,s=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,a=i[0]+" "+s[0]+" "+e[0],r=i[1]+" "+s[1]+" "+e[1],n=i[2]+" "+s[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",a),this.feFuncG.setAttribute("tableValues",r),this.feFuncB.setAttribute("tableValues",n);
+}},dt.prototype.createFeFunc=function(t,e){var s=g(t);return s.setAttribute("type","table"),e.appendChild(s),s},dt.prototype.getTableValue=function(t,e,s,i,a){for(var r,n,h=0,o=256,l=Math.min(t,e),p=Math.max(t,e),f=Array.call(null,{length:o}),m=0,d=a-i,c=e-t;h<=256;)r=h/256,n=r<=l?c<0?a:i:r>=p?c<0?i:a:i+d*Math.pow((r-t)/c,1/s),f[m++]=n,h+=256/(o-1);return f.join(" ")},dt.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,s=this.filterManager.effectElements;this.feFuncRComposed&&(t||s[3].p._mdf||s[4].p._mdf||s[5].p._mdf||s[6].p._mdf||s[7].p._mdf)&&(e=this.getTableValue(s[3].p.v,s[4].p.v,s[5].p.v,s[6].p.v,s[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||s[10].p._mdf||s[11].p._mdf||s[12].p._mdf||s[13].p._mdf||s[14].p._mdf)&&(e=this.getTableValue(s[10].p.v,s[11].p.v,s[12].p.v,s[13].p.v,s[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||s[17].p._mdf||s[18].p._mdf||s[19].p._mdf||s[20].p._mdf||s[21].p._mdf)&&(e=this.getTableValue(s[17].p.v,s[18].p.v,s[19].p.v,s[20].p.v,s[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||s[24].p._mdf||s[25].p._mdf||s[26].p._mdf||s[27].p._mdf||s[28].p._mdf)&&(e=this.getTableValue(s[24].p.v,s[25].p.v,s[26].p.v,s[27].p.v,s[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||s[31].p._mdf||s[32].p._mdf||s[33].p._mdf||s[34].p._mdf||s[35].p._mdf)&&(e=this.getTableValue(s[31].p.v,s[32].p.v,s[33].p.v,s[34].p.v,s[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},ct.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",Qt(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var s=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*Zt,a=s*Math.cos(i),r=s*Math.sin(i);this.feOffset.setAttribute("dx",a),this.feOffset.setAttribute("dy",r)}}};var Ae=[],Me=0;ut.prototype.findSymbol=function(t){for(var e=0,s=Ae.length;e<s;){if(Ae[e]===t)return Ae[e];e+=1}return null},ut.prototype.replaceInParent=function(t,e){var s=t.layerElement.parentNode;if(s){for(var i=s.children,a=0,r=i.length;a<r&&i[a]!==t.layerElement;)a+=1;var n;a<=r-2&&(n=i[a+1]);var h=g("use");h.setAttribute("href","#"+e),n?s.insertBefore(h,n):s.appendChild(h)}},ut.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var s="matte_"+o(5)+"_"+Me++,i=g("mask");i.setAttribute("id",e.layerId),i.setAttribute("mask-type","alpha"),Ae.push(e);var a=t.globalData.defs;a.appendChild(i);var r=g("symbol");r.setAttribute("id",s),this.replaceInParent(e,s),r.appendChild(e.layerElement),a.appendChild(r);var n=g("use");n.setAttribute("href","#"+s),i.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},ut.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=0,s=this.elem.comp.elements.length;e<s;)this.elem.comp.elements[e].data.ind===t&&this.setElementAsMask(this.elem,this.elem.comp.elements[e]),e+=1;this.initialized=!0},ut.prototype.renderFrame=function(){this.initialized||this.initialize()},gt.prototype.renderFrame=function(t){var e,s=this.filters.length;for(e=0;e<s;e+=1)this.filters[e].renderFrame(t)};var Pe=function(){function e(t){for(var e=0,s=t.target;e<P;)A[e].animation===s&&(A.splice(e,1),e-=1,P-=1,s.isPaused||a()),e+=1}function s(t,e){if(!t)return null;for(var s=0;s<P;){if(A[s].elem==t&&null!==A[s].elem)return A[s].animation;s+=1}var i=new Ce;return r(i,t),i.setData(t,e),i}function i(){D+=1,_()}function a(){D-=1,0===D&&(C=!0)}function r(t,s){t.addEventListener("destroy",e),t.addEventListener("_active",i),t.addEventListener("_idle",a),A.push({elem:s,animation:t}),P+=1}function n(t){var e=new Ce;return r(e,null),e.setParams(t),e}function h(t,e){var s;for(s=0;s<P;s+=1)A[s].animation.setSpeed(t,e)}function o(t,e){var s;for(s=0;s<P;s+=1)A[s].animation.setDirection(t,e)}function l(t){var e;for(e=0;e<P;e+=1)A[e].animation.play(t)}function p(e){var s,i=e-M;for(s=0;s<P;s+=1)A[s].animation.advanceTime(i);M=e,C?x=!0:t.requestAnimationFrame(p)}function f(e){M=e,t.requestAnimationFrame(p)}function m(t){var e;for(e=0;e<P;e+=1)A[e].animation.pause(t)}function d(t,e,s){var i;for(i=0;i<P;i+=1)A[i].animation.goToAndStop(t,e,s)}function c(t){var e;for(e=0;e<P;e+=1)A[e].animation.stop(t)}function u(t){var e;for(e=0;e<P;e+=1)A[e].animation.togglePause(t)}function g(t){var e;for(e=P-1;e>=0;e-=1)A[e].animation.destroy(t)}function y(t,e,i){var a,r=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),n=r.length;for(a=0;a<n;a+=1)i&&r[a].setAttribute("data-bm-type",i),s(r[a],t);if(e&&0===n){i||(i="svg");var h=document.getElementsByTagName("body")[0];h.innerHTML="";var o=v("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),h.appendChild(o),s(o,t)}}function b(){var t;for(t=0;t<P;t+=1)A[t].animation.resize()}function _(){C&&(C=!1,x&&(t.requestAnimationFrame(f),x=!1))}var k={},A=[],M=0,P=0,C=!0,D=0,x=!0;return k.registerAnimation=s,k.loadAnimation=n,k.setSpeed=h,k.setDirection=o,k.play=l,k.pause=m,k.stop=c,k.togglePause=u,k.searchAnimations=y,k.resize=b,k.goToAndStop=d,k.destroy=g,k}(),Ce=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.pendingElements=0,this.playCount=0,this.animationData={},this.layers=[],this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=o(10),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.subframeEnabled=Gt,this.segments=[],this._idle=!0,this.projectInterface=e()};b([c],Ce),Ce.prototype.setParams=function(t){var e=this;t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var s=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(s){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new R(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}if(this.renderer.setProjectInterface(this.projectInterface),this.animType=s,""===t.loop||null===t.loop||(t.loop===!1?this.loop=!1:t.loop===!0?this.loop=!0:this.loop=parseInt(t.loop)),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,t.animationData)e.configAnimation(t.animationData);else if(t.path){"json"!=t.path.substr(-4)&&("/"!=t.path.substr(-1,1)&&(t.path+="/"),t.path+="data.json");var i=new XMLHttpRequest;t.path.lastIndexOf("\\")!=-1?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),i.open("GET",t.path,!0),i.send(),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status)e.configAnimation(JSON.parse(i.responseText));else try{var t=JSON.parse(i.responseText);e.configAnimation(t)}catch(s){}}}},Ce.prototype.setData=function(t,e){var s={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===a||("false"===a?s.loop=!1:"true"===a?s.loop=!0:s.loop=parseInt(a));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"";var n=i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"";"false"===n&&(s.prerender=!1),this.setParams(s)},Ce.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip),this.animationData.tf=this.totalFrames);var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id==r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,ie.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),Vt&&Vt.initExpressions(this),this.renderer.renderFrame(-1),this.loadNextSegment()},Ce.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.animationData.tf);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=new XMLHttpRequest,i=this,a=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,s.open("GET",a,!0),s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i.includeLayers(JSON.parse(s.responseText));else try{var t=JSON.parse(s.responseText);i.includeLayers(t)}catch(e){}}},Ce.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.animationData.tf),this.loadNextSegment()},Ce.prototype.configAnimation=function(t){var e=this;this.renderer&&(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.animationData.tf=this.totalFrames,this.renderer.configAnimation(t),t.assets||(t.assets=[]),t.comps&&(t.assets=t.assets.concat(t.comps),t.comps=null),this.renderer.searchExtraCompositions(t.assets),this.layers=this.animationData.layers,this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.trigger("config_ready"),this.imagePreloader=new pe,this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(t.assets,function(t){t||e.trigger("loaded_images")}),this.loadSegments(),this.updaFrameModifier(),this.renderer.globalData.fontManager?this.waitForFontsLoaded():(ie.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()))},Ce.prototype.waitForFontsLoaded=function(){function t(){this.renderer.globalData.fontManager.loaded?(ie.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded()):setTimeout(t.bind(this),20)}return function(){t.bind(this)()}}(),Ce.prototype.addPendingElement=function(){this.pendingElements+=1},Ce.prototype.elementLoaded=function(){this.pendingElements--,this.checkLoaded()},Ce.prototype.checkLoaded=function(){0===this.pendingElements&&(Vt&&Vt.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.isLoaded=!0,this.gotoFrame(),this.autoplay&&this.play())},Ce.prototype.resize=function(){this.renderer.updateContainerSize()},Ce.prototype.setSubframe=function(t){this.subframeEnabled=!!t},Ce.prototype.gotoFrame=function(){this.currentFrame=this.subframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},Ce.prototype.renderFrame=function(){this.isLoaded!==!1&&this.renderer.renderFrame(this.currentFrame+this.firstFrame)},Ce.prototype.play=function(t){t&&this.name!=t||this.isPaused===!0&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger("_active")))},Ce.prototype.pause=function(t){t&&this.name!=t||this.isPaused===!1&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"))},Ce.prototype.togglePause=function(t){t&&this.name!=t||(this.isPaused===!0?this.play():this.pause())},Ce.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this.setCurrentRawFrameValue(0))},Ce.prototype.goToAndStop=function(t,e,s){s&&this.name!=s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},Ce.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},Ce.prototype.advanceTime=function(t){if(this.isPaused!==!0&&this.isLoaded!==!1){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e%this.totalFrames)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&this.loop!==!0?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},Ce.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},Ce.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,s!==-1&&this.goToAndStop(s,!0)},Ce.prototype.playSegments=function(t,e){if("object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);e&&this.checkSegments(0),this.isPaused&&this.play()},Ce.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},Ce.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},Ce.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},Ce.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},Ce.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},Ce.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},Ce.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection},Ce.prototype.getPath=function(){return this.path},Ce.prototype.getAssetsPath=function(t){var e="";if(this.assetsPath){var s=t.p;s.indexOf("images/")!==-1&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},Ce.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t==this.assets[e].id)return this.assets[e];e+=1}},Ce.prototype.hide=function(){this.renderer.hide()},Ce.prototype.show=function(){this.renderer.show()},Ce.prototype.getAssets=function(){return this.assets},Ce.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},Ce.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new i(t,this.currentFrame,this.totalFrames,this.frameMult));break;case"loopComplete":this.triggerEvent(t,new r(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new a(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new n(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new h(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new i(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new r(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new a(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new n(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new h(t,this))};var De={};De.play=bt,De.pause=_t,De.setLocationHref=yt,De.togglePause=kt,De.setSpeed=At,De.setDirection=Mt,De.stop=Pt,De.searchAnimations=Ct,De.registerAnimation=Dt,De.loadAnimation=St,De.setSubframeRendering=Ft,De.resize=xt,De.goToAndStop=Et,De.destroy=wt,De.setQuality=Tt,De.inBrowser=It,De.installPlugin=Lt,De.__getFactory=zt,De.version="5.1.13";var xe="__[STANDALONE]__",Ee="__[ANIMATIONDATA]__",Fe="";if(xe){var Se=document.getElementsByTagName("script"),we=Se.length-1,Te=Se[we]||{src:""},Ie=Te.src.replace(/^[^\?]+\??/,"");Fe=Nt("renderer")}var Le=setInterval(Rt,100);return De});
\ No newline at end of file
diff --git a/demo/adrock/index.html b/demo/adrock/index.html
index acaa39c..1b9fbac 100644
--- a/demo/adrock/index.html
+++ b/demo/adrock/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html style="width: 100%;height: 100%">
 <head>
-     <script src="../bodymovin.js"></script>
+     <script src="../../build/player/lottie.js"></script>
 </head>
 <body style="background-color:#ccc; margin: 0px;height: 100%;">
 
diff --git a/demo/bodymovin/index.html b/demo/bodymovin/index.html
index 51d13db..aaef629 100644
--- a/demo/bodymovin/index.html
+++ b/demo/bodymovin/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html style="width: 100%;height: 100%">
 <head>
-     <script src="../bodymovin.js"></script>
+     <script src="../../build/player/lottie.js"></script>
 </head>
 <body style="background-color:#ccc; margin: 0px;height: 100%; font-family: sans-serif;font-size: 10px">
 
diff --git a/demo/gatin/index.html b/demo/gatin/index.html
index d9f4db6..a43032d 100644
--- a/demo/gatin/index.html
+++ b/demo/gatin/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html style="width: 100%;height: 100%">
 <head>
-     <script src="../bodymovin.js"></script>
+     <script src="../../build/player/lottie.js"></script>
 </head>
 <body style="background-color:#ccc; margin: 0px;height: 100%; font-family: sans-serif;font-size: 10px">
 
diff --git a/demo/grunt/index.html b/demo/grunt/index.html
index a026ebc..d407020 100644
--- a/demo/grunt/index.html
+++ b/demo/grunt/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html style="width: 100%;height: 100%">
 <head>
-     <script src="../bodymovin.js"></script>
+     <script src="../../build/player/lottie.js"></script>
      <script src="data.js"></script>
 </head>
 <body style="background-color:#ccc; margin: 0px;height: 100%;overflow: hidden">
diff --git a/demo/happy2016/index.html b/demo/happy2016/index.html
index 51d13db..aaef629 100644
--- a/demo/happy2016/index.html
+++ b/demo/happy2016/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html style="width: 100%;height: 100%">
 <head>
-     <script src="../bodymovin.js"></script>
+     <script src="../../build/player/lottie.js"></script>
 </head>
 <body style="background-color:#ccc; margin: 0px;height: 100%; font-family: sans-serif;font-size: 10px">
 
diff --git a/demo/navidad/index.html b/demo/navidad/index.html
index 8d39eb5..c0f18e8 100644
--- a/demo/navidad/index.html
+++ b/demo/navidad/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html style="width: 100%;height: 100%">
 <head>
-     <script src="../bodymovin.js"></script>
+     <script src="../../build/player/lottie.js"></script>
 </head>
 <body style="background-color:#ccc; margin: 0;height: 100%;">
 
diff --git a/gifs/Community 2_3.gif b/gifs/Community 2_3.gif
new file mode 100644
index 0000000..122e921
--- /dev/null
+++ b/gifs/Community 2_3.gif
Binary files differ
diff --git a/gifs/Example1.gif b/gifs/Example1.gif
new file mode 100644
index 0000000..a3c7e46
--- /dev/null
+++ b/gifs/Example1.gif
Binary files differ
diff --git a/gifs/Example2.gif b/gifs/Example2.gif
new file mode 100644
index 0000000..46823b7
--- /dev/null
+++ b/gifs/Example2.gif
Binary files differ
diff --git a/gifs/Example3.gif b/gifs/Example3.gif
new file mode 100644
index 0000000..552882d
--- /dev/null
+++ b/gifs/Example3.gif
Binary files differ
diff --git a/gifs/Example4.gif b/gifs/Example4.gif
new file mode 100644
index 0000000..e5c9f08
--- /dev/null
+++ b/gifs/Example4.gif
Binary files differ
diff --git a/gulpfile.js b/gulpfile.js
index e09deb5..f32d755 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -16,8 +16,11 @@
 var htmlreplace = require('gulp-html-replace');
 var eventstream = require("event-stream");
 var jslint = require('gulp-jslint');
+var through = require('through2');
+var replace = require('gulp-replace');
+var batch_replace = require('gulp-batch-replace');
 
-var bm_version = '4.6.10';
+var bm_version = '5.1.13';
 
 var files = [
     {
@@ -26,11 +29,17 @@
     }
 ]
 
-                  //(function (root, factory) { if(typeof define === "function" && define.amd) { define( factory); } else if(typeof module === "object" && module.exports) { module.exports = factory(); } else { root.bodymovin = factory(); } }(window, function() {<%= contents %>var bodymovinjs = {}; function play(animation){ animationManager.play(animation); } function pause(animation){ animationManager.pause(animation); } function togglePause(animation){ animationManager.togglePause(animation); } function setSpeed(value,animation){ animationManager.setSpeed(value, animation); } function setDirection(value,animation){ animationManager.setDirection(value, animation); } function stop(animation){ animationManager.stop(animation); } function moveFrame(value){ animationManager.moveFrame(value); } function searchAnimations(){ if(standalone === true){ animationManager.searchAnimations(animationData,standalone, renderer); }else{ animationManager.searchAnimations(); } } function registerAnimation(elem){ return animationManager.registerAnimation(elem); } function resize(){ animationManager.resize(); } function start(){ animationManager.start(); } function goToAndStop(val,isFrame, animation){ animationManager.goToAndStop(val,isFrame, animation); } function setSubframeRendering(flag){ subframeEnabled = flag; } function loadAnimation(params){ if(standalone === true){ params.animationData = JSON.parse(animationData); } return animationManager.loadAnimation(params); } function destroy(animation){ return animationManager.destroy(animation); } function setQuality(value){ if(typeof value === 'string'){ switch(value){ case 'high': defaultCurveSegments = 200; break; case 'medium': defaultCurveSegments = 50; break; case 'low': defaultCurveSegments = 10; break; } }else if(!isNaN(value) && value > 1){ defaultCurveSegments = value; } if(defaultCurveSegments >= 50){ roundValues(false); }else{ roundValues(true); } } function installPlugin(type,plugin){ if(type==='expressions'){ expressionsPlugin = plugin; } } function getFactory(name){ if(name === 'propertyFactory'){ return PropertyFactory; } } bodymovinjs.play = play; bodymovinjs.pause = pause; bodymovinjs.togglePause = togglePause; bodymovinjs.setSpeed = setSpeed; bodymovinjs.setDirection = setDirection; bodymovinjs.stop = stop; bodymovinjs.moveFrame = moveFrame; bodymovinjs.searchAnimations = searchAnimations; bodymovinjs.registerAnimation = registerAnimation; bodymovinjs.loadAnimation = loadAnimation; bodymovinjs.setSubframeRendering = setSubframeRendering; bodymovinjs.resize = resize; bodymovinjs.start = start; bodymovinjs.goToAndStop = goToAndStop; bodymovinjs.destroy = destroy; bodymovinjs.setQuality = setQuality; bodymovinjs.installPlugin = installPlugin; bodymovinjs.__getFactory = getFactory; bodymovinjs.version = '4.1.9'; function checkReady(){ if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); searchAnimations(); } } function getQueryVariable(variable) { var vars = queryString.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } } var standalone = '__[STANDALONE]__'; var animationData = '__[ANIMATIONDATA]__'; var renderer = ''; if(standalone) { var scripts = document.getElementsByTagName('script'); var index = scripts.length - 1; var myScript = scripts[index]; var queryString = myScript.src.replace(/^[^\?]+\??/,''); renderer = getQueryVariable('renderer'); } var readyStateCheckInterval = setInterval(checkReady, 100); return bodymovinjs; }));
-  var moduleWrap = '(function (root, factory) { if(typeof define === "function" && define.amd) { define( factory); } else if(typeof module === "object" && module.exports) { module.exports = factory(); } else { root.bodymovin = factory(); } }(window, function() {<%= contents %>var bodymovinjs = {}; function play(animation){ animationManager.play(animation); } function pause(animation){ animationManager.pause(animation); } function togglePause(animation){ animationManager.togglePause(animation); } function setSpeed(value,animation){ animationManager.setSpeed(value, animation); } function setDirection(value,animation){ animationManager.setDirection(value, animation); } function stop(animation){ animationManager.stop(animation); } function moveFrame(value){ animationManager.moveFrame(value); } function searchAnimations(){ if(standalone === true){ animationManager.searchAnimations(animationData,standalone, renderer); }else{ animationManager.searchAnimations(); } } function registerAnimation(elem){ return animationManager.registerAnimation(elem); } function resize(){ animationManager.resize(); } function start(){ animationManager.start(); } function goToAndStop(val,isFrame, animation){ animationManager.goToAndStop(val,isFrame, animation); } function setSubframeRendering(flag){ subframeEnabled = flag; } function loadAnimation(params){ if(standalone === true){ params.animationData = JSON.parse(animationData); } return animationManager.loadAnimation(params); } function destroy(animation){ return animationManager.destroy(animation); } function setQuality(value){ if(typeof value === \'string\'){ switch(value){ case \'high\': defaultCurveSegments = 200; break; case \'medium\': defaultCurveSegments = 50; break; case \'low\': defaultCurveSegments = 10; break; } }else if(!isNaN(value) && value > 1){ defaultCurveSegments = value; } if(defaultCurveSegments >= 50){ roundValues(false); }else{ roundValues(true); } } function installPlugin(type,plugin){ if(type===\'expressions\'){ expressionsPlugin = plugin; } } function getFactory(name){ switch(name){ case "propertyFactory": return PropertyFactory;case "shapePropertyFactory": return ShapePropertyFactory; case "matrix": return Matrix; } } bodymovinjs.play = play; bodymovinjs.pause = pause; bodymovinjs.togglePause = togglePause; bodymovinjs.setSpeed = setSpeed; bodymovinjs.setDirection = setDirection; bodymovinjs.stop = stop; bodymovinjs.moveFrame = moveFrame; bodymovinjs.searchAnimations = searchAnimations; bodymovinjs.registerAnimation = registerAnimation; bodymovinjs.loadAnimation = loadAnimation; bodymovinjs.setSubframeRendering = setSubframeRendering; bodymovinjs.resize = resize; bodymovinjs.start = start; bodymovinjs.goToAndStop = goToAndStop; bodymovinjs.destroy = destroy; bodymovinjs.setQuality = setQuality; bodymovinjs.installPlugin = installPlugin; bodymovinjs.__getFactory = getFactory; bodymovinjs.version = \''+bm_version+'\'; function checkReady(){ if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); searchAnimations(); } } function getQueryVariable(variable) { var vars = queryString.split(\'&\'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split(\'=\'); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } } var standalone = \'__[STANDALONE]__\'; var animationData = \'__[ANIMATIONDATA]__\'; var renderer = \'\'; if(standalone) { var scripts = document.getElementsByTagName(\'script\'); var index = scripts.length - 1; var myScript = scripts[index] || { src: \'\' }; var queryString = myScript.src.replace(/^[^\\?]+\\??/,\'\'); renderer = getQueryVariable(\'renderer\'); } var readyStateCheckInterval = setInterval(checkReady, 100); return bodymovinjs; }));  ';
-//var moduleWrap = '(function (root, factory) { if(typeof define === "function" && define.amd) { define( factory); } else if(typeof module === "object" && module.exports) { module.exports = factory(); } else { root.bodymovin = factory(); } }(window, function() {<%= contents %>var bodymovinjs = {}; function play(animation){ animationManager.play(animation); } function pause(animation){ animationManager.pause(animation); } function togglePause(animation){ animationManager.togglePause(animation); } function setSpeed(value,animation){ animationManager.setSpeed(value, animation); } function setDirection(value,animation){ animationManager.setDirection(value, animation); } function stop(animation){ animationManager.stop(animation); } function moveFrame(value){ animationManager.moveFrame(value); } function searchAnimations(){ if(standalone === true){ animationManager.searchAnimations(animationData,standalone, renderer); }else{ animationManager.searchAnimations(); } } function registerAnimation(elem){ return animationManager.registerAnimation(elem); } function resize(){ animationManager.resize(); } function start(){ animationManager.start(); } function goToAndStop(val,isFrame, animation){ animationManager.goToAndStop(val,isFrame, animation); } function setSubframeRendering(flag){ subframeEnabled = flag; } function loadAnimation(params){ if(standalone === true){ params.animationData = JSON.parse(animationData); } return animationManager.loadAnimation(params); } function destroy(animation){ return animationManager.destroy(animation); } function setQuality(value){ if(typeof value === \'string\'){ switch(value){ case \'high\': defaultCurveSegments = 200; break; case \'medium\': defaultCurveSegments = 50; break; case \'low\': defaultCurveSegments = 10; break; } }else if(!isNaN(value) && value > 1){ defaultCurveSegments = value; } if(defaultCurveSegments >= 50){ roundValues(false); }else{ roundValues(true); } } bodymovinjs.play = play; bodymovinjs.pause = pause; bodymovinjs.togglePause = togglePause; bodymovinjs.setSpeed = setSpeed; bodymovinjs.setDirection = setDirection; bodymovinjs.stop = stop; bodymovinjs.moveFrame = moveFrame; bodymovinjs.searchAnimations = searchAnimations; bodymovinjs.registerAnimation = registerAnimation; bodymovinjs.loadAnimation = loadAnimation; bodymovinjs.setSubframeRendering = setSubframeRendering; bodymovinjs.resize = resize; bodymovinjs.start = start; bodymovinjs.goToAndStop = goToAndStop; bodymovinjs.destroy = destroy; bodymovinjs.setQuality = setQuality; bodymovinjs.version = \''+bm_version+'\'; function checkReady(){ if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); searchAnimations(); } } function getQueryVariable(variable) { var vars = queryString.split(\'&\'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split(\'=\'); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } } var standalone = \'__[STANDALONE]__\'; var animationData = \'__[ANIMATIONDATA]__\'; var renderer = \'\'; if(standalone) { var scripts = document.getElementsByTagName(\'script\'); var index = scripts.length - 1; var myScript = scripts[index]; var queryString = myScript.src.replace(/^[^\\?]+\\??/,\'\'); renderer = getQueryVariable(\'renderer\'); } var readyStateCheckInterval = setInterval(checkReady, 100); return bodymovinjs; })); ';
+function customMinify(value) {
+    console.log(value);
+    return value;
+}
+
+var moduleWrap = fs.readFileSync("player/js/module.js", "utf8");
+moduleWrap = moduleWrap.replace('/*<%= contents %>*/','<%= contents %>');
+moduleWrap = moduleWrap.replace('[[BM_VERSION]]',bm_version);
+
 gulp.task('gzipFile', function(){
-  gulp.src('build/player/bodymovin.min.js')
+  gulp.src('player/exports/render/data.json')
     .pipe(gzip({ append: false }))
     .pipe(gulp.dest('demo/'));
 });
@@ -55,7 +64,7 @@
     gulp.src('./player/index.html')
         //.pipe(wrap('(function(window){"use strict";<%= contents %>}(window));'))
         .pipe(wrap(moduleWrap))
-        .pipe(gulp.dest('build/player/bodymovin.min.js'));
+        .pipe(gulp.dest('build/player/lottie.min.js'));
 });
 
 gulp.task('zipPlayer',['buildPlayer','buildUnminifiedPlayer'], function(){
@@ -72,7 +81,7 @@
 var srcs = [];
 
 var demoBuiltData = '';
-var uglifyOptions = {output: {ascii_only:true}};
+var uglifyOptions = {output: {ascii_only:true},toplevel:true};
 
 
 gulp.task('getBuildSources', function(cb) {
@@ -120,39 +129,178 @@
     return buildVersion(['data-skip']);
 });
 
+gulp.task('buildSources', function() {
+    return buildVersion(['data-skip']);
+});
+
 gulp.task('buildLightSources', function() {
     return buildVersion(['data-skip','data-light-skip']);
 });
 
 gulp.task('buildLight',['buildLightSources'], function() {
     return gulp.src(srcs)
-        .pipe(concat('bodymovin_light.js'))
+        .pipe(concat('lottie_light.js'))
         .pipe(wrap(moduleWrap))
+        //.pipe(batch_replace(replacingMap))
         .pipe(gulp.dest('build/player/'));
 });
 
 gulp.task('buildLightMin',['buildLightSources'], function() {
     return gulp.src(srcs)
-        .pipe(concat('bodymovin_light.min.js'))
+        .pipe(concat('lottie_light.min.js'))
         .pipe(wrap(moduleWrap))
         .pipe(uglify(uglifyOptions))
+        //.pipe(batch_replace(replacingMap))
         .pipe(gulp.dest('build/player/'));
 });
 
 gulp.task('buildFullMin',['buildSources'], function() {
     return gulp.src(srcs)
-        .pipe(concat('bodymovin.min.js'))
+        .pipe(concat('lottie.min.js'))
         .pipe(wrap(moduleWrap))
         .pipe(uglify(uglifyOptions))
+        //.pipe(batch_replace(replacingMap))
         .pipe(gulp.dest('build/player/'));
 });
 
 gulp.task('buildFull',['buildSources'], function() {
     return gulp.src(srcs)
-        .pipe(concat('bodymovin.js'))
+        .pipe(concat('lottie.js'))
         .pipe(wrap(moduleWrap))
+        //.pipe(batch_replace(replacingMap))
         .pipe(gulp.dest('build/player/'));
 });
 
 gulp.task('buildAll',['buildLightMin','buildLight','buildFullMin','buildFull'], function() {
+});
+
+var replacingMap = [
+    ['AnimationItem', '_a'],
+    ['HBaseElement', '_b'],
+    ['CVBaseElement', '_c'],
+    ['SVGBaseElement', '_d'],
+    ['BaseElement', '_e'],
+    ['IShapeElement', '_f'],
+    ['ICompElement', '_g'],
+    ['IImageElement', '_h'],
+    ['NullElement', '_i'],
+    ['ISolidElement', '_j'],
+    ['ITextElement', '_k'],
+    ['BaseRenderer', '_l'],
+    ['BaseRenderer', '_l'],
+    ['CVCompElement', '_m'],
+    ['CVContextData', '_n'],
+    ['CVEffects', '_o'],
+    ['CVImageElement', '_p'],
+    ['CVMaskElement', '_q'],
+    ['CVShapeElement', '_r'],
+    ['CVSolidElement', '_s'],
+    ['CVTextElement', '_t'],
+    ['HBaseElement', '_u'],
+    ['HCameraElement', '_v'],
+    ['globalData', '_x'],
+    ['HCompElement', '_w'],
+    ['HImageElement', '_y'],
+    ['HShapeElement', '_z'],
+    ['HSolidElement', '_aa'],
+    ['HTextElement', '_ab'],
+    ['FrameElement', '_ac'],
+    ['HierarchyElement', '_ad'],
+    ['RenderableElement', '_ae'],
+    ['createTransformElement', '_cp'],
+    ['TransformElement', '_af'],
+    ['TransformPropertyFactory', '_ag'],
+    ['ShapePropertyFactory', '_ah'],
+    ['PropertyFactory', '_ai'],
+    ['RepeaterModifier', '_aj'],
+    ['localShapeCollection', '_ak'],
+    ['newShapeCollection', '_al'],
+    ['ShapeCollection', '_am'],
+    ['TrimModifier', '_an'],
+    ['SVGRenderer', '_ao'],
+    ['HybridRenderer', '_ap'],
+    ['CanvasRenderer', '_aq'],
+    ['TextProperty', '_ar'],
+    ['ShapeModifiers', '_as'],
+    ['ShapeModifier', '_at'],
+    ['RoundCornersModifier', '_au'],
+    ['ShapePath', '_av'],
+    ['setTripleAt', '_aw'],
+    ['setXYAt', '_ax'],
+    ['MaskElement', '_ay'],
+    ['prepareFrame', '_az'],
+    ['renderFrame', '_ba'],
+    ['SVGTintFilter', '_bb'],
+    ['SVGFillFilter', '_bc'],
+    ['SVGStrokeEffect', '_bd'],
+    ['SVGTritoneFilter', '_be'],
+    ['SVGProLevelsFilter', '_bf'],
+    ['SVGDropShadowEffect', '_bg'],
+    ['SVGMatte3Effect', '_bh'],
+    ['SVGEffects', '_bi'],
+    ['getTransformProperty', '_bj'],
+    ['TransformProperty', '_bk'],
+    ['TextAnimatorProperty', '_bl'],
+    ['textAnimator_animatables', '_bn'],
+    ['getProp', '_bo'],
+    ['getShapeProp', '_bp'],
+    ['_elements', '_bq'],
+    ['elements', '_br'],
+    ['renderedLettersCount', '_bs'],
+    ['renderedLetters', '_bt'],
+    ['renderedLetter', '_bu'],
+    ['HEffects', '_bv'],
+    ['layerElementParent', '_bw'],
+    ['layerElement', '_bx'],
+    ['baseElement', '_by'],
+    ['transformedElement', '_bz'],
+    ['maskedElement', '_ca'],
+    ['innerElemStyle', '_cb'],
+    ['innerElem', '_cc'],
+    ['_thisLayerFunction', '_cd'],
+    ['setGroupProperty', '_ce'],
+    ['svgElement', '_cf'],
+    ['currentBBox', '_cg'],
+    ['firstFrame', '_ch'],
+    ['RenderableDOMElement', '_ci'],
+    ['SVGGradientStrokeStyleData', '_cj'],
+    ['SVGGradientFillStyleData', '_ck'],
+    ['filterManager', '_cl'],
+    ['effectElements', '_cm'],
+    ['applyToPointArray', '_cn'],
+    ['dynamicProperties', '_co'],
+    ['animationItem', '_cq'],
+    ['fontManager', '_cr'],
+    ['createTypedArray', '_cs'],
+    ['createNS', '_ct'],
+    ['createTag', '_cu'],
+    ['createSizedArray', '_cv'],
+    ['SVGTextElement', '_cw'],
+    ['transformCanvas', '_cx'],
+    ['triggerEvent', '_cy'],
+    ['initElement', '_cz'],
+    ['canvasContext', '_da'],
+    ['completeLayers', '_db'],
+    ['pendingElements', '_dc'],
+    ['hierarchy', '_dd'],
+    ['compSize', '_de'],
+    ['keyframes', '_df'],
+    ['getValueAtTime', '_dg'],
+    ['\'float32\'', '\'_f3\''],
+    ['"float32"', '\'_f3\''],
+    ['renderedFrame', '_dh'],
+    ['offsetTime', '_di'],
+    ['stylesList', '_dj'],
+]
+
+gulp.task('buildTest',['buildSources'], function() {
+    return gulp.src(srcs)
+        .pipe(concat('lottie.js'))
+        .pipe(wrap(moduleWrap))
+        .pipe(batch_replace(replacingMap))
+        /*.pipe(through.obj(function (chunk, enc, cb) {
+            console.log(chunk.contents.toString('utf8')) // this should log now
+            cb(null, chunk)
+          }))*/
+        .pipe(gulp.dest('player/'));
 });
\ No newline at end of file
diff --git a/package.json b/package.json
index 7f04af2..8c96f7e 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,14 @@
 {
-  "name": "bodymovin",
-  "version": "4.6.10",
+  "name": "lottie-web",
+  "version": "5.1.13",
   "description": "After Effects plugin for exporting animations to SVG + JavaScript or canvas + JavaScript",
-  "main": "./build/player/bodymovin.js",
+  "main": "./build/player/lottie.js",
   "repository": {
     "type": "git",
-    "url": "https://github.com/bodymovin/bodymovin.git"
+    "url": "https://github.com/airbnb/lottie-web.git"
+  },
+  "scripts": {
+    "start": "gulp buildAll"
   },
   "keywords": [
     "animation",
@@ -19,10 +22,13 @@
     "event-stream": "^3.3.4",
     "events-stream": "^0.2.0",
     "gulp": "^3.9.0",
+    "gulp-batch-replace": "0.0.0",
+    "gulp-cheerio": "^0.6.2",
     "gulp-concat": "^2.6.0",
     "gulp-gzip": "^1.2.0",
     "gulp-html-replace": "^1.6.1",
     "gulp-jshint": "^1.11.2",
+    "gulp-jslint": "^1.0.10",
     "gulp-jsoncombine": "^1.0.3",
     "gulp-rename": "^1.2.2",
     "gulp-replace": "^0.5.4",
@@ -30,7 +36,7 @@
     "gulp-usemin": "^0.3.14",
     "gulp-watch": "^4.3.5",
     "gulp-wrap": "^0.11.0",
-    "gulp-cheerio": "^0.6.2"
+    "through2": "^2.0.3"
   },
   "license": "MIT"
 }
diff --git a/player/index.html b/player/index.html
index c69c51c..0a741a6 100644
--- a/player/index.html
+++ b/player/index.html
@@ -1,45 +1,81 @@
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
+    <meta charset="UTF-8">
     <style>
         body, html{
-            background-color:#ddd;
+            background-color:#000;
             margin: 0px;
             height: 100%;
             overflow-x: hidden;
             overflow-y: auto;
         }
 
-        #bodymovin{
-            background-color:#333;
+        #lottie{
+            background-color:#000;
             width:100%;
             height:100%;
-            /*width:800px;
-            height:500px;*/
+            /*width:600px;
+            height:400px;*/
             display:block;
             transform: translate3d(0,0,0);
             margin: auto;
+            /*display:none;*/
         }
 
         .botas_loop_3,.botas_loop_2{
             display:none
         }
 
+        #bird_element.ready, #piano_element.ready, #cat_element.ready {
+            opacity: 1;
+            transition: opacity .6s ease-out;
+            cursor: pointer;
+        }
+
+        #bird_text_element, #piano_text_element, #cat_text_element {
+            opacity: 0;
+            transition: opacity .6s ease-out;
+        }
+
+        #bird_element.ready:hover ~ #bird_text_element,
+        #piano_element.ready:hover ~ #piano_text_element,
+        #cat_element.ready:hover ~ #cat_text_element {
+            opacity: 1;
+        }
+
+        #bird_element.ready:hover,
+        #piano_element.ready:hover,
+        #cat_element.ready:hover {
+            opacity: 0.2;
+        }
+
+        button {
+            padding: 0;
+            border: none;
+            background-color: transparent;
+        }
+
     </style>
-    <!-- build:js bodymovin.js -->
-     <script src="js/main.js"></script>
+    <!-- build:js lottie.js -->
+    <script src="js/main.js"></script>
     <script src="js/utils/common.js"></script>
+    <script src="js/utils/BaseEvent.js"></script>
+    <script src="js/utils/helpers/arrays.js"></script>
+    <script src="js/utils/helpers/svg_elements.js"></script>
+    <script src="js/utils/helpers/html_elements.js"></script>
+    <script src="js/utils/helpers/dynamicProperties.js"></script>
     <script src="js/3rd_party/transformation-matrix.js"></script>
     <script src="js/3rd_party/seedrandom.js"></script>
     <script src="js/3rd_party/BezierEaser.js"></script>
     <script src="js/3rd_party/PIXI_4_4_3.js"></script>
-    <script src="js/utils/MatrixManager.js"></script>
     <script src="js/utils/animationFramePolyFill.js"></script>
     <script src="js/utils/functionExtensions.js"></script>
     <script src="js/utils/bez.js"></script>
     <script src="js/utils/DataManager.js"></script>
     <script src="js/utils/FontManager.js"></script>
     <script src="js/utils/PropertyFactory.js"></script>
+    <script src="js/utils/TransformProperty.js"></script>
     <script src="js/utils/shapes/ShapePath.js"></script>
     <script src="js/utils/shapes/ShapeProperty.js"></script>
     <script src="js/utils/shapes/ShapeModifiers.js"></script>
@@ -47,41 +83,75 @@
     <script src="js/utils/shapes/RoundCornersModifier.js"></script>
     <script src="js/utils/shapes/RepeaterModifier.js"></script>
     <script src="js/utils/shapes/ShapeCollection.js"></script>
+    <script src="js/utils/shapes/DashProperty.js"></script>
+    <script src="js/utils/shapes/GradientProperty.js"></script>
+    <script src="js/utils/shapes/shapePathBuilder.js"></script>
     <script src="js/utils/imagePreloader.js"></script>
     <script src="js/utils/featureSupport.js"></script>
     <script src="js/utils/filters.js"></script>
+    <script src="js/utils/text/TextAnimatorProperty.js"></script>
+    <script src="js/utils/text/TextAnimatorDataProperty.js"></script>
+    <script src="js/utils/text/LetterProps.js"></script>
+    <script src="js/utils/text/TextProperty.js"></script>
+    <script src="js/utils/text/TextSelectorProperty.js"></script>
+    <script src="js/utils/pooling/pool_factory.js"></script>
     <script src="js/utils/pooling/pooling.js"></script>
     <script src="js/utils/pooling/point_pool.js"></script>
     <script src="js/utils/pooling/shape_pool.js"></script>
     <script src="js/utils/pooling/shapeCollection_pool.js"></script>
+    <script src="js/utils/pooling/segments_length_pool.js"></script>
+    <script src="js/utils/pooling/bezier_length_pool.js"></script>
     <script src="js/renderers/BaseRenderer.js"></script>
     <script src="js/renderers/SVGRenderer.js"></script>
     <script src="js/renderers/PIXIRenderer.js" data-light-skip="true"></script>
     <script src="js/renderers/CanvasRenderer.js" data-light-skip="true"></script>
     <script src="js/renderers/HybridRenderer.js" data-light-skip="true"></script>
     <script src="js/mask.js"></script>
+    <script src="js/elements/helpers/HierarchyElement.js"></script>
+    <script src="js/elements/helpers/FrameElement.js"></script>
+    <script src="js/elements/helpers/TransformElement.js"></script>
+    <script src="js/elements/helpers/RenderableElement.js"></script>
+    <script src="js/elements/helpers/RenderableDOMElement.js"></script>
+    <script src="js/elements/helpers/shapes/ProcessedElement.js"></script>
+    <script src="js/elements/helpers/shapes/SVGStyleData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGShapeData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGTransformData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGStrokeStyleData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGFillStyleData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGGradientFillStyleData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGGradientStrokeStyleData.js"></script>
+    <script src="js/elements/helpers/shapes/ShapeGroupData.js"></script>
+    <script src="js/elements/helpers/shapes/SVGElementsRenderer.js"></script>
+    <script src="js/elements/helpers/shapes/PIXIElementsRenderer.js"></script>
+    <script src="js/elements/helpers/shapes/CVShapeData.js" data-light-skip="true"></script>
     <script src="js/elements/BaseElement.js"></script>
+    <script src="js/elements/NullElement.js"></script>
     <script src="js/elements/svgElements/SVGBaseElement.js"></script>
+    <script src="js/elements/ShapeElement.js"></script>
     <script src="js/elements/TextElement.js"></script>
+    <script src="js/elements/CompElement.js"></script>
+    <script src="js/elements/ImageElement.js"></script>
+    <script src="js/elements/SolidElement.js"></script>
+    <script src="js/elements/svgElements/SVGCompElement.js"></script>
     <script src="js/elements/svgElements/SVGTextElement.js"></script>
+    <script src="js/elements/svgElements/SVGShapeElement.js"></script>
     <script src="js/elements/svgElements/effects/SVGTintEffect.js"></script>
     <script src="js/elements/svgElements/effects/SVGFillFilter.js"></script>
     <script src="js/elements/svgElements/effects/SVGStrokeEffect.js"></script>
     <script src="js/elements/svgElements/effects/SVGTritoneFilter.js"></script>
     <script src="js/elements/svgElements/effects/SVGProLevelsFilter.js"></script>
     <script src="js/elements/svgElements/effects/SVGDropShadowEffect.js"></script>
+    <script src="js/elements/svgElements/effects/SVGMatte3Effect.js"></script>
     <script src="js/elements/svgElements/SVGEffects.js"></script>
-    <script src="js/elements/CompElement.js"></script>
-    <script src="js/elements/ImageElement.js"></script>
-    <script src="js/elements/ShapeElement.js"></script>
-    <script src="js/elements/SolidElement.js"></script>
+    <script src="js/elements/canvasElements/CVContextData.js" data-light-skip="true"></script>
     <script src="js/elements/canvasElements/CVBaseElement.js" data-light-skip="true"></script>
-    <script src="js/elements/canvasElements/CVCompElement.js" data-light-skip="true"></script>
     <script src="js/elements/canvasElements/CVImageElement.js" data-light-skip="true"></script>
+    <script src="js/elements/canvasElements/CVCompElement.js" data-light-skip="true"></script>
     <script src="js/elements/canvasElements/CVMaskElement.js" data-light-skip="true"></script>
     <script src="js/elements/canvasElements/CVShapeElement.js" data-light-skip="true"></script>
     <script src="js/elements/canvasElements/CVSolidElement.js" data-light-skip="true"></script>
     <script src="js/elements/canvasElements/CVTextElement.js" data-light-skip="true"></script>
+    <script src="js/elements/canvasElements/CVEffects.js" data-light-skip="true"></script>
     <script src="js/elements/htmlElements/HBaseElement.js" data-light-skip="true"></script>
     <script src="js/elements/htmlElements/HSolidElement.js" data-light-skip="true"></script>
     <script src="js/elements/htmlElements/HCompElement.js" data-light-skip="true"></script>
@@ -89,6 +159,7 @@
     <script src="js/elements/htmlElements/HTextElement.js" data-light-skip="true"></script>
     <script src="js/elements/htmlElements/HImageElement.js" data-light-skip="true"></script>
     <script src="js/elements/htmlElements/HCameraElement.js" data-light-skip="true"></script>
+    <script src="js/elements/htmlElements/HEffects.js" data-light-skip="true"></script>
     <script src="js/elements/pixiElements/PIXIBaseElement.js" data-light-skip="true"></script>
     <script src="js/elements/pixiElements/PIXIImageElement.js" data-light-skip="true"></script>
     <script src="js/elements/pixiElements/PIXISolidElement.js" data-light-skip="true"></script>
@@ -99,8 +170,9 @@
     <script src="js/animation/AnimationItem.js"></script>
     <!-- Expressions -->
     <script src="js/utils/expressions/Expressions.js" data-light-skip="true"></script>
-    <script src="js/utils/expressions/ExpressionPropertyDecorator.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/ExpressionManager.js" data-light-skip="true"></script>
+    <script src="js/utils/expressions/ExpressionPropertyDecorator.js" data-light-skip="true"></script>
+    <script src="js/utils/expressions/ExpressionTextPropertyDecorator.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/ShapeInterface.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/TextInterface.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/LayerInterface.js" data-light-skip="true"></script>
@@ -108,34 +180,47 @@
     <script src="js/utils/expressions/TransformInterface.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/ProjectInterface.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/EffectInterface.js" data-light-skip="true"></script>
+    <script src="js/utils/expressions/MaskInterface.js" data-light-skip="true"></script>
     <script src="js/utils/expressions/ExpressionValue.js" data-light-skip="true"></script>
     <script src="js/effects/SliderEffect.js" data-light-skip="true"></script>
-    <script src="js/effects.js" data-light-skip="true"></script>
+    <script src="js/effects/EffectsManagerPlaceholder.js" ></script>
+    <script src="js/EffectsManager.js" data-light-skip="true"></script>
     <!-- end Expressions -->
     <!-- endbuild -->
     <script src="js/module.js" data-skip="true"></script>
-    <!-- <script src="bodymovin.js"></script> -->
+    <!-- <script src="lottie.js"></script> -->
     <!-- <script src="bodymovin_light.js"></script> -->
+
 </head>
 <body>
-<div id="bodymovin"></div>
+<div id="lottie"></div>
 
 <script>
-
     var anim;
-    var elem = document.getElementById('bodymovin')
+    var elem = document.getElementById('lottie');
+    //elem.style.display = 'none';
     var animData = {
         container: elem,
-        renderer: 'svg',
-        loop: true,
+        renderer: 'pixi',
+        loop: false,
         autoplay: true,
         rendererSettings: {
-            progressiveLoad:true
+            progressiveLoad:false,
         },
-        path: 'exports/dalek/data.json'
+        path: 'exports/render/data.json'
     };
-    anim = bodymovin.loadAnimation(animData);
+    anim = lottie.loadAnimation(animData);
+    anim.setSubframe(false);
 
+    /*anim.addEventListener('DOMLoaded', function() {
+        animationAPI = lottie_api.createAnimationApi(anim);
+        var null_animator = animationAPI.getKeyPath('Shape Layer 2, Transform, Scale');
+        animationAPI.addValueCallback(null_animator, function(currentValue) {
+            currentValue[0] = Math.random() * 100;
+            return currentValue
+        })
+    })*/
+    //anim.setSubframe(false);
 </script>
 </body>
 </html>
diff --git a/player/js/3rd_party/BezierEaser.js b/player/js/3rd_party/BezierEaser.js
index c5aeb8a..5e2dc6f 100644
--- a/player/js/3rd_party/BezierEaser.js
+++ b/player/js/3rd_party/BezierEaser.js
@@ -153,5 +153,4 @@
 
     return ob;
 
-}())
-
+}());
\ No newline at end of file
diff --git a/player/js/3rd_party/canvasPoly.js b/player/js/3rd_party/canvasPoly.js
deleted file mode 100644
index 0dafb9c..0000000
--- a/player/js/3rd_party/canvasPoly.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Copyright 2014 Google Inc. All rights reserved.
- *
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file.
- *
- * @fileoverview Description of this file.
- *
- * A polyfill for HTML Canvas features, including
- * Path2D support.
- */
-if (CanvasRenderingContext2D.prototype.ellipse === undefined) {
-    CanvasRenderingContext2D.prototype.ellipse = function(x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) {
-        this.save();
-        this.translate(x, y);
-        this.rotate(rotation);
-        this.scale(radiusX, radiusY);
-        this.arc(0, 0, 1, startAngle, endAngle, antiClockwise);
-        this.restore();
-    };
-}
-var BM_Path2D;
-function BM_CanvasRenderingContext2D(renderer){
-    this.renderer = renderer;
-}
-(function() {
-
-    var canvasPrototype = CanvasRenderingContext2D.prototype;
-
-    var bm_canvasPrototype = BM_CanvasRenderingContext2D.prototype;
-
-    function Path_(arg) {
-        this.ops_ = [];
-        if (arg === undefined) {
-            return;
-        }
-        if (typeof arg == 'string') {
-            try {
-                this.ops_ = parser.parse(arg);
-            } catch(e) {
-                // Treat an invalid SVG path as an empty path.
-            }
-        } else if (arg.hasOwnProperty('ops_')) {
-            this.ops_ = arg.ops_.slice(0);
-        } else {
-            throw 'Error: ' + typeof arg + 'is not a valid argument to Path';
-        }
-    }
-
-    // TODO(jcgregorio) test for arcTo and implement via something.
-
-
-    // Path methods that map simply to the CanvasRenderingContext2D.
-    var simple_mapping = [
-        'closePath',
-        'moveTo',
-        'lineTo',
-        'quadraticCurveTo',
-        'bezierCurveTo',
-        'rect',
-        'arc',
-        'arcTo',
-        'ellipse'
-    ];
-
-    function createFunction(name) {
-        return function() {
-            var i, len = arguments.length;
-            var args = [];
-            for(i=0;i<len;i+=1){
-                args.push(arguments[i]);
-            }
-            this.ops_.push({type: name, args: args});
-        };
-    }
-
-    // Add simple_mapping methods to Path2D.
-    for (var i=0; i<simple_mapping.length; i++) {
-        var name = simple_mapping[i];
-        Path_.prototype[name] = createFunction(name);
-    }
-
-    Path_.prototype.addPath = function(path, tr) {
-        var hasTx = false;
-        if (tr && (tr[0] != 1 || tr[1] !== 0 || tr[2] !== 0 || tr[3] != 1 || tr[4] !== 0 || tr[5] !== 0)) {
-
-            hasTx = true;
-            this.ops_.push({type: 'save', args: []});
-            this.ops_.push({type: 'transform', args: [tr[0], tr[1], tr[2], tr[3], tr[4], tr[5]]});
-        }
-        this.ops_ = this.ops_.concat(path.ops_);
-        if (hasTx) {
-            this.ops_.push({type: 'restore', args: []});
-        }
-    };
-
-    var original_fill = canvasPrototype.fill;
-    var original_stroke = canvasPrototype.stroke;
-    var original_clip = canvasPrototype.clip;
-
-    // Replace methods on CanvasRenderingContext2D with ones that understand Path2D.
-    bm_canvasPrototype.fill = function(arg) {
-        if (arg instanceof Path_) {
-            this.renderer.canvasContext.beginPath();
-            for (var i = 0, len = arg.ops_.length; i < len; i++) {
-                var op = arg.ops_[i];
-                if(op.type == 'transform'){
-                    this.renderer.ctxTransform(op.args);
-                }else if(op.type == 'save'){
-                    this.renderer.save();
-                }else if(op.type == 'restore'){
-                    this.renderer.restore();
-                }else{
-                    this.renderer.canvasContext[op.type].apply(this.renderer.canvasContext, op.args);
-                }
-            }
-            len = arguments.length;
-            var args = [];
-            for(i=1;i<len;i+=1){
-                args.push(arguments[i]);
-            }
-            original_fill.apply(this.renderer.canvasContext, args);
-        } else {
-            original_fill.apply(this.renderer.canvasContext, arguments);
-        }
-    };
-
-    bm_canvasPrototype.stroke = function(arg) {
-        if (arg instanceof Path_) {
-            this.renderer.canvasContext.beginPath();
-            for (var i = 0, len = arg.ops_.length; i < len; i++) {
-                var op = arg.ops_[i];
-                this.renderer.canvasContext[op.type].apply(this.renderer.canvasContext, op.args);
-            }
-            original_stroke.call(this.renderer.canvasContext);
-        } else {
-            original_stroke.call(this.renderer.canvasContext);
-        }
-    };
-
-    bm_canvasPrototype.clip = function(arg) {
-        if (arg instanceof Path_) {
-            this.renderer.canvasContext.beginPath();
-            for (var i = 0, len = arg.ops_.length; i < len; i++) {
-                var op = arg.ops_[i];
-                this.renderer.canvasContext[op.type].apply(this.renderer.canvasContext, op.args);
-            }
-            len = arguments.length;
-            var args = [];
-            for(i=1;i<len;i+=1){
-                args.push(arguments[i]);
-            }
-            original_clip.apply(this.renderer.canvasContext, args);
-        } else {
-            original_clip.apply(this.renderer.canvasContext, arguments);
-        }
-    };
-
-    // Set up externs.
-    BM_Path2D = Path_;
-})();
\ No newline at end of file
diff --git a/player/js/3rd_party/seedrandom.js b/player/js/3rd_party/seedrandom.js
index 4f5f6df..2224985 100644
--- a/player/js/3rd_party/seedrandom.js
+++ b/player/js/3rd_party/seedrandom.js
@@ -43,12 +43,12 @@
 //
     function seedrandom(seed, options, callback) {
         var key = [];
-        options = (options == true) ? { entropy: true } : (options || {});
+        options = (options === true) ? { entropy: true } : (options || {});
 
         // Flatten the seed string or build one from local entropy if needed.
         var shortseed = mixkey(flatten(
             options.entropy ? [seed, tostring(pool)] :
-                (seed == null) ? autoseed() : seed, 3), key);
+                (seed === null) ? autoseed() : seed, 3), key);
 
         // Use the seed to initialize an ARC4 generator.
         var arc4 = new ARC4(key);
@@ -72,8 +72,8 @@
             return (n + x) / d;                 // Form the number within [0, 1).
         };
 
-        prng.int32 = function() { return arc4.g(4) | 0; }
-        prng.quick = function() { return arc4.g(4) / 0x100000000; }
+        prng.int32 = function() { return arc4.g(4) | 0; };
+        prng.quick = function() { return arc4.g(4) / 0x100000000; };
         prng.double = prng;
 
         // Mix the randomness into accumulated entropy.
@@ -86,7 +86,7 @@
                 // Load the arc4 state from the given state if it has an S array.
                 if (state.S) { copy(state, arc4); }
                 // Only provide the .state method if requested via options.state.
-                prng.state = function() { return copy(arc4, {}); }
+                prng.state = function() { return copy(arc4, {}); };
             }
 
             // If called as a method of Math (Math.seedrandom()), mutate
@@ -131,7 +131,7 @@
         }
 
         // The "g" method returns the next (count) outputs as one number.
-        (me.g = function(count) {
+        me.g = function(count) {
             // Using instance members instead of closure state nearly doubles speed.
             var t, r = 0,
                 i = me.i, j = me.j, s = me.S;
@@ -144,7 +144,7 @@
             // For robust unpredictability, the function call below automatically
             // discards an initial batch of values.  This is called RC4-drop[256].
             // See http://google.com/search?q=rsa+fluhrer+response&btnI
-        })(width);
+        };
     }
 
 //
@@ -156,7 +156,7 @@
         t.j = f.j;
         t.S = f.S.slice();
         return t;
-    };
+    }
 
 //
 // flatten()
@@ -200,7 +200,7 @@
         } catch (e) {
             var browser = global.navigator,
                 plugins = browser && browser.plugins;
-            return [+new Date, global, plugins, global.screen, tostring(pool)];
+            return [+new Date(), global, plugins, global.screen, tostring(pool)];
         }
     }
 
diff --git a/player/js/3rd_party/sylvester.js b/player/js/3rd_party/sylvester.js
deleted file mode 100644
index 3e83bee..0000000
--- a/player/js/3rd_party/sylvester.js
+++ /dev/null
@@ -1 +0,0 @@
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 17={3i:\'0.1.3\',16:1e-6};l v(){}v.23={e:l(i){8(i<1||i>7.4.q)?w:7.4[i-1]},2R:l(){8 7.4.q},1u:l(){8 F.1x(7.2u(7))},24:l(a){9 n=7.4.q;9 V=a.4||a;o(n!=V.q){8 1L}J{o(F.13(7.4[n-1]-V[n-1])>17.16){8 1L}}H(--n);8 2x},1q:l(){8 v.u(7.4)},1b:l(a){9 b=[];7.28(l(x,i){b.19(a(x,i))});8 v.u(b)},28:l(a){9 n=7.4.q,k=n,i;J{i=k-n;a(7.4[i],i+1)}H(--n)},2q:l(){9 r=7.1u();o(r===0){8 7.1q()}8 7.1b(l(x){8 x/r})},1C:l(a){9 V=a.4||a;9 n=7.4.q,k=n,i;o(n!=V.q){8 w}9 b=0,1D=0,1F=0;7.28(l(x,i){b+=x*V[i-1];1D+=x*x;1F+=V[i-1]*V[i-1]});1D=F.1x(1D);1F=F.1x(1F);o(1D*1F===0){8 w}9 c=b/(1D*1F);o(c<-1){c=-1}o(c>1){c=1}8 F.37(c)},1m:l(a){9 b=7.1C(a);8(b===w)?w:(b<=17.16)},34:l(a){9 b=7.1C(a);8(b===w)?w:(F.13(b-F.1A)<=17.16)},2k:l(a){9 b=7.2u(a);8(b===w)?w:(F.13(b)<=17.16)},2j:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x+V[i-1]})},2C:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x-V[i-1]})},22:l(k){8 7.1b(l(x){8 x*k})},x:l(k){8 7.22(k)},2u:l(a){9 V=a.4||a;9 i,2g=0,n=7.4.q;o(n!=V.q){8 w}J{2g+=7.4[n-1]*V[n-1]}H(--n);8 2g},2f:l(a){9 B=a.4||a;o(7.4.q!=3||B.q!=3){8 w}9 A=7.4;8 v.u([(A[1]*B[2])-(A[2]*B[1]),(A[2]*B[0])-(A[0]*B[2]),(A[0]*B[1])-(A[1]*B[0])])},2A:l(){9 m=0,n=7.4.q,k=n,i;J{i=k-n;o(F.13(7.4[i])>F.13(m)){m=7.4[i]}}H(--n);8 m},2Z:l(x){9 a=w,n=7.4.q,k=n,i;J{i=k-n;o(a===w&&7.4[i]==x){a=i+1}}H(--n);8 a},3g:l(){8 S.2X(7.4)},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(y){8(F.13(y-x)<=17.16)?x:y})},1o:l(a){o(a.K){8 a.1o(7)}9 V=a.4||a;o(V.q!=7.4.q){8 w}9 b=0,2b;7.28(l(x,i){2b=x-V[i-1];b+=2b*2b});8 F.1x(b)},3a:l(a){8 a.1h(7)},2T:l(a){8 a.1h(7)},1V:l(t,a){9 V,R,x,y,z;2S(7.4.q){27 2:V=a.4||a;o(V.q!=2){8 w}R=S.1R(t).4;x=7.4[0]-V[0];y=7.4[1]-V[1];8 v.u([V[0]+R[0][0]*x+R[0][1]*y,V[1]+R[1][0]*x+R[1][1]*y]);1I;27 3:o(!a.U){8 w}9 C=a.1r(7).4;R=S.1R(t,a.U).4;x=7.4[0]-C[0];y=7.4[1]-C[1];z=7.4[2]-C[2];8 v.u([C[0]+R[0][0]*x+R[0][1]*y+R[0][2]*z,C[1]+R[1][0]*x+R[1][1]*y+R[1][2]*z,C[2]+R[2][0]*x+R[2][1]*y+R[2][2]*z]);1I;2P:8 w}},1t:l(a){o(a.K){9 P=7.4.2O();9 C=a.1r(P).4;8 v.u([C[0]+(C[0]-P[0]),C[1]+(C[1]-P[1]),C[2]+(C[2]-(P[2]||0))])}1d{9 Q=a.4||a;o(7.4.q!=Q.q){8 w}8 7.1b(l(x,i){8 Q[i-1]+(Q[i-1]-x)})}},1N:l(){9 V=7.1q();2S(V.4.q){27 3:1I;27 2:V.4.19(0);1I;2P:8 w}8 V},2n:l(){8\'[\'+7.4.2K(\', \')+\']\'},26:l(a){7.4=(a.4||a).2O();8 7}};v.u=l(a){9 V=25 v();8 V.26(a)};v.i=v.u([1,0,0]);v.j=v.u([0,1,0]);v.k=v.u([0,0,1]);v.2J=l(n){9 a=[];J{a.19(F.2F())}H(--n);8 v.u(a)};v.1j=l(n){9 a=[];J{a.19(0)}H(--n);8 v.u(a)};l S(){}S.23={e:l(i,j){o(i<1||i>7.4.q||j<1||j>7.4[0].q){8 w}8 7.4[i-1][j-1]},33:l(i){o(i>7.4.q){8 w}8 v.u(7.4[i-1])},2E:l(j){o(j>7.4[0].q){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][j-1])}H(--n);8 v.u(a)},2R:l(){8{2D:7.4.q,1p:7.4[0].q}},2D:l(){8 7.4.q},1p:l(){8 7.4[0].q},24:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(7.4.q!=M.q||7.4[0].q!=M[0].q){8 1L}9 b=7.4.q,15=b,i,G,10=7.4[0].q,j;J{i=15-b;G=10;J{j=10-G;o(F.13(7.4[i][j]-M[i][j])>17.16){8 1L}}H(--G)}H(--b);8 2x},1q:l(){8 S.u(7.4)},1b:l(a){9 b=[],12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;b[i]=[];J{j=10-G;b[i][j]=a(7.4[i][j],i+1,j+1)}H(--G)}H(--12);8 S.u(b)},2i:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}8(7.4.q==M.q&&7.4[0].q==M[0].q)},2j:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x+M[i-1][j-1]})},2C:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x-M[i-1][j-1]})},2B:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}8(7.4[0].q==M.q)},22:l(a){o(!a.4){8 7.1b(l(x){8 x*a})}9 b=a.1u?2x:1L;9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2B(M)){8 w}9 d=7.4.q,15=d,i,G,10=M[0].q,j;9 e=7.4[0].q,4=[],21,20,c;J{i=15-d;4[i]=[];G=10;J{j=10-G;21=0;20=e;J{c=e-20;21+=7.4[i][c]*M[c][j]}H(--20);4[i][j]=21}H(--G)}H(--d);9 M=S.u(4);8 b?M.2E(1):M},x:l(a){8 7.22(a)},32:l(a,b,c,d){9 e=[],12=c,i,G,j;9 f=7.4.q,1p=7.4[0].q;J{i=c-12;e[i]=[];G=d;J{j=d-G;e[i][j]=7.4[(a+i-1)%f][(b+j-1)%1p]}H(--G)}H(--12);8 S.u(e)},31:l(){9 a=7.4.q,1p=7.4[0].q;9 b=[],12=1p,i,G,j;J{i=1p-12;b[i]=[];G=a;J{j=a-G;b[i][j]=7.4[j][i]}H(--G)}H(--12);8 S.u(b)},1y:l(){8(7.4.q==7.4[0].q)},2A:l(){9 m=0,12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;J{j=10-G;o(F.13(7.4[i][j])>F.13(m)){m=7.4[i][j]}}H(--G)}H(--12);8 m},2Z:l(x){9 a=w,12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;J{j=10-G;o(7.4[i][j]==x){8{i:i+1,j:j+1}}}H(--G)}H(--12);8 w},30:l(){o(!7.1y){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][i])}H(--n);8 v.u(a)},1K:l(){9 M=7.1q(),1c;9 n=7.4.q,k=n,i,1s,1n=7.4[0].q,p;J{i=k-n;o(M.4[i][i]==0){2e(j=i+1;j<k;j++){o(M.4[j][i]!=0){1c=[];1s=1n;J{p=1n-1s;1c.19(M.4[i][p]+M.4[j][p])}H(--1s);M.4[i]=1c;1I}}}o(M.4[i][i]!=0){2e(j=i+1;j<k;j++){9 a=M.4[j][i]/M.4[i][i];1c=[];1s=1n;J{p=1n-1s;1c.19(p<=i?0:M.4[j][p]-M.4[i][p]*a)}H(--1s);M.4[j]=1c}}}H(--n);8 M},3h:l(){8 7.1K()},2z:l(){o(!7.1y()){8 w}9 M=7.1K();9 a=M.4[0][0],n=M.4.q-1,k=n,i;J{i=k-n+1;a=a*M.4[i][i]}H(--n);8 a},3f:l(){8 7.2z()},2y:l(){8(7.1y()&&7.2z()===0)},2Y:l(){o(!7.1y()){8 w}9 a=7.4[0][0],n=7.4.q-1,k=n,i;J{i=k-n+1;a+=7.4[i][i]}H(--n);8 a},3e:l(){8 7.2Y()},1Y:l(){9 M=7.1K(),1Y=0;9 a=7.4.q,15=a,i,G,10=7.4[0].q,j;J{i=15-a;G=10;J{j=10-G;o(F.13(M.4[i][j])>17.16){1Y++;1I}}H(--G)}H(--a);8 1Y},3d:l(){8 7.1Y()},2W:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}9 T=7.1q(),1p=T.4[0].q;9 b=T.4.q,15=b,i,G,10=M[0].q,j;o(b!=M.q){8 w}J{i=15-b;G=10;J{j=10-G;T.4[i][1p+j]=M[i][j]}H(--G)}H(--b);8 T},2w:l(){o(!7.1y()||7.2y()){8 w}9 a=7.4.q,15=a,i,j;9 M=7.2W(S.I(a)).1K();9 b,1n=M.4[0].q,p,1c,2v;9 c=[],2c;J{i=a-1;1c=[];b=1n;c[i]=[];2v=M.4[i][i];J{p=1n-b;2c=M.4[i][p]/2v;1c.19(2c);o(p>=15){c[i].19(2c)}}H(--b);M.4[i]=1c;2e(j=0;j<i;j++){1c=[];b=1n;J{p=1n-b;1c.19(M.4[j][p]-M.4[i][p]*M.4[j][i])}H(--b);M.4[j]=1c}}H(--a);8 S.u(c)},3c:l(){8 7.2w()},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(p){8(F.13(p-x)<=17.16)?x:p})},2n:l(){9 a=[];9 n=7.4.q,k=n,i;J{i=k-n;a.19(v.u(7.4[i]).2n())}H(--n);8 a.2K(\'\\n\')},26:l(a){9 i,4=a.4||a;o(1g(4[0][0])!=\'1f\'){9 b=4.q,15=b,G,10,j;7.4=[];J{i=15-b;G=4[i].q;10=G;7.4[i]=[];J{j=10-G;7.4[i][j]=4[i][j]}H(--G)}H(--b);8 7}9 n=4.q,k=n;7.4=[];J{i=k-n;7.4.19([4[i]])}H(--n);8 7}};S.u=l(a){9 M=25 S();8 M.26(a)};S.I=l(n){9 a=[],k=n,i,G,j;J{i=k-n;a[i]=[];G=k;J{j=k-G;a[i][j]=(i==j)?1:0}H(--G)}H(--n);8 S.u(a)};S.2X=l(a){9 n=a.q,k=n,i;9 M=S.I(n);J{i=k-n;M.4[i][i]=a[i]}H(--n);8 M};S.1R=l(b,a){o(!a){8 S.u([[F.1H(b),-F.1G(b)],[F.1G(b),F.1H(b)]])}9 d=a.1q();o(d.4.q!=3){8 w}9 e=d.1u();9 x=d.4[0]/e,y=d.4[1]/e,z=d.4[2]/e;9 s=F.1G(b),c=F.1H(b),t=1-c;8 S.u([[t*x*x+c,t*x*y-s*z,t*x*z+s*y],[t*x*y+s*z,t*y*y+c,t*y*z-s*x],[t*x*z-s*y,t*y*z+s*x,t*z*z+c]])};S.3b=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[1,0,0],[0,c,-s],[0,s,c]])};S.39=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[c,0,s],[0,1,0],[-s,0,c]])};S.38=l(t){9 c=F.1H(t),s=F.1G(t);8 S.u([[c,-s,0],[s,c,0],[0,0,1]])};S.2J=l(n,m){8 S.1j(n,m).1b(l(){8 F.2F()})};S.1j=l(n,m){9 a=[],12=n,i,G,j;J{i=n-12;a[i]=[];G=m;J{j=m-G;a[i][j]=0}H(--G)}H(--12);8 S.u(a)};l 14(){}14.23={24:l(a){8(7.1m(a)&&7.1h(a.K))},1q:l(){8 14.u(7.K,7.U)},2U:l(a){9 V=a.4||a;8 14.u([7.K.4[0]+V[0],7.K.4[1]+V[1],7.K.4[2]+(V[2]||0)],7.U)},1m:l(a){o(a.W){8 a.1m(7)}9 b=7.U.1C(a.U);8(F.13(b)<=17.16||F.13(b-F.1A)<=17.16)},1o:l(a){o(a.W){8 a.1o(7)}o(a.U){o(7.1m(a)){8 7.1o(a.K)}9 N=7.U.2f(a.U).2q().4;9 A=7.K.4,B=a.K.4;8 F.13((A[0]-B[0])*N[0]+(A[1]-B[1])*N[1]+(A[2]-B[2])*N[2])}1d{9 P=a.4||a;9 A=7.K.4,D=7.U.4;9 b=P[0]-A[0],2a=P[1]-A[1],29=(P[2]||0)-A[2];9 c=F.1x(b*b+2a*2a+29*29);o(c===0)8 0;9 d=(b*D[0]+2a*D[1]+29*D[2])/c;9 e=1-d*d;8 F.13(c*F.1x(e<0?0:e))}},1h:l(a){9 b=7.1o(a);8(b!==w&&b<=17.16)},2T:l(a){8 a.1h(7)},1v:l(a){o(a.W){8 a.1v(7)}8(!7.1m(a)&&7.1o(a)<=17.16)},1U:l(a){o(a.W){8 a.1U(7)}o(!7.1v(a)){8 w}9 P=7.K.4,X=7.U.4,Q=a.K.4,Y=a.U.4;9 b=X[0],1z=X[1],1B=X[2],1T=Y[0],1S=Y[1],1M=Y[2];9 c=P[0]-Q[0],2s=P[1]-Q[1],2r=P[2]-Q[2];9 d=-b*c-1z*2s-1B*2r;9 e=1T*c+1S*2s+1M*2r;9 f=b*b+1z*1z+1B*1B;9 g=1T*1T+1S*1S+1M*1M;9 h=b*1T+1z*1S+1B*1M;9 k=(d*g/f+h*e)/(g-h*h);8 v.u([P[0]+k*b,P[1]+k*1z,P[2]+k*1B])},1r:l(a){o(a.U){o(7.1v(a)){8 7.1U(a)}o(7.1m(a)){8 w}9 D=7.U.4,E=a.U.4;9 b=D[0],1l=D[1],1k=D[2],1P=E[0],1O=E[1],1Q=E[2];9 x=(1k*1P-b*1Q),y=(b*1O-1l*1P),z=(1l*1Q-1k*1O);9 N=v.u([x*1Q-y*1O,y*1P-z*1Q,z*1O-x*1P]);9 P=11.u(a.K,N);8 P.1U(7)}1d{9 P=a.4||a;o(7.1h(P)){8 v.u(P)}9 A=7.K.4,D=7.U.4;9 b=D[0],1l=D[1],1k=D[2],1w=A[0],18=A[1],1a=A[2];9 x=b*(P[1]-18)-1l*(P[0]-1w),y=1l*((P[2]||0)-1a)-1k*(P[1]-18),z=1k*(P[0]-1w)-b*((P[2]||0)-1a);9 V=v.u([1l*x-1k*z,1k*y-b*x,b*z-1l*y]);9 k=7.1o(P)/V.1u();8 v.u([P[0]+V.4[0]*k,P[1]+V.4[1]*k,(P[2]||0)+V.4[2]*k])}},1V:l(t,a){o(1g(a.U)==\'1f\'){a=14.u(a.1N(),v.k)}9 R=S.1R(t,a.U).4;9 C=a.1r(7.K).4;9 A=7.K.4,D=7.U.4;9 b=C[0],1E=C[1],1J=C[2],1w=A[0],18=A[1],1a=A[2];9 x=1w-b,y=18-1E,z=1a-1J;8 14.u([b+R[0][0]*x+R[0][1]*y+R[0][2]*z,1E+R[1][0]*x+R[1][1]*y+R[1][2]*z,1J+R[2][0]*x+R[2][1]*y+R[2][2]*z],[R[0][0]*D[0]+R[0][1]*D[1]+R[0][2]*D[2],R[1][0]*D[0]+R[1][1]*D[1]+R[1][2]*D[2],R[2][0]*D[0]+R[2][1]*D[1]+R[2][2]*D[2]])},1t:l(a){o(a.W){9 A=7.K.4,D=7.U.4;9 b=A[0],18=A[1],1a=A[2],2N=D[0],1l=D[1],1k=D[2];9 c=7.K.1t(a).4;9 d=b+2N,2h=18+1l,2o=1a+1k;9 Q=a.1r([d,2h,2o]).4;9 e=[Q[0]+(Q[0]-d)-c[0],Q[1]+(Q[1]-2h)-c[1],Q[2]+(Q[2]-2o)-c[2]];8 14.u(c,e)}1d o(a.U){8 7.1V(F.1A,a)}1d{9 P=a.4||a;8 14.u(7.K.1t([P[0],P[1],(P[2]||0)]),7.U)}},1Z:l(a,b){a=v.u(a);b=v.u(b);o(a.4.q==2){a.4.19(0)}o(b.4.q==2){b.4.19(0)}o(a.4.q>3||b.4.q>3){8 w}9 c=b.1u();o(c===0){8 w}7.K=a;7.U=v.u([b.4[0]/c,b.4[1]/c,b.4[2]/c]);8 7}};14.u=l(a,b){9 L=25 14();8 L.1Z(a,b)};14.X=14.u(v.1j(3),v.i);14.Y=14.u(v.1j(3),v.j);14.Z=14.u(v.1j(3),v.k);l 11(){}11.23={24:l(a){8(7.1h(a.K)&&7.1m(a))},1q:l(){8 11.u(7.K,7.W)},2U:l(a){9 V=a.4||a;8 11.u([7.K.4[0]+V[0],7.K.4[1]+V[1],7.K.4[2]+(V[2]||0)],7.W)},1m:l(a){9 b;o(a.W){b=7.W.1C(a.W);8(F.13(b)<=17.16||F.13(F.1A-b)<=17.16)}1d o(a.U){8 7.W.2k(a.U)}8 w},2k:l(a){9 b=7.W.1C(a.W);8(F.13(F.1A/2-b)<=17.16)},1o:l(a){o(7.1v(a)||7.1h(a)){8 0}o(a.K){9 A=7.K.4,B=a.K.4,N=7.W.4;8 F.13((A[0]-B[0])*N[0]+(A[1]-B[1])*N[1]+(A[2]-B[2])*N[2])}1d{9 P=a.4||a;9 A=7.K.4,N=7.W.4;8 F.13((A[0]-P[0])*N[0]+(A[1]-P[1])*N[1]+(A[2]-(P[2]||0))*N[2])}},1h:l(a){o(a.W){8 w}o(a.U){8(7.1h(a.K)&&7.1h(a.K.2j(a.U)))}1d{9 P=a.4||a;9 A=7.K.4,N=7.W.4;9 b=F.13(N[0]*(A[0]-P[0])+N[1]*(A[1]-P[1])+N[2]*(A[2]-(P[2]||0)));8(b<=17.16)}},1v:l(a){o(1g(a.U)==\'1f\'&&1g(a.W)==\'1f\'){8 w}8!7.1m(a)},1U:l(a){o(!7.1v(a)){8 w}o(a.U){9 A=a.K.4,D=a.U.4,P=7.K.4,N=7.W.4;9 b=(N[0]*(P[0]-A[0])+N[1]*(P[1]-A[1])+N[2]*(P[2]-A[2]))/(N[0]*D[0]+N[1]*D[1]+N[2]*D[2]);8 v.u([A[0]+D[0]*b,A[1]+D[1]*b,A[2]+D[2]*b])}1d o(a.W){9 c=7.W.2f(a.W).2q();9 N=7.W.4,A=7.K.4,O=a.W.4,B=a.K.4;9 d=S.1j(2,2),i=0;H(d.2y()){i++;d=S.u([[N[i%3],N[(i+1)%3]],[O[i%3],O[(i+1)%3]]])}9 e=d.2w().4;9 x=N[0]*A[0]+N[1]*A[1]+N[2]*A[2];9 y=O[0]*B[0]+O[1]*B[1]+O[2]*B[2];9 f=[e[0][0]*x+e[0][1]*y,e[1][0]*x+e[1][1]*y];9 g=[];2e(9 j=1;j<=3;j++){g.19((i==j)?0:f[(j+(5-i)%3)%3])}8 14.u(g,c)}},1r:l(a){9 P=a.4||a;9 A=7.K.4,N=7.W.4;9 b=(A[0]-P[0])*N[0]+(A[1]-P[1])*N[1]+(A[2]-(P[2]||0))*N[2];8 v.u([P[0]+N[0]*b,P[1]+N[1]*b,(P[2]||0)+N[2]*b])},1V:l(t,a){9 R=S.1R(t,a.U).4;9 C=a.1r(7.K).4;9 A=7.K.4,N=7.W.4;9 b=C[0],1E=C[1],1J=C[2],1w=A[0],18=A[1],1a=A[2];9 x=1w-b,y=18-1E,z=1a-1J;8 11.u([b+R[0][0]*x+R[0][1]*y+R[0][2]*z,1E+R[1][0]*x+R[1][1]*y+R[1][2]*z,1J+R[2][0]*x+R[2][1]*y+R[2][2]*z],[R[0][0]*N[0]+R[0][1]*N[1]+R[0][2]*N[2],R[1][0]*N[0]+R[1][1]*N[1]+R[1][2]*N[2],R[2][0]*N[0]+R[2][1]*N[1]+R[2][2]*N[2]])},1t:l(a){o(a.W){9 A=7.K.4,N=7.W.4;9 b=A[0],18=A[1],1a=A[2],2M=N[0],2L=N[1],2Q=N[2];9 c=7.K.1t(a).4;9 d=b+2M,2p=18+2L,2m=1a+2Q;9 Q=a.1r([d,2p,2m]).4;9 e=[Q[0]+(Q[0]-d)-c[0],Q[1]+(Q[1]-2p)-c[1],Q[2]+(Q[2]-2m)-c[2]];8 11.u(c,e)}1d o(a.U){8 7.1V(F.1A,a)}1d{9 P=a.4||a;8 11.u(7.K.1t([P[0],P[1],(P[2]||0)]),7.W)}},1Z:l(a,b,c){a=v.u(a);a=a.1N();o(a===w){8 w}b=v.u(b);b=b.1N();o(b===w){8 w}o(1g(c)==\'1f\'){c=w}1d{c=v.u(c);c=c.1N();o(c===w){8 w}}9 d=a.4[0],18=a.4[1],1a=a.4[2];9 e=b.4[0],1W=b.4[1],1X=b.4[2];9 f,1i;o(c!==w){9 g=c.4[0],2l=c.4[1],2t=c.4[2];f=v.u([(1W-18)*(2t-1a)-(1X-1a)*(2l-18),(1X-1a)*(g-d)-(e-d)*(2t-1a),(e-d)*(2l-18)-(1W-18)*(g-d)]);1i=f.1u();o(1i===0){8 w}f=v.u([f.4[0]/1i,f.4[1]/1i,f.4[2]/1i])}1d{1i=F.1x(e*e+1W*1W+1X*1X);o(1i===0){8 w}f=v.u([b.4[0]/1i,b.4[1]/1i,b.4[2]/1i])}7.K=a;7.W=f;8 7}};11.u=l(a,b,c){9 P=25 11();8 P.1Z(a,b,c)};11.2I=11.u(v.1j(3),v.k);11.2H=11.u(v.1j(3),v.i);11.2G=11.u(v.1j(3),v.j);11.36=11.2I;11.35=11.2H;11.3j=11.2G;9 $V=v.u;9 $M=S.u;9 $L=14.u;9 $P=11.u;',62,206,'||||elements|||this|return|var||||||||||||function|||if||length||||create|Vector|null|||||||||Math|nj|while||do|anchor||||||||Matrix||direction||normal||||kj|Plane|ni|abs|Line|ki|precision|Sylvester|A2|push|A3|map|els|else||undefined|typeof|contains|mod|Zero|D3|D2|isParallelTo|kp|distanceFrom|cols|dup|pointClosestTo|np|reflectionIn|modulus|intersects|A1|sqrt|isSquare|X2|PI|X3|angleFrom|mod1|C2|mod2|sin|cos|break|C3|toRightTriangular|false|Y3|to3D|E2|E1|E3|Rotation|Y2|Y1|intersectionWith|rotate|v12|v13|rank|setVectors|nc|sum|multiply|prototype|eql|new|setElements|case|each|PA3|PA2|part|new_element|round|for|cross|product|AD2|isSameSizeAs|add|isPerpendicularTo|v22|AN3|inspect|AD3|AN2|toUnitVector|PsubQ3|PsubQ2|v23|dot|divisor|inverse|true|isSingular|determinant|max|canMultiplyFromLeft|subtract|rows|col|random|ZX|YZ|XY|Random|join|N2|N1|D1|slice|default|N3|dimensions|switch|liesIn|translate|snapTo|augment|Diagonal|trace|indexOf|diagonal|transpose|minor|row|isAntiparallelTo|ZY|YX|acos|RotationZ|RotationY|liesOn|RotationX|inv|rk|tr|det|toDiagonalMatrix|toUpperTriangular|version|XZ'.split('|'),0,{}))
\ No newline at end of file
diff --git a/player/js/3rd_party/transformation-matrix.js b/player/js/3rd_party/transformation-matrix.js
index d1045eb..75ed5e9 100644
--- a/player/js/3rd_party/transformation-matrix.js
+++ b/player/js/3rd_party/transformation-matrix.js
@@ -29,6 +29,11 @@
 
 var Matrix = (function(){
 
+    var _cos = Math.cos;
+    var _sin = Math.sin;
+    var _tan = Math.tan;
+    var _rnd = Math.round;
+
     function reset(){
         this.props[0] = 1;
         this.props[1] = 0;
@@ -53,48 +58,36 @@
         if(angle === 0){
             return this;
         }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos, -mSin,  0, 0
-            , mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1);
+        var mCos = _cos(angle);
+        var mSin = _sin(angle);
+        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
     }
 
     function rotateX(angle){
         if(angle === 0){
             return this;
         }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(1, 0, 0, 0
-            , 0, mCos, -mSin, 0
-            , 0, mSin,  mCos, 0
-            , 0, 0, 0, 1);
+        var mCos = _cos(angle);
+        var mSin = _sin(angle);
+        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
     }
 
     function rotateY(angle){
         if(angle === 0){
             return this;
         }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos,  0,  mSin, 0
-            , 0, 1, 0, 0
-            , -mSin,  0,  mCos, 0
-            , 0, 0, 0, 1);
+        var mCos = _cos(angle);
+        var mSin = _sin(angle);
+        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
     }
 
     function rotateZ(angle){
         if(angle === 0){
             return this;
         }
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos, -mSin,  0, 0
-            , mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1);
+        var mCos = _cos(angle);
+        var mSin = _sin(angle);
+        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
     }
 
     function shear(sx,sy){
@@ -102,25 +95,16 @@
     }
 
     function skew(ax, ay){
-        return this.shear(Math.tan(ax), Math.tan(ay));
+        return this.shear(_tan(ax), _tan(ay));
     }
 
     function skewFromAxis(ax, angle){
-        var mCos = Math.cos(angle);
-        var mSin = Math.sin(angle);
-        return this._t(mCos, mSin,  0, 0
-            , -mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1)
-            ._t(1, 0,  0, 0
-            , Math.tan(ax),  1, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1)
-            ._t(mCos, -mSin,  0, 0
-            , mSin,  mCos, 0, 0
-            , 0,  0,  1, 0
-            , 0, 0, 0, 1);
-        //return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, Math.tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);
+        var mCos = _cos(angle);
+        var mSin = _sin(angle);
+        return this._t(mCos, mSin,  0, 0, -mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1)
+            ._t(1, 0,  0, 0, _tan(ax),  1, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1)
+            ._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
+        //return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, _tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);
     }
 
     function scale(sx, sy, sz) {
@@ -161,62 +145,85 @@
 
     function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
 
-        if(a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0){
-            if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+        var _p = this.props;
 
-                this.props[12] = this.props[12] * a2 + this.props[13] * e2 + this.props[14] * i2 + this.props[15] * m2 ;
-                this.props[13] = this.props[12] * b2 + this.props[13] * f2 + this.props[14] * j2 + this.props[15] * n2 ;
-                this.props[14] = this.props[12] * c2 + this.props[13] * g2 + this.props[14] * k2 + this.props[15] * o2 ;
-                this.props[15] = this.props[12] * d2 + this.props[13] * h2 + this.props[14] * l2 + this.props[15] * p2 ;
-            }
+        if(a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0){
+            //NOTE: commenting this condition because TurboFan deoptimizes code when present
+            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+                _p[12] = _p[12] * a2 + _p[15] * m2;
+                _p[13] = _p[13] * f2 + _p[15] * n2;
+                _p[14] = _p[14] * k2 + _p[15] * o2;
+                _p[15] = _p[15] * p2;
+            //}
+            this._identityCalculated = false;
             return this;
         }
 
-        var a1 = this.props[0];
-        var b1 = this.props[1];
-        var c1 = this.props[2];
-        var d1 = this.props[3];
-        var e1 = this.props[4];
-        var f1 = this.props[5];
-        var g1 = this.props[6];
-        var h1 = this.props[7];
-        var i1 = this.props[8];
-        var j1 = this.props[9];
-        var k1 = this.props[10];
-        var l1 = this.props[11];
-        var m1 = this.props[12];
-        var n1 = this.props[13];
-        var o1 = this.props[14];
-        var p1 = this.props[15];
+        var a1 = _p[0];
+        var b1 = _p[1];
+        var c1 = _p[2];
+        var d1 = _p[3];
+        var e1 = _p[4];
+        var f1 = _p[5];
+        var g1 = _p[6];
+        var h1 = _p[7];
+        var i1 = _p[8];
+        var j1 = _p[9];
+        var k1 = _p[10];
+        var l1 = _p[11];
+        var m1 = _p[12];
+        var n1 = _p[13];
+        var o1 = _p[14];
+        var p1 = _p[15];
 
         /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        this.props[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        this.props[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        this.props[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        this.props[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
+        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
+        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
 
-        this.props[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        this.props[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        this.props[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        this.props[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
+        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
+        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
+        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
 
-        this.props[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        this.props[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        this.props[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        this.props[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
+        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
+        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
+        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
 
-        this.props[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        this.props[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        this.props[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        this.props[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
+        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
+        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
+        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
 
+        this._identityCalculated = false;
         return this;
     }
 
+    function isIdentity() {
+        if(!this._identityCalculated){
+            this._identity = !(this.props[0] !== 1 || this.props[1] !== 0 || this.props[2] !== 0 || this.props[3] !== 0 || this.props[4] !== 0 || this.props[5] !== 1 || this.props[6] !== 0 || this.props[7] !== 0 || this.props[8] !== 0 || this.props[9] !== 0 || this.props[10] !== 1 || this.props[11] !== 0 || this.props[12] !== 0 || this.props[13] !== 0 || this.props[14] !== 0 || this.props[15] !== 1);
+            this._identityCalculated = true;
+        }
+        return this._identity;
+    }
+
+    function equals(matr){
+        var i = 0;
+        while (i < 16) {
+            if(matr.props[i] !== this.props[i]) {
+                return false;
+            }
+            i+=1;
+        }
+        return true;
+    }
+
     function clone(matr){
         var i;
         for(i=0;i<16;i+=1){
@@ -272,38 +279,83 @@
         return retPts;
     }
 
-    function applyToPointArray(x,y,z,dimensions){
-        if(dimensions && dimensions === 2) {
-            var arr = point_pool.newPoint();
-            arr[0] = x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12]; 
-            arr[1] = x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13]; 
-            return arr;    
+    function applyToTriplePoints(pt1, pt2, pt3) {
+        var arr = createTypedArray('float32', 6);
+        if(this.isIdentity()) {
+            arr[0] = pt1[0];
+            arr[1] = pt1[1];
+            arr[2] = pt2[0];
+            arr[3] = pt2[1];
+            arr[4] = pt3[0];
+            arr[5] = pt3[1];
+        } else {
+            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
+            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
         }
-        return [x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]];
-    }
-    function applyToPointStringified(x, y) {
-        return (bm_rnd(x * this.props[0] + y * this.props[4] + this.props[12]))+','+(bm_rnd(x * this.props[1] + y * this.props[5] + this.props[13]));
+        return arr;
     }
 
-    function toArray() {
-        return [this.props[0],this.props[1],this.props[2],this.props[3],this.props[4],this.props[5],this.props[6],this.props[7],this.props[8],this.props[9],this.props[10],this.props[11],this.props[12],this.props[13],this.props[14],this.props[15]];
+    function applyToPointArray(x,y,z){
+        var arr;
+        if(this.isIdentity()) {
+            arr = [x,y,z];
+        } else {
+            arr = [x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]];
+        }
+        return arr;
+    }
+
+    function applyToPointStringified(x, y) {
+        if(this.isIdentity()) {
+            return x + ',' + y;
+        }
+        var _p = this.props;
+        return Math.round((x * _p[0] + y * _p[4] + _p[12]) * 100) / 100+','+ Math.round((x * _p[1] + y * _p[5] + _p[13]) * 100) / 100;
     }
 
     function toCSS() {
-        if(isSafari){
-            return "matrix3d(" + roundTo2Decimals(this.props[0]) + ',' + roundTo2Decimals(this.props[1]) + ',' + roundTo2Decimals(this.props[2]) + ',' + roundTo2Decimals(this.props[3]) + ',' + roundTo2Decimals(this.props[4]) + ',' + roundTo2Decimals(this.props[5]) + ',' + roundTo2Decimals(this.props[6]) + ',' + roundTo2Decimals(this.props[7]) + ',' + roundTo2Decimals(this.props[8]) + ',' + roundTo2Decimals(this.props[9]) + ',' + roundTo2Decimals(this.props[10]) + ',' + roundTo2Decimals(this.props[11]) + ',' + roundTo2Decimals(this.props[12]) + ',' + roundTo2Decimals(this.props[13]) + ',' + roundTo2Decimals(this.props[14]) + ',' + roundTo2Decimals(this.props[15]) + ')';
-        } else {
-            this.cssParts[1] = this.props.join(',');
-            return this.cssParts.join('');
+        //Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.
+        /*if(this.isIdentity()) {
+            return '';
+        }*/
+        var i = 0;
+        var props = this.props;
+        var cssValue = 'matrix3d(';
+        var v = 10000;
+        while(i<16){
+            cssValue += _rnd(props[i]*v)/v;
+            cssValue += i === 15 ? ')':',';
+            i += 1;
         }
+        return cssValue;
+    }
+
+    function roundMatrixProperty(val) {
+        var v = 10000;
+        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+            return _rnd(val * v) / v;
+        }
+        return val;
     }
 
     function to2dCSS() {
-        return "matrix(" + this.props[0] + ',' + this.props[1] + ',' + this.props[4] + ',' + this.props[5] + ',' + this.props[12] + ',' + this.props[13] + ")";
-    }
-
-    function toString() {
-        return "" + this.toArray();
+        //Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.
+        /*if(this.isIdentity()) {
+            return '';
+        }*/
+        var props = this.props;
+        var _a = roundMatrixProperty(props[0]);
+        var _b = roundMatrixProperty(props[1]);
+        var _c = roundMatrixProperty(props[4]);
+        var _d = roundMatrixProperty(props[5]);
+        var _e = roundMatrixProperty(props[12]);
+        var _f = roundMatrixProperty(props[13]);
+        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
     }
 
     return function(){
@@ -324,24 +376,21 @@
         this.applyToY = applyToY;
         this.applyToZ = applyToZ;
         this.applyToPointArray = applyToPointArray;
+        this.applyToTriplePoints = applyToTriplePoints;
         this.applyToPointStringified = applyToPointStringified;
-        this.toArray = toArray;
         this.toCSS = toCSS;
         this.to2dCSS = to2dCSS;
-        this.toString = toString;
         this.clone = clone;
         this.cloneFromProps = cloneFromProps;
+        this.equals = equals;
         this.inversePoints = inversePoints;
         this.inversePoint = inversePoint;
         this._t = this.transform;
+        this.isIdentity = isIdentity;
+        this._identity = true;
+        this._identityCalculated = false;
 
-        this.props = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
-
-        this.cssParts = ['matrix3d(','',')'];
-    }
+        this.props = createTypedArray('float32', 16);
+        this.reset();
+    };
 }());
-
-function Matrix() {
-
-
-}
diff --git a/player/js/EffectsManager.js b/player/js/EffectsManager.js
new file mode 100644
index 0000000..bec6706
--- /dev/null
+++ b/player/js/EffectsManager.js
@@ -0,0 +1,63 @@
+function EffectsManager(data,element){
+    var effects = data.ef || [];
+    this.effectElements = [];
+    var i,len = effects.length;
+    var effectItem;
+    for(i=0;i<len;i++) {
+        effectItem = new GroupEffect(effects[i],element);
+        this.effectElements.push(effectItem);
+    }
+}
+
+function GroupEffect(data,element){
+    this.init(data,element);
+}
+
+extendPrototype([DynamicPropertyContainer], GroupEffect);
+
+GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
+
+GroupEffect.prototype.init = function(data,element){
+    this.data = data;
+    this.effectElements = [];
+    this.initDynamicPropertyContainer(element);
+    var i, len = this.data.ef.length;
+    var eff, effects = this.data.ef;
+    for(i=0;i<len;i+=1){
+        eff = null;
+        switch(effects[i].ty){
+            case 0:
+                eff = new SliderEffect(effects[i],element,this);
+                break;
+            case 1:
+                eff = new AngleEffect(effects[i],element,this);
+                break;
+            case 2:
+                eff = new ColorEffect(effects[i],element,this);
+                break;
+            case 3:
+                eff = new PointEffect(effects[i],element,this);
+                break;
+            case 4:
+            case 7:
+                eff = new CheckboxEffect(effects[i],element,this);
+                break;
+            case 10:
+                eff = new LayerIndexEffect(effects[i],element,this);
+                break;
+            case 11:
+                eff = new MaskIndexEffect(effects[i],element,this);
+                break;
+            case 5:
+                eff = new EffectsManager(effects[i],element,this);
+                break;
+            //case 6:
+            default:
+                eff = new NoValueEffect(effects[i],element,this);
+                break;
+        }
+        if(eff) {
+            this.effectElements.push(eff);
+        }
+    }
+};
\ No newline at end of file
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index 4a6ad12..74ae6af 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -12,7 +12,6 @@
     this.playDirection = 1;
     this.pendingElements = 0;
     this.playCount = 0;
-    this.prerenderFramesFlag = true;
     this.animationData = {};
     this.layers = [];
     this.assets = [];
@@ -21,17 +20,17 @@
     this.loop = true;
     this.renderer = null;
     this.animationID = randomString(10);
-    this.scaleMode = 'fit';
     this.assetsPath = '';
     this.timeCompleted = 0;
     this.segmentPos = 0;
     this.subframeEnabled = subframeEnabled;
     this.segments = [];
-    this.pendingSegment = false;
     this._idle = true;
     this.projectInterface = ProjectInterface();
 };
 
+extendPrototype([BaseEvent], AnimationItem);
+
 AnimationItem.prototype.setParams = function(params) {
     var self = this;
     if(params.context){
@@ -70,8 +69,8 @@
     }
     this.autoplay = 'autoplay' in params ? params.autoplay : true;
     this.name = params.name ? params.name :  '';
-    this.prerenderFramesFlag = 'prerender' in params ? params.prerender : true;
     this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
+    this.assetsPath = params.assetsPath;
     if(params.animationData){
         self.configAnimation(params.animationData);
     }else if(params.path){
@@ -88,7 +87,6 @@
         }else{
             this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
         }
-        this.assetsPath = params.assetsPath;
         this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
         this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
         xhr.open('GET', params.path, true);
@@ -178,7 +176,7 @@
     if(expressionsPlugin){
         expressionsPlugin.initExpressions(this);
     }
-    this.renderer.renderFrame(null);
+    this.renderer.renderFrame(-1);
     this.loadNextSegment();
 };
 
@@ -221,12 +219,10 @@
 };
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(this.renderer && this.renderer.destroyed){
+    var _this = this;
+    if(!this.renderer){
         return;
     }
-    //console.log(JSON.parse(JSON.stringify(animData)));
-    //animData.w = Math.round(animData.w/blitter);
-    //animData.h = Math.round(animData.h/blitter);
     this.animationData = animData;
     this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
     this.animationData.tf = this.totalFrames;
@@ -249,7 +245,11 @@
     this.imagePreloader = new ImagePreloader();
     this.imagePreloader.setAssetsPath(this.assetsPath);
     this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(animData.assets);
+    this.imagePreloader.loadAssets(animData.assets, function(err) {
+        if(!err) {
+            _this.trigger('loaded_images');
+        }
+    });
     this.loadSegments();
     this.updaFrameModifier();
     if(this.renderer.globalData.fontManager){
@@ -273,12 +273,12 @@
 
     return function(){
         checkFontsLoaded.bind(this)();
-    }
+    };
 }());
 
 AnimationItem.prototype.addPendingElement = function () {
     this.pendingElements += 1;
-}
+};
 
 AnimationItem.prototype.elementLoaded = function () {
     this.pendingElements--;
@@ -308,14 +308,10 @@
 
 AnimationItem.prototype.setSubframe = function(flag){
     this.subframeEnabled = flag ? true : false;
-}
+};
 
 AnimationItem.prototype.gotoFrame = function () {
-    if(this.subframeEnabled){
-        this.currentFrame = this.currentRawFrame;
-    }else{
-        this.currentFrame = Math.floor(this.currentRawFrame);
-    }
+    this.currentFrame = this.subframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
 
     if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
         this.currentFrame = this.timeCompleted;
@@ -328,7 +324,6 @@
     if(this.isLoaded === false){
         return;
     }
-    //console.log('this.currentFrame:',this.currentFrame + this.firstFrame);
     this.renderer.renderFrame(this.currentFrame + this.firstFrame);
 };
 
@@ -351,10 +346,8 @@
     }
     if(this.isPaused === false){
         this.isPaused = true;
-        if(!this.pendingSegment){
-            this._idle = true;
-            this.trigger('_idle');
-        }
+        this._idle = true;
+        this.trigger('_idle');
     }
 };
 
@@ -374,9 +367,8 @@
         return;
     }
     this.pause();
-    this.currentFrame = this.currentRawFrame = 0;
     this.playCount = 0;
-    this.gotoFrame();
+    this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
@@ -397,32 +389,49 @@
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if(this.pendingSegment){
-        this.pendingSegment = false;
-        this.adjustSegment(this.segments.shift());
-        if(this.isPaused){
-            this.play();
-        }
-        return;
-    }
     if (this.isPaused === true || this.isLoaded === false) {
         return;
     }
-    this.setCurrentRawFrameValue(this.currentRawFrame + value * this.frameModifier);
-};
-
-AnimationItem.prototype.updateAnimation = function (perc) {
-    this.setCurrentRawFrameValue(this.totalFrames * perc);
-};
-
-AnimationItem.prototype.moveFrame = function (value, name) {
-    if(name && this.name != name){
-        return;
+    var nextValue = this.currentRawFrame + value * this.frameModifier;
+    var _isComplete = false;
+    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+        if (!this.loop || this.playCount === this.loop) {
+            if (!this.checkSegments(nextValue % this.totalFrames)) {
+                _isComplete = true;
+                nextValue = this.totalFrames - 1;
+            }
+        } else if (nextValue >= this.totalFrames) {
+            this.playCount += 1;
+            if (!this.checkSegments(nextValue % this.totalFrames)) {
+                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+                this.trigger('loopComplete');
+            }
+        } else {
+            this.setCurrentRawFrameValue(nextValue);
+        }
+    } else if(nextValue < 0) {
+        if (!this.checkSegments(nextValue % this.totalFrames)) {
+            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
+                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+                this.trigger('loopComplete');
+            } else {
+                _isComplete = true;
+                nextValue = 0;
+            }
+        }
+    } else {
+        this.setCurrentRawFrameValue(nextValue);
     }
-    this.setCurrentRawFrameValue(this.currentRawFrame+value);
+    if (_isComplete) {
+        this.setCurrentRawFrameValue(nextValue);
+        this.pause();
+        this.trigger('complete');
+    }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr){
+AnimationItem.prototype.adjustSegment = function(arr, offset){
     this.playCount = 0;
     if(arr[1] < arr[0]){
         if(this.frameModifier > 0){
@@ -432,9 +441,9 @@
                 this.setDirection(-1);
             }
         }
-        this.totalFrames = arr[0] - arr[1];
+        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
         this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.01);
+        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
     } else if(arr[1] > arr[0]){
         if(this.frameModifier < 0){
             if(this.playSpeed < 0){
@@ -443,9 +452,9 @@
                 this.setDirection(1);
             }
         }
-        this.totalFrames = arr[1] - arr[0];
+        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
         this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0);
+        this.setCurrentRawFrameValue(0.001 + offset);
     }
     this.trigger('segmentStart');
 };
@@ -455,16 +464,16 @@
         if (this.currentRawFrame + this.firstFrame < init) {
             pendingFrame = init;
         } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init - 0.01;
+            pendingFrame = end - init;
         }
     }
 
     this.firstFrame = init;
-    this.totalFrames = end - init;
+    this.timeCompleted = this.totalFrames = end - init;
     if(pendingFrame !== -1) {
         this.goToAndStop(pendingFrame,true);
     }
-}
+};
 
 AnimationItem.prototype.playSegments = function (arr,forceFlag) {
     if(typeof arr[0] === 'object'){
@@ -476,7 +485,7 @@
         this.segments.push(arr);
     }
     if(forceFlag){
-        this.adjustSegment(this.segments.shift());
+        this.checkSegments(0);
     }
     if(this.isPaused){
         this.play();
@@ -485,78 +494,33 @@
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
     this.segments.length = 0;
-    this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+    this.segments.push([this.animationData.ip,this.animationData.op]);
+    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
     if(forceFlag){
-        this.adjustSegment(this.segments.shift());
+        this.checkSegments(0);
     }
 };
-AnimationItem.prototype.checkSegments = function(){
-    if(this.segments.length){
-        this.pendingSegment = true;
+AnimationItem.prototype.checkSegments = function(offset){
+    if(this.segments.length) {
+        this.adjustSegment(this.segments.shift(), offset);
+        return true;
     }
-}
-
-AnimationItem.prototype.remove = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.renderer.destroy();
+    return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if((name && this.name != name) || (this.renderer && this.renderer.destroyed)){
+    if((name && this.name != name) || !this.renderer){
         return;
     }
     this.renderer.destroy();
     this.trigger('destroy');
     this._cbs = null;
     this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
+    this.renderer = null;
 };
 
 AnimationItem.prototype.setCurrentRawFrameValue = function(value){
     this.currentRawFrame = value;
-    //console.log(this.totalFrames);
-    if (this.currentRawFrame >= this.totalFrames) {
-        this.checkSegments();
-        if(this.loop === false){
-            this.currentRawFrame = this.totalFrames - 0.01;
-            this.gotoFrame();
-            this.pause();
-            this.trigger('complete');
-            return;
-        }else{
-            this.trigger('loopComplete');
-            this.playCount += 1;
-            if((this.loop !== true && this.playCount == this.loop) || this.pendingSegment){
-                this.currentRawFrame = this.totalFrames - 0.01;
-                this.gotoFrame();
-                this.pause();
-                this.trigger('complete');
-                return;
-            } else {
-                this.currentRawFrame = this.currentRawFrame % this.totalFrames;
-            }
-        }
-    } else if (this.currentRawFrame < 0) {
-        this.checkSegments();
-        this.playCount -= 1;
-        if(this.playCount < 0){
-            this.playCount = 0;
-        }
-        if(this.loop === false  || this.pendingSegment){
-            this.currentRawFrame = 0;
-            this.gotoFrame();
-            this.pause();
-            this.trigger('complete');
-            return;
-        }else{
-            this.trigger('loopComplete');
-            this.currentRawFrame = (this.totalFrames + this.currentRawFrame) % this.totalFrames;
-            this.gotoFrame();
-            return;
-        }
-    }
-
     this.gotoFrame();
 };
 
@@ -616,6 +580,10 @@
     return this.assets;
 };
 
+AnimationItem.prototype.getDuration = function (isFrame) {
+    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+};
+
 AnimationItem.prototype.trigger = function(name){
     if(this._cbs && this._cbs[name]){
         switch(name){
@@ -654,7 +622,3 @@
         this.onDestroy.call(this,new BMDestroyEvent(name,this));
     }
 };
-
-AnimationItem.prototype.addEventListener = _addEventListener;
-AnimationItem.prototype.removeEventListener = _removeEventListener;
-AnimationItem.prototype.triggerEvent = _triggerEvent;
diff --git a/player/js/animation/AnimationManager.js b/player/js/animation/AnimationManager.js
index 5af73e7..63fd2c7 100644
--- a/player/js/animation/AnimationManager.js
+++ b/player/js/animation/AnimationManager.js
@@ -5,6 +5,7 @@
     var len = 0;
     var idled = true;
     var playingAnimationsNum = 0;
+    var _stopped = true;
 
     function removeElement(ev){
         var i = 0;
@@ -15,7 +16,7 @@
                 i -= 1;
                 len -= 1;
                 if(!animItem.isPaused){
-                    subtractPlayingCount();   
+                    subtractPlayingCount();
                 }
             }
             i += 1;
@@ -87,17 +88,7 @@
             registeredAnimations[i].animation.play(animation);
         }
     }
-
-    function moveFrame (value, animation) {
-        initTime = Date.now();
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.moveFrame(value,animation);
-        }
-    }
-
     function resume(nowTime) {
-
         var elapsedTime = nowTime - initTime;
         var i;
         for(i=0;i<len;i+=1){
@@ -105,13 +96,15 @@
         }
         initTime = nowTime;
         if(!idled) {
-            requestAnimationFrame(resume);
+            window.requestAnimationFrame(resume);
+        } else {
+            _stopped = true;
         }
     }
 
     function first(nowTime){
         initTime = nowTime;
-        requestAnimationFrame(resume);
+        window.requestAnimationFrame(resume);
     }
 
     function pause(animation) {
@@ -150,7 +143,8 @@
     }
 
     function searchAnimations(animationData, standalone, renderer){
-        var animElements = document.getElementsByClassName('bodymovin');
+        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+                  [].slice.call(document.getElementsByClassName('bodymovin')));
         var i, len = animElements.length;
         for(i=0;i<len;i+=1){
             if(renderer){
@@ -164,7 +158,7 @@
             }
             var body = document.getElementsByTagName('body')[0];
             body.innerHTML = '';
-            var div = document.createElement('div');
+            var div = createTag('div');
             div.style.width = '100%';
             div.style.height = '100%';
             div.setAttribute('data-bm-type',renderer);
@@ -180,34 +174,36 @@
         }
     }
 
-    function start(){
-        requestAnimationFrame(first);
-    }
+    /*function start(){
+        window.requestAnimationFrame(first);
+    }*/
 
     function activate(){
         if(idled){
             idled = false;
-            requestAnimationFrame(first);
+            if(_stopped) {
+                window.requestAnimationFrame(first);
+                _stopped = false;
+            }
         }
     }
 
     //start();
 
-    setTimeout(start,0);
+    //setTimeout(start,0);
 
     moduleOb.registerAnimation = registerAnimation;
     moduleOb.loadAnimation = loadAnimation;
     moduleOb.setSpeed = setSpeed;
     moduleOb.setDirection = setDirection;
     moduleOb.play = play;
-    moduleOb.moveFrame = moveFrame;
     moduleOb.pause = pause;
     moduleOb.stop = stop;
     moduleOb.togglePause = togglePause;
     moduleOb.searchAnimations = searchAnimations;
     moduleOb.resize = resize;
-    moduleOb.start = start;
+    //moduleOb.start = start;
     moduleOb.goToAndStop = goToAndStop;
     moduleOb.destroy = destroy;
     return moduleOb;
-}());
\ No newline at end of file
+}());
diff --git a/player/js/effects.js b/player/js/effects.js
deleted file mode 100644
index 79cbd5f..0000000
--- a/player/js/effects.js
+++ /dev/null
@@ -1,76 +0,0 @@
-function EffectsManager(data,element,dynamicProperties){
-    var effects = data.ef;
-    this.effectElements = [];
-    var i,len = effects.length;
-    var effectItem;
-    for(i=0;i<len;i++) {
-        effectItem = new GroupEffect(effects[i],element,dynamicProperties);
-        this.effectElements.push(effectItem);
-    }
-}
-
-function GroupEffect(data,element,dynamicProperties){
-    this.dynamicProperties = [];
-    this.init(data,element,this.dynamicProperties);
-    if(this.dynamicProperties.length){
-        dynamicProperties.push(this);
-    }
-}
-
-GroupEffect.prototype.getValue = function(){
-    this.mdf = false;
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        this.mdf = this.dynamicProperties[i].mdf ? true : this.mdf;
-    }
-};
-
-GroupEffect.prototype.init = function(data,element,dynamicProperties){
-    this.data = data;
-    this.mdf = false;
-    this.effectElements = [];
-    var i, len = this.data.ef.length;
-    var eff, effects = this.data.ef;
-    for(i=0;i<len;i+=1){
-        switch(effects[i].ty){
-            case 0:
-                eff = new SliderEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 1:
-                eff = new AngleEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 2:
-                eff = new ColorEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 3:
-                eff = new PointEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 4:
-            case 7:
-                eff = new CheckboxEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 10:
-                eff = new LayerIndexEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 11:
-                eff = new MaskIndexEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 5:
-                eff = new EffectsManager(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-            case 6:
-                eff = new NoValueEffect(effects[i],element,dynamicProperties);
-                this.effectElements.push(eff);
-                break;
-        }
-    }
-};
\ No newline at end of file
diff --git a/player/js/effects/EffectsManagerPlaceholder.js b/player/js/effects/EffectsManagerPlaceholder.js
new file mode 100644
index 0000000..fed52b5
--- /dev/null
+++ b/player/js/effects/EffectsManagerPlaceholder.js
@@ -0,0 +1 @@
+function EffectsManager(){}
\ No newline at end of file
diff --git a/player/js/effects/SliderEffect.js b/player/js/effects/SliderEffect.js
index dcd3aba..94e31e5 100644
--- a/player/js/effects/SliderEffect.js
+++ b/player/js/effects/SliderEffect.js
@@ -1,23 +1,23 @@
-function SliderEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,dynamicProperties);
+function SliderEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
 }
-function AngleEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,dynamicProperties);
+function AngleEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
 }
-function ColorEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,dynamicProperties);
+function ColorEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
 }
-function PointEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,dynamicProperties);
+function PointEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
 }
-function LayerIndexEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,dynamicProperties);
+function LayerIndexEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
 }
-function MaskIndexEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,dynamicProperties);
+function MaskIndexEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
 }
-function CheckboxEffect(data,elem, dynamicProperties){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,dynamicProperties);
+function CheckboxEffect(data,elem, container){
+    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
 }
 function NoValueEffect(){
     this.p = {};
diff --git a/player/js/effects/StrokeEffectManager.js b/player/js/effects/StrokeEffectManager.js
deleted file mode 100644
index a783657..0000000
--- a/player/js/effects/StrokeEffectManager.js
+++ /dev/null
@@ -1,48 +0,0 @@
-function StrokeEffectManager(){}
-
-StrokeEffectManager.prototype.init = function(){
-    this.element.maskManager.registerEffect(this);
-    this.layerSize = this.element.getLayerSize();
-    this.svgElement = document.createElementNS(svgNS,'svg');
-    this.svgElement.setAttribute('width',this.layerSize.w);
-    this.svgElement.setAttribute('height',this.layerSize.h);
-    this.pathGroup = document.createElementNS(svgNS,'g');
-    this.path = document.createElementNS(svgNS,'path');
-    this.path.setAttribute('stroke-linecap','round');
-    this.path.setAttribute('fill','none');
-    this.svgElement.appendChild(this.path);
-    this.setStaticAttributes();
-    var maskElement = this.element.maskManager.getMaskelement();
-    maskElement.appendChild(this.pathGroup);
-    this.pathGroup.appendChild(this.path);
-    //this.svgElement.appendChild(this.path);
-};
-
-StrokeEffectManager.prototype.renderMask = function(num,masks){
-    var pathString = masks[this.data.path-1].pathString;
-    this.path.setAttribute('d', pathString);
-    var length = this.path.getTotalLength();
-    var startValue = this.data.animated.Start[num];
-    var endValue = this.data.animated.End[num];
-    var dashArrayString = "0 ";
-    dashArrayString +=startValue*length/100+" ";
-    dashArrayString +=(endValue-startValue)*length/100+" ";
-    dashArrayString +=(100-endValue)*length/100+" ";
-    this.path.style['stroke-dasharray'] = dashArrayString;
-    //this.path.style['stroke-dashoffset'] = -10;
-    //document.getElementById('stage').appendChild(this.svgElement);
-};
-
-StrokeEffectManager.prototype.setStaticAttributes = function(){
-    var staticData = this.data.static;
-    if(staticData['Brush Size']){
-        this.path.setAttribute('stroke-width',staticData['Brush Size']*2);
-    }
-    if(staticData.Color){
-        this.path.setAttribute('stroke',staticData.Color);
-    }
-};
-
-StrokeEffectManager.prototype.renderFrame = function(){
-
-};
\ No newline at end of file
diff --git a/player/js/effects/TintEffect.js b/player/js/effects/TintEffect.js
deleted file mode 100644
index e548f12..0000000
--- a/player/js/effects/TintEffect.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var TintEffect = (function(){
-    var grayMatrix = "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";
-}());
\ No newline at end of file
diff --git a/player/js/elements/BaseElement.js b/player/js/elements/BaseElement.js
index 833c499..23ec18b 100644
--- a/player/js/elements/BaseElement.js
+++ b/player/js/elements/BaseElement.js
@@ -1,244 +1,79 @@
 function BaseElement(){
-};
-BaseElement.prototype.checkMasks = function(){
-    if(!this.data.hasMask){
+}
+
+BaseElement.prototype = {
+    checkMasks: function(){
+        if(!this.data.hasMask){
+            return false;
+        }
+        var i = 0, len = this.data.masksProperties.length;
+        while(i<len) {
+            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+                return true;
+            }
+            i += 1;
+        }
         return false;
-    }
-    var i = 0, len = this.data.masksProperties.length;
-    while(i<len) {
-        if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-            return true;
+    },
+    initExpressions: function(){
+        this.layerInterface = LayerExpressionInterface(this);
+        if(this.data.hasMask && this.maskManager) {
+            this.layerInterface.registerMaskInterface(this.maskManager);
         }
-        i += 1;
-    }
-    return false;
-}
+        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
+        this.layerInterface.registerEffectsInterface(effectsInterface);
 
-BaseElement.prototype.checkParenting = function(){
-    if(this.data.parent !== undefined){
-        this.comp.buildElementParenting(this, this.data.parent);
-    }
-}
-
-BaseElement.prototype.prepareFrame = function(num){
-    if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-    {
-        if(this.isVisible !== true){
-            this.elemMdf = true;
-            this.globalData.mdf = true;
-            this.isVisible = true;
-            this.firstFrame = true;
-            if(this.data.hasMask){
-                this.maskManager.firstFrame = true;
-            }
+        if(this.data.ty === 0 || this.data.xt){
+            this.compInterface = CompExpressionInterface(this);
+        } else if(this.data.ty === 4){
+            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
+            this.layerInterface.content = this.layerInterface.shapeInterface;
+        } else if(this.data.ty === 5){
+            this.layerInterface.textInterface = TextExpressionInterface(this);
+            this.layerInterface.text = this.layerInterface.textInterface;
         }
-    }else{
-        if(this.isVisible !== false){
-            this.elemMdf = true;
-            this.globalData.mdf = true;
-            this.isVisible = false;
+    },
+    blendModeEnums: {
+        1:'multiply',
+        2:'screen',
+        3:'overlay',
+        4:'darken',
+        5:'lighten',
+        6:'color-dodge',
+        7:'color-burn',
+        8:'hard-light',
+        9:'soft-light',
+        10:'difference',
+        11:'exclusion',
+        12:'hue',
+        13:'saturation',
+        14:'color',
+        15:'luminosity'
+    },
+    getBlendMode: function(){
+        return this.blendModeEnums[this.data.bm] || '';
+    },
+    setBlendMode: function(){
+        var blendModeValue = this.getBlendMode();
+        var elem = this.baseElement || this.layerElement;
+
+        elem.style['mix-blend-mode'] = blendModeValue;
+    },
+    initBaseData: function(data, globalData, comp){
+        this.globalData = globalData;
+        this.comp = comp;
+        this.data = data;
+        this.layerId = 'ly_'+randomString(10);
+        
+        //Stretch factor for old animations missing this property.
+        if(!this.data.sr){
+            this.data.sr = 1;
         }
+        // effects manager
+        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
+        
+    },
+    getType: function(){
+        return this.type;
     }
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        if(this.isVisible || (this._isParent && this.dynamicProperties[i].type === 'transform')){
-            this.dynamicProperties[i].getValue();
-            if(this.dynamicProperties[i].mdf){
-                this.elemMdf = true;
-                this.globalData.mdf = true;
-            }
-        }
-    }
-    if(this.data.hasMask && this.isVisible){
-        this.maskManager.prepareFrame(num*this.data.sr);
-    }
-    
-    /* TODO check this
-    if(this.data.sy){
-        if(this.data.sy[0].renderedData[num]){
-            if(this.data.sy[0].renderedData[num].c){
-                this.feFlood.setAttribute('flood-color','rgb('+Math.round(this.data.sy[0].renderedData[num].c[0])+','+Math.round(this.data.sy[0].renderedData[num].c[1])+','+Math.round(this.data.sy[0].renderedData[num].c[2])+')');
-            }
-            if(this.data.sy[0].renderedData[num].s){
-                this.feMorph.setAttribute('radius',this.data.sy[0].renderedData[num].s);
-            }
-        }
-    }
-    */
-
-
-    this.currentFrameNum = num*this.data.sr;
-    return this.isVisible;
-};
-
-BaseElement.prototype.globalToLocal = function(pt){
-    var transforms = [];
-    transforms.push(this.finalTransform);
-    var flag = true;
-    var comp = this.comp;
-    while(flag){
-        if(comp.finalTransform){
-            if(comp.data.hasMask){
-                transforms.splice(0,0,comp.finalTransform);
-            }
-            comp = comp.comp;
-        } else {
-            flag = false;
-        }
-    }
-    var i, len = transforms.length,ptNew;
-    for(i=0;i<len;i+=1){
-        ptNew = transforms[i].mat.applyToPointArray(0,0,0);
-        //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-        pt = [pt[0] - ptNew[0],pt[1] - ptNew[1],0];
-    }
-    return pt;
-};
-
-BaseElement.prototype.initExpressions = function(){
-    this.layerInterface = LayerExpressionInterface(this);
-    //layers[i].layerInterface = LayerExpressionInterface(layers[i]);
-    //layers[i].layerInterface = LayerExpressionInterface(layers[i]);
-    if(this.data.hasMask){
-        this.layerInterface.registerMaskInterface(this.maskManager);
-    }
-    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-    this.layerInterface.registerEffectsInterface(effectsInterface);
-
-    if(this.data.ty === 0 || this.data.xt){
-        this.compInterface = CompExpressionInterface(this);
-    } else if(this.data.ty === 4){
-        this.layerInterface.shapeInterface = ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.layerInterface);
-    } else if(this.data.ty === 5){
-        this.layerInterface.textInterface = TextExpressionInterface(this);
-    }
-}
-
-BaseElement.prototype.setBlendMode = function(){
-    var blendModeValue = '';
-    switch(this.data.bm){
-        case 1:
-            blendModeValue = 'multiply';
-            break;
-        case 2:
-            blendModeValue = 'screen';
-            break;
-        case 3:
-            blendModeValue = 'overlay';
-            break;
-        case 4:
-            blendModeValue = 'darken';
-            break;
-        case 5:
-            blendModeValue = 'lighten';
-            break;
-        case 6:
-            blendModeValue = 'color-dodge';
-            break;
-        case 7:
-            blendModeValue = 'color-burn';
-            break;
-        case 8:
-            blendModeValue = 'hard-light';
-            break;
-        case 9:
-            blendModeValue = 'soft-light';
-            break;
-        case 10:
-            blendModeValue = 'difference';
-            break;
-        case 11:
-            blendModeValue = 'exclusion';
-            break;
-        case 12:
-            blendModeValue = 'hue';
-            break;
-        case 13:
-            blendModeValue = 'saturation';
-            break;
-        case 14:
-            blendModeValue = 'color';
-            break;
-        case 15:
-            blendModeValue = 'luminosity';
-            break;
-    }
-    var elem = this.baseElement || this.layerElement;
-
-    elem.style['mix-blend-mode'] = blendModeValue;
-}
-
-BaseElement.prototype.init = function(){
-    if(!this.data.sr){
-        this.data.sr = 1;
-    }
-    this.dynamicProperties = [];
-    if(this.data.ef){
-        this.effects = new EffectsManager(this.data,this,this.dynamicProperties);
-        //this.effect = this.effectsManager.bind(this.effectsManager);
-    }
-    //this.elemInterface = buildLayerExpressionInterface(this);
-    this.hidden = false;
-    this.firstFrame = true;
-    this.isVisible = false;
-    this._isParent = false;
-    this.currentFrameNum = -99999;
-    this.lastNum = -99999;
-    if(this.data.ks){
-        this.finalTransform = {
-            mProp: PropertyFactory.getProp(this,this.data.ks,2,null,this.dynamicProperties),
-            matMdf: false,
-            opMdf: false,
-            mat: new Matrix(),
-            opacity: 1
-        };
-        if(this.data.ao){
-            this.finalTransform.mProp.autoOriented = true;
-        }
-        this.finalTransform.op = this.finalTransform.mProp.o;
-        this.transform = this.finalTransform.mProp;
-        if(this.data.ty !== 11){
-            this.createElements();
-        }
-        if(this.data.hasMask){
-            this.addMasks(this.data);
-        }
-    }
-    this.elemMdf = false;
-};
-BaseElement.prototype.getType = function(){
-    return this.type;
-};
-
-BaseElement.prototype.resetHierarchy = function(){
-    if(!this.hierarchy){
-        this.hierarchy = [];
-    }else{
-        this.hierarchy.length = 0;
-    }
-};
-
-BaseElement.prototype.getHierarchy = function(){
-    if(!this.hierarchy){
-        this.hierarchy = [];
-    }
-    return this.hierarchy;
-};
-
-BaseElement.prototype.setHierarchy = function(hierarchy){
-    this.hierarchy = hierarchy;
-};
-
-BaseElement.prototype.getLayerSize = function(){
-    if(this.data.ty === 5){
-        return {w:this.data.textData.width,h:this.data.textData.height};
-    }else{
-        return {w:this.data.width,h:this.data.height};
-    }
-};
-
-BaseElement.prototype.hide = function(){
-
-};
-
-BaseElement.prototype.mHelper = new Matrix();
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/player/js/elements/CompElement.js b/player/js/elements/CompElement.js
index df83753..6fe2289 100644
--- a/player/js/elements/CompElement.js
+++ b/player/js/elements/CompElement.js
@@ -1,41 +1,43 @@
-function ICompElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? Array.apply(null,{length:this.layers.length}) : [];
-    if(this.data.tm){
-        this.tm = PropertyFactory.getProp(this,this.data.tm,0,globalData.frameRate,this.dynamicProperties);
-    }
-    if(this.data.xt){
-        this.layerElement = document.createElementNS(svgNS,'g');
-        this.buildAllItems();
-    } else if(!globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-}
-createElement(SVGBaseElement, ICompElement);
+function ICompElement(){}
 
-ICompElement.prototype.hide = function(){
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
+
+ICompElement.prototype.initElement = function(data,globalData,comp) {
+    this.initFrame();
+    this.initBaseData(data, globalData, comp);
+    this.initTransform(data, globalData, comp);
+    this.initRenderable();
+    this.initHierarchy();
+    this.initRendererElement();
+    this.createContainerElements();
+    this.addMasks();
+    if(this.data.xt || !globalData.progressiveLoad){
+        this.buildAllItems();
+    }
+    this.hide();
+};
+
+/*ICompElement.prototype.hide = function(){
     if(!this.hidden){
+        this.hideElement();
         var i,len = this.elements.length;
         for( i = 0; i < len; i+=1 ){
             if(this.elements[i]){
                 this.elements[i].hide();
             }
         }
-        this.hidden = true;
     }
-};
+};*/
 
 ICompElement.prototype.prepareFrame = function(num){
-    this._parent.prepareFrame.call(this,num);
-    if(this.isVisible===false && !this.data.xt){
+    this._mdf = false;
+    this.prepareRenderableFrame(num);
+    this.prepareProperties(num, this.isInRange);
+    if(!this.isInRange && !this.data.xt){
         return;
     }
 
-    if(this.tm){
+    if (!this.tm._placeholder) {
         var timeRemapped = this.tm.v;
         if(timeRemapped === this.data.op){
             timeRemapped = this.data.op - 1;
@@ -51,27 +53,20 @@
     for( i = 0; i < len; i+=1 ){
         if(this.completeLayers || this.elements[i]){
             this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+            if(this.elements[i]._mdf) {
+                this._mdf = true;
+            }
         }
     }
 };
 
-ICompElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
+ICompElement.prototype.renderInnerContent = function() {
     var i,len = this.layers.length;
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-
-    this.hidden = false;
-    for( i = 0; i < len; i+=1 ){
+    for( i = 0; i < len; i += 1 ){
         if(this.completeLayers || this.elements[i]){
             this.elements[i].renderFrame();
         }
     }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
 };
 
 ICompElement.prototype.setElements = function(elems){
@@ -82,8 +77,7 @@
     return this.elements;
 };
 
-ICompElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
+ICompElement.prototype.destroyElements = function(){
     var i,len = this.layers.length;
     for( i = 0; i < len; i+=1 ){
         if(this.elements[i]){
@@ -92,17 +86,7 @@
     }
 };
 
-ICompElement.prototype.checkLayers = SVGRenderer.prototype.checkLayers;
-ICompElement.prototype.buildItem = SVGRenderer.prototype.buildItem;
-ICompElement.prototype.buildAllItems = SVGRenderer.prototype.buildAllItems;
-ICompElement.prototype.buildElementParenting = SVGRenderer.prototype.buildElementParenting;
-ICompElement.prototype.createItem = SVGRenderer.prototype.createItem;
-ICompElement.prototype.createImage = SVGRenderer.prototype.createImage;
-ICompElement.prototype.createComp = SVGRenderer.prototype.createComp;
-ICompElement.prototype.createSolid = SVGRenderer.prototype.createSolid;
-ICompElement.prototype.createShape = SVGRenderer.prototype.createShape;
-ICompElement.prototype.createText = SVGRenderer.prototype.createText;
-ICompElement.prototype.createBase = SVGRenderer.prototype.createBase;
-ICompElement.prototype.appendElementInPos = SVGRenderer.prototype.appendElementInPos;
-ICompElement.prototype.checkPendingElements = SVGRenderer.prototype.checkPendingElements;
-ICompElement.prototype.addPendingElement = SVGRenderer.prototype.addPendingElement;
\ No newline at end of file
+ICompElement.prototype.destroy = function(){
+    this.destroyElements();
+    this.destroyBaseElement();
+};
diff --git a/player/js/elements/ImageElement.js b/player/js/elements/ImageElement.js
index a391222..b2e5a43 100644
--- a/player/js/elements/ImageElement.js
+++ b/player/js/elements/ImageElement.js
@@ -1,54 +1,19 @@
-function IImageElement(data,parentContainer,globalData,comp,placeholder){
+function IImageElement(data,globalData,comp){
     this.assetData = globalData.getAssetData(data.refId);
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp,placeholder);
+    this.initElement(data,globalData,comp);
 }
-createElement(SVGBaseElement, IImageElement);
 
-IImageElement.prototype.createElements = function(){
+extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+
+IImageElement.prototype.createContent = function(){
 
     var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    this._parent.createElements.call(this);
-
-    this.innerElem = document.createElementNS(svgNS,'image');
+    this.innerElem = createNS('image');
     this.innerElem.setAttribute('width',this.assetData.w+"px");
     this.innerElem.setAttribute('height',this.assetData.h+"px");
     this.innerElem.setAttribute('preserveAspectRatio','xMidYMid slice');
     this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    this.maskedElement = this.innerElem;
+    
     this.layerElement.appendChild(this.innerElem);
-    if(this.data.ln){
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.layerElement.setAttribute('class',this.data.cl);
-    }
-
 };
-
-IImageElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.layerElement.style.display = 'none';
-        this.hidden = true;
-    }
-};
-
-IImageElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    if(this.hidden){
-        this.hidden = false;
-        this.layerElement.style.display = 'block';
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-};
-
-IImageElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
-    this.innerElem =  null;
-};
\ No newline at end of file
diff --git a/player/js/elements/NullElement.js b/player/js/elements/NullElement.js
new file mode 100644
index 0000000..ce9f684
--- /dev/null
+++ b/player/js/elements/NullElement.js
@@ -0,0 +1,29 @@
+function NullElement(data,globalData,comp){
+    this.initFrame();
+	this.initBaseData(data, globalData, comp);
+    this.initFrame();
+    this.initTransform(data, globalData, comp);
+    this.initHierarchy();
+}
+
+NullElement.prototype.prepareFrame = function(num) {
+    this.prepareProperties(num, true);
+};
+
+NullElement.prototype.renderFrame = function() {
+};
+
+NullElement.prototype.getBaseElement = function() {
+	return null;
+};
+
+NullElement.prototype.destroy = function() {
+};
+
+NullElement.prototype.sourceRectAtTime = function() {
+};
+
+NullElement.prototype.hide = function() {
+};
+
+extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
diff --git a/player/js/elements/PlaceHolderElement.js b/player/js/elements/PlaceHolderElement.js
deleted file mode 100644
index 390e01a..0000000
--- a/player/js/elements/PlaceHolderElement.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var PlaceHolderElement = function (data,parentContainer,globalData){
-    this.data = data;
-    this.globalData = globalData;
-    if(parentContainer){
-        this.parentContainer = parentContainer;
-        var g = document.createElementNS(svgNS,'g');
-        g.setAttribute('id',this.data.id);
-        parentContainer.appendChild(g);
-        this.phElement = g;
-    }
-    this.layerId = 'ly_'+randomString(10);
-};
-PlaceHolderElement.prototype.prepareFrame = function(){};
-PlaceHolderElement.prototype.renderFrame = function(){};
-PlaceHolderElement.prototype.draw = function(){};
\ No newline at end of file
diff --git a/player/js/elements/ShapeElement.js b/player/js/elements/ShapeElement.js
index 1c278ac..d2cb45c 100644
--- a/player/js/elements/ShapeElement.js
+++ b/player/js/elements/ShapeElement.js
@@ -1,566 +1,71 @@
-function IShapeElement(data,parentContainer,globalData,comp, placeholder){
-    this.shapes = [];
-    this.shapesData = data.shapes;
-    this.stylesList = [];
-    this.viewData = [];
-    this.shapeModifiers = [];
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-}
-createElement(SVGBaseElement, IShapeElement);
-
-IShapeElement.prototype.lcEnum = {
-    '1': 'butt',
-    '2': 'round',
-    '3': 'butt'
+function IShapeElement(){
 }
 
-IShapeElement.prototype.ljEnum = {
-    '1': 'miter',
-    '2': 'round',
-    '3': 'butt'
-}
-
-IShapeElement.prototype.buildExpressionInterface = function(){};
-
-IShapeElement.prototype.createElements = function(){
-    //TODO check if I can use symbol so i can set its viewBox
-    this._parent.createElements.call(this);
-    this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.dynamicProperties, 0);
-    if(!this.data.hd || this.data.td){
-        styleUnselectableDiv(this.layerElement);
-    }
-    //this.elemInterface.registerShapeExpressionInterface(ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.elemInterface));
-};
-
-IShapeElement.prototype.setGradientData = function(pathElement,arr,data){
-
-    var gradientId = 'gr_'+randomString(10);
-    var gfill;
-    if(arr.t === 1){
-        gfill = document.createElementNS(svgNS,'linearGradient');
-    } else {
-        gfill = document.createElementNS(svgNS,'radialGradient');
-    }
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = arr.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = document.createElementNS(svgNS,'stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( arr.ty === 'gf' ? 'fill':'stroke','url(#'+gradientId+')');
-    this.globalData.defs.appendChild(gfill);
-    data.gf = gfill;
-    data.cst = stops;
-}
-
-IShapeElement.prototype.setGradientOpacity = function(arr, data, styleOb){
-    if((arr.g.k.k[0].s && arr.g.k.k[0].s.length > arr.g.p*4) || arr.g.k.k.length > arr.g.p*4){
-        var opFill;
-        var stop, j, jLen;
-        var mask = document.createElementNS(svgNS,"mask");
-        var maskElement = document.createElementNS(svgNS, 'path');
-        mask.appendChild(maskElement);
-        var opacityId = 'op_'+randomString(10);
-        var maskId = 'mk_'+randomString(10);
-        mask.setAttribute('id',maskId);
-        if(arr.t === 1){
-            opFill = document.createElementNS(svgNS,'linearGradient');
-        } else {
-            opFill = document.createElementNS(svgNS,'radialGradient');
+IShapeElement.prototype = {
+    addShapeToModifiers: function(data) {
+        var i, len = this.shapeModifiers.length;
+        for(i=0;i<len;i+=1){
+            this.shapeModifiers[i].addShape(data);
         }
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = arr.g.k.k[0].s ? arr.g.k.k[0].s.length : arr.g.k.k.length;
-        var stops = [];
-        for(j=arr.g.p*4;j<jLen;j+=2){
-            stop = document.createElementNS(svgNS,'stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            //stop.setAttribute('offset',Math.round(arr.y[j][0]*100)+'%');
-            //stop.setAttribute('style','stop-color:rgb(255,255,255);stop-opacity:'+arr.y[j][1]);
-            opFill.appendChild(stop);
-            stops.push(stop);
+    },
+    isShapeInAnimatedModifiers: function(data) {
+        var i = 0, len = this.shapeModifiers.length;
+        while(i < len) {
+            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
+                return true;
+            }
         }
-        maskElement.setAttribute( arr.ty === 'gf' ? 'fill':'stroke','url(#'+opacityId+')');
-        this.globalData.defs.appendChild(opFill);
-        this.globalData.defs.appendChild(mask);
-        data.of = opFill;
-        data.ost = stops;
-        styleOb.msElem = maskElement;
-        return maskId;
-    }
-};
-
-IShapeElement.prototype.searchShapes = function(arr,data,container,dynamicProperties, level, transformers){
-    transformers = transformers || [];
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownArrays = [], ownModifiers = [], styleOb, currentTransform;
-    for(i=len;i>=0;i-=1){
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            data[i] = {};
-            styleOb = {
-                type: arr[i].ty,
-                d: '',
-                ld: '',
-                lvl: level,
-                mdf: false
-            };
-            var pathElement = document.createElementNS(svgNS, "path");
-            data[i].o = PropertyFactory.getProp(this,arr[i].o,0,0.01,dynamicProperties);
-            if(arr[i].ty == 'st' || arr[i].ty == 'gs') {
-                pathElement.setAttribute('stroke-linecap', this.lcEnum[arr[i].lc] || 'round');
-                ////pathElement.style.strokeLinecap = this.lcEnum[arr[i].lc] || 'round';
-                pathElement.setAttribute('stroke-linejoin',this.ljEnum[arr[i].lj] || 'round');
-                ////pathElement.style.strokeLinejoin = this.ljEnum[arr[i].lj] || 'round';
-                pathElement.setAttribute('fill-opacity','0');
-                ////pathElement.style.fillOpacity = 0;
-                if(arr[i].lj == 1) {
-                    pathElement.setAttribute('stroke-miterlimit',arr[i].ml);
-                    ////pathElement.style.strokeMiterlimit = arr[i].ml;
-                }
-
-                data[i].w = PropertyFactory.getProp(this,arr[i].w,0,null,dynamicProperties);
-                if(arr[i].d){
-                    var d = PropertyFactory.getDashProp(this,arr[i].d,'svg',dynamicProperties);
-                    if(!d.k){
-                        pathElement.setAttribute('stroke-dasharray', d.dasharray);
-                        ////pathElement.style.strokeDasharray = d.dasharray;
-                        pathElement.setAttribute('stroke-dashoffset', d.dashoffset);
-                        ////pathElement.style.strokeDashoffset = d.dashoffset;
-                    }
-                    data[i].d = d;
-                }
-
-            }
-            if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
-                data[i].c = PropertyFactory.getProp(this,arr[i].c,1,255,dynamicProperties);
-                container.appendChild(pathElement);
-            } else {
-                data[i].g = PropertyFactory.getGradientProp(this,arr[i].g,dynamicProperties);
-                if(arr[i].t == 2){
-                    data[i].h = PropertyFactory.getProp(this,arr[i].h,1,0.01,dynamicProperties);
-                    data[i].a = PropertyFactory.getProp(this,arr[i].a,1,degToRads,dynamicProperties);
-                }
-                data[i].s = PropertyFactory.getProp(this,arr[i].s,1,null,dynamicProperties);
-                data[i].e = PropertyFactory.getProp(this,arr[i].e,1,null,dynamicProperties);
-                this.setGradientData(pathElement,arr[i],data[i], styleOb);
-                var maskId = this.setGradientOpacity(arr[i],data[i], styleOb);
-                if(maskId){
-                    pathElement.setAttribute('mask','url(#'+maskId+')');
-                }
-                data[i].elem = pathElement;
-                container.appendChild(pathElement);
-            }
-            if(arr[i].r === 2) {
-                pathElement.setAttribute('fill-rule', 'evenodd');
-            }
-
-            if(arr[i].ln){
-                pathElement.setAttribute('id',arr[i].ln);
-            }
-            if(arr[i].cl){
-                pathElement.setAttribute('class',arr[i].cl);
-            }
-            styleOb.pElem = pathElement;
-            this.stylesList.push(styleOb);
-            data[i].style = styleOb;
-            ownArrays.push(styleOb);
-        }else if(arr[i].ty == 'gr'){
-            data[i] = {
-                it: []
-            };
-            var g = document.createElementNS(svgNS,'g');
-            container.appendChild(g);
-            data[i].gr = g;
-            this.searchShapes(arr[i].it,data[i].it,g,dynamicProperties, level + 1, ownTransformers);
-        }else if(arr[i].ty == 'tr'){
-            data[i] = {
-                transform : {
-                    op: PropertyFactory.getProp(this,arr[i].o,0,0.01,dynamicProperties),
-                    mProps: PropertyFactory.getProp(this,arr[i],2,null,dynamicProperties)
-                },
-                elements: []
-            };
-            currentTransform = data[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            data[i] = {
-                elements : [],
-                caches:[],
-                styles : [],
-                transformers: ownTransformers,
-                lStr: ''
-            };
-            var ty = 4;
-            if(arr[i].ty == 'rc'){
-                ty = 5;
-            }else if(arr[i].ty == 'el'){
-                ty = 6;
-            }else if(arr[i].ty == 'sr'){
-                ty = 7;
-            }
-            data[i].sh = ShapePropertyFactory.getShapeProp(this,arr[i],ty,dynamicProperties);
-            data[i].lvl = level;
-            this.shapes.push(data[i].sh);
-            this.addShapeToModifiers(data[i]);
-            jLen = this.stylesList.length;
-            for(j=0;j<jLen;j+=1){
-                if(!this.stylesList[j].closed){
-                    data[i].elements.push({
-                        ty:this.stylesList[j].type,
-                        st: this.stylesList[j]
-                    });
-                }
-            }
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'rp'){
-            var modifier = ShapeModifiers.getModifier(arr[i].ty);
-            modifier.init(this,arr[i],dynamicProperties);
-            this.shapeModifiers.push(modifier);
-            ownModifiers.push(modifier);
-            data[i] = modifier;
+        return false;
+    },
+    renderModifiers: function() {
+        if(!this.shapeModifiers.length){
+            return;
         }
-    }
-    len = ownArrays.length;
-    for(i=0;i<len;i+=1){
-        ownArrays[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
+        var i, len = this.shapes.length;
+        for(i=0;i<len;i+=1){
+            this.shapes[i].sh.reset();
+        }
 
-IShapeElement.prototype.addShapeToModifiers = function(data) {
-    var i, len = this.shapeModifiers.length;
-    for(i=0;i<len;i+=1){
-        this.shapeModifiers[i].addShape(data);
-    }
-};
-
-IShapeElement.prototype.renderModifiers = function() {
-    if(!this.shapeModifiers.length){
-        return;
-    }
-    var i, len = this.shapes.length;
-    for(i=0;i<len;i+=1){
-        this.shapes[i].reset();
-    }
-
-
-    len = this.shapeModifiers.length;
-
-    for(i=len-1;i>=0;i-=1){
-        this.shapeModifiers[i].processShapes(this.firstFrame);
-    }
-};
-
-IShapeElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    this.globalToLocal([0,0,0]);
-    if(this.hidden){
-        this.layerElement.style.display = 'block';
-        this.hidden = false;
-    }
-    this.renderModifiers();
-    this.renderShape(null,null,true, null);
-};
-
-IShapeElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.layerElement.style.display = 'none';
-        var i, len = this.stylesList.length;
+        len = this.shapeModifiers.length;
         for(i=len-1;i>=0;i-=1){
-            if(this.stylesList[i].ld !== '0'){
-                this.stylesList[i].ld = '0';
-                this.stylesList[i].pElem.style.display = 'none';
-                if(this.stylesList[i].pElem.parentNode){
-                    this.stylesList[i].parent = this.stylesList[i].pElem.parentNode;
-                    //this.stylesList[i].pElem.parentNode.removeChild(this.stylesList[i].pElem);
-                }
+            this.shapeModifiers[i].processShapes(this._isFirstFrame);
+        }
+    },
+    lcEnum: {
+        '1': 'butt',
+        '2': 'round',
+        '3': 'square'
+    },
+    ljEnum: {
+        '1': 'miter',
+        '2': 'round',
+        '3': 'butt'
+    },
+    searchProcessedElement: function(elem){
+        var elements = this.processedElements;
+        var i = 0, len = elements.length;
+        while(i < len){
+            if(elements[i].elem === elem){
+                return elements[i].pos;
+            }
+            i += 1;
+        }
+        return 0;
+    },
+    addProcessedElement: function(elem, pos){
+        var elements = this.processedElements;
+        var i = elements.length;
+        while(i){
+            i -= 1;
+            if(elements[i].elem === elem){
+                elements[i].pos = pos;
+                return;
             }
         }
-        this.hidden = true;
+        elements.push(new ProcessedElement(elem, pos));
+    },
+    prepareFrame: function(num) {
+        this.prepareRenderableFrame(num);
+        this.prepareProperties(num, this.isInRange);
     }
-};
-
-IShapeElement.prototype.renderShape = function(items,data,isMain, container){
-    var i, len;
-    if(!items){
-        items = this.shapesData;
-        len = this.stylesList.length;
-        for(i=0;i<len;i+=1){
-            this.stylesList[i].d = '';
-            this.stylesList[i].mdf = false;
-        }
-    }
-    if(!data){
-        data = this.viewData;
-    }
-    ///
-    ///
-    len = items.length - 1;
-    var ty;
-    for(i=len;i>=0;i-=1){
-        ty = items[i].ty;
-        if(ty == 'tr'){
-            if(this.firstFrame || data[i].transform.op.mdf && container){
-                container.setAttribute('opacity',data[i].transform.op.v);
-            }
-            if(this.firstFrame || data[i].transform.mProps.mdf && container){
-                container.setAttribute('transform',data[i].transform.mProps.v.to2dCSS());
-            }
-        }else if(ty == 'sh' || ty == 'el' || ty == 'rc' || ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(ty == 'fl'){
-            this.renderFill(items[i],data[i]);
-        }else if(ty == 'gf'){
-            this.renderGradient(items[i],data[i]);
-        }else if(ty == 'gs'){
-            this.renderGradient(items[i],data[i]);
-            this.renderStroke(items[i],data[i]);
-        }else if(ty == 'st'){
-            this.renderStroke(items[i],data[i]);
-        }else if(ty == 'gr'){
-            this.renderShape(items[i].it,data[i].it,false, data[i].gr);
-        }else if(ty == 'tm'){
-            //
-        }
-    }
-    if(isMain) {
-        len = this.stylesList.length;
-        for (i = 0; i < len; i += 1) {
-            if (this.stylesList[i].ld === '0') {
-                this.stylesList[i].ld = '1';
-                this.stylesList[i].pElem.style.display = 'block';
-                //this.stylesList[i].parent.appendChild(this.stylesList[i].pElem);
-            }
-            if (this.stylesList[i].mdf || this.firstFrame) {
-                this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d);
-                if(this.stylesList[i].msElem){
-                    this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                }
-            }
-        }
-        if (this.firstFrame) {
-            this.firstFrame = false;
-        }
-    }
-
-};
-
-IShapeElement.prototype.renderPath = function(pathData,viewData){
-    var len, i, j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = viewData.elements.length;
-    var lvl = viewData.lvl;
-    for(l=0;l<lLen;l+=1){
-        redraw = viewData.sh.mdf || this.firstFrame;
-        pathStringTransformed = 'M0 0';
-        var paths = viewData.sh.paths;
-        jLen = paths._length;
-        if(viewData.elements[l].st.lvl < lvl){
-            var mat = this.mHelper.reset(), props;
-            var iterations = lvl - viewData.elements[l].st.lvl;
-            var k = viewData.transformers.length-1;
-            while(iterations > 0) {
-                redraw = viewData.transformers[k].mProps.mdf || redraw;
-                props = viewData.transformers[k].mProps.v.props;
-                mat.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
-                iterations --;
-                k --;
-            }
-            if(redraw){
-                for(j=0;j<jLen;j+=1){
-                    pathNodes = paths.shapes[j];
-                    if(pathNodes && pathNodes._length){
-                        len = pathNodes._length;
-                        for (i = 1; i < len; i += 1) {
-                            if (i == 1) {
-                                pathStringTransformed += " M" + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            }
-                            pathStringTransformed += " C" + mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + mat.applyToPointStringified(pathNodes.i[i][0], pathNodes.i[i][1]) + " " + mat.applyToPointStringified(pathNodes.v[i][0], pathNodes.v[i][1]);
-                        }
-                        if (len == 1) {
-                            pathStringTransformed += " M" + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                        }
-                        if (pathNodes.c) {
-                            pathStringTransformed += " C" + mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + mat.applyToPointStringified(pathNodes.i[0][0], pathNodes.i[0][1]) + " " + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            pathStringTransformed += 'z';
-                        }
-                    }
-                }
-                viewData.caches[l] = pathStringTransformed;
-            } else {
-                pathStringTransformed = viewData.caches[l];
-            }
-        } else {
-            if(redraw){
-                for(j=0;j<jLen;j+=1){
-                    pathNodes = paths.shapes[j];
-                    if(pathNodes && pathNodes._length){
-                        len = pathNodes._length;
-                        for (i = 1; i < len; i += 1) {
-                            if (i == 1) {
-                                //pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                                pathStringTransformed += " M" + pathNodes.v[0].join(',');
-                            }
-                            //pathStringTransformed += " C" + groupTransform.mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.i[i][0], pathNodes.i[i][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.v[i][0], pathNodes.v[i][1]);
-                            pathStringTransformed += " C" + pathNodes.o[i - 1].join(',') + " " + pathNodes.i[i].join(',') + " " + pathNodes.v[i].join(',');
-                        }
-                        if (len == 1) {
-                            //pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            pathStringTransformed += " M" + pathNodes.v[0].join(',');
-                        }
-                        if (pathNodes.c && len) {
-                            //pathStringTransformed += " C" + groupTransform.mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.i[0][0], pathNodes.i[0][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            pathStringTransformed += " C" + pathNodes.o[i - 1].join(',') + " " + pathNodes.i[0].join(',') + " " + pathNodes.v[0].join(',');
-                            pathStringTransformed += 'z';
-                        }
-                    }
-                }
-                viewData.caches[l] = pathStringTransformed;
-            } else {
-                pathStringTransformed = viewData.caches[l];
-            }
-        }
-        viewData.elements[l].st.d += pathStringTransformed;
-        viewData.elements[l].st.mdf = redraw || viewData.elements[l].st.mdf;
-    }
-
-};
-
-IShapeElement.prototype.renderFill = function(styleData,viewData){
-    var styleElem = viewData.style;
-
-    if(viewData.c.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-        ////styleElem.pElem.style.fill = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('fill-opacity',viewData.o.v);
-    }
-};
-
-IShapeElement.prototype.renderGradient = function(styleData,viewData){
-    var gfill = viewData.gf;
-    var opFill = viewData.of;
-    var pt1 = viewData.s.v,pt2 = viewData.e.v;
-
-    if(viewData.o.mdf || this.firstFrame){
-        var attr = styleData.ty === 'gf' ? 'fill-opacity':'stroke-opacity';
-        viewData.elem.setAttribute(attr,viewData.o.v);
-    }
-    //clippedElement.setAttribute('transform','matrix(1,0,0,1,-100,0)');
-    if(viewData.s.mdf || this.firstFrame){
-        var attr1 = styleData.t === 1 ? 'x1':'cx';
-        var attr2 = attr1 === 'x1' ? 'y1':'cy';
-        gfill.setAttribute(attr1,pt1[0]);
-        gfill.setAttribute(attr2,pt1[1]);
-        if(opFill){
-            opFill.setAttribute(attr1,pt1[0]);
-            opFill.setAttribute(attr2,pt1[1]);
-        }
-    }
-    var stops, i, len, stop;
-    if(viewData.g.cmdf || this.firstFrame){
-        stops = viewData.cst;
-        var cValues = viewData.g.c;
-        len = stops.length;
-        for(i=0;i<len;i+=1){
-            stop = stops[i];
-            stop.setAttribute('offset',cValues[i*4]+'%');
-            stop.setAttribute('stop-color','rgb('+cValues[i*4+1]+','+cValues[i*4+2]+','+cValues[i*4+3]+')');
-        }
-    }
-    if(opFill && (viewData.g.omdf || this.firstFrame)){
-        stops = viewData.ost;
-        var oValues = viewData.g.o;
-        len = stops.length;
-        for(i=0;i<len;i+=1){
-            stop = stops[i];
-            stop.setAttribute('offset',oValues[i*2]+'%');
-            stop.setAttribute('stop-opacity',oValues[i*2+1]);
-        }
-    }
-    if(styleData.t === 1){
-        if(viewData.e.mdf  || this.firstFrame){
-            gfill.setAttribute('x2',pt2[0]);
-            gfill.setAttribute('y2',pt2[1]);
-            if(opFill){
-                opFill.setAttribute('x2',pt2[0]);
-                opFill.setAttribute('y2',pt2[1]);
-            }
-        }
-    } else {
-        var rad;
-        if(viewData.s.mdf || viewData.e.mdf || this.firstFrame){
-            rad = Math.sqrt(Math.pow(pt1[0]-pt2[0],2)+Math.pow(pt1[1]-pt2[1],2));
-            gfill.setAttribute('r',rad);
-            if(opFill){
-                opFill.setAttribute('r',rad);
-            }
-        }
-        if(viewData.e.mdf || viewData.h.mdf || viewData.a.mdf || this.firstFrame){
-            if(!rad){
-                rad = Math.sqrt(Math.pow(pt1[0]-pt2[0],2)+Math.pow(pt1[1]-pt2[1],2));
-            }
-            var ang = Math.atan2(pt2[1]-pt1[1], pt2[0]-pt1[0]);
-
-            var percent = viewData.h.v >= 1 ? 0.99 : viewData.h.v <= -1 ? -0.99:viewData.h.v;
-            var dist = rad*percent;
-            var x = Math.cos(ang + viewData.a.v)*dist + pt1[0];
-            var y = Math.sin(ang + viewData.a.v)*dist + pt1[1];
-            gfill.setAttribute('fx',x);
-            gfill.setAttribute('fy',y);
-            if(opFill){
-                opFill.setAttribute('fx',x);
-                opFill.setAttribute('fy',y);
-            }
-        }
-        //gfill.setAttribute('fy','200');
-    }
-};
-
-IShapeElement.prototype.renderStroke = function(styleData,viewData){
-    var styleElem = viewData.style;
-    //TODO fix dashes
-    var d = viewData.d;
-    var dasharray,dashoffset;
-    if(d && d.k && (d.mdf || this.firstFrame)){
-        styleElem.pElem.setAttribute('stroke-dasharray', d.dasharray);
-        ////styleElem.pElem.style.strokeDasharray = d.dasharray;
-        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset);
-        ////styleElem.pElem.style.strokeDashoffset = d.dashoffset;
-    }
-    if(viewData.c && (viewData.c.mdf || this.firstFrame)){
-        styleElem.pElem.setAttribute('stroke','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-        ////styleElem.pElem.style.stroke = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('stroke-opacity',viewData.o.v);
-    }
-    if(viewData.w.mdf || this.firstFrame){
-        styleElem.pElem.setAttribute('stroke-width',viewData.w.v);
-        if(styleElem.msElem){
-            styleElem.msElem.setAttribute('stroke-width',viewData.w.v);
-        }
-        ////styleElem.pElem.style.strokeWidth = viewData.w.v;
-    }
-};
-
-IShapeElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
-    this.shapeData = null;
-    this.viewData = null;
-    this.parentContainer = null;
-    this.placeholder = null;
-};
+};
\ No newline at end of file
diff --git a/player/js/elements/ShapeItemElement.js b/player/js/elements/ShapeItemElement.js
deleted file mode 100644
index f6f8371..0000000
--- a/player/js/elements/ShapeItemElement.js
+++ /dev/null
@@ -1,399 +0,0 @@
-function ShapeItemElement(data,parentElement,parentContainer,placeholder,dynamicProperties,globalData){
-    this.shape = parentElement;
-    this.parentContainer = parentContainer;
-    this.placeholder = placeholder;
-
-    this.lcEnum = {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'butt'
-    };
-    this.ljEnum = {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    };
-    this.stylesList = [];
-    this.viewData = [];
-    this.elemData = data;
-    this.data = data.shapes;
-    this.globalData = globalData;
-    this.firstFrame = true;
-    this.searchShapes(this.data,this.viewData,dynamicProperties,[]);
-    styleUnselectableDiv(this.shape);
-}
-
-ShapeItemElement.prototype.appendNodeToParent = SVGBaseElement.prototype.appendNodeToParent;
-
-ShapeItemElement.prototype.searchShapes = function(arr,data,dynamicProperties,addedTrims){
-    var i, len = arr.length - 1;
-    var j, jLen;
-    //c: PropertyFactory.getProp()
-    var ownArrays = [], ownTrims = [];
-    for(i=len;i>=0;i-=1){
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
-            data[i] = {};
-            var pathElement;
-            data[i].c = PropertyFactory.getProp(this.elemData,arr[i].c,1,null,dynamicProperties);
-            data[i].o = PropertyFactory.getProp(this.elemData,arr[i].o,0,0.01,dynamicProperties);
-            if(arr[i].ty == 'st') {
-                pathElement = document.createElementNS(svgNS, "g");
-                ////pathElement.setAttribute('stroke-linecap', this.lcEnum[arr[i].lc] || 'round');
-                pathElement.style.strokeLinecap = this.lcEnum[arr[i].lc] || 'round';
-                ////pathElement.setAttribute('stroke-linejoin',this.ljEnum[arr[i].lj] || 'round');
-                pathElement.style.strokeLinejoin = this.ljEnum[arr[i].lj] || 'round';
-                ////pathElement.setAttribute('fill-opacity','0');
-                pathElement.style.fillOpacity = 0;
-                if(arr[i].lj == 1) {
-                    ////pathElement.setAttribute('stroke-miterlimit',arr[i].ml);
-                    pathElement.style.strokeMiterlimit = arr[i].ml;
-                }
-                if(!data[i].c.k) {
-                    pathElement.style.stroke = 'rgb('+data[i].c.v[0]+','+data[i].c.v[1]+','+data[i].c.v[2]+')';
-                    ////pathElement.setAttribute('stroke','rgb('+data[i].c.v[0]+','+data[i].c.v[1]+','+data[i].c.v[2]+')');
-                }
-                if(!data[i].o.k) {
-                    ////pathElement.setAttribute('stroke-opacity',data[i].o.v);
-                    pathElement.style.strokeOpacity = data[i].o.v;
-                }
-                data[i].w = PropertyFactory.getProp(this.elemData,arr[i].w,0,null,dynamicProperties);
-                if(!data[i].w.k) {
-                    ////pathElement.setAttribute('stroke-width',data[i].w.v);
-                    pathElement.style.strokeWidth = data[i].w.v;
-                }
-                if(arr[i].d){
-                    var d = PropertyFactory.getDashProp(this.elemData,arr[i].d,'svg',dynamicProperties);
-                    if(!d.k){
-                        ////pathElement.setAttribute('stroke-dasharray', d.dasharray);
-                        pathElement.style.strokeDasharray = d.dasharray;
-                        ////pathElement.setAttribute('stroke-dashoffset', d.dashoffset);
-                        pathElement.style.strokeDashoffset = d.dashoffset;
-                    }else{
-                        data[i].d = d;
-                    }
-                }
-
-            }else{
-                pathElement = document.createElementNS(svgNS, "path");
-                if(!data[i].c.k) {
-                    ////pathElement.setAttribute('fill','rgb('+data[i].c.v[0]+','+data[i].c.v[1]+','+data[i].c.v[2]+')');
-                    pathElement.style.fill = 'rgb('+data[i].c.v[0]+','+data[i].c.v[1]+','+data[i].c.v[2]+')';
-                }
-                if(!data[i].o.k) {
-                    ////pathElement.setAttribute('fill-opacity',data[i].o.v);
-                    pathElement.style.fillOpacity = data[i].o.v;
-                }
-            }
-            if(this.shape === this.parentContainer){
-                this.appendNodeToParent(pathElement);
-            }else{
-                this.shape.appendChild(pathElement);
-            }
-            this.stylesList.push({
-                pathElement: pathElement,
-                type: arr[i].ty,
-                d: '',
-                ld: '',
-                mdf: false
-            });
-            data[i].style = this.stylesList[this.stylesList.length - 1];
-            ownArrays.push(data[i].style);
-        }else if(arr[i].ty == 'gr'){
-            data[i] = {
-                it: []
-            };
-            this.searchShapes(arr[i].it,data[i].it,dynamicProperties,addedTrims);
-        }else if(arr[i].ty == 'tr'){
-            data[i] = {
-                transform : {
-                    mat: new Matrix(),
-                    opacity: 1,
-                    matMdf:false,
-                    opMdf:false,
-                    op: PropertyFactory.getProp(this.elemData,arr[i].o,0,0.01,dynamicProperties),
-                    mProps: PropertyFactory.getProp(this.elemData,arr[i],2,null,dynamicProperties)
-                },
-                elements: []
-            };
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el'){
-            data[i] = {
-                elements : [],
-                styles : [],
-                lStr: ''
-            };
-            var ty = 4;
-            if(arr[i].ty == 'rc'){
-                ty = 5;
-            }else if(arr[i].ty == 'el'){
-                ty = 6;
-            }
-            data[i].sh = PropertyFactory.getShapeProp(this.elemData,arr[i],ty,dynamicProperties, addedTrims);
-            jLen = this.stylesList.length;
-            var element, hasStrokes = false, hasFills = false;
-            for(j=0;j<jLen;j+=1){
-                if(!this.stylesList[j].closed){
-                    if(this.stylesList[j].type === 'st'){
-                        hasStrokes = true;
-                        element = document.createElementNS(svgNS, "path");
-                        this.stylesList[j].pathElement.appendChild(element);
-                        data[i].elements.push({
-                            ty:this.stylesList[j].type,
-                            el:element
-                        });
-                    }else{
-                        hasFills = true;
-                        data[i].elements.push({
-                            ty:this.stylesList[j].type,
-                            st: this.stylesList[j]
-                        });
-                    }
-                }
-            }
-            data[i].st = hasStrokes;
-            data[i].fl = hasFills;
-        }else if(arr[i].ty == 'tm'){
-            var trimOb = {
-                closed: false,
-                trimProp: PropertyFactory.getProp(this.elemData,arr[i],7,null,dynamicProperties)
-            };
-            addedTrims.push(trimOb);
-            ownTrims.push(trimOb);
-        }
-    }
-    len = ownArrays.length;
-    for(i=0;i<len;i+=1){
-        ownArrays[i].closed = true;
-    }
-    len = ownTrims.length;
-    for(i=0;i<len;i+=1){
-        ownTrims[i].closed = true;
-    }
-};
-
-ShapeItemElement.prototype.getElement = function(){
-    return this.shape;
-};
-
-ShapeItemElement.prototype.hideShape = function(){
-    var i, len = this.stylesList.length;
-    for(i=len-1;i>=0;i-=1){
-        if(this.stylesList[i].ld !== '0'){
-            this.stylesList[i].ld = '0';
-            this.stylesList[i].pathElement.style.display = 'none';
-            if(this.stylesList[i].pathElement.parentNode){
-                this.stylesList[i].parent = this.stylesList[i].pathElement.parentNode;
-                //this.stylesList[i].pathElement.parentNode.removeChild(this.stylesList[i].pathElement);
-            }
-        }
-    }
-};
-
-ShapeItemElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len;
-    if(!items){
-        items = this.data;
-        len = this.stylesList.length;
-        for(i=0;i<len;i+=1){
-            this.stylesList[i].d = '';
-            this.stylesList[i].mdf = false;
-        }
-    }
-    if(!data){
-        data = this.viewData;
-    }
-    ///
-    ///
-    len = items.length - 1;
-    var groupTransform,groupMatrix;
-    groupTransform = parentTransform;
-    for(i=len;i>=0;i-=1){
-        if(items[i].ty == 'tr'){
-            groupTransform = data[i].transform;
-            var mtArr = data[i].transform.mProps.v.props;
-            groupTransform.matMdf = groupTransform.mProps.mdf;
-            groupTransform.opMdf = groupTransform.op.mdf;
-            groupMatrix = groupTransform.mat;
-            groupMatrix.reset();
-            if(parentTransform){
-                var props = parentTransform.mat.props;
-                groupTransform.opacity = parentTransform.opacity;
-                groupTransform.opacity *= data[i].transform.op.v;
-                groupTransform.matMdf = parentTransform.matMdf ? true : groupTransform.matMdf;
-                groupTransform.opMdf = parentTransform.opMdf ? true : groupTransform.opMdf;
-                groupMatrix.transform(props[0],props[1],props[2],props[3],props[4],props[5]);
-            }else{
-                groupTransform.opacity = groupTransform.op.o;
-            }
-            groupMatrix.transform(mtArr[0],mtArr[1],mtArr[2],mtArr[3],mtArr[4],mtArr[5]);
-        }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc'){
-            this.renderPath(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'fl'){
-            this.renderFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'st'){
-            this.renderStroke(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gr'){
-            this.renderShape(groupTransform,items[i].it,data[i].it);
-        }else if(items[i].ty == 'tm'){
-            //
-        }
-    }
-    if(!isMain){
-        return;
-    }
-    len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        if(this.stylesList[i].ld === '0') {
-            this.stylesList[i].ld = '1';
-            this.stylesList[i].pathElement.style.display = 'block';
-            //this.stylesList[i].parent.appendChild(this.stylesList[i].pathElement);
-        }
-        if(this.stylesList[i].type === 'fl'){
-            if(this.stylesList[i].mdf || this.firstFrame){
-                this.stylesList[i].pathElement.setAttribute('d',this.stylesList[i].d);
-            }
-        }
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-
-};
-
-ShapeItemElement.prototype.renderPath = function(pathData,viewData,groupTransform){
-    var len, i;
-    var pathNodes = viewData.sh.v;
-    var t = '';
-    var pathStringTransformed = '';
-    var pathStringNonTransformed = '';
-    if(pathNodes.v){
-        len = pathNodes.v.length;
-        var redraw = groupTransform.matMdf || viewData.sh.mdf || this.firstFrame;
-        if(redraw) {
-            var stops = pathNodes.s ? pathNodes.s : [];
-            for (i = 1; i < len; i += 1) {
-                if (stops[i - 1]) {
-                    if (viewData.st) {
-                        pathStringNonTransformed += " M" + stops[i - 1][0] + ',' + stops[i - 1][1];
-                    }
-                    if (viewData.fl) {
-                        pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(stops[i - 1][0], stops[i - 1][1]);
-                    }
-                } else if (i == 1) {
-                    if (viewData.st) {
-                        pathStringNonTransformed += " M" + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
-                    }
-
-                    if (viewData.fl) {
-                        pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                    }
-                }
-                if (viewData.st) {
-                    pathStringNonTransformed += " C" + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + " " + pathNodes.i[i][0] + ',' + pathNodes.i[i][1] + " " + pathNodes.v[i][0] + ',' + pathNodes.v[i][1];
-                }
-
-                if (viewData.fl) {
-                    pathStringTransformed += " C" + groupTransform.mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.i[i][0], pathNodes.i[i][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.v[i][0], pathNodes.v[i][1]);
-                }
-            }
-            if (len == 1) {
-                if (stops[0]) {
-                    if (viewData.st) {
-                        pathStringNonTransformed += " M" + stops[0][0] + ',' + stops[0][1];
-                    }
-
-                    if (viewData.fl) {
-                        pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(stops[0][0], stops[0][1]);
-                    }
-                } else {
-
-                    if (viewData.st) {
-                        pathStringNonTransformed += " M" + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
-                    }
-
-                    if (viewData.fl) {
-                        pathStringTransformed += " M" + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                    }
-                }
-            }
-            if (len && pathData.closed && !(pathData.trimmed && !pathNodes.c)) {
-                if (viewData.st) {
-                    pathStringNonTransformed += " C" + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + " " + pathNodes.i[0][0] + ',' + pathNodes.i[0][1] + " " + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
-                }
-
-                if (viewData.fl) {
-                    pathStringTransformed += " C" + groupTransform.mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.i[0][0], pathNodes.i[0][1]) + " " + groupTransform.mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                }
-            }
-            if (viewData.st) {
-                t = 'matrix(' + groupTransform.mat.props.join(',') + ')';
-            }
-            viewData.lStr = pathStringTransformed;
-        }else{
-            pathStringTransformed = viewData.lStr;
-        }
-        len = viewData.elements.length;
-        for(i=0;i<len;i+=1){
-            if(viewData.elements[i].ty === 'st'){
-                if(viewData.sh.mdf || this.firstFrame){
-                    //console.log(pathStringNonTransformed);
-                    viewData.elements[i].el.setAttribute('d', pathStringNonTransformed);
-                }
-                if(groupTransform.matMdf || this.firstFrame) {
-                    viewData.elements[i].el.setAttribute('transform',t);
-                    ////viewData.elements[i].el.style.transform = t;
-                }
-            }else{
-                viewData.elements[i].st.mdf = redraw ? true : viewData.elements[i].st.mdf;
-                viewData.elements[i].st.d += pathStringTransformed;
-            }
-        }
-    }
-};
-
-ShapeItemElement.prototype.renderFill = function(styleData,viewData, groupTransform){
-    var styleElem = viewData.style;
-
-    if(viewData.c.mdf || this.firstFrame){
-        ////styleElem.pathElement.setAttribute('fill','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-        styleElem.pathElement.style.fill = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || groupTransform.opMdf || this.firstFrame){
-        ////styleElem.pathElement.setAttribute('fill-opacity',viewData.o.v*groupTransform.opacity);
-        styleElem.pathElement.style.fillOpacity = viewData.o.v*groupTransform.opacity;
-    }
-};
-
-ShapeItemElement.prototype.renderStroke = function(styleData,viewData, groupTransform){
-    var styleElem = viewData.style;
-    //TODO fix dashes
-    var d = viewData.d;
-    var dasharray,dashoffset;
-    if(d){
-        if(d.mdf || this.firstFrame){
-            ////styleElem.pathElement.setAttribute('stroke-dasharray', d.dasharray);
-            styleElem.pathElement.style.strokeDasharray = d.dasharray;
-            ////styleElem.pathElement.setAttribute('stroke-dashoffset', d.dashoffset);
-            styleElem.pathElement.style.strokeDashoffset = d.dashoffset;
-        }
-    }
-    if(viewData.c.mdf || this.firstFrame){
-        ////styleElem.pathElement.setAttribute('stroke','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-        styleElem.pathElement.style.stroke = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || groupTransform.opMdf || this.firstFrame){
-        ////styleElem.pathElement.setAttribute('stroke-opacity',viewData.o.v*groupTransform.opacity);
-        styleElem.pathElement.style.strokeOpacity =viewData.o.v*groupTransform.opacity;
-    }
-    if(viewData.w.mdf || this.firstFrame){
-        ////styleElem.pathElement.setAttribute('stroke-width',viewData.w.v);
-        styleElem.pathElement.style.strokeWidth = viewData.w.v;
-    }
-};
-
-ShapeItemElement.prototype.destroy = function(items, data){
-    this.shape = null;
-    this.data = null;
-    this.viewData = null;
-    this.parentContainer = null;
-    this.placeholder = null;
-};
\ No newline at end of file
diff --git a/player/js/elements/SolidElement.js b/player/js/elements/SolidElement.js
index 40e335b..05ff414 100644
--- a/player/js/elements/SolidElement.js
+++ b/player/js/elements/SolidElement.js
@@ -1,12 +1,11 @@
-function ISolidElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+function ISolidElement(data,globalData,comp){
+    this.initElement(data,globalData,comp);
 }
-createElement(SVGBaseElement, ISolidElement);
+extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createElements = function(){
-    this._parent.createElements.call(this);
+ISolidElement.prototype.createContent = function(){
 
-    var rect = document.createElementNS(svgNS,'rect');
+    var rect = createNS('rect');
     ////rect.style.width = this.data.sw;
     ////rect.style.height = this.data.sh;
     ////rect.style.fill = this.data.sc;
@@ -14,15 +13,4 @@
     rect.setAttribute('height',this.data.sh);
     rect.setAttribute('fill',this.data.sc);
     this.layerElement.appendChild(rect);
-    this.innerElem = rect;
-    if(this.data.ln){
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.layerElement.setAttribute('class',this.data.cl);
-    }
-};
-
-ISolidElement.prototype.hide = IImageElement.prototype.hide;
-ISolidElement.prototype.renderFrame = IImageElement.prototype.renderFrame;
-ISolidElement.prototype.destroy = IImageElement.prototype.destroy;
+};
\ No newline at end of file
diff --git a/player/js/elements/TextElement.js b/player/js/elements/TextElement.js
index e39239e..3e405d4 100644
--- a/player/js/elements/TextElement.js
+++ b/player/js/elements/TextElement.js
@@ -1,589 +1,80 @@
-function ITextElement(data, animationItem,parentContainer,globalData){
+function ITextElement(){
 }
-ITextElement.prototype.init = function(){
-    this._parent.init.call(this);
 
-    this.lettersChangedFlag = false;
-    this.currentTextDocumentData = {};
-    var data = this.data;
-    this.viewData = {
-        m:{
-            a: PropertyFactory.getProp(this,data.t.m.a,1,0,this.dynamicProperties)
-        }
-    };
-    var textData = this.data.t;
-    if(textData.a.length){
-        this.viewData.a = Array.apply(null,{length:textData.a.length});
-        var i, len = textData.a.length, animatorData, animatorProps;
-        for(i=0;i<len;i+=1){
-            animatorProps = textData.a[i];
-            animatorData = {
-                a: {},
-                s: {}
-            };
-            if('r' in animatorProps.a) {
-                animatorData.a.r = PropertyFactory.getProp(this,animatorProps.a.r,0,degToRads,this.dynamicProperties);
-            }
-            if('rx' in animatorProps.a) {
-                animatorData.a.rx = PropertyFactory.getProp(this,animatorProps.a.rx,0,degToRads,this.dynamicProperties);
-            }
-            if('ry' in animatorProps.a) {
-                animatorData.a.ry = PropertyFactory.getProp(this,animatorProps.a.ry,0,degToRads,this.dynamicProperties);
-            }
-            if('sk' in animatorProps.a) {
-                animatorData.a.sk = PropertyFactory.getProp(this,animatorProps.a.sk,0,degToRads,this.dynamicProperties);
-            }
-            if('sa' in animatorProps.a) {
-                animatorData.a.sa = PropertyFactory.getProp(this,animatorProps.a.sa,0,degToRads,this.dynamicProperties);
-            }
-            if('s' in animatorProps.a) {
-                animatorData.a.s = PropertyFactory.getProp(this,animatorProps.a.s,1,0.01,this.dynamicProperties);
-            }
-            if('a' in animatorProps.a) {
-                animatorData.a.a = PropertyFactory.getProp(this,animatorProps.a.a,1,0,this.dynamicProperties);
-            }
-            if('o' in animatorProps.a) {
-                animatorData.a.o = PropertyFactory.getProp(this,animatorProps.a.o,0,0.01,this.dynamicProperties);
-            }
-            if('p' in animatorProps.a) {
-                animatorData.a.p = PropertyFactory.getProp(this,animatorProps.a.p,1,0,this.dynamicProperties);
-            }
-            if('sw' in animatorProps.a) {
-                animatorData.a.sw = PropertyFactory.getProp(this,animatorProps.a.sw,0,0,this.dynamicProperties);
-            }
-            if('sc' in animatorProps.a) {
-                animatorData.a.sc = PropertyFactory.getProp(this,animatorProps.a.sc,1,0,this.dynamicProperties);
-            }
-            if('fc' in animatorProps.a) {
-                animatorData.a.fc = PropertyFactory.getProp(this,animatorProps.a.fc,1,0,this.dynamicProperties);
-            }
-            if('fh' in animatorProps.a) {
-                animatorData.a.fh = PropertyFactory.getProp(this,animatorProps.a.fh,0,0,this.dynamicProperties);
-            }
-            if('fs' in animatorProps.a) {
-                animatorData.a.fs = PropertyFactory.getProp(this,animatorProps.a.fs,0,0.01,this.dynamicProperties);
-            }
-            if('fb' in animatorProps.a) {
-                animatorData.a.fb = PropertyFactory.getProp(this,animatorProps.a.fb,0,0.01,this.dynamicProperties);
-            }
-            if('t' in animatorProps.a) {
-                animatorData.a.t = PropertyFactory.getProp(this,animatorProps.a.t,0,0,this.dynamicProperties);
-            }
-            animatorData.s = PropertyFactory.getTextSelectorProp(this,animatorProps.s,this.dynamicProperties);
-            animatorData.s.t = animatorProps.s.t;
-            this.viewData.a[i] = animatorData;
-        }
-    }else{
-        this.viewData.a = [];
-    }
-    if(textData.p && 'm' in textData.p){
-        this.viewData.p = {
-            f: PropertyFactory.getProp(this,textData.p.f,0,0,this.dynamicProperties),
-            l: PropertyFactory.getProp(this,textData.p.l,0,0,this.dynamicProperties),
-            r: textData.p.r,
-            m: this.maskManager.getMaskProperty(textData.p.m)
-        };
-        this.maskPath = true;
-    } else {
-        this.maskPath = false;
+ITextElement.prototype.initElement = function(data,globalData,comp){
+    this.lettersChangedFlag = true;
+    this.initFrame();
+    this.initBaseData(data, globalData, comp);
+    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+    this.initTransform(data, globalData, comp);
+    this.initHierarchy();
+    this.initRenderable();
+    this.initRendererElement();
+    this.createContainerElements();
+    this.addMasks();
+    this.createContent();
+    this.hide();
+    this.textAnimator.searchProperties(this.dynamicProperties);
+};
+
+ITextElement.prototype.prepareFrame = function(num) {
+    this._mdf = false;
+    this.prepareRenderableFrame(num);
+    this.prepareProperties(num, this.isInRange);
+    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
+        this.buildNewText();
+        this.textProperty._isFirstFrame = false;
+        this.textProperty._mdf = false;
     }
 };
-ITextElement.prototype.prepareFrame = function(num) {
-    var i = 0, len = this.data.t.d.k.length;
-    var textDocumentData = this.data.t.d.k[i].s;
-    i += 1;
-    while(i<len){
-        if(this.data.t.d.k[i].t > num){
-            break;
-        }
-        textDocumentData = this.data.t.d.k[i].s;
-        i += 1;
-    }
-    this.lettersChangedFlag = false;
-    if(textDocumentData !== this.currentTextDocumentData){
-        this.currentTextDocumentData = textDocumentData;
-        this.lettersChangedFlag = true;
-        this.buildNewText();
-    }
-    this._parent.prepareFrame.call(this, num);
-}
 
 ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
     var j,jLen = shapes.length;
     var k, kLen, pathNodes;
     var shapeStr = '';
     for(j=0;j<jLen;j+=1){
-        kLen = shapes[j].ks.k.i.length;
         pathNodes = shapes[j].ks.k;
-        for(k=1;k<kLen;k+=1){
-            if(k==1){
-                shapeStr += " M"+matrixHelper.applyToPointStringified(pathNodes.v[0][0],pathNodes.v[0][1]);
-            }
-            shapeStr += " C"+matrixHelper.applyToPointStringified(pathNodes.o[k-1][0],pathNodes.o[k-1][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.i[k][0],pathNodes.i[k][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.v[k][0],pathNodes.v[k][1]);
-        }
-        shapeStr += " C"+matrixHelper.applyToPointStringified(pathNodes.o[k-1][0],pathNodes.o[k-1][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.i[0][0],pathNodes.i[0][1]) + " "+matrixHelper.applyToPointStringified(pathNodes.v[0][0],pathNodes.v[0][1]);
-        shapeStr += 'z';
+        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
     }
     return shapeStr;
 };
 
-ITextElement.prototype.getMeasures = function(){
+ITextElement.prototype.updateDocumentData = function(newData, index) {
+    this.textProperty.updateDocumentData(newData, index);
+};
 
-    var matrixHelper = this.mHelper;
-    var renderType = this.renderType;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var documentData = this.currentTextDocumentData;
-    var letters = documentData.l;
-    if(this.maskPath) {
-        var mask = this.viewData.p.m;
-        if(!this.viewData.p.n || this.viewData.p.mdf){
-            var paths = mask.v;
-            if(this.viewData.p.r){
-                paths = reversePath(paths);
-            }
-            var pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths.v.length - 1;
-            var pathData;
-            var totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                pathData = {
-                    s: paths.v[i],
-                    e: paths.v[i + 1],
-                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
-                    ti: [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]
-                };
-                bez.buildBezierData(pathData);
-                pathInfo.tLength += pathData.bezierData.segmentLength;
-                pathInfo.segments.push(pathData);
-                totalLength += pathData.bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                pathData = {
-                    s: paths.v[i],
-                    e: paths.v[0],
-                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
-                    ti: [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]
-                };
-                bez.buildBezierData(pathData);
-                pathInfo.tLength += pathData.bezierData.segmentLength;
-                pathInfo.segments.push(pathData);
-                totalLength += pathData.bezierData.segmentLength;
-            }
-            this.viewData.p.pi = pathInfo;
-        }
-        var pathInfo = this.viewData.p.pi;
+ITextElement.prototype.canResizeFont = function(_canResize) {
+    this.textProperty.canResizeFont(_canResize);
+};
 
-        var currentLength = this.viewData.p.f.v, segmentInd = 0, pointInd = 1, currentPoint, prevPoint, points;
-        var segmentLength = 0, flag = true;
-        var segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].bezierData.points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].bezierData.points;
-                    pointInd = points.length - 1;
-                }
-            }
+ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
+    this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-        }
-        points = segments[segmentInd].bezierData.points;
-        prevPoint = points[pointInd - 1];
-        currentPoint = points[pointInd];
-        var partialLength = currentPoint.partialLength;
-        var perc, tanAngle;
+ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
+    if(documentData.ps){
+        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
     }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.s*1.2*.714;
-    var firstLine = true;
-    var renderedData = this.viewData, animatorProps, animatorSelector;
-    var j, jLen;
-    var lettersValue = Array.apply(null,{length:len}), letterValue;
-
-    jLen = renderedData.a.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw,letterSc,letterFc,letterM,letterP,letterO;
-    for( i = 0; i < len; i += 1) {
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this.maskPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
-                points = segments[segmentInd].bezierData.points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
-            }
-            lettersValue[i] = this.emptyProp;
-        }else{
-            if(this.maskPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += renderedData.m.a.v[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = renderedData.a[j].a;
-                    if ('p' in animatorProps) {
-                        animatorSelector = renderedData.a[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
-
-                    }
-                    if ('a' in animatorProps) {
-                        animatorSelector = renderedData.a[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
-
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-renderedData.m.a.v[0]*letters[i].an/200, -(renderedData.m.a.v[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].bezierData.points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].bezierData.points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
-            } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-renderedData.m.a.v[0]*letters[i].an/200, -renderedData.m.a.v[1]*yOff/100, 0);
-            }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-                if ('t' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                    if(this.maskPath) {
-                        if(mult.length) {
-                            currentLength += animatorProps.t*mult[0];
-                        } else {
-                            currentLength += animatorProps.t*mult;
-                        }
-                    }else{
-                        if(mult.length) {
-                            xPos += animatorProps.t.v*mult[0];
-                        } else {
-                            xPos += animatorProps.t.v*mult;
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-                if ('a' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-                if ('s' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = renderedData.a[j].a;
-                animatorSelector = renderedData.a[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                if ('sk' in animatorProps) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if ('r' in animatorProps) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if ('ry' in animatorProps) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if ('rx' in animatorProps) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if ('o' in animatorProps) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && 'sw' in animatorProps) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && 'sc' in animatorProps) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = Math.round(255*(sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0]));
-                        } else {
-                            sc[k] = Math.round(255*(sc[k] + (animatorProps.sc.v[k] - sc[k])*mult));
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim) {
-                    if('fc' in animatorProps){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                                //console.log('mult',mult);
-                                //console.log(Math.round(fc[k] + (animatorProps.fc.v[k] - fc[k])*mult));
-                            }
-                        }
-                    }
-                    if('fh' in animatorProps){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if('fs' in animatorProps){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if('fb' in animatorProps){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = renderedData.a[j].a;
-
-                if ('p' in animatorProps) {
-                    animatorSelector = renderedData.a[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],data.t.a[j].s.totalChars);
-                    if(this.maskPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this.maskPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, renderedData.m.a.v[1]*yOff/100 + yPos,0);
-                if (data.t.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= renderedData.m.a.v[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.s;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(renderedData.m.a.v[0]*letters[i].an/200,renderedData.m.a.v[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.s;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                letterP = [matrixHelper.props[0],matrixHelper.props[1],matrixHelper.props[2],matrixHelper.props[3],matrixHelper.props[4],matrixHelper.props[5],matrixHelper.props[6],matrixHelper.props[7],matrixHelper.props[8],matrixHelper.props[9],matrixHelper.props[10],matrixHelper.props[11],matrixHelper.props[12],matrixHelper.props[13],matrixHelper.props[14],matrixHelper.props[15]];
-            }
-            letterO = elemOpacity;
-
-            lastLetter = this.renderedLetters[i];
-            if(lastLetter && (lastLetter.o !== letterO || lastLetter.sw !== letterSw || lastLetter.sc !== letterSc || lastLetter.fc !== letterFc)){
-                this.lettersChangedFlag = true;
-                letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            }else{
-                if((renderType === 'svg' || renderType === 'html') && (!lastLetter || lastLetter.m !== letterM)){
-                    this.lettersChangedFlag = true;
-                    letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM);
-                }else if(renderType === 'canvas' && (!lastLetter || (lastLetter.props[0] !== letterP[0] || lastLetter.props[1] !== letterP[1] || lastLetter.props[4] !== letterP[4] || lastLetter.props[5] !== letterP[5] || lastLetter.props[12] !== letterP[12] || lastLetter.props[13] !== letterP[13]))){
-                    this.lettersChangedFlag = true;
-                    letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,null,letterP);
-                } else {
-                    letterValue = lastLetter;
-                }
-            }
-            this.renderedLetters[i] = letterValue;
-        }
+    matrixHelper.translate(0,-documentData.ls,0);
+    switch(documentData.j){
+        case 1:
+            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
+            break;
+        case 2:
+            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
+            break;
     }
+    matrixHelper.translate(xPos, yPos, 0);
+};
+
+
+ITextElement.prototype.buildColor = function(colorData) {
+    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
+
+ITextElement.prototype.destroy = function(){
+    
+};
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVBaseElement.js b/player/js/elements/canvasElements/CVBaseElement.js
index 42866ee..e0f963e 100644
--- a/player/js/elements/canvasElements/CVBaseElement.js
+++ b/player/js/elements/canvasElements/CVBaseElement.js
@@ -1,142 +1,63 @@
-function CVBaseElement(data, comp,globalData){
-    this.globalData = globalData;
-    this.data = data;
-    this.comp = comp;
-    this.canvasContext = globalData.canvasContext;
-    this.init();
+function CVBaseElement(){
 }
 
-createElement(BaseElement, CVBaseElement);
-
-CVBaseElement.prototype.createElements = function(){
-    this.checkParenting();
-};
-
-CVBaseElement.prototype.checkBlendMode = function(globalData){
-    if(globalData.blendMode !== this.data.bm) {
-        globalData.blendMode = this.data.bm;
-
-        var blendModeValue = '';
-        switch (this.data.bm) {
-            case 0:
-                blendModeValue = 'normal';
-                break;
-            case 1:
-                blendModeValue = 'multiply';
-                break;
-            case 2:
-                blendModeValue = 'screen';
-                break;
-            case 3:
-                blendModeValue = 'overlay';
-                break;
-            case 4:
-                blendModeValue = 'darken';
-                break;
-            case 5:
-                blendModeValue = 'lighten';
-                break;
-            case 6:
-                blendModeValue = 'color-dodge';
-                break;
-            case 7:
-                blendModeValue = 'color-burn';
-                break;
-            case 8:
-                blendModeValue = 'hard-light';
-                break;
-            case 9:
-                blendModeValue = 'soft-light';
-                break;
-            case 10:
-                blendModeValue = 'difference';
-                break;
-            case 11:
-                blendModeValue = 'exclusion';
-                break;
-            case 12:
-                blendModeValue = 'hue';
-                break;
-            case 13:
-                blendModeValue = 'saturation';
-                break;
-            case 14:
-                blendModeValue = 'color';
-                break;
-            case 15:
-                blendModeValue = 'luminosity';
-                break;
+CVBaseElement.prototype = {
+    createElements: function(){},
+    initRendererElement: function(){},
+    createContainerElements: function(){
+        this.canvasContext = this.globalData.canvasContext;
+        this.renderableEffectsManager = new CVEffects(this);
+    },
+    createContent: function(){},
+    setBlendMode: function(){
+        var globalData = this.globalData;
+        if(globalData.blendMode !== this.data.bm) {
+            globalData.blendMode = this.data.bm;
+            var blendModeValue = this.getBlendMode();
+            globalData.canvasContext.globalCompositeOperation = blendModeValue;
         }
-        globalData.canvasContext.globalCompositeOperation = blendModeValue;
-    }
-};
-
-
-CVBaseElement.prototype.renderFrame = function(parentTransform){
-    if(this.data.ty === 3){
-        return false;
-    }
-        this.checkBlendMode(this.data.ty === 0?this.parentGlobalData:this.globalData);
-
-    if(!this.isVisible){
-        return this.isVisible;
-    }
-    this.finalTransform.opMdf = this.finalTransform.op.mdf;
-    this.finalTransform.matMdf = this.finalTransform.mProp.mdf;
-    this.finalTransform.opacity = this.finalTransform.op.v;
-
-    var mat;
-    var finalMat = this.finalTransform.mat;
-
-    if(this.hierarchy){
-        var i, len = this.hierarchy.length;
-        mat = this.finalTransform.mProp.v.props;
-        finalMat.cloneFromProps(mat);
-        for(i=0;i<len;i+=1){
-            this.finalTransform.matMdf = this.hierarchy[i].finalTransform.mProp.mdf ? true : this.finalTransform.matMdf;
-            mat = this.hierarchy[i].finalTransform.mProp.v.props;
-            finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
+    },
+    addMasks: function(){
+        this.maskManager = new CVMaskElement(this.data, this);
+    },
+    hideElement: function(){
+        if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+            this.hidden = true;
         }
-    }else{
-        if(!parentTransform){
-            finalMat.cloneFromProps(this.finalTransform.mProp.v.props);
-        }else{
-            mat = this.finalTransform.mProp.v.props;
-            finalMat.cloneFromProps(mat);
+    },
+    showElement: function(){
+        if (this.isInRange && !this.isTransparent){
+            this.hidden = false;
+            this._isFirstFrame = true;
+            this.maskManager._isFirstFrame = true;
         }
-    }
-
-    if(parentTransform){
-        mat = parentTransform.mat.props;
-        finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
-        this.finalTransform.opacity *= parentTransform.opacity;
-        this.finalTransform.opMdf = parentTransform.opMdf ? true : this.finalTransform.opMdf;
-        this.finalTransform.matMdf = parentTransform.matMdf ? true : this.finalTransform.matMdf
-    }
-
-    if(this.data.hasMask){
-        this.globalData.renderer.save(true);
-        this.maskManager.renderFrame(this.data.ty === 0?null:finalMat);
-    }
-    if(this.data.hd){
-        this.isVisible = false;
-    }
-    return this.isVisible;
-
-};
-
-CVBaseElement.prototype.addMasks = function(data){
-    this.maskManager = new CVMaskElement(data,this,this.globalData);
-};
-
-
-CVBaseElement.prototype.destroy = function(){
-    this.canvasContext = null;
-    this.data = null;
-    this.globalData = null;
-    if(this.maskManager) {
+    },
+    renderFrame: function() {
+        if (this.hidden) {
+            return;
+        }
+        this.renderTransform();
+        this.renderRenderable();
+        this.setBlendMode();
+        this.globalData.renderer.save();
+        this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
+        this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
+        this.renderInnerContent();
+        this.globalData.renderer.restore();
+        if(this.maskManager.hasMasks) {
+            this.globalData.renderer.restore(true);
+        }
+        if (this._isFirstFrame) {
+            this._isFirstFrame = false;
+        }
+    },
+    destroy: function(){
+        this.canvasContext = null;
+        this.data = null;
+        this.globalData = null;
         this.maskManager.destroy();
-    }
+    },
+    mHelper: new Matrix()
 };
-
-CVBaseElement.prototype.mHelper = new Matrix();
+CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
+CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
diff --git a/player/js/elements/canvasElements/CVCompElement.js b/player/js/elements/canvasElements/CVCompElement.js
index af9f29b..5a7e1c0 100644
--- a/player/js/elements/canvasElements/CVCompElement.js
+++ b/player/js/elements/canvasElements/CVCompElement.js
@@ -1,169 +1,30 @@
-function CVCompElement(data, comp,globalData){
-    this._parent.constructor.call(this,data, comp,globalData);
-    var compGlobalData = {};
-    for(var s in globalData){
-        if(globalData.hasOwnProperty(s)){
-            compGlobalData[s] = globalData[s];
-        }
-    }
-    compGlobalData.renderer = this;
-    compGlobalData.compHeight = this.data.h;
-    compGlobalData.compWidth = this.data.w;
-    this.renderConfig = {
-        clearCanvas: true
-    };
-    this.contextData = {
-        saved : Array.apply(null,{length:15}),
-        savedOp: Array.apply(null,{length:15}),
-        cArrPos : 0,
-        cTr : new Matrix(),
-        cO : 1
-    };
+function CVCompElement(data, globalData, comp) {
     this.completeLayers = false;
-    var i, len = 15;
-    for(i=0;i<len;i+=1){
-        this.contextData.saved[i] = Array.apply(null,{length:16});
-    }
-    this.transformMat = new Matrix();
-    this.parentGlobalData = this.globalData;
-    var cv = document.createElement('canvas');
-    //document.body.appendChild(cv);
-    compGlobalData.canvasContext = cv.getContext('2d');
-    this.canvasContext = compGlobalData.canvasContext;
-    cv.width = this.data.w;
-    cv.height = this.data.h;
-    this.canvas = cv;
-    this.globalData = compGlobalData;
     this.layers = data.layers;
     this.pendingElements = [];
-    this.elements = Array.apply(null,{length:this.layers.length});
-    if(this.data.tm){
-        this.tm = PropertyFactory.getProp(this,this.data.tm,0,globalData.frameRate,this.dynamicProperties);
-    }
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
+    this.elements = createSizedArray(this.layers.length);
+    this.initElement(data, globalData, comp);
+    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
 }
-createElement(CVBaseElement, CVCompElement);
 
-CVCompElement.prototype.ctxTransform = CanvasRenderer.prototype.ctxTransform;
-CVCompElement.prototype.ctxOpacity = CanvasRenderer.prototype.ctxOpacity;
-CVCompElement.prototype.save = CanvasRenderer.prototype.save;
-CVCompElement.prototype.restore = CanvasRenderer.prototype.restore;
-CVCompElement.prototype.reset =  function(){
-    this.contextData.cArrPos = 0;
-    this.contextData.cTr.reset();
-    this.contextData.cO = 1;
-};
-CVCompElement.prototype.resize = function(transformCanvas){
-    var maxScale = Math.max(transformCanvas.sx,transformCanvas.sy);
-    this.canvas.width = this.data.w*maxScale;
-    this.canvas.height = this.data.h*maxScale;
-    this.transformCanvas = {
-        sc:maxScale,
-        w:this.data.w*maxScale,
-        h:this.data.h*maxScale,
-        props:[maxScale,0,0,0,0,maxScale,0,0,0,0,1,0,0,0,0,1]
-    }
-    var i,len = this.elements.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i] && this.elements[i].data.ty === 0){
-            this.elements[i].resize(transformCanvas);
-        }
-    }
-};
+extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
 
-CVCompElement.prototype.prepareFrame = function(num){
-    this.globalData.frameId = this.parentGlobalData.frameId;
-    this.globalData.mdf = false;
-    this._parent.prepareFrame.call(this,num);
-    if(this.isVisible===false && !this.data.xt){
-        return;
-    }
-    var timeRemapped = num;
-    if(this.tm){
-        timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-    }
-    this.renderedFrame = timeRemapped/this.data.sr;
-    var i,len = this.elements.length;
-
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-
-    for( i = 0; i < len; i+=1 ){
+CVCompElement.prototype.renderInnerContent = function() {
+    var i,len = this.layers.length;
+    for( i = len - 1; i >= 0; i -= 1 ){
         if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(timeRemapped/this.data.sr - this.layers[i].st);
-            if(this.elements[i].data.ty === 0 && this.elements[i].globalData.mdf){
-                this.globalData.mdf = true;
-            }
+            this.elements[i].renderFrame();
         }
     }
-    if(this.globalData.mdf && !this.data.xt){
-        this.canvasContext.clearRect(0, 0, this.data.w, this.data.h);
-        this.ctxTransform(this.transformCanvas.props);
-    }
-};
-
-CVCompElement.prototype.renderFrame = function(parentMatrix){
-    if(this._parent.renderFrame.call(this,parentMatrix)===false){
-        return;
-    }
-    if(this.globalData.mdf){
-        var i,len = this.layers.length;
-        for( i = len - 1; i >= 0; i -= 1 ){
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-    if(this.data.hasMask){
-        this.globalData.renderer.restore(true);
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-    this.parentGlobalData.renderer.save();
-    this.parentGlobalData.renderer.ctxTransform(this.finalTransform.mat.props);
-    this.parentGlobalData.renderer.ctxOpacity(this.finalTransform.opacity);
-    this.parentGlobalData.renderer.canvasContext.drawImage(this.canvas,0,0,this.data.w,this.data.h);
-    this.parentGlobalData.renderer.restore();
-
-    if(this.globalData.mdf){
-        this.reset();
-    }
-};
-
-CVCompElement.prototype.setElements = function(elems){
-    this.elements = elems;
-};
-
-CVCompElement.prototype.getElements = function(){
-    return this.elements;
 };
 
 CVCompElement.prototype.destroy = function(){
     var i,len = this.layers.length;
     for( i = len - 1; i >= 0; i -= 1 ){
-        this.elements[i].destroy();
+        if(this.elements[i]) {
+            this.elements[i].destroy();
+        }
     }
     this.layers = null;
     this.elements = null;
-    this._parent.destroy.call(this._parent);
-};
-CVCompElement.prototype.checkLayers = CanvasRenderer.prototype.checkLayers;
-CVCompElement.prototype.buildItem = CanvasRenderer.prototype.buildItem;
-CVCompElement.prototype.checkPendingElements = CanvasRenderer.prototype.checkPendingElements;
-CVCompElement.prototype.addPendingElement = CanvasRenderer.prototype.addPendingElement;
-CVCompElement.prototype.buildAllItems = CanvasRenderer.prototype.buildAllItems;
-CVCompElement.prototype.createItem = CanvasRenderer.prototype.createItem;
-CVCompElement.prototype.createImage = CanvasRenderer.prototype.createImage;
-CVCompElement.prototype.createComp = CanvasRenderer.prototype.createComp;
-CVCompElement.prototype.createSolid = CanvasRenderer.prototype.createSolid;
-CVCompElement.prototype.createShape = CanvasRenderer.prototype.createShape;
-CVCompElement.prototype.createText = CanvasRenderer.prototype.createText;
-CVCompElement.prototype.createBase = CanvasRenderer.prototype.createBase;
-CVCompElement.prototype.buildElementParenting = CanvasRenderer.prototype.buildElementParenting;
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVContextData.js b/player/js/elements/canvasElements/CVContextData.js
new file mode 100644
index 0000000..b522199
--- /dev/null
+++ b/player/js/elements/canvasElements/CVContextData.js
@@ -0,0 +1,30 @@
+function CVContextData() {
+	this.saved = [];
+    this.cArrPos = 0;
+    this.cTr = new Matrix();
+    this.cO = 1;
+    var i, len = 15;
+    this.savedOp = createTypedArray('float32', len);
+    for(i=0;i<len;i+=1){
+        this.saved[i] = createTypedArray('float32', 16);
+    }
+    this._length = len;
+}
+
+CVContextData.prototype.duplicate = function() {
+	var newLength = this._length * 2;
+	var currentSavedOp = this.savedOp;
+    this.savedOp = createTypedArray('float32', newLength);
+    this.savedOp.set(currentSavedOp);
+    var i = 0;
+    for(i = this._length; i < newLength; i += 1) {
+        this.saved[i] = createTypedArray('float32', 16);
+    }
+    this._length = newLength;
+};
+
+CVContextData.prototype.reset = function() {
+	this.cArrPos = 0;
+	this.cTr.reset();
+    this.cO = 1;
+};
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVEffects.js b/player/js/elements/canvasElements/CVEffects.js
new file mode 100644
index 0000000..c141cd2
--- /dev/null
+++ b/player/js/elements/canvasElements/CVEffects.js
@@ -0,0 +1,4 @@
+function CVEffects() {
+
+}
+CVEffects.prototype.renderFrame = function(){};
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVImageElement.js b/player/js/elements/canvasElements/CVImageElement.js
index e52453a..ec76d33 100644
--- a/player/js/elements/canvasElements/CVImageElement.js
+++ b/player/js/elements/canvasElements/CVImageElement.js
@@ -1,70 +1,62 @@
-function CVImageElement(data, comp,globalData){
+function CVImageElement(data, globalData, comp){
+    this.failed = false;
+    this.img = new Image();
     this.assetData = globalData.getAssetData(data.refId);
-    this._parent.constructor.call(this,data, comp,globalData);
+    this.initElement(data,globalData,comp);
     this.globalData.addPendingElement();
 }
-createElement(CVBaseElement, CVImageElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
 
-CVImageElement.prototype.createElements = function(){
-    var imageLoaded = function(){
-        this.globalData.elementLoaded();
-        if(this.assetData.w !== this.img.width || this.assetData.h !== this.img.height){
-            var canvas = document.createElement('canvas');
-            canvas.width = this.assetData.w;
-            canvas.height = this.assetData.h;
-            var ctx = canvas.getContext('2d');
+//TODO: refactor this
+CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
+CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-            var imgW = this.img.width;
-            var imgH = this.img.height;
-            var imgRel = imgW / imgH;
-            var canvasRel = this.assetData.w/this.assetData.h;
-            var widthCrop, heightCrop;
-            if(imgRel>canvasRel){
-                heightCrop = imgH;
-                widthCrop = heightCrop*canvasRel;
-            } else {
-                widthCrop = imgW;
-                heightCrop = widthCrop/canvasRel;
-            }
-            ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h);
-            this.img = canvas;
+CVImageElement.prototype.imageLoaded = function() {
+    this.globalData.elementLoaded();
+    if(this.assetData.w !== this.img.width || this.assetData.h !== this.img.height){
+        var canvas = createTag('canvas');
+        canvas.width = this.assetData.w;
+        canvas.height = this.assetData.h;
+        var ctx = canvas.getContext('2d');
+
+        var imgW = this.img.width;
+        var imgH = this.img.height;
+        var imgRel = imgW / imgH;
+        var canvasRel = this.assetData.w/this.assetData.h;
+        var widthCrop, heightCrop;
+        if(imgRel>canvasRel){
+            heightCrop = imgH;
+            widthCrop = heightCrop*canvasRel;
+        } else {
+            widthCrop = imgW;
+            heightCrop = widthCrop/canvasRel;
         }
-    }.bind(this);
-    var imageFailed = function(){
-        this.failed = true;
-        this.globalData.elementLoaded();
-    }.bind(this);
+        ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h);
+        this.img = canvas;
+    }
+};
 
-    this.img = new Image();
-    this.img.addEventListener('load', imageLoaded, false);
-    this.img.addEventListener('error', imageFailed, false);
+CVImageElement.prototype.imageFailed = function() {
+    this.failed = true;
+    this.globalData.elementLoaded();
+};
+
+CVImageElement.prototype.createContent = function(){
+    var img = this.img;
+    img.addEventListener('load', this.imageLoaded.bind(this), false);
+    img.addEventListener('error', this.imageFailed.bind(this), false);
     var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.img.src = assetPath;
-
-    this._parent.createElements.call(this);
+    img.src = assetPath;
 
 };
 
-CVImageElement.prototype.renderFrame = function(parentMatrix){
-    if(this.failed){
+CVImageElement.prototype.renderInnerContent = function(parentMatrix){
+    if (this.failed) {
         return;
     }
-    if(this._parent.renderFrame.call(this,parentMatrix)===false){
-        return;
-    }
-    var ctx = this.canvasContext;
-    this.globalData.renderer.save();
-    var finalMat = this.finalTransform.mat.props;
-    this.globalData.renderer.ctxTransform(finalMat);
-    this.globalData.renderer.ctxOpacity(this.finalTransform.opacity);
-    ctx.drawImage(this.img,0,0);
-    this.globalData.renderer.restore(this.data.hasMask);
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
+    this.canvasContext.drawImage(this.img, 0, 0);
 };
 
 CVImageElement.prototype.destroy = function(){
     this.img = null;
-    this._parent.destroy.call(this._parent);
 };
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVMaskElement.js b/player/js/elements/canvasElements/CVMaskElement.js
index d52ad87..47a09ab 100644
--- a/player/js/elements/canvasElements/CVMaskElement.js
+++ b/player/js/elements/canvasElements/CVMaskElement.js
@@ -2,79 +2,56 @@
 function CVMaskElement(data,element){
     this.data = data;
     this.element = element;
-    this.dynamicProperties = [];
-    this.masksProperties = this.data.masksProperties;
-    this.viewData = new Array(this.masksProperties.length);
-    var i, len = this.masksProperties.length;
+    this.masksProperties = this.data.masksProperties || [];
+    this.viewData = createSizedArray(this.masksProperties.length);
+    var i, len = this.masksProperties.length, hasMasks = false;
     for (i = 0; i < len; i++) {
-        this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3,this.dynamicProperties,null);
+        if(this.masksProperties[i].mode !== 'n'){
+            hasMasks = true;
+        }
+        this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);
+    }
+    this.hasMasks = hasMasks;
+    if(hasMasks) {
+        this.element.addRenderableComponent(this);
     }
 }
 
-CVMaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos];
-};
-
-CVMaskElement.prototype.prepareFrame = function(num){
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue(num);
-        if(this.dynamicProperties[i].mdf){
-            this.element.globalData.mdf = true;
-        }
+CVMaskElement.prototype.renderFrame = function () {
+    if(!this.hasMasks){
+        return;
     }
-};
-
-CVMaskElement.prototype.renderFrame = function (transform) {
+    var transform = this.element.finalTransform.mat;
     var ctx = this.element.canvasContext;
-    var i, len = this.data.masksProperties.length;
-    var pt,pt2,pt3,data, hasMasks = false;
+    var i, len = this.masksProperties.length;
+    var pt,pts,data;
+    ctx.beginPath();
     for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode === 'n'){
-            continue;
+        if(this.masksProperties[i].mode !== 'n'){
+            if (this.masksProperties[i].inv) {
+                ctx.moveTo(0, 0);
+                ctx.lineTo(this.element.globalData.compWidth, 0);
+                ctx.lineTo(this.element.globalData.compWidth, this.element.globalData.compHeight);
+                ctx.lineTo(0, this.element.globalData.compHeight);
+                ctx.lineTo(0, 0);
+            }
+            data = this.viewData[i].v;
+            pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0);
+            ctx.moveTo(pt[0], pt[1]);
+            var j, jLen = data._length;
+            for (j = 1; j < jLen; j++) {
+                pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
+                ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
+            }
+            pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
+            ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
         }
-        if(hasMasks === false){
-            ctx.beginPath();
-            hasMasks = true;
-        }
-        if (this.masksProperties[i].inv) {
-            ctx.moveTo(0, 0);
-            ctx.lineTo(this.element.globalData.compWidth, 0);
-            ctx.lineTo(this.element.globalData.compWidth, this.element.globalData.compHeight);
-            ctx.lineTo(0, this.element.globalData.compHeight);
-            ctx.lineTo(0, 0);
-        }
-        data = this.viewData[i].v;
-        pt = transform ? transform.applyToPointArray(data.v[0][0],data.v[0][1],0):data.v[0];
-        ctx.moveTo(pt[0], pt[1]);
-        var j, jLen = data._length;
-        for (j = 1; j < jLen; j++) {
-            pt = transform ? transform.applyToPointArray(data.o[j - 1][0],data.o[j - 1][1],0) : data.o[j - 1];
-            pt2 = transform ? transform.applyToPointArray(data.i[j][0],data.i[j][1],0) : data.i[j];
-            pt3 = transform ? transform.applyToPointArray(data.v[j][0],data.v[j][1],0) : data.v[j];
-            ctx.bezierCurveTo(pt[0], pt[1], pt2[0], pt2[1], pt3[0], pt3[1]);
-        }
-        pt = transform ? transform.applyToPointArray(data.o[j - 1][0],data.o[j - 1][1],0) : data.o[j - 1];
-        pt2 = transform ? transform.applyToPointArray(data.i[0][0],data.i[0][1],0) : data.i[0];
-        pt3 = transform ? transform.applyToPointArray(data.v[0][0],data.v[0][1],0) : data.v[0];
-        ctx.bezierCurveTo(pt[0], pt[1], pt2[0], pt2[1], pt3[0], pt3[1]);
     }
-    if(hasMasks){
-        ctx.clip();
-    }
+    this.element.globalData.renderer.save(true);
+    ctx.clip();
 };
 
-CVMaskElement.prototype.getMask = function(nm){
-    var i = 0, len = this.masksProperties.length;
-    while(i<len){
-        if(this.masksProperties[i].nm === nm){
-            return {
-                maskPath: this.viewData[i].pv
-            }
-        }
-        i += 1;
-    }
-};
+CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
 
 CVMaskElement.prototype.destroy = function(){
     this.element = null;
diff --git a/player/js/elements/canvasElements/CVShapeElement.js b/player/js/elements/canvasElements/CVShapeElement.js
index c09a6dd..b90d66f 100644
--- a/player/js/elements/canvasElements/CVShapeElement.js
+++ b/player/js/elements/canvasElements/CVShapeElement.js
@@ -1,133 +1,190 @@
-function CVShapeElement(data, comp,globalData){
+function CVShapeElement(data, globalData, comp) {
     this.shapes = [];
-    this.stylesList = [];
-    this.viewData = [];
-    this.shapeModifiers = [];
     this.shapesData = data.shapes;
-    this.firstFrame = true;
-    this._parent.constructor.call(this,data, comp,globalData);
-}
-createElement(CVBaseElement, CVShapeElement);
-
-CVShapeElement.prototype.lcEnum = {
-    '1': 'butt',
-    '2': 'round',
-    '3': 'butt'
+    this.stylesList = [];
+    this.itemsData = [];
+    this.prevViewData = [];
+    this.shapeModifiers = [];
+    this.processedElements = [];
+    this.initElement(data, globalData, comp);
 }
 
-CVShapeElement.prototype.ljEnum = {
-    '1': 'miter',
-    '2': 'round',
-    '3': 'butt'
-};
-CVShapeElement.prototype.transformHelper = {opacity:1,mat:new Matrix(),matMdf:false,opMdf:false};
+extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement);
+
+CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
+
+CVShapeElement.prototype.transformHelper = {opacity:1,mat:new Matrix(),_matMdf:false,_opMdf:false};
 
 CVShapeElement.prototype.dashResetter = [];
 
-CVShapeElement.prototype.createElements = function(){
-
-    this._parent.createElements.call(this);
-    this.searchShapes(this.shapesData,this.viewData,this.dynamicProperties);
+CVShapeElement.prototype.createContent = function(){
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true);
 };
-CVShapeElement.prototype.searchShapes = function(arr,data,dynamicProperties){
+
+CVShapeElement.prototype.createStyleElement = function(data){
+    var styleElem = {
+        data: data,
+        type: data.ty,
+        elements: []
+    };
+    var elementData = {};
+    if(data.ty == 'fl' || data.ty == 'st'){
+        elementData.c = PropertyFactory.getProp(this,data.c,1,255,this);
+        if(!elementData.c.k){
+            styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')';
+        }
+    }
+    elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this);
+    if(data.ty == 'st') {
+        styleElem.lc = this.lcEnum[data.lc] || 'round';
+        styleElem.lj = this.ljEnum[data.lj] || 'round';
+        if(data.lj == 1) {
+            styleElem.ml = data.ml;
+        }
+        elementData.w = PropertyFactory.getProp(this,data.w,0,null,this);
+        if(!elementData.w.k){
+            styleElem.wi = elementData.w.v;
+        }
+        if(data.d){
+            var d = new DashProperty(this,data.d,'canvas');
+            elementData.d = d;
+            if(!elementData.d.k){
+                styleElem.da = elementData.d.dashArray;
+                styleElem.do = elementData.d.dashoffset[0];
+            }
+        }
+
+    } else {
+
+        styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+    }
+    this.stylesList.push(styleElem);
+    elementData.style = styleElem;
+    return elementData;
+};
+
+CVShapeElement.prototype.createGroupElement = function(data) {
+    var elementData = {
+        it: [],
+        prevViewData: []
+    };
+    return elementData;
+};
+
+CVShapeElement.prototype.createTransformElement = function(data) {
+    var elementData = {
+        transform : {
+            mat: new Matrix(),
+            opacity: 1,
+            _matMdf:false,
+            _opMdf:false,
+            op: PropertyFactory.getProp(this,data.o,0,0.01,this),
+            mProps: TransformPropertyFactory.getTransformProperty(this,data,this)
+        },
+        elements: []
+    };
+    return elementData;
+};
+
+CVShapeElement.prototype.createShapeElement = function(data) {
+    var elementData = new CVShapeData(this, data);
+    
+    this.shapes.push(elementData);
+    this.addShapeToModifiers(elementData);
+    var j, jLen = this.stylesList.length;
+    var hasStrokes = false, hasFills = false;
+    for(j=0;j<jLen;j+=1){
+        if(!this.stylesList[j].closed){
+            this.stylesList[j].elements.push(elementData);
+            if(this.stylesList[j].type === 'st'){
+                hasStrokes = true;
+            }else{
+                hasFills = true;
+            }
+        }
+    }
+    elementData.st = hasStrokes;
+    elementData.fl = hasFills;
+    return elementData;
+};
+
+CVShapeElement.prototype.reloadShapes = function(){
+    this._isFirstFrame = true;
+    var i, len = this.itemsData.length;
+    for(i=0;i<len;i+=1){
+        this.prevViewData[i] = this.itemsData[i];
+    }
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true);
+    len = this.dynamicProperties.length;
+    for(i=0;i<len;i+=1){
+        this.dynamicProperties[i].getValue();
+    }
+    this.renderModifiers();
+};
+
+CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, render){
     var i, len = arr.length - 1;
     var j, jLen;
-    var ownArrays = [], ownModifiers = [], styleElem;
+    var ownArrays = [], ownModifiers = [], processedPos, modifier;
     for(i=len;i>=0;i-=1){
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
-            styleElem = {
-                type: arr[i].ty,
-                elements: []
-            };
-            data[i] = {};
-            if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
-                data[i].c = PropertyFactory.getProp(this,arr[i].c,1,255,dynamicProperties);
-                if(!data[i].c.k){
-                    styleElem.co = 'rgb('+bm_floor(data[i].c.v[0])+','+bm_floor(data[i].c.v[1])+','+bm_floor(data[i].c.v[2])+')';
-                }
-            }
-            data[i].o = PropertyFactory.getProp(this,arr[i].o,0,0.01,dynamicProperties);
-            if(arr[i].ty == 'st') {
-                styleElem.lc = this.lcEnum[arr[i].lc] || 'round';
-                styleElem.lj = this.ljEnum[arr[i].lj] || 'round';
-                if(arr[i].lj == 1) {
-                    styleElem.ml = arr[i].ml;
-                }
-                data[i].w = PropertyFactory.getProp(this,arr[i].w,0,null,dynamicProperties);
-                if(!data[i].w.k){
-                    styleElem.wi = data[i].w.v;
-                }
-                if(arr[i].d){
-                    var d = PropertyFactory.getDashProp(this,arr[i].d,'canvas',dynamicProperties);
-                    data[i].d = d;
-                    if(!data[i].d.k){
-                        styleElem.da = data[i].d.dasharray;
-                        styleElem.do = data[i].d.dashoffset;
-                    }
-                }
-
-            } else {
-
-                styleElem.r = arr[i].r === 2 ? 'evenodd' : 'nonzero';
-            }
-            this.stylesList.push(styleElem);
-            data[i].style = styleElem;
-            ownArrays.push(data[i].style);
-        }else if(arr[i].ty == 'gr'){
-            data[i] = {
-                it: []
-            };
-            this.searchShapes(arr[i].it,data[i].it,dynamicProperties);
-        }else if(arr[i].ty == 'tr'){
-            data[i] = {
-                transform : {
-                    mat: new Matrix(),
-                    opacity: 1,
-                    matMdf:false,
-                    opMdf:false,
-                    op: PropertyFactory.getProp(this,arr[i].o,0,0.01,dynamicProperties),
-                    mProps: PropertyFactory.getProp(this,arr[i],2,null,dynamicProperties)
-                },
-                elements: []
-            };
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            data[i] = {
-                nodes:[],
-                trNodes:[],
-                tr:[0,0,0,0,0,0]
-            };
-            var ty = 4;
-            if(arr[i].ty == 'rc'){
-                ty = 5;
-            }else if(arr[i].ty == 'el'){
-                ty = 6;
-            }else if(arr[i].ty == 'sr'){
-                ty = 7;
-            }
-            data[i].sh = ShapePropertyFactory.getShapeProp(this,arr[i],ty,dynamicProperties);
-            this.shapes.push(data[i].sh);
-            this.addShapeToModifiers(data[i]);
-            jLen = this.stylesList.length;
-            var hasStrokes = false, hasFills = false;
-            for(j=0;j<jLen;j+=1){
-                if(!this.stylesList[j].closed){
-                    this.stylesList[j].elements.push(data[i]);
-                    if(this.stylesList[j].type === 'st'){
-                        hasStrokes = true;
-                    }else{
-                        hasFills = true;
-                    }
-                }
-            }
-            data[i].st = hasStrokes;
-            data[i].fl = hasFills;
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'rp'){
-            var modifier = ShapeModifiers.getModifier(arr[i].ty);
-            modifier.init(this,arr[i],dynamicProperties);
-            this.shapeModifiers.push(modifier);
-            ownModifiers.push(modifier);
-            data[i] = modifier;
+        processedPos = this.searchProcessedElement(arr[i]);
+        if(!processedPos){
+            arr[i]._render = render;
+        } else {
+            itemsData[i] = prevViewData[processedPos - 1];
         }
+        if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
+            if(!processedPos){
+                itemsData[i] = this.createStyleElement(arr[i]);
+            } else {
+                itemsData[i].style.closed = false;
+            }
+            
+            ownArrays.push(itemsData[i].style);
+        }else if(arr[i].ty == 'gr'){
+            if(!processedPos){
+                itemsData[i] = this.createGroupElement(arr[i]);
+            } else {
+                jLen = itemsData[i].it.length;
+                for(j=0;j<jLen;j+=1){
+                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
+                }
+            }
+            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData, render);
+        }else if(arr[i].ty == 'tr'){
+            if(!processedPos){
+                itemsData[i] = this.createTransformElement(arr[i]);
+            }
+        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
+            if(!processedPos){
+                itemsData[i] = this.createShapeElement(arr[i]);
+            }
+            
+        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd'){
+            if(!processedPos){
+                modifier = ShapeModifiers.getModifier(arr[i].ty);
+                modifier.init(this,arr[i]);
+                itemsData[i] = modifier;
+                this.shapeModifiers.push(modifier);
+            } else {
+                modifier = itemsData[i];
+                modifier.closed = false;
+            }
+            ownModifiers.push(modifier);
+        } else if(arr[i].ty == 'rp'){
+            if(!processedPos){
+                modifier = ShapeModifiers.getModifier(arr[i].ty);
+                itemsData[i] = modifier;
+                modifier.init(this,arr,i,itemsData);
+                this.shapeModifiers.push(modifier);
+                render = false;
+            }else{
+                modifier = itemsData[i];
+                modifier.closed = true;
+            }
+            ownModifiers.push(modifier);
+        }
+        this.addProcessedElement(arr[i], i + 1);
     }
     len = ownArrays.length;
     for(i=0;i<len;i+=1){
@@ -139,60 +196,103 @@
     }
 };
 
-CVShapeElement.prototype.addShapeToModifiers = IShapeElement.prototype.addShapeToModifiers;
-CVShapeElement.prototype.renderModifiers = IShapeElement.prototype.renderModifiers;
+CVShapeElement.prototype.renderInnerContent = function() {
 
-CVShapeElement.prototype.renderFrame = function(parentMatrix){
-    if(this._parent.renderFrame.call(this, parentMatrix)===false){
-        return;
-    }
     this.transformHelper.mat.reset();
-    this.transformHelper.opacity = this.finalTransform.opacity;
-    this.transformHelper.matMdf = false;
-    this.transformHelper.opMdf = this.finalTransform.opMdf;
+    this.transformHelper.opacity = 1;
+    this.transformHelper._matMdf = false;
+    this.transformHelper._opMdf = false;
     this.renderModifiers();
-    this.renderShape(this.transformHelper,null,null,true);
-    if(this.data.hasMask){
-        this.globalData.renderer.restore(true);
+    this.renderShape(this.transformHelper,this.shapesData,this.itemsData,true);
+};
+
+CVShapeElement.prototype.renderShapeTransform = function(parentTransform, groupTransform) {
+    var props, groupMatrix;
+    if(parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
+        groupTransform.opacity = parentTransform.opacity;
+        groupTransform.opacity *= groupTransform.op.v;
+        groupTransform._opMdf = true;
+    }
+    if(parentTransform._matMdf || groupTransform.mProps._mdf || this._isFirstFrame) {
+        groupMatrix = groupTransform.mat;
+        groupMatrix.cloneFromProps(groupTransform.mProps.v.props);
+        groupTransform._matMdf = true;
+        props = parentTransform.mat.props;
+        groupMatrix.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
+    }
+};
+
+CVShapeElement.prototype.drawLayer = function() {
+    var i, len = this.stylesList.length;
+    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type, currentStyle;
+    for(i=0;i<len;i+=1){
+        currentStyle = this.stylesList[i];
+        type = currentStyle.type;
+        if((type === 'st' && currentStyle.wi === 0) || !currentStyle.data._render || currentStyle.coOp === 0){
+            continue;
+        }
+        renderer.save();
+        elems = currentStyle.elements;
+        if(type === 'st'){
+            ctx.strokeStyle = currentStyle.co;
+            ctx.lineWidth = currentStyle.wi;
+            ctx.lineCap = currentStyle.lc;
+            ctx.lineJoin = currentStyle.lj;
+            ctx.miterLimit = currentStyle.ml || 0;
+        }else{
+            ctx.fillStyle = currentStyle.co;
+        }
+        renderer.ctxOpacity(currentStyle.coOp);
+        if(this.globalData.currentGlobalAlpha !== 0) {
+            if(type !== 'st'){
+                ctx.beginPath();
+            }
+            jLen = elems.length;
+            for(j=0;j<jLen;j+=1){
+                if(type === 'st'){
+                    ctx.beginPath();
+                    if(currentStyle.da){
+                        ctx.setLineDash(currentStyle.da);
+                        ctx.lineDashOffset = currentStyle.do;
+                        this.globalData.isDashed = true;
+                    }else if(this.globalData.isDashed){
+                        ctx.setLineDash(this.dashResetter);
+                        this.globalData.isDashed = false;
+                    }
+                }
+                nodes = elems[j].trNodes;
+                kLen = nodes.length;
+
+                for(k=0;k<kLen;k+=1){
+                    if(nodes[k].t == 'm'){
+                        ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
+                    }else if(nodes[k].t == 'c'){
+                        ctx.bezierCurveTo(nodes[k].pts[0],nodes[k].pts[1],nodes[k].pts[2],nodes[k].pts[3],nodes[k].pts[4],nodes[k].pts[5]);
+                    }else{
+                        ctx.closePath();
+                    }
+                }
+                if(type === 'st'){
+                    ctx.stroke();
+                }
+            }
+            if(type !== 'st'){
+                ctx.fill(currentStyle.r);
+            }
+            
+        }
+        renderer.restore();
     }
 };
 
 CVShapeElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len;
-    if(!items){
-        items = this.shapesData;
-        len = this.stylesList.length;
-        for(i=0;i<len;i+=1){
-            this.stylesList[i].d = '';
-            this.stylesList[i].mdf = false;
-        }
-    }
-    if(!data){
-        data = this.viewData;
-    }
-    ///
-    ///
-    len = items.length - 1;
-    var groupTransform,groupMatrix;
+    var i, len = items.length - 1;
+    var groupTransform;
     groupTransform = parentTransform;
     for(i=len;i>=0;i-=1){
         if(items[i].ty == 'tr'){
             groupTransform = data[i].transform;
-            var mtArr = data[i].transform.mProps.v.props;
-            groupTransform.matMdf = groupTransform.mProps.mdf;
-            groupTransform.opMdf = groupTransform.op.mdf;
-            groupMatrix = groupTransform.mat;
-            groupMatrix.cloneFromProps(mtArr);
-            if(parentTransform){
-                var props = parentTransform.mat.props;
-                groupTransform.opacity = parentTransform.opacity;
-                groupTransform.opacity *= data[i].transform.op.v;
-                groupTransform.matMdf = parentTransform.matMdf ? true : groupTransform.matMdf;
-                groupTransform.opMdf = parentTransform.opMdf ? true : groupTransform.opMdf;
-                groupMatrix.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
-            }else{
-                groupTransform.opacity = groupTransform.op.o;
-            }
+            this.renderShapeTransform(parentTransform, groupTransform);
         }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){
             this.renderPath(items[i],data[i],groupTransform);
         }else if(items[i].ty == 'fl'){
@@ -205,79 +305,18 @@
             //
         }
     }
-    if(!isMain){
-        return;
+    if(isMain){
+        this.drawLayer();
     }
-    len = this.stylesList.length;
-    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type;
-    renderer.save();
-    renderer.ctxTransform(this.finalTransform.mat.props);
-    for(i=0;i<len;i+=1){
-        type = this.stylesList[i].type;
-        if(type === 'st' && this.stylesList[i].wi === 0){
-            continue;
-        }
-        renderer.save();
-        elems = this.stylesList[i].elements;
-        if(type === 'st'){
-            ctx.strokeStyle = this.stylesList[i].co;
-            ctx.lineWidth = this.stylesList[i].wi;
-            ctx.lineCap = this.stylesList[i].lc;
-            ctx.lineJoin = this.stylesList[i].lj;
-            ctx.miterLimit = this.stylesList[i].ml || 0;
-        }else{
-            ctx.fillStyle = this.stylesList[i].co;
-        }
-        renderer.ctxOpacity(this.stylesList[i].coOp);
-        if(type !== 'st'){
-            ctx.beginPath();
-        }
-        jLen = elems.length;
-        for(j=0;j<jLen;j+=1){
-            if(type === 'st'){
-                ctx.beginPath();
-                if(this.stylesList[i].da){
-                    ctx.setLineDash(this.stylesList[i].da);
-                    ctx.lineDashOffset = this.stylesList[i].do;
-                    this.globalData.isDashed = true;
-                }else if(this.globalData.isDashed){
-                    ctx.setLineDash(this.dashResetter);
-                    this.globalData.isDashed = false;
-                }
-            }
-            nodes = elems[j].trNodes;
-            kLen = nodes.length;
-
-            for(k=0;k<kLen;k+=1){
-                if(nodes[k].t == 'm'){
-                    ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
-                }else if(nodes[k].t == 'c'){
-                    ctx.bezierCurveTo(nodes[k].p1[0],nodes[k].p1[1],nodes[k].p2[0],nodes[k].p2[1],nodes[k].p3[0],nodes[k].p3[1]);
-                }else{
-                    ctx.closePath();
-                }
-            }
-            if(type === 'st'){
-                ctx.stroke();
-            }
-        }
-        if(type !== 'st'){
-            ctx.fill(this.stylesList[i].r);
-        }
-        renderer.restore();
-    }
-    renderer.restore();
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
+    
 };
-CVShapeElement.prototype.renderPath = function(pathData,viewData,groupTransform){
+CVShapeElement.prototype.renderPath = function(pathData,itemData,groupTransform){
     var len, i, j,jLen;
-    var redraw = groupTransform.matMdf || viewData.sh.mdf || this.firstFrame;
+    var redraw = groupTransform._matMdf || itemData.sh._mdf || this._isFirstFrame;
     if(redraw) {
-        var paths = viewData.sh.paths;
-        jLen = paths._length;
-        var pathStringTransformed = viewData.trNodes;
+        var paths = itemData.sh.paths, groupTransformMat = groupTransform.mat;
+        jLen = pathData._render === false ? 0 : paths._length;
+        var pathStringTransformed = itemData.trNodes;
         pathStringTransformed.length = 0;
         for(j=0;j<jLen;j+=1){
             var pathNodes = paths.shapes[j];
@@ -287,78 +326,72 @@
                     if (i == 1) {
                         pathStringTransformed.push({
                             t: 'm',
-                            p: groupTransform.mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
+                            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
                         });
                     }
                     pathStringTransformed.push({
                         t: 'c',
-                        p1: groupTransform.mat.applyToPointArray(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1], 0),
-                        p2: groupTransform.mat.applyToPointArray(pathNodes.i[i][0], pathNodes.i[i][1], 0),
-                        p3: groupTransform.mat.applyToPointArray(pathNodes.v[i][0], pathNodes.v[i][1], 0)
+                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
                     });
                 }
                 if (len == 1) {
                     pathStringTransformed.push({
                         t: 'm',
-                        p: groupTransform.mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
+                        p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
                     });
                 }
                 if (pathNodes.c && len) {
                     pathStringTransformed.push({
                         t: 'c',
-                        p1: groupTransform.mat.applyToPointArray(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1], 0),
-                        p2: groupTransform.mat.applyToPointArray(pathNodes.i[0][0], pathNodes.i[0][1], 0),
-                        p3: groupTransform.mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
+                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
                     });
                     pathStringTransformed.push({
                         t: 'z'
                     });
                 }
-                viewData.lStr = pathStringTransformed;
+                itemData.lStr = pathStringTransformed;
             }
 
         }
 
-        if (viewData.st) {
+        if (itemData.st) {
             for (i = 0; i < 16; i += 1) {
-                viewData.tr[i] = groupTransform.mat.props[i];
+                itemData.tr[i] = groupTransform.mat.props[i];
             }
         }
-        viewData.trNodes = pathStringTransformed;
+        itemData.trNodes = pathStringTransformed;
 
     }
 };
 
 
 
-CVShapeElement.prototype.renderFill = function(styleData,viewData, groupTransform){
-    var styleElem = viewData.style;
+CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){
+    var styleElem = itemData.style;
 
-    if(viewData.c.mdf || this.firstFrame){
-        styleElem.co = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
+    if(itemData.c._mdf || this._isFirstFrame){
+        styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
     }
-    if(viewData.o.mdf || groupTransform.opMdf || this.firstFrame){
-        styleElem.coOp = viewData.o.v*groupTransform.opacity;
+    if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
+        styleElem.coOp = itemData.o.v*groupTransform.opacity;
     }
 };
 
-CVShapeElement.prototype.renderStroke = function(styleData,viewData, groupTransform){
-    var styleElem = viewData.style;
-    //TODO fix dashes
-    var d = viewData.d;
-    var dasharray,dashoffset;
-    if(d && (d.mdf  || this.firstFrame)){
-        styleElem.da = d.dasharray;
-        styleElem.do = d.dashoffset;
+CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){
+    var styleElem = itemData.style;
+    var d = itemData.d;
+    if(d && (d._mdf  || this._isFirstFrame)){
+        styleElem.da = d.dashArray;
+        styleElem.do = d.dashoffset[0];
     }
-    if(viewData.c.mdf || this.firstFrame){
-        styleElem.co = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
+    if(itemData.c._mdf || this._isFirstFrame){
+        styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
     }
-    if(viewData.o.mdf || groupTransform.opMdf || this.firstFrame){
-        styleElem.coOp = viewData.o.v*groupTransform.opacity;
+    if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
+        styleElem.coOp = itemData.o.v*groupTransform.opacity;
     }
-    if(viewData.w.mdf || this.firstFrame){
-        styleElem.wi = viewData.w.v;
+    if(itemData.w._mdf || this._isFirstFrame){
+        styleElem.wi = itemData.w.v;
     }
 };
 
@@ -368,7 +401,6 @@
     this.globalData = null;
     this.canvasContext = null;
     this.stylesList.length = 0;
-    this.viewData.length = 0;
-    this._parent.destroy.call(this._parent);
+    this.itemsData.length = 0;
 };
 
diff --git a/player/js/elements/canvasElements/CVShapeItemElement.js b/player/js/elements/canvasElements/CVShapeItemElement.js
deleted file mode 100644
index 5069285..0000000
--- a/player/js/elements/canvasElements/CVShapeItemElement.js
+++ /dev/null
@@ -1,396 +0,0 @@
-function CVShapeItemElement(data,dynamicProperties,globalData){
-    this.lcEnum = {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'butt'
-    };
-    this.ljEnum = {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    };
-    this.stylesList = [];
-    this.viewData = [];
-    this.elemData = data;
-    this.data = data.shapes;
-    this.globalData = globalData;
-    this.firstFrame = true;
-    this.searchShapes(this.data,this.viewData,dynamicProperties,[]);
-}
-
-CVShapeItemElement.prototype.dashResetter = [];
-
-CVShapeItemElement.prototype.searchShapes = function(arr,data,dynamicProperties,addedTrims){
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownArrays = [], ownTrims = [], styleElem;
-    for(i=len;i>=0;i-=1){
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'){
-            styleElem = {
-                type: arr[i].ty,
-                elements: []
-            }
-            data[i] = {};
-            data[i].c = PropertyFactory.getProp(this.elemData,arr[i].c,1,null,dynamicProperties);
-            if(!data[i].c.k){
-                styleElem.co = 'rgb('+bm_floor(data[i].c.v[0])+','+bm_floor(data[i].c.v[1])+','+bm_floor(data[i].c.v[2])+')';
-            }
-            data[i].o = PropertyFactory.getProp(this.elemData,arr[i].o,0,0.01,dynamicProperties);
-            if(arr[i].ty == 'st') {
-                styleElem.lc = this.lcEnum[arr[i].lc] || 'round';
-                styleElem.lj = this.ljEnum[arr[i].lj] || 'round';
-                if(arr[i].lj == 1) {
-                    styleElem.ml = arr[i].ml;
-                }
-                data[i].w = PropertyFactory.getProp(this.elemData,arr[i].w,0,null,dynamicProperties);
-                if(!data[i].w.k){
-                    styleElem.wi = data[i].w.v;
-                }
-                if(arr[i].d){
-                    var d = PropertyFactory.getDashProp(this.elemData,arr[i].d,'canvas',dynamicProperties);
-                    data[i].d = d;
-                    if(!data[i].d.k){
-                        styleElem.da = data[i].d.dasharray;
-                        styleElem.do = data[i].d.dashoffset;
-                    }
-                }
-
-            }
-            this.stylesList.push(styleElem);
-            data[i].style = styleElem;
-            ownArrays.push(data[i].style);
-        }else if(arr[i].ty == 'gr'){
-            data[i] = {
-                it: []
-            };
-            this.searchShapes(arr[i].it,data[i].it,dynamicProperties,addedTrims);
-        }else if(arr[i].ty == 'tr'){
-            data[i] = {
-                transform : {
-                    mat: new Matrix(),
-                    opacity: 1,
-                    matMdf:false,
-                    opMdf:false,
-                    op: PropertyFactory.getProp(this.elemData,arr[i].o,0,0.01,dynamicProperties),
-                    mProps: PropertyFactory.getProp(this.elemData,arr[i],2,null,dynamicProperties)
-                },
-                elements: []
-            };
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el'){
-            data[i] = {
-                nodes:[],
-                trNodes:[],
-                tr:[0,0,0,0,0,0]
-            };
-            var ty = 4;
-            if(arr[i].ty == 'rc'){
-                ty = 5;
-            }else if(arr[i].ty == 'el'){
-                ty = 6;
-            }
-            data[i].sh = PropertyFactory.getShapeProp(this.elemData,arr[i],ty,dynamicProperties, addedTrims);
-            jLen = this.stylesList.length;
-            var hasStrokes = false, hasFills = false;
-            for(j=0;j<jLen;j+=1){
-                if(!this.stylesList[j].closed){
-                    this.stylesList[j].elements.push(data[i]);
-                    if(this.stylesList[j].type === 'st'){
-                        hasStrokes = true;
-                    }else{
-                        hasFills = true;
-                    }
-                }
-            }
-            data[i].st = hasStrokes;
-            data[i].fl = hasFills;
-        }else if(arr[i].ty == 'tm'){
-            var trimOb = {
-                closed: false,
-                trimProp: PropertyFactory.getProp(this.elemData,arr[i],7,null,dynamicProperties)
-            };
-            addedTrims.push(trimOb);
-            ownTrims.push(trimOb);
-        }
-    }
-    len = ownArrays.length;
-    for(i=0;i<len;i+=1){
-        ownArrays[i].closed = true;
-    }
-    len = ownTrims.length;
-    for(i=0;i<len;i+=1){
-        ownTrims[i].closed = true;
-    }
-};
-
-CVShapeItemElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len;
-    if(!items){
-        items = this.data;
-        len = this.stylesList.length;
-        for(i=0;i<len;i+=1){
-            this.stylesList[i].d = '';
-            this.stylesList[i].mdf = false;
-        }
-    }
-    if(!data){
-        data = this.viewData;
-    }
-    ///
-    ///
-    len = items.length - 1;
-    var groupTransform,groupMatrix;
-    groupTransform = parentTransform;
-    for(i=len;i>=0;i-=1){
-        if(items[i].ty == 'tr'){
-            groupTransform = data[i].transform;
-            var mtArr = data[i].transform.mProps.v.props;
-            groupTransform.matMdf = groupTransform.mProps.mdf;
-            groupTransform.opMdf = groupTransform.op.mdf;
-            groupMatrix = groupTransform.mat;
-            groupMatrix.reset();
-            if(parentTransform){
-                var props = parentTransform.mat.props;
-                groupTransform.opacity = parentTransform.opacity;
-                groupTransform.opacity *= data[i].transform.op.v;
-                groupTransform.matMdf = parentTransform.matMdf ? true : groupTransform.matMdf;
-                groupTransform.opMdf = parentTransform.opMdf ? true : groupTransform.opMdf;
-                groupMatrix.transform(props[0],props[1],props[2],props[3],props[4],props[5]);
-            }else{
-                groupTransform.opacity = groupTransform.op.o;
-            }
-            groupMatrix.transform(mtArr[0],mtArr[1],mtArr[2],mtArr[3],mtArr[4],mtArr[5]);
-        }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc'){
-            this.renderPath(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'fl'){
-            this.renderFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'st'){
-            this.renderStroke(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gr'){
-            this.renderShape(groupTransform,items[i].it,data[i].it);
-        }else if(items[i].ty == 'tm'){
-            //
-        }
-    }
-    if(!isMain){
-        return;
-    }
-    len = this.stylesList.length;
-    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type;
-    for(i=0;i<len;i+=1){
-        type = this.stylesList[i].type;
-        if(type === 'st' && this.stylesList[i].wi === 0){
-            continue;
-        }
-        renderer.save();
-        elems = this.stylesList[i].elements;
-        jLen = elems.length;
-        if(type === 'st'){
-            ctx.strokeStyle = this.stylesList[i].co;
-            ctx.lineWidth = this.stylesList[i].wi;
-            ctx.lineCap = this.stylesList[i].lc;
-            ctx.lineJoin = this.stylesList[i].lj;
-            ctx.miterLimit = this.stylesList[i].ml;
-        }else{
-            ctx.fillStyle = this.stylesList[i].co;
-        }
-        renderer.ctxOpacity(this.stylesList[i].coOp);
-        ctx.beginPath();
-        for(j=0;j<jLen;j+=1){
-            if(type === 'st'){
-                renderer.save();
-                ctx.beginPath();
-                if(this.stylesList[i].da){
-                    ctx.setLineDash(this.stylesList[i].da);
-                    ctx.lineDashOffset = this.stylesList[i].do;
-                    this.globalData.isDashed = true;
-                }else if(this.globalData.isDashed){
-                    ctx.setLineDash(this.dashResetter);
-                    this.globalData.isDashed = false;
-                }
-                renderer.ctxTransform(elems[j].tr);
-                nodes = elems[j].nodes;
-            }else{
-                nodes = elems[j].trNodes;
-            }
-            kLen = nodes.length;
-
-            for(k=0;k<kLen;k+=1){
-                if(nodes[k].t == 'm'){
-                    ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
-                }else{
-                    ctx.bezierCurveTo(nodes[k].p1[0],nodes[k].p1[1],nodes[k].p2[0],nodes[k].p2[1],nodes[k].p3[0],nodes[k].p3[1]);
-                }
-            }
-            if(type === 'st'){
-                ctx.stroke();
-                renderer.restore();
-            }
-        }
-        if(type !== 'st'){
-            ctx.fill();
-        }
-        renderer.restore();
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-};
-
-CVShapeItemElement.prototype.renderPath = function(pathData,viewData,groupTransform){
-    var len, i;
-    var pathNodes = viewData.sh.v;
-    if(pathNodes.v){
-        len = pathNodes.v.length;
-        var redraw = groupTransform.matMdf || viewData.sh.mdf || this.firstFrame;
-        if(redraw) {
-            var pathStringTransformed = viewData.trNodes;
-            var pathStringNonTransformed = viewData.nodes;
-            pathStringTransformed.length = 0;
-            pathStringNonTransformed.length = 0;
-            var stops = pathNodes.s ? pathNodes.s : [];
-            for (i = 1; i < len; i += 1) {
-                if (stops[i - 1]) {
-                    if (viewData.st) {
-                        pathStringNonTransformed.push({
-                            t:'m',
-                            p:stops[i - 1]
-                        });
-                    }
-                    if (viewData.fl) {
-                        pathStringTransformed.push({
-                            t:'m',
-                            p:groupTransform.mat.applyToPointArray(stops[i - 1][0], stops[i - 1][1])
-                        });
-                    }
-                } else if (i == 1) {
-                    if (viewData.st) {
-                        pathStringNonTransformed.push({
-                            t:'m',
-                            p:pathNodes.v[0]
-                        });
-                    }
-
-                    if (viewData.fl) {
-                        pathStringTransformed.push({
-                            t:'m',
-                            p:groupTransform.mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1])
-                        });
-                    }
-                }
-                if (viewData.st) {
-                    pathStringNonTransformed.push({
-                        t:'c',
-                        p1:pathNodes.o[i - 1],
-                        p2:pathNodes.i[i],
-                        p3:pathNodes.v[i]
-                    });
-                }
-
-                if (viewData.fl) {
-                    pathStringTransformed.push({
-                        t:'c',
-                        p1:groupTransform.mat.applyToPointArray(pathNodes.o[i - 1][0],pathNodes.o[i - 1][1]),
-                        p2:groupTransform.mat.applyToPointArray(pathNodes.i[i][0], pathNodes.i[i][1]),
-                        p3:groupTransform.mat.applyToPointArray(pathNodes.v[i][0], pathNodes.v[i][1])
-                    });
-                }
-            }
-            if (len == 1) {
-                if (stops[0]) {
-                    if (viewData.st) {
-                        pathStringNonTransformed.push({
-                            t:'m',
-                            p:stops[0]
-                        });
-                    }
-                    if (viewData.fl) {
-                        pathStringTransformed.push({
-                            t:'m',
-                            p:groupTransform.mat.applyToPointArray(stops[0][0], stops[0][1])
-                        });
-                    }
-                } else {
-                    if (viewData.st) {
-                        pathStringNonTransformed.push({
-                            t:'m',
-                            p:pathNodes.v[0]
-                        });
-                    }
-                    if (viewData.fl) {
-                        pathStringTransformed.push({
-                            t:'m',
-                            p:groupTransform.mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1])
-                        });
-                    }
-                }
-            }
-            if (len && pathData.closed && !(pathData.trimmed && !pathNodes.c)) {
-                if (viewData.st) {
-                    pathStringNonTransformed.push({
-                        t:'c',
-                        p1:pathNodes.o[i - 1],
-                        p2:pathNodes.i[0],
-                        p3:pathNodes.v[0]
-                    });
-                }
-                if (viewData.fl) {
-                    pathStringTransformed.push({
-                        t:'c',
-                        p1:groupTransform.mat.applyToPointArray(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]),
-                        p2:groupTransform.mat.applyToPointArray(pathNodes.i[0][0], pathNodes.i[0][1]),
-                        p3:groupTransform.mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1])
-                    });
-                }
-            }
-            if (viewData.st) {
-                viewData.tr[0] = groupTransform.mat.props[0];
-                viewData.tr[1] = groupTransform.mat.props[1];
-                viewData.tr[2] = groupTransform.mat.props[2];
-                viewData.tr[3] = groupTransform.mat.props[3];
-                viewData.tr[4] = groupTransform.mat.props[4];
-                viewData.tr[5] = groupTransform.mat.props[5];
-            }
-            viewData.nodes = pathStringNonTransformed;
-            viewData.trNodes = pathStringTransformed;
-        }
-    }
-};
-
-
-
-CVShapeItemElement.prototype.renderFill = function(styleData,viewData, groupTransform){
-    var styleElem = viewData.style;
-
-    if(viewData.c.mdf || this.firstFrame){
-        styleElem.co = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || groupTransform.opMdf || this.firstFrame){
-        styleElem.coOp = viewData.o.v*groupTransform.opacity;
-    }
-};
-
-CVShapeItemElement.prototype.renderStroke = function(styleData,viewData, groupTransform){
-    var styleElem = viewData.style;
-    //TODO fix dashes
-    var d = viewData.d;
-    var dasharray,dashoffset;
-    if(d && (d.mdf  || this.firstFrame)){
-        styleElem.da = d.dasharray;
-        styleElem.do = d.dashoffset;
-    }
-    if(viewData.c.mdf || this.firstFrame){
-        styleElem.co = 'rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')';
-    }
-    if(viewData.o.mdf || groupTransform.opMdf || this.firstFrame){
-        styleElem.coOp = viewData.o.v*groupTransform.opacity;
-    }
-    if(viewData.w.mdf || this.firstFrame){
-        styleElem.wi = viewData.w.v;
-    }
-};
-
-CVShapeItemElement.prototype.destroy = function(){
-    this.data = null;
-    this.globalData = null;
-    this.canvasContext = null;
-};
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVSolidElement.js b/player/js/elements/canvasElements/CVSolidElement.js
index 27ff1f2..0f88d44 100644
--- a/player/js/elements/canvasElements/CVSolidElement.js
+++ b/player/js/elements/canvasElements/CVSolidElement.js
@@ -1,20 +1,14 @@
-function CVSolidElement(data, comp,globalData){
-    this._parent.constructor.call(this,data, comp,globalData);
+function CVSolidElement(data, globalData, comp) {
+    this.initElement(data,globalData,comp);
 }
-createElement(CVBaseElement, CVSolidElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
 
-CVSolidElement.prototype.renderFrame = function(parentMatrix){
-    if(this._parent.renderFrame.call(this, parentMatrix)===false){
-        return;
-    }
+CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
+CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
+
+CVSolidElement.prototype.renderInnerContent = function() {
     var ctx = this.canvasContext;
-    this.globalData.renderer.save();
-    this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
-    this.globalData.renderer.ctxOpacity(this.finalTransform.opacity);
-    ctx.fillStyle=this.data.sc;
-    ctx.fillRect(0,0,this.data.sw,this.data.sh);
-    this.globalData.renderer.restore(this.data.hasMask);
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
+    ctx.fillStyle = this.data.sc;
+    ctx.fillRect(0, 0, this.data.sw, this.data.sh);
+    //
 };
\ No newline at end of file
diff --git a/player/js/elements/canvasElements/CVTextElement.js b/player/js/elements/canvasElements/CVTextElement.js
index 3be7267..c38c8fa 100644
--- a/player/js/elements/canvasElements/CVTextElement.js
+++ b/player/js/elements/canvasElements/CVTextElement.js
@@ -1,4 +1,4 @@
-function CVTextElement(data, comp, globalData){
+function CVTextElement(data, globalData, comp){
     this.textSpans = [];
     this.yOffset = 0;
     this.fillColorAnim = false;
@@ -14,33 +14,21 @@
         stroke: 'rgba(0,0,0,0)',
         sWidth: 0,
         fValue: ''
-    }
-    this._parent.constructor.call(this,data,comp, globalData);
+    };
+    this.initElement(data,globalData,comp);
 }
-createElement(CVBaseElement, CVTextElement);
+extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement], CVTextElement);
 
-CVTextElement.prototype.init = ITextElement.prototype.init;
-CVTextElement.prototype.getMeasures = ITextElement.prototype.getMeasures;
-CVTextElement.prototype.getMult = ITextElement.prototype.getMult;
-CVTextElement.prototype.prepareFrame = ITextElement.prototype.prepareFrame;
-
-CVTextElement.prototype.tHelper = document.createElement('canvas').getContext('2d');
-
-CVTextElement.prototype.createElements = function(){
-
-    this._parent.createElements.call(this);
-    //console.log('this.data: ',this.data);
-
-};
+CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
 
 CVTextElement.prototype.buildNewText = function(){
-    var documentData = this.currentTextDocumentData;
-    this.renderedLetters = Array.apply(null,{length:this.currentTextDocumentData.l ? this.currentTextDocumentData.l.length : 0});
+    var documentData = this.textProperty.currentData;
+    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
 
     var hasFill = false;
     if(documentData.fc) {
         hasFill = true;
-        this.values.fill = 'rgb(' + Math.round(documentData.fc[0]*255) + ',' + Math.round(documentData.fc[1]*255) + ',' + Math.round(documentData.fc[2]*255) + ')';
+        this.values.fill = this.buildColor(documentData.fc);
     }else{
         this.values.fill = 'rgba(0,0,0,0)';
     }
@@ -48,7 +36,7 @@
     var hasStroke = false;
     if(documentData.sc){
         hasStroke = true;
-        this.values.stroke = 'rgb(' + Math.round(documentData.sc[0]*255) + ',' + Math.round(documentData.sc[1]*255) + ',' + Math.round(documentData.sc[2]*255) + ')';
+        this.values.stroke = this.buildColor(documentData.sc);
         this.values.sWidth = documentData.sw;
     }
     var fontData = this.globalData.fontManager.getFontByName(documentData.f);
@@ -56,68 +44,47 @@
     var letters = documentData.l;
     var matrixHelper = this.mHelper;
     this.stroke = hasStroke;
-    this.values.fValue = documentData.s + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily;
-    len = documentData.t.length;
-    this.tHelper.font = this.values.fValue;
+    this.values.fValue = documentData.finalSize + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily;
+    len = documentData.finalText.length;
+    //this.tHelper.font = this.values.fValue;
     var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape;
-    if (singleShape) {
-        var xPos = 0, yPos = 0, lineWidths = documentData.lineWidths, boxWidth = documentData.boxWidth, firstLine = true;
-    }
+    var trackingOffset = documentData.tr/1000*documentData.finalSize;
+    var xPos = 0, yPos = 0, firstLine = true;
     var cnt = 0;
-    for (i = 0;i < len ;i += 1) {
-        charData = this.globalData.fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-        var shapeData;
-        if(charData){
-            shapeData = charData.data;
-        } else {
-            shapeData = null;
-        }
+    for (i = 0; i < len; i += 1) {
+        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+        shapeData = charData && charData.data || {};
         matrixHelper.reset();
         if(singleShape && letters[i].n) {
-            xPos = 0;
+            xPos = -trackingOffset;
             yPos += documentData.yOffset;
             yPos += firstLine ? 1 : 0;
             firstLine = false;
         }
 
-        if(shapeData && shapeData.shapes){
-            shapes = shapeData.shapes[0].it;
-            jLen = shapes.length;
-            matrixHelper.scale(documentData.s/100,documentData.s/100);
-            if(singleShape){
-                if(documentData.ps){
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
+        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+        jLen = shapes.length;
+        matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
+        if(singleShape){
+            this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+        }
+        commands = createSizedArray(jLen);
+        for(j=0;j<jLen;j+=1){
+            kLen = shapes[j].ks.k.i.length;
+            pathNodes = shapes[j].ks.k;
+            pathArr = [];
+            for(k=1;k<kLen;k+=1){
+                if(k==1){
+                    pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
                 }
-                matrixHelper.translate(0,-documentData.ls,0);
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(documentData.justifyOffset + (boxWidth - lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(documentData.justifyOffset + (boxWidth - lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(xPos,yPos,0);
+                pathArr.push(matrixHelper.applyToX(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToY(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToX(pathNodes.i[k][0],pathNodes.i[k][1],0),matrixHelper.applyToY(pathNodes.i[k][0],pathNodes.i[k][1],0),matrixHelper.applyToX(pathNodes.v[k][0],pathNodes.v[k][1],0),matrixHelper.applyToY(pathNodes.v[k][0],pathNodes.v[k][1],0));
             }
-            commands = new Array(jLen);
-            for(j=0;j<jLen;j+=1){
-                kLen = shapes[j].ks.k.i.length;
-                pathNodes = shapes[j].ks.k;
-                pathArr = [];
-                for(k=1;k<kLen;k+=1){
-                    if(k==1){
-                        pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
-                    }
-                    pathArr.push(matrixHelper.applyToX(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToY(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToX(pathNodes.i[k][0],pathNodes.i[k][1],0),matrixHelper.applyToY(pathNodes.i[k][0],pathNodes.i[k][1],0),matrixHelper.applyToX(pathNodes.v[k][0],pathNodes.v[k][1],0),matrixHelper.applyToY(pathNodes.v[k][0],pathNodes.v[k][1],0));
-                }
-                pathArr.push(matrixHelper.applyToX(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToY(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToX(pathNodes.i[0][0],pathNodes.i[0][1],0),matrixHelper.applyToY(pathNodes.i[0][0],pathNodes.i[0][1],0),matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
-                commands[j] = pathArr;
-            }
-        }else{
-            commands = [];
+            pathArr.push(matrixHelper.applyToX(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToY(pathNodes.o[k-1][0],pathNodes.o[k-1][1],0),matrixHelper.applyToX(pathNodes.i[0][0],pathNodes.i[0][1],0),matrixHelper.applyToY(pathNodes.i[0][0],pathNodes.i[0][1],0),matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
+            commands[j] = pathArr;
         }
         if(singleShape){
             xPos += letters[i].l;
+            xPos += trackingOffset;
         }
         if(this.textSpans[cnt]){
             this.textSpans[cnt].elem = commands;
@@ -126,30 +93,24 @@
         }
         cnt +=1;
     }
-}
+};
 
-CVTextElement.prototype.renderFrame = function(parentMatrix){
-    if(this._parent.renderFrame.call(this, parentMatrix)===false){
-        return;
-    }
+CVTextElement.prototype.renderInnerContent = function(){
     var ctx = this.canvasContext;
     var finalMat = this.finalTransform.mat.props;
-    this.globalData.renderer.save();
-    this.globalData.renderer.ctxTransform(finalMat);
-    this.globalData.renderer.ctxOpacity(this.finalTransform.opacity);
     ctx.font = this.values.fValue;
     ctx.lineCap = 'butt';
     ctx.lineJoin = 'miter';
     ctx.miterLimit = 4;
 
     if(!this.data.singleShape){
-        this.getMeasures();
+        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
     }
 
     var  i,len, j, jLen, k, kLen;
-    var renderedLetters = this.renderedLetters;
+    var renderedLetters = this.textAnimator.renderedLetters;
 
-    var letters = this.currentTextDocumentData.l;
+    var letters = this.textProperty.currentData.l;
 
     len = letters.length;
     var renderedLetter;
@@ -161,7 +122,7 @@
         renderedLetter = renderedLetters[i];
         if(renderedLetter){
             this.globalData.renderer.save();
-            this.globalData.renderer.ctxTransform(renderedLetter.props);
+            this.globalData.renderer.ctxTransform(renderedLetter.p);
             this.globalData.renderer.ctxOpacity(renderedLetter.o);
         }
         if(this.fill){
@@ -230,8 +191,4 @@
     /*if(this.data.hasMask){
      this.globalData.renderer.restore(true);
      }*/
-    this.globalData.renderer.restore(this.data.hasMask);
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
 };
\ No newline at end of file
diff --git a/player/js/elements/helpers/FrameElement.js b/player/js/elements/helpers/FrameElement.js
new file mode 100644
index 0000000..41080a0
--- /dev/null
+++ b/player/js/elements/helpers/FrameElement.js
@@ -0,0 +1,51 @@
+/**
+ * @file 
+ * Handles element's layer frame update.
+ * Checks layer in point and out point
+ *
+ */
+
+function FrameElement(){}
+
+FrameElement.prototype = {
+    /**
+     * @function 
+     * Initializes frame related properties.
+     *
+     */
+    initFrame: function(){
+        //set to true when inpoint is rendered
+        this._isFirstFrame = false;
+        //list of animated properties
+        this.dynamicProperties = [];
+        // If layer has been modified in current tick this will be true
+        this._mdf = false;
+    },
+    /**
+     * @function 
+     * Calculates all dynamic values
+     *
+     * @param {number} num
+     * current frame number in Layer's time
+     * @param {boolean} isVisible
+     * if layers is currently in range
+     * 
+     */
+    prepareProperties: function(num, isVisible) {
+        var i, len = this.dynamicProperties.length;
+        for (i = 0;i < len; i += 1) {
+            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+                this.dynamicProperties[i].getValue();
+                if (this.dynamicProperties[i]._mdf) {
+                    this.globalData._mdf = true;
+                    this._mdf = true;
+                }
+            }
+        }
+    },
+    addDynamicProperty: function(prop) {
+        if(this.dynamicProperties.indexOf(prop) === -1) {
+            this.dynamicProperties.push(prop);
+        }
+    }
+};
\ No newline at end of file
diff --git a/player/js/elements/helpers/HierarchyElement.js b/player/js/elements/helpers/HierarchyElement.js
new file mode 100644
index 0000000..0a91122
--- /dev/null
+++ b/player/js/elements/helpers/HierarchyElement.js
@@ -0,0 +1,50 @@
+/**
+ * @file 
+ * Handles AE's layer parenting property.
+ *
+ */
+
+function HierarchyElement(){}
+
+HierarchyElement.prototype = {
+	/**
+     * @function 
+     * Initializes hierarchy properties
+     *
+     */
+	initHierarchy: function() {
+		//element's parent list
+	    this.hierarchy = [];
+	    //if element is parent of another layer _isParent will be true
+	    this._isParent = false;
+	    this.checkParenting();
+	},
+	/**
+     * @function 
+     * Sets layer's hierarchy.
+     * @param {array} hierarch
+     * layer's parent list
+     *
+     */ 
+	setHierarchy: function(hierarchy){
+	    this.hierarchy = hierarchy;
+	},
+	/**
+     * @function 
+     * Sets layer as parent.
+     *
+     */ 
+	setAsParent: function() {
+	    this._isParent = true;
+	},
+	/**
+     * @function 
+     * Searches layer's parenting chain
+     *
+     */ 
+	checkParenting: function(){
+	    if (this.data.parent !== undefined){
+	        this.comp.buildElementParenting(this, this.data.parent, []);
+	    }
+	}
+};
\ No newline at end of file
diff --git a/player/js/elements/helpers/RenderableDOMElement.js b/player/js/elements/helpers/RenderableDOMElement.js
new file mode 100644
index 0000000..19ef002
--- /dev/null
+++ b/player/js/elements/helpers/RenderableDOMElement.js
@@ -0,0 +1,61 @@
+function RenderableDOMElement() {}
+
+(function(){
+    var _prototype = {
+        initElement: function(data,globalData,comp) {
+            this.initFrame();
+            this.initBaseData(data, globalData, comp);
+            this.initTransform(data, globalData, comp);
+            this.initHierarchy();
+            this.initRenderable();
+            this.initRendererElement();
+            this.createContainerElements();
+            this.addMasks();
+            this.createContent();
+            this.hide();
+        },
+        hide: function(){
+            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+                var elem = this.baseElement || this.layerElement;
+                elem.style.display = 'none';
+                this.hidden = true;
+            }
+        },
+        show: function(){
+            if (this.isInRange && !this.isTransparent){
+                if (!this.data.hd) {
+                    var elem = this.baseElement || this.layerElement;
+                    elem.style.display = 'block';
+                }
+                this.hidden = false;
+                this._isFirstFrame = true;
+            }
+        },
+        renderFrame: function() {
+            //If it is exported as hidden (data.hd === true) no need to render
+            //If it is not visible no need to render
+            if (this.data.hd || this.hidden) {
+                return;
+            }
+            this.renderTransform();
+            this.renderRenderable();
+            this.renderElement();
+            this.renderInnerContent();
+            if (this._isFirstFrame) {
+                this._isFirstFrame = false;
+            }
+        },
+        renderInnerContent: function() {},
+        prepareFrame: function(num) {
+            this._mdf = false;
+            this.prepareRenderableFrame(num);
+            this.prepareProperties(num, this.isInRange);
+            this.checkTransparency();
+        },
+        destroy: function(){
+            this.innerElem =  null;
+            this.destroyBaseElement();
+        }
+    };
+    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+}());
\ No newline at end of file
diff --git a/player/js/elements/helpers/RenderableElement.js b/player/js/elements/helpers/RenderableElement.js
new file mode 100644
index 0000000..6018d81
--- /dev/null
+++ b/player/js/elements/helpers/RenderableElement.js
@@ -0,0 +1,88 @@
+function RenderableElement(){
+
+}
+
+RenderableElement.prototype = {
+    initRenderable: function() {
+        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+        this.isInRange = false;
+        //layer's display state
+        this.hidden = false;
+        // If layer's transparency equals 0, it can be hidden
+        this.isTransparent = false;
+        //list of animated components
+        this.renderableComponents = [];
+    },
+    addRenderableComponent: function(component) {
+        if(this.renderableComponents.indexOf(component) === -1) {
+            this.renderableComponents.push(component);
+        }
+    },
+    removeRenderableComponent: function(component) {
+        if(this.renderableComponents.indexOf(component) !== -1) {
+            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+        }
+    },
+    prepareRenderableFrame: function(num) {
+        this.checkLayerLimits(num);
+    },
+    checkTransparency: function(){
+        if(this.finalTransform.mProp.o.v <= 0) {
+            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
+                this.isTransparent = true;
+                this.hide();
+            }
+        } else if(this.isTransparent) {
+            this.isTransparent = false;
+            this.show();
+        }
+    },
+    /**
+     * @function 
+     * Initializes frame related properties.
+     *
+     * @param {number} num
+     * current frame number in Layer's time
+     * 
+     */
+    checkLayerLimits: function(num) {
+        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
+        {
+            if(this.isInRange !== true){
+                this.globalData._mdf = true;
+                this._mdf = true;
+                this.isInRange = true;
+                this.show();
+            }
+        } else {
+            if(this.isInRange !== false){
+                this.globalData._mdf = true;
+                this.isInRange = false;
+                this.hide();
+            }
+        }
+    },
+    renderRenderable: function() {
+        var i, len = this.renderableComponents.length;
+        for(i = 0; i < len; i += 1) {
+            this.renderableComponents[i].renderFrame(this._isFirstFrame);
+        }
+        /*this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
+    },
+    sourceRectAtTime: function(){
+        return {
+            top:0,
+            left:0,
+            width:100,
+            height:100
+        };
+    },
+    getLayerSize: function(){
+        if(this.data.ty === 5){
+            return {w:this.data.textData.width,h:this.data.textData.height};
+        }else{
+            return {w:this.data.width,h:this.data.height};
+        }
+    }
+};
\ No newline at end of file
diff --git a/player/js/elements/helpers/TransformElement.js b/player/js/elements/helpers/TransformElement.js
new file mode 100644
index 0000000..4a54327
--- /dev/null
+++ b/player/js/elements/helpers/TransformElement.js
@@ -0,0 +1,74 @@
+function TransformElement(){}
+
+TransformElement.prototype = {
+    initTransform: function() {
+        this.finalTransform = {
+            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
+            _matMdf: false,
+            _opMdf: false,
+            mat: new Matrix()
+        };
+        if (this.data.ao) {
+            this.finalTransform.mProp.autoOriented = true;
+        }
+
+        //TODO: check TYPE 11: Guided elements
+        if (this.data.ty !== 11) {
+            //this.createElements();
+        }
+    },
+    renderTransform: function() {
+
+        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+
+        if (this.hierarchy) {
+            var mat;
+            var finalMat = this.finalTransform.mat;
+            var i = 0, len = this.hierarchy.length;
+            //Checking if any of the transformation matrices in the hierarchy chain has changed.
+            if (!this.finalTransform._matMdf) {
+                while (i < len) {
+                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
+                        this.finalTransform._matMdf = true;
+                        break;
+                    }
+                    i += 1;
+                }
+            }
+            
+            if (this.finalTransform._matMdf) {
+                mat = this.finalTransform.mProp.v.props;
+                finalMat.cloneFromProps(mat);
+                for (i = 0; i < len; i += 1) {
+                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
+                    finalMat.transform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5], mat[6], mat[7], mat[8], mat[9], mat[10], mat[11], mat[12], mat[13], mat[14], mat[15]);
+                }
+            }
+        }
+    },
+    globalToLocal: function(pt) {
+        var transforms = [];
+        transforms.push(this.finalTransform);
+        var flag = true;
+        var comp = this.comp;
+        while (flag) {
+            if (comp.finalTransform) {
+                if (comp.data.hasMask) {
+                    transforms.splice(0, 0, comp.finalTransform);
+                }
+                comp = comp.comp;
+            } else {
+                flag = false;
+            }
+        }
+        var i, len = transforms.length,ptNew;
+        for (i = 0; i < len; i += 1) {
+            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+        }
+        return pt;
+    },
+    mHelper: new Matrix()
+};
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/CVShapeData.js b/player/js/elements/helpers/shapes/CVShapeData.js
new file mode 100644
index 0000000..6eca1f4
--- /dev/null
+++ b/player/js/elements/helpers/shapes/CVShapeData.js
@@ -0,0 +1,18 @@
+function CVShapeData(element, data) {
+    this.nodes = [];
+    this.trNodes = [];
+    this.tr = [0,0,0,0,0,0];
+    var ty = 4;
+    if(data.ty == 'rc'){
+        ty = 5;
+    }else if(data.ty == 'el'){
+        ty = 6;
+    }else if(data.ty == 'sr'){
+        ty = 7;
+    }
+    this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element);
+    this.st = false;
+    this.fl = false;
+}
+
+CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/PIXIElementsRenderer.js b/player/js/elements/helpers/shapes/PIXIElementsRenderer.js
new file mode 100644
index 0000000..2fc2aaa
--- /dev/null
+++ b/player/js/elements/helpers/shapes/PIXIElementsRenderer.js
@@ -0,0 +1,230 @@
+var PIXIElementsRenderer = (function() {
+	var _identityMatrix = new Matrix();
+	var _matrixHelper = new Matrix();
+
+	var ob = {
+		createRenderFunction: createRenderFunction
+	}
+
+	function createRenderFunction(data) {
+	    var ty = data.ty;
+	    switch(data.ty) {
+	        case 'fl':
+	        return renderFill;
+	        case 'gf':
+	        return renderGradient;
+	        case 'gs':
+	        return renderGradientStroke;
+	        case 'st':
+	        return renderStroke;
+	        case 'sh':
+	        case 'el':
+	        case 'rc':
+	        case 'sr':
+	        return renderPath;
+	        case 'tr':
+	        return renderContentTransform;
+	    }
+	}
+
+	function renderContentTransform(styleData, itemData, isFirstFrame) {
+	    if(isFirstFrame || itemData.transform.op._mdf){
+	        itemData.transform.container.alpha = itemData.transform.op.v;
+	    }
+	    if(isFirstFrame || itemData.transform.mProps._mdf){
+	    	var finalMat = itemData.transform.mProps.v;
+            var mt = new PIXI.Matrix();
+            mt.a = finalMat.props[0];
+            mt.b = finalMat.props[1];
+            mt.c = finalMat.props[4];
+            mt.d = finalMat.props[5];
+            mt.tx = finalMat.props[12];
+            mt.ty = finalMat.props[13];
+            itemData.transform.container.transform.setFromMatrix(mt);
+	    }
+	}
+
+	function renderPath(styleData, itemData, isFirstFrame) {
+	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
+	    var lvl = itemData.lvl;
+	    var paths, mat, props, iterations, k, PPathString;
+	    for(l=0;l<lLen;l+=1){
+        	PPathString = [];
+	        redraw = itemData.sh._mdf || isFirstFrame;
+	        if(itemData.styles[l].lvl < lvl){
+	            mat = _matrixHelper.reset();
+	            iterations = lvl - itemData.styles[l].lvl;
+	            k = itemData.transformers.length-1;
+	            while(!redraw && iterations > 0) {
+	                redraw = itemData.transformers[k].mProps._mdf || redraw;
+	                iterations --;
+	                k --;
+	            }
+	            if(redraw) {
+	                iterations = lvl - itemData.styles[l].lvl;
+	                k = itemData.transformers.length-1;
+	                while(iterations > 0) {
+	                    props = itemData.transformers[k].mProps.v.props;
+	                    mat.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
+	                    iterations --;
+	                    k --;
+	                }
+	            }
+	        } else {
+	            mat = _identityMatrix;
+	        }
+	        paths = itemData.sh.paths;
+	        jLen = paths._length;
+	        if(redraw){
+	            pathStringTransformed = '';
+	            for(j=0;j<jLen;j+=1){
+	                pathNodes = paths.shapes[j];
+	                if(pathNodes && pathNodes._length){
+	                	PPathString = PPathString.concat(buildPIXIShape(pathNodes, pathNodes._length, pathNodes.c, mat))
+	                    //pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+	                }
+	            }
+	            itemData.caches[l] = PPathString;
+	        } else {
+	            PPathString = itemData.caches[l];
+	        }
+	        itemData.styles[l].PD = itemData.styles[l].PD.concat(PPathString);
+	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+	    }
+	}
+
+	function renderFill (styleData,itemData, isFirstFrame){
+	    var styleElem = itemData.style;
+
+	    if(itemData.c._mdf || isFirstFrame){
+	        //styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
+	    	//Todo: this shouldn't be invoked every frame
+	    	styleElem._mdf = true;
+	    	styleElem._styleType = 'fill';
+	    	styleElem._styleColor = rgbToHex(bm_floor(itemData.c.v[0]),bm_floor(itemData.c.v[1]),bm_floor(itemData.c.v[2]),'0x');
+		    //styleElem.PpElem.clear();
+		    //styleElem.PpElem.beginFill(rgbToHex(bm_floor(itemData.c.v[0]),bm_floor(itemData.c.v[1]),bm_floor(itemData.c.v[2]),'0x'));
+	    }
+	    if(itemData.o._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
+	    }
+
+	};
+
+	function renderGradientStroke (styleData, itemData, isFirstFrame) {
+	    renderGradient(styleData, itemData, isFirstFrame);
+	    renderStroke(styleData, itemData, isFirstFrame);
+	}
+
+	function renderGradient(styleData, itemData, isFirstFrame) {
+	    var gfill = itemData.gf;
+	    var hasOpacity = itemData.g._hasOpacity;
+	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+
+	    if (itemData.o._mdf || isFirstFrame) {
+	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
+	    }
+	    if (itemData.s._mdf || isFirstFrame) {
+	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+	        gfill.setAttribute(attr1, pt1[0]);
+	        gfill.setAttribute(attr2, pt1[1]);
+	        if (hasOpacity && !itemData.g._collapsable) {
+	            itemData.of.setAttribute(attr1, pt1[0]);
+	            itemData.of.setAttribute(attr2, pt1[1]);
+	        }
+	    }
+	    var stops, i, len, stop;
+	    if (itemData.g._cmdf || isFirstFrame) {
+	        stops = itemData.cst;
+	        var cValues = itemData.g.c;
+	        len = stops.length;
+	        for (i = 0; i < len; i += 1){
+	            stop = stops[i];
+	            stop.setAttribute('offset', cValues[i * 4] + '%');
+	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
+	        }
+	    }
+	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+	        var oValues = itemData.g.o;
+	        if(itemData.g._collapsable) {
+	            stops = itemData.cst;
+	        } else {
+	            stops = itemData.ost;
+	        }
+	        len = stops.length;
+	        for (i = 0; i < len; i += 1) {
+	            stop = stops[i];
+	            if(!itemData.g._collapsable) {
+	                stop.setAttribute('offset', oValues[i * 2] + '%');
+	            }
+	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+	        }
+	    }
+	    if (styleData.t === 1) {
+	        if (itemData.e._mdf  || isFirstFrame) {
+	            gfill.setAttribute('x2', pt2[0]);
+	            gfill.setAttribute('y2', pt2[1]);
+	            if (hasOpacity && !itemData.g._collapsable) {
+	                itemData.of.setAttribute('x2', pt2[0]);
+	                itemData.of.setAttribute('y2', pt2[1]);
+	            }
+	        }
+	    } else {
+	        var rad;
+	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+	            gfill.setAttribute('r', rad);
+	            if(hasOpacity && !itemData.g._collapsable){
+	                itemData.of.setAttribute('r', rad);
+	            }
+	        }
+	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+	            if (!rad) {
+	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+	            }
+	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+
+	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
+	            var dist = rad * percent;
+	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+	            gfill.setAttribute('fx', x);
+	            gfill.setAttribute('fy', y);
+	            if (hasOpacity && !itemData.g._collapsable) {
+	                itemData.of.setAttribute('fx', x);
+	                itemData.of.setAttribute('fy', y);
+	            }
+	        }
+	        //gfill.setAttribute('fy','200');
+	    }
+	};
+
+	function renderStroke(styleData, itemData, isFirstFrame) {
+	    var styleElem = itemData.style;
+	    /*var d = itemData.d;
+	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+	    }
+	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
+	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
+	    }
+	    if(itemData.o._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+	    }
+	    if(itemData.w._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+	        if(styleElem.msElem){
+	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+	        }
+	    }*/
+    	styleElem._mdf = true;
+    	styleElem._styleType = 'stroke';
+    	styleElem._styleColor = rgbToHex(bm_floor(itemData.c.v[0]),bm_floor(itemData.c.v[1]),bm_floor(itemData.c.v[2]),'0x');
+    	styleElem._styleWidth = itemData.w.v;
+	};
+
+	return ob;
+}())
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/ProcessedElement.js b/player/js/elements/helpers/shapes/ProcessedElement.js
new file mode 100644
index 0000000..6bd71d4
--- /dev/null
+++ b/player/js/elements/helpers/shapes/ProcessedElement.js
@@ -0,0 +1,4 @@
+function ProcessedElement(element, position) {
+	this.elem = element;
+	this.pos = position;
+}
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGElementsRenderer.js b/player/js/elements/helpers/shapes/SVGElementsRenderer.js
new file mode 100644
index 0000000..3f2f1b1
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGElementsRenderer.js
@@ -0,0 +1,209 @@
+var SVGElementsRenderer = (function() {
+	var _identityMatrix = new Matrix();
+	var _matrixHelper = new Matrix();
+
+	var ob = {
+		createRenderFunction: createRenderFunction
+	}
+
+	function createRenderFunction(data) {
+	    var ty = data.ty;
+	    switch(data.ty) {
+	        case 'fl':
+	        return renderFill;
+	        case 'gf':
+	        return renderGradient;
+	        case 'gs':
+	        return renderGradientStroke;
+	        case 'st':
+	        return renderStroke;
+	        case 'sh':
+	        case 'el':
+	        case 'rc':
+	        case 'sr':
+	        return renderPath;
+	        case 'tr':
+	        return renderContentTransform;
+	    }
+	}
+
+	function renderContentTransform(styleData, itemData, isFirstFrame) {
+	    if(isFirstFrame || itemData.transform.op._mdf){
+	        itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
+	    }
+	    if(isFirstFrame || itemData.transform.mProps._mdf){
+	        itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
+	    }
+	}
+
+	function renderPath(styleData, itemData, isFirstFrame) {
+	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
+	    var lvl = itemData.lvl;
+	    var paths, mat, props, iterations, k;
+	    for(l=0;l<lLen;l+=1){
+	        redraw = itemData.sh._mdf || isFirstFrame;
+	        if(itemData.styles[l].lvl < lvl){
+	            mat = _matrixHelper.reset();
+	            iterations = lvl - itemData.styles[l].lvl;
+	            k = itemData.transformers.length-1;
+	            while(!redraw && iterations > 0) {
+	                redraw = itemData.transformers[k].mProps._mdf || redraw;
+	                iterations --;
+	                k --;
+	            }
+	            if(redraw) {
+	                iterations = lvl - itemData.styles[l].lvl;
+	                k = itemData.transformers.length-1;
+	                while(iterations > 0) {
+	                    props = itemData.transformers[k].mProps.v.props;
+	                    mat.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
+	                    iterations --;
+	                    k --;
+	                }
+	            }
+	        } else {
+	            mat = _identityMatrix;
+	        }
+	        paths = itemData.sh.paths;
+	        jLen = paths._length;
+	        if(redraw){
+	            pathStringTransformed = '';
+	            for(j=0;j<jLen;j+=1){
+	                pathNodes = paths.shapes[j];
+	                if(pathNodes && pathNodes._length){
+	                    pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+	                }
+	            }
+	            itemData.caches[l] = pathStringTransformed;
+	        } else {
+	            pathStringTransformed = itemData.caches[l];
+	        }
+	        itemData.styles[l].d += pathStringTransformed;
+	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+	    }
+	}
+
+	function renderFill (styleData,itemData, isFirstFrame){
+	    var styleElem = itemData.style;
+
+	    if(itemData.c._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
+	    }
+	    if(itemData.o._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
+	    }
+	};
+
+	function renderGradientStroke (styleData, itemData, isFirstFrame) {
+	    renderGradient(styleData, itemData, isFirstFrame);
+	    renderStroke(styleData, itemData, isFirstFrame);
+	}
+
+	function renderGradient(styleData, itemData, isFirstFrame) {
+	    var gfill = itemData.gf;
+	    var hasOpacity = itemData.g._hasOpacity;
+	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+
+	    if (itemData.o._mdf || isFirstFrame) {
+	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
+	    }
+	    if (itemData.s._mdf || isFirstFrame) {
+	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+	        gfill.setAttribute(attr1, pt1[0]);
+	        gfill.setAttribute(attr2, pt1[1]);
+	        if (hasOpacity && !itemData.g._collapsable) {
+	            itemData.of.setAttribute(attr1, pt1[0]);
+	            itemData.of.setAttribute(attr2, pt1[1]);
+	        }
+	    }
+	    var stops, i, len, stop;
+	    if (itemData.g._cmdf || isFirstFrame) {
+	        stops = itemData.cst;
+	        var cValues = itemData.g.c;
+	        len = stops.length;
+	        for (i = 0; i < len; i += 1){
+	            stop = stops[i];
+	            stop.setAttribute('offset', cValues[i * 4] + '%');
+	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
+	        }
+	    }
+	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+	        var oValues = itemData.g.o;
+	        if(itemData.g._collapsable) {
+	            stops = itemData.cst;
+	        } else {
+	            stops = itemData.ost;
+	        }
+	        len = stops.length;
+	        for (i = 0; i < len; i += 1) {
+	            stop = stops[i];
+	            if(!itemData.g._collapsable) {
+	                stop.setAttribute('offset', oValues[i * 2] + '%');
+	            }
+	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+	        }
+	    }
+	    if (styleData.t === 1) {
+	        if (itemData.e._mdf  || isFirstFrame) {
+	            gfill.setAttribute('x2', pt2[0]);
+	            gfill.setAttribute('y2', pt2[1]);
+	            if (hasOpacity && !itemData.g._collapsable) {
+	                itemData.of.setAttribute('x2', pt2[0]);
+	                itemData.of.setAttribute('y2', pt2[1]);
+	            }
+	        }
+	    } else {
+	        var rad;
+	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+	            gfill.setAttribute('r', rad);
+	            if(hasOpacity && !itemData.g._collapsable){
+	                itemData.of.setAttribute('r', rad);
+	            }
+	        }
+	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+	            if (!rad) {
+	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+	            }
+	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+
+	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
+	            var dist = rad * percent;
+	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+	            gfill.setAttribute('fx', x);
+	            gfill.setAttribute('fy', y);
+	            if (hasOpacity && !itemData.g._collapsable) {
+	                itemData.of.setAttribute('fx', x);
+	                itemData.of.setAttribute('fy', y);
+	            }
+	        }
+	        //gfill.setAttribute('fy','200');
+	    }
+	};
+
+	function renderStroke(styleData, itemData, isFirstFrame) {
+	    var styleElem = itemData.style;
+	    var d = itemData.d;
+	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+	    }
+	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
+	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
+	    }
+	    if(itemData.o._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+	    }
+	    if(itemData.w._mdf || isFirstFrame){
+	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+	        if(styleElem.msElem){
+	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+	        }
+	    }
+	};
+
+	return ob;
+}())
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGFillStyleData.js b/player/js/elements/helpers/shapes/SVGFillStyleData.js
new file mode 100644
index 0000000..3ec2644
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGFillStyleData.js
@@ -0,0 +1,9 @@
+function SVGFillStyleData(elem, data, styleOb){
+	this.initDynamicPropertyContainer(elem);
+	this.getValue = this.iterateDynamicProperties;
+	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
+	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
+	this.style = styleOb;
+}
+
+extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js b/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js
new file mode 100644
index 0000000..dd485fb
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js
@@ -0,0 +1,73 @@
+function SVGGradientFillStyleData(elem, data, styleOb){
+    this.initDynamicPropertyContainer(elem);
+    this.getValue = this.iterateDynamicProperties;
+    this.initGradientData(elem, data, styleOb);
+}
+
+SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
+    this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
+    this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
+    this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
+    this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
+    this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
+    this.g = new GradientProperty(elem,data.g,this);
+    this.style = styleOb;
+    this.stops = [];
+    this.setGradientData(styleOb.pElem, data);
+    this.setGradientOpacity(data, styleOb);
+    this._isAnimated = !!this._isAnimated;
+
+};
+
+SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
+
+    var gradientId = 'gr_'+randomString(10);
+    var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+    gfill.setAttribute('id',gradientId);
+    gfill.setAttribute('spreadMethod','pad');
+    gfill.setAttribute('gradientUnits','userSpaceOnUse');
+    var stops = [];
+    var stop, j, jLen;
+    jLen = data.g.p*4;
+    for(j=0;j<jLen;j+=4){
+        stop = createNS('stop');
+        gfill.appendChild(stop);
+        stops.push(stop);
+    }
+    pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(#'+gradientId+')');
+    
+    this.gf = gfill;
+    this.cst = stops;
+};
+
+SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
+    if(this.g._hasOpacity && !this.g._collapsable){
+        var stop, j, jLen;
+        var mask = createNS("mask");
+        var maskElement = createNS( 'path');
+        mask.appendChild(maskElement);
+        var opacityId = 'op_'+randomString(10);
+        var maskId = 'mk_'+randomString(10);
+        mask.setAttribute('id',maskId);
+        var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+        opFill.setAttribute('id',opacityId);
+        opFill.setAttribute('spreadMethod','pad');
+        opFill.setAttribute('gradientUnits','userSpaceOnUse');
+        jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
+        var stops = this.stops;
+        for(j=data.g.p*4;j<jLen;j+=2){
+            stop = createNS('stop');
+            stop.setAttribute('stop-color','rgb(255,255,255)');
+            opFill.appendChild(stop);
+            stops.push(stop);
+        }
+        maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(#'+opacityId+')');
+        this.of = opFill;
+        this.ms = mask;
+        this.ost = stops;
+        this.maskId = maskId;
+        styleOb.msElem = maskElement;
+    }
+};
+
+extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js b/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js
new file mode 100644
index 0000000..9cf09a0
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js
@@ -0,0 +1,10 @@
+function SVGGradientStrokeStyleData(elem, data, styleOb){
+	this.initDynamicPropertyContainer(elem);
+	this.getValue = this.iterateDynamicProperties;
+	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
+	this.d = new DashProperty(elem,data.d||{},'svg',this);
+    this.initGradientData(elem, data, styleOb);
+    this._isAnimated = !!this._isAnimated;
+}
+
+extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGShapeData.js b/player/js/elements/helpers/shapes/SVGShapeData.js
new file mode 100644
index 0000000..61abf26
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGShapeData.js
@@ -0,0 +1,25 @@
+function SVGShapeData(transformers, level, shape) {
+    this.caches = [];
+    this.styles = [];
+    this.transformers = transformers;
+    this.lStr = '';
+    this.sh = shape;
+    this.lvl = level;
+    //TODO find if there are some cases where _isAnimated can be false. 
+    // For now, since shapes add up with other shapes. They have to be calculated every time.
+    // One way of finding out is checking if all styles associated to this shape depend only of this shape
+    this._isAnimated = !!shape.k;
+    // TODO: commenting this for now since all shapes are animated
+    var i = 0, len = transformers.length;
+    while(i < len) {
+    	if(transformers[i].mProps.dynamicProperties.length) {
+    		this._isAnimated = true;
+    		break;
+    	}
+    	i += 1;
+    }
+}
+
+SVGShapeData.prototype.setAsAnimated = function() {
+    this._isAnimated = true;
+}
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGStrokeStyleData.js b/player/js/elements/helpers/shapes/SVGStrokeStyleData.js
new file mode 100644
index 0000000..3548095
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGStrokeStyleData.js
@@ -0,0 +1,12 @@
+function SVGStrokeStyleData(elem, data, styleOb){
+	this.initDynamicPropertyContainer(elem);
+	this.getValue = this.iterateDynamicProperties;
+	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
+	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
+	this.d = new DashProperty(elem,data.d||{},'svg',this);
+	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
+	this.style = styleOb;
+    this._isAnimated = !!this._isAnimated;
+}
+
+extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGStyleData.js b/player/js/elements/helpers/shapes/SVGStyleData.js
new file mode 100644
index 0000000..cb783fa
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGStyleData.js
@@ -0,0 +1,18 @@
+function SVGStyleData(data, level) {
+	this.data = data;
+	this.type = data.ty;
+	this.d = '';
+	this.lvl = level;
+	this._mdf = false;
+	this.closed = false;
+	this.pElem = createNS('path');
+	this.PpElem = new PIXI.Graphics();
+	this.PD = [];
+	this.msElem = null;
+}
+
+SVGStyleData.prototype.reset = function() {
+	this.d = '';
+	this.PD.length = 0;
+	this._mdf = false;
+};
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGTransformData.js b/player/js/elements/helpers/shapes/SVGTransformData.js
new file mode 100644
index 0000000..f20d382
--- /dev/null
+++ b/player/js/elements/helpers/shapes/SVGTransformData.js
@@ -0,0 +1,9 @@
+function SVGTransformData(mProps, op, container) {
+	this.transform = {
+		mProps: mProps,
+		op: op,
+		container: container
+	};
+	this.elements = [];
+    this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
+}
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/ShapeElement.js b/player/js/elements/helpers/shapes/ShapeElement.js
new file mode 100644
index 0000000..2c8f5a5
--- /dev/null
+++ b/player/js/elements/helpers/shapes/ShapeElement.js
@@ -0,0 +1,3 @@
+function ShapeElementData() {
+	
+}
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/ShapeGroupData.js b/player/js/elements/helpers/shapes/ShapeGroupData.js
new file mode 100644
index 0000000..28735af
--- /dev/null
+++ b/player/js/elements/helpers/shapes/ShapeGroupData.js
@@ -0,0 +1,5 @@
+function ShapeGroupData() {
+	this.it = [];
+    this.prevViewData = [];
+    this.gr = createNS('g');
+}
\ No newline at end of file
diff --git a/player/js/elements/htmlElements/HBaseElement.js b/player/js/elements/htmlElements/HBaseElement.js
index c156108..4ea42c9 100644
--- a/player/js/elements/htmlElements/HBaseElement.js
+++ b/player/js/elements/htmlElements/HBaseElement.js
@@ -1,152 +1,71 @@
-function HBaseElement(data,parentContainer,globalData,comp, placeholder){
-    this.globalData = globalData;
-    this.comp = comp;
-    this.data = data;
-    this.matteElement = null;
-    this.parentContainer = parentContainer;
-    this.layerId = placeholder ? placeholder.layerId : 'ly_'+randomString(10);
-    this.placeholder = placeholder;
-    this.init();
-};
-
-createElement(BaseElement, HBaseElement);
-HBaseElement.prototype.checkBlendMode = function(){
-
-};
-HBaseElement.prototype.setBlendMode = BaseElement.prototype.setBlendMode;
-
-/*HBaseElement.prototype.appendNodeToParent = function(node) {
-    if(this.data.hd){
-        return;
-    }
-    if(this.placeholder){
-        var g = this.placeholder.phElement;
-        g.parentNode.insertBefore(node, g);
-        //g.parentNode.removeChild(g);
-    }else{
-        this.parentContainer.appendChild(node);
-    }
-};*/
-
-
-HBaseElement.prototype.getBaseElement = function(){
-    return this.baseElement;
-};
-
-HBaseElement.prototype.createElements = function(){
-    if(this.data.hasMask){
-        this.layerElement = document.createElementNS(svgNS,'svg');
-        styleDiv(this.layerElement);
-        //this.appendNodeToParent(this.layerElement);
-        this.baseElement = this.layerElement;
+function HBaseElement(data,globalData,comp){}
+HBaseElement.prototype = {
+    checkBlendMode: function(){},
+    initRendererElement: function(){
+        this.baseElement = createTag(this.data.tg || 'div');
+        if(this.data.hasMask) {
+            this.svgElement = createNS('svg');
+            this.layerElement = createNS('g');
+            this.maskedElement = this.layerElement;
+            this.svgElement.appendChild(this.layerElement);
+            this.baseElement.appendChild(this.svgElement);
+        } else {
+            this.layerElement = this.baseElement;
+        }
+        styleDiv(this.baseElement);
+    },
+    createContainerElements: function(){
+        this.renderableEffectsManager = new CVEffects(this);
+        this.transformedElement = this.baseElement;
         this.maskedElement = this.layerElement;
-    }else{
-        this.layerElement = this.parentContainer;
-    }
-    this.transformedElement = this.layerElement;
-    if(this.data.ln && (this.data.ty === 4 || this.data.ty === 0)){
-        if(this.layerElement === this.parentContainer){
-            this.layerElement = document.createElementNS(svgNS,'g');
-            //this.appendNodeToParent(this.layerElement);
-            this.baseElement = this.layerElement;
+        if (this.data.ln) {
+            this.layerElement.setAttribute('id',this.data.ln);
         }
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    this.setBlendMode();
-    if(this.layerElement !== this.parentContainer){
-        this.placeholder = null;
-    }
-    this.checkParenting();
-};
-
-HBaseElement.prototype.renderFrame = function(parentTransform){
-    if(this.data.ty === 3){
-        return false;
-    }
-
-    if(this.currentFrameNum === this.lastNum || !this.isVisible){
-        return this.isVisible;
-    }
-    this.lastNum = this.currentFrameNum;
-
-    this.finalTransform.opMdf = this.finalTransform.op.mdf;
-    this.finalTransform.matMdf = this.finalTransform.mProp.mdf;
-    this.finalTransform.opacity = this.finalTransform.op.v;
-    if(this.firstFrame){
-        this.finalTransform.opMdf = true;
-        this.finalTransform.matMdf = true;
-    }
-
-    var mat;
-    var finalMat = this.finalTransform.mat;
-
-    if(this.hierarchy){
-        var i, len = this.hierarchy.length;
-
-        mat = this.finalTransform.mProp.v.props;
-        finalMat.cloneFromProps(mat);
-        for(i=0;i<len;i+=1){
-            this.finalTransform.matMdf = this.hierarchy[i].finalTransform.mProp.mdf ? true : this.finalTransform.matMdf;
-            mat = this.hierarchy[i].finalTransform.mProp.v.props;
-            finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
+        if (this.data.cl) {
+            this.layerElement.setAttribute('class', this.data.cl);
         }
-    }else{
-        if(this.isVisible && this.finalTransform.matMdf){
-            if(!parentTransform){
-                finalMat.cloneFromProps(this.finalTransform.mProp.v.props);
-            }else{
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-            }
+        if (this.data.bm !== 0) {
+            this.setBlendMode();
         }
-    }
-    if(this.data.hasMask){
-        this.maskManager.renderFrame(finalMat);
-    }
-
-    if(parentTransform){
-        mat = parentTransform.mat.props;
-        finalMat.cloneFromProps(mat);
-        this.finalTransform.opacity *= parentTransform.opacity;
-        this.finalTransform.opMdf = parentTransform.opMdf ? true : this.finalTransform.opMdf;
-        this.finalTransform.matMdf = parentTransform.matMdf ? true : this.finalTransform.matMdf
-    }
-
-    if(this.finalTransform.matMdf){
-        this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = finalMat.toCSS();
-        this.finalMat = finalMat;
-    }
-    if(this.finalTransform.opMdf){
-        this.transformedElement.style.opacity = this.finalTransform.opacity;
-    }
-    return this.isVisible;
+    },
+    renderElement: function() {
+        if(this.finalTransform._matMdf){
+            this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
+        }
+        if(this.finalTransform._opMdf){
+            this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
+        }
+    },
+    renderFrame: function() {
+        //If it is exported as hidden (data.hd === true) no need to render
+        //If it is not visible no need to render
+        if (this.data.hd || this.hidden) {
+            return;
+        }
+        this.renderTransform();
+        this.renderRenderable();
+        this.renderElement();
+        this.renderInnerContent();
+        if (this._isFirstFrame) {
+            this._isFirstFrame = false;
+        }
+    },
+    destroy: function(){
+        this.layerElement = null;
+        this.transformedElement = null;
+        if(this.matteElement) {
+            this.matteElement = null;
+        }
+        if(this.maskManager) {
+            this.maskManager.destroy();
+            this.maskManager = null;
+        }
+    },
+    addMasks: function(){
+        this.maskManager = new MaskElement(this.data, this, this.globalData);
+    },
+    setMatte: function(){}
 };
-
-HBaseElement.prototype.destroy = function(){
-    this.layerElement = null;
-    this.transformedElement = null;
-    this.parentContainer = null;
-    if(this.matteElement) {
-        this.matteElement = null;
-    }
-    if(this.maskManager) {
-        this.maskManager.destroy();
-        this.maskManager = null;
-    }
-};
-
-HBaseElement.prototype.getDomElement = function(){
-    return this.layerElement;
-};
-HBaseElement.prototype.addMasks = function(data){
-    this.maskManager = new MaskElement(data,this,this.globalData);
-};
-
-HBaseElement.prototype.hide = function(){
-};
-
-HBaseElement.prototype.setMatte = function(){
-
-}
-
+HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
+HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
 HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
\ No newline at end of file
diff --git a/player/js/elements/htmlElements/HCameraElement.js b/player/js/elements/htmlElements/HCameraElement.js
index 92775f9..daa7378 100644
--- a/player/js/elements/htmlElements/HCameraElement.js
+++ b/player/js/elements/htmlElements/HCameraElement.js
@@ -1,15 +1,18 @@
-function HCameraElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-    this.pe = PropertyFactory.getProp(this,data.pe,0,0,this.dynamicProperties);
+function HCameraElement(data,globalData,comp){
+    this.initFrame();
+    this.initBaseData(data,globalData,comp);
+    this.initHierarchy();
+    var getProp = PropertyFactory.getProp;
+    this.pe = getProp(this,data.pe,0,0,this);
     if(data.ks.p.s){
-        this.px = PropertyFactory.getProp(this,data.ks.p.x,1,0,this.dynamicProperties);
-        this.py = PropertyFactory.getProp(this,data.ks.p.y,1,0,this.dynamicProperties);
-        this.pz = PropertyFactory.getProp(this,data.ks.p.z,1,0,this.dynamicProperties);
+        this.px = getProp(this,data.ks.p.x,1,0,this);
+        this.py = getProp(this,data.ks.p.y,1,0,this);
+        this.pz = getProp(this,data.ks.p.z,1,0,this);
     }else{
-        this.p = PropertyFactory.getProp(this,data.ks.p,1,0,this.dynamicProperties);
+        this.p = getProp(this,data.ks.p,1,0,this);
     }
     if(data.ks.a){
-        this.a = PropertyFactory.getProp(this,data.ks.a,1,0,this.dynamicProperties);
+        this.a = getProp(this,data.ks.a,1,0,this);
     }
     if(data.ks.or.k.length && data.ks.or.k[0].to){
         var i,len = data.ks.or.k.length;
@@ -18,23 +21,27 @@
             data.ks.or.k[i].ti = null;
         }
     }
-    this.or = PropertyFactory.getProp(this,data.ks.or,1,degToRads,this.dynamicProperties);
+    this.or = getProp(this,data.ks.or,1,degToRads,this);
     this.or.sh = true;
-    this.rx = PropertyFactory.getProp(this,data.ks.rx,0,degToRads,this.dynamicProperties);
-    this.ry = PropertyFactory.getProp(this,data.ks.ry,0,degToRads,this.dynamicProperties);
-    this.rz = PropertyFactory.getProp(this,data.ks.rz,0,degToRads,this.dynamicProperties);
+    this.rx = getProp(this,data.ks.rx,0,degToRads,this);
+    this.ry = getProp(this,data.ks.ry,0,degToRads,this);
+    this.rz = getProp(this,data.ks.rz,0,degToRads,this);
     this.mat = new Matrix();
+    this._prevMat = new Matrix();
+    this._isFirstFrame = true;
 }
-createElement(HBaseElement, HCameraElement);
+extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
 
 HCameraElement.prototype.setup = function() {
     var i, len = this.comp.threeDElements.length, comp;
     for(i=0;i<len;i+=1){
         //[perspectiveElem,container]
         comp = this.comp.threeDElements[i];
-        comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-        comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
-        comp.perspectiveElem.style.transform = comp.perspectiveElem.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+        if(comp.type === '3d') {
+            comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
+            comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
+            comp.perspectiveElem.style.transform = comp.perspectiveElem.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+        }
     }
 };
 
@@ -45,17 +52,33 @@
 };
 
 HCameraElement.prototype.renderFrame = function(){
-    var mdf = this.firstFrame;
+    var _mdf = this._isFirstFrame;
     var i, len;
     if(this.hierarchy){
         len = this.hierarchy.length;
         for(i=0;i<len;i+=1){
-            mdf = this.hierarchy[i].finalTransform.mProp.mdf ? true : mdf;
+            _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
         }
     }
-    if(mdf || (this.p && this.p.mdf) || (this.px && (this.px.mdf || this.py.mdf || this.pz.mdf)) || this.rx.mdf || this.ry.mdf || this.rz.mdf || this.or.mdf || (this.a && this.a.mdf)) {
+    if(_mdf || (this.p && this.p._mdf) || (this.px && (this.px._mdf || this.py._mdf || this.pz._mdf)) || this.rx._mdf || this.ry._mdf || this.rz._mdf || this.or._mdf || (this.a && this.a._mdf)) {
         this.mat.reset();
 
+        if(this.hierarchy){
+            var mat;
+            len = this.hierarchy.length - 1;
+            for (i = len; i >= 0; i -= 1) {
+                /*mat = this.hierarchy[i].finalTransform.mProp.v.props;
+                console.log(mat)
+                this.mat.transform(-mat[0],-mat[1],-mat[2],-mat[3],-mat[4],-mat[5],-mat[6],-mat[7],-mat[8],-mat[9],-mat[10],-mat[11],-mat[12],-mat[13],-mat[14],mat[15]);
+                console.log(this.mat.props)*/
+                var mTransf = this.hierarchy[i].finalTransform.mProp;
+                this.mat.translate(-mTransf.p.v[0],-mTransf.p.v[1],mTransf.p.v[2]);
+                this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
+                this.mat.scale(1/mTransf.s.v[0],1/mTransf.s.v[1],1/mTransf.s.v[2]);
+                this.mat.translate(mTransf.a.v[0],mTransf.a.v[1],mTransf.a.v[2]);
+            }
+        }
+
         if(this.p){
             this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]);
         }else{
@@ -76,23 +99,31 @@
         this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
         this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0);
         this.mat.translate(0,0,this.pe.v);
-        if(this.hierarchy){
-            var mat;
-            len = this.hierarchy.length;
+
+
+        
+
+
+        if(!this._prevMat.equals(this.mat) && this.comp.threeDElements) {
+            len = this.comp.threeDElements.length;
+            var comp;
             for(i=0;i<len;i+=1){
-                mat = this.hierarchy[i].finalTransform.mProp.iv.props;
-                this.mat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],-mat[12],-mat[13],mat[14],mat[15]);
+                comp = this.comp.threeDElements[i];
+                if(comp.type === '3d') {
+                    comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
+                }
             }
-        }
-        len = this.comp.threeDElements.length;
-        var comp;
-        for(i=0;i<len;i+=1){
-            comp = this.comp.threeDElements[i];
-            comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
+            this.mat.clone(this._prevMat);
         }
     }
-    this.firstFrame = false;
+    this._isFirstFrame = false;
+};
+
+HCameraElement.prototype.prepareFrame = function(num) {
+    this.prepareProperties(num, true);
 };
 
 HCameraElement.prototype.destroy = function(){
-};
\ No newline at end of file
+};
+HCameraElement.prototype.initExpressions = function(){};
+HCameraElement.prototype.getBaseElement = function(){return null;};
\ No newline at end of file
diff --git a/player/js/elements/htmlElements/HCompElement.js b/player/js/elements/htmlElements/HCompElement.js
index 1b4248c..a989837 100644
--- a/player/js/elements/htmlElements/HCompElement.js
+++ b/player/js/elements/htmlElements/HCompElement.js
@@ -1,89 +1,40 @@
-function HCompElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+function HCompElement(data,globalData,comp){
     this.layers = data.layers;
-    this.supports3d = true;
+    this.supports3d = !data.hasMask;
     this.completeLayers = false;
     this.pendingElements = [];
-    this.elements = Array.apply(null,{length:this.layers.length});
-    if(this.data.tm){
-        this.tm = PropertyFactory.getProp(this,this.data.tm,0,globalData.frameRate,this.dynamicProperties);
-    }
-    if(this.data.hasMask) {
-        this.supports3d = false;
-    }
-    if(this.data.xt){
-        this.layerElement = document.createElement('div');
-    }
-    this.buildAllItems();
-
+    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+    this.initElement(data,globalData,comp);
+    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
 }
-createElement(HBaseElement, HCompElement);
 
-HCompElement.prototype.createElements = function(){
-    var divElement = document.createElement('div');
-    styleDiv(divElement);
-    if(this.data.ln){
-        divElement.setAttribute('id',this.data.ln);
-    }
-    divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
+extendPrototype([HybridRenderer, ICompElement, HBaseElement], HCompElement);
+HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
+
+HCompElement.prototype.createContainerElements = function(){
+    this._createBaseContainerElements();
+    //divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
     if(this.data.hasMask){
-        var compSvg = document.createElementNS(svgNS,'svg');
-        styleDiv(compSvg);
-        compSvg.setAttribute('width',this.data.w);
-        compSvg.setAttribute('height',this.data.h);
-        var g = document.createElementNS(svgNS,'g');
-        compSvg.appendChild(g);
-        divElement.appendChild(compSvg);
-        this.maskedElement = g;
-        this.baseElement = divElement;
-        this.layerElement = g;
-        this.transformedElement = divElement;
-    }else{
-        this.layerElement = divElement;
-        this.baseElement = this.layerElement;
-        this.transformedElement = divElement;
+        this.svgElement.setAttribute('width',this.data.w);
+        this.svgElement.setAttribute('height',this.data.h);
+        this.transformedElement = this.baseElement;
+    } else {
+        this.transformedElement = this.layerElement;
     }
-    //this.appendNodeToParent(this.layerElement);
-    this.checkParenting();
 };
 
-HCompElement.prototype.hide = ICompElement.prototype.hide;
-HCompElement.prototype.prepareFrame = ICompElement.prototype.prepareFrame;
-HCompElement.prototype.setElements = ICompElement.prototype.setElements;
-HCompElement.prototype.getElements = ICompElement.prototype.getElements;
-HCompElement.prototype.destroy = ICompElement.prototype.destroy;
-
-HCompElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    var i,len = this.layers.length;
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-
-    this.hidden = false;
-
-    for( i = 0; i < len; i+=1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
+HCompElement.prototype.addTo3dContainer = function(elem,pos) {
+    var j = 0;
+    var nextElement;
+    while(j<pos){
+        if(this.elements[j] && this.elements[j].getBaseElement){
+            nextElement = this.elements[j].getBaseElement();
         }
+        j += 1;
     }
-    if(this.firstFrame){
-        this.firstFrame = false;
+    if(nextElement){
+        this.layerElement.insertBefore(elem, nextElement);
+    } else {
+        this.layerElement.appendChild(elem);
     }
-};
-
-HCompElement.prototype.checkLayers = BaseRenderer.prototype.checkLayers;
-HCompElement.prototype.buildItem = HybridRenderer.prototype.buildItem;
-HCompElement.prototype.checkPendingElements = HybridRenderer.prototype.checkPendingElements;
-HCompElement.prototype.addPendingElement = HybridRenderer.prototype.addPendingElement;
-HCompElement.prototype.buildAllItems = BaseRenderer.prototype.buildAllItems;
-HCompElement.prototype.createItem = HybridRenderer.prototype.createItem;
-HCompElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
-HCompElement.prototype.createImage = HybridRenderer.prototype.createImage;
-HCompElement.prototype.createComp = HybridRenderer.prototype.createComp;
-HCompElement.prototype.createSolid = HybridRenderer.prototype.createSolid;
-HCompElement.prototype.createShape = HybridRenderer.prototype.createShape;
-HCompElement.prototype.createText = HybridRenderer.prototype.createText;
-HCompElement.prototype.createBase = HybridRenderer.prototype.createBase;
-HCompElement.prototype.appendElementInPos = HybridRenderer.prototype.appendElementInPos;
\ No newline at end of file
+}
diff --git a/player/js/elements/htmlElements/HEffects.js b/player/js/elements/htmlElements/HEffects.js
new file mode 100644
index 0000000..5445e6a
--- /dev/null
+++ b/player/js/elements/htmlElements/HEffects.js
@@ -0,0 +1,3 @@
+function HEffects() {
+}
+HEffects.prototype.renderFrame = function(){};
\ No newline at end of file
diff --git a/player/js/elements/htmlElements/HImageElement.js b/player/js/elements/htmlElements/HImageElement.js
index 0ac7a39..ecb0dd9 100644
--- a/player/js/elements/htmlElements/HImageElement.js
+++ b/player/js/elements/htmlElements/HImageElement.js
@@ -1,46 +1,28 @@
-function HImageElement(data,parentContainer,globalData,comp, placeholder){
+function HImageElement(data,globalData,comp){
     this.assetData = globalData.getAssetData(data.refId);
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+    this.initElement(data,globalData,comp);
 }
-createElement(HBaseElement, HImageElement);
 
-HImageElement.prototype.createElements = function(){
+extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement], HImageElement);
 
+
+HImageElement.prototype.createContent = function(){
     var assetPath = this.globalData.getAssetsPath(this.assetData);
     var img = new Image();
 
     if(this.data.hasMask){
-        var parent = document.createElement('div');
-        styleDiv(parent);
-        var cont = document.createElementNS(svgNS,'svg');
-        styleDiv(cont);
-        cont.setAttribute('width',this.assetData.w);
-        cont.setAttribute('height',this.assetData.h);
-        parent.appendChild(cont);
-        this.imageElem = document.createElementNS(svgNS,'image');
+        this.imageElem = createNS('image');
         this.imageElem.setAttribute('width',this.assetData.w+"px");
         this.imageElem.setAttribute('height',this.assetData.h+"px");
         this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-        cont.appendChild(this.imageElem);
-        this.layerElement = parent;
-        this.transformedElement = parent;
-        this.baseElement = parent;
-        this.innerElem = parent;
-        this.maskedElement = this.imageElem;
+        this.layerElement.appendChild(this.imageElem);
+        this.baseElement.setAttribute('width',this.assetData.w);
+        this.baseElement.setAttribute('height',this.assetData.h);
     } else {
-        styleDiv(img);
-        this.layerElement = img;
-        this.baseElement = img;
-        this.innerElem = img;
-        this.transformedElement = img;
+        this.layerElement.appendChild(img);
     }
     img.src = assetPath;
     if(this.data.ln){
-        this.innerElem.setAttribute('id',this.data.ln);
+        this.baseElement.setAttribute('id',this.data.ln);
     }
-    this.checkParenting();
-};
-
-HImageElement.prototype.hide = HSolidElement.prototype.hide;
-HImageElement.prototype.renderFrame = HSolidElement.prototype.renderFrame;
-HImageElement.prototype.destroy = HSolidElement.prototype.destroy;
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/player/js/elements/htmlElements/HShapeElement.js b/player/js/elements/htmlElements/HShapeElement.js
index a00e2c8..66f16ef 100644
--- a/player/js/elements/htmlElements/HShapeElement.js
+++ b/player/js/elements/htmlElements/HShapeElement.js
@@ -1,14 +1,23 @@
-function HShapeElement(data,parentContainer,globalData,comp, placeholder){
+function HShapeElement(data,globalData,comp){
+    //List of drawable elements
     this.shapes = [];
-    this.shapeModifiers = [];
+    // Full shape data
     this.shapesData = data.shapes;
+    //List of styles that will be applied to shapes
     this.stylesList = [];
-    this.viewData = [];
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-    this.addedTransforms = {
-        mdf: false,
-        mats: [this.finalTransform.mat]
-    };
+    //List of modifiers that will be applied to shapes
+    this.shapeModifiers = [];
+    //List of items in shape tree
+    this.itemsData = [];
+    //List of items in previous shape tree
+    this.processedElements = [];
+    // List of animated components
+    this.animatedContents = [];
+    this.shapesContainer = createNS('g');
+    this.initElement(data,globalData,comp);
+    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
+    // List of elements that have been created
+    this.prevViewData = [];
     this.currentBBox = {
         x:999999,
         y: -999999,
@@ -16,85 +25,191 @@
         w: 0
     };
 }
-createElement(HBaseElement, HShapeElement);
-var parent = HShapeElement.prototype._parent;
-extendPrototype(IShapeElement, HShapeElement);
-HShapeElement.prototype._parent = parent;
+extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement], HShapeElement);
+HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
 
-HShapeElement.prototype.createElements = function(){
-    var parent = document.createElement('div');
-    styleDiv(parent);
-    var cont = document.createElementNS(svgNS,'svg');
-    styleDiv(cont);
-    var size = this.comp.data ? this.comp.data : this.globalData.compSize;
-    cont.setAttribute('width',size.w);
-    cont.setAttribute('height',size.h);
-    if(this.data.hasMask){
-        var g = document.createElementNS(svgNS,'g');
-        parent.appendChild(cont);
-        cont.appendChild(g);
-        this.maskedElement = g;
-        this.layerElement = g;
-        this.shapesContainer = g;
-    }else{
-        parent.appendChild(cont);
-        this.layerElement = cont;
-        this.shapesContainer = document.createElementNS(svgNS,'g');
+HShapeElement.prototype.createContent = function(){
+    var cont;
+    this.baseElement.style.fontSize = 0;
+    if (this.data.hasMask) {
         this.layerElement.appendChild(this.shapesContainer);
+        cont = this.svgElement;
+    } else {
+        cont = createNS('svg');
+        var size = this.comp.data ? this.comp.data : this.globalData.compSize;
+        cont.setAttribute('width',size.w);
+        cont.setAttribute('height',size.h);
+        cont.appendChild(this.shapesContainer);
+        this.layerElement.appendChild(cont);
     }
-    if(!this.data.hd){
-        //this.parentContainer.appendChild(parent);
-        this.baseElement = parent;
-    }
-    this.innerElem = parent;
-    if(this.data.ln){
-        this.innerElem.setAttribute('id',this.data.ln);
-    }
-    this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.dynamicProperties,0);
-    this.buildExpressionInterface();
-    this.layerElement = parent;
-    this.transformedElement = parent;
+
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0, [], true);
+    this.filterUniqueShapes();
     this.shapeCont = cont;
-    if(this.data.bm !== 0){
-        this.setBlendMode();
-    }
-    this.checkParenting();
 };
 
-HShapeElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
+HShapeElement.prototype.getTransformedPoint = function(transformers, point) {
+    var i, len = transformers.length;
+    for(i = 0; i < len; i += 1) {
+        point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
+    }
+    return point;
+}
+
+HShapeElement.prototype.calculateShapeBoundingBox = function(item, boundingBox) {
+    var shape = item.sh.v;
+    var transformers = item.transformers;
+    var i, len = shape._length, vPoint, oPoint, nextIPoint, nextVPoint, bounds;
+    if (len <= 1) {
         return;
     }
-    if(this.hidden){
-        this.layerElement.style.display = 'block';
-        this.hidden = false;
+    for (i = 0; i < len - 1; i += 1) {
+        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+        nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
+        nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
+        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
     }
-    this.renderModifiers();
-    this.addedTransforms.mdf = this.finalTransform.matMdf;
-    this.addedTransforms.mats.length = 1;
-    this.addedTransforms.mats[0] = this.finalTransform.mat;
-    this.renderShape(null,null,true, null);
+    if(shape.c) {
+        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+        nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
+        nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
+        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+    }
+}
 
-    if(this.isVisible && (this.elemMdf || this.firstFrame)){
-        var boundingBox = this.shapeCont.getBBox();
+HShapeElement.prototype.checkBounds = function(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
+    this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
+    var bounds = this.shapeBoundingBox;
+    boundingBox.x = bm_min(bounds.left, boundingBox.x);
+    boundingBox.xMax = bm_max(bounds.right, boundingBox.xMax);
+    boundingBox.y = bm_min(bounds.top, boundingBox.y);
+    boundingBox.yMax = bm_max(bounds.bottom, boundingBox.yMax);
+}
+
+HShapeElement.prototype.shapeBoundingBox = {
+    left:0,
+    right:0,
+    top:0,
+    bottom:0,
+}
+
+HShapeElement.prototype.tempBoundingBox = {
+    x:0,
+    xMax:0,
+    y:0,
+    yMax:0,
+    width:0,
+    height:0
+}
+
+HShapeElement.prototype.getBoundsOfCurve = function(p0, p1, p2, p3) {
+
+    var bounds = [[p0[0],p3[0]], [p0[1],p3[1]]];
+
+    for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
+
+      b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
+      a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
+      c = 3 * p1[i] - 3 * p0[i];
+
+      b = b | 0;
+      a = a | 0;
+      c = c | 0;
+
+      if (a === 0) {
+
+        if (b === 0) {
+          continue;
+        }
+
+        t = -c / b;
+
+        if (0 < t && t < 1) {
+          bounds[i].push(this.calculateF(t,p0,p1,p2,p3,i));
+        }
+        continue;
+      }
+
+      b2ac = b * b - 4 * c * a;
+
+      if (b2ac < 0) {
+        continue;
+      }
+
+      t1 = (-b + bm_sqrt(b2ac))/(2 * a);
+      if (0 < t1 && t1 < 1) bounds[i].push(this.calculateF(t1,p0,p1,p2,p3,i));
+
+      t2 = (-b - bm_sqrt(b2ac))/(2 * a);
+      if (0 < t2 && t2 < 1) bounds[i].push(this.calculateF(t2,p0,p1,p2,p3,i));
+
+    }
+
+    this.shapeBoundingBox.left = bm_min.apply(null, bounds[0]);
+    this.shapeBoundingBox.top = bm_min.apply(null, bounds[1]);
+    this.shapeBoundingBox.right = bm_max.apply(null, bounds[0]);
+    this.shapeBoundingBox.bottom = bm_max.apply(null, bounds[1]);
+  };
+
+  HShapeElement.prototype.calculateF = function(t, p0, p1, p2, p3, i) {
+    return bm_pow(1-t, 3) * p0[i]
+        + 3 * bm_pow(1-t, 2) * t * p1[i]
+        + 3 * (1-t) * bm_pow(t, 2) * p2[i]
+        + bm_pow(t, 3) * p3[i];
+  }
+
+HShapeElement.prototype.calculateBoundingBox = function(itemsData, boundingBox) {
+    var i, len = itemsData.length, path;
+    for(i = 0; i < len; i += 1) {
+        if(itemsData[i] && itemsData[i].sh) {
+            this.calculateShapeBoundingBox(itemsData[i], boundingBox)
+        } else if(itemsData[i] && itemsData[i].it) {
+            this.calculateBoundingBox(itemsData[i].it, boundingBox)
+        }
+    }
+}
+
+HShapeElement.prototype.currentBoxContains = function(box) {
+    return this.currentBBox.x <= box.x 
+    && this.currentBBox.y <= box.y 
+    && this.currentBBox.width + this.currentBBox.x >= box.x + box.width
+    && this.currentBBox.height + this.currentBBox.y >= box.y + box.height
+}
+
+HShapeElement.prototype.renderInnerContent = function() {
+    this._renderShapeFrame();
+
+    if(!this.hidden && (this._isFirstFrame || this._mdf)) {
+        var tempBoundingBox = this.tempBoundingBox;
+        var max = 999999;
+        tempBoundingBox.x = max;
+        tempBoundingBox.xMax = -max;
+        tempBoundingBox.y = max;
+        tempBoundingBox.yMax = -max;
+        this.calculateBoundingBox(this.itemsData, tempBoundingBox);
+        tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
+        tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
+        //var tempBoundingBox = this.shapeCont.getBBox();
+        if(this.currentBoxContains(tempBoundingBox)) {
+            return;
+        }
         var changed = false;
-        if(this.currentBBox.w !== boundingBox.width){
-            this.currentBBox.w = boundingBox.width;
-            this.shapeCont.setAttribute('width',boundingBox.width);
+        if(this.currentBBox.w !== tempBoundingBox.width){
+            this.currentBBox.w = tempBoundingBox.width;
+            this.shapeCont.setAttribute('width',tempBoundingBox.width);
             changed = true;
         }
-        if(this.currentBBox.h !== boundingBox.height){
-            this.currentBBox.h = boundingBox.height;
-            this.shapeCont.setAttribute('height',boundingBox.height);
+        if(this.currentBBox.h !== tempBoundingBox.height){
+            this.currentBBox.h = tempBoundingBox.height;
+            this.shapeCont.setAttribute('height',tempBoundingBox.height);
             changed = true;
         }
-        if(changed  || this.currentBBox.x !== boundingBox.x  || this.currentBBox.y !== boundingBox.y){
-            this.currentBBox.w = boundingBox.width;
-            this.currentBBox.h = boundingBox.height;
-            this.currentBBox.x = boundingBox.x;
-            this.currentBBox.y = boundingBox.y;
+        if(changed  || this.currentBBox.x !== tempBoundingBox.x  || this.currentBBox.y !== tempBoundingBox.y){
+            this.currentBBox.w = tempBoundingBox.width;
+            this.currentBBox.h = tempBoundingBox.height;
+            this.currentBBox.x = tempBoundingBox.x;
+            this.currentBBox.y = tempBoundingBox.y;
 
             this.shapeCont.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
             this.shapeCont.style.transform = this.shapeCont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
diff --git a/player/js/elements/htmlElements/HSolidElement.js b/player/js/elements/htmlElements/HSolidElement.js
index dded87e..e210624 100644
--- a/player/js/elements/htmlElements/HSolidElement.js
+++ b/player/js/elements/htmlElements/HSolidElement.js
@@ -1,40 +1,22 @@
-function HSolidElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+function HSolidElement(data,globalData,comp){
+    this.initElement(data,globalData,comp);
 }
-createElement(HBaseElement, HSolidElement);
+extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], HSolidElement);
 
-HSolidElement.prototype.createElements = function(){
-    var parent = document.createElement('div');
-    styleDiv(parent);
-    var cont = document.createElementNS(svgNS,'svg');
-    styleDiv(cont);
-    cont.setAttribute('width',this.data.sw);
-    cont.setAttribute('height',this.data.sh);
-    parent.appendChild(cont);
-    this.layerElement = parent;
-    this.transformedElement = parent;
-    //this.appendNodeToParent(parent);
-    this.baseElement = parent;
-    this.innerElem = parent;
-    if(this.data.ln){
-        this.innerElem.setAttribute('id',this.data.ln);
-    }
-    if(this.data.bm !== 0){
-        this.setBlendMode();
-    }
-    var rect = document.createElementNS(svgNS,'rect');
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    cont.appendChild(rect);
+HSolidElement.prototype.createContent = function(){
+    var rect;
     if(this.data.hasMask){
-        this.maskedElement = rect;
+        rect = createNS('rect');
+        rect.setAttribute('width',this.data.sw);
+        rect.setAttribute('height',this.data.sh);
+        rect.setAttribute('fill',this.data.sc);
+        this.svgElement.setAttribute('width',this.data.sw);
+        this.svgElement.setAttribute('height',this.data.sh);
+    } else {
+        rect = createTag('div');
+        rect.style.width = this.data.sw + 'px';
+        rect.style.height = this.data.sh + 'px';
+        rect.style.backgroundColor = this.data.sc;
     }
-    this.checkParenting();
+    this.layerElement.appendChild(rect);
 };
-
-
-
-HSolidElement.prototype.hide = IImageElement.prototype.hide;
-HSolidElement.prototype.renderFrame = IImageElement.prototype.renderFrame;
-HSolidElement.prototype.destroy = IImageElement.prototype.destroy;
\ No newline at end of file
diff --git a/player/js/elements/htmlElements/HTextElement.js b/player/js/elements/htmlElements/HTextElement.js
index c787deb..552ca88 100644
--- a/player/js/elements/htmlElements/HTextElement.js
+++ b/player/js/elements/htmlElements/HTextElement.js
@@ -1,4 +1,4 @@
-function HTextElement(data,parentContainer,globalData,comp, placeholder){
+function HTextElement(data,globalData,comp){
     this.textSpans = [];
     this.textPaths = [];
     this.currentBBox = {
@@ -6,80 +6,54 @@
         y: -999999,
         h: 0,
         w: 0
-    }
+    };
     this.renderType = 'svg';
     this.isMasked = false;
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+    this.initElement(data,globalData,comp);
 
 }
-createElement(HBaseElement, HTextElement);
+extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], HTextElement);
 
-HTextElement.prototype.init = ITextElement.prototype.init;
-HTextElement.prototype.getMeasures = ITextElement.prototype.getMeasures;
-HTextElement.prototype.createPathShape = ITextElement.prototype.createPathShape;
-HTextElement.prototype.prepareFrame = ITextElement.prototype.prepareFrame;
-
-HTextElement.prototype.createElements = function(){
+HTextElement.prototype.createContent = function(){
     this.isMasked = this.checkMasks();
-    var parent = document.createElement('div');
-    styleDiv(parent);
-    this.layerElement = parent;
-    this.transformedElement = parent;
     if(this.isMasked){
         this.renderType = 'svg';
-        var cont = document.createElementNS(svgNS,'svg');
-        styleDiv(cont);
-        this.cont = cont;
         this.compW = this.comp.data.w;
         this.compH = this.comp.data.h;
-        cont.setAttribute('width',this.compW);
-        cont.setAttribute('height',this.compH);
-        var g = document.createElementNS(svgNS,'g');
-        cont.appendChild(g);
-        parent.appendChild(cont);
-        this.maskedElement = g;
+        this.svgElement.setAttribute('width',this.compW);
+        this.svgElement.setAttribute('height',this.compH);
+        var g = createNS('g');
+        this.maskedElement.appendChild(g);
         this.innerElem = g;
     } else {
         this.renderType = 'html';
-        this.innerElem = parent;
+        this.innerElem = this.layerElement;
     }
-    this.baseElement = parent;
 
     this.checkParenting();
 
 };
 
 HTextElement.prototype.buildNewText = function(){
-    var documentData = this.currentTextDocumentData;
-    this.renderedLetters = Array.apply(null,{length:this.currentTextDocumentData.l ? this.currentTextDocumentData.l.length : 0});
-    if(documentData.fc) {
-        this.innerElem.style.color = this.innerElem.style.fill = 'rgb(' + Math.round(documentData.fc[0]*255) + ',' + Math.round(documentData.fc[1]*255) + ',' + Math.round(documentData.fc[2]*255) + ')';
-        ////this.innerElem.setAttribute('fill', 'rgb(' + documentData.fc[0] + ',' + documentData.fc[1] + ',' + documentData.fc[2] + ')');
-    }else{
-        this.innerElem.style.color = this.innerElem.style.fill = 'rgba(0,0,0,0)';
-        ////this.innerElem.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
+    var documentData = this.textProperty.currentData;
+    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+    var innerElemStyle = this.innerElem.style;
+    innerElemStyle.color = innerElemStyle.fill = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
     if(documentData.sc){
-        ////this.innerElem.setAttribute('stroke', 'rgb(' + documentData.sc[0] + ',' + documentData.sc[1] + ',' + documentData.sc[2] + ')');
-        this.innerElem.style.stroke = 'rgb(' + Math.round(documentData.sc[0]*255) + ',' + Math.round(documentData.sc[1]*255) + ',' + Math.round(documentData.sc[2]*255) + ')';
-        ////this.innerElem.setAttribute('stroke-width', documentData.sw);
-        this.innerElem.style.strokeWidth = documentData.sw+'px';
+        innerElemStyle.stroke = this.buildColor(documentData.sc);
+        innerElemStyle.strokeWidth = documentData.sw+'px';
     }
-    ////this.innerElem.setAttribute('font-size', documentData.s);
     var fontData = this.globalData.fontManager.getFontByName(documentData.f);
     if(!this.globalData.fontManager.chars){
-        this.innerElem.style.fontSize = documentData.s+'px';
-        this.innerElem.style.lineHeight = documentData.s+'px';
+        innerElemStyle.fontSize = documentData.finalSize+'px';
+        innerElemStyle.lineHeight = documentData.finalSize+'px';
         if(fontData.fClass){
             this.innerElem.className = fontData.fClass;
         } else {
-            ////this.innerElem.setAttribute('font-family', fontData.fFamily);
-            this.innerElem.style.fontFamily = fontData.fFamily;
+            innerElemStyle.fontFamily = fontData.fFamily;
             var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-            ////this.innerElem.setAttribute('font-style', fStyle);
-            this.innerElem.style.fontStyle = fStyle;
-            ////this.innerElem.setAttribute('font-weight', fWeight);
-            this.innerElem.style.fontWeight = fWeight;
+            innerElemStyle.fontStyle = fStyle;
+            innerElemStyle.fontWeight = fWeight;
         }
     }
     var i, len;
@@ -93,7 +67,7 @@
     for (i = 0;i < len ;i += 1) {
         if(this.globalData.fontManager.chars){
             if(!this.textPaths[cnt]){
-                tSpan = document.createElementNS(svgNS,'path');
+                tSpan = createNS('path');
                 tSpan.setAttribute('stroke-linecap', 'butt');
                 tSpan.setAttribute('stroke-linejoin','round');
                 tSpan.setAttribute('stroke-miterlimit','4');
@@ -106,8 +80,8 @@
                     tCont = tParent.children[0];
                 } else {
 
-                    tParent = document.createElement('div');
-                    tCont = document.createElementNS(svgNS,'svg');
+                    tParent = createTag('div');
+                    tCont = createNS('svg');
                     tCont.appendChild(tSpan);
                     styleDiv(tParent);
                 }
@@ -118,19 +92,19 @@
                     tParent = this.textSpans[cnt];
                     tSpan = this.textPaths[cnt];
                 } else {
-                    tParent = document.createElement('span');
+                    tParent = createTag('span');
                     styleDiv(tParent);
-                    tSpan = document.createElement('span');
+                    tSpan = createTag('span');
                     styleDiv(tSpan);
                     tParent.appendChild(tSpan);
                 }
             } else {
-                tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : document.createElementNS(svgNS,'text');
+                tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
             }
         }
         //tSpan.setAttribute('visibility', 'hidden');
         if(this.globalData.fontManager.chars){
-            var charData = this.globalData.fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+            var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
             var shapeData;
             if(charData){
                 shapeData = charData.data;
@@ -140,28 +114,29 @@
             matrixHelper.reset();
             if(shapeData && shapeData.shapes){
                 shapes = shapeData.shapes[0].it;
-                matrixHelper.scale(documentData.s/100,documentData.s/100);
+                matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
                 shapeStr = this.createPathShape(matrixHelper,shapes);
                 tSpan.setAttribute('d',shapeStr);
             }
             if(!this.isMasked){
                 this.innerElem.appendChild(tParent);
                 if(shapeData && shapeData.shapes){
+
+                    //document.body.appendChild is needed to get exact measure of shape
                     document.body.appendChild(tCont);
-
                     var boundingBox = tCont.getBBox();
-                    tCont.setAttribute('width',boundingBox.width);
-                    tCont.setAttribute('height',boundingBox.height);
-                    tCont.setAttribute('viewBox',boundingBox.x+' '+ boundingBox.y+' '+ boundingBox.width+' '+ boundingBox.height);
-                    tCont.style.transform = tCont.style.webkitTransform = 'translate(' + boundingBox.x + 'px,' + boundingBox.y + 'px)';
+                    tCont.setAttribute('width',boundingBox.width + 2);
+                    tCont.setAttribute('height',boundingBox.height + 2);
+                    tCont.setAttribute('viewBox',(boundingBox.x-1)+' '+ (boundingBox.y-1)+' '+ (boundingBox.width+2)+' '+ (boundingBox.height+2));
+                    tCont.style.transform = tCont.style.webkitTransform = 'translate(' + (boundingBox.x-1) + 'px,' + (boundingBox.y-1) + 'px)';
 
-                    letters[i].yOffset = boundingBox.y;
-                    tParent.appendChild(tCont);
+                    letters[i].yOffset = boundingBox.y-1;
 
                 } else{
                     tCont.setAttribute('width',1);
                     tCont.setAttribute('height',1);
                 }
+                    tParent.appendChild(tCont);
             }else{
                 this.innerElem.appendChild(tSpan);
             }
@@ -171,7 +146,7 @@
             if(!this.isMasked){
                 this.innerElem.appendChild(tParent);
                 //
-                tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,'+ -documentData.s/1.2+'px,0)';
+                tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,'+ -documentData.finalSize/1.2+'px,0)';
             } else {
                 this.innerElem.appendChild(tSpan);
             }
@@ -190,96 +165,84 @@
         this.textSpans[cnt].style.display = 'none';
         cnt += 1;
     }
-}
+};
 
-HTextElement.prototype.hide = SVGTextElement.prototype.hide;
-
-HTextElement.prototype.renderFrame = function(parentMatrix){
-
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    if(this.hidden){
-        this.hidden = false;
-        this.innerElem.style.display = 'block';
-        this.layerElement.style.display = 'block';
-    }
+HTextElement.prototype.renderInnerContent = function() {
 
     if(this.data.singleShape){
-        if(!this.firstFrame && !this.lettersChangedFlag){
+        if(!this._isFirstFrame && !this.lettersChangedFlag){
             return;
         } else {
             // Todo Benchmark if using this is better than getBBox
-             if(this.isMasked && this.finalTransform.matMdf){
-                 this.cont.setAttribute('viewBox',-this.finalTransform.mProp.p.v[0]+' '+ -this.finalTransform.mProp.p.v[1]+' '+this.compW+' '+this.compH);
-                this.cont.style.transform = this.cont.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
+             if(this.isMasked && this.finalTransform._matMdf){
+                 this.svgElement.setAttribute('viewBox',-this.finalTransform.mProp.p.v[0]+' '+ -this.finalTransform.mProp.p.v[1]+' '+this.compW+' '+this.compH);
+                this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
              }
         }
     }
 
-    this.getMeasures();
-    if(!this.lettersChangedFlag){
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+    if(!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag){
         return;
     }
-    var  i,len;
-    var renderedLetters = this.renderedLetters;
+    var  i,len, count = 0;
+    var renderedLetters = this.textAnimator.renderedLetters;
 
-    var letters = this.currentTextDocumentData.l;
+    var letters = this.textProperty.currentData.l;
 
     len = letters.length;
-    var renderedLetter;
+    var renderedLetter, textSpan, textPath;
     for(i=0;i<len;i+=1){
         if(letters[i].n){
+            count += 1;
             continue;
         }
-        renderedLetter = renderedLetters[i];
-        if(!this.isMasked){
-            this.textSpans[i].style.transform = this.textSpans[i].style.webkitTransform = renderedLetter.m;
-        }else{
-            this.textSpans[i].setAttribute('transform',renderedLetter.m);
-        }
-        ////this.textSpans[i].setAttribute('opacity',renderedLetter.o);
-        this.textSpans[i].style.opacity = renderedLetter.o;
-        if(renderedLetter.sw){
-            this.textPaths[i].setAttribute('stroke-width',renderedLetter.sw);
-        }
-        if(renderedLetter.sc){
-            this.textPaths[i].setAttribute('stroke',renderedLetter.sc);
-        }
-        if(renderedLetter.fc){
-            this.textPaths[i].setAttribute('fill',renderedLetter.fc);
-            this.textPaths[i].style.color = renderedLetter.fc;
-        }
-    }
-    if(this.isVisible && (this.elemMdf || this.firstFrame)){
-        if(this.innerElem.getBBox){
-            var boundingBox = this.innerElem.getBBox();
-
-            if(this.currentBBox.w !== boundingBox.width){
-                this.currentBBox.w = boundingBox.width;
-                this.cont.setAttribute('width',boundingBox.width);
-            }
-            if(this.currentBBox.h !== boundingBox.height){
-                this.currentBBox.h = boundingBox.height;
-                this.cont.setAttribute('height',boundingBox.height);
-            }
-            if(this.currentBBox.w !== boundingBox.width || this.currentBBox.h !== boundingBox.height  || this.currentBBox.x !== boundingBox.x  || this.currentBBox.y !== boundingBox.y){
-                this.currentBBox.w = boundingBox.width;
-                this.currentBBox.h = boundingBox.height;
-                this.currentBBox.x = boundingBox.x;
-                this.currentBBox.y = boundingBox.y;
-
-                this.cont.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-                this.cont.style.transform = this.cont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+        textSpan = this.textSpans[i];
+        textPath = this.textPaths[i];
+        renderedLetter = renderedLetters[count];
+        count += 1;
+        if(renderedLetter._mdf.m) {
+            if(!this.isMasked){
+                textSpan.style.transform = textSpan.style.webkitTransform = renderedLetter.m;
+            }else{
+                textSpan.setAttribute('transform',renderedLetter.m);
             }
         }
+        ////textSpan.setAttribute('opacity',renderedLetter.o);
+        textSpan.style.opacity = renderedLetter.o;
+        if(renderedLetter.sw && renderedLetter._mdf.sw){
+            textPath.setAttribute('stroke-width',renderedLetter.sw);
+        }
+        if(renderedLetter.sc && renderedLetter._mdf.sc){
+            textPath.setAttribute('stroke',renderedLetter.sc);
+        }
+        if(renderedLetter.fc && renderedLetter._mdf.fc){
+            textPath.setAttribute('fill',renderedLetter.fc);
+            textPath.style.color = renderedLetter.fc;
+        }
     }
-    if(this.firstFrame){
-        this.firstFrame = false;
+
+    if(this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)){
+        var boundingBox = this.innerElem.getBBox();
+
+        if(this.currentBBox.w !== boundingBox.width){
+            this.currentBBox.w = boundingBox.width;
+            this.svgElement.setAttribute('width',boundingBox.width);
+        }
+        if(this.currentBBox.h !== boundingBox.height){
+            this.currentBBox.h = boundingBox.height;
+            this.svgElement.setAttribute('height',boundingBox.height);
+        }
+
+        var margin = 1;
+        if(this.currentBBox.w !== (boundingBox.width + margin*2) || this.currentBBox.h !== (boundingBox.height + margin*2)  || this.currentBBox.x !== (boundingBox.x - margin)  || this.currentBBox.y !== (boundingBox.y - margin)){
+            this.currentBBox.w = boundingBox.width + margin*2;
+            this.currentBBox.h = boundingBox.height + margin*2;
+            this.currentBBox.x = boundingBox.x - margin;
+            this.currentBBox.y = boundingBox.y - margin;
+
+            this.svgElement.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
+            this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+        }
     }
-}
-
-
-HTextElement.prototype.destroy = SVGTextElement.prototype.destroy;
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/player/js/elements/pixiElements/PIXIBaseElement.js b/player/js/elements/pixiElements/PIXIBaseElement.js
index d9458b7..1c54fa6 100644
--- a/player/js/elements/pixiElements/PIXIBaseElement.js
+++ b/player/js/elements/pixiElements/PIXIBaseElement.js
@@ -9,250 +9,153 @@
     this.init();
 };
 
-createElement(BaseElement, PIXIBaseElement);
+PIXIBaseElement.prototype = {
+    initRendererElement: function() {
+        this.layerElement = new PIXI.DisplayObjectContainer();
+    },
+    createContainerElements: function(){
+        this.matteElement = createNS('g');
+        this.transformedElement = this.layerElement;
+        this.maskedElement = this.layerElement;
+        this._sizeChanged = false;
+        var layerElementParent = null;
+        //If this layer acts as a mask for the following layer
+        var filId, fil, gg;
+        if (this.data.td) {
+            if (this.data.td == 3 || this.data.td == 1) {
+                var masker = createNS('mask');
+                masker.setAttribute('id', this.layerId);
+                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
+                masker.appendChild(this.layerElement);
+                layerElementParent = masker;
+                this.globalData.defs.appendChild(masker);
+                // This is only for IE and Edge when mask if of type alpha
+                if (!featureSupport.maskType && this.data.td == 1) {
+                    masker.setAttribute('mask-type', 'luminance');
+                    filId = randomString(10);
+                    fil = filtersFactory.createFilter(filId);
+                    this.globalData.defs.appendChild(fil);
+                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+                    gg = createNS('g');
+                    gg.appendChild(this.layerElement);
+                    layerElementParent = gg;
+                    masker.appendChild(gg);
+                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
+                }
+            } else if(this.data.td == 2) {
+                var maskGroup = createNS('mask');
+                maskGroup.setAttribute('id', this.layerId);
+                maskGroup.setAttribute('mask-type','alpha');
+                var maskGrouper = createNS('g');
+                maskGroup.appendChild(maskGrouper);
+                filId = randomString(10);
+                fil = filtersFactory.createFilter(filId);
+                ////
 
-PIXIBaseElement.prototype.createElements = function(){
-    if(this.data.td){
-        if(this.data.td == 3){
-            this.layerElement = document.createElementNS(svgNS,'mask');
-            this.layerElement.setAttribute('id',this.layerId);
-            this.layerElement.setAttribute('mask-type','luminance');
-            this.globalData.defs.appendChild(this.layerElement);
-        }else if(this.data.td == 2){
-            var maskGroup = document.createElementNS(svgNS,'mask');
-            maskGroup.setAttribute('id',this.layerId);
-            maskGroup.setAttribute('mask-type','alpha');
-            var maskGrouper = document.createElementNS(svgNS,'g');
-            maskGroup.appendChild(maskGrouper);
-            this.layerElement = document.createElementNS(svgNS,'g');
-            var fil = document.createElementNS(svgNS,'filter');
-            var filId = randomString(10);
-            fil.setAttribute('id',filId);
-            fil.setAttribute('filterUnits','objectBoundingBox');
-            fil.setAttribute('x','0%');
-            fil.setAttribute('y','0%');
-            fil.setAttribute('width','100%');
-            fil.setAttribute('height','100%');
-            var feCTr = document.createElementNS(svgNS,'feComponentTransfer');
-            feCTr.setAttribute('in','SourceGraphic');
-            fil.appendChild(feCTr);
-            var feFunc = document.createElementNS(svgNS,'feFuncA');
-            feFunc.setAttribute('type','table');
-            feFunc.setAttribute('tableValues','1.0 0.0');
-            feCTr.appendChild(feFunc);
-            this.globalData.defs.appendChild(fil);
-            var alphaRect = document.createElementNS(svgNS,'rect');
-            alphaRect.setAttribute('width',this.comp.data ? this.comp.data.w : this.globalData.compSize.w);
-            alphaRect.setAttribute('height',this.comp.data ? this.comp.data.h : this.globalData.compSize.h);
-            alphaRect.setAttribute('x','0');
-            alphaRect.setAttribute('y','0');
-            alphaRect.setAttribute('fill','#ffffff');
-            alphaRect.setAttribute('opacity','0');
-            maskGrouper.setAttribute('filter','url(#'+filId+')');
-            maskGrouper.appendChild(alphaRect);
-            maskGrouper.appendChild(this.layerElement);
-            this.globalData.defs.appendChild(maskGroup);
-        }else{
-            this.layerElement = document.createElementNS(svgNS,'g');
-            var masker = document.createElementNS(svgNS,'mask');
-            masker.setAttribute('id',this.layerId);
-            masker.setAttribute('mask-type','alpha');
-            masker.appendChild(this.layerElement);
-            this.globalData.defs.appendChild(masker);
-        }
-        if(this.data.hasMask){
-            this.maskedElement = this.layerElement;
-        }
-    }else if(this.data.hasMask || this.data.tt){
-        this.layerElement = document.createElementNS(svgNS,'g');
-        this.PLayerElement = new PIXI.DisplayObjectContainer();
-        if(this.data.tt){
-            this.matteElement = document.createElementNS(svgNS,'g');
+                var feColorMatrix = createNS('feColorMatrix');
+                feColorMatrix.setAttribute('type', 'matrix');
+                feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+                feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
+                fil.appendChild(feColorMatrix);
+
+                this.globalData.defs.appendChild(fil);
+                var alphaRect = createNS('rect');
+                alphaRect.setAttribute('width',  this.comp.data.w);
+                alphaRect.setAttribute('height', this.comp.data.h);
+                alphaRect.setAttribute('x','0');
+                alphaRect.setAttribute('y','0');
+                alphaRect.setAttribute('fill','#ffffff');
+                alphaRect.setAttribute('opacity','0');
+                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
+                maskGrouper.appendChild(alphaRect);
+                maskGrouper.appendChild(this.layerElement);
+                layerElementParent = maskGrouper;
+                if (!featureSupport.maskType) {
+                    maskGroup.setAttribute('mask-type', 'luminance');
+                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+                    gg = createNS('g');
+                    maskGrouper.appendChild(alphaRect);
+                    gg.appendChild(this.layerElement);
+                    layerElementParent = gg;
+                    maskGrouper.appendChild(gg);
+                }
+                this.globalData.defs.appendChild(maskGroup);
+            }
+        } else if (this.data.tt) {
             this.matteElement.appendChild(this.layerElement);
+            layerElementParent = this.matteElement;
             this.baseElement = this.matteElement;
-            //this.appendNodeToParent(this.matteElement);
-        }else{
+        } else {
             this.baseElement = this.layerElement;
             this.PBaseElement = this.PLayerElement;
-            //this.appendNodeToParent(this.layerElement);
         }
-        if(this.data.hasMask){
-            this.maskedElement = this.layerElement;
-            this.PMaskedElement = this.PLayerElement;
+        if (this.data.ln) {
+            this.layerElement.setAttribute('id', this.data.ln);
         }
-    }else{
-        this.layerElement = document.createElementNS(svgNS,'g');
-        this.baseElement = this.layerElement;
-        this.PLayerElement = new PIXI.DisplayObjectContainer();
-        this.PBaseElement = this.PLayerElement;
-    }
-    if((this.data.ln || this.data.cl) && (this.data.ty === 4 || this.data.ty === 0)){
-        if(this.data.ln){
-            this.layerElement.setAttribute('id',this.data.ln);
+        if (this.data.cl) {
+            this.layerElement.setAttribute('class', this.data.cl);
         }
-        if(this.data.cl){
-            this.layerElement.setAttribute('class',this.data.cl);
-        }
-    }
-    if(this.data.ty === 0 && !this.checkMasks()){
-        var cp = document.createElementNS(svgNS, 'clipPath');
-        var pt = document.createElementNS(svgNS,'path');
-        pt.setAttribute('d','M0,0 L'+this.data.w+',0'+' L'+this.data.w+','+this.data.h+' L0,'+this.data.h+'z');
-        var clipId = 'cp_'+randomString(8);
-        cp.setAttribute('id',clipId);
-        this.layerElement.setAttribute('clip-path','url(#'+clipId+')');
-        cp.appendChild(pt);
-        this.globalData.defs.appendChild(cp);
-    }
-    if(this.data.bm !== 0){
-        this.setBlendMode();
-    }
-    if(this.layerElement !== this.parentContainer){
-        this.placeholder = null;
-    }
-    /* Todo performance killer
-    if(this.data.sy){
-        var filterID = 'st_'+randomString(10);
-        var c = this.data.sy[0].c.k;
-        var r = this.data.sy[0].s.k;
-        var expansor = document.createElementNS(svgNS,'filter');
-        expansor.setAttribute('id',filterID);
-        var feFlood = document.createElementNS(svgNS,'feFlood');
-        this.feFlood = feFlood;
-        if(!c[0].e){
-            feFlood.setAttribute('flood-color','rgb('+c[0]+','+c[1]+','+c[2]+')');
-        }
-        feFlood.setAttribute('result','base');
-        expansor.appendChild(feFlood);
-        var feMorph = document.createElementNS(svgNS,'feMorphology');
-        feMorph.setAttribute('operator','dilate');
-        feMorph.setAttribute('in','SourceGraphic');
-        feMorph.setAttribute('result','bigger');
-        this.feMorph = feMorph;
-        if(!r.length){
-            feMorph.setAttribute('radius',this.data.sy[0].s.k);
-        }
-        expansor.appendChild(feMorph);
-        var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-        feColorMatrix.setAttribute('result','mask');
-        feColorMatrix.setAttribute('in','bigger');
-        feColorMatrix.setAttribute('type','matrix');
-        feColorMatrix.setAttribute('values','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0');
-        expansor.appendChild(feColorMatrix);
-        var feComposite = document.createElementNS(svgNS,'feComposite');
-        feComposite.setAttribute('result','drop');
-        feComposite.setAttribute('in','base');
-        feComposite.setAttribute('in2','mask');
-        feComposite.setAttribute('operator','in');
-        expansor.appendChild(feComposite);
-        var feBlend = document.createElementNS(svgNS,'feBlend');
-        feBlend.setAttribute('in','SourceGraphic');
-        feBlend.setAttribute('in2','drop');
-        feBlend.setAttribute('mode','normal');
-        expansor.appendChild(feBlend);
-        this.globalData.defs.appendChild(expansor);
-        var cont = document.createElementNS(svgNS,'g');
-        if(this.layerElement === this.parentContainer){
-            this.layerElement = cont;
-        }else{
-            cont.appendChild(this.layerElement);
-        }
-        cont.setAttribute('filter','url(#'+filterID+')');
-        if(this.data.td){
-            cont.setAttribute('data-td',this.data.td);
-        }
-        if(this.data.td == 3){
-            this.globalData.defs.appendChild(cont);
-        }else if(this.data.td == 2){
-            maskGrouper.appendChild(cont);
-        }else if(this.data.td == 1){
-            masker.appendChild(cont);
-        }else{
-            if(this.data.hasMask && this.data.tt){
-                this.matteElement.appendChild(cont);
-            }else{
-                this.appendNodeToParent(cont);
+        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+        if (this.data.ty === 0 && !this.data.hd) {
+            var cp = createNS( 'clipPath');
+            var pt = createNS('path');
+            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+            var clipId = 'cp_'+randomString(8);
+            cp.setAttribute('id',clipId);
+            cp.appendChild(pt);
+            this.globalData.defs.appendChild(cp);
+
+            if (this.checkMasks()) {
+                var cpGroup = createNS('g');
+                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
+                cpGroup.appendChild(this.layerElement);
+                this.transformedElement = cpGroup;
+                if (layerElementParent) {
+                    layerElementParent.appendChild(this.transformedElement);
+                } else {
+                    this.baseElement = this.transformedElement;
+                }
+            } else {
+                //this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
             }
+            
         }
-    }*/
-    if(this.data.ef){
-        this.effectsManager = new SVGEffects(this);
-    }
-    this.checkParenting();
-};
-
-
-PIXIBaseElement.prototype.setBlendMode = BaseElement.prototype.setBlendMode;
-
-PIXIBaseElement.prototype.renderFrame = function(parentTransform){
-    if(this.data.ty === 3 || this.data.hd){
-        return false;
-    }
-
-    if(!this.isVisible){
-        return this.isVisible;
-    }
-    this.lastNum = this.currentFrameNum;
-    this.finalTransform.opMdf = this.finalTransform.op.mdf;
-    this.finalTransform.matMdf = this.finalTransform.mProp.mdf;
-    this.finalTransform.opacity = this.finalTransform.op.v;
-    if(this.firstFrame){
-        this.finalTransform.opMdf = true;
-        this.finalTransform.matMdf = true;
-    }
-
-    var mat;
-    var finalMat = this.finalTransform.mat;
-
-    if(this.hierarchy){
-        var i, len = this.hierarchy.length;
-
-        mat = this.finalTransform.mProp.v.props;
-        finalMat.cloneFromProps(mat);
-        for(i=0;i<len;i+=1){
-            this.finalTransform.matMdf = this.hierarchy[i].finalTransform.mProp.mdf ? true : this.finalTransform.matMdf;
-            mat = this.hierarchy[i].finalTransform.mProp.v.props;
-            finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
+        if (this.data.bm !== 0) {
+            this.setBlendMode();
         }
-    }else{
-        if(this.isVisible){
-            finalMat.cloneFromProps(this.finalTransform.mProp.v.props);
+        this.renderableEffectsManager = new SVGEffects(this);
+    },
+    renderInnerContent: function() {},
+    renderFrame: function() {
+        if (this.hidden) {
+            return;
         }
-    }
-    if(parentTransform){
-        mat = parentTransform.mat.props;
-        finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
-        this.finalTransform.opacity *= parentTransform.opacity;
-        this.finalTransform.opMdf = parentTransform.opMdf ? true : this.finalTransform.opMdf;
-        this.finalTransform.matMdf = parentTransform.matMdf ? true : this.finalTransform.matMdf;
-    }
-    if(this.finalTransform.matMdf && this.layerElement){
-        this.layerElement.setAttribute('transform',finalMat.to2dCSS());
-        ///
-    }
-    var mt = new PIXI.Matrix();
-    mt.a = finalMat.props[0];
-    mt.b = finalMat.props[1];
-    mt.c = finalMat.props[4];
-    mt.d = finalMat.props[5];
-    mt.tx = finalMat.props[12];
-    mt.ty = finalMat.props[13];
-    this.PLayerElement.transform.setFromMatrix(mt);
-    var trMat = this.finalTransform.mProp;
-    //this.PLayerElement.setTransform(trMat.p.v[0],trMat.p.v[1],trMat.s.v[0],trMat.s.v[1],trMat.r.v,trMat.r.v*degToRads,0,0,trMat.a.v[0],trMat.a.v[1]);
-    if(this.finalTransform.opMdf && this.layerElement){
-        this.layerElement.setAttribute('opacity',this.finalTransform.opacity);
-        this.PLayerElement.alpha = this.finalTransform.opacity;
-    }
-
-    if(this.data.hasMask){
-        this.maskManager.renderFrame(finalMat);
-    }
-    if(this.effectsManager){
-        this.effectsManager.renderFrame(this.firstFrame);
-    }
-    return this.isVisible;
-};
+        this.renderTransform();
+        //this.setBlendMode();
+        this.renderRenderable();
+        this.renderElement();
+        this.renderInnerContent();
+        if (this._isFirstFrame) {
+            this._isFirstFrame = false;
+        }
+    },
+    renderElement: function() {
+        if (this.finalTransform._matMdf) {
+            var finalMat = this.finalTransform.mat;
+            var mt = new PIXI.Matrix();
+            mt.a = finalMat.props[0];
+            mt.b = finalMat.props[1];
+            mt.c = finalMat.props[4];
+            mt.d = finalMat.props[5];
+            mt.tx = finalMat.props[12];
+            mt.ty = finalMat.props[13];
+            this.transformedElement.transform.setFromMatrix(mt);
+        }
+        if (this.finalTransform._opMdf) {
+            this.transformedElement.alpha = this.finalTransform.mProp.o.v;
+        }
+    },
+}
 
 PIXIBaseElement.prototype.destroy = function(){
     this.layerElement = null;
@@ -266,14 +169,10 @@
 };
 
 PIXIBaseElement.prototype.getBaseElement = function(){
-    return this.baseElement;
-};
-
-PIXIBaseElement.prototype.getPBaseElement = function(){
     return this.PBaseElement;
 };
-PIXIBaseElement.prototype.addMasks = function(data){
-    this.maskManager = new PIXIMaskElement(data,this,this.globalData);
+PIXIBaseElement.prototype.addMasks = function(){
+    this.maskManager = new PIXIMaskElement(this.data, this, this.globalData);
 };
 
 PIXIBaseElement.prototype.setMatte = function(id){
@@ -290,6 +189,20 @@
     this.matteElement.setAttribute("mask", "url(#" + id + ")");
 };
 
+PIXIBaseElement.prototype.show = function(){
+    if (this.isInRange && !this.isTransparent){
+        this.hidden = false;
+        this._isFirstFrame = true;
+    }
+};
+
 PIXIBaseElement.prototype.hide = function(){
 
 };
+
+PIXIBaseElement.prototype.prepareFrame = function(num){
+    this._mdf = false;
+    this.prepareRenderableFrame(num);
+    this.prepareProperties(num, this.isInRange);
+    this.checkTransparency();
+};
\ No newline at end of file
diff --git a/player/js/elements/pixiElements/PIXICompElement.js b/player/js/elements/pixiElements/PIXICompElement.js
index d7b2324..35e7e85 100644
--- a/player/js/elements/pixiElements/PIXICompElement.js
+++ b/player/js/elements/pixiElements/PIXICompElement.js
@@ -1,109 +1,10 @@
-function PIXICompElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
-    this.layers = data.layers;
-    this.supports3d = true;
+function PIXICompElement(data, globalData, comp){
     this.completeLayers = false;
+    this.layers = data.layers;
     this.pendingElements = [];
-    this.elements = Array.apply(null,{length:this.layers.length});
-    if(this.data.tm){
-        this.tm = PropertyFactory.getProp(this,this.data.tm,0,globalData.frameRate,this.dynamicProperties);
-    }
-    if(this.data.xt){
-        this.layerElement = document.createElementNS(svgNS,'g');
-        this.buildAllItems();
-    } else if(!globalData.progressiveLoad){
-        this.buildAllItems();
-    }
+    this.elements = createSizedArray(this.layers.length);
+    this.initElement(data, globalData, comp);
+    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
 }
-createElement(PIXIBaseElement, PIXICompElement);
 
-PIXICompElement.prototype.hide = function(){
-    if(!this.hidden){
-        var i,len = this.elements.length;
-        for( i = 0; i < len; i+=1 ){
-            if(this.elements[i]){
-                this.elements[i].hide();
-            }
-        }
-        this.hidden = true;
-    }
-};
-
-PIXICompElement.prototype.prepareFrame = function(num){
-    this._parent.prepareFrame.call(this,num);
-    if(this.isVisible===false && !this.data.xt){
-        return;
-    }
-    var timeRemapped = num;
-    if(this.tm){
-        timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-    }
-    this.renderedFrame = timeRemapped/this.data.sr;
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
-    }
-    for( i = 0; i < len; i+=1 ){
-        /*if(!this.elements[i]){
-            this.checkLayer(i, this.renderedFrame - this.layers[i].st, this.layerElement);
-        }*/
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(timeRemapped/this.data.sr - this.layers[i].st);
-        }
-    }
-};
-
-PIXICompElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    var i,len = this.layers.length;
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-
-    this.hidden = false;
-    for( i = 0; i < len; i+=1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
-    }
-    if(this.firstFrame){
-        this.firstFrame = false;
-    }
-};
-
-PIXICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
-};
-
-PIXICompElement.prototype.getElements = function(){
-    return this.elements;
-};
-
-PIXICompElement.prototype.destroy = function(){
-    this._parent.destroy.call();
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-};
-
-PIXICompElement.prototype.checkLayers = PIXIRenderer.prototype.checkLayers;
-PIXICompElement.prototype.buildItem = PIXIRenderer.prototype.buildItem;
-PIXICompElement.prototype.buildAllItems = PIXIRenderer.prototype.buildAllItems;
-PIXICompElement.prototype.buildElementParenting = PIXIRenderer.prototype.buildElementParenting;
-PIXICompElement.prototype.createItem = PIXIRenderer.prototype.createItem;
-PIXICompElement.prototype.createImage = PIXIRenderer.prototype.createImage;
-PIXICompElement.prototype.createComp = PIXIRenderer.prototype.createComp;
-PIXICompElement.prototype.createSolid = PIXIRenderer.prototype.createSolid;
-PIXICompElement.prototype.createShape = PIXIRenderer.prototype.createShape;
-PIXICompElement.prototype.createText = PIXIRenderer.prototype.createText;
-PIXICompElement.prototype.createBase = PIXIRenderer.prototype.createBase;
-PIXICompElement.prototype.appendElementInPos = PIXIRenderer.prototype.appendElementInPos;
-PIXICompElement.prototype.checkPendingElements = SVGRenderer.prototype.checkPendingElements;
-PIXICompElement.prototype.addPendingElement = SVGRenderer.prototype.addPendingElement;
\ No newline at end of file
+extendPrototype([PIXIRenderer, ICompElement, PIXIBaseElement], PIXICompElement);
\ No newline at end of file
diff --git a/player/js/elements/pixiElements/PIXIImageElement.js b/player/js/elements/pixiElements/PIXIImageElement.js
index 602b4f0..9fe6832 100644
--- a/player/js/elements/pixiElements/PIXIImageElement.js
+++ b/player/js/elements/pixiElements/PIXIImageElement.js
@@ -2,7 +2,7 @@
     this.assetData = globalData.getAssetData(data.refId);
     this._parent.constructor.call(this,data,parentContainer,globalData,comp,placeholder);
 }
-createElement(PIXIBaseElement, PIXIImageElement);
+extendPrototype([BaseElement, TransformElement, PIXIBaseElement, HierarchyElement, FrameElement, RenderableElement], PIXIImageElement);
 
 PIXIImageElement.prototype.createElements = function(){
 
diff --git a/player/js/elements/pixiElements/PIXIMask.js b/player/js/elements/pixiElements/PIXIMask.js
index a6e19d1..1e69d83 100644
--- a/player/js/elements/pixiElements/PIXIMask.js
+++ b/player/js/elements/pixiElements/PIXIMask.js
@@ -5,11 +5,10 @@
     this.globalData = globalData;
     this.paths = [];
     this.storedData = [];
-    this.masksProperties = this.data.masksProperties;
+    this.masksProperties = this.data.masksProperties || [];
     this.viewData = new Array(this.masksProperties.length);
     this.maskElement = null;
     this.PMaskElement = null;
-    this.firstFrame = true;
     var defs = this.globalData.defs;
     var i, len = this.masksProperties.length;
 
@@ -42,7 +41,7 @@
         PPath = new PIXI.Graphics;
         if(properties[i].mode == 'n' || properties[i].cl === false) {
             this.viewData[i] = {
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3,this.dynamicProperties,null),
+                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
                 elem: path
             };
             defs.appendChild(path);
@@ -70,7 +69,7 @@
         if(properties[i].x.k !== 0){
             maskType = 'mask';
             maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.dynamicProperties);
+            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
             var filterID = 'fi_'+randomString(10);
             expansor = document.createElementNS(svgNS,'filter');
             expansor.setAttribute('id',filterID);
@@ -127,7 +126,7 @@
             elem: path,
             PElem: PPath,
             lastPath: '',
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3,this.dynamicProperties,null)
+            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3)
         };
         if(rect){
             this.viewData[i].invRect = rect;
@@ -146,59 +145,28 @@
         //this.PMaskElement.addChild(currentPMasks[i]);
     }
 
-    this.maskElement.setAttribute('id', layerId);
     if(count > 0){
         this.element.maskedElement.setAttribute(maskRef, "url(#" + layerId + ")");
         this.element.PMaskedElement.mask = currentPMasks[0];
         this.element.PMaskedElement.addChild(currentPMasks[0]);
     }
+    if (this.viewData.length) {
+        this.element.addRenderableComponent(this);
+    }
 
-    defs.appendChild(this.maskElement);
 };
 
 PIXIMaskElement.prototype.getMaskProperty = function(pos){
     return this.viewData[pos].prop;
 };
 
-PIXIMaskElement.prototype.prepareFrame = function(){
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-
-    }
-};
-
-PIXIMaskElement.prototype.renderFrame = function (finalMat) {
+PIXIMaskElement.prototype.renderFrame = function (isFirstFrame) {
     var i, len = this.masksProperties.length;
     for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop.mdf || this.firstFrame){
+        if(this.viewData[i].prop._mdf || isFirstFrame){
             this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
         }
-        if(this.masksProperties[i].mode !== 'n' && this.masksProperties[i].cl !== false){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp.mdf || this.firstFrame)){
-                this.viewData[i].invRect.setAttribute('x', -finalMat.props[12]);
-                this.viewData[i].invRect.setAttribute('y', -finalMat.props[13]);
-            }
-            if(this.storedData[i].x && (this.storedData[i].x.mdf || this.firstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
     }
-    this.firstFrame = false;
 };
 
 PIXIMaskElement.prototype.getMaskelement = function () {
diff --git a/player/js/elements/pixiElements/PIXIShapeElement.js b/player/js/elements/pixiElements/PIXIShapeElement.js
index d69e701..3b8329e 100644
--- a/player/js/elements/pixiElements/PIXIShapeElement.js
+++ b/player/js/elements/pixiElements/PIXIShapeElement.js
@@ -1,12 +1,15 @@
-function PIXIShapeElement(data,parentContainer,globalData,comp, placeholder){
+function PIXIShapeElement(data, globalData, comp){
     this.shapes = [];
     this.shapesData = data.shapes;
     this.stylesList = [];
-    this.viewData = [];
+    this.itemsData = [];
+    this.prevViewData = [];
+    this.animatedContents = [];
     this.shapeModifiers = [];
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+    this.processedElements = [];
+    this.initElement(data, globalData, comp);
 }
-createElement(PIXIBaseElement, PIXIShapeElement);
+extendPrototype([BaseElement,TransformElement,PIXIBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], PIXIShapeElement);
 
 PIXIShapeElement.prototype.lcEnum = {
     '1': 'butt',
@@ -20,84 +23,326 @@
     '3': 'butt'
 }
 
-PIXIShapeElement.prototype.buildExpressionInterface = function(){};
-
-PIXIShapeElement.prototype.createElements = function(){
-    //TODO check if I can use symbol so i can set its viewBox
-    this._parent.createElements.call(this);
-    this.searchShapes(this.shapesData,this.viewData,this.layerElement,this.PLayerElement,this.dynamicProperties, 0);
-
-    if(!this.data.hd || this.data.td){
-        styleUnselectableDiv(this.layerElement);
-    }
-    //this.elemInterface.registerShapeExpressionInterface(ShapeExpressionInterface.createShapeInterface(this.shapesData,this.viewData,this.elemInterface));
-};
-
-PIXIShapeElement.prototype.setGradientData = function(pathElement,arr,data){
-
-    var gradientId = 'gr_'+randomString(10);
-    var gfill;
-    if(arr.t === 1){
-        gfill = document.createElementNS(svgNS,'linearGradient');
-    } else {
-        gfill = document.createElementNS(svgNS,'radialGradient');
-    }
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = arr.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = document.createElementNS(svgNS,'stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( arr.ty === 'gf' ? 'fill':'stroke','url(#'+gradientId+')');
-    this.globalData.defs.appendChild(gfill);
-    data.gf = gfill;
-    data.cst = stops;
+PIXIShapeElement.prototype.initElement = function(data,globalData,comp) {
+    this.initFrame();
+    this.initBaseData(data, globalData, comp);
+    this.initTransform(data, globalData, comp);
+    this.initHierarchy();
+    this.initRenderable();
+    this.initRendererElement();
+    this.createContainerElements();
+    this.addMasks();
+    this.createContent();
+    this.hide();
 }
 
-PIXIShapeElement.prototype.setGradientOpacity = function(arr, data, styleOb){
-    if((arr.g.k.k[0].s && arr.g.k.k[0].s.length > arr.g.p*4) || arr.g.k.k.length > arr.g.p*4){
-        var opFill;
-        var stop, j, jLen;
-        var mask = document.createElementNS(svgNS,"mask");
-        var maskElement = document.createElementNS(svgNS, 'path');
-        mask.appendChild(maskElement);
-        var opacityId = 'op_'+randomString(10);
-        var maskId = 'mk_'+randomString(10);
-        mask.setAttribute('id',maskId);
-        if(arr.t === 1){
-            opFill = document.createElementNS(svgNS,'linearGradient');
-        } else {
-            opFill = document.createElementNS(svgNS,'radialGradient');
+PIXIShapeElement.prototype.initSecondaryElement = function() {
+};
+
+PIXIShapeElement.prototype.identityMatrix = new Matrix();
+
+PIXIShapeElement.prototype.buildExpressionInterface = function(){};
+
+PIXIShapeElement.prototype.createContent = function(){
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.PLayerElement, 0, [], true);
+    this.filterUniqueShapes();
+};
+
+/*
+This method searches for multiple shapes that affect a single element and one of them is animated
+*/
+PIXIShapeElement.prototype.filterUniqueShapes = function(){
+    var i, len = this.shapes.length, shape;
+    var j, jLen = this.stylesList.length;
+    var style, count = 0;
+    var tempShapes = [];
+    var areAnimated = false;
+    for(j = 0; j < jLen; j += 1) {
+        style = this.stylesList[j];
+        areAnimated = false;
+        tempShapes.length = 0;
+        for(i = 0; i < len; i += 1) {
+            shape = this.shapes[i];
+            if(shape.styles.indexOf(style) !== -1) {
+                tempShapes.push(shape);
+                areAnimated = shape._isAnimated || areAnimated;
+            }
         }
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = arr.g.k.k[0].s ? arr.g.k.k[0].s.length : arr.g.k.k.length;
-        var stops = [];
-        for(j=arr.g.p*4;j<jLen;j+=2){
-            stop = document.createElementNS(svgNS,'stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            //stop.setAttribute('offset',Math.round(arr.y[j][0]*100)+'%');
-            //stop.setAttribute('style','stop-color:rgb(255,255,255);stop-opacity:'+arr.y[j][1]);
-            opFill.appendChild(stop);
-            stops.push(stop);
+        if(tempShapes.length > 1 && areAnimated) {
+            this.setShapesAsAnimated(tempShapes);
         }
-        maskElement.setAttribute( arr.ty === 'gf' ? 'fill':'stroke','url(#'+opacityId+')');
-        this.globalData.defs.appendChild(opFill);
-        this.globalData.defs.appendChild(mask);
-        data.of = opFill;
-        data.ost = stops;
-        styleOb.msElem = maskElement;
-        return maskId;
+    }
+}
+
+PIXIShapeElement.prototype.setShapesAsAnimated = function(shapes){
+    var i, len = shapes.length;
+    for(i = 0; i < len; i += 1) {
+        shapes[i].setAsAnimated();
+    }
+}
+
+PIXIShapeElement.prototype.createStyleElement = function(data, level){
+    //TODO: prevent drawing of hidden styles
+    var elementData;
+    var styleOb = new SVGStyleData(data, level);
+
+    var pathElement = styleOb.pElem;
+    if(data.ty === 'st') {
+        elementData = new SVGStrokeStyleData(this, data, styleOb);
+    } else if(data.ty === 'fl') {
+        elementData = new SVGFillStyleData(this, data, styleOb);
+    } else if(data.ty === 'gf' || data.ty === 'gs') {
+        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+        elementData = new gradientConstructor(this, data, styleOb);
+        this.globalData.defs.appendChild(elementData.gf);
+        if (elementData.maskId) {
+            this.globalData.defs.appendChild(elementData.ms);
+            this.globalData.defs.appendChild(elementData.of);
+            pathElement.setAttribute('mask','url(#' + elementData.maskId + ')');
+        }
+    }
+    
+    if(data.ty === 'st' || data.ty === 'gs') {
+        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
+        pathElement.setAttribute('fill-opacity','0');
+        if(data.lj === 1) {
+            pathElement.setAttribute('stroke-miterlimit',data.ml);
+        }
+    }
+
+    if(data.r === 2) {
+        pathElement.setAttribute('fill-rule', 'evenodd');
+    }
+
+    this.stylesList.push(styleOb);
+    this.addToAnimatedContents(data, elementData);
+    return elementData;
+};
+
+PIXIShapeElement.prototype.createGroupElement = function(data) {
+    var elementData = {
+        it: [],
+        prevViewData: [],
+        gr: new PIXI.DisplayObjectContainer()
+    }
+    return elementData;
+};
+
+PIXIShapeElement.prototype.createTransformElement = function(data, container) {
+    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
+    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+    this.addToAnimatedContents(data, elementData);
+    return elementData;
+};
+
+PIXIShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
+    var ty = 4;
+    if(data.ty === 'rc'){
+        ty = 5;
+    }else if(data.ty === 'el'){
+        ty = 6;
+    }else if(data.ty === 'sr'){
+        ty = 7;
+    }
+    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
+    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+    this.shapes.push(elementData);
+    this.addShapeToModifiers(elementData);
+    this.addToAnimatedContents(data, elementData);
+    return elementData;
+};
+
+PIXIShapeElement.prototype.addToAnimatedContents = function(data, element) {
+    var i = 0, len = this.animatedContents.length;
+    while(i < len) {
+        if(this.animatedContents[i].element === element) {
+            return;
+        }
+        i += 1;
+    }
+    this.animatedContents.push({
+        fn: PIXIElementsRenderer.createRenderFunction(data),
+        element: element,
+        data: data
+    });
+};
+
+PIXIShapeElement.prototype.setElementStyles = function(elementData){
+    var arr = elementData.styles;
+    var j, jLen = this.stylesList.length;
+    for (j = 0; j < jLen; j += 1) {
+        if (!this.stylesList[j].closed) {
+            arr.push(this.stylesList[j]);
+        }
     }
 };
 
-PIXIShapeElement.prototype.searchShapes = function(arr,data,container,PContainer,dynamicProperties, level){
+PIXIShapeElement.prototype.reloadShapes = function(){
+    this._isFirstFrame = true;
+    var i, len = this.itemsData.length;
+    for( i = 0; i < len; i += 1) {
+        this.prevViewData[i] = this.itemsData[i];
+    }
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
+    this.filterUniqueShapes();
+    len = this.dynamicProperties.length;
+    for(i = 0; i < len; i += 1) {
+        this.dynamicProperties[i].getValue();
+    }
+    this.renderModifiers();
+};
+
+PIXIShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
+    var ownTransformers = [].concat(transformers);
+    var i, len = arr.length - 1;
+    var j, jLen;
+    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
+    for(i=len;i>=0;i-=1){
+        processedPos = this.searchProcessedElement(arr[i]);
+        if(!processedPos){
+            arr[i]._render = render;
+        } else {
+            itemsData[i] = prevViewData[processedPos - 1];
+        }
+        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
+            if(!processedPos){
+                itemsData[i] = this.createStyleElement(arr[i], level);
+            } else {
+                itemsData[i].style.closed = false;
+            }
+            if(arr[i]._render){
+                container.addChild(itemsData[i].style.PpElem);
+            }
+            ownStyles.push(itemsData[i].style);
+        }else if(arr[i].ty == 'gr'){
+            if(!processedPos){
+                itemsData[i] = this.createGroupElement(arr[i]);
+            } else {
+                jLen = itemsData[i].it.length;
+                for(j=0;j<jLen;j+=1){
+                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
+                }
+            }
+            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
+            if(arr[i]._render){
+                container.addChild(itemsData[i].gr);
+            }
+        }else if(arr[i].ty == 'tr'){
+            if(!processedPos){
+                itemsData[i] = this.createTransformElement(arr[i], container);
+            }
+            currentTransform = itemsData[i].transform;
+            ownTransformers.push(currentTransform);
+        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
+            if(!processedPos){
+                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+            }
+            this.setElementStyles(itemsData[i]);
+
+        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms'){
+            if(!processedPos){
+                modifier = ShapeModifiers.getModifier(arr[i].ty);
+                modifier.init(this,arr[i]);
+                itemsData[i] = modifier;
+                this.shapeModifiers.push(modifier);
+            } else {
+                modifier = itemsData[i];
+                modifier.closed = false;
+            }
+            ownModifiers.push(modifier);
+        }else if(arr[i].ty == 'rp'){
+            if(!processedPos){
+                modifier = ShapeModifiers.getModifier(arr[i].ty);
+                itemsData[i] = modifier;
+                modifier.init(this,arr,i,itemsData);
+                this.shapeModifiers.push(modifier);
+                render = false;
+            }else{
+                modifier = itemsData[i];
+                modifier.closed = true;
+            }
+            ownModifiers.push(modifier);
+        }
+        this.addProcessedElement(arr[i], i + 1);
+    }
+    len = ownStyles.length;
+    for(i=0;i<len;i+=1){
+        ownStyles[i].closed = true;
+    }
+    len = ownModifiers.length;
+    for(i=0;i<len;i+=1){
+        ownModifiers[i].closed = true;
+    }
+};
+
+PIXIShapeElement.prototype.drawShapeCommands = function(styleData) {
+    var shapeCommands = styleData.PD, PIXIElem = styleData.PpElem;
+    PIXIElem.clear();
+    if(styleData._styleType === 'fill') {
+        PIXIElem.beginFill(styleData._styleColor);
+    } else if(styleData._styleType === 'stroke') {
+        PIXIElem.lineStyle(styleData._styleWidth,styleData._styleColor);
+    }
+    var i, len = shapeCommands.length;
+    for(i = 0; i < len; i += 1) {
+        if(shapeCommands[i].t === 'm'){
+            PIXIElem.moveTo(shapeCommands[i].c[0],shapeCommands[i].c[1]);
+        } else {
+            PIXIElem.bezierCurveTo(shapeCommands[i].c[0],shapeCommands[i].c[1],shapeCommands[i].c[3],shapeCommands[i].c[4],shapeCommands[i].c[6],shapeCommands[i].c[7]);
+        }
+    }
+    if(styleData._styleType === 'fill') {
+        PIXIElem.endFill();
+    } else if(styleData._styleType === 'stroke') {
+        //TODO: search iff stroke needs to be ended
+    }
+}
+
+PIXIShapeElement.prototype.renderInnerContent = function() {
+    this.renderModifiers();
+    var i, len = this.stylesList.length;
+    for(i=0;i<len;i+=1){
+        this.stylesList[i].reset();
+    }
+    this.renderShape();
+
+    for (i = 0; i < len; i += 1) {
+        if (this.stylesList[i]._mdf || this._isFirstFrame) {
+            if(this.stylesList[i].msElem){
+                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+                //Adding M0 0 fixes same mask bug on all browsers
+                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+            }
+            this.drawShapeCommands(this.stylesList[i]);
+            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
+        }
+    }
+};
+
+PIXIShapeElement.prototype.renderShape = function() {
+    var i, len = this.animatedContents.length;
+    var animatedContent;
+    for(i = 0; i < len; i += 1) {
+        animatedContent = this.animatedContents[i];
+        if(this._isFirstFrame || animatedContent.element._isAnimated) {
+            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
+        }
+    }
+}
+
+PIXIShapeElement.prototype.destroy = function(){
+    this.destroyBaseElement();
+    this.shapeData = null;
+    this.itemsData = null;
+};
+
+
+
+
+
+
+PIXIShapeElement.prototype.searchShapess = function(arr,itemsData,prevViewData,container, level, transformers, render){
     var i, len = arr.length - 1;
     var j, jLen;
     var ownArrays = [], ownModifiers = [], styleOb, currentTransform;
@@ -248,398 +493,3 @@
         ownModifiers[i].closed = true;
     }
 };
-
-PIXIShapeElement.prototype.addShapeToModifiers = function(data) {
-    var i, len = this.shapeModifiers.length;
-    for(i=0;i<len;i+=1){
-        this.shapeModifiers[i].addShape(data);
-    }
-};
-
-PIXIShapeElement.prototype.renderModifiers = function() {
-    if(!this.shapeModifiers.length){
-        return;
-    }
-    var i, len = this.shapes.length;
-    for(i=0;i<len;i+=1){
-        this.shapes[i].reset();
-    }
-
-
-    len = this.shapeModifiers.length;
-
-    for(i=len-1;i>=0;i-=1){
-        this.shapeModifiers[i].processShapes(this.firstFrame);
-    }
-};
-
-PIXIShapeElement.prototype.renderFrame = function(parentMatrix){
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
-    }
-    this.PLayerElement.visible = true;
-    this.globalToLocal([0,0,0]);
-
-    this.hidden = false;
-    this.renderModifiers();
-    this.renderShape(null,null,true, null);
-};
-
-PIXIShapeElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.PLayerElement.visible = false;
-        var i, len = this.stylesList.length;
-        for(i=len-1;i>=0;i-=1){
-            if(this.stylesList[i].ld !== '0'){
-                this.stylesList[i].ld = '0';
-                this.stylesList[i].pElem.style.display = 'none';
-                if(this.stylesList[i].pElem.parentNode){
-                    this.stylesList[i].parent = this.stylesList[i].pElem.parentNode;
-                    //this.stylesList[i].pElem.parentNode.removeChild(this.stylesList[i].pElem);
-                }
-            }
-        }
-        this.hidden = true;
-    }
-};
-
-PIXIShapeElement.prototype.renderShape = function(items,data,isMain, container,PContainer){
-    var i, len;
-    if(!items){
-        items = this.shapesData;
-        len = this.stylesList.length;
-        for(i=0;i<len;i+=1){
-            // this.stylesList[i].d = '';
-            this.stylesList[i].PD.length = 0;
-            this.stylesList[i].mdf = false;
-        }
-    }
-    if(!data){
-        data = this.viewData;
-    }
-    ///
-    ///
-    len = items.length - 1;
-    var ty;
-    for(i=len;i>=0;i-=1){
-        ty = items[i].ty;
-        if(ty == 'tr'){
-            if(this.firstFrame || data[i].transform.op.mdf && container){
-                container.setAttribute('opacity',data[i].transform.op.v);
-                PContainer.alpha = data[i].transform.op.v;
-            }
-            if(this.firstFrame || data[i].transform.mProps.mdf && container){
-                container.setAttribute('transform',data[i].transform.mProps.v.to2dCSS());
-                var props = data[i].transform.mProps.v.props;
-                var mt = new PIXI.Matrix();
-                mt.a = props[0];
-                mt.b = props[1];
-                mt.c = props[4];
-                mt.d = props[5];
-                mt.tx = props[12];
-                mt.ty = props[13];
-                PContainer.transform.setFromMatrix(mt);
-            }
-        }else if(ty == 'sh' || ty == 'el' || ty == 'rc' || ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(ty == 'fl'){
-            this.renderFill(items[i],data[i]);
-        }else if(ty == 'gf'){
-            this.renderGradient(items[i],data[i]);
-        }else if(ty == 'gs'){
-            this.renderGradient(items[i],data[i]);
-            this.renderStroke(items[i],data[i]);
-        }else if(ty == 'st'){
-            this.renderStroke(items[i],data[i]);
-        }else if(ty == 'gr'){
-            this.renderShape(items[i].it,data[i].it,false, data[i].gr, data[i].PGr);
-        }else if(ty == 'tm'){
-            //
-        }
-    }
-    if(isMain) {
-        len = this.stylesList.length;
-        for (i = 0; i < len; i += 1) {
-            if (this.stylesList[i].ld === '0') {
-                this.stylesList[i].ld = '1';
-                // this.stylesList[i].pElem.style.display = 'block';
-                //this.stylesList[i].parent.appendChild(this.stylesList[i].pElem);
-            }
-            if (this.stylesList[i].mdf || this.firstFrame) {
-                // this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d);
-                // if(this.stylesList[i].msElem){
-                //     this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                // }
-            }
-            var j, jLen = this.stylesList[i].PD.length;
-            for(j=0;j<jLen;j+=1){
-                if(this.stylesList[i].PD[j].t === 'm'){
-                    this.stylesList[i].PPElem.moveTo(this.stylesList[i].PD[j].c[0],this.stylesList[i].PD[j].c[1]);
-                } else {
-                    this.stylesList[i].PPElem.bezierCurveTo(this.stylesList[i].PD[j].c[0],this.stylesList[i].PD[j].c[1],this.stylesList[i].PD[j].c[2],this.stylesList[i].PD[j].c[3],this.stylesList[i].PD[j].c[4],this.stylesList[i].PD[j].c[5]);
-                }
-            }
-            this.stylesList[i].PPElem.endFill();
-            //this.stylesList[i].PPElem
-        }
-        if (this.firstFrame) {
-            this.firstFrame = false;
-        }
-    }
-
-};
-
-PIXIShapeElement.prototype.renderPath = function(pathData,viewData){
-    var len, i, j, jLen,pathStringTransformed,PPathString,redraw,pathNodes,l, lLen = viewData.elements.length;
-    var lvl = viewData.lvl;
-    for(l=0;l<lLen;l+=1){
-        redraw = viewData.sh.mdf || this.firstFrame;
-        pathStringTransformed = '';
-        PPathString = [];
-        var paths = viewData.sh.paths;
-        jLen = paths._length;
-        var PMatPoint,PMatPointI,PMatPointO;
-        if(viewData.elements[l].st.lvl < lvl){
-            var mat = this.mHelper.reset(), props;
-            var k, kLen = viewData.elements[l].st.lvl;
-            for(k=lvl-1;k>=kLen;k-=1){
-                redraw = viewData.elements[l].st.transformers[k - kLen].mProps.mdf || redraw;
-                props = viewData.elements[l].st.transformers[k - kLen].mProps.v.props;
-                mat.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
-            }
-            if(redraw){
-                for(j=0;j<jLen;j+=1){
-                    pathNodes = paths.shapes[j];
-                    if(pathNodes && pathNodes.v){
-                        len = pathNodes.v.length;
-                        for (i = 1; i < len; i += 1) {
-                            if (i == 1) {
-                                // pathStringTransformed += " M" + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                                PMatPoint = mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1],0);
-                                PPathString.push({
-                                    t:'m',
-                                    c:[PMatPoint[0], PMatPoint[1]]
-                                })
-                            }
-                            // pathStringTransformed += " C" + mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + mat.applyToPointStringified(pathNodes.i[i][0], pathNodes.i[i][1]) + " " + mat.applyToPointStringified(pathNodes.v[i][0], pathNodes.v[i][1]);
-                            PMatPoint = mat.applyToPointArray(pathNodes.v[i][0], pathNodes.v[i][1],0);
-                            PMatPointO = mat.applyToPointArray(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1],0);
-                            PMatPointI = mat.applyToPointArray(pathNodes.i[i][0], pathNodes.i[i][1],0);
-                            PPathString.push({
-                                t:'c',
-                                c:[PMatPointO[0], PMatPointO[1],PMatPointI[0], PMatPointI[1],PMatPoint[0], PMatPoint[1]]
-                            })
-                        }
-                        if (len == 1) {
-                            // pathStringTransformed += " M" + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            PMatPoint = mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1],0);
-                            PPathString.push({
-                                t:'m',
-                                c:[PMatPoint[0], PMatPoint[1]]
-                            })
-                        }
-                        if (pathNodes.c) {
-                            // pathStringTransformed += " C" + mat.applyToPointStringified(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1]) + " " + mat.applyToPointStringified(pathNodes.i[0][0], pathNodes.i[0][1]) + " " + mat.applyToPointStringified(pathNodes.v[0][0], pathNodes.v[0][1]);
-                            // pathStringTransformed += 'z';
-                            PMatPoint = mat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1],0);
-                            PMatPointO = mat.applyToPointArray(pathNodes.o[i - 1][0], pathNodes.o[i - 1][1],0);
-                            PMatPointI = mat.applyToPointArray(pathNodes.i[0][0], pathNodes.i[0][1],0);
-                            PPathString.push({
-                                t:'c',
-                                c:[PMatPointO[0], PMatPointO[1],PMatPointI[0], PMatPointI[1],PMatPoint[0], PMatPoint[1]]
-                            });
-                        }
-                    }
-                }
-                // viewData.caches[l] = pathStringTransformed;
-                viewData.PCaches[l] = PPathString;
-            } else {
-                // pathStringTransformed = viewData.caches[l];
-                PPathString = viewData.PCaches[l];
-            }
-        } else {
-            if(redraw){
-                for(j=0;j<jLen;j+=1){
-                    pathNodes = paths.shapes[j];
-                    if(pathNodes && pathNodes._length){
-                        len = pathNodes._length;
-                        for (i = 1; i < len; i += 1) {
-                            if (i == 1) {
-                                // pathStringTransformed += " M" + pathNodes.v[0].join(',');
-                                PPathString.push({
-                                    t:'m',
-                                    c:[pathNodes.v[0][0], pathNodes.v[0][1]]
-                                })
-                            }
-                            // pathStringTransformed += " C" + pathNodes.o[i - 1].join(',') + " " + pathNodes.i[i].join(',') + " " + pathNodes.v[i].join(',');
-                            PPathString.push({
-                                t:'c',
-                                c:[pathNodes.o[i - 1][0], pathNodes.o[i - 1][1],pathNodes.i[i][0], pathNodes.i[i][1],pathNodes.v[i][0], pathNodes.v[i][1]]
-                            })
-                        }
-                        if (len == 1) {
-                            // pathStringTransformed += " M" + pathNodes.v[0].join(',');
-                            PPathString.push({
-                                t:'m',
-                                c:[pathNodes.v[0][0], pathNodes.v[0][1]]
-                            })
-                        }
-                        if (pathNodes.c) {
-                            // pathStringTransformed += " C" + pathNodes.o[i - 1].join(',') + " " + pathNodes.i[0].join(',') + " " + pathNodes.v[0].join(',');
-                            // pathStringTransformed += 'z';
-                            PPathString.push({
-                                t:'c',
-                                c:[pathNodes.o[i - 1][0], pathNodes.o[i - 1][1],pathNodes.i[0][0], pathNodes.i[0][1],pathNodes.v[0][0], pathNodes.v[0][1]]
-                            })
-                        }
-                    }
-                }
-                viewData.caches[l] = pathStringTransformed;
-                viewData.PCaches[l] = PPathString;
-            } else {
-                pathStringTransformed = viewData.caches[l];
-                PPathString = viewData.PCaches[l];
-            }
-        }
-        if(PPathString.length === 2 && PPathString[0].c[0] === PPathString[1].c[0] && PPathString[0].c[1] === PPathString[1].c[1]
-            && PPathString[0].c[0] === PPathString[1].c[2] && PPathString[0].c[1] === PPathString[1].c[3]
-            && PPathString[0].c[0] === PPathString[1].c[4] && PPathString[0].c[1] === PPathString[1].c[5]){
-            PPathString[1].c[4] += 0.1;
-            PPathString[1].c[5] += 0.1;
-        }
-        //viewData.elements[l].st.d += pathStringTransformed;
-        viewData.elements[l].st.PD = viewData.elements[l].st.PD.concat(PPathString);
-        viewData.elements[l].st.mdf = redraw || viewData.elements[l].st.mdf;
-    }
-
-};
-
-PIXIShapeElement.prototype.renderFill = function(styleData,viewData){
-    var styleElem = viewData.style;
-
-    // if(viewData.c.mdf || this.firstFrame){
-    //     styleElem.pElem.setAttribute('fill','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-    // }
-    styleElem.PPElem.clear();
-    styleElem.PPElem.beginFill(rgbToHex(bm_floor(viewData.c.v[0]),bm_floor(viewData.c.v[1]),bm_floor(viewData.c.v[2]),'0x'));
-    // if(viewData.o.mdf || this.firstFrame){
-    //     styleElem.pElem.setAttribute('fill-opacity',viewData.o.v);
-    // }
-};
-
-PIXIShapeElement.prototype.renderGradient = function(styleData,viewData){
-    var gfill = viewData.gf;
-    var opFill = viewData.of;
-    var pt1 = viewData.s.v,pt2 = viewData.e.v;
-
-    if(viewData.o.mdf || this.firstFrame){
-        var attr = styleData.ty === 'gf' ? 'fill-opacity':'stroke-opacity';
-        viewData.elem.setAttribute(attr,viewData.o.v);
-    }
-    //clippedElement.setAttribute('transform','matrix(1,0,0,1,-100,0)');
-    if(viewData.s.mdf || this.firstFrame){
-        var attr1 = styleData.t === 1 ? 'x1':'cx';
-        var attr2 = attr1 === 'x1' ? 'y1':'cy';
-        gfill.setAttribute(attr1,pt1[0]);
-        gfill.setAttribute(attr2,pt1[1]);
-        if(opFill){
-            opFill.setAttribute(attr1,pt1[0]);
-            opFill.setAttribute(attr2,pt1[1]);
-        }
-    }
-    var stops, i, len, stop;
-    if(viewData.g.cmdf || this.firstFrame){
-        stops = viewData.cst;
-        var cValues = viewData.g.c;
-        len = stops.length;
-        for(i=0;i<len;i+=1){
-            stop = stops[i];
-            stop.setAttribute('offset',cValues[i*4]+'%');
-            stop.setAttribute('stop-color','rgb('+cValues[i*4+1]+','+cValues[i*4+2]+','+cValues[i*4+3]+')');
-        }
-    }
-    if(opFill && (viewData.g.omdf || this.firstFrame)){
-        stops = viewData.ost;
-        var oValues = viewData.g.o;
-        len = stops.length;
-        for(i=0;i<len;i+=1){
-            stop = stops[i];
-            stop.setAttribute('offset',oValues[i*2]+'%');
-            stop.setAttribute('stop-opacity',oValues[i*2+1]);
-        }
-    }
-    if(styleData.t === 1){
-        if(viewData.e.mdf  || this.firstFrame){
-            gfill.setAttribute('x2',pt2[0]);
-            gfill.setAttribute('y2',pt2[1]);
-            if(opFill){
-                opFill.setAttribute('x2',pt2[0]);
-                opFill.setAttribute('y2',pt2[1]);
-            }
-        }
-    } else {
-        var rad;
-        if(viewData.s.mdf || viewData.e.mdf || this.firstFrame){
-            rad = Math.sqrt(Math.pow(pt1[0]-pt2[0],2)+Math.pow(pt1[1]-pt2[1],2));
-            gfill.setAttribute('r',rad);
-            if(opFill){
-                opFill.setAttribute('r',rad);
-            }
-        }
-        if(viewData.e.mdf || viewData.h.mdf || viewData.a.mdf || this.firstFrame){
-            if(!rad){
-                rad = Math.sqrt(Math.pow(pt1[0]-pt2[0],2)+Math.pow(pt1[1]-pt2[1],2));
-            }
-            var ang = Math.atan2(pt2[1]-pt1[1], pt2[0]-pt1[0]);
-
-            var percent = viewData.h.v >= 1 ? 0.99 : viewData.h.v <= -1 ? -0.99:viewData.h.v;
-            var dist = rad*percent;
-            var x = Math.cos(ang + viewData.a.v)*dist + pt1[0];
-            var y = Math.sin(ang + viewData.a.v)*dist + pt1[1];
-            gfill.setAttribute('fx',x);
-            gfill.setAttribute('fy',y);
-            if(opFill){
-                opFill.setAttribute('fx',x);
-                opFill.setAttribute('fy',y);
-            }
-        }
-        //gfill.setAttribute('fy','200');
-    }
-};
-
-PIXIShapeElement.prototype.renderStroke = function(styleData,viewData){
-    var styleElem = viewData.style;
-    //TODO fix dashes
-    var d = viewData.d;
-    var dasharray,dashoffset;
-    // if(d && d.k && (d.mdf || this.firstFrame)){
-    //     styleElem.pElem.setAttribute('stroke-dasharray', d.dasharray);
-    //     ////styleElem.pElem.style.strokeDasharray = d.dasharray;
-    //     styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset);
-    //     ////styleElem.pElem.style.strokeDashoffset = d.dashoffset;
-    // }
-    styleElem.PPElem.clear();
-    // if(viewData.c && (viewData.c.mdf || this.firstFrame)){
-    //     styleElem.pElem.setAttribute('stroke','rgb('+bm_floor(viewData.c.v[0])+','+bm_floor(viewData.c.v[1])+','+bm_floor(viewData.c.v[2])+')');
-    // }
-    // if(viewData.o.mdf || this.firstFrame){
-    //     styleElem.pElem.setAttribute('stroke-opacity',viewData.o.v);
-    // }
-    // if(viewData.w.mdf || this.firstFrame){
-    //     styleElem.pElem.setAttribute('stroke-width',viewData.w.v);
-    //     if(styleElem.msElem){
-    //         styleElem.msElem.setAttribute('stroke-width',viewData.w.v);
-    //     }
-    // }
-    styleElem.PPElem.lineStyle(viewData.w.v,rgbToHex(bm_floor(viewData.c.v[0]),bm_floor(viewData.c.v[1]),bm_floor(viewData.c.v[2]),'0x'));
-};
-
-PIXIShapeElement.prototype.destroy = function(){
-    this._parent.destroy.call();
-    this.shapeData = null;
-    this.viewData = null;
-    this.parentContainer = null;
-    this.placeholder = null;
-};
diff --git a/player/js/elements/pixiElements/PIXISolidElement.js b/player/js/elements/pixiElements/PIXISolidElement.js
index 3c39c5b..9b6af4b 100644
--- a/player/js/elements/pixiElements/PIXISolidElement.js
+++ b/player/js/elements/pixiElements/PIXISolidElement.js
@@ -1,33 +1,24 @@
-function PIXISolidElement(data,parentContainer,globalData,comp, placeholder){
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+function PIXISolidElement(data,globalData,comp){
+    this.initElement(data,globalData,comp);
 }
-createElement(PIXIBaseElement, PIXISolidElement);
+extendPrototype([BaseElement, TransformElement, PIXIBaseElement, HierarchyElement, FrameElement, RenderableElement], PIXISolidElement);
 
-PIXISolidElement.prototype.createElements = function(){
-    this._parent.createElements.call(this);
-
-    var rect = document.createElementNS(svgNS,'rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
-    this.innerElem = rect;
-    if(this.data.ln){
-        this.innerElem.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.innerElem.setAttribute('class',this.data.cl);
-    }
-
+PIXISolidElement.prototype.createContent = function(){
     var graphics = new PIXI.Graphics();
     graphics.beginFill(this.data.sc.replace('#','0x'));
     graphics.drawRect(0, 0, this.data.sw, this.data.sh);
-    this.PLayerElement.addChild(graphics);
+    this.layerElement.addChild(graphics);
 };
 
-PIXISolidElement.prototype.hide = PIXIImageElement.prototype.hide;
-PIXISolidElement.prototype.renderFrame = PIXIImageElement.prototype.renderFrame;
-PIXISolidElement.prototype.destroy = PIXIImageElement.prototype.destroy;
+PIXISolidElement.prototype.initElement = function(data,globalData,comp) {
+    this.initFrame();
+    this.initBaseData(data, globalData, comp);
+    this.initTransform(data, globalData, comp);
+    this.initHierarchy();
+    this.initRenderable();
+    this.initRendererElement();
+    this.createContainerElements();
+    this.addMasks();
+    this.createContent();
+    this.hide();
+}
\ No newline at end of file
diff --git a/player/js/elements/svgElements/SVGBaseElement.js b/player/js/elements/svgElements/SVGBaseElement.js
index aaa344f..02f642d 100644
--- a/player/js/elements/svgElements/SVGBaseElement.js
+++ b/player/js/elements/svgElements/SVGBaseElement.js
@@ -1,300 +1,156 @@
-function SVGBaseElement(data,parentContainer,globalData,comp, placeholder){
-    this.globalData = globalData;
-    this.comp = comp;
-    this.data = data;
-    this.matteElement = null;
-    this.transformedElement = null;
-    this.parentContainer = parentContainer;
-    this.layerId = placeholder ? placeholder.layerId : 'ly_'+randomString(10);
-    this.placeholder = placeholder;
-    this.init();
-};
+function SVGBaseElement(){
+}
 
-createElement(BaseElement, SVGBaseElement);
-
-SVGBaseElement.prototype.createElements = function(){
-    this.layerElement = document.createElementNS(svgNS,'g');
-    this.transformedElement = this.layerElement;
-    if(this.data.hasMask){
+SVGBaseElement.prototype = {
+    initRendererElement: function() {
+        this.layerElement = createNS('g');
+    },
+    createContainerElements: function(){
+        this.matteElement = createNS('g');
+        this.transformedElement = this.layerElement;
         this.maskedElement = this.layerElement;
-    }
-    var layerElementParent = null;
-    if(this.data.td){
-        if(this.data.td == 3 || this.data.td == 1){
-            var masker = document.createElementNS(svgNS,'mask');
-            masker.setAttribute('id',this.layerId);
-            masker.setAttribute('mask-type',this.data.td == 3 ? 'luminance':'alpha');
-            masker.appendChild(this.layerElement);
-            layerElementParent = masker;
-            this.globalData.defs.appendChild(masker);
-            ////// This is only for IE and Edge when mask if of type alpha
-            if(!featureSupport.maskType && this.data.td == 1){
-                masker.setAttribute('mask-type','luminance');
-                var filId = randomString(10);
-                var fil = filtersFactory.createFilter(filId);
+        this._sizeChanged = false;
+        var layerElementParent = null;
+        //If this layer acts as a mask for the following layer
+        var filId, fil, gg;
+        if (this.data.td) {
+            if (this.data.td == 3 || this.data.td == 1) {
+                var masker = createNS('mask');
+                masker.setAttribute('id', this.layerId);
+                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
+                masker.appendChild(this.layerElement);
+                layerElementParent = masker;
+                this.globalData.defs.appendChild(masker);
+                // This is only for IE and Edge when mask if of type alpha
+                if (!featureSupport.maskType && this.data.td == 1) {
+                    masker.setAttribute('mask-type', 'luminance');
+                    filId = randomString(10);
+                    fil = filtersFactory.createFilter(filId);
+                    this.globalData.defs.appendChild(fil);
+                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+                    gg = createNS('g');
+                    gg.appendChild(this.layerElement);
+                    layerElementParent = gg;
+                    masker.appendChild(gg);
+                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
+                }
+            } else if(this.data.td == 2) {
+                var maskGroup = createNS('mask');
+                maskGroup.setAttribute('id', this.layerId);
+                maskGroup.setAttribute('mask-type','alpha');
+                var maskGrouper = createNS('g');
+                maskGroup.appendChild(maskGrouper);
+                filId = randomString(10);
+                fil = filtersFactory.createFilter(filId);
+                ////
+
+                var feColorMatrix = createNS('feColorMatrix');
+                feColorMatrix.setAttribute('type', 'matrix');
+                feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+                feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
+                fil.appendChild(feColorMatrix);
+
+                ////
+                /*var feCTr = createNS('feComponentTransfer');
+                feCTr.setAttribute('in','SourceGraphic');
+                fil.appendChild(feCTr);
+                var feFunc = createNS('feFuncA');
+                feFunc.setAttribute('type','table');
+                feFunc.setAttribute('tableValues','1.0 0.0');
+                feCTr.appendChild(feFunc);*/
                 this.globalData.defs.appendChild(fil);
-                fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                var gg = document.createElementNS(svgNS,'g');
-                gg.appendChild(this.layerElement);
-                layerElementParent = gg;
-                masker.appendChild(gg);
-                gg.setAttribute('filter','url(#'+filId+')');
-            }
-        }else if(this.data.td == 2){
-            var maskGroup = document.createElementNS(svgNS,'mask');
-            maskGroup.setAttribute('id',this.layerId);
-            maskGroup.setAttribute('mask-type','alpha');
-            var maskGrouper = document.createElementNS(svgNS,'g');
-            maskGroup.appendChild(maskGrouper);
-            var filId = randomString(10);
-            var fil = filtersFactory.createFilter(filId);
-            ////
-
-            var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-            feColorMatrix.setAttribute('type','matrix');
-            feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-            feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-            fil.appendChild(feColorMatrix);
-
-            ////
-            /*var feCTr = document.createElementNS(svgNS,'feComponentTransfer');
-            feCTr.setAttribute('in','SourceGraphic');
-            fil.appendChild(feCTr);
-            var feFunc = document.createElementNS(svgNS,'feFuncA');
-            feFunc.setAttribute('type','table');
-            feFunc.setAttribute('tableValues','1.0 0.0');
-            feCTr.appendChild(feFunc);*/
-            this.globalData.defs.appendChild(fil);
-            var alphaRect = document.createElementNS(svgNS,'rect');
-            alphaRect.setAttribute('width',this.comp.data.w);
-            alphaRect.setAttribute('height',this.comp.data.h);
-            alphaRect.setAttribute('x','0');
-            alphaRect.setAttribute('y','0');
-            alphaRect.setAttribute('fill','#ffffff');
-            alphaRect.setAttribute('opacity','0');
-            maskGrouper.setAttribute('filter','url(#'+filId+')');
-            maskGrouper.appendChild(alphaRect);
-            maskGrouper.appendChild(this.layerElement);
-            layerElementParent = maskGrouper;
-            if(!featureSupport.maskType){
-                maskGroup.setAttribute('mask-type','luminance');
-                fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                var gg = document.createElementNS(svgNS,'g');
+                var alphaRect = createNS('rect');
+                alphaRect.setAttribute('width',  this.comp.data.w);
+                alphaRect.setAttribute('height', this.comp.data.h);
+                alphaRect.setAttribute('x','0');
+                alphaRect.setAttribute('y','0');
+                alphaRect.setAttribute('fill','#ffffff');
+                alphaRect.setAttribute('opacity','0');
+                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
                 maskGrouper.appendChild(alphaRect);
-                gg.appendChild(this.layerElement);
-                layerElementParent = gg;
-                maskGrouper.appendChild(gg);
+                maskGrouper.appendChild(this.layerElement);
+                layerElementParent = maskGrouper;
+                if (!featureSupport.maskType) {
+                    maskGroup.setAttribute('mask-type', 'luminance');
+                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+                    gg = createNS('g');
+                    maskGrouper.appendChild(alphaRect);
+                    gg.appendChild(this.layerElement);
+                    layerElementParent = gg;
+                    maskGrouper.appendChild(gg);
+                }
+                this.globalData.defs.appendChild(maskGroup);
             }
-            this.globalData.defs.appendChild(maskGroup);
-        }
-    }else if(this.data.hasMask || this.data.tt){
-        if(this.data.tt){
-            this.matteElement = document.createElementNS(svgNS,'g');
+        } else if (this.data.tt) {
             this.matteElement.appendChild(this.layerElement);
             layerElementParent = this.matteElement;
             this.baseElement = this.matteElement;
-        }else{
+        } else {
             this.baseElement = this.layerElement;
         }
-    }else{
-        this.baseElement = this.layerElement;
-    }
-    if((this.data.ln || this.data.cl) && (this.data.ty === 4 || this.data.ty === 0)){
-        if(this.data.ln){
-            this.layerElement.setAttribute('id',this.data.ln);
+        if (this.data.ln) {
+            this.layerElement.setAttribute('id', this.data.ln);
         }
-        if(this.data.cl){
-            this.layerElement.setAttribute('class',this.data.cl);
+        if (this.data.cl) {
+            this.layerElement.setAttribute('class', this.data.cl);
         }
-    }
-    if(this.data.ty === 0){
-            var cp = document.createElementNS(svgNS, 'clipPath');
-            var pt = document.createElementNS(svgNS,'path');
-            pt.setAttribute('d','M0,0 L'+this.data.w+',0'+' L'+this.data.w+','+this.data.h+' L0,'+this.data.h+'z');
+        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+        if (this.data.ty === 0 && !this.data.hd) {
+            var cp = createNS( 'clipPath');
+            var pt = createNS('path');
+            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
             var clipId = 'cp_'+randomString(8);
             cp.setAttribute('id',clipId);
             cp.appendChild(pt);
             this.globalData.defs.appendChild(cp);
-        if(this.checkMasks()){
-            var cpGroup = document.createElementNS(svgNS,'g');
-            cpGroup.setAttribute('clip-path','url(#'+clipId+')');
-            cpGroup.appendChild(this.layerElement);
-            this.transformedElement = cpGroup;
-            if(layerElementParent){
-                layerElementParent.appendChild(this.transformedElement);
-            } else {
-                this.baseElement = this.transformedElement;
-            }
-        } else {
-            this.layerElement.setAttribute('clip-path','url(#'+clipId+')');
-        }
-        
-    }
-    if(this.data.bm !== 0){
-        this.setBlendMode();
-    }
-    if(this.layerElement !== this.parentContainer){
-        this.placeholder = null;
-    }
-    /* Todo performance killer
-    if(this.data.sy){
-        var filterID = 'st_'+randomString(10);
-        var c = this.data.sy[0].c.k;
-        var r = this.data.sy[0].s.k;
-        var expansor = document.createElementNS(svgNS,'filter');
-        expansor.setAttribute('id',filterID);
-        var feFlood = document.createElementNS(svgNS,'feFlood');
-        this.feFlood = feFlood;
-        if(!c[0].e){
-            feFlood.setAttribute('flood-color','rgb('+c[0]+','+c[1]+','+c[2]+')');
-        }
-        feFlood.setAttribute('result','base');
-        expansor.appendChild(feFlood);
-        var feMorph = document.createElementNS(svgNS,'feMorphology');
-        feMorph.setAttribute('operator','dilate');
-        feMorph.setAttribute('in','SourceGraphic');
-        feMorph.setAttribute('result','bigger');
-        this.feMorph = feMorph;
-        if(!r.length){
-            feMorph.setAttribute('radius',this.data.sy[0].s.k);
-        }
-        expansor.appendChild(feMorph);
-        var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
-        feColorMatrix.setAttribute('result','mask');
-        feColorMatrix.setAttribute('in','bigger');
-        feColorMatrix.setAttribute('type','matrix');
-        feColorMatrix.setAttribute('values','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0');
-        expansor.appendChild(feColorMatrix);
-        var feComposite = document.createElementNS(svgNS,'feComposite');
-        feComposite.setAttribute('result','drop');
-        feComposite.setAttribute('in','base');
-        feComposite.setAttribute('in2','mask');
-        feComposite.setAttribute('operator','in');
-        expansor.appendChild(feComposite);
-        var feBlend = document.createElementNS(svgNS,'feBlend');
-        feBlend.setAttribute('in','SourceGraphic');
-        feBlend.setAttribute('in2','drop');
-        feBlend.setAttribute('mode','normal');
-        expansor.appendChild(feBlend);
-        this.globalData.defs.appendChild(expansor);
-        var cont = document.createElementNS(svgNS,'g');
-        if(this.layerElement === this.parentContainer){
-            this.layerElement = cont;
-        }else{
-            cont.appendChild(this.layerElement);
-        }
-        cont.setAttribute('filter','url(#'+filterID+')');
-        if(this.data.td){
-            cont.setAttribute('data-td',this.data.td);
-        }
-        if(this.data.td == 3){
-            this.globalData.defs.appendChild(cont);
-        }else if(this.data.td == 2){
-            maskGrouper.appendChild(cont);
-        }else if(this.data.td == 1){
-            masker.appendChild(cont);
-        }else{
-            if(this.data.hasMask && this.data.tt){
-                this.matteElement.appendChild(cont);
-            }else{
-                this.appendNodeToParent(cont);
-            }
-        }
-    }*/
-    if(this.data.ef){
-        this.effectsManager = new SVGEffects(this);
-    }
-    this.checkParenting();
-};
 
-
-SVGBaseElement.prototype.setBlendMode = BaseElement.prototype.setBlendMode;
-
-SVGBaseElement.prototype.renderFrame = function(parentTransform){
-    if(this.data.ty === 3 || this.data.hd || !this.isVisible){
-        return false;
-    }
-
-    this.lastNum = this.currentFrameNum;
-    this.finalTransform.opMdf = this.firstFrame || this.finalTransform.op.mdf;
-    this.finalTransform.matMdf = this.firstFrame || this.finalTransform.mProp.mdf;
-    this.finalTransform.opacity = this.finalTransform.op.v;
-
-    var mat;
-    var finalMat = this.finalTransform.mat;
-
-    if(this.hierarchy){
-        var i = 0, len = this.hierarchy.length;
-        if(!this.finalTransform.matMdf) {
-            while(i < len) {
-                if(this.hierarchy[i].finalTransform.mProp.mdf) {
-                    this.finalTransform.matMdf = true;
-                    break;
+            if (this.checkMasks()) {
+                var cpGroup = createNS('g');
+                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
+                cpGroup.appendChild(this.layerElement);
+                this.transformedElement = cpGroup;
+                if (layerElementParent) {
+                    layerElementParent.appendChild(this.transformedElement);
+                } else {
+                    this.baseElement = this.transformedElement;
                 }
-                i += 1;
+            } else {
+                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
             }
+            
         }
-        
-        if(this.finalTransform.matMdf) {
-            mat = this.finalTransform.mProp.v.props;
-            finalMat.cloneFromProps(mat);
-            for(i=0;i<len;i+=1){
-                mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                finalMat.transform(mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8],mat[9],mat[10],mat[11],mat[12],mat[13],mat[14],mat[15]);
-            }
+        if (this.data.bm !== 0) {
+            this.setBlendMode();
         }
-        
-    }else if(this.isVisible){
-        finalMat = this.finalTransform.mProp.v;
-    }
-    if(this.finalTransform.matMdf && this.layerElement){
-        this.transformedElement.setAttribute('transform',finalMat.to2dCSS());
-    }
-    if(this.finalTransform.opMdf && this.layerElement){
-        this.transformedElement.setAttribute('opacity',this.finalTransform.op.v);
-    }
+        this.renderableEffectsManager = new SVGEffects(this);
 
-    if(this.data.hasMask){
-        this.maskManager.renderFrame(finalMat);
-    }
-    if(this.effectsManager){
-        this.effectsManager.renderFrame(this.firstFrame);
-    }
-    return this.isVisible;
-};
-
-SVGBaseElement.prototype.destroy = function(){
-    this.layerElement = null;
-    this.parentContainer = null;
-    if(this.matteElement) {
+    },
+    renderElement: function() {
+        if (this.finalTransform._matMdf) {
+            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+        }
+        if (this.finalTransform._opMdf) {
+            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+        }
+    },
+    destroyBaseElement: function() {
+        this.layerElement = null;
         this.matteElement = null;
-    }
-    if(this.maskManager) {
         this.maskManager.destroy();
+    },
+    getBaseElement: function() {
+        if (this.data.hd) {
+            return null;
+        }
+        return this.baseElement;
+    },
+    addMasks: function() {
+        this.maskManager = new MaskElement(this.data, this, this.globalData);
+    },
+    setMatte: function(id) {
+        if (!this.matteElement) {
+            return;
+        }
+        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
     }
-};
-
-SVGBaseElement.prototype.getBaseElement = function(){
-    return this.baseElement;
-};
-SVGBaseElement.prototype.addMasks = function(data){
-    this.maskManager = new MaskElement(data,this,this.globalData);
-};
-
-SVGBaseElement.prototype.setMatte = function(id){
-    if(!this.matteElement){
-        return;
-    }
-    this.matteElement.setAttribute("mask", "url(#" + id + ")");
-};
-
-SVGBaseElement.prototype.setMatte = function(id){
-    if(!this.matteElement){
-        return;
-    }
-    this.matteElement.setAttribute("mask", "url(#" + id + ")");
-};
-
-SVGBaseElement.prototype.hide = function(){
-
-};
+};
\ No newline at end of file
diff --git a/player/js/elements/svgElements/SVGCompElement.js b/player/js/elements/svgElements/SVGCompElement.js
new file mode 100644
index 0000000..e264f84
--- /dev/null
+++ b/player/js/elements/svgElements/SVGCompElement.js
@@ -0,0 +1,12 @@
+function SVGCompElement(data,globalData,comp){
+    this.layers = data.layers;
+    this.supports3d = true;
+    this.completeLayers = false;
+    this.pendingElements = [];
+    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+    //this.layerElement = createNS('g');
+    this.initElement(data,globalData,comp);
+    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+}
+
+extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
\ No newline at end of file
diff --git a/player/js/elements/svgElements/SVGEffects.js b/player/js/elements/svgElements/SVGEffects.js
index e8e63e0..122779c 100644
--- a/player/js/elements/svgElements/SVGEffects.js
+++ b/player/js/elements/svgElements/SVGEffects.js
@@ -1,45 +1,49 @@
 function SVGEffects(elem){
-    var i, len = elem.data.ef.length;
+    var i, len = elem.data.ef ? elem.data.ef.length : 0;
     var filId = randomString(10);
     var fil = filtersFactory.createFilter(filId);
     var count = 0;
     this.filters = [];
     var filterManager;
     for(i=0;i<len;i+=1){
+        filterManager = null;
         if(elem.data.ef[i].ty === 20){
             count += 1;
-            filterManager = new SVGTintFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
+            filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
         }else if(elem.data.ef[i].ty === 21){
             count += 1;
-            filterManager = new SVGFillFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
+            filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
         }else if(elem.data.ef[i].ty === 22){
-            filterManager = new SVGStrokeEffect(elem, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
+            filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
         }else if(elem.data.ef[i].ty === 23){
             count += 1;
-            filterManager = new SVGTritoneFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
+            filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
         }else if(elem.data.ef[i].ty === 24){
             count += 1;
-            filterManager = new SVGProLevelsFilter(fil, elem.effects.effectElements[i]);
-            this.filters.push(filterManager);
+            filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
         }else if(elem.data.ef[i].ty === 25){
             count += 1;
-            filterManager = new SVGDropShadowEffect(fil, elem.effects.effectElements[i]);
+            filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
+        }else if(elem.data.ef[i].ty === 28){
+            //count += 1;
+            filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
+        }
+        if(filterManager) {
             this.filters.push(filterManager);
         }
     }
     if(count){
         elem.globalData.defs.appendChild(fil);
-        elem.layerElement.setAttribute('filter','url(#'+filId+')');
+        elem.layerElement.setAttribute('filter','url(' + locationHref + '#'+filId+')');
+    }
+    if (this.filters.length) {
+        elem.addRenderableComponent(this);
     }
 }
 
-SVGEffects.prototype.renderFrame = function(firstFrame){
+SVGEffects.prototype.renderFrame = function(_isFirstFrame){
     var i, len = this.filters.length;
     for(i=0;i<len;i+=1){
-        this.filters[i].renderFrame(firstFrame);
+        this.filters[i].renderFrame(_isFirstFrame);
     }
 };
\ No newline at end of file
diff --git a/player/js/elements/svgElements/SVGShapeElement.js b/player/js/elements/svgElements/SVGShapeElement.js
new file mode 100644
index 0000000..a2bddbb
--- /dev/null
+++ b/player/js/elements/svgElements/SVGShapeElement.js
@@ -0,0 +1,305 @@
+function SVGShapeElement(data,globalData,comp){
+    //List of drawable elements
+    this.shapes = [];
+    // Full shape data
+    this.shapesData = data.shapes;
+    //List of styles that will be applied to shapes
+    this.stylesList = [];
+    //List of modifiers that will be applied to shapes
+    this.shapeModifiers = [];
+    //List of items in shape tree
+    this.itemsData = [];
+    //List of items in previous shape tree
+    this.processedElements = [];
+    // List of animated components
+    this.animatedContents = [];
+    this.initElement(data,globalData,comp);
+    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
+    // List of elements that have been created
+    this.prevViewData = [];
+    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
+}
+
+extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
+
+SVGShapeElement.prototype.initSecondaryElement = function() {
+};
+
+SVGShapeElement.prototype.identityMatrix = new Matrix();
+
+SVGShapeElement.prototype.buildExpressionInterface = function(){};
+
+SVGShapeElement.prototype.createContent = function(){
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
+    this.filterUniqueShapes();
+};
+
+/*
+This method searches for multiple shapes that affect a single element and one of them is animated
+*/
+SVGShapeElement.prototype.filterUniqueShapes = function(){
+    var i, len = this.shapes.length, shape;
+    var j, jLen = this.stylesList.length;
+    var style, count = 0;
+    var tempShapes = [];
+    var areAnimated = false;
+    for(j = 0; j < jLen; j += 1) {
+        style = this.stylesList[j];
+        areAnimated = false;
+        tempShapes.length = 0;
+        for(i = 0; i < len; i += 1) {
+            shape = this.shapes[i];
+            if(shape.styles.indexOf(style) !== -1) {
+                tempShapes.push(shape);
+                areAnimated = shape._isAnimated || areAnimated;
+            }
+        }
+        if(tempShapes.length > 1 && areAnimated) {
+            this.setShapesAsAnimated(tempShapes);
+        }
+    }
+}
+
+SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
+    var i, len = shapes.length;
+    for(i = 0; i < len; i += 1) {
+        shapes[i].setAsAnimated();
+    }
+}
+
+SVGShapeElement.prototype.createStyleElement = function(data, level){
+    //TODO: prevent drawing of hidden styles
+    var elementData;
+    var styleOb = new SVGStyleData(data, level);
+
+    var pathElement = styleOb.pElem;
+    if(data.ty === 'st') {
+        elementData = new SVGStrokeStyleData(this, data, styleOb);
+    } else if(data.ty === 'fl') {
+        elementData = new SVGFillStyleData(this, data, styleOb);
+    } else if(data.ty === 'gf' || data.ty === 'gs') {
+        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+        elementData = new gradientConstructor(this, data, styleOb);
+        this.globalData.defs.appendChild(elementData.gf);
+        if (elementData.maskId) {
+            this.globalData.defs.appendChild(elementData.ms);
+            this.globalData.defs.appendChild(elementData.of);
+            pathElement.setAttribute('mask','url(#' + elementData.maskId + ')');
+        }
+    }
+    
+    if(data.ty === 'st' || data.ty === 'gs') {
+        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
+        pathElement.setAttribute('fill-opacity','0');
+        if(data.lj === 1) {
+            pathElement.setAttribute('stroke-miterlimit',data.ml);
+        }
+    }
+
+    if(data.r === 2) {
+        pathElement.setAttribute('fill-rule', 'evenodd');
+    }
+
+    if(data.ln){
+        pathElement.setAttribute('id',data.ln);
+    }
+    if(data.cl){
+        pathElement.setAttribute('class',data.cl);
+    }
+    this.stylesList.push(styleOb);
+    this.addToAnimatedContents(data, elementData);
+    return elementData;
+};
+
+SVGShapeElement.prototype.createGroupElement = function(data) {
+    var elementData = new ShapeGroupData();
+    if(data.ln){
+        elementData.gr.setAttribute('id',data.ln);
+    }
+    return elementData;
+};
+
+SVGShapeElement.prototype.createTransformElement = function(data, container) {
+    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
+    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+    this.addToAnimatedContents(data, elementData);
+    return elementData;
+};
+
+SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
+    var ty = 4;
+    if(data.ty === 'rc'){
+        ty = 5;
+    }else if(data.ty === 'el'){
+        ty = 6;
+    }else if(data.ty === 'sr'){
+        ty = 7;
+    }
+    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
+    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+    this.shapes.push(elementData);
+    this.addShapeToModifiers(elementData);
+    this.addToAnimatedContents(data, elementData);
+    return elementData;
+};
+
+SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
+    var i = 0, len = this.animatedContents.length;
+    while(i < len) {
+        if(this.animatedContents[i].element === element) {
+            return;
+        }
+        i += 1;
+    }
+    this.animatedContents.push({
+        fn: SVGElementsRenderer.createRenderFunction(data),
+        element: element,
+        data: data
+    });
+};
+
+SVGShapeElement.prototype.setElementStyles = function(elementData){
+    var arr = elementData.styles;
+    var j, jLen = this.stylesList.length;
+    for (j = 0; j < jLen; j += 1) {
+        if (!this.stylesList[j].closed) {
+            arr.push(this.stylesList[j]);
+        }
+    }
+};
+
+SVGShapeElement.prototype.reloadShapes = function(){
+    this._isFirstFrame = true;
+    var i, len = this.itemsData.length;
+    for( i = 0; i < len; i += 1) {
+        this.prevViewData[i] = this.itemsData[i];
+    }
+    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
+    this.filterUniqueShapes();
+    len = this.dynamicProperties.length;
+    for(i = 0; i < len; i += 1) {
+        this.dynamicProperties[i].getValue();
+    }
+    this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
+    var ownTransformers = [].concat(transformers);
+    var i, len = arr.length - 1;
+    var j, jLen;
+    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
+    for(i=len;i>=0;i-=1){
+        processedPos = this.searchProcessedElement(arr[i]);
+        if(!processedPos){
+            arr[i]._render = render;
+        } else {
+            itemsData[i] = prevViewData[processedPos - 1];
+        }
+        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
+            if(!processedPos){
+                itemsData[i] = this.createStyleElement(arr[i], level);
+            } else {
+                itemsData[i].style.closed = false;
+            }
+            if(arr[i]._render){
+                container.appendChild(itemsData[i].style.pElem);
+            }
+            ownStyles.push(itemsData[i].style);
+        }else if(arr[i].ty == 'gr'){
+            if(!processedPos){
+                itemsData[i] = this.createGroupElement(arr[i]);
+            } else {
+                jLen = itemsData[i].it.length;
+                for(j=0;j<jLen;j+=1){
+                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
+                }
+            }
+            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
+            if(arr[i]._render){
+                container.appendChild(itemsData[i].gr);
+            }
+        }else if(arr[i].ty == 'tr'){
+            if(!processedPos){
+                itemsData[i] = this.createTransformElement(arr[i], container);
+            }
+            currentTransform = itemsData[i].transform;
+            ownTransformers.push(currentTransform);
+        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
+            if(!processedPos){
+                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+            }
+            this.setElementStyles(itemsData[i]);
+
+        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms'){
+            if(!processedPos){
+                modifier = ShapeModifiers.getModifier(arr[i].ty);
+                modifier.init(this,arr[i]);
+                itemsData[i] = modifier;
+                this.shapeModifiers.push(modifier);
+            } else {
+                modifier = itemsData[i];
+                modifier.closed = false;
+            }
+            ownModifiers.push(modifier);
+        }else if(arr[i].ty == 'rp'){
+            if(!processedPos){
+                modifier = ShapeModifiers.getModifier(arr[i].ty);
+                itemsData[i] = modifier;
+                modifier.init(this,arr,i,itemsData);
+                this.shapeModifiers.push(modifier);
+                render = false;
+            }else{
+                modifier = itemsData[i];
+                modifier.closed = true;
+            }
+            ownModifiers.push(modifier);
+        }
+        this.addProcessedElement(arr[i], i + 1);
+    }
+    len = ownStyles.length;
+    for(i=0;i<len;i+=1){
+        ownStyles[i].closed = true;
+    }
+    len = ownModifiers.length;
+    for(i=0;i<len;i+=1){
+        ownModifiers[i].closed = true;
+    }
+};
+
+SVGShapeElement.prototype.renderInnerContent = function() {
+    this.renderModifiers();
+    var i, len = this.stylesList.length;
+    for(i=0;i<len;i+=1){
+        this.stylesList[i].reset();
+    }
+    this.renderShape();
+
+    for (i = 0; i < len; i += 1) {
+        if (this.stylesList[i]._mdf || this._isFirstFrame) {
+            if(this.stylesList[i].msElem){
+                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+                //Adding M0 0 fixes same mask bug on all browsers
+                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+            }
+            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
+        }
+    }
+};
+
+SVGShapeElement.prototype.renderShape = function() {
+    var i, len = this.animatedContents.length;
+    var animatedContent;
+    for(i = 0; i < len; i += 1) {
+        animatedContent = this.animatedContents[i];
+        if(this._isFirstFrame || animatedContent.element._isAnimated) {
+            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
+        }
+    }
+}
+
+SVGShapeElement.prototype.destroy = function(){
+    this.destroyBaseElement();
+    this.shapeData = null;
+    this.itemsData = null;
+};
diff --git a/player/js/elements/svgElements/SVGTextElement.js b/player/js/elements/svgElements/SVGTextElement.js
index 8b3c408..88c17d6 100644
--- a/player/js/elements/svgElements/SVGTextElement.js
+++ b/player/js/elements/svgElements/SVGTextElement.js
@@ -1,43 +1,49 @@
-function SVGTextElement(data,parentContainer,globalData,comp, placeholder){
+function SVGTextElement(data,globalData,comp){
     this.textSpans = [];
     this.renderType = 'svg';
-    this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
+    this.initElement(data,globalData,comp);
 }
-createElement(SVGBaseElement, SVGTextElement);
 
-SVGTextElement.prototype.init = ITextElement.prototype.init;
-SVGTextElement.prototype.createPathShape = ITextElement.prototype.createPathShape;
-SVGTextElement.prototype.getMeasures = ITextElement.prototype.getMeasures;
-SVGTextElement.prototype.prepareFrame = ITextElement.prototype.prepareFrame;
+extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
 
-SVGTextElement.prototype.createElements = function(){
+SVGTextElement.prototype.createContent = function(){
 
-    this._parent.createElements.call(this);
-
-
-    if(this.data.ln){
-        this.layerElement.setAttribute('id',this.data.ln);
-    }
-    if(this.data.cl){
-        this.layerElement.setAttribute('class',this.data.cl);
+    if (this.data.singleShape && !this.globalData.fontManager.chars) {
+        this.textContainer = createNS('text');
     }
 };
 
+SVGTextElement.prototype.buildTextContents = function(textArray) {
+    var i = 0, len = textArray.length;
+    var textContents = [], currentTextContent = '';
+    while (i < len) {
+        if(textArray[i] === String.fromCharCode(13)) {
+            textContents.push(currentTextContent);
+            currentTextContent = '';
+        } else {
+            currentTextContent += textArray[i];
+        }
+        i += 1;
+    }
+    textContents.push(currentTextContent);
+    return textContents;
+}
+
 SVGTextElement.prototype.buildNewText = function(){
     var i, len;
 
-    var documentData = this.currentTextDocumentData;
-    this.renderedLetters = Array.apply(null,{length:this.currentTextDocumentData.l ? this.currentTextDocumentData.l.length : 0});
+    var documentData = this.textProperty.currentData;
+    this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
     if(documentData.fc) {
-        this.layerElement.setAttribute('fill', 'rgb(' + Math.round(documentData.fc[0]*255) + ',' + Math.round(documentData.fc[1]*255) + ',' + Math.round(documentData.fc[2]*255) + ')');
+        this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
     }else{
         this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
     }
     if(documentData.sc){
-        this.layerElement.setAttribute('stroke', 'rgb(' + Math.round(documentData.sc[0]*255) + ',' + Math.round(documentData.sc[1]*255) + ',' + Math.round(documentData.sc[2]*255) + ')');
+        this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
         this.layerElement.setAttribute('stroke-width', documentData.sw);
     }
-    this.layerElement.setAttribute('font-size', documentData.s);
+    this.layerElement.setAttribute('font-size', documentData.finalSize);
     var fontData = this.globalData.fontManager.getFontByName(documentData.f);
     if(fontData.fClass){
         this.layerElement.setAttribute('class',fontData.fClass);
@@ -48,9 +54,8 @@
         this.layerElement.setAttribute('font-weight', fWeight);
     }
 
-
-
     var letters = documentData.l || [];
+    var usesGlyphs = this.globalData.fontManager.chars;
     len = letters.length;
     if(!len){
         return;
@@ -58,154 +63,147 @@
     var tSpan;
     var matrixHelper = this.mHelper;
     var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    if (singleShape) {
-        var xPos = 0, yPos = 0, lineWidths = documentData.lineWidths, boxWidth = documentData.boxWidth, firstLine = true;
-    }
-    var cnt = 0;
-    for (i = 0;i < len ;i += 1) {
-        if(this.globalData.fontManager.chars){
-            if(!singleShape || i === 0){
-                tSpan = this.textSpans[cnt] ? this.textSpans[cnt] : document.createElementNS(svgNS,'path');
+    var xPos = 0, yPos = 0, firstLine = true;
+    var trackingOffset = documentData.tr/1000*documentData.finalSize;
+    if(singleShape && !usesGlyphs && !documentData.sz) {
+        var tElement = this.textContainer;
+        var justify = 'start';
+        switch(documentData.j) {
+            case 1:
+                justify = 'end';
+                break;
+            case 2:
+                justify = 'middle';
+                break;
+        }
+        tElement.setAttribute('text-anchor',justify);
+        tElement.setAttribute('letter-spacing',trackingOffset);
+        var textContent = this.buildTextContents(documentData.finalText);
+        len = textContent.length;
+        yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
+        for ( i = 0; i < len; i += 1) {
+            tSpan = this.textSpans[i] || createNS('tspan');
+            tSpan.textContent = textContent[i];
+            tSpan.setAttribute('x', 0);
+            tSpan.setAttribute('y', yPos);
+            tSpan.style.display = 'inherit';
+            tElement.appendChild(tSpan);
+            this.textSpans[i] = tSpan;
+            yPos += documentData.finalLineHeight;
+        }
+        
+        this.layerElement.appendChild(tElement);
+    } else {
+        var cachedSpansLength = this.textSpans.length;
+        var shapeData, charData;
+        for (i = 0; i < len; i += 1) {
+            if(!usesGlyphs || !singleShape || i === 0){
+                tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
+                if (cachedSpansLength <= i) {
+                    tSpan.setAttribute('stroke-linecap', 'butt');
+                    tSpan.setAttribute('stroke-linejoin','round');
+                    tSpan.setAttribute('stroke-miterlimit','4');
+                    this.textSpans[i] = tSpan;
+                    this.layerElement.appendChild(tSpan);
+                }
+                tSpan.style.display = 'inherit';
             }
-        }else{
-            tSpan = this.textSpans[cnt] ? this.textSpans[cnt] : document.createElementNS(svgNS,'text');
-        }
-        tSpan.style.display = 'inherit';
-        tSpan.setAttribute('stroke-linecap', 'butt');
-        tSpan.setAttribute('stroke-linejoin','round');
-        tSpan.setAttribute('stroke-miterlimit','4');
-        //tSpan.setAttribute('visibility', 'hidden');
-        if(singleShape && letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            firstLine = false;
-        }
-        matrixHelper.reset();
-        if(this.globalData.fontManager.chars) {
-            matrixHelper.scale(documentData.s / 100, documentData.s / 100);
+            
+            matrixHelper.reset();
+            matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+            if (singleShape) {
+                if(letters[i].n) {
+                    xPos = -trackingOffset;
+                    yPos += documentData.yOffset;
+                    yPos += firstLine ? 1 : 0;
+                    firstLine = false;
+                }
+                this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+                xPos += letters[i].l || 0;
+                //xPos += letters[i].val === ' ' ? 0 : trackingOffset;
+                xPos += trackingOffset;
+            }
+            if(usesGlyphs) {
+                charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+                shapeData = charData && charData.data || {};
+                shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+                if(!singleShape){
+                    tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
+                } else {
+                    shapeStr += this.createPathShape(matrixHelper,shapes);
+                }
+            } else {
+                if(singleShape) {
+                    tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
+                }
+                tSpan.textContent = letters[i].val;
+                tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
+            }
+            //
         }
         if (singleShape) {
-            if(documentData.ps){
-                matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-            }
-            matrixHelper.translate(0,-documentData.ls,0);
-            switch(documentData.j){
-                case 1:
-                    matrixHelper.translate(documentData.justifyOffset + (boxWidth - lineWidths[letters[i].line]),0,0);
-                    break;
-                case 2:
-                    matrixHelper.translate(documentData.justifyOffset + (boxWidth - lineWidths[letters[i].line])/2,0,0);
-                    break;
-            }
-            matrixHelper.translate(xPos, yPos, 0);
-        }
-        if(this.globalData.fontManager.chars){
-            var charData = this.globalData.fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-            var shapeData;
-            if(charData){
-                shapeData = charData.data;
-            } else {
-                shapeData = null;
-            }
-            if(shapeData && shapeData.shapes){
-                shapes = shapeData.shapes[0].it;
-                if(!singleShape){
-                    shapeStr = '';
-                }
-                shapeStr += this.createPathShape(matrixHelper,shapes);
-                if(!singleShape){
-
-                    tSpan.setAttribute('d',shapeStr);
-                }
-            }
-            if(!singleShape){
-                this.layerElement.appendChild(tSpan);
-            }
-        }else{
-            tSpan.textContent = letters[i].val;
-            tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            this.layerElement.appendChild(tSpan);
-            if(singleShape){
-                tSpan.setAttribute('transform',matrixHelper.to2dCSS());
-            }
-        }
-        if(singleShape) {
-            xPos += letters[i].l;
-            xPos += documentData.tr/1000*documentData.s;
-        }
-        //
-        this.textSpans[cnt] = tSpan;
-        cnt += 1;
-    }
-    if(!singleShape){
-        while(cnt < this.textSpans.length){
-            this.textSpans[cnt].style.display = 'none';
-            cnt += 1;
+            tSpan.setAttribute('d',shapeStr);
         }
     }
-    if(singleShape && this.globalData.fontManager.chars){
-        tSpan.setAttribute('d',shapeStr);
-        this.layerElement.appendChild(tSpan);
+    while (i < this.textSpans.length){
+        this.textSpans[i].style.display = 'none';
+        i += 1;
     }
-}
-
-SVGTextElement.prototype.hide = function(){
-    if(!this.hidden){
-        this.layerElement.style.display = 'none';
-        this.hidden = true;
-    }
+    
+    this._sizeChanged = true;
 };
 
-SVGTextElement.prototype.renderFrame = function(parentMatrix){
-
-    var renderParent = this._parent.renderFrame.call(this,parentMatrix);
-    if(renderParent===false){
-        this.hide();
-        return;
+SVGTextElement.prototype.sourceRectAtTime = function(time){
+    this.prepareFrame(this.comp.renderedFrame - this.data.st);
+    this.renderInnerContent();
+    if(this._sizeChanged){
+        this._sizeChanged = false;
+        var textBox = this.layerElement.getBBox();
+        this.bbox = {
+            top: textBox.y,
+            left: textBox.x,
+            width: textBox.width,
+            height: textBox.height
+        };
     }
-    if(this.hidden){
-        this.hidden = false;
-        this.layerElement.style.display = 'block';
-    }
+    return this.bbox;
+};
 
-    if(this.data.singleShape){
-        return;
-    }
-    this.getMeasures();
-    if(!this.lettersChangedFlag){
-        return;
-    }
-    var  i,len;
-    var renderedLetters = this.renderedLetters;
+SVGTextElement.prototype.renderInnerContent = function(){
 
-    var letters = this.currentTextDocumentData.l;
+    if(!this.data.singleShape){
+        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+        if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
+            this._sizeChanged = true;
+            var  i,len;
+            var renderedLetters = this.textAnimator.renderedLetters;
 
-    len = letters.length;
-    var renderedLetter;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            continue;
-        }
-        renderedLetter = renderedLetters[i];
-        this.textSpans[i].setAttribute('transform',renderedLetter.m);
-        this.textSpans[i].setAttribute('opacity',renderedLetter.o);
-        if(renderedLetter.sw){
-            this.textSpans[i].setAttribute('stroke-width',renderedLetter.sw);
-        }
-        if(renderedLetter.sc){
-            this.textSpans[i].setAttribute('stroke',renderedLetter.sc);
-        }
-        if(renderedLetter.fc){
-            this.textSpans[i].setAttribute('fill',renderedLetter.fc);
+            var letters = this.textProperty.currentData.l;
+
+            len = letters.length;
+            var renderedLetter, textSpan;
+            for(i=0;i<len;i+=1){
+                if(letters[i].n){
+                    continue;
+                }
+                renderedLetter = renderedLetters[i];
+                textSpan = this.textSpans[i];
+                if(renderedLetter._mdf.m) {
+                    textSpan.setAttribute('transform',renderedLetter.m);
+                }
+                if(renderedLetter._mdf.o) {
+                    textSpan.setAttribute('opacity',renderedLetter.o);
+                }
+                if(renderedLetter._mdf.sw){
+                    textSpan.setAttribute('stroke-width',renderedLetter.sw);
+                }
+                if(renderedLetter._mdf.sc){
+                    textSpan.setAttribute('stroke',renderedLetter.sc);
+                }
+                if(renderedLetter._mdf.fc){
+                    textSpan.setAttribute('fill',renderedLetter.fc);
+                }
+            }
         }
     }
-    if(this.firstFrame) {
-        this.firstFrame = false;
-    }
-}
-
-
-SVGTextElement.prototype.destroy = function(){
-    this._parent.destroy.call(this._parent);
 };
\ No newline at end of file
diff --git a/player/js/elements/svgElements/effects/SVGDropShadowEffect.js b/player/js/elements/svgElements/effects/SVGDropShadowEffect.js
index 16103b8..25d2980 100644
--- a/player/js/elements/svgElements/effects/SVGDropShadowEffect.js
+++ b/player/js/elements/svgElements/effects/SVGDropShadowEffect.js
@@ -1,39 +1,32 @@
 function SVGDropShadowEffect(filter, filterManager){
-    /*<feGaussianBlur in="SourceAlpha" stdDeviation="3"/> <!-- stdDeviation is how much to blur -->
-  <feOffset dx="2" dy="2" result="offsetblur"/> <!-- how much to offset -->
-  <feMerge> 
-    <feMergeNode/> <!-- this contains the offset blurred image -->
-    <feMergeNode in="SourceGraphic"/> <!-- this contains the element that the filter is applied to -->
-  </feMerge>*/
-  /*<feFlood flood-color="#3D4574" flood-opacity="0.5" result="offsetColor"/>*/
     filter.setAttribute('x','-100%');
     filter.setAttribute('y','-100%');
     filter.setAttribute('width','400%');
     filter.setAttribute('height','400%');
     this.filterManager = filterManager;
 
-    var feGaussianBlur = document.createElementNS(svgNS,'feGaussianBlur');
+    var feGaussianBlur = createNS('feGaussianBlur');
     feGaussianBlur.setAttribute('in','SourceAlpha');
     feGaussianBlur.setAttribute('result','drop_shadow_1');
     feGaussianBlur.setAttribute('stdDeviation','0');
     this.feGaussianBlur = feGaussianBlur;
     filter.appendChild(feGaussianBlur);
 
-    var feOffset = document.createElementNS(svgNS,'feOffset');
+    var feOffset = createNS('feOffset');
     feOffset.setAttribute('dx','25');
     feOffset.setAttribute('dy','0');
     feOffset.setAttribute('in','drop_shadow_1');
     feOffset.setAttribute('result','drop_shadow_2');
     this.feOffset = feOffset;
     filter.appendChild(feOffset);
-    var feFlood = document.createElementNS(svgNS,'feFlood');
+    var feFlood = createNS('feFlood');
     feFlood.setAttribute('flood-color','#00ff00');
     feFlood.setAttribute('flood-opacity','1');
     feFlood.setAttribute('result','drop_shadow_3');
     this.feFlood = feFlood;
     filter.appendChild(feFlood);
 
-    var feComposite = document.createElementNS(svgNS,'feComposite');
+    var feComposite = createNS('feComposite');
     feComposite.setAttribute('in','drop_shadow_3');
     feComposite.setAttribute('in2','drop_shadow_2');
     feComposite.setAttribute('operator','in');
@@ -41,12 +34,12 @@
     filter.appendChild(feComposite);
 
 
-    var feMerge = document.createElementNS(svgNS,'feMerge');
+    var feMerge = createNS('feMerge');
     filter.appendChild(feMerge);
     var feMergeNode;
-    feMergeNode = document.createElementNS(svgNS,'feMergeNode');
+    feMergeNode = createNS('feMergeNode');
     feMerge.appendChild(feMergeNode);
-    feMergeNode = document.createElementNS(svgNS,'feMergeNode');
+    feMergeNode = createNS('feMergeNode');
     feMergeNode.setAttribute('in','SourceGraphic');
     this.feMergeNode = feMergeNode;
     this.feMerge = feMerge;
@@ -55,26 +48,26 @@
 }
 
 SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
-        if(forceRender || this.filterManager.effectElements[4].p.mdf){
+    if(forceRender || this.filterManager._mdf){
+        if(forceRender || this.filterManager.effectElements[4].p._mdf){
             this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
         }
-        if(forceRender || this.filterManager.effectElements[0].p.mdf){
+        if(forceRender || this.filterManager.effectElements[0].p._mdf){
             var col = this.filterManager.effectElements[0].p.v;
             this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
         }
-        if(forceRender || this.filterManager.effectElements[1].p.mdf){
+        if(forceRender || this.filterManager.effectElements[1].p._mdf){
             this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
         }
-        if(forceRender || this.filterManager.effectElements[2].p.mdf || this.filterManager.effectElements[3].p.mdf){
-            var distance = this.filterManager.effectElements[3].p.v
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads
-            var x = distance * Math.cos(angle)
-            var y = distance * Math.sin(angle)
+        if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
+            var distance = this.filterManager.effectElements[3].p.v;
+            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
+            var x = distance * Math.cos(angle);
+            var y = distance * Math.sin(angle);
             this.feOffset.setAttribute('dx', x);
             this.feOffset.setAttribute('dy', y);
         }
-        /*if(forceRender || this.filterManager.effectElements[5].p.mdf){
+        /*if(forceRender || this.filterManager.effectElements[5].p._mdf){
             if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
                 this.feMerge.removeChild(this.feMergeNode);
                 this.originalNodeAdded = false;
diff --git a/player/js/elements/svgElements/effects/SVGFillFilter.js b/player/js/elements/svgElements/effects/SVGFillFilter.js
index ccee398..db1069d 100644
--- a/player/js/elements/svgElements/effects/SVGFillFilter.js
+++ b/player/js/elements/svgElements/effects/SVGFillFilter.js
@@ -1,6 +1,6 @@
 function SVGFillFilter(filter, filterManager){
     this.filterManager = filterManager;
-    var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
+    var feColorMatrix = createNS('feColorMatrix');
     feColorMatrix.setAttribute('type','matrix');
     feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
     feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
@@ -8,7 +8,7 @@
     this.matrixFilter = feColorMatrix;
 }
 SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
+    if(forceRender || this.filterManager._mdf){
         var color = this.filterManager.effectElements[2].p.v;
         var opacity = this.filterManager.effectElements[6].p.v;
         this.matrixFilter.setAttribute('values','0 0 0 0 '+color[0]+' 0 0 0 0 '+color[1]+' 0 0 0 0 '+color[2]+' 0 0 0 '+opacity+' 0');
diff --git a/player/js/elements/svgElements/effects/SVGMatte3Effect.js b/player/js/elements/svgElements/effects/SVGMatte3Effect.js
new file mode 100644
index 0000000..da04982
--- /dev/null
+++ b/player/js/elements/svgElements/effects/SVGMatte3Effect.js
@@ -0,0 +1,91 @@
+var _svgMatteSymbols = [];
+var _svgMatteMaskCounter = 0;
+
+function SVGMatte3Effect(filterElem, filterManager, elem){
+    this.initialized = false;
+    this.filterManager = filterManager;
+    this.filterElem = filterElem;
+    this.elem = elem;
+    elem.matteElement = createNS('g');
+    elem.matteElement.appendChild(elem.layerElement);
+    elem.matteElement.appendChild(elem.transformedElement);
+    elem.baseElement = elem.matteElement;
+}
+
+SVGMatte3Effect.prototype.findSymbol = function(mask) {
+    var i = 0, len = _svgMatteSymbols.length;
+    while(i < len) {
+        if(_svgMatteSymbols[i] === mask) {
+            return _svgMatteSymbols[i];
+        }
+        i += 1;
+    }
+    return null;
+};
+
+SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
+    var parentNode = mask.layerElement.parentNode;
+    if(!parentNode) {
+        return;
+    }
+    var children = parentNode.children;
+    var i = 0, len = children.length;
+    while (i < len) {
+        if (children[i] === mask.layerElement) {
+            break;
+        }
+        i += 1;
+    }
+    var nextChild;
+    if (i <= len - 2) {
+        nextChild = children[i + 1];
+    }
+    var useElem = createNS('use');
+    useElem.setAttribute('href', '#' + symbolId);
+    if(nextChild) {
+        parentNode.insertBefore(useElem, nextChild);
+    } else {
+        parentNode.appendChild(useElem);
+    }
+};
+
+SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
+    if(!this.findSymbol(mask)) {
+        var symbolId = 'matte_' + randomString(5) + '_' + _svgMatteMaskCounter++;
+        var masker = createNS('mask');
+        masker.setAttribute('id', mask.layerId);
+        masker.setAttribute('mask-type', 'alpha');
+        _svgMatteSymbols.push(mask);
+        var defs = elem.globalData.defs;
+        defs.appendChild(masker);
+        var symbol = createNS('symbol');
+        symbol.setAttribute('id', symbolId);
+        this.replaceInParent(mask, symbolId);
+        symbol.appendChild(mask.layerElement);
+        defs.appendChild(symbol);
+        var useElem = createNS('use');
+        useElem.setAttribute('href', '#' + symbolId);
+        masker.appendChild(useElem);
+        mask.data.hd = false;
+        mask.show();
+    }
+    elem.setMatte(mask.layerId);
+};
+
+SVGMatte3Effect.prototype.initialize = function() {
+    var ind = this.filterManager.effectElements[0].p.v;
+    var i = 0, len = this.elem.comp.elements.length;
+    while (i < len) {
+    	if (this.elem.comp.elements[i].data.ind === ind) {
+    		this.setElementAsMask(this.elem, this.elem.comp.elements[i]);
+    	}
+    	i += 1;
+    }
+    this.initialized = true;
+};
+
+SVGMatte3Effect.prototype.renderFrame = function() {
+	if(!this.initialized) {
+		this.initialize();
+	}
+};
\ No newline at end of file
diff --git a/player/js/elements/svgElements/effects/SVGProLevelsFilter.js b/player/js/elements/svgElements/effects/SVGProLevelsFilter.js
index ad572ec..1f1c0a6 100644
--- a/player/js/elements/svgElements/effects/SVGProLevelsFilter.js
+++ b/player/js/elements/svgElements/effects/SVGProLevelsFilter.js
@@ -1,29 +1,29 @@
 function SVGProLevelsFilter(filter, filterManager){
     this.filterManager = filterManager;
     var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = document.createElementNS(svgNS,'feComponentTransfer');
+    var feComponentTransfer = createNS('feComponentTransfer');
     var feFuncR, feFuncG, feFuncB;
     
-    if(effectElements[9].p.k || effectElements[9].p.v !== 0 || effectElements[10].p.k || effectElements[10].p.v !== 1 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 0 || effectElements[13].p.k || effectElements[13].p.v !== 1){
+    if(effectElements[10].p.k || effectElements[10].p.v !== 0 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 1 || effectElements[13].p.k || effectElements[13].p.v !== 0 || effectElements[14].p.k || effectElements[14].p.v !== 1){
         this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
     }
-    if(effectElements[16].p.k || effectElements[16].p.v !== 0 || effectElements[17].p.k || effectElements[17].p.v !== 1 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 0 || effectElements[20].p.k || effectElements[20].p.v !== 1){
+    if(effectElements[17].p.k || effectElements[17].p.v !== 0 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 1 || effectElements[20].p.k || effectElements[20].p.v !== 0 || effectElements[21].p.k || effectElements[21].p.v !== 1){
         this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
     }
-    if(effectElements[23].p.k || effectElements[23].p.v !== 0 || effectElements[24].p.k || effectElements[24].p.v !== 1 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 0 || effectElements[27].p.k || effectElements[27].p.v !== 1){
+    if(effectElements[24].p.k || effectElements[24].p.v !== 0 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 1 || effectElements[27].p.k || effectElements[27].p.v !== 0 || effectElements[28].p.k || effectElements[28].p.v !== 1){
         this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
     }
-    if(effectElements[30].p.k || effectElements[30].p.v !== 0 || effectElements[31].p.k || effectElements[31].p.v !== 1 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 0 || effectElements[34].p.k || effectElements[34].p.v !== 1){
+    if(effectElements[31].p.k || effectElements[31].p.v !== 0 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 1 || effectElements[34].p.k || effectElements[34].p.v !== 0 || effectElements[35].p.k || effectElements[35].p.v !== 1){
         this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
     }
     
     if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
         feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
         filter.appendChild(feComponentTransfer);
-        feComponentTransfer = document.createElementNS(svgNS,'feComponentTransfer');
+        feComponentTransfer = createNS('feComponentTransfer');
     }
 
-    if(effectElements[2].p.k || effectElements[2].p.v !== 0 || effectElements[3].p.k || effectElements[3].p.v !== 1 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 0 || effectElements[6].p.k || effectElements[6].p.v !== 1){
+    if(effectElements[3].p.k || effectElements[3].p.v !== 0 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 1 || effectElements[6].p.k || effectElements[6].p.v !== 0 || effectElements[7].p.k || effectElements[7].p.v !== 1){
 
         feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
         filter.appendChild(feComponentTransfer);
@@ -34,7 +34,7 @@
 }
 
 SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = document.createElementNS(svgNS,type);
+    var feFunc = createNS(type);
     feFunc.setAttribute('type','table');
     feComponentTransfer.appendChild(feFunc);
     return feFunc;
@@ -67,33 +67,34 @@
 };
 
 SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
+    if(forceRender || this.filterManager._mdf){
         var val, cnt, perc, bezier;
         var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[2].p.mdf || effectElements[3].p.mdf || effectElements[4].p.mdf || effectElements[5].p.mdf || effectElements[6].p.mdf)){
-            val = this.getTableValue(effectElements[2].p.v,effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v);
+        if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
+            val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
             this.feFuncRComposed.setAttribute('tableValues',val);
             this.feFuncGComposed.setAttribute('tableValues',val);
             this.feFuncBComposed.setAttribute('tableValues',val);
         }
 
-        if(this.feFuncR && (forceRender || effectElements[9].p.mdf || effectElements[10].p.mdf || effectElements[11].p.mdf || effectElements[12].p.mdf || effectElements[13].p.mdf)){
-            val = this.getTableValue(effectElements[9].p.v,effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v);
+
+        if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
+            val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
             this.feFuncR.setAttribute('tableValues',val);
         }
 
-        if(this.feFuncG && (forceRender || effectElements[16].p.mdf || effectElements[17].p.mdf || effectElements[18].p.mdf || effectElements[19].p.mdf || effectElements[20].p.mdf)){
-            val = this.getTableValue(effectElements[16].p.v,effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v);
+        if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
+            val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
             this.feFuncG.setAttribute('tableValues',val);
         }
 
-        if(this.feFuncB && (forceRender || effectElements[23].p.mdf || effectElements[24].p.mdf || effectElements[25].p.mdf || effectElements[26].p.mdf || effectElements[27].p.mdf)){
-            val = this.getTableValue(effectElements[23].p.v,effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v);
+        if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
+            val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
             this.feFuncB.setAttribute('tableValues',val);
         }
 
-        if(this.feFuncA && (forceRender || effectElements[30].p.mdf || effectElements[31].p.mdf || effectElements[32].p.mdf || effectElements[33].p.mdf || effectElements[34].p.mdf)){
-            val = this.getTableValue(effectElements[30].p.v,effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v);
+        if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
+            val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
             this.feFuncA.setAttribute('tableValues',val);
         }
         
diff --git a/player/js/elements/svgElements/effects/SVGStrokeEffect.js b/player/js/elements/svgElements/effects/SVGStrokeEffect.js
index d87f426..e19956f 100644
--- a/player/js/elements/svgElements/effects/SVGStrokeEffect.js
+++ b/player/js/elements/svgElements/effects/SVGStrokeEffect.js
@@ -16,24 +16,24 @@
         i = this.filterManager.effectElements[0].p.v - 1;
         len = i + 1;
     }
-    groupPath = document.createElementNS(svgNS,'g'); 
+    groupPath = createNS('g'); 
     groupPath.setAttribute('fill','none');
     groupPath.setAttribute('stroke-linecap','round');
     groupPath.setAttribute('stroke-dashoffset',1);
     for(i;i<len;i+=1){
-        path = document.createElementNS(svgNS,'path');
+        path = createNS('path');
         groupPath.appendChild(path);
         this.paths.push({p:path,m:i});
     }
     if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = document.createElementNS(svgNS,'mask');
+        var mask = createNS('mask');
         var id = 'stms_' + randomString(10);
         mask.setAttribute('id',id);
         mask.setAttribute('mask-type','alpha');
         mask.appendChild(groupPath);
         this.elem.globalData.defs.appendChild(mask);
-        var g = document.createElementNS(svgNS,'g');
-        g.setAttribute('mask','url(#'+id+')');
+        var g = createNS('g');
+        g.setAttribute('mask','url(' + locationHref + '#'+id+')');
         if(elemChildren[0]){
             g.appendChild(elemChildren[0]);
         }
@@ -42,7 +42,7 @@
         groupPath.setAttribute('stroke','#fff');
     } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
         if(this.filterManager.effectElements[10].p.v === 2){
-            var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+            elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
             while(elemChildren.length){
                 this.elem.layerElement.removeChild(elemChildren[0]);
             }
@@ -53,7 +53,7 @@
     }
     this.initialized = true;
     this.pathMasker = groupPath;
-}
+};
 
 SVGStrokeEffect.prototype.renderFrame = function(forceRender){
     if(!this.initialized){
@@ -62,12 +62,15 @@
     var i, len = this.paths.length;
     var mask, path;
     for(i=0;i<len;i+=1){
+        if(this.paths[i].m === -1) {
+            continue;
+        }
         mask = this.elem.maskManager.viewData[this.paths[i].m];
         path = this.paths[i].p;
-        if(forceRender || this.filterManager.mdf || mask.prop.mdf){
+        if(forceRender || this.filterManager._mdf || mask.prop._mdf){
             path.setAttribute('d',mask.lastPath);
         }
-        if(forceRender || this.filterManager.effectElements[9].p.mdf || this.filterManager.effectElements[4].p.mdf || this.filterManager.effectElements[7].p.mdf || this.filterManager.effectElements[8].p.mdf || mask.prop.mdf){
+        if(forceRender || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || mask.prop._mdf){
             var dasharrayValue;
             if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
                 var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
@@ -88,15 +91,15 @@
             path.setAttribute('stroke-dasharray',dasharrayValue);
         }
     }
-    if(forceRender || this.filterManager.effectElements[4].p.mdf){
+    if(forceRender || this.filterManager.effectElements[4].p._mdf){
         this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
     }
     
-    if(forceRender || this.filterManager.effectElements[6].p.mdf){
+    if(forceRender || this.filterManager.effectElements[6].p._mdf){
         this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
     }
     if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p.mdf){
+        if(forceRender || this.filterManager.effectElements[3].p._mdf){
             var color = this.filterManager.effectElements[3].p.v;
             this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
         }
diff --git a/player/js/elements/svgElements/effects/SVGTintEffect.js b/player/js/elements/svgElements/effects/SVGTintEffect.js
index 2a728a8..9b41b08 100644
--- a/player/js/elements/svgElements/effects/SVGTintEffect.js
+++ b/player/js/elements/svgElements/effects/SVGTintEffect.js
@@ -1,12 +1,12 @@
 function SVGTintFilter(filter, filterManager){
     this.filterManager = filterManager;
-    var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
+    var feColorMatrix = createNS('feColorMatrix');
     feColorMatrix.setAttribute('type','matrix');
     feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
     feColorMatrix.setAttribute('values','0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');
     feColorMatrix.setAttribute('result','f1');
     filter.appendChild(feColorMatrix);
-    feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
+    feColorMatrix = createNS('feColorMatrix');
     feColorMatrix.setAttribute('type','matrix');
     feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
     feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
@@ -14,20 +14,20 @@
     filter.appendChild(feColorMatrix);
     this.matrixFilter = feColorMatrix;
     if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = document.createElementNS(svgNS,'feMerge');
+        var feMerge = createNS('feMerge');
         filter.appendChild(feMerge);
         var feMergeNode;
-        feMergeNode = document.createElementNS(svgNS,'feMergeNode');
+        feMergeNode = createNS('feMergeNode');
         feMergeNode.setAttribute('in','SourceGraphic');
         feMerge.appendChild(feMergeNode);
-        feMergeNode = document.createElementNS(svgNS,'feMergeNode');
+        feMergeNode = createNS('feMergeNode');
         feMergeNode.setAttribute('in','f2');
         feMerge.appendChild(feMergeNode);
     }
 }
 
 SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
+    if(forceRender || this.filterManager._mdf){
         var colorBlack = this.filterManager.effectElements[0].p.v;
         var colorWhite = this.filterManager.effectElements[1].p.v;
         var opacity = this.filterManager.effectElements[2].p.v/100;
diff --git a/player/js/elements/svgElements/effects/SVGTritoneFilter.js b/player/js/elements/svgElements/effects/SVGTritoneFilter.js
index 376026b..0b880c4 100644
--- a/player/js/elements/svgElements/effects/SVGTritoneFilter.js
+++ b/player/js/elements/svgElements/effects/SVGTritoneFilter.js
@@ -1,37 +1,37 @@
 function SVGTritoneFilter(filter, filterManager){
     this.filterManager = filterManager;
-    var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
+    var feColorMatrix = createNS('feColorMatrix');
     feColorMatrix.setAttribute('type','matrix');
     feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
     feColorMatrix.setAttribute('values','0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0');
     feColorMatrix.setAttribute('result','f1');
     filter.appendChild(feColorMatrix);
-    var feComponentTransfer = document.createElementNS(svgNS,'feComponentTransfer');
+    var feComponentTransfer = createNS('feComponentTransfer');
     feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
     filter.appendChild(feComponentTransfer);
     this.matrixFilter = feComponentTransfer;
-    var feFuncR = document.createElementNS(svgNS,'feFuncR');
+    var feFuncR = createNS('feFuncR');
     feFuncR.setAttribute('type','table');
     feComponentTransfer.appendChild(feFuncR);
     this.feFuncR = feFuncR;
-    var feFuncG = document.createElementNS(svgNS,'feFuncG');
+    var feFuncG = createNS('feFuncG');
     feFuncG.setAttribute('type','table');
     feComponentTransfer.appendChild(feFuncG);
     this.feFuncG = feFuncG;
-    var feFuncB = document.createElementNS(svgNS,'feFuncB');
+    var feFuncB = createNS('feFuncB');
     feFuncB.setAttribute('type','table');
     feComponentTransfer.appendChild(feFuncB);
     this.feFuncB = feFuncB;
 }
 
 SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager.mdf){
+    if(forceRender || this.filterManager._mdf){
         var color1 = this.filterManager.effectElements[0].p.v;
         var color2 = this.filterManager.effectElements[1].p.v;
         var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0]
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1]
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2]
+        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
+        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
+        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
         this.feFuncR.setAttribute('tableValues', tableR);
         this.feFuncG.setAttribute('tableValues', tableG);
         this.feFuncB.setAttribute('tableValues', tableB);
diff --git a/player/js/main.js b/player/js/main.js
index 9719c46..8fddc43 100644
--- a/player/js/main.js
+++ b/player/js/main.js
@@ -1 +1,5 @@
-var svgNS = "http://www.w3.org/2000/svg";
\ No newline at end of file
+var svgNS = "http://www.w3.org/2000/svg";
+
+var locationHref = '';
+
+var initialDefaultFrame = -999999;
diff --git a/player/js/mask.js b/player/js/mask.js
index 5ade9d5..ab4c176 100644
--- a/player/js/mask.js
+++ b/player/js/mask.js
@@ -1,16 +1,14 @@
 function MaskElement(data,element,globalData) {
-    this.dynamicProperties = [];
     this.data = data;
     this.element = element;
     this.globalData = globalData;
-    this.paths = [];
     this.storedData = [];
-    this.masksProperties = this.data.masksProperties;
-    this.viewData = new Array(this.masksProperties.length);
+    this.masksProperties = this.data.masksProperties || [];
     this.maskElement = null;
-    this.firstFrame = true;
     var defs = this.globalData.defs;
-    var i, len = this.masksProperties.length;
+    var i, len = this.masksProperties ? this.masksProperties.length : 0;
+    this.viewData = createSizedArray(len);
+    this.solidPath = '';
 
 
     var path, properties = this.masksProperties;
@@ -27,8 +25,8 @@
             maskRef = 'mask';
         }
 
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count == 0){
-            rect = document.createElementNS(svgNS, 'rect');
+        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
+            rect = createNS( 'rect');
             rect.setAttribute('fill', '#ffffff');
             rect.setAttribute('width', this.element.comp.data.w);
             rect.setAttribute('height', this.element.comp.data.h);
@@ -37,49 +35,44 @@
             rect = null;
         }
 
-        path = document.createElementNS(svgNS, 'path');
+        path = createNS( 'path');
         if(properties[i].mode == 'n') {
+            // TODO move this to a factory or to a constructor
             this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.dynamicProperties),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3,this.dynamicProperties,null),
-                elem: path
+                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
+                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
+                elem: path,
+                lastPath: ''
             };
             defs.appendChild(path);
             continue;
         }
         count += 1;
 
-        if(properties[i].mode == 's'){
-            path.setAttribute('fill', '#000000');
-        }else{
-            path.setAttribute('fill', '#ffffff');
-        }
+        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
         path.setAttribute('clip-rule','nonzero');
+        var filterID;
 
-        if(properties[i].x.k !== 0){
+        if (properties[i].x.k !== 0) {
             maskType = 'mask';
             maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.dynamicProperties);
-            var filterID = 'fi_'+randomString(10);
-            expansor = document.createElementNS(svgNS,'filter');
+            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
+            filterID = 'fi_'+randomString(10);
+            expansor = createNS('filter');
             expansor.setAttribute('id',filterID);
-            feMorph = document.createElementNS(svgNS,'feMorphology');
+            feMorph = createNS('feMorphology');
             feMorph.setAttribute('operator','dilate');
             feMorph.setAttribute('in','SourceGraphic');
             feMorph.setAttribute('radius','0');
             expansor.appendChild(feMorph);
             defs.appendChild(expansor);
-            if(properties[i].mode == 's'){
-                path.setAttribute('stroke', '#000000');
-            }else{
-                path.setAttribute('stroke', '#ffffff');
-            }
-        }else{
+            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
+        } else {
             feMorph = null;
             x = null;
         }
 
-
+        // TODO move this to a factory or to a constructor
         this.storedData[i] = {
              elem: path,
              x: x,
@@ -91,16 +84,16 @@
         };
         if(properties[i].mode == 'i'){
             jLen = currentMasks.length;
-            var g = document.createElementNS(svgNS,'g');
+            var g = createNS('g');
             for(j=0;j<jLen;j+=1){
                 g.appendChild(currentMasks[j]);
             }
-            var mask = document.createElementNS(svgNS,'mask');
+            var mask = createNS('mask');
             mask.setAttribute('mask-type','alpha');
             mask.setAttribute('id',layerId+'_'+count);
             mask.appendChild(path);
             defs.appendChild(mask);
-            g.setAttribute('mask','url(#'+layerId+'_'+count+')');
+            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
 
             currentMasks.length = 0;
             currentMasks.push(g);
@@ -110,67 +103,62 @@
         if(properties[i].inv && !this.solidPath){
             this.solidPath = this.createLayerSolidPath();
         }
+        // TODO move this to a factory or to a constructor
         this.viewData[i] = {
             elem: path,
             lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.dynamicProperties),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3,this.dynamicProperties,null)
+            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
+            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
+            invRect: rect
         };
-        if(rect){
-            this.viewData[i].invRect = rect;
-        }
         if(!this.viewData[i].prop.k){
             this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
         }
     }
 
-    this.maskElement = document.createElementNS(svgNS, maskType);
+    this.maskElement = createNS( maskType);
 
     len = currentMasks.length;
     for(i=0;i<len;i+=1){
         this.maskElement.appendChild(currentMasks[i]);
     }
 
-    this.maskElement.setAttribute('id', layerId);
     if(count > 0){
-        this.element.maskedElement.setAttribute(maskRef, "url(#" + layerId + ")");
+        this.maskElement.setAttribute('id', layerId);
+        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
+        defs.appendChild(this.maskElement);
+    }
+    if (this.viewData.length) {
+        this.element.addRenderableComponent(this);
     }
 
-    defs.appendChild(this.maskElement);
-};
+}
 
 MaskElement.prototype.getMaskProperty = function(pos){
     return this.viewData[pos].prop;
 };
 
-MaskElement.prototype.prepareFrame = function(){
-    var i, len = this.dynamicProperties.length;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-
-    }
-};
-
-MaskElement.prototype.renderFrame = function (finalMat) {
+MaskElement.prototype.renderFrame = function (isFirstFrame) {
+    var finalMat = this.element.finalTransform.mat;
     var i, len = this.masksProperties.length;
     for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop.mdf || this.firstFrame){
+        if(this.viewData[i].prop._mdf || isFirstFrame){
             this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
         }
-        if(this.viewData[i].op.mdf || this.firstFrame){
+        if(this.viewData[i].op._mdf || isFirstFrame){
             this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
         }
         if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp.mdf || this.firstFrame)){
+            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
                 this.viewData[i].invRect.setAttribute('x', -finalMat.props[12]);
                 this.viewData[i].invRect.setAttribute('y', -finalMat.props[13]);
             }
-            if(this.storedData[i].x && (this.storedData[i].x.mdf || this.firstFrame)){
+            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
                 var feMorph = this.storedData[i].expan;
                 if(this.storedData[i].x.v < 0){
                     if(this.storedData[i].lastOperator !== 'erode'){
                         this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(#'+this.storedData[i].filterId+')');
+                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
                     }
                     feMorph.setAttribute('radius',-this.storedData[i].x.v);
                 }else{
@@ -184,7 +172,6 @@
             }
         }
     }
-    this.firstFrame = false;
 };
 
 MaskElement.prototype.getMaskelement = function () {
@@ -206,46 +193,31 @@
     len = pathNodes._length;
     for(i=1;i<len;i+=1){
         //pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[i][0]+','+pathNodes.i[i][1] + " "+pathNodes.v[i][0]+','+pathNodes.v[i][1];
-        pathString += " C"+bm_rnd(pathNodes.o[i-1][0])+','+bm_rnd(pathNodes.o[i-1][1]) + " "+bm_rnd(pathNodes.i[i][0])+','+bm_rnd(pathNodes.i[i][1]) + " "+bm_rnd(pathNodes.v[i][0])+','+bm_rnd(pathNodes.v[i][1]);
+        pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[i][0]+','+pathNodes.i[i][1] + " "+pathNodes.v[i][0]+','+pathNodes.v[i][1];
     }
         //pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1];
     if(pathNodes.c && len > 1){
-        pathString += " C"+bm_rnd(pathNodes.o[i-1][0])+','+bm_rnd(pathNodes.o[i-1][1]) + " "+bm_rnd(pathNodes.i[0][0])+','+bm_rnd(pathNodes.i[0][1]) + " "+bm_rnd(pathNodes.v[0][0])+','+bm_rnd(pathNodes.v[0][1]);
+        pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1];
     }
     //pathNodes.__renderedString = pathString;
 
 
     if(viewData.lastPath !== pathString){
+        var pathShapeValue = '';
         if(viewData.elem){
-            if(!pathNodes.c){
-                viewData.elem.setAttribute('d','');
-            }else if(pathData.inv){
-                viewData.elem.setAttribute('d',this.solidPath + pathString);
-            }else{
-                viewData.elem.setAttribute('d',pathString);
+            if(pathNodes.c){
+                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
             }
+            viewData.elem.setAttribute('d',pathShapeValue);
         }
         viewData.lastPath = pathString;
     }
 };
 
-MaskElement.prototype.getMask = function(nm){
-    var i = 0, len = this.masksProperties.length;
-    while(i<len){
-        if(this.masksProperties[i].nm === nm){
-            return {
-                maskPath: this.viewData[i].prop.pv
-            }
-        }
-        i += 1;
-    }
-};
-
 MaskElement.prototype.destroy = function(){
     this.element = null;
     this.globalData = null;
     this.maskElement = null;
     this.data = null;
-    this.paths = null;
     this.masksProperties = null;
 };
\ No newline at end of file
diff --git a/player/js/module.js b/player/js/module.js
index 99cae5b..dee9c84 100644
--- a/player/js/module.js
+++ b/player/js/module.js
@@ -1,69 +1,88 @@
-(function (root, factory) {
-    if(typeof define === "function" && define.amd) {
-        define( factory);
-    } else if(typeof module === "object" && module.exports) {
-        module.exports = factory();
+(typeof navigator !== "undefined") && (function(root, factory) {
+    if (typeof define === "function" && define.amd) {
+        define(function() {
+            return factory(root);
+        });
+    } else if (typeof module === "object" && module.exports) {
+        module.exports = factory(root);
     } else {
-        root.bodymovin = factory();
+        root.lottie = factory(root);
+        root.bodymovin = root.lottie;
     }
-}(window, function() {
-    var bodymovinjs = {};
+}((window || {}), function(window) {
+    "use strict";
+    /*<%= contents %>*/
+    var lottiejs = {};
 
+    function setLocationHref (href) {
+        locationHref = href;
+    }
     function play(animation){
         animationManager.play(animation);
     }
-    function pause(animation){
+
+    function pause(animation) {
         animationManager.pause(animation);
     }
-    function togglePause(animation){
+
+    function togglePause(animation) {
         animationManager.togglePause(animation);
     }
-    function setSpeed(value,animation){
+
+    function setSpeed(value, animation) {
         animationManager.setSpeed(value, animation);
     }
-    function setDirection(value,animation){
+
+    function setDirection(value, animation) {
         animationManager.setDirection(value, animation);
     }
-    function stop(animation){
+
+    function stop(animation) {
         animationManager.stop(animation);
     }
-    function moveFrame(value){
-        animationManager.moveFrame(value);
-    }
-    function searchAnimations(){
-        if(standalone === true){
-            animationManager.searchAnimations(animationData,standalone, renderer);
-        }else{
+
+    function searchAnimations() {
+        if (standalone === true) {
+            animationManager.searchAnimations(animationData, standalone, renderer);
+        } else {
             animationManager.searchAnimations();
         }
     }
-    function registerAnimation(elem){
+
+    function registerAnimation(elem) {
         return animationManager.registerAnimation(elem);
     }
-    function resize(){
+
+    function resize() {
         animationManager.resize();
     }
-    function start(){
+
+    /*function start() {
         animationManager.start();
+    }*/
+
+    function goToAndStop(val, isFrame, animation) {
+        animationManager.goToAndStop(val, isFrame, animation);
     }
-    function goToAndStop(val,isFrame, animation){
-        animationManager.goToAndStop(val,isFrame, animation);
-    }
-    function setSubframeRendering(flag){
+
+    function setSubframeRendering(flag) {
         subframeEnabled = flag;
     }
-    function loadAnimation(params){
-        if(standalone === true){
+
+    function loadAnimation(params) {
+        if (standalone === true) {
             params.animationData = JSON.parse(animationData);
         }
         return animationManager.loadAnimation(params);
     }
-    function destroy(animation){
+
+    function destroy(animation) {
         return animationManager.destroy(animation);
     }
-    function setQuality(value){
-        if(typeof value === 'string'){
-            switch(value){
+
+    function setQuality(value) {
+        if (typeof value === 'string') {
+            switch (value) {
                 case 'high':
                     defaultCurveSegments = 200;
                     break;
@@ -74,24 +93,28 @@
                     defaultCurveSegments = 10;
                     break;
             }
-        }else if(!isNaN(value) && value > 1){
+        } else if (!isNaN(value) && value > 1) {
             defaultCurveSegments = value;
         }
-        if(defaultCurveSegments >= 50){
+        if (defaultCurveSegments >= 50) {
             roundValues(false);
-        }else{
+        } else {
             roundValues(true);
         }
-
     }
-    function installPlugin(type,plugin){
-        if(type==='expressions'){
+
+    function inBrowser() {
+        return typeof navigator !== 'undefined';
+    }
+
+    function installPlugin(type, plugin) {
+        if (type === 'expressions') {
             expressionsPlugin = plugin;
         }
     }
 
-    function getFactory(name){
-        switch(name){
+    function getFactory(name) {
+        switch (name) {
             case "propertyFactory":
                 return PropertyFactory;
             case "shapePropertyFactory":
@@ -100,28 +123,28 @@
                 return Matrix;
         }
     }
+    lottiejs.play = play;
+    lottiejs.pause = pause;
+    lottiejs.setLocationHref = setLocationHref;
+    lottiejs.togglePause = togglePause;
+    lottiejs.setSpeed = setSpeed;
+    lottiejs.setDirection = setDirection;
+    lottiejs.stop = stop;
+    lottiejs.searchAnimations = searchAnimations;
+    lottiejs.registerAnimation = registerAnimation;
+    lottiejs.loadAnimation = loadAnimation;
+    lottiejs.setSubframeRendering = setSubframeRendering;
+    lottiejs.resize = resize;
+    //lottiejs.start = start;
+    lottiejs.goToAndStop = goToAndStop;
+    lottiejs.destroy = destroy;
+    lottiejs.setQuality = setQuality;
+    lottiejs.inBrowser = inBrowser;
+    lottiejs.installPlugin = installPlugin;
+    lottiejs.__getFactory = getFactory;
+    lottiejs.version = '[[BM_VERSION]]';
 
-    bodymovinjs.play = play;
-    bodymovinjs.pause = pause;
-    bodymovinjs.togglePause = togglePause;
-    bodymovinjs.setSpeed = setSpeed;
-    bodymovinjs.setDirection = setDirection;
-    bodymovinjs.stop = stop;
-    bodymovinjs.moveFrame = moveFrame;
-    bodymovinjs.searchAnimations = searchAnimations;
-    bodymovinjs.registerAnimation = registerAnimation;
-    bodymovinjs.loadAnimation = loadAnimation;
-    bodymovinjs.setSubframeRendering = setSubframeRendering;
-    bodymovinjs.resize = resize;
-    bodymovinjs.start = start;
-    bodymovinjs.goToAndStop = goToAndStop;
-    bodymovinjs.destroy = destroy;
-    bodymovinjs.setQuality = setQuality;
-    bodymovinjs.installPlugin = installPlugin;
-    bodymovinjs.__getFactory = getFactory;
-    bodymovinjs.version = '4.1.9';
-
-    function checkReady(){
+    function checkReady() {
         if (document.readyState === "complete") {
             clearInterval(readyStateCheckInterval);
             searchAnimations();
@@ -137,20 +160,18 @@
             }
         }
     }
-
     var standalone = '__[STANDALONE]__';
     var animationData = '__[ANIMATIONDATA]__';
-
     var renderer = '';
-    if(standalone) {
+    if (standalone) {
         var scripts = document.getElementsByTagName('script');
         var index = scripts.length - 1;
-        var myScript = scripts[index] || { src: '' };
-        var queryString = myScript.src.replace(/^[^\?]+\??/,'');
+        var myScript = scripts[index] || {
+            src: ''
+        };
+        var queryString = myScript.src.replace(/^[^\?]+\??/, '');
         renderer = getQueryVariable('renderer');
     }
-
     var readyStateCheckInterval = setInterval(checkReady, 100);
-
-    return bodymovinjs;
+    return lottiejs;
 }));
diff --git a/player/js/players/BasicPlayer.js b/player/js/players/BasicPlayer.js
index 4f82e04..2551948 100644
--- a/player/js/players/BasicPlayer.js
+++ b/player/js/players/BasicPlayer.js
@@ -24,7 +24,7 @@
     wrapper.addEventListener('bmPlay',function(){self.playStarted();});
     wrapper.addEventListener('bmPause',function(){self.pauseStarted();});
 
-    this.controls = document.createElement('div');
+    this.controls = createTag('div');
     this.controls.style.width = '100%';
     this.controls.style.height = '70px';
     this.controls.style.position = 'absolute';
@@ -32,16 +32,14 @@
     this.controls.style.bottom = 0;
     this.controls.style.backgroundColor = 'rgba(0,0,0,.3)';
     wrapper.appendChild(this.controls);
-    styleUnselectableDiv(this.controls);
 
-    this.scrollBar = document.createElement('div');
+    this.scrollBar = createTag('div');
     this.scrollBar.style.width = '100%';
     this.scrollBar.style.height = '14px';
     this.scrollBar.style.backgroundColor = 'rgba(25,25,25,1)';
-    styleUnselectableDiv(this.scrollBar);
     this.controls.appendChild(this.scrollBar);
 
-    this.scrollBarThumb = document.createElement('div');
+    this.scrollBarThumb = createTag('div');
     this.scrollBarThumb.style.width = '18px';
     this.scrollBarThumb.style.height = '18px';
     this.scrollBarThumb.style.position = 'absolute';
@@ -53,7 +51,6 @@
     this.scrollBarThumb.style.backgroundColor = 'rgba(255,255,255,1)';
     this.scrollBarThumb.style.cursor = 'pointer';
     this.controls.appendChild(this.scrollBarThumb);
-    styleUnselectableDiv(this.scrollBarThumb);
 
     this.scrollBar.addEventListener('mousedown', function (ev) {
         var mousePos = ev.layerX;
@@ -64,7 +61,7 @@
         self.scrollAnimation();
     });
 
-    this.playButton = document.createElement('div');
+    this.playButton = createTag('div');
     this.playButton.style.width = '40px';
     this.playButton.style.height = '30px';
     this.playButton.style.marginTop = '12px';
@@ -80,12 +77,11 @@
     this.playAnimation = animationManager.registerAnimation(this.playButton);
     this.playAnimation.loop = false;
     this.controls.appendChild(this.playButton);
-    styleUnselectableDiv(this.playButton);
     this.playButton.addEventListener('click', function () {
         self.animationItem.play();
     });
 
-    this.pauseButton = document.createElement('div');
+    this.pauseButton = createTag('div');
     this.pauseButton.style.width = '40px';
     this.pauseButton.style.height = '30px';
     this.pauseButton.style.marginTop = '12px';
@@ -101,7 +97,6 @@
     this.pauseAnimation.wrapper.addEventListener('bmLoaded',function(){self.pauseAnimation.goToAndStop(self.pauseAnimation.totalFrames - 1);});
     this.pauseAnimation.loop = false;
     this.controls.appendChild(this.pauseButton);
-    styleUnselectableDiv(this.pauseButton);
     this.pauseButton.addEventListener('click', function () {
         self.animationItem.pause();
     });
diff --git a/player/js/renderers/BaseRenderer.js b/player/js/renderers/BaseRenderer.js
index f15dd8f..20227c2 100644
--- a/player/js/renderers/BaseRenderer.js
+++ b/player/js/renderers/BaseRenderer.js
@@ -23,21 +23,21 @@
             return this.createComp(layer);
         case 1:
             return this.createSolid(layer);
+        case 3:
+            return this.createNull(layer);
         case 4:
             return this.createShape(layer);
         case 5:
             return this.createText(layer);
         case 13:
             return this.createCamera(layer);
-        case 99:
-            return null;
     }
-    return this.createBase(layer);
+    return this.createNull(layer);
 };
 
 BaseRenderer.prototype.createCamera = function(){
     throw new Error('You\'re using a 3d camera. Try the html renderer.');
-}
+};
 
 BaseRenderer.prototype.buildAllItems = function(){
     var i, len = this.layers.length;
@@ -72,27 +72,24 @@
         this.buildAllItems();
     }
 };
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy){
-    hierarchy = hierarchy || [];
+BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
     var elements = this.elements;
     var layers = this.layers;
     var i=0, len = layers.length;
-    while(i<len){
-        if(layers[i].ind == parentName){
-            if(!elements[i] || elements[i] === true){
+    while (i < len) {
+        if (layers[i].ind == parentName) {
+            if (!elements[i] || elements[i] === true) {
                 this.buildItem(i);
                 this.addPendingElement(element);
-            } else if(layers[i].parent !== undefined){
-                hierarchy.push(elements[i]);
-                elements[i]._isParent = true;
-                this.buildElementParenting(element,layers[i].parent, hierarchy);
             } else {
                 hierarchy.push(elements[i]);
-                elements[i]._isParent = true;
-                element.setHierarchy(hierarchy);
+                elements[i].setAsParent();
+                if(layers[i].parent !== undefined) {
+                    this.buildElementParenting(element, layers[i].parent, hierarchy);
+                } else {
+                    element.setHierarchy(hierarchy);
+                }
             }
-
-
         }
         i += 1;
     }
@@ -100,4 +97,15 @@
 
 BaseRenderer.prototype.addPendingElement = function(element){
     this.pendingElements.push(element);
-};
\ No newline at end of file
+};
+
+BaseRenderer.prototype.searchExtraCompositions = function(assets){
+    var i, len = assets.length;
+    for(i=0;i<len;i+=1){
+        if(assets[i].xt){
+            var comp = this.createComp(assets[i]);
+            comp.initExpressions();
+            this.globalData.projectInterface.registerComposition(comp);
+        }
+    }
+};
diff --git a/player/js/renderers/CanvasRenderer.js b/player/js/renderers/CanvasRenderer.js
index da1b013..3579c70 100644
--- a/player/js/renderers/CanvasRenderer.js
+++ b/player/js/renderers/CanvasRenderer.js
@@ -4,7 +4,8 @@
         clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
         context: (config && config.context) || null,
         progressiveLoad: (config && config.progressiveLoad) || false,
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet'
+        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+        className: (config && config.className) || ''
     };
     this.renderConfig.dpr = (config && config.dpr) || 1;
     if (this.animationItem.wrapper) {
@@ -12,50 +13,42 @@
     }
     this.renderedFrame = -1;
     this.globalData = {
-        frameNum: -1
-    };
-    this.contextData = {
-        saved : Array.apply(null,{length:15}),
-        savedOp: Array.apply(null,{length:15}),
-        cArrPos : 0,
-        cTr : new Matrix(),
-        cO : 1
+        frameNum: -1,
+        _mdf: false,
+        renderConfig: this.renderConfig,
+        currentGlobalAlpha: -1
     };
     var i, len = 15;
-    for(i=0;i<len;i+=1){
-        this.contextData.saved[i] = Array.apply(null,{length:16});
-    }
+    this.contextData = new CVContextData();
     this.elements = [];
     this.pendingElements = [];
     this.transformMat = new Matrix();
     this.completeLayers = false;
 }
-extendPrototype(BaseRenderer,CanvasRenderer);
-
-CanvasRenderer.prototype.createBase = function (data) {
-    return new CVBaseElement(data, this, this.globalData);
-};
+extendPrototype([BaseRenderer],CanvasRenderer);
 
 CanvasRenderer.prototype.createShape = function (data) {
-    return new CVShapeElement(data, this, this.globalData);
+    return new CVShapeElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createText = function (data) {
-    return new CVTextElement(data, this, this.globalData);
+    return new CVTextElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createImage = function (data) {
-    return new CVImageElement(data, this, this.globalData);
+    return new CVImageElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createComp = function (data) {
-    return new CVCompElement(data, this, this.globalData);
+    return new CVCompElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createSolid = function (data) {
-    return new CVSolidElement(data, this, this.globalData);
+    return new CVSolidElement(data, this.globalData, this);
 };
 
+CanvasRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
+
 CanvasRenderer.prototype.ctxTransform = function(props){
     if(props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0){
         return;
@@ -65,7 +58,8 @@
         return;
     }
     this.transformMat.cloneFromProps(props);
-    this.transformMat.transform(this.contextData.cTr.props[0],this.contextData.cTr.props[1],this.contextData.cTr.props[2],this.contextData.cTr.props[3],this.contextData.cTr.props[4],this.contextData.cTr.props[5],this.contextData.cTr.props[6],this.contextData.cTr.props[7],this.contextData.cTr.props[8],this.contextData.cTr.props[9],this.contextData.cTr.props[10],this.contextData.cTr.props[11],this.contextData.cTr.props[12],this.contextData.cTr.props[13],this.contextData.cTr.props[14],this.contextData.cTr.props[15])
+    var cProps = this.contextData.cTr.props;
+    this.transformMat.transform(cProps[0],cProps[1],cProps[2],cProps[3],cProps[4],cProps[5],cProps[6],cProps[7],cProps[8],cProps[9],cProps[10],cProps[11],cProps[12],cProps[13],cProps[14],cProps[15]);
     //this.contextData.cTr.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]);
     this.contextData.cTr.cloneFromProps(this.transformMat.props);
     var trProps = this.contextData.cTr.props;
@@ -73,15 +67,19 @@
 };
 
 CanvasRenderer.prototype.ctxOpacity = function(op){
-    if(op === 1){
+    /*if(op === 1){
         return;
-    }
+    }*/
     if(!this.renderConfig.clearCanvas){
         this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
+        this.globalData.currentGlobalAlpha = this.contextData.cO;
         return;
     }
     this.contextData.cO *= op < 0 ? 0 : op;
-    this.canvasContext.globalAlpha = this.contextData.cO;
+    if(this.globalData.currentGlobalAlpha !== this.contextData.cO) {
+        this.canvasContext.globalAlpha = this.contextData.cO;
+        this.globalData.currentGlobalAlpha = this.contextData.cO;
+    }
 };
 
 CanvasRenderer.prototype.reset = function(){
@@ -89,9 +87,7 @@
         this.canvasContext.restore();
         return;
     }
-    this.contextData.cArrPos = 0;
-    this.contextData.cTr.reset();
-    this.contextData.cO = 1;
+    this.contextData.reset();
 };
 
 CanvasRenderer.prototype.save = function(actionFlag){
@@ -103,11 +99,11 @@
         this.canvasContext.save();
     }
     var props = this.contextData.cTr.props;
-    if(this.contextData.saved[this.contextData.cArrPos] === null || this.contextData.saved[this.contextData.cArrPos] === undefined){
-        this.contextData.saved[this.contextData.cArrPos] = new Array(16);
+    if(this.contextData._length <= this.contextData.cArrPos) {
+        this.contextData.duplicate();
     }
-    var i,arr = this.contextData.saved[this.contextData.cArrPos];
-    for(i=0;i<16;i+=1){
+    var i, arr = this.contextData.saved[this.contextData.cArrPos];
+    for (i = 0; i < 16; i += 1) {
         arr[i] = props[i];
     }
     this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
@@ -121,6 +117,7 @@
     }
     if(actionFlag){
         this.canvasContext.restore();
+        this.globalData.blendMode = 'source-over';
     }
     this.contextData.cArrPos -= 1;
     var popped = this.contextData.saved[this.contextData.cArrPos];
@@ -131,7 +128,10 @@
     this.canvasContext.setTransform(popped[0],popped[1],popped[4],popped[5],popped[12],popped[13]);
     popped = this.contextData.savedOp[this.contextData.cArrPos];
     this.contextData.cO = popped;
-    this.canvasContext.globalAlpha = popped;
+    if(this.globalData.currentGlobalAlpha !== popped) {
+        this.canvasContext.globalAlpha = popped;
+        this.globalData.currentGlobalAlpha = popped;
+    }
 };
 
 CanvasRenderer.prototype.configAnimation = function(animData){
@@ -140,7 +140,7 @@
     animData.w = animData.w/blitter;
     animData.h = animData.h/blitter;
     if(this.animationItem.wrapper){
-        this.animationItem.container = document.createElement('canvas');
+        this.animationItem.container = createTag('canvas');
         this.animationItem.container.style.width = '100%';
         this.animationItem.container.style.height = '100%';
         //this.animationItem.container.style.transform = 'translate3d(0,0,0)';
@@ -148,6 +148,9 @@
         this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
         this.animationItem.wrapper.appendChild(this.animationItem.container);
         this.canvasContext = this.animationItem.container.getContext('2d');
+        if(this.renderConfig.className) {
+            this.animationItem.container.setAttribute('class', this.renderConfig.className);
+        }
     }else{
         this.canvasContext = this.renderConfig.context;
     }
@@ -166,9 +169,14 @@
     };
     this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
     this.layers = animData.layers;
-    this.transformCanvas = {};
-    this.transformCanvas.w = animData.w;
-    this.transformCanvas.h = animData.h;
+    this.transformCanvas = {
+        w: animData.w,
+        h:animData.h,
+        sx:0,
+        sy:0,
+        tx:0,
+        ty:0
+    };
     this.globalData.fontManager = new FontManager();
     this.globalData.fontManager.addChars(animData.chars);
     this.globalData.fontManager.addFonts(animData.fonts,document.body);
@@ -177,12 +185,13 @@
     this.globalData.elementLoaded = this.animationItem.elementLoaded.bind(this.animationItem);
     this.globalData.addPendingElement = this.animationItem.addPendingElement.bind(this.animationItem);
     this.globalData.transformCanvas = this.transformCanvas;
-    this.elements = Array.apply(null,{length:animData.layers.length});
+    this.elements = createSizedArray(animData.layers.length);
 
     this.updateContainerSize();
 };
 
 CanvasRenderer.prototype.updateContainerSize = function () {
+    this.reset();
     var elementWidth,elementHeight;
     if(this.animationItem.wrapper && this.animationItem.container){
         elementWidth = this.animationItem.wrapper.offsetWidth;
@@ -237,12 +246,17 @@
         this.transformCanvas.ty = 0;
     }
     this.transformCanvas.props = [this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1];
-    var i, len = this.elements.length;
+    /*var i, len = this.elements.length;
     for(i=0;i<len;i+=1){
         if(this.elements[i] && this.elements[i].data.ty === 0){
             this.elements[i].resize(this.globalData.transformCanvas);
         }
-    }
+    }*/
+    this.ctxTransform(this.transformCanvas.props);
+    this.canvasContext.beginPath();
+    this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
+    this.canvasContext.closePath();
+    this.canvasContext.clip();
 };
 
 CanvasRenderer.prototype.destroy = function () {
@@ -251,7 +265,9 @@
     }
     var i, len = this.layers ? this.layers.length : 0;
     for (i = len - 1; i >= 0; i-=1) {
-        this.elements[i].destroy();
+        if(this.elements[i]) {
+            this.elements[i].destroy();
+        }
     }
     this.elements.length = 0;
     this.globalData.canvasContext = null;
@@ -260,29 +276,17 @@
 };
 
 CanvasRenderer.prototype.renderFrame = function(num){
-    if((this.renderedFrame == num && this.renderConfig.clearCanvas === true) || this.destroyed || num === null){
+    if((this.renderedFrame == num && this.renderConfig.clearCanvas === true) || this.destroyed || num === -1){
         return;
     }
     this.renderedFrame = num;
-    this.globalData.frameNum = num - this.animationItem.firstFrame;
+    this.globalData.frameNum = num - this.animationItem._isFirstFrame;
     this.globalData.frameId += 1;
+    this.globalData._mdf = false;
     this.globalData.projectInterface.currentFrame = num;
-    if(this.renderConfig.clearCanvas === true){
-        this.reset();
-        this.canvasContext.save();
-        //this.canvasContext.canvas.width = this.canvasContext.canvas.width;
-        this.canvasContext.clearRect(this.transformCanvas.tx, this.transformCanvas.ty, this.transformCanvas.w*this.transformCanvas.sx, this.transformCanvas.h*this.transformCanvas.sy);
-    }else{
-        this.save();
-    }
-    this.ctxTransform(this.transformCanvas.props);
-    this.canvasContext.beginPath();
-    this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
-    this.canvasContext.closePath();
-    this.canvasContext.clip();
 
-    //console.log('--------');
-    //console.log('NEW: ',num);
+     // console.log('--------');
+     // console.log('NEW: ',num);
     var i, len = this.layers.length;
     if(!this.completeLayers){
         this.checkLayers(num);
@@ -293,15 +297,20 @@
             this.elements[i].prepareFrame(num - this.layers[i].st);
         }
     }
-    for (i = len - 1; i >= 0; i-=1) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
+    if(this.globalData._mdf) {
+        if(this.renderConfig.clearCanvas === true){
+            this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+        }else{
+            this.save();
         }
-    }
-    if(this.renderConfig.clearCanvas !== true){
-        this.restore();
-    } else {
-        this.canvasContext.restore();
+        for (i = len - 1; i >= 0; i-=1) {
+            if(this.completeLayers || this.elements[i]){
+                this.elements[i].renderFrame();
+            }
+        }
+        if(this.renderConfig.clearCanvas !== true){
+            this.restore();
+        }
     }
 };
 
@@ -313,9 +322,9 @@
     var element = this.createItem(this.layers[pos], this,this.globalData);
     elements[pos] = element;
     element.initExpressions();
-    if(this.layers[pos].ty === 0){
+    /*if(this.layers[pos].ty === 0){
         element.resize(this.globalData.transformCanvas);
-    }
+    }*/
 };
 
 CanvasRenderer.prototype.checkPendingElements  = function(){
@@ -332,17 +341,3 @@
 CanvasRenderer.prototype.show = function(){
     this.animationItem.container.style.display = 'block';
 };
-
-CanvasRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    var floatingContainer = document.createElementNS(svgNS,'g');
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i],this.globalData.comp,this.globalData);
-            comp.initExpressions();
-            //comp.compInterface = CompExpressionInterface(comp);
-            //Expressions.addLayersInterface(comp.elements, this.globalData.projectInterface);
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
\ No newline at end of file
diff --git a/player/js/renderers/HybridRenderer.js b/player/js/renderers/HybridRenderer.js
index cd656b1..c8da087 100644
--- a/player/js/renderers/HybridRenderer.js
+++ b/player/js/renderers/HybridRenderer.js
@@ -1,9 +1,15 @@
-function HybridRenderer(animationItem){
+function HybridRenderer(animationItem, config){
     this.animationItem = animationItem;
     this.layers = null;
     this.renderedFrame = -1;
+    this.renderConfig = {
+        className: (config && config.className) || '',
+        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true
+    };
     this.globalData = {
-        frameNum: -1
+        _mdf: false,
+        frameNum: -1,
+        renderConfig: this.renderConfig
     };
     this.pendingElements = [];
     this.elements = [];
@@ -14,7 +20,7 @@
 
 }
 
-extendPrototype(BaseRenderer,HybridRenderer);
+extendPrototype([BaseRenderer],HybridRenderer);
 
 HybridRenderer.prototype.buildItem = SVGRenderer.prototype.buildItem;
 
@@ -26,96 +32,114 @@
 };
 
 HybridRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
+    var newDOMElement = element.getBaseElement();
+    if(!newDOMElement){
         return;
     }
     var layer = this.layers[pos];
     if(!layer.ddd || !this.supports3d){
-        var i = 0;
-        var nextElement;
-        while(i<pos){
-            if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement){
-                nextElement = this.elements[i].getBaseElement();
-            }
-            i += 1;
-        }
-        if(nextElement){
-            if(!layer.ddd || !this.supports3d){
-                this.layerElement.insertBefore(newElement, nextElement);
-            }
+        if(this.threeDElements) {
+            this.addTo3dContainer(newDOMElement,pos);
         } else {
-            if(!layer.ddd || !this.supports3d){
-                this.layerElement.appendChild(newElement);
+            var i = 0;
+            var nextDOMElement, nextLayer, tmpDOMElement;
+            while(i<pos){
+                if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement){
+                    nextLayer = this.elements[i];
+                    tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
+                    nextDOMElement = tmpDOMElement || nextDOMElement;
+                }
+                i += 1;
+            }
+            if(nextDOMElement){
+                if(!layer.ddd || !this.supports3d){
+                    this.layerElement.insertBefore(newDOMElement, nextDOMElement);
+                }
+            } else {
+                if(!layer.ddd || !this.supports3d){
+                    this.layerElement.appendChild(newDOMElement);
+                }
             }
         }
+        
     } else {
-        this.addTo3dContainer(newElement,pos);
+        this.addTo3dContainer(newDOMElement,pos);
     }
 };
 
-
-HybridRenderer.prototype.createBase = function (data) {
-    return new SVGBaseElement(data, this.layerElement,this.globalData,this);
-};
-
 HybridRenderer.prototype.createShape = function (data) {
     if(!this.supports3d){
-        return new IShapeElement(data, this.layerElement,this.globalData,this);
+        return new SVGShapeElement(data, this.globalData, this);
     }
-    return new HShapeElement(data, this.layerElement,this.globalData,this);
+    return new HShapeElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createText = function (data) {
     if(!this.supports3d){
-        return new SVGTextElement(data, this.layerElement,this.globalData,this);
+        return new SVGTextElement(data, this.globalData, this);
     }
-    return new HTextElement(data, this.layerElement,this.globalData,this);
+    return new HTextElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createCamera = function (data) {
-    this.camera = new HCameraElement(data, this.layerElement,this.globalData,this);
+    this.camera = new HCameraElement(data, this.globalData, this);
     return this.camera;
 };
 
 HybridRenderer.prototype.createImage = function (data) {
     if(!this.supports3d){
-        return new IImageElement(data, this.layerElement,this.globalData,this);
+        return new IImageElement(data, this.globalData, this);
     }
-    return new HImageElement(data, this.layerElement,this.globalData,this);
+    return new HImageElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createComp = function (data) {
     if(!this.supports3d){
-        return new ICompElement(data, this.layerElement,this.globalData,this);
+        return new SVGCompElement(data, this.globalData, this);
     }
-    return new HCompElement(data, this.layerElement,this.globalData,this);
+    return new HCompElement(data, this.globalData, this);
 
 };
 
 HybridRenderer.prototype.createSolid = function (data) {
     if(!this.supports3d){
-        return new ISolidElement(data, this.layerElement,this.globalData,this);
+        return new ISolidElement(data, this.globalData, this);
     }
-    return new HSolidElement(data, this.layerElement,this.globalData,this);
+    return new HSolidElement(data, this.globalData, this);
 };
 
-HybridRenderer.prototype.getThreeDContainer = function(pos){
-    var perspectiveElem = document.createElement('div');
+HybridRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
+
+HybridRenderer.prototype.getThreeDContainerByPos = function(pos){
+    var i = 0, len = this.threeDElements.length;
+    while(i<len) {
+        if(this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
+            return this.threeDElements[i].perspectiveElem;
+        }
+        i += 1;
+    }
+};
+
+HybridRenderer.prototype.createThreeDContainer = function(pos, type){
+    var perspectiveElem = createTag('div');
     styleDiv(perspectiveElem);
-    perspectiveElem.style.width = this.globalData.compSize.w+'px';
-    perspectiveElem.style.height = this.globalData.compSize.h+'px';
-    perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%";
-    var container = document.createElement('div');
+    var container = createTag('div');
     styleDiv(container);
-    container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+    if(type === '3d') {
+        perspectiveElem.style.width = this.globalData.compSize.w+'px';
+        perspectiveElem.style.height = this.globalData.compSize.h+'px';
+        perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%";
+        container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+    }
+    
     perspectiveElem.appendChild(container);
-    this.resizerElem.appendChild(perspectiveElem);
+    //this.resizerElem.appendChild(perspectiveElem);
     var threeDContainerData = {
         container:container,
         perspectiveElem:perspectiveElem,
         startPos: pos,
-        endPos: pos
+        endPos: pos,
+        type: type
     };
     this.threeDElements.push(threeDContainerData);
     return threeDContainerData;
@@ -124,16 +148,26 @@
 HybridRenderer.prototype.build3dContainers = function(){
     var i, len = this.layers.length;
     var lastThreeDContainerData;
+    var currentContainer = '';
     for(i=0;i<len;i+=1){
-        if(this.layers[i].ddd){
-            if(!lastThreeDContainerData){
-                lastThreeDContainerData = this.getThreeDContainer(i);
+        if(this.layers[i].ddd && this.layers[i].ty !== 3){
+            if(currentContainer !== '3d'){
+                currentContainer = '3d';
+                lastThreeDContainerData = this.createThreeDContainer(i,'3d');
             }
             lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
         } else {
-            lastThreeDContainerData = null;
+            if(currentContainer !== '2d'){
+                currentContainer = '2d';
+                lastThreeDContainerData = this.createThreeDContainer(i,'2d');
+            }
+            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
         }
     }
+    len = this.threeDElements.length;
+    for(i = len - 1; i >= 0; i --) {
+        this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
+    }
 };
 
 HybridRenderer.prototype.addTo3dContainer = function(elem,pos){
@@ -160,22 +194,25 @@
 };
 
 HybridRenderer.prototype.configAnimation = function(animData){
-    var resizerElem = document.createElement('div');
+    var resizerElem = createTag('div');
     var wrapper = this.animationItem.wrapper;
     resizerElem.style.width = animData.w+'px';
     resizerElem.style.height = animData.h+'px';
     this.resizerElem = resizerElem;
     styleDiv(resizerElem);
     resizerElem.style.transformStyle = resizerElem.style.webkitTransformStyle = resizerElem.style.mozTransformStyle = "flat";
+    if(this.renderConfig.className) {
+      resizerElem.setAttribute('class', this.renderConfig.className);
+    }
     wrapper.appendChild(resizerElem);
 
     resizerElem.style.overflow = 'hidden';
-    var svg = document.createElementNS(svgNS,'svg');
+    var svg = createNS('svg');
     svg.setAttribute('width','1');
     svg.setAttribute('height','1');
     styleDiv(svg);
     this.resizerElem.appendChild(svg);
-    var defs = document.createElementNS(svgNS,'defs');
+    var defs = createNS('defs');
     svg.appendChild(defs);
     this.globalData.defs = defs;
     this.data = animData;
@@ -257,7 +294,7 @@
 
 HybridRenderer.prototype.searchExtraCompositions = function(assets){
     var i, len = assets.length;
-    var floatingContainer = document.createElement('div');
+    var floatingContainer = createTag('div');
     for(i=0;i<len;i+=1){
         if(assets[i].xt){
             var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
@@ -265,4 +302,4 @@
             this.globalData.projectInterface.registerComposition(comp);
         }
     }
-};
\ No newline at end of file
+};
diff --git a/player/js/renderers/PIXIRenderer.js b/player/js/renderers/PIXIRenderer.js
index 32babd0..8c1f3a6 100644
--- a/player/js/renderers/PIXIRenderer.js
+++ b/player/js/renderers/PIXIRenderer.js
@@ -15,34 +15,36 @@
 
 }
 
-extendPrototype(BaseRenderer,PIXIRenderer);
+extendPrototype([BaseRenderer],PIXIRenderer);
 
 PIXIRenderer.prototype.createBase = function (data) {
-    return new PIXIBaseElement(data, this.layerElement,this.globalData,this);
+    return new PIXIBaseElement(data,this.globalData,this);
 };
 
 PIXIRenderer.prototype.createShape = function (data) {
-    return new PIXIShapeElement(data, this.layerElement,this.globalData,this);
+    return new PIXIShapeElement(data,this.globalData,this);
 };
 
 PIXIRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data, this.layerElement,this.globalData,this);
+    return new SVGTextElement(data,this.globalData,this);
 
 };
 
 PIXIRenderer.prototype.createImage = function (data) {
-    return new PIXIImageElement(data, this.layerElement,this.globalData,this);
+    return new PIXIImageElement(data,this.globalData,this);
 };
 
 PIXIRenderer.prototype.createComp = function (data) {
-    return new PIXICompElement(data, this.layerElement,this.globalData,this);
+    return new PIXICompElement(data,this.globalData,this);
 
 };
 
 PIXIRenderer.prototype.createSolid = function (data) {
-    return new PIXISolidElement(data, this.layerElement,this.globalData,this);
+    return new PIXISolidElement(data,this.globalData,this);
 };
 
+PIXIRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
+
 PIXIRenderer.prototype.configAnimation = function(animData){
     animData.width = animData.width/blitter;
     animData.height = animData.height/blitter;
@@ -62,7 +64,7 @@
     //this.animationItem.wrapper.appendChild(this.layerElement);
     ///
     this.renderer = new PIXI.WebGLRenderer(animData.w, animData.h,{antialias:true,transparent:true});
-    this.renderer.view.style.transform = 'scale(0.5,0.5)';
+    //this.renderer.view.style.transform = 'scale(0.5,0.5)';
     this.renderer.view.style.transformOrigin = '0 0';
     this.animationItem.wrapper.appendChild(this.renderer.view);
     this.stage = new PIXI.Container();
@@ -184,29 +186,22 @@
 
 PIXIRenderer.prototype.appendElementInPos = function(element, pos){
     var newElement = element.getBaseElement();
-    var newPIXIElement = element.getPBaseElement();
-    if(!newPIXIElement){
-        console.log(element);
-    }
     if(!newElement){
         return;
     }
     var i = 0;
-    var nextElement,pNextElement;
+    var nextElement;
     while(i<pos){
         if(this.elements[i] && this.elements[i].getBaseElement()){
             nextElement = this.elements[i].getBaseElement();
-            pNextElement = this.elements[i].getPBaseElement();
         }
         i += 1;
     }
     if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-        var index = this.PLayerElement.getChildIndex(pNextElement);
-        this.PLayerElement.addChildAt(newPIXIElement,index);
+        var index = this.PLayerElement.getChildIndex(nextElement);
+        this.PLayerElement.addChildAt(newElement,index);
     } else {
-        this.layerElement.appendChild(newElement);
-        this.PLayerElement.addChild(newPIXIElement);
+        this.PLayerElement.addChild(newElement);
     }
 };
 
diff --git a/player/js/renderers/SVGRenderer.js b/player/js/renderers/SVGRenderer.js
index dd39cc5..d04df7f 100644
--- a/player/js/renderers/SVGRenderer.js
+++ b/player/js/renderers/SVGRenderer.js
@@ -2,12 +2,28 @@
     this.animationItem = animationItem;
     this.layers = null;
     this.renderedFrame = -1;
-    this.globalData = {
-        frameNum: -1
-    };
+    this.svgElement = createNS('svg');
+    var maskElement = createNS('g');
+    this.svgElement.appendChild(maskElement);
+    this.layerElement = maskElement;
+    var defs = createNS( 'defs');
+    this.svgElement.appendChild(defs);
     this.renderConfig = {
         preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        progressiveLoad: (config && config.progressiveLoad) || false
+        progressiveLoad: (config && config.progressiveLoad) || false,
+        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
+        viewBoxOnly: (config && config.viewBoxOnly) || false,
+        viewBoxSize: (config && config.viewBoxSize) || false,
+        className: (config && config.className) || ''
+    };
+    this.globalData = {
+        _mdf: false,
+        frameNum: -1,
+        defs: defs,
+        frameId: 0,
+        compSize: {w:0,h:0},
+        renderConfig: this.renderConfig,
+        fontManager: new FontManager()
     };
     this.elements = [];
     this.pendingElements = [];
@@ -15,67 +31,70 @@
 
 }
 
-extendPrototype(BaseRenderer,SVGRenderer);
+extendPrototype([BaseRenderer],SVGRenderer);
 
-SVGRenderer.prototype.createBase = function (data) {
-    return new SVGBaseElement(data, this.layerElement,this.globalData,this);
+SVGRenderer.prototype.createNull = function (data) {
+    return new NullElement(data,this.globalData,this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new IShapeElement(data, this.layerElement,this.globalData,this);
+    return new SVGShapeElement(data,this.globalData,this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data, this.layerElement,this.globalData,this);
+    return new SVGTextElement(data,this.globalData,this);
 
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data, this.layerElement,this.globalData,this);
+    return new IImageElement(data,this.globalData,this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new ICompElement(data, this.layerElement,this.globalData,this);
+    return new SVGCompElement(data,this.globalData,this);
 
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data, this.layerElement,this.globalData,this);
+    return new ISolidElement(data,this.globalData,this);
 };
 
 SVGRenderer.prototype.configAnimation = function(animData){
-    animData.width = animData.width/blitter;
-    animData.height = animData.height/blitter;
-    animData.w = animData.w/blitter;
-    animData.h = animData.h/blitter;
-    this.layerElement = document.createElementNS(svgNS,'svg');
-    this.layerElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    this.layerElement.setAttribute('width',animData.w);
-    this.layerElement.setAttribute('height',animData.h);
-    this.layerElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    this.layerElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    this.layerElement.style.width = '100%';
-    this.layerElement.style.height = '100%';
+    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
+    if(this.renderConfig.viewBoxSize) {
+        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
+    } else {
+        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
+    }
+
+    if(!this.renderConfig.viewBoxOnly) {
+        this.svgElement.setAttribute('width',animData.w);
+        this.svgElement.setAttribute('height',animData.h);
+        this.svgElement.style.width = '100%';
+        this.svgElement.style.height = '100%';
+        this.svgElement.style.transform = 'translate3d(0,0,0)';
+    }
+    if(this.renderConfig.className) {
+        this.svgElement.setAttribute('class', this.renderConfig.className);
+    }
+    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
     //this.layerElement.style.transform = 'translate3d(0,0,0)';
     //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.layerElement);
+    this.animationItem.wrapper.appendChild(this.svgElement);
     //Mask animation
-    var defs = document.createElementNS(svgNS, 'defs');
-    this.globalData.defs = defs;
-    this.layerElement.appendChild(defs);
+    var defs = this.globalData.defs;
+
     this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
     this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
     this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.frameId = 0;
     this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    };
-    this.data = animData;
+    this.globalData.compSize.w = animData.w;
+    this.globalData.compSize.h = animData.h;
     this.globalData.frameRate = animData.fr;
-    var maskElement = document.createElementNS(svgNS, 'clipPath');
-    var rect = document.createElementNS(svgNS,'rect');
+    this.data = animData;
+
+    var maskElement = createNS( 'clipPath');
+    var rect = createNS('rect');
     rect.setAttribute('width',animData.w);
     rect.setAttribute('height',animData.h);
     rect.setAttribute('x',0);
@@ -83,16 +102,13 @@
     var maskId = 'animationMask_'+randomString(10);
     maskElement.setAttribute('id', maskId);
     maskElement.appendChild(rect);
-    var maskedElement = document.createElementNS(svgNS,'g');
-    maskedElement.setAttribute("clip-path", "url(#"+maskId+")");
-    this.layerElement.appendChild(maskedElement);
+    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+
     defs.appendChild(maskElement);
-    this.layerElement = maskedElement;
     this.layers = animData.layers;
-    this.globalData.fontManager = new FontManager();
     this.globalData.fontManager.addChars(animData.chars);
     this.globalData.fontManager.addFonts(animData.fonts,defs);
-    this.elements = Array.apply(null,{length:animData.layers.length});
+    this.elements = createSizedArray(animData.layers.length);
 };
 
 
@@ -158,7 +174,7 @@
 };
 
 SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame == num || this.destroyed){
+    if(this.renderedFrame === num || this.destroyed){
         return;
     }
     if(num === null){
@@ -166,12 +182,12 @@
     }else{
         this.renderedFrame = num;
     }
-    //clearPoints();
-    /*console.log('-------');
-    console.log('FRAME ',num);*/
+    // console.log('-------');
+    // console.log('FRAME ',num);
     this.globalData.frameNum = num;
     this.globalData.frameId += 1;
     this.globalData.projectInterface.currentFrame = num;
+    this.globalData._mdf = false;
     var i, len = this.layers.length;
     if(!this.completeLayers){
         this.checkLayers(num);
@@ -181,9 +197,11 @@
             this.elements[i].prepareFrame(num - this.layers[i].st);
         }
     }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
+    if(this.globalData._mdf) {
+        for (i = 0; i < len; i += 1) {
+            if(this.completeLayers || this.elements[i]){
+                this.elements[i].renderFrame();
+            }
         }
     }
 };
@@ -215,17 +233,3 @@
 SVGRenderer.prototype.show = function(){
     this.layerElement.style.display = 'block';
 };
-
-SVGRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    var floatingContainer = document.createElementNS(svgNS,'g');
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
-            comp.initExpressions();
-            //comp.compInterface = CompExpressionInterface(comp);
-            //Expressions.addLayersInterface(comp.elements, this.globalData.projectInterface);
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
diff --git a/player/js/utils/BaseEvent.js b/player/js/utils/BaseEvent.js
new file mode 100644
index 0000000..e9cf078
--- /dev/null
+++ b/player/js/utils/BaseEvent.js
@@ -0,0 +1,39 @@
+function BaseEvent(){}
+BaseEvent.prototype = {
+	triggerEvent: function (eventName, args) {
+	    if (this._cbs[eventName]) {
+	        var len = this._cbs[eventName].length;
+	        for (var i = 0; i < len; i++){
+	            this._cbs[eventName][i](args);
+	        }
+	    }
+	},
+	addEventListener: function (eventName, callback) {
+	    if (!this._cbs[eventName]){
+	        this._cbs[eventName] = [];
+	    }
+	    this._cbs[eventName].push(callback);
+
+		return function() {
+			this.removeEventListener(eventName, callback);
+		}.bind(this);
+	},
+	removeEventListener: function (eventName,callback){
+	    if (!callback){
+	        this._cbs[eventName] = null;
+	    }else if(this._cbs[eventName]){
+	        var i = 0, len = this._cbs[eventName].length;
+	        while(i<len){
+	            if(this._cbs[eventName][i] === callback){
+	                this._cbs[eventName].splice(i,1);
+	                i -=1;
+	                len -= 1;
+	            }
+	            i += 1;
+	        }
+	        if(!this._cbs[eventName].length){
+	            this._cbs[eventName] = null;
+	        }
+	    }
+	}
+};
\ No newline at end of file
diff --git a/player/js/utils/DataManager.js b/player/js/utils/DataManager.js
index 42b3e09..7dc626a 100644
--- a/player/js/utils/DataManager.js
+++ b/player/js/utils/DataManager.js
@@ -1,6 +1,6 @@
 function dataFunctionManager(){
 
-    //var tCanvasHelper = document.createElement('canvas').getContext('2d');
+    //var tCanvasHelper = createTag('canvas').getContext('2d');
 
     function completeLayers(layers, comps, fontManager){
         var layerData;
@@ -52,7 +52,11 @@
         var i = 0, len = comps.length;
         while(i<len){
             if(comps[i].id === id){
-                return comps[i].layers;
+                if(!comps[i].layers.__used) {
+                    comps[i].layers.__used = true;
+                    return comps[i].layers;
+                }
+                return JSON.parse(JSON.stringify(comps[i].layers));
             }
             i += 1;
         }
@@ -137,7 +141,7 @@
                         t:0
                     }
                 ]
-            }
+            };
         }
 
         function iterateLayers(layers){
@@ -162,8 +166,32 @@
                     }
                 }
             }
-        }
-    }())
+        };
+    }());
+
+    var checkChars = (function() {
+        var minimumVersion = [4,7,99];
+        return function (animationData){
+            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
+                var i, len = animationData.chars.length, j, jLen, k, kLen;
+                var pathData, paths;
+                for(i = 0; i < len; i += 1) {
+                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
+                        paths = animationData.chars[i].data.shapes[0].it;
+                        jLen = paths.length;
+
+                        for(j = 0; j < jLen; j += 1) {
+                            pathData = paths[j].ks.k;
+                            if(!pathData.__converted) {
+                                convertPathsToAbsoluteValues(paths[j].ks.k);
+                                pathData.__converted = true;
+                            }
+                        }
+                    }
+                }
+            }
+        };
+    }());
 
     var checkColors = (function(){
         var minimumVersion = [4,1,9];
@@ -223,7 +251,7 @@
                     }
                 }
             }
-        }
+        };
     }());
 
     var checkShapes = (function(){
@@ -301,174 +329,16 @@
                     }
                 }
             }
-        }
+        };
     }());
 
-    function blitPaths(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] /= blitter;
-            path.i[i][1] /= blitter;
-            path.o[i][0] /= blitter;
-            path.o[i][1] /= blitter;
-            path.v[i][0] /= blitter;
-            path.v[i][1] /= blitter;
-        }
-    }
-
-    function blitShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    blitPaths(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            blitPaths(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            blitPaths(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                blitShapes(arr[i].it);
-            }else if(arr[i].ty == 'rc'){
-                blitProperty(arr[i].p);
-                blitProperty(arr[i].s);
-            }else if(arr[i].ty == 'st'){
-                blitProperty(arr[i].w);
-            }else if(arr[i].ty == 'tr'){
-                blitProperty(arr[i].p);
-                blitProperty(arr[i].sk);
-                blitProperty(arr[i].a);
-            }else if(arr[i].ty == 'el'){
-                blitProperty(arr[i].p);
-                blitProperty(arr[i].s);
-            }else if(arr[i].ty == 'rd'){
-                blitProperty(arr[i].r);
-            }else{
-
-                //console.log(arr[i].ty );
-            }
-        }
-    }
-
-    function blitText(data, fontManager){
-
-    }
-
-    function blitValue(val){
-        if(typeof(val) === 'number'){
-            val /= blitter;
-        } else {
-            var i = val.length-1;
-            while(i>=0){
-                val[i] /= blitter;
-                i-=1;
-            }
-        }
-        return val;
-    }
-
-    function blitProperty(data){
-        if(!data.k.length){
-            data.k = blitValue(data.k);
-        }else if(typeof(data.k[0]) === 'number'){
-            data.k = blitValue(data.k);
-        } else {
-            var i, len = data.k.length;
-            for(i=0;i<len;i+=1){
-                if(data.k[i].s){
-                    //console.log('pre S: ', data.k[i].s);
-                    data.k[i].s = blitValue(data.k[i].s);
-                    //console.log('post S: ', data.k[i].s);
-                }
-                if(data.k[i].e){
-                    //console.log('pre E: ', data.k[i].e);
-                    data.k[i].e = blitValue(data.k[i].e);
-                    //console.log('post E: ', data.k[i].e);
-                }
-                if(data.k[i].to){
-                    data.k[i].to = blitValue(data.k[i].to);
-                    data.k[i].ti = blitValue(data.k[i].ti);
-                }
-            }
-        }
-    }
-
-    function blitLayers(layers,comps, fontManager){
-        if(layers._blitted){
-            return;
-        }
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData)){
-                continue;
-            }
-            blitProperty(layerData.ks.a);
-            blitProperty(layerData.ks.p);
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        blitPaths(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                blitPaths(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                blitPaths(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.w = Math.round(layerData.w/blitter);
-                layerData.h = Math.round(layerData.h/blitter);
-                blitLayers(layerData.layers,comps, fontManager);
-                layerData.layers._blitted = true;
-            }else if(layerData.ty === 4){
-                blitShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                blitText(layerData, fontManager);
-            }else if(layerData.ty == 1){
-                layerData.sh /= blitter;
-                layerData.sw /= blitter;
-            } else {
-            }
-        }
-    }
-
-    function blitAnimation(animationData,comps, fontManager){
-        blitLayers(animationData.layers,comps, fontManager);
-    }
-
     function completeData(animationData, fontManager){
         if(animationData.__complete){
             return;
         }
         checkColors(animationData);
         checkText(animationData);
+        checkChars(animationData);
         checkShapes(animationData);
         completeLayers(animationData.layers, animationData.assets, fontManager);
         animationData.__complete = true;
@@ -478,207 +348,9 @@
     }
 
     function completeText(data, fontManager){
-        var letters;
-        var keys = data.t.d.k;
-        var k, kLen = keys.length;
-        for(k=0;k<kLen;k+=1){
-            var documentData = data.t.d.k[k].s;
-            letters = [];
-            var i, len;
-            var newLineFlag, index = 0, val;
-            var anchorGrouping = data.t.m.g;
-            var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-            var lineWidth = 0;
-            var maxLineWidth = 0;
-            var j, jLen;
-            var fontData = fontManager.getFontByName(documentData.f);
-            var charData, cLength = 0;
-            var styles = fontData.fStyle.split(' ');
-
-            var fWeight = 'normal', fStyle = 'normal';
-            len = styles.length;
-            for(i=0;i<len;i+=1){
-                if (styles[i].toLowerCase() === 'italic') {
-                    fStyle = 'italic';
-                }else if (styles[i].toLowerCase() === 'bold') {
-                    fWeight = '700';
-                } else if (styles[i].toLowerCase() === 'black') {
-                    fWeight = '900';
-                } else if (styles[i].toLowerCase() === 'medium') {
-                    fWeight = '500';
-                } else if (styles[i].toLowerCase() === 'regular' || styles[i].toLowerCase() === 'normal') {
-                    fWeight = '400';
-                } else if (styles[i].toLowerCase() === 'light' || styles[i].toLowerCase() === 'thin') {
-                    fWeight = '200';
-                }
-            }
-            documentData.fWeight = fWeight;
-            documentData.fStyle = fStyle;
-            len = documentData.t.length;
-            if(documentData.sz){
-                var boxWidth = documentData.sz[0];
-                var lastSpaceIndex = -1;
-                for(i=0;i<len;i+=1){
-                    newLineFlag = false;
-                    if(documentData.t.charAt(i) === ' '){
-                        lastSpaceIndex = i;
-                    }else if(documentData.t.charCodeAt(i) === 13){
-                        lineWidth = 0;
-                        newLineFlag = true;
-                    }
-                    if(fontManager.chars){
-                        charData = fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, fontData.fFamily);
-                        cLength = newLineFlag ? 0 : charData.w*documentData.s/100;
-                    }else{
-                        //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                        cLength = fontManager.measureText(documentData.t.charAt(i), documentData.f, documentData.s);
-                    }
-                    if(lineWidth + cLength > boxWidth){
-                        if(lastSpaceIndex === -1){
-                            //i -= 1;
-                            documentData.t = documentData.t.substr(0,i) + "\r" + documentData.t.substr(i);
-                            len += 1;
-                        } else {
-                            i = lastSpaceIndex;
-                            documentData.t = documentData.t.substr(0,i) + "\r" + documentData.t.substr(i+1);
-                        }
-                        lastSpaceIndex = -1;
-                        lineWidth = 0;
-                    }else {
-                        lineWidth += cLength;
-                    }
-                }
-                len = documentData.t.length;
-            }
-            lineWidth = 0;
-            cLength = 0;
-            for (i = 0;i < len ;i += 1) {
-                newLineFlag = false;
-                if(documentData.t.charAt(i) === ' '){
-                    val = '\u00A0';
-                }else if(documentData.t.charCodeAt(i) === 13){
-                    lineWidths.push(lineWidth);
-                    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-                    lineWidth = 0;
-                    val = '';
-                    newLineFlag = true;
-                    currentLine += 1;
-                }else{
-                    val = documentData.t.charAt(i);
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(documentData.t.charAt(i), fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.s/100;
-                }else{
-                    //var charWidth = fontManager.measureText(val, documentData.f, documentData.s);
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-                    cLength = fontManager.measureText(val, documentData.f, documentData.s);
-                }
-
-                //
-                lineWidth += cLength;
-                letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine});
-                if(anchorGrouping == 2){
-                    currentSize += cLength;
-                    if(val == '' || val == '\u00A0' || i == len - 1){
-                        if(val == '' || val == '\u00A0'){
-                            currentSize -= cLength;
-                        }
-                        while(currentPos<=i){
-                            letters[currentPos].an = currentSize;
-                            letters[currentPos].ind = index;
-                            letters[currentPos].extra = cLength;
-                            currentPos += 1;
-                        }
-                        index += 1;
-                        currentSize = 0;
-                    }
-                }else if(anchorGrouping == 3){
-                    currentSize += cLength;
-                    if(val == '' || i == len - 1){
-                        if(val == ''){
-                            currentSize -= cLength;
-                        }
-                        while(currentPos<=i){
-                            letters[currentPos].an = currentSize;
-                            letters[currentPos].ind = index;
-                            letters[currentPos].extra = cLength;
-                            currentPos += 1;
-                        }
-                        currentSize = 0;
-                        index += 1;
-                    }
-                }else{
-                    letters[index].ind = index;
-                    letters[index].extra = 0;
-                    index += 1;
-                }
-            }
-            documentData.l = letters;
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidths.push(lineWidth);
-            if(documentData.sz){
-                documentData.boxWidth = documentData.sz[0];
-                documentData.justifyOffset = 0;
-            }else{
-                documentData.boxWidth = maxLineWidth;
-                switch(documentData.j){
-                    case 1:
-                        documentData.justifyOffset = - documentData.boxWidth;
-                        break;
-                    case 2:
-                        documentData.justifyOffset = - documentData.boxWidth/2;
-                        break;
-                    default:
-                        documentData.justifyOffset = 0;
-                }
-            }
-            documentData.lineWidths = lineWidths;
-
-            var animators = data.t.a;
-            jLen = animators.length;
-            var based, ind, indexes = [];
-            for(j=0;j<jLen;j+=1){
-                if(animators[j].a.sc){
-                    documentData.strokeColorAnim = true;
-                }
-                if(animators[j].a.sw){
-                    documentData.strokeWidthAnim = true;
-                }
-                if(animators[j].a.fc || animators[j].a.fh || animators[j].a.fs || animators[j].a.fb){
-                    documentData.fillColorAnim = true;
-                }
-                ind = 0;
-                based = animators[j].s.b;
-                for(i=0;i<len;i+=1){
-                    letters[i].anIndexes[j] = ind;
-                    if((based == 1 && letters[i].val != '') || (based == 2 && letters[i].val != '' && letters[i].val != '\u00A0') || (based == 3 && (letters[i].n || letters[i].val == '\u00A0' || i == len - 1)) || (based == 4 && (letters[i].n || i == len - 1))){
-                        if(animators[j].s.rn === 1){
-                            indexes.push(ind);
-                        }
-                        ind += 1;
-                    }
-                }
-                data.t.a[j].s.totalChars = ind;
-                var currentInd = -1, newInd;
-                if(animators[j].s.rn === 1){
-                    for(i = 0; i < len; i += 1){
-                        if(currentInd != letters[i].anIndexes[j]){
-                            currentInd = letters[i].anIndexes[j];
-                            newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                        }
-                        letters[i].anIndexes[j] = newInd;
-                    }
-                }
-            }
-            if(jLen === 0 && !('m' in data.t.p)){
-                data.singleShape = true;
-            }
-            documentData.yOffset = documentData.lh || documentData.s*1.2;
-            documentData.ls = documentData.ls || 0;
-            documentData.ascent = fontData.ascent*documentData.s/100;
+        if(data.t.a.length === 0 && !('m' in data.t.p)){
+            data.singleShape = true;
         }
-
     }
 
     var moduleOb = {};
diff --git a/player/js/utils/FontManager.js b/player/js/utils/FontManager.js
index 21fa53e..40159a6 100644
--- a/player/js/utils/FontManager.js
+++ b/player/js/utils/FontManager.js
@@ -1,11 +1,21 @@
 var FontManager = (function(){
 
     var maxWaitingTime = 5000;
+    var emptyChar = {
+        w: 0,
+        size:0,
+        shapes:[]
+    };
+    var combinedCharacters = [];
+    //Hindi characters
+    combinedCharacters = combinedCharacters.concat([2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366
+    , 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379
+    , 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403]);
 
     function setUpNode(font, family){
-        var parentNode = document.createElement('span');
+        var parentNode = createTag('span');
         parentNode.style.fontFamily    = family;
-        var node = document.createElement('span');
+        var node = createTag('span');
         // Characters that vary significantly among different fonts
         node.innerHTML = 'giItT1WQy@!-/#';
         // Visible - so we can measure it - but not on the screen
@@ -37,7 +47,7 @@
                 loadedCount -= 1;
                 continue;
             }
-            if(this.fonts[i].fOrigin === 't'){
+            if(this.fonts[i].fOrigin === 't' || this.fonts[i].origin === 2){
                 if(window.Typekit && window.Typekit.load && this.typekitLoaded === 0){
                     this.typekitLoaded = 1;
                     try{window.Typekit.load({
@@ -50,7 +60,7 @@
                 if(this.typekitLoaded === 2) {
                     this.fonts[i].loaded = true;
                 }
-            } else if(this.fonts[i].fOrigin === 'n'){
+            } else if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
                 this.fonts[i].loaded = true;
             } else{
                 node = this.fonts[i].monoCase.node;
@@ -79,12 +89,15 @@
             setTimeout(function(){this.loaded = true;}.bind(this),0);
 
         }
-    };
+    }
 
     function createHelper(def, fontData){
-        var tHelper = document.createElementNS(svgNS,'text');
+        var tHelper = createNS('text');
         tHelper.style.fontSize = '100px';
-        tHelper.style.fontFamily = fontData.fFamily;
+        //tHelper.style.fontFamily = fontData.fFamily;
+        tHelper.setAttribute('font-family', fontData.fFamily);
+        tHelper.setAttribute('font-style', fontData.fStyle);
+        tHelper.setAttribute('font-weight', fontData.fWeight);
         tHelper.textContent = '1';
         if(fontData.fClass){
             tHelper.style.fontFamily = 'inherit';
@@ -93,9 +106,9 @@
             tHelper.style.fontFamily = fontData.fFamily;
         }
         def.appendChild(tHelper);
-        var tCanvasHelper = document.createElement('canvas').getContext('2d');
-        tCanvasHelper.font = '100px '+ fontData.fFamily;
-        return tCanvasHelper;
+        var tCanvasHelper = createTag('canvas').getContext('2d');
+        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
+        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
         return tHelper;
     }
 
@@ -110,6 +123,7 @@
             return;
         }
 
+
         var fontArr = fontData.list;
         var i, len = fontArr.length;
         for(i=0; i<len; i+= 1){
@@ -118,28 +132,31 @@
             fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
             if(!fontArr[i].fPath) {
                 fontArr[i].loaded = true;
-            }else if(fontArr[i].fOrigin === 'p'){
-                var s = document.createElement('style');
+            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
+                var s = createTag('style');
                 s.type = "text/css";
                 s.innerHTML = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
                 defs.appendChild(s);
-            } else if(fontArr[i].fOrigin === 'g'){
-                //<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
-                var l = document.createElement('link');
+            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
+                var l = createTag('link');
                 l.type = "text/css";
                 l.rel = "stylesheet";
                 l.href = fontArr[i].fPath;
-                defs.appendChild(l);
-            } else if(fontArr[i].fOrigin === 't'){
-                //<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
-                var sc = document.createElement('script');
+                document.body.appendChild(l);
+            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
+                var sc = createTag('script');
                 sc.setAttribute('src',fontArr[i].fPath);
                 defs.appendChild(sc);
             }
             fontArr[i].helper = createHelper(defs,fontArr[i]);
+            fontArr[i].cache = {};
             this.fonts.push(fontArr[i]);
         }
-        checkLoadedFonts.bind(this)();
+        //On some cases the font even if it is loaded, it won't load correctly when measuring text on canvas.
+        //Adding this timeout seems to fix it
+       setTimeout(function() {
+            checkLoadedFonts.bind(this)();
+        }.bind(this), 100);
     }
 
     function addChars(chars){
@@ -175,14 +192,31 @@
             }
             i+= 1;
         }
+        if(console && console.warn) {
+            console.warn('Missing character from exported characters list: ', char, style, font);
+        }
+        return emptyChar;
     }
 
-    function measureText(char, fontName, size){
+    function measureText(char, fontName, size) {
         var fontData = this.getFontByName(fontName);
-        var tHelper = fontData.helper;
-        //tHelper.textContent = char;
-        return tHelper.measureText(char).width*size/100;
-        //return tHelper.getComputedTextLength()*size/100;
+        var index = char.charCodeAt(0);
+        if(!fontData.cache[index + 1]) {
+            var tHelper = fontData.helper;
+            //Canvas version
+            //fontData.cache[index] = tHelper.measureText(char).width / 100;
+            //SVG version
+            //console.log(tHelper.getBBox().width)
+            /*tHelper.textContent = '|' + char + '|';
+            var doubleSize = tHelper.getComputedTextLength();
+            tHelper.textContent = '||';
+            var singleSize = tHelper.getComputedTextLength();
+            fontData.cache[index + 1] = (doubleSize - singleSize)/100;*/
+           
+            tHelper.textContent = char;
+            fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
+        }
+        return fontData.cache[index + 1] * size;
     }
 
     function getFontByName(name){
@@ -193,7 +227,11 @@
             }
             i += 1;
         }
-        return 'sans-serif';
+        return this.fonts[0];
+    }
+
+    function getCombinedCharacterCodes() {
+        return combinedCharacters;
     }
 
     var Font = function(){
@@ -203,6 +241,9 @@
         this.loaded = false;
         this.initTime = Date.now();
     };
+    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
+    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
     Font.prototype.addChars = addChars;
     Font.prototype.addFonts = addFonts;
     Font.prototype.getCharData = getCharData;
diff --git a/player/js/utils/MatrixManager.js b/player/js/utils/MatrixManager.js
deleted file mode 100644
index 36ae323..0000000
--- a/player/js/utils/MatrixManager.js
+++ /dev/null
@@ -1,18 +0,0 @@
-function matrixManagerFunction(){
-
-    var mat = new Matrix();
-
-    var returnMatrix2D = function(rX, scaleX, scaleY, tX, tY){
-        return mat.reset().translate(tX,tY).rotate(rX).scale(scaleX,scaleY).toCSS();
-    };
-
-    var getMatrix = function(animData){
-        return returnMatrix2D(animData.tr.r[2],animData.tr.s[0],animData.tr.s[1],animData.tr.p[0],animData.tr.p[1]);
-    };
-
-    return {
-        getMatrix : getMatrix
-    };
-
-}
-var MatrixManager = matrixManagerFunction;
\ No newline at end of file
diff --git a/player/js/utils/PropertyFactory.js b/player/js/utils/PropertyFactory.js
index 40ba8fa..06141ff 100644
--- a/player/js/utils/PropertyFactory.js
+++ b/player/js/utils/PropertyFactory.js
@@ -1,120 +1,124 @@
 var PropertyFactory = (function(){
 
-    var initFrame = -999999;
+    var initFrame = initialDefaultFrame;
+    var math_abs = Math.abs;
 
-    function getValue(){
-        if(this.elem.globalData.frameId === this.frameId){
-            return;
+    function interpolateValue(frameNum, caching){
+        var offsetTime = this.offsetTime;
+        var newValue;
+        if(this.propType === 'multidimensional') {
+            newValue = createTypedArray('float32', this.pv.length);
         }
-        this.mdf = false;
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        if(!(frameNum === this.lastFrame || (this.lastFrame !== initFrame && ((this.lastFrame >= this.keyframes[this.keyframes.length- 1].t-this.offsetTime && frameNum >= this.keyframes[this.keyframes.length- 1].t-this.offsetTime) || (this.lastFrame < this.keyframes[0].t-this.offsetTime && frameNum < this.keyframes[0].t-this.offsetTime))))){
-            var i = this.lastFrame < frameNum ? this._lastIndex : 0;
-            var len = this.keyframes.length- 1,flag = true;
-            var keyData, nextKeyData;
+        var iterationIndex = caching.lastIndex;
+        var i = iterationIndex;
+        var len = this.keyframes.length- 1,flag = true;
+        var keyData, nextKeyData;
 
-            while(flag){
-                keyData = this.keyframes[i];
-                nextKeyData = this.keyframes[i+1];
-                if(i == len-1 && frameNum >= nextKeyData.t - this.offsetTime){
-                    if(keyData.h){
-                        keyData = nextKeyData;
-                    }
-                    break;
+        while(flag){
+            keyData = this.keyframes[i];
+            nextKeyData = this.keyframes[i+1];
+            if(i == len-1 && frameNum >= nextKeyData.t - offsetTime){
+                if(keyData.h){
+                    keyData = nextKeyData;
                 }
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
+                iterationIndex = 0;
+                break;
             }
-
-            this._lastIndex = i;
-
-            var k, kLen,perc,jLen, j, fnc;
-            if(keyData.to){
-
-                if(!keyData.bezierData){
-                    bez.buildBezierData(keyData);
-                }
-                var bezierData = keyData.bezierData;
-                if(frameNum >= nextKeyData.t-this.offsetTime || frameNum < keyData.t-this.offsetTime){
-                    var ind = frameNum >= nextKeyData.t-this.offsetTime ? bezierData.points.length - 1 : 0;
-                    kLen = bezierData.points[ind].point.length;
-                    for(k = 0; k < kLen; k += 1){
-                        this.pv[k] = bezierData.points[ind].point[k];
-                        this.v[k] = this.mult ? this.pv[k]*this.mult : this.pv[k];
-                        if(this.lastPValue[k] !== this.pv[k]) {
-                            this.mdf = true;
-                            this.lastPValue[k] = this.pv[k];
-                        }
-                    }
-                    this._lastBezierData = null;
-                }else{
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y,keyData.n).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                    var distanceInLine = bezierData.segmentLength*perc;
-
-                    var segmentPerc;
-                    var addedLength =  (this.lastFrame < frameNum && this._lastBezierData === bezierData) ? this._lastAddedLength : 0;
-                    j =  (this.lastFrame < frameNum && this._lastBezierData === bezierData) ? this._lastPoint : 0;
-                    flag = true;
-                    jLen = bezierData.points.length;
-                    while(flag){
-                        addedLength +=bezierData.points[j].partialLength;
-                        if(distanceInLine === 0 || perc === 0 || j == bezierData.points.length - 1){
-                            kLen = bezierData.points[j].point.length;
-                            for(k=0;k<kLen;k+=1){
-                                this.pv[k] = bezierData.points[j].point[k];
-                                this.v[k] = this.mult ? this.pv[k]*this.mult : this.pv[k];
-                                if(this.lastPValue[k] !== this.pv[k]) {
-                                    this.mdf = true;
-                                    this.lastPValue[k] = this.pv[k];
-                                }
-                            }
-                            break;
-                        }else if(distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j+1].partialLength){
-                            segmentPerc = (distanceInLine-addedLength)/(bezierData.points[j+1].partialLength);
-                            kLen = bezierData.points[j].point.length;
-                            for(k=0;k<kLen;k+=1){
-                                this.pv[k] = bezierData.points[j].point[k] + (bezierData.points[j+1].point[k] - bezierData.points[j].point[k])*segmentPerc;
-                                this.v[k] = this.mult ? this.pv[k] * this.mult : this.pv[k];
-                                if(this.lastPValue[k] !== this.pv[k]) {
-                                    this.mdf = true;
-                                    this.lastPValue[k] = this.pv[k];
-                                }
-                            }
-                            break;
-                        }
-                        if(j < jLen - 1){
-                            j += 1;
-                        }else{
-                            flag = false;
-                        }
-                    }
-                    this._lastPoint = j;
-                    this._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                    this._lastBezierData = bezierData;
-                }
+            if((nextKeyData.t - offsetTime) > frameNum){
+                iterationIndex = i;
+                break;
+            }
+            if(i < len - 1){
+                i += 1;
             }else{
-                var outX,outY,inX,inY, keyValue;
-                len = keyData.s.length;
+                iterationIndex = 0;
+                flag = false;
+            }
+        }
+
+        var k, kLen,perc,jLen, j, fnc;
+        if(keyData.to){
+
+            if(!keyData.bezierData){
+                bez.buildBezierData(keyData);
+            }
+            var bezierData = keyData.bezierData;
+            if(frameNum >= nextKeyData.t-offsetTime || frameNum < keyData.t-offsetTime){
+                var ind = frameNum >= nextKeyData.t-offsetTime ? bezierData.points.length - 1 : 0;
+                kLen = bezierData.points[ind].point.length;
+                for(k = 0; k < kLen; k += 1){
+                    newValue[k] = bezierData.points[ind].point[k];
+                }
+                caching._lastBezierData = null;
+            }else{
+                if(keyData.__fnct){
+                    fnc = keyData.__fnct;
+                }else{
+                    fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y,keyData.n).get;
+                    keyData.__fnct = fnc;
+                }
+                perc = fnc((frameNum-(keyData.t-offsetTime))/((nextKeyData.t-offsetTime)-(keyData.t-offsetTime)));
+                var distanceInLine = bezierData.segmentLength*perc;
+
+                var segmentPerc;
+                var addedLength =  (caching.lastFrame < frameNum && caching._lastBezierData === bezierData) ? caching._lastAddedLength : 0;
+                j =  (caching.lastFrame < frameNum && caching._lastBezierData === bezierData) ? caching._lastPoint : 0;
+                flag = true;
+                jLen = bezierData.points.length;
+                while(flag){
+                    addedLength +=bezierData.points[j].partialLength;
+                    if(distanceInLine === 0 || perc === 0 || j == bezierData.points.length - 1){
+                        kLen = bezierData.points[j].point.length;
+                        for(k=0;k<kLen;k+=1){
+                            newValue[k] = bezierData.points[j].point[k];
+                        }
+                        break;
+                    }else if(distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j+1].partialLength){
+                        segmentPerc = (distanceInLine-addedLength)/(bezierData.points[j+1].partialLength);
+                        kLen = bezierData.points[j].point.length;
+                        for(k=0;k<kLen;k+=1){
+                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j+1].point[k] - bezierData.points[j].point[k])*segmentPerc;
+                        }
+                        break;
+                    }
+                    if(j < jLen - 1){
+                        j += 1;
+                    }else{
+                        flag = false;
+                    }
+                }
+                caching._lastPoint = j;
+                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+                caching._lastBezierData = bezierData;
+            }
+        }else{
+            var outX,outY,inX,inY, keyValue;
+            len = keyData.s.length;
+            if(this.sh && keyData.h !== 1) {
+                if(frameNum >= nextKeyData.t-offsetTime){
+                    newValue[0] = keyData.e[0];
+                    newValue[1] = keyData.e[1];
+                    newValue[2] = keyData.e[2];
+                }else if(frameNum <= keyData.t-offsetTime){
+                    newValue[0] = keyData.s[0];
+                    newValue[1] = keyData.s[1];
+                    newValue[2] = keyData.s[2];
+                }else{
+                    var quatStart = createQuaternion(keyData.s);
+                    var quatEnd = createQuaternion(keyData.e);
+                    var time = (frameNum-(keyData.t-offsetTime))/((nextKeyData.t-offsetTime)-(keyData.t-offsetTime));
+                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+                }
+                
+            } else {
                 for(i=0;i<len;i+=1){
                     if(keyData.h !== 1){
-                        if(frameNum >= nextKeyData.t-this.offsetTime){
+                        if(frameNum >= nextKeyData.t-offsetTime){
                             perc = 1;
-                        }else if(frameNum < keyData.t-this.offsetTime){
+                        }else if(frameNum < keyData.t-offsetTime){
                             perc = 0;
                         }else{
-                            if(keyData.o.x instanceof Array){
+                            if(keyData.o.x.constructor === Array){
                                 if(!keyData.__fnct){
                                     keyData.__fnct = [];
                                 }
@@ -140,102 +144,225 @@
                                     fnc = keyData.__fnct;
                                 }
                             }
-                            perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
+                            perc = fnc((frameNum-(keyData.t-offsetTime))/((nextKeyData.t-offsetTime)-(keyData.t-offsetTime)));
                         }
                     }
-                    if(this.sh && keyData.h !== 1){
-                        var initP = keyData.s[i];
-                        var endP = keyData.e[i];
-                        if(initP-endP < -180){
-                            initP += 360;
-                        } else if(initP-endP > 180){
-                            initP -= 360;
-                        }
-                        keyValue = initP+(endP-initP)*perc;
-                    } else {
-                        keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i]+(keyData.e[i]-keyData.s[i])*perc;
-                    }
+
+                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i]+(keyData.e[i]-keyData.s[i])*perc;
+
                     if(len === 1){
-                        this.v = this.mult ? keyValue*this.mult : keyValue;
-                        this.pv = keyValue;
-                        if(this.lastPValue != this.pv){
-                            this.mdf = true;
-                            this.lastPValue = this.pv;
-                        }
+                        newValue = keyValue;
                     }else{
-                        this.v[i] = this.mult ? keyValue*this.mult : keyValue;
-                        this.pv[i] = keyValue;
-                        if(this.lastPValue[i] !== this.pv[i]){
-                            this.mdf = true;
-                            this.lastPValue[i] = this.pv[i];
-                        }
+                        newValue[i] = keyValue;
                     }
                 }
             }
         }
-        this.lastFrame = frameNum;
+        caching.lastIndex = iterationIndex;
+        return newValue;
+    }
+
+    //based on @Toji's https://github.com/toji/gl-matrix/
+    function slerp(a, b, t) {
+        var out = [];
+        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
+        bx = b[0], by = b[1], bz = b[2], bw = b[3]
+
+        var omega, cosom, sinom, scale0, scale1;
+
+        cosom = ax * bx + ay * by + az * bz + aw * bw;
+        if (cosom < 0.0) {
+            cosom = -cosom;
+            bx = -bx;
+            by = -by;
+            bz = -bz;
+            bw = -bw;
+        }
+        if ((1.0 - cosom) > 0.000001) {
+            omega = Math.acos(cosom);
+            sinom = Math.sin(omega);
+            scale0 = Math.sin((1.0 - t) * omega) / sinom;
+            scale1 = Math.sin(t * omega) / sinom;
+        } else {
+            scale0 = 1.0 - t;
+            scale1 = t;
+        }
+        out[0] = scale0 * ax + scale1 * bx;
+        out[1] = scale0 * ay + scale1 * by;
+        out[2] = scale0 * az + scale1 * bz;
+        out[3] = scale0 * aw + scale1 * bw;
+
+        return out;
+    }
+
+    function quaternionToEuler(out, quat) {
+        var qx = quat[0];
+        var qy = quat[1];
+        var qz = quat[2];
+        var qw = quat[3];
+        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
+        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
+        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
+        out[0] = heading/degToRads;
+        out[1] = attitude/degToRads;
+        out[2] = bank/degToRads;
+    }
+
+    function createQuaternion(values) {
+        var heading = values[0] * degToRads;
+        var attitude = values[1] * degToRads;
+        var bank = values[2] * degToRads;
+        var c1 = Math.cos(heading / 2);
+        var c2 = Math.cos(attitude / 2);
+        var c3 = Math.cos(bank / 2);
+        var s1 = Math.sin(heading / 2);
+        var s2 = Math.sin(attitude / 2);
+        var s3 = Math.sin(bank / 2);
+        var w = c1 * c2 * c3 - s1 * s2 * s3;
+        var x = s1 * s2 * c3 + c1 * c2 * s3;
+        var y = s1 * c2 * c3 + c1 * s2 * s3;
+        var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+        return [x,y,z,w];
+    }
+
+    function getValueAtCurrentTime(){
+        var frameNum = this.comp.renderedFrame - this.offsetTime;
+        var initTime = this.keyframes[0].t - this.offsetTime;
+        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
+        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
+            this._caching.lastIndex = this._caching.lastFrame < frameNum ? this._caching.lastIndex : 0;
+            var renderResult = this.interpolateValue(frameNum, this._caching);
+            this.pv = renderResult;
+        }
+        this._caching.lastFrame = frameNum;
+        return this.pv;
+    }
+
+    function setVValue(val) {
+        var multipliedValue;
+        if(this.propType === 'unidimensional') {
+            multipliedValue = val * this.mult;
+            if(math_abs(this.v - multipliedValue) > 0.00001) {
+                this.v = multipliedValue;
+                this._mdf = true;
+            }
+        } else {
+            var i = 0, len = this.v.length;
+            while (i < len) {
+                multipliedValue = val[i] * this.mult;
+                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
+                    this.v[i] = multipliedValue;
+                    this._mdf = true;
+                }
+                i += 1;
+            }
+        }
+    }
+
+    function processEffectsSequence() {
+        if(this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+            return;
+        }        
+        if(this.lock) {
+            this.setVValue(this.pv);
+            return;
+        }
+        this.lock = true;
+        this._mdf = this._isFirstFrame;
+        var multipliedValue;
+        var i, len = this.effectsSequence.length;
+        var finalValue = this.kf ? this.pv : this.data.k;
+        for(i = 0; i < len; i += 1) {
+            finalValue = this.effectsSequence[i](finalValue);
+        }
+        this.setVValue(finalValue);
+        this._isFirstFrame = false;
+        this.lock = false;
         this.frameId = this.elem.globalData.frameId;
     }
 
-    function getNoValue(){}
+    function addEffect(effectFunction) {
+        this.effectsSequence.push(effectFunction);
+        this.container.addDynamicProperty(this);
+    }
 
-    function ValueProperty(elem,data, mult){
-        this.mult = mult;
+    function ValueProperty(elem, data, mult, container){
+        this.propType = 'unidimensional';
+        this.mult = mult || 1;
+        this.data = data;
         this.v = mult ? data.k * mult : data.k;
         this.pv = data.k;
-        this.mdf = false;
+        this._mdf = false;
+        this.elem = elem;
+        this.container = container;
         this.comp = elem.comp;
         this.k = false;
         this.kf = false;
         this.vel = 0;
-        this.getValue = getNoValue;
+        this.effectsSequence = [];
+        this._isFirstFrame = true;
+        this.getValue = processEffectsSequence;
+        this.setVValue = setVValue;
+        this.addEffect = addEffect;
     }
 
-    function MultiDimensionalProperty(elem,data, mult){
-        this.mult = mult;
+    function MultiDimensionalProperty(elem, data, mult, container) {
+        this.propType = 'multidimensional';
+        this.mult = mult || 1;
         this.data = data;
-        this.mdf = false;
+        this._mdf = false;
+        this.elem = elem;
+        this.container = container;
         this.comp = elem.comp;
         this.k = false;
         this.kf = false;
         this.frameId = -1;
-        this.v = Array.apply(null, {length:data.k.length});
-        this.pv = Array.apply(null, {length:data.k.length});
-        this.lastValue = Array.apply(null, {length:data.k.length});
-        var arr = Array.apply(null, {length:data.k.length});
-        this.vel = arr.map(function () { return 0 });
         var i, len = data.k.length;
-        for(i = 0;i<len;i+=1){
-            this.v[i] = mult ? data.k[i] * mult : data.k[i];
+        this.v = createTypedArray('float32', len);
+        this.pv = createTypedArray('float32', len);
+        var arr = createTypedArray('float32', len);
+        this.vel = createTypedArray('float32', len);
+        for (i = 0; i < len; i += 1) {
+            this.v[i] = data.k[i] * this.mult;
             this.pv[i] = data.k[i];
         }
-        this.getValue = getNoValue;
+        this._isFirstFrame = true;
+        this.effectsSequence = [];
+        this.getValue = processEffectsSequence;
+        this.setVValue = setVValue;
+        this.addEffect = addEffect;
     }
 
-    function KeyframedValueProperty(elem, data, mult){
+    function KeyframedValueProperty(elem, data, mult, container) {
+        this.propType = 'unidimensional';
         this.keyframes = data.k;
         this.offsetTime = elem.data.st;
-        this.lastValue = -99999;
-        this.lastPValue = -99999;
         this.frameId = -1;
-        this._lastIndex = 0;
+        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0};
         this.k = true;
         this.kf = true;
         this.data = data;
-        this.mult = mult;
+        this.mult = mult || 1;
         this.elem = elem;
+        this.container = container;
         this.comp = elem.comp;
-        this.lastFrame = initFrame;
-        this.v = mult ? data.k[0].s[0]*mult : data.k[0].s[0];
-        this.pv = data.k[0].s[0];
-        this.getValue = getValue;
+        this.v = initFrame;
+        this.pv = initFrame;
+        this._isFirstFrame = true;
+        this.getValue = processEffectsSequence;
+        this.setVValue = setVValue;
+        this.interpolateValue = interpolateValue;
+        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+        this.addEffect = addEffect;
     }
 
-    function KeyframedMultidimensionalProperty(elem, data, mult){
+    function KeyframedMultidimensionalProperty(elem, data, mult, container){
+        this.propType = 'multidimensional';
         var i, len = data.k.length;
         var s, e,to,ti;
-        for(i=0;i<len-1;i+=1){
-            if(data.k[i].to && data.k[i].s && data.k[i].e ){
+        for (i = 0; i < len - 1; i += 1) {
+            if (data.k[i].to && data.k[i].s && data.k[i].e) {
                 s = data.k[i].s;
                 e = data.k[i].e;
                 to = data.k[i].to;
@@ -244,555 +371,75 @@
                     data.k[i].to = null;
                     data.k[i].ti = null;
                 }
+                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+                        data.k[i].to = null;
+                        data.k[i].ti = null;
+                    }
+                }
             }
         }
+        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
         this.keyframes = data.k;
         this.offsetTime = elem.data.st;
         this.k = true;
         this.kf = true;
-        this.mult = mult;
+        this._isFirstFrame = true;
+        this.mult = mult || 1;
         this.elem = elem;
+        this.container = container;
         this.comp = elem.comp;
-        this.getValue = getValue;
+        this.getValue = processEffectsSequence;
+        this.setVValue = setVValue;
+        this.interpolateValue = interpolateValue;
         this.frameId = -1;
-        this._lastIndex = 0;
-        this.v = Array.apply(null, {length:data.k[0].s.length});
-        this.pv = Array.apply(null, {length:data.k[0].s.length});
-        this.lastValue = Array.apply(null, {length:data.k[0].s.length});
-        this.lastPValue = Array.apply(null, {length:data.k[0].s.length});
-        this.lastFrame = initFrame;
+        var arrLen = data.k[0].s.length;
+        this.v = createTypedArray('float32', arrLen);
+        this.pv = createTypedArray('float32', arrLen);
+        for (i = 0; i < arrLen; i += 1) {
+            this.v[i] = initFrame;
+            this.pv[i] = initFrame;
+        }
+        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
+        this.addEffect = addEffect;
     }
 
-    var TransformProperty = (function() {
-        function positionGetter() {
-            return ExpressionValue(this.p);
-        }
-        function xPositionGetter() {
-            return ExpressionValue(this.px);
-        }
-        function yPositionGetter() {
-            return ExpressionValue(this.py);
-        }
-        function zPositionGetter() {
-            return ExpressionValue(this.pz);
-        }
-        function anchorGetter() {
-            return ExpressionValue(this.a);
-        }
-        function orientationGetter() {
-            return ExpressionValue(this.or);
-        }
-        function rotationGetter() {
-            return ExpressionValue(this.r, 1/degToRads);
-        }
-        function scaleGetter() {
-            return ExpressionValue(this.s, 100);
-        }
-        function opacityGetter() {
-            return ExpressionValue(this.o, 100);
-        }
-        function skewGetter() {
-            return ExpressionValue(this.sk);
-        }
-        function skewAxisGetter() {
-            return ExpressionValue(this.sa);
-        }
-        function applyToMatrix(mat) {
-            var i, len = this.dynamicProperties.length;
-            for(i = 0; i < len; i += 1) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i].mdf) {
-                    this.mdf = true;
-                }
-            }
-            if (this.a) {
-                mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if (this.s) {
-                mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.r) {
-                mat.rotate(-this.r.v);
-            } else {
-                mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
-            }
-            if (this.data.p.s) {
-                if (this.data.p.z) {
-                    mat.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    mat.translate(this.px.v, this.py.v, 0);
-                }
-            } else {
-                mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-            }
-        }
-        function processKeys(){
-            if (this.elem.globalData.frameId === this.frameId) {
-                return;
-            }
-
-            this.mdf = false;
-            var i, len = this.dynamicProperties.length;
-
-            for(i = 0; i < len; i += 1) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i].mdf) {
-                    this.mdf = true;
-                }
-            }
-            if (this.mdf) {
-                this.v.reset();
-                if (this.a) {
-                    this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-                }
-                if(this.s) {
-                    this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-                }
-                if (this.sk) {
-                    this.v.skewFromAxis(-this.sk.v, this.sa.v);
-                }
-                if (this.r) {
-                    this.v.rotate(-this.r.v);
-                } else {
-                    this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
-                }
-                if (this.autoOriented && this.p.keyframes && this.p.getValueAtTime) {
-                    var v1,v2;
-                    if (this.p.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / this.elem.globalData.frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / this.elem.globalData.frameRate, 0);
-                    } else if(this.p.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / this.elem.globalData.frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.01) / this.elem.globalData.frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p.lastFrame+this.p.offsetTime - 0.01) / this.elem.globalData.frameRate, this.p.offsetTime);
-                    }
-                    this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-                }
-                if(this.data.p.s){
-                    if(this.data.p.z) {
-                        this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                    } else {
-                        this.v.translate(this.px.v, this.py.v, 0);
-                    }
-                }else{
-                    this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-                }
-            }
-            //console.log(this.v.to2dCSS())
-            this.frameId = this.elem.globalData.frameId;
-        }
-
-        function setInverted(){
-            this.inverted = true;
-            this.iv = new Matrix();
-            if(!this.k){
-                if(this.data.p.s){
-                    this.iv.translate(this.px.v,this.py.v,-this.pz.v);
-                }else{
-                    this.iv.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-                }
-                if(this.r){
-                    this.iv.rotate(-this.r.v);
-                }else{
-                    this.iv.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
-                }
-                if(this.s){
-                    this.iv.scale(this.s.v[0],this.s.v[1],1);
-                }
-                if(this.a){
-                    this.iv.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]);
-                }
-            }
-        }
-
-        function autoOrient(){
-            //
-            //var prevP = this.getValueAtTime();
-        }
-
-        return function TransformProperty(elem,data,arr){
-            this.elem = elem;
-            this.frameId = -1;
-            this.type = 'transform';
-            this.dynamicProperties = [];
-            this.mdf = false;
-            this.data = data;
-            this.getValue = processKeys;
-            this.applyToMatrix = applyToMatrix;
-            this.setInverted = setInverted;
-            this.autoOrient = autoOrient;
-            this.v = new Matrix();
-            if(data.p.s){
-                this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this.dynamicProperties);
-                this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this.dynamicProperties);
-                if(data.p.z){
-                    this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this.dynamicProperties);
-                }
-            }else{
-                this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            }
-            if(data.r) {
-                this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this.dynamicProperties);
-            } else if(data.rx) {
-                this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this.dynamicProperties);
-                this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this.dynamicProperties);
-                this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this.dynamicProperties);
-                this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this.dynamicProperties);
-            }
-            if(data.sk){
-                this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this.dynamicProperties);
-                this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this.dynamicProperties);
-            }
-            if(data.a) {
-                this.a = PropertyFactory.getProp(elem,data.a,1,0,this.dynamicProperties);
-            }
-            if(data.s) {
-                this.s = PropertyFactory.getProp(elem,data.s,1,0.01,this.dynamicProperties);
-            }
-            if(data.o){
-                this.o = PropertyFactory.getProp(elem,data.o,0,0.01,arr);
-            } else {
-                this.o = {mdf:false,v:1};
-            }
-            if(this.dynamicProperties.length){
-                arr.push(this);
-            }else{
-                if(this.a){
-                    this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]);
-                }
-                if(this.s){
-                    this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]);
-                }
-                if(this.sk){
-                    this.v.skewFromAxis(-this.sk.v,this.sa.v);
-                }
-                if(this.r){
-                    this.v.rotate(-this.r.v);
-                }else{
-                    this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
-                }
-                if(this.data.p.s){
-                    if(data.p.z) {
-                        this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                    } else {
-                        this.v.translate(this.px.v, this.py.v, 0);
-                    }
-                }else{
-                    this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-                }
-            }
-            Object.defineProperty(this, "position", { get: positionGetter});
-            Object.defineProperty(this, "xPosition", { get: xPositionGetter});
-            Object.defineProperty(this, "yPosition", { get: yPositionGetter});
-            Object.defineProperty(this, "orientation", { get: orientationGetter});
-            Object.defineProperty(this, "anchorPoint", { get: anchorGetter});
-            Object.defineProperty(this, "rotation", { get: rotationGetter});
-            Object.defineProperty(this, "scale", { get: scaleGetter});
-            Object.defineProperty(this, "opacity", { get: opacityGetter});
-            Object.defineProperty(this, "skew", { get: skewGetter});
-            Object.defineProperty(this, "skewAxis", { get: skewAxisGetter});
-        }
-    }());
-
-    function getProp(elem,data,type, mult, arr) {
+    function getProp(elem,data,type, mult, container) {
         var p;
-        if(type === 2){
-            p = new TransformProperty(elem, data, arr);
-        } else if(data.a === 0){
+        if(data.a === 0){
             if(type === 0) {
-                p = new ValueProperty(elem,data,mult);
+                p = new ValueProperty(elem,data,mult, container);
             } else {
-                p = new MultiDimensionalProperty(elem,data, mult);
+                p = new MultiDimensionalProperty(elem,data, mult, container);
             }
         } else if(data.a === 1){
             if(type === 0) {
-                p = new KeyframedValueProperty(elem,data,mult);
+                p = new KeyframedValueProperty(elem,data,mult, container);
             } else {
-                p = new KeyframedMultidimensionalProperty(elem,data, mult);
+                p = new KeyframedMultidimensionalProperty(elem,data, mult, container);
             }
         } else if(!data.k.length){
-            p = new ValueProperty(elem,data, mult);
+            p = new ValueProperty(elem,data, mult, container);
         }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult);
+            p = new MultiDimensionalProperty(elem,data, mult, container);
         }else{
             switch(type){
                 case 0:
-                    p = new KeyframedValueProperty(elem,data,mult);
+                    p = new KeyframedValueProperty(elem,data,mult, container);
                     break;
                 case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult);
+                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
                     break;
             }
         }
-        if(p.k){
-            arr.push(p);
+        if(p.effectsSequence.length){
+            container.addDynamicProperty(p);
         }
         return p;
     }
 
-    var getGradientProp = (function(){
-
-        function getValue(forceRender){
-            this.prop.getValue();
-            this.cmdf = false;
-            this.omdf = false;
-            if(this.prop.mdf || forceRender){
-                var i, len = this.data.p*4;
-                var mult, val;
-                for(i=0;i<len;i+=1){
-                    mult = i%4 === 0 ? 100 : 255;
-                    val = Math.round(this.prop.v[i]*mult);
-                    if(this.c[i] !== val){
-                        this.c[i] = val;
-                        this.cmdf = true;
-                    }
-                }
-                if(this.o.length){
-                    len = this.prop.v.length;
-                    for(i=this.data.p*4;i<len;i+=1){
-                        mult = i%2 === 0 ? 100 : 1;
-                        val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                        if(this.o[i-this.data.p*4] !== val){
-                            this.o[i-this.data.p*4] = val;
-                            this.omdf = true;
-                        }
-                    }
-                }
-            }
-
-        }
-
-        function gradientProp(elem,data,arr){
-            this.prop = getProp(elem,data.k,1,null,[]);
-            this.data = data;
-            this.k = this.prop.k;
-            this.c = Array.apply(null,{length:data.p*4});
-            var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-            this.o = Array.apply(null,{length:cLength});
-            this.cmdf = false;
-            this.omdf = false;
-            this.getValue = getValue;
-            if(this.prop.k){
-                arr.push(this);
-            }
-            this.getValue(true);
-        }
-
-        return function getGradientProp(elem,data,arr){
-            return new gradientProp(elem,data,arr);
-        }
-    }());
-
-
-
-
-    var DashProperty = (function(){
-
-        function processKeys(forceRender){
-            var i = 0, len = this.dataProps.length;
-
-            if(this.elem.globalData.frameId === this.frameId && !forceRender){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-            while(i<len){
-                if(this.dataProps[i].p.mdf){
-                    this.mdf = true;
-                    break;
-                }
-                i+=1;
-            }
-            if(this.mdf || forceRender){
-                if(this.renderer === 'svg') {
-                    this.dasharray = '';
-                }
-                for(i=0;i<len;i+=1){
-                    if(this.dataProps[i].n != 'o'){
-                        if(this.renderer === 'svg') {
-                            this.dasharray += ' ' + this.dataProps[i].p.v;
-                        }else{
-                            this.dasharray[i] = this.dataProps[i].p.v;
-                        }
-                    }else{
-                        this.dashoffset = this.dataProps[i].p.v;
-                    }
-                }
-            }
-        }
-
-        return function(elem, data,renderer, dynamicProperties){
-            this.elem = elem;
-            this.frameId = -1;
-            this.dataProps = new Array(data.length);
-            this.renderer = renderer;
-            this.mdf = false;
-            this.k = false;
-            if(this.renderer === 'svg'){
-                this.dasharray = '';
-            }else{
-
-                this.dasharray = new Array(data.length - 1);
-            }
-            this.dashoffset = 0;
-            var i, len = data.length, prop;
-            for(i=0;i<len;i+=1){
-                prop = PropertyFactory.getProp(elem,data[i].v,0, 0, dynamicProperties);
-                this.k = prop.k ? true : this.k;
-                this.dataProps[i] = {n:data[i].n,p:prop};
-            }
-            this.getValue = processKeys;
-            if(this.k){
-                dynamicProperties.push(this);
-            }else{
-                this.getValue(true);
-            }
-
-        }
-    }());
-
-    function getDashProp(elem, data,renderer, dynamicProperties) {
-        return new DashProperty(elem, data,renderer, dynamicProperties);
+    var ob = {
+        getProp: getProp
     };
-
-    var TextSelectorProp = (function(){
-        var max = Math.max;
-        var min = Math.min;
-        var floor = Math.floor;
-        function updateRange(){
-            if(this.dynamicProperties.length){
-                var i, len = this.dynamicProperties.length;
-                for(i=0;i<len;i+=1){
-                    this.dynamicProperties[i].getValue();
-                    if(this.dynamicProperties[i].mdf){
-                        this.mdf = true;
-                    }
-                }
-            }
-            var totalChars = this.data.totalChars;
-            var divisor = this.data.r === 2 ? 1 : 100/totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-
-        function getMult(ind){
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var easer = BezierFactory.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get;
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if(type == 2){
-                if(e === s){
-                    mult = ind >= e ? 1 : 0;
-                }else{
-                    mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
-                }
-                mult = easer(mult);
-            }else if(type == 3){
-                if(e === s){
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
-                }
-
-                mult = easer(mult);
-            }else if(type == 4){
-                if(e === s){
-                    mult = 0;
-                }else{
-                    mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
-                    if(mult<.5){
-                        mult *= 2;
-                    }else{
-                        mult = 1 - 2*(mult-0.5);
-                    }
-                }
-                mult = easer(mult);
-            }else if(type == 5){
-                if(e === s){
-                    mult = 0;
-                }else{
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0,ind+0.5-s),e-s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x*x)/(a*a));
-                }
-                mult = easer(mult);
-            }else if(type == 6){
-                if(e === s){
-                    mult = 0;
-                }else{
-                    ind = min(max(0,ind+0.5-s),e-s);
-                    mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind)/(e-s)))))/2;
-                    /*
-                     ind = Math.min(Math.max(s,ind),e-1);
-                     mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind-s)/(e-1-s)))))/2;
-                     mult = Math.max(mult,(1/(e-1-s))/(e-1-s));*/
-                }
-                mult = easer(mult);
-            }else {
-                if(ind >= floor(s)){
-                    if(ind-s < 0){
-                        mult = 1 - (s - ind);
-                    }else{
-                        mult = max(0,min(e-ind,1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        }
-
-        return function TextSelectorProp(elem,data, arr){
-            this.mdf = false;
-            this.k = false;
-            this.data = data;
-            this.dynamicProperties = [];
-            this.getValue = updateRange;
-            this.getMult = getMult;
-            this.comp = elem.comp;
-            this.finalS = 0;
-            this.finalE = 0;
-            this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this.dynamicProperties);
-            if('e' in data){
-                this.e = PropertyFactory.getProp(elem,data.e,0,0,this.dynamicProperties);
-            }else{
-                this.e = {v:data.r === 2 ? data.totalChars : 100};
-            }
-            this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this.dynamicProperties);
-            this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this.dynamicProperties);
-            this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this.dynamicProperties);
-            this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this.dynamicProperties);
-            if(this.dynamicProperties.length){
-                arr.push(this);
-            }else{
-                this.getValue();
-            }
-        }
-    }());
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
-    };
-
-    var ob = {};
-    ob.getProp = getProp;
-    ob.getDashProp = getDashProp;
-    ob.getTextSelectorProp = getTextSelectorProp;
-    ob.getGradientProp = getGradientProp;
     return ob;
 }());
\ No newline at end of file
diff --git a/player/js/utils/TransformProperty.js b/player/js/utils/TransformProperty.js
new file mode 100644
index 0000000..0a03750
--- /dev/null
+++ b/player/js/utils/TransformProperty.js
@@ -0,0 +1,206 @@
+var TransformPropertyFactory = (function() {
+
+    function applyToMatrix(mat) {
+        var _mdf = this._mdf;
+        this.iterateDynamicProperties();
+        this._mdf = this._mdf || _mdf;
+        if (this.a) {
+            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+        }
+        if (this.s) {
+            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+        }
+        if (this.sk) {
+            mat.skewFromAxis(-this.sk.v, this.sa.v);
+        }
+        if (this.r) {
+            mat.rotate(-this.r.v);
+        } else {
+            mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
+        }
+        if (this.data.p.s) {
+            if (this.data.p.z) {
+                mat.translate(this.px.v, this.py.v, -this.pz.v);
+            } else {
+                mat.translate(this.px.v, this.py.v, 0);
+            }
+        } else {
+            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+        }
+    }
+    function processKeys(forceRender){
+        if (this.elem.globalData.frameId === this.frameId) {
+            return;
+        }
+        if(this._isDirty) {
+            this.precalculateMatrix();
+            this._isDirty = false;
+        }
+
+        this.iterateDynamicProperties();
+
+        if (this._mdf || forceRender) {
+            this.v.cloneFromProps(this.pre.props);
+            if (this.appliedTransformations < 1) {
+                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+            }
+            if(this.appliedTransformations < 2) {
+                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+            }
+            if (this.sk && this.appliedTransformations < 3) {
+                this.v.skewFromAxis(-this.sk.v, this.sa.v);
+            }
+            if (this.r && this.appliedTransformations < 4) {
+                this.v.rotate(-this.r.v);
+            } else if (!this.r && this.appliedTransformations < 4){
+                this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
+            }
+            if (this.autoOriented && this.p.keyframes && this.p.getValueAtTime) {
+                var v1,v2;
+                if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
+                    v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / this.elem.globalData.frameRate,0);
+                    v2 = this.p.getValueAtTime(this.p.keyframes[0].t / this.elem.globalData.frameRate, 0);
+                } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+                    v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / this.elem.globalData.frameRate), 0);
+                    v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.01) / this.elem.globalData.frameRate, 0);
+                } else {
+                    v1 = this.p.pv;
+                    v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / this.elem.globalData.frameRate, this.p.offsetTime);
+                }
+                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+            }
+            if(this.data.p.s){
+                if(this.data.p.z) {
+                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
+                } else {
+                    this.v.translate(this.px.v, this.py.v, 0);
+                }
+            }else{
+                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
+            }
+        }
+        this.frameId = this.elem.globalData.frameId;
+    }
+
+    function precalculateMatrix() {
+        if(!this.a.k) {
+            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+            this.appliedTransformations = 1;
+        } else {
+            return;
+        }
+        if(!this.s.effectsSequence.length) {
+            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+            this.appliedTransformations = 2;
+        } else {
+            return;
+        }
+        if(this.sk) {
+            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+            this.appliedTransformations = 3;
+            } else {
+                return;
+            }
+        }
+        if (this.r) {
+            if(!this.r.effectsSequence.length) {
+                this.pre.rotate(-this.r.v);
+                this.appliedTransformations = 4;
+            } else {
+                return;
+            }
+        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+            this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]);
+            this.appliedTransformations = 4;
+        }
+    }
+
+    function autoOrient(){
+        //
+        //var prevP = this.getValueAtTime();
+    }
+
+    function addDynamicProperty(prop) {
+        this._addDynamicProperty(prop);
+        this.elem.addDynamicProperty(prop);
+        this._isDirty = true;
+    }
+
+    function TransformProperty(elem,data,container){
+        this.elem = elem;
+        this.frameId = -1;
+        this.propType = 'transform';
+        this.data = data;
+        this.v = new Matrix();
+        //Precalculated matrix with non animated properties
+        this.pre = new Matrix();
+        this.appliedTransformations = 0;
+        this.initDynamicPropertyContainer(container || elem);
+        if(data.p.s){
+            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
+            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
+            if(data.p.z){
+                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
+            }
+        }else{
+            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
+        }
+        if(data.r) {
+            this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+        } else if(data.rx) {
+            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+            if(data.or.k[0].ti) {
+                var i, len = data.or.k.length;
+                for(i=0;i<len;i+=1) {
+                    data.or.k[i].to = data.or.k[i].ti = null;
+                }
+            }
+            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+            //sh Indicates it needs to be capped between -180 and 180
+            this.or.sh = true;
+        }
+        if(data.sk){
+            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+        }
+        if(data.a) {
+            this.a = PropertyFactory.getProp(elem,data.a,1,0,this);
+        }
+        if(data.s) {
+            this.s = PropertyFactory.getProp(elem,data.s,1,0.01,this);
+        }
+        // Opacity is not part of the transform properties, that's why it won't use this.dynamicProperties. That way transforms won't get updated if opacity changes.
+        if(data.o){
+            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
+        } else {
+            this.o = {_mdf:false,v:1};
+        }
+        this._isDirty = true;
+        if(!this.dynamicProperties.length){
+            this.getValue(true);
+        }
+    }
+
+    TransformProperty.prototype = {
+        applyToMatrix: applyToMatrix,
+        getValue: processKeys,
+        precalculateMatrix: precalculateMatrix,
+        autoOrient: autoOrient
+    }
+
+    extendPrototype([DynamicPropertyContainer], TransformProperty);
+    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+    function getTransformProperty(elem,data,container){
+        return new TransformProperty(elem,data,container);
+    }
+
+    return {
+        getTransformProperty: getTransformProperty
+    };
+
+}());
\ No newline at end of file
diff --git a/player/js/utils/animationFramePolyFill.js b/player/js/utils/animationFramePolyFill.js
index e98a636..0cf0a30 100644
--- a/player/js/utils/animationFramePolyFill.js
+++ b/player/js/utils/animationFramePolyFill.js
@@ -9,7 +9,7 @@
         window.requestAnimationFrame = function (callback, element) {
             var currTime = new Date().getTime();
             var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = window.setTimeout(function () {
+            var id = setTimeout(function () {
                     callback(currTime + timeToCall);
                 },
                 timeToCall);
@@ -20,4 +20,4 @@
         window.cancelAnimationFrame = function (id) {
             clearTimeout(id);
         };
-}());
\ No newline at end of file
+}());
diff --git a/player/js/utils/bez.js b/player/js/utils/bez.js
index 8dc7392..b6c35fd 100644
--- a/player/js/utils/bez.js
+++ b/player/js/utils/bez.js
@@ -5,10 +5,13 @@
 
     function pointOnLine2D(x1,y1, x2,y2, x3,y3){
         var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.0001 && det1 < 0.0001;
+        return det1 > -0.001 && det1 < 0.001;
     }
 
     function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
+        if(z1 === 0 && z2 === 0 && z3 === 0) {
+            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+        }
         var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
         var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
         var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
@@ -27,42 +30,8 @@
         return diffDist > -0.0001 && diffDist < 0.0001;
     }
 
-    /*function getEasingCurve(aa,bb,cc,dd,encodedFuncName) {
-        if(!encodedFuncName){
-            encodedFuncName = ('bez_' + aa+'_'+bb+'_'+cc+'_'+dd).replace(/\./g, 'p');
-        }
-        if(easingFunctions[encodedFuncName]){
-            return easingFunctions[encodedFuncName];
-        }
-        var A0, B0, C0;
-        var A1, B1, C1;
-        easingFunctions[encodedFuncName] = function(tt) {
-            var x = tt;
-            var i = 0, z;
-            while (++i < 20) {
-                C0 = 3 * aa;
-                B0 = 3 * (cc - aa) - C0;
-                A0 = 1 - C0 - B0;
-                z = (x * (C0 + x * (B0 + x * A0))) - tt;
-                if (bm_abs(z) < 1e-3) break;
-                x -= z / (C0 + x * (2 * B0 + 3 * A0 * x));
-            }
-            C1 = 3 * bb;
-            B1 = 3 * (dd - bb) - C1;
-            A1 = 1 - C1 - B1;
-            var polyB = x * (C1 + x * (B1 + x * A1));
-            //return c * polyB + b;
-            return polyB;
-        };
-        return easingFunctions[encodedFuncName];
-    }*/
     var getBezierLength = (function(){
 
-        function Segment(l,p){
-            this.l = l;
-            this.p = p;
-        }
-
         return function(pt1,pt2,pt3,pt4){
             var curveSegments = defaultCurveSegments;
             var k;
@@ -70,10 +39,7 @@
             var ptCoord,perc,addedLength = 0;
             var ptDistance;
             var point = [],lastPoint = [];
-            var lengthData = {
-                addedLength: 0,
-                segments: []
-            };
+            var lengthData = bezier_length_pool.newElement();
             len = pt3.length;
             for(k=0;k<curveSegments;k+=1){
                 perc = k/(curveSegments-1);
@@ -90,13 +56,35 @@
                     ptDistance = bm_sqrt(ptDistance);
                     addedLength += ptDistance;
                 }
-                lengthData.segments.push(new Segment(addedLength,perc));
+                lengthData.percents[k] = perc;
+                lengthData.lengths[k] = addedLength;
             }
             lengthData.addedLength = addedLength;
             return lengthData;
         };
     }());
 
+    function getSegmentsLength(shapeData) {
+        var segmentsLength = segments_length_pool.newElement();
+        var closed = shapeData.c;
+        var pathV = shapeData.v;
+        var pathO = shapeData.o;
+        var pathI = shapeData.i;
+        var i, len = shapeData._length;
+        var lengths = segmentsLength.lengths;
+        var totalLength = 0;
+        for(i=0;i<len-1;i+=1){
+            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
+            totalLength += lengths[i].addedLength;
+        }
+        if(closed){
+            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
+            totalLength += lengths[i].addedLength;
+        }
+        segmentsLength.totalLength = totalLength;
+        return segmentsLength;
+    }
+
     function BezierData(length){
         this.segmentLength = 0;
         this.points = new Array(length);
@@ -116,80 +104,91 @@
             var pt2 = keyData.e;
             var pt3 = keyData.to;
             var pt4 = keyData.ti;
-            var bezierName = (pt1.join('_')+'_'+pt2.join('_')+'_'+pt3.join('_')+'_'+pt4.join('_')).replace(/\./g, 'p');
+            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
             if(storedData[bezierName]){
                 keyData.bezierData = storedData[bezierName];
                 return;
             }
-        var curveSegments = defaultCurveSegments;
-        var k, i, len;
+            var curveSegments = defaultCurveSegments;
+            var k, i, len;
             var ptCoord,perc,addedLength = 0;
             var ptDistance;
             var point,lastPoint = null;
-            if(pt1.length === 2 && (pt1[0] != pt2[0] || pt1[1] != pt2[1]) && pointOnLine2D(pt1[0],pt1[1],pt2[0],pt2[1],pt1[0]+pt3[0],pt1[1]+pt3[1]) && pointOnLine2D(pt1[0],pt1[1],pt2[0],pt2[1],pt2[0]+pt4[0],pt2[1]+pt4[1])){
+            if (pt1.length === 2 && (pt1[0] != pt2[0] || pt1[1] != pt2[1]) && pointOnLine2D(pt1[0],pt1[1],pt2[0],pt2[1],pt1[0]+pt3[0],pt1[1]+pt3[1]) && pointOnLine2D(pt1[0],pt1[1],pt2[0],pt2[1],pt2[0]+pt4[0],pt2[1]+pt4[1])){
                 curveSegments = 2;
             }
             var bezierData = new BezierData(curveSegments);
             len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-            point = new Array(len);
-                perc = k/(curveSegments-1);
+            for (k = 0; k < curveSegments; k += 1) {
+                point = createSizedArray(len);
+                perc = k / (curveSegments - 1);
                 ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                point[i] = ptCoord;
+                for (i = 0; i < len; i += 1){
+                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
+                    point[i] = ptCoord;
                     if(lastPoint !== null){
-                    ptDistance += bm_pow(point[i] - lastPoint[i],2);
+                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
                     }
                 }
-            ptDistance = bm_sqrt(ptDistance);
+                ptDistance = bm_sqrt(ptDistance);
                 addedLength += ptDistance;
-                bezierData.points[k] = new PointData(ptDistance,point);
+                bezierData.points[k] = new PointData(ptDistance, point);
                 lastPoint = point;
             }
             bezierData.segmentLength = addedLength;
             keyData.bezierData = bezierData;
             storedData[bezierName] = bezierData;
-
-        }
+        };
     }());
 
     function getDistancePerc(perc,bezierData){
-        var segments = bezierData.segments;
-        var len = segments.length;
+        var percents = bezierData.percents;
+        var lengths = bezierData.lengths;
+        var len = percents.length;
         var initPos = bm_floor((len-1)*perc);
         var lengthPos = perc*bezierData.addedLength;
         var lPerc = 0;
-        if(lengthPos == segments[initPos].l){
-            return segments[initPos].p;
+        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
+            return percents[initPos];
         }else{
-            var dir = segments[initPos].l > lengthPos ? -1 : 1;
+            var dir = lengths[initPos] > lengthPos ? -1 : 1;
             var flag = true;
             while(flag){
-                if(segments[initPos].l <= lengthPos && segments[initPos+1].l > lengthPos){
-                    lPerc = (lengthPos - segments[initPos].l)/(segments[initPos+1].l-segments[initPos].l);
+                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
+                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
                     flag = false;
                 }else{
                     initPos += dir;
                 }
                 if(initPos < 0 || initPos >= len - 1){
+                    //FIX for TypedArrays that don't store floating point values with enough accuracy
+                    if(initPos === len - 1) {
+                        return percents[initPos];
+                    }
                     flag = false;
                 }
             }
-            return segments[initPos].p + (segments[initPos+1].p - segments[initPos].p)*lPerc;
+            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
         }
     }
 
-    function SegmentPoints(){
-        this.pt1 = new Array(2);
-        this.pt2 = new Array(2);
-        this.pt3 = new Array(2);
-        this.pt4 = new Array(2);
+    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+        var t1 = getDistancePerc(percent,bezierData);
+        var u0 = 1;
+        var u1 = 1 - t1;
+        var ptX = Math.round((u1*u1*u1* pt1[0] + (t1*u1*u1 + u1*t1*u1 + u1*u1*t1)* pt3[0] + (t1*t1*u1 + u1*t1*t1 + t1*u1*t1)*pt4[0] + t1*t1*t1* pt2[0])* 1000) / 1000;
+        var ptY = Math.round((u1*u1*u1* pt1[1] + (t1*u1*u1 + u1*t1*u1 + u1*u1*t1)* pt3[1] + (t1*t1*u1 + u1*t1*t1 + t1*u1*t1)*pt4[1] + t1*t1*t1* pt2[1])* 1000) / 1000;
+        return [ptX, ptY];
     }
 
+    function getSegmentArray() {
+
+    }
+
+    var bezier_segment_points = createTypedArray('float32', 8);
+
     function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
 
-        var pts = new SegmentPoints();
         startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
         var t0 = getDistancePerc(startPerc,bezierData);
         endPerc = endPerc > 1 ? 1 : endPerc;
@@ -197,20 +196,39 @@
         var i, len = pt1.length;
         var u0 = 1 - t0;
         var u1 = 1 - t1;
-        //Math.round(num * 100) / 100
+        var u0u0u0 = u0*u0*u0;
+        var t0u0u0_3 = t0*u0*u0*3;
+        var t0t0u0_3 = t0*t0*u0*3;
+        var t0t0t0 = t0*t0*t0;
+        //
+        var u0u0u1 = u0*u0*u1;
+        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
+        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
+        var t0t0t1 = t0*t0*t1;
+        //
+        var u0u1u1 = u0*u1*u1;
+        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
+        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
+        var t0t1t1 = t0*t1*t1;
+        //
+        var u1u1u1 = u1*u1*u1;
+        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
+        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
+        var t1t1t1 = t1*t1*t1;
         for(i=0;i<len;i+=1){
-            pts.pt1[i] =  Math.round((u0*u0*u0* pt1[i] + (t0*u0*u0 + u0*t0*u0 + u0*u0*t0) * pt3[i] + (t0*t0*u0 + u0*t0*t0 + t0*u0*t0)* pt4[i] + t0*t0*t0* pt2[i])* 1000) / 1000;
-            pts.pt3[i] = Math.round((u0*u0*u1*pt1[i] + (t0*u0*u1 + u0*t0*u1 + u0*u0*t1)* pt3[i] + (t0*t0*u1 + u0*t0*t1 + t0*u0*t1)* pt4[i] + t0*t0*t1* pt2[i])* 1000) / 1000;
-            pts.pt4[i] = Math.round((u0*u1*u1* pt1[i] + (t0*u1*u1 + u0*t1*u1 + u0*u1*t1)* pt3[i] + (t0*t1*u1 + u0*t1*t1 + t0*u1*t1)* pt4[i] + t0*t1*t1* pt2[i])* 1000) / 1000;
-            pts.pt2[i] = Math.round((u1*u1*u1* pt1[i] + (t1*u1*u1 + u1*t1*u1 + u1*u1*t1)* pt3[i] + (t1*t1*u1 + u1*t1*t1 + t1*u1*t1)*pt4[i] + t1*t1*t1* pt2[i])* 1000) / 1000;
+            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
+            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
+            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
+            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
         }
-        return pts;
+
+        return bezier_segment_points;
     }
 
     return {
-        //getEasingCurve : getEasingCurve,
-        getBezierLength : getBezierLength,
+        getSegmentsLength : getSegmentsLength,
         getNewSegment : getNewSegment,
+        getPointInSegment : getPointInSegment,
         buildBezierData : buildBezierData,
         pointOnLine2D : pointOnLine2D,
         pointOnLine3D : pointOnLine3D
diff --git a/player/js/utils/common.js b/player/js/utils/common.js
index 3913740..4ecae5b 100644
--- a/player/js/utils/common.js
+++ b/player/js/utils/common.js
@@ -21,13 +21,13 @@
     }
 }());
 
-function ProjectInterface(){return {}};
+function ProjectInterface(){return {};}
 
 BMMath.random = Math.random;
 BMMath.abs = function(val){
     var tOfVal = typeof val;
     if(tOfVal === 'object' && val.length){
-        var absArr = Array.apply(null,{length:val.length});
+        var absArr = createSizedArray(val.length);
         var i, len = val.length;
         for(i=0;i<len;i+=1){
             absArr[i] = Math.abs(val[i]);
@@ -36,7 +36,7 @@
     }
     return Math.abs(val);
 
-}
+};
 var defaultCurveSegments = 150;
 var degToRads = Math.PI/180;
 var roundCorner = 0.5519;
@@ -52,14 +52,6 @@
 }
 roundValues(false);
 
-function roundTo2Decimals(val){
-    return Math.round(val*10000)/10000;
-}
-
-function roundTo3Decimals(val){
-    return Math.round(val*100)/100;
-}
-
 function styleDiv(element){
     element.style.position = 'absolute';
     element.style.top = 0;
@@ -70,14 +62,6 @@
     element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
 }
 
-function styleUnselectableDiv(element){
-    element.style.userSelect = 'none';
-    element.style.MozUserSelect = 'none';
-    element.style.webkitUserSelect = 'none';
-    element.style.oUserSelect = 'none';
-
-}
-
 function BMEnterFrameEvent(n,c,t,d){
     this.type = n;
     this.currentTime = c;
@@ -92,8 +76,8 @@
 
 function BMCompleteLoopEvent(n,c,t,d){
     this.type = n;
-    this.currentLoop = c;
-    this.totalLoops = t;
+    this.currentLoop = t;
+    this.totalLoops = c;
     this.direction = d < 0 ? -1:1;
 }
 
@@ -108,48 +92,6 @@
     this.target = t;
 }
 
-function _addEventListener(eventName, callback){
-
-    if (!this._cbs[eventName]){
-        this._cbs[eventName] = [];
-    }
-    this._cbs[eventName].push(callback);
-
-	return function() {
-		this.removeEventListener(eventName, callback);
-	}.bind(this);
-}
-
-function _removeEventListener(eventName,callback){
-
-    if (!callback){
-        this._cbs[eventName] = null;
-    }else if(this._cbs[eventName]){
-        var i = 0, len = this._cbs[eventName].length;
-        while(i<len){
-            if(this._cbs[eventName][i] === callback){
-                this._cbs[eventName].splice(i,1);
-                i -=1;
-                len -= 1;
-            }
-            i += 1;
-        }
-        if(!this._cbs[eventName].length){
-            this._cbs[eventName] = null;
-        }
-    }
-
-}
-
-function _triggerEvent(eventName, args){
-    if (this._cbs[eventName]) {
-        var len = this._cbs[eventName].length;
-        for (var i = 0; i < len; i++){
-            this._cbs[eventName][i](args);
-        }
-    }
-}
-
 function randomString(length, chars){
     if(chars === undefined){
         chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
@@ -162,21 +104,18 @@
 
 function HSVtoRGB(h, s, v) {
     var r, g, b, i, f, p, q, t;
-    if (arguments.length === 1) {
-        s = h.s, v = h.v, h = h.h;
-    }
     i = Math.floor(h * 6);
     f = h * 6 - i;
     p = v * (1 - s);
     q = v * (1 - f * s);
     t = v * (1 - (1 - f) * s);
     switch (i % 6) {
-        case 0: r = v, g = t, b = p; break;
-        case 1: r = q, g = v, b = p; break;
-        case 2: r = p, g = v, b = t; break;
-        case 3: r = p, g = q, b = v; break;
-        case 4: r = t, g = p, b = v; break;
-        case 5: r = v, g = p, b = q; break;
+        case 0: r = v; g = t; b = p; break;
+        case 1: r = q; g = v; b = p; break;
+        case 2: r = p; g = v; b = t; break;
+        case 3: r = p; g = q; b = v; break;
+        case 4: r = t; g = p; b = v; break;
+        case 5: r = v; g = p; b = q; break;
     }
     return [ r,
         g,
@@ -184,9 +123,6 @@
 }
 
 function RGBtoHSV(r, g, b) {
-    if (arguments.length === 1) {
-        g = r.g, b = r.b, r = r.r;
-    }
     var max = Math.max(r, g, b), min = Math.min(r, g, b),
         d = max - min,
         h,
@@ -243,11 +179,6 @@
     return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
 }
 
-function componentToHex(c) {
-    var hex = c.toString(16);
-    return hex.length == 1 ? '0' + hex : hex;
-}
-
 var rgbToHex = (function(){
     var colorMap = [];
     var i;
@@ -271,82 +202,3 @@
         return prefix + colorMap[r] + colorMap[g] + colorMap[b];
     };
 }());
-
-function fillToRgba(hex,alpha){
-    if(!cachedColors[hex]){
-        var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
-        cachedColors[hex] = parseInt(result[1], 16)+','+parseInt(result[2], 16)+','+parseInt(result[3], 16);
-    }
-    return 'rgba('+cachedColors[hex]+','+alpha+')';
-}
-
-var fillColorToString = (function(){
-
-    var colorMap = [];
-    return function(colorArr,alpha){
-        if(alpha !== undefined){
-            colorArr[3] = alpha;
-        }
-        if(!colorMap[colorArr[0]]){
-            colorMap[colorArr[0]] = {};
-        }
-        if(!colorMap[colorArr[0]][colorArr[1]]){
-            colorMap[colorArr[0]][colorArr[1]] = {};
-        }
-        if(!colorMap[colorArr[0]][colorArr[1]][colorArr[2]]){
-            colorMap[colorArr[0]][colorArr[1]][colorArr[2]] = {};
-        }
-        if(!colorMap[colorArr[0]][colorArr[1]][colorArr[2]][colorArr[3]]){
-            colorMap[colorArr[0]][colorArr[1]][colorArr[2]][colorArr[3]] = 'rgba(' + colorArr.join(',')+')';
-        }
-        return colorMap[colorArr[0]][colorArr[1]][colorArr[2]][colorArr[3]];
-    };
-}());
-
-function RenderedFrame(tr,o) {
-    this.tr = tr;
-    this.o = o;
-}
-
-function LetterProps(o,sw,sc,fc,m,p){
-    this.o = o;
-    this.sw = sw;
-    this.sc = sc;
-    this.fc = fc;
-    this.m = m;
-    this.props = p;
-}
-
-function iterateDynamicProperties(num){
-    var i, len = this.dynamicProperties;
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue(num);
-    }
-}
-
-function reversePath(paths){
-    var newI = [], newO = [], newV = [];
-    var i, len, newPaths = {};
-    var init = 0;
-    if (paths.c) {
-        newI[0] = paths.o[0];
-        newO[0] = paths.i[0];
-        newV[0] = paths.v[0];
-        init = 1;
-    }
-    len = paths.i.length;
-    var cnt = len - 1;
-
-    for (i = init; i < len; i += 1) {
-        newI.push(paths.o[cnt]);
-        newO.push(paths.i[cnt]);
-        newV.push(paths.v[cnt]);
-        cnt -= 1;
-    }
-
-    newPaths.i = newI;
-    newPaths.o = newO;
-    newPaths.v = newV;
-
-    return newPaths;
-}
\ No newline at end of file
diff --git a/player/js/utils/expressions/CompInterface.js b/player/js/utils/expressions/CompInterface.js
index 13cd592..73dc835 100644
--- a/player/js/utils/expressions/CompInterface.js
+++ b/player/js/utils/expressions/CompInterface.js
@@ -8,7 +8,7 @@
                 }
                 i += 1;
             }
-            return {active:false}
+            return {active:false};
         }
         Object.defineProperty(_thisLayerFunction, "_name", { value:comp.data.nm });
         _thisLayerFunction.layer = _thisLayerFunction;
@@ -18,5 +18,5 @@
         _thisLayerFunction.pixelAspect = 1;
         _thisLayerFunction.frameDuration = 1/comp.globalData.frameRate;
         return _thisLayerFunction;
-    }
+    };
 }());
\ No newline at end of file
diff --git a/player/js/utils/expressions/EffectInterface.js b/player/js/utils/expressions/EffectInterface.js
index eae83be..b2b8f7b 100644
--- a/player/js/utils/expressions/EffectInterface.js
+++ b/player/js/utils/expressions/EffectInterface.js
@@ -4,24 +4,24 @@
     };
 
     function createEffectsInterface(elem, propertyGroup){
-        if(elem.effects){
+        if(elem.effectsManager){
 
             var effectElements = [];
             var effectsData = elem.data.ef;
-            var i, len = elem.effects.effectElements.length;
+            var i, len = elem.effectsManager.effectElements.length;
             for(i=0;i<len;i+=1){
-                effectElements.push(createGroupInterface(effectsData[i],elem.effects.effectElements[i],propertyGroup,elem));
+                effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
             }
 
             return function(name){
-                var effects = elem.data.ef, i = 0, len = effects.length;
+                var effects = elem.data.ef || [], i = 0, len = effects.length;
                 while(i<len) {
                     if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
                         return effectElements[i];
                     }
                     i += 1;
                 }
-            }
+            };
         }
     }
 
@@ -30,11 +30,20 @@
         var i, len = data.ef.length;
         for(i=0;i<len;i+=1){
             if(data.ef[i].ty === 5){
-                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],propertyGroup, elem));
+                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
             } else {
-                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem));
+                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
             }
         }
+
+        function _propertyGroup(val) {
+            if(val === 1){
+               return groupInterface;
+            } else{
+               return propertyGroup(val-1);
+            }
+        }
+
         var groupInterface = function(name){
             var effects = data.ef, i = 0, len = effects.length;
             while(i<len) {
@@ -48,7 +57,10 @@
                 i += 1;
             }
             return effectElements[0]();
-        }
+        };
+
+        groupInterface.propertyGroup = _propertyGroup;
+
         if(data.mn === 'ADBE Color Control'){
             Object.defineProperty(groupInterface, 'color', {
                 get: function(){
@@ -56,17 +68,28 @@
                 }
             });
         }
+        Object.defineProperty(groupInterface, 'numProperties', {
+            get: function(){
+                return data.np;
+            }
+        });
         groupInterface.active = data.en !== 0;
-        return groupInterface
+        return groupInterface;
     }
 
-    function createValueInterface(element, type, elem){
-        return function(){
+    function createValueInterface(element, type, elem, propertyGroup){
+        function interfaceFunction(){
             if(type === 10){
                 return elem.comp.compInterface(element.p.v);
             }
             return ExpressionValue(element.p);
         }
+
+        if(element.p.setGroupProperty) {
+            element.p.setGroupProperty(propertyGroup);
+        }
+
+        return interfaceFunction;
     }
 
     return ob;
diff --git a/player/js/utils/expressions/ExpressionManager.js b/player/js/utils/expressions/ExpressionManager.js
index ea967d0..cecce4e 100644
--- a/player/js/utils/expressions/ExpressionManager.js
+++ b/player/js/utils/expressions/ExpressionManager.js
@@ -1,39 +1,33 @@
 var ExpressionManager = (function(){
+    'use strict';
     var ob = {};
     var Math = BMMath;
     var window = null;
     var document = null;
 
-    function duplicatePropertyValue(value, mult){
+    function duplicatePropertyValue(value, mult) {
         mult = mult || 1;
 
-        if(typeof value === 'number'  || value instanceof Number){
-            return value*mult;
-        }else if(value.i){
-            return JSON.parse(JSON.stringify(value));
-        }else{
-            var arr = Array.apply(null,{length:value.length});
+        if (typeof value === 'number'  || value instanceof Number) {
+            return value * mult;
+        } else if(value.i) {
+            return shape_pool.clone(value);
+        } else {
+            var arr = createTypedArray('float32', value.length);
             var i, len = value.length;
-            for(i=0;i<len;i+=1){
-                arr[i]=value[i]*mult;
+            for (i = 0; i < len; i += 1) {
+                arr[i] = value[i] * mult;
             }
             return arr;
         }
     }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            if(shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1]
-                || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1]
-                || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]){
-                return false;
-            }
-        }
-        return true;
+    function isTypeOfArray(arr) {
+        return arr.constructor === Array || arr.constructor === Float32Array;
+    }
+
+    function isNumerable(tOfV, v) {
+        return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
     }
 
     function $bm_neg(a){
@@ -41,7 +35,7 @@
         if(tOfA === 'number' || tOfA === 'boolean'  || a instanceof Number ){
             return -a;
         }
-        if(a.constructor === Array){
+        if(isTypeOfArray(a)){
             var i, lenA = a.length;
             var retArr = [];
             for(i=0;i<lenA;i+=1){
@@ -57,25 +51,28 @@
         if(tOfA === 'string' || tOfB === 'string'){
             return a + b;
         }
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number) && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string'  || b instanceof Number)) {
+        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
             return a + b;
         }
-        if(a.constructor === Array && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )){
+        if(isTypeOfArray(a) && isNumerable(tOfB, b)){
+            a = a.slice(0);
             a[0] = a[0] + b;
             return a;
         }
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && b.constructor === Array){
+        if(isNumerable(tOfA, a) && isTypeOfArray(b)){
+            b = b.slice(0);
             b[0] = a + b[0];
             return b;
         }
-        if(a.constructor === Array && b.constructor === Array){
+        if(isTypeOfArray(a) && isTypeOfArray(b)){
+            
             var i = 0, lenA = a.length, lenB = b.length;
             var retArr = [];
             while(i<lenA || i < lenB){
-                if(typeof a[i] === 'number' && typeof b[i] === 'number'){
+                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
                     retArr[i] = a[i] + b[i];
                 }else{
-                    retArr[i] = b[i] == undefined ? a[i] : a[i] || b[i];
+                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
                 }
                 i += 1;
             }
@@ -88,25 +85,33 @@
     function sub(a,b) {
         var tOfA = typeof a;
         var tOfB = typeof b;
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )) {
+        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+            if(tOfA === 'string') {
+                a = parseInt(a);
+            }
+            if(tOfB === 'string') {
+                b = parseInt(b);
+            }
             return a - b;
         }
-        if( a.constructor === Array && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )){
+        if( isTypeOfArray(a) && isNumerable(tOfB, b)){
+            a = a.slice(0);
             a[0] = a[0] - b;
             return a;
         }
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) &&  b.constructor === Array){
+        if(isNumerable(tOfA, a) &&  isTypeOfArray(b)){
+            b = b.slice(0);
             b[0] = a - b[0];
             return b;
         }
-        if(a.constructor === Array && b.constructor === Array){
+        if(isTypeOfArray(a) && isTypeOfArray(b)){
             var i = 0, lenA = a.length, lenB = b.length;
             var retArr = [];
             while(i<lenA || i < lenB){
-                if(typeof a[i] === 'number' && typeof b[i] === 'number'){
+                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
                     retArr[i] = a[i] - b[i];
                 }else{
-                    retArr[i] = b[i] == undefined ? a[i] : a[i] || b[i];
+                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
                 }
                 i += 1;
             }
@@ -119,22 +124,22 @@
         var tOfA = typeof a;
         var tOfB = typeof b;
         var arr;
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )) {
+        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
             return a * b;
         }
 
         var i, len;
-        if(a.constructor === Array && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )){
+        if(isTypeOfArray(a) && isNumerable(tOfB, b)){
             len = a.length;
-            arr = Array.apply(null,{length:len});
+            arr = createTypedArray('float32', len);
             for(i=0;i<len;i+=1){
                 arr[i] = a[i] * b;
             }
             return arr;
         }
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && b.constructor === Array){
+        if(isNumerable(tOfA, a) && isTypeOfArray(b)){
             len = b.length;
-            arr = Array.apply(null,{length:len});
+            arr = createTypedArray('float32', len);
             for(i=0;i<len;i+=1){
                 arr[i] = a * b[i];
             }
@@ -147,21 +152,21 @@
         var tOfA = typeof a;
         var tOfB = typeof b;
         var arr;
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )) {
+        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
             return a / b;
         }
         var i, len;
-        if(a.constructor === Array && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number  )){
+        if(isTypeOfArray(a) && isNumerable(tOfB, b)){
             len = a.length;
-            arr = Array.apply(null,{length:len});
+            arr = createTypedArray('float32', len);
             for(i=0;i<len;i+=1){
                 arr[i] = a[i] / b;
             }
             return arr;
         }
-        if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && b.constructor === Array){
+        if(isNumerable(tOfA, a) && isTypeOfArray(b)){
             len = b.length;
-            arr = Array.apply(null,{length:len});
+            arr = createTypedArray('float32', len);
             for(i=0;i<len;i+=1){
                 arr[i] = a / b[i];
             }
@@ -169,6 +174,15 @@
         }
         return 0;
     }
+    function mod(a,b) {
+        if(typeof a === 'string') {
+            a = parseInt(a);
+        }
+        if(typeof b === 'string') {
+            b = parseInt(b);
+        }
+        return a % b;
+    }
 
     function clamp(num, min, max) {
         if(min > max){
@@ -191,27 +205,27 @@
 
     var helperLengthArray = [0,0,0,0,0,0];
 
-    function length(arr1,arr2){
-        if(typeof arr1 === "number"){
+    function length(arr1, arr2) {
+        if (typeof arr1 === 'number' || arr1 instanceof Number) {
             arr2 = arr2 || 0;
             return Math.abs(arr1 - arr2);
         }
-        if(!arr2){
+        if(!arr2) {
             arr2 = helperLengthArray;
         }
-        var i,len = Math.min(arr1.length,arr2.length);
+        var i, len = Math.min(arr1.length, arr2.length);
         var addedLength = 0;
-        for(i=0;i<len;i+=1){
-            addedLength += Math.pow(arr2[i]-arr1[i],2);
+        for (i = 0; i < len; i += 1) {
+            addedLength += Math.pow(arr2[i] - arr1[i], 2);
         }
         return Math.sqrt(addedLength);
     }
 
-    function normalize(vec){
+    function normalize(vec) {
         return div(vec, length(vec));
     }
 
-    function rgbToHsl(val){
+    function rgbToHsl(val) {
         var r = val[0]; var g = val[1]; var b = val[2];
         var max = Math.max(r, g, b), min = Math.min(r, g, b);
         var h, s, l = (max + min) / 2;
@@ -231,6 +245,16 @@
 
         return [h, s, l,val[3]];
     }
+
+    function hue2rgb(p, q, t){
+        if(t < 0) t += 1;
+        if(t > 1) t -= 1;
+        if(t < 1/6) return p + (q - p) * 6 * t;
+        if(t < 1/2) return q;
+        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
+        return p;
+    }
+
     function hslToRgb(val){
         var h = val[0];
         var s = val[1];
@@ -238,17 +262,9 @@
 
         var r, g, b;
 
-        if(s == 0){
+        if(s === 0){
             r = g = b = l; // achromatic
         }else{
-            function hue2rgb(p, q, t){
-                if(t < 0) t += 1;
-                if(t > 1) t -= 1;
-                if(t < 1/6) return p + (q - p) * 6 * t;
-                if(t < 1/2) return q;
-                if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
-                return p;
-            }
 
             var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
             var p = 2 * l - q;
@@ -274,7 +290,7 @@
             return value1 + (value2-value1)*perc;
         }
         var i, len = value1.length;
-        var arr = Array.apply( null, { length: len } );
+        var arr = createTypedArray('float32', len);
         for(i=0;i<len;i+=1){
             arr[i] = value1[i] + (value2[i]-value1[i])*perc;
         }
@@ -293,12 +309,12 @@
         if(max.length){
             var i, len = max.length;
             if(!min){
-                min = Array.apply(null,{length:len});
+                min = createTypedArray('float32', len);
             }
-            var arr = Array.apply(null,{length:len});
+            var arr = createTypedArray('float32', len);
             var rnd = BMMath.random();
             for(i=0;i<len;i+=1){
-                arr[i] = min[i] + rnd*(max[i]-min[i])
+                arr[i] = min[i] + rnd*(max[i]-min[i]);
             }
             return arr;
         }
@@ -309,33 +325,48 @@
         return min + rndm*(max-min);
     }
 
+    function createPath(points, inTangents, outTangents, closed) {
+        var i, len = points.length;
+        var path = shape_pool.newElement();
+        path.setPathData(!!closed, len);
+        var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
+        for(i = 0; i < len; i += 1) {
+            inVertexPoint = inTangents ? inTangents[i] : arrPlaceholder;
+            outVertexPoint = outTangents ? outTangents[i] : arrPlaceholder;
+            path.setTripleAt(points[i][0],points[i][1],outVertexPoint[0] + points[i][0],outVertexPoint[1] + points[i][1],inVertexPoint[0] + points[i][0],inVertexPoint[1] + points[i][1],i,true);
+        }
+        return path;
+    }
+
     function initiateExpression(elem,data,property){
         var val = data.x;
         var needsVelocity = /velocity(?![\w\d])/.test(val);
         var _needsRandom = val.indexOf('random') !== -1;
         var elemType = elem.data.ty;
         var transform,content,effect;
-        var thisComp = elem.comp;
         var thisProperty = property;
         elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
         var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
         var outPoint = elem.data.op/elem.comp.globalData.frameRate;
         var width = elem.data.sw ? elem.data.sw : 0;
         var height = elem.data.sh ? elem.data.sh : 0;
-        var thisLayer,thisComp;
-        var fn = new Function();
-        //var fnStr = 'var fn = function(){'+val+';this.v = $bm_rt;}';
-        //eval(fnStr);
-        var fn = eval('[function(){' + val+';this.v = $bm_rt;}' + ']')[0];
-        var bindedFn = fn.bind(this);
+        var loopIn, loop_in, loopOut, loop_out;
+        var toWorld,fromWorld,fromComp,fromCompToSurface,anchorPoint,thisLayer,thisComp,mask,valueAtTime,velocityAtTime;
+        var __expression_functions = [];
+        if(data.xf) {
+            var i, len = data.xf.length;
+            for(i = 0; i < len; i += 1) {
+                __expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
+            }
+        }
+
+        var scoped_bm_rt;
+        var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
         var numKeys = property.kf ? data.k.length : 0;
 
         var wiggle = function wiggle(freq,amp){
             var i,j, len = this.pv.length ? this.pv.length : 1;
-            var addedAmps = Array.apply(null,{len:len});
-            for(j=0;j<len;j+=1){
-                addedAmps[j] = 0;
-            }
+            var addedAmps = createTypedArray('float32', len);
             freq = 5;
             var iterations = Math.floor(time*freq);
             i = 0;
@@ -351,7 +382,7 @@
             //var rnd2 = BMMath.random();
             var periods = time*freq;
             var perc = periods - Math.floor(periods);
-            var arr = Array.apply({length:len});
+            var arr = createTypedArray('float32', len);
             if(len>1){
                 for(j=0;j<len;j+=1){
                     arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp*2*BMMath.random())*perc;
@@ -364,146 +395,31 @@
             }
         }.bind(this);
 
-        var loopIn = function loopIn(type,duration, durationFlag) {
-            if(!this.k){
-                return this.pv;
-            }
-            var currentFrame = time*elem.comp.globalData.frameRate;
-            var keyframes = this.keyframes;
-            var firstKeyFrame = keyframes[0].t;
-            if(currentFrame>=firstKeyFrame){
-                return this.pv;
-            }else{
-                var cycleDuration, lastKeyFrame;
-                if(!durationFlag){
-                    if(!duration || duration > keyframes.length - 1){
-                        duration = keyframes.length - 1;
-                    }
-                    lastKeyFrame = keyframes[duration].t;
-                    cycleDuration = lastKeyFrame - firstKeyFrame;
-                } else {
-                    if(!duration){
-                        cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
-                    } else {
-                        cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
-                    }
-                    lastKeyFrame = firstKeyFrame + cycleDuration;
-                }
-                var i, len, ret;
-                if(type === 'pingpong') {
-                    var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
-                    if(iterations % 2 === 0){
-                        return this.getValueAtTime(((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                    }
-                } else if(type === 'offset'){
-                    var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                    var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                    var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                    var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
-                    if(this.pv.length){
-                        ret = new Array(initV.length);
-                        len = ret.length;
-                        for(i=0;i<len;i+=1){
-                            ret[i] = current[i]-(endV[i]-initV[i])*repeats;
-                        }
-                        return ret;
-                    }
-                    return current-(endV-initV)*repeats;
-                } else if(type === 'continue'){
-                    var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                    var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
-                    if(this.pv.length){
-                        ret = new Array(firstValue.length);
-                        len = ret.length;
-                        for(i=0;i<len;i+=1){
-                            ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
-                        }
-                        return ret;
-                    }
-                    return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
-                }
-                return this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-            }
-        }.bind(this);
+        if(thisProperty.loopIn) {
+            loopIn = thisProperty.loopIn.bind(thisProperty);
+            loop_in = loopIn;
+        }
 
-        var loopInDuration = function loopInDuration(type,duration){
+        if(thisProperty.loopOut) {
+            loopOut = thisProperty.loopOut.bind(thisProperty);
+            loop_out = loopOut;
+        }
+
+        function loopInDuration(type,duration){
             return loopIn(type,duration,true);
-        }.bind(this);
+        }
 
-        var loopOut = function loopOut(type,duration,durationFlag){
-            if(!this.k || !this.keyframes){
-                return this.pv;
-            }
-            var currentFrame = time*elem.comp.globalData.frameRate;
-            var keyframes = this.keyframes;
-            var lastKeyFrame = keyframes[keyframes.length - 1].t;
-            if(currentFrame<=lastKeyFrame){
-                return this.pv;
-            }else{
-                var cycleDuration, firstKeyFrame;
-                if(!durationFlag){
-                    if(!duration || duration > keyframes.length - 1){
-                        duration = keyframes.length - 1;
-                    }
-                    firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
-                    cycleDuration = lastKeyFrame - firstKeyFrame;
-                } else {
-                    if(!duration){
-                        cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
-                    } else {
-                        cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
-                    }
-                    firstKeyFrame = lastKeyFrame - cycleDuration;
-                }
-                var i, len, ret;
-                if(type === 'pingpong') {
-                    var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                    if(iterations % 2 !== 0){
-                        return this.getValueAtTime((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                    }
-                } else if(type === 'offset'){
-                    var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                    var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                    var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                    var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                    if(this.pv.length){
-                        ret = new Array(initV.length);
-                        len = ret.length;
-                        for(i=0;i<len;i+=1){
-                            ret[i] = (endV[i]-initV[i])*repeats + current[i];
-                        }
-                        return ret;
-                    }
-                    return (endV-initV)*repeats + current;
-                } else if(type === 'continue'){
-                    var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                    var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
-                    if(this.pv.length){
-                        ret = new Array(lastValue.length);
-                        len = ret.length;
-                        for(i=0;i<len;i+=1){
-                            ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
-                        }
-                        return ret;
-                    }
-                    return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
-                }
-                return this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-            }
-        }.bind(this);
-        var loop_out = loopOut;
-
-        var loopOutDuration = function loopOutDuration(type,duration){
+        function loopOutDuration(type,duration){
             return loopOut(type,duration,true);
-        }.bind(this);
+        }
 
-        var valueAtTime = function valueAtTime(t) {
-            return this.getValueAtTime(t, 0);
-        }.bind(this);
+        if(this.getValueAtTime) {
+            valueAtTime = this.getValueAtTime.bind(this);
+        }
 
-        var velocityAtTime = function velocityAtTime(t) {
-            return this.getVelocityAtTime(t);
-        }.bind(this);
+        if(this.getVelocityAtTime) {
+            velocityAtTime = this.getVelocityAtTime.bind(this);
+        }
 
         var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
 
@@ -514,10 +430,26 @@
             return [yaw,pitch,0];
         }
 
-        function easeOut(t, val1, val2){
+        function easeOut(t, tMin, tMax, val1, val2){
+            if(val1 === undefined){
+                val1 = tMin;
+                val2 = tMax;
+            } else {
+                t = (t - tMin) / (tMax - tMin);
+            }
             return -(val2-val1) * t*(t-2) + val1;
         }
 
+        function easeIn(t, tMin, tMax, val1, val2){
+            if(val1 === undefined){
+                val1 = tMin;
+                val2 = tMax;
+            } else {
+                t = (t - tMin) / (tMax - tMin);
+            }
+            return (val2-val1)*t*t + val1;
+        }
+
         function nearestKey(time){
             var i, len = data.k.length,index,keyTime;
             if(!data.k.length || typeof(data.k[0]) === 'number'){
@@ -560,11 +492,12 @@
         }
 
         function key(ind){
+            var ob, i, len;
             if(!data.k.length || typeof(data.k[0]) === 'number'){
-                return {time:0};
+                throw new Error('The property has no keyframe at index ' + ind);
             }
             ind -= 1;
-            var ob = {
+            ob = {
                 time: data.k[ind].t/elem.comp.globalData.frameRate
             };
             var arr;
@@ -573,156 +506,94 @@
             }else{
                 arr = data.k[ind].s;
             }
-            var i, len = arr.length;
+            len = arr.length;
             for(i=0;i<len;i+=1){
                 ob[i] = arr[i];
             }
             return ob;
         }
 
-        function framesToTime(frames,fps){
-            if(!fps){
+        function framesToTime(frames, fps) { 
+            if (!fps) {
                 fps = elem.comp.globalData.frameRate;
             }
-            return frames/fps;
+            return frames / fps;
         }
 
-        function timeToFrames(t,fps){
-            if(!t){
+        function timeToFrames(t, fps) {
+            if (!t && t !== 0) {
                 t = time;
             }
-            if(!fps){
+            if (!fps) {
                 fps = elem.comp.globalData.frameRate;
             }
-            return t*fps;
-        }
-
-        var toworldMatrix = new Matrix();
-        function toWorld(arr){
-            toworldMatrix.reset();
-            elem.finalTransform.mProp.applyToMatrix(toworldMatrix);
-            if(elem.hierarchy && elem.hierarchy.length){
-                var i, len = elem.hierarchy.length;
-                for(i=0;i<len;i+=1){
-                    elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toworldMatrix);
-                }
-                return toworldMatrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-            }
-            return toworldMatrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-        }
-
-        var fromworldMatrix = new Matrix();
-        function fromWorld(arr){
-            fromworldMatrix.reset();
-            var pts = [];
-            pts.push(arr);
-            elem.finalTransform.mProp.applyToMatrix(fromworldMatrix);
-            if(elem.hierarchy && elem.hierarchy.length){
-                var i, len = elem.hierarchy.length;
-                for(i=0;i<len;i+=1){
-                    elem.hierarchy[i].finalTransform.mProp.applyToMatrix(fromworldMatrix);
-                }
-                return fromworldMatrix.inversePoints(pts)[0];
-            }
-            return fromworldMatrix.inversePoints(pts)[0];
+            return t * fps;
         }
 
         function seedRandom(seed){
             BMMath.seedrandom(randSeed + seed);
-        };
+        }
 
-        var time,velocity, value,textIndex,textTotal,selectorValue;
+        function sourceRectAtTime() {
+            return elem.sourceRectAtTime();
+        }
+
+        var time, velocity, value, textIndex, textTotal, selectorValue;
         var index = elem.data.ind;
         var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
         var parent;
         var randSeed = Math.floor(Math.random()*1000000);
-        function execute(){
-            if(_needsRandom){
+        function executeExpression(_value) {
+            value = _value;
+            if (_needsRandom) {
                 seedRandom(randSeed);
             }
-            if(this.frameExpressionId === elem.globalData.frameId && this.type !== 'textSelector'){
-                return;
+            if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
+                return value;
             }
-            if(this.lock){
-                this.v = duplicatePropertyValue(this.pv,this.mult);
-                return true;
-            }
-            if(this.type === 'textSelector'){
+            if(this.propType === 'textSelector'){
                 textIndex = this.textIndex;
                 textTotal = this.textTotal;
                 selectorValue = this.selectorValue;
             }
-            if(!thisLayer){
+            if (!thisLayer) {
                 thisLayer = elem.layerInterface;
                 thisComp = elem.comp.compInterface;
+                toWorld = thisLayer.toWorld.bind(thisLayer);
+                fromWorld = thisLayer.fromWorld.bind(thisLayer);
+                fromComp = thisLayer.fromComp.bind(thisLayer);
+                mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
+                fromCompToSurface = fromComp;
             }
-            if(!transform){
+            if (!transform) {
                 transform = elem.layerInterface("ADBE Transform Group");
+                anchorPoint = transform.anchorPoint;
             }
-            if(elemType === 4 && !content){
+            
+            if (elemType === 4 && !content) {
                 content = thisLayer("ADBE Root Vectors Group");
             }
-            if(!effect){
+            if (!effect) {
                 effect = thisLayer(4);
             }
             hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-            if(hasParent && !parent){
+            if (hasParent && !parent) {
                 parent = elem.hierarchy[0].layerInterface;
             }
-            this.lock = true;
-            if(this.getPreValue){
-                this.getPreValue();
-            }
-            value = this.pv;
             time = this.comp.renderedFrame/this.comp.globalData.frameRate;
-            if(needsVelocity){
+            if (needsVelocity) {
                 velocity = velocityAtTime(time);
             }
-            bindedFn();
+            expression_function();
             this.frameExpressionId = elem.globalData.frameId;
-            var i,len;
-            if(this.mult){
-                if(typeof this.v === 'number' || this.v instanceof Number || typeof this.v === 'string'){
-                    this.v *= this.mult;
-                }else if(this.v.length === 1){
-                    this.v = this.v[0] * this.mult;
-                }else{
-                    len = this.v.length;
-                    if(value === this.v){
-                        this.v = len === 2 ? [value[0],value[1]] : [value[0],value[1],value[2]];
-                    }
-                    for(i = 0; i < len; i += 1){
-                        this.v[i] *= this.mult;
-                    }
-                }
-            }
 
-            if(this.v.length === 1){
-                this.v = this.v[0];
+            //TODO: Check if it's possible to return on ShapeInterface the .v value
+            if (scoped_bm_rt.propType === "shape") {
+                scoped_bm_rt = shape_pool.clone(scoped_bm_rt.v);
             }
-            if(typeof this.v === 'number' || this.v instanceof Number || typeof this.v === 'string'){
-                if(this.lastValue !== this.v){
-                    this.lastValue = this.v;
-                    this.mdf = true;
-                }
-            }else if(this.v._length){
-                if(!shapesEqual(this.v,this.localShapeCollection.shapes[0])){
-                    this.mdf = true;
-                    this.localShapeCollection.releaseShapes();
-                    this.localShapeCollection.addShape(shape_pool.clone(this.v));
-                }
-            }else{
-                len = this.v.length;
-                for(i = 0; i < len; i += 1){
-                    if(this.v[i] !== this.lastValue[i]){
-                        this.lastValue[i] = this.v[i];
-                        this.mdf = true;
-                    }
-                }
-            }
-            this.lock = false;
+            return scoped_bm_rt;
         }
-        return execute;
+        return executeExpression;
     }
 
     ob.initiateExpression = initiateExpression;
diff --git a/player/js/utils/expressions/ExpressionPropertyDecorator.js b/player/js/utils/expressions/ExpressionPropertyDecorator.js
index b8c75bd..c5a2ea9 100644
--- a/player/js/utils/expressions/ExpressionPropertyDecorator.js
+++ b/player/js/utils/expressions/ExpressionPropertyDecorator.js
@@ -4,168 +4,172 @@
         return this.pv;
     }
 
-    function getValueAtTime(frameNum, offsetTime) {
-        frameNum *= this.elem.globalData.frameRate;
-        var i = 0,len = this.keyframes.length- 1,dir= 1,flag = true;
-        var keyData, nextKeyData;
-        offsetTime = offsetTime === undefined ? this.offsetTime : 0;
-        //console.log(this.offsetTime);
-        var retVal = typeof this.pv === 'object' ? [this.pv.length] : 0;
-
-        while(flag){
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i+1];
-            if(i == len-1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                break;
-            }
-            if((nextKeyData.t - offsetTime) > frameNum){
-                break;
-            }
-            if(i < len - 1){
-                i += dir;
-            }else{
-                flag = false;
-            }
+    function loopOut(type,duration,durationFlag){
+        if(!this.k || !this.keyframes){
+            return this.pv;
         }
-
-        var k, kLen,perc,jLen, j = 0, fnc;
-        if (keyData.to) {
-
-            if (!keyData.bezierData) {
-                bez.buildBezierData(keyData);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyData.t-offsetTime || frameNum < keyData.t-offsetTime) {
-                var ind = frameNum >= nextKeyData.t-offsetTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for(k = 0; k < kLen; k += 1){
-                    retVal[k] = bezierData.points[ind].point[k];
+        type = type ? type.toLowerCase() : '';
+        var currentFrame = this.comp.renderedFrame;
+        var keyframes = this.keyframes;
+        var lastKeyFrame = keyframes[keyframes.length - 1].t;
+        if(currentFrame<=lastKeyFrame){
+            return this.pv;
+        }else{
+            var cycleDuration, firstKeyFrame;
+            if(!durationFlag){
+                if(!duration || duration > keyframes.length - 1){
+                    duration = keyframes.length - 1;
                 }
+                firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
+                cycleDuration = lastKeyFrame - firstKeyFrame;
             } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
+                if(!duration){
+                    cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
                 } else {
-                    //fnc = bez.getEasingCurve(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y,keyData.n);
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
+                    cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
                 }
-                perc = fnc((frameNum - (keyData.t - offsetTime)) / ((nextKeyData.t - offsetTime) - (keyData.t - offsetTime)));
-                var distanceInLine = bezierData.segmentLength * perc;
-
-                var segmentPerc;
-                var addedLength = 0;
-                dir = 1;
-                flag = true;
-                jLen = bezierData.points.length;
-                while(flag) {
-                    addedLength += bezierData.points[j].partialLength*dir;
-                    if (distanceInLine === 0 || perc === 0 || j == bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            retVal[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j+1].partialLength){
-                        segmentPerc = (distanceInLine - addedLength) / (bezierData.points[j + 1].partialLength);
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            retVal[k] = bezierData.points[j].point[k] + (bezierData.points[j+1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1 && dir == 1 || j > 0 && dir == -1) {
-                        j += dir;
-                    } else {
-                        flag = false;
-                    }
-                }
+                firstKeyFrame = lastKeyFrame - cycleDuration;
             }
-        } else {
-            var outX,outY,inX,inY, isArray = false, keyValue;
-            len = keyData.s.length;
-            for(i=0;i<len;i+=1){
-                if(keyData.h !== 1){
-                    if(keyData.o.x instanceof Array){
-                        isArray = true;
-                        if(!keyData.__fnct){
-                            keyData.__fnct = [];
-                        }
-                        if(!keyData.__fnct[i]){
-                            outX = keyData.o.x[i] || keyData.o.x[0];
-                            outY = keyData.o.y[i] || keyData.o.y[0];
-                            inX = keyData.i.x[i] || keyData.i.x[0];
-                            inY = keyData.i.y[i] || keyData.i.y[0];
-                        }
-                    }else{
-                        isArray = false;
-                        if(!keyData.__fnct) {
-                            outX = keyData.o.x;
-                            outY = keyData.o.y;
-                            inX = keyData.i.x;
-                            inY = keyData.i.y;
-                        }
-                    }
-                    if(isArray){
-                        if(keyData.__fnct[i]){
-                            fnc = keyData.__fnct[i];
-                        }else{
-                            //fnc = bez.getEasingCurve(outX,outY,inX,inY);
-                            fnc = BezierFactory.getBezierEasing(outX,outY,inX,inY).get;
-                            keyData.__fnct[i] = fnc;
-                        }
-                    }else{
-                        if(keyData.__fnct){
-                            fnc = keyData.__fnct;
-                        }else{
-                            //fnc = bez.getEasingCurve(outX,outY,inX,inY);
-                            fnc = BezierFactory.getBezierEasing(outX,outY,inX,inY).get;
-                            keyData.__fnct = fnc;
-                        }
-                    }
-                    if(frameNum >= nextKeyData.t-offsetTime){
-                        perc = 1;
-                    }else if(frameNum < keyData.t-offsetTime){
-                        perc = 0;
-                    }else{
-                        perc = fnc((frameNum-(keyData.t-offsetTime))/((nextKeyData.t-offsetTime)-(keyData.t-offsetTime)));
-                    }
+            var i, len, ret;
+            if(type === 'pingpong') {
+                var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
+                if(iterations % 2 !== 0){
+                    return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
                 }
-                if(this.sh && keyData.h !== 1){
-                    var initP = keyData.s[i];
-                    var endP = keyData.e[i];
-                    if(initP-endP < -180){
-                        initP += 360;
-                    } else if(initP-endP > 180){
-                        initP -= 360;
+            } else if(type === 'offset'){
+                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+                var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
+                var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
+                if(this.pv.length){
+                    ret = new Array(initV.length);
+                    len = ret.length;
+                    for(i=0;i<len;i+=1){
+                        ret[i] = (endV[i]-initV[i])*repeats + current[i];
                     }
-                    keyValue = initP+(endP-initP)*perc;
-                } else {
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i]+(keyData.e[i]-keyData.s[i])*perc;
+                    return ret;
                 }
-                if(len === 1){
-                    retVal = keyValue;
-                }else{
-                    retVal[i] = keyValue;
+                return (endV-initV)*repeats + current;
+            } else if(type === 'continue'){
+                var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+                var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
+                if(this.pv.length){
+                    ret = new Array(lastValue.length);
+                    len = ret.length;
+                    for(i=0;i<len;i+=1){
+                        ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
+                    }
+                    return ret;
                 }
+                return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
             }
+            return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
         }
-        return retVal;
+    }
+
+    function loopIn(type,duration, durationFlag) {
+        if(!this.k){
+            return this.pv;
+        }
+        type = type ? type.toLowerCase() : '';
+        var currentFrame = this.comp.renderedFrame;
+        var keyframes = this.keyframes;
+        var firstKeyFrame = keyframes[0].t;
+        if(currentFrame>=firstKeyFrame){
+            return this.pv;
+        }else{
+            var cycleDuration, lastKeyFrame;
+            if(!durationFlag){
+                if(!duration || duration > keyframes.length - 1){
+                    duration = keyframes.length - 1;
+                }
+                lastKeyFrame = keyframes[duration].t;
+                cycleDuration = lastKeyFrame - firstKeyFrame;
+            } else {
+                if(!duration){
+                    cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
+                } else {
+                    cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
+                }
+                lastKeyFrame = firstKeyFrame + cycleDuration;
+            }
+            var i, len, ret;
+            if(type === 'pingpong') {
+                var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
+                if(iterations % 2 === 0){
+                    return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
+                }
+            } else if(type === 'offset'){
+                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+                var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
+                var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
+                if(this.pv.length){
+                    ret = new Array(initV.length);
+                    len = ret.length;
+                    for(i=0;i<len;i+=1){
+                        ret[i] = current[i]-(endV[i]-initV[i])*repeats;
+                    }
+                    return ret;
+                }
+                return current-(endV-initV)*repeats;
+            } else if(type === 'continue'){
+                var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+                var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
+                if(this.pv.length){
+                    ret = new Array(firstValue.length);
+                    len = ret.length;
+                    for(i=0;i<len;i+=1){
+                        ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
+                    }
+                    return ret;
+                }
+                return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
+            }
+            return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
+        }
+    }
+
+    function getValueAtTime(frameNum) {
+        if(frameNum !== this._cachingAtTime.lastFrame) {
+            frameNum *= this.elem.globalData.frameRate;
+            frameNum -= this.offsetTime;
+            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
+            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
+            this._cachingAtTime.lastFrame = frameNum;
+        }
+        return this._cachingAtTime.value;
+
+    }
+
+    function getSpeedAtTime(frameNum) {
+        var delta = -0.01;
+        var v1 = this.getValueAtTime(frameNum);
+        var v2 = this.getValueAtTime(frameNum + delta);
+        var speed = 0;
+        if(v1.length){
+            var i;
+            for(i=0;i<v1.length;i+=1){
+                speed += Math.pow(v2[i] - v1[i], 2);
+            }
+            speed = Math.sqrt(speed) * 100;
+        } else {
+            speed = 0;
+        }
+        return speed;
     }
 
     function getVelocityAtTime(frameNum) {
         if(this.vel !== undefined){
             return this.vel;
         }
-        var delta = -0.01;
+        var delta = -0.001;
         //frameNum += this.elem.data.st;
-        var v1 = this.getValueAtTime(frameNum, 0);
-        var v2 = this.getValueAtTime(frameNum + delta, 0);
+        var v1 = this.getValueAtTime(frameNum);
+        var v2 = this.getValueAtTime(frameNum + delta);
         var velocity;
         if(v1.length){
-            velocity = Array.apply(null,{length:v1.length});
+            velocity = createTypedArray('float32', v1.length);
             var i;
             for(i=0;i<v1.length;i+=1){
                 //removing frameRate
@@ -177,7 +181,7 @@
             velocity = (v2 - v1)/delta;
         }
         return velocity;
-    };
+    }
 
     function setGroupProperty(propertyGroup){
         this.propertyGroup = propertyGroup;
@@ -187,13 +191,19 @@
         if(data.x){
             prop.k = true;
             prop.x = true;
-            if(prop.getValue) {
-                prop.getPreValue = prop.getValue;
-            }
-            prop.getValue = ExpressionManager.initiateExpression.bind(prop)(elem,data,prop);
+            prop.initiateExpression = ExpressionManager.initiateExpression;
+            prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
         }
     }
 
+    function getTransformValueAtTime(time) {
+        console.warn('Transform at time not supported');
+    }
+
+    function getTransformStaticValueAtTime(time) {
+
+    }
+
     var TextExpressionSelectorProp = (function(){
 
         function getValueProxy(index,total){
@@ -207,8 +217,8 @@
             this.pv = 1;
             this.comp = elem.comp;
             this.elem = elem;
-            this.mult = .01;
-            this.type = 'textSelector';
+            this.mult = 0.01;
+            this.propType = 'textSelector';
             this.textTotal = data.totalChars;
             this.selectorValue = 100;
             this.lastValue = [1,1,1];
@@ -221,70 +231,188 @@
                 this.getValueAtTime = getStaticValueAtTime.bind(this);
             }
             this.setGroupProperty = setGroupProperty;
-        }
+        };
     }());
 
+    var getTransformProperty = TransformPropertyFactory.getTransformProperty;
+    TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
+        var prop = getTransformProperty(elem, data, container);
+        if(prop.dynamicProperties.length) {
+            prop.getValueAtTime = getTransformValueAtTime.bind(prop);
+        } else {
+            prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
+        }
+        prop.setGroupProperty = setGroupProperty;
+        return prop;
+    };
 
     var propertyGetProp = PropertyFactory.getProp;
-    PropertyFactory.getProp = function(elem,data,type, mult, arr){
-        var prop = propertyGetProp(elem,data,type, mult, arr);
-        prop.getVelocityAtTime = getVelocityAtTime;
+    PropertyFactory.getProp = function(elem,data,type, mult, container){
+        var prop = propertyGetProp(elem,data,type, mult, container);
+        //prop.getVelocityAtTime = getVelocityAtTime;
+        //prop.loopOut = loopOut;
+        //prop.loopIn = loopIn;
         if(prop.kf){
             prop.getValueAtTime = getValueAtTime.bind(prop);
         } else {
             prop.getValueAtTime = getStaticValueAtTime.bind(prop);
         }
         prop.setGroupProperty = setGroupProperty;
-        var isAdded = prop.k;
-        if(data.ix !== undefined){
-            Object.defineProperty(prop,'propertyIndex',{
-                get: function(){
-                    return data.ix;
-                }
-            })
+        prop.loopOut = loopOut;
+        prop.loopIn = loopIn;
+        prop.getVelocityAtTime = getVelocityAtTime.bind(prop);
+        prop.getSpeedAtTime = getSpeedAtTime.bind(prop);
+        prop.numKeys = data.a === 1 ? data.k.length : 0;
+        prop.propertyIndex = data.ix;
+        var value = 0;
+        if(type !== 0) {
+            value = createTypedArray('float32', data.a === 1 ?  data.k[0].s.length : data.k.length);
         }
+        prop._cachingAtTime = {
+            lastFrame: initialDefaultFrame,
+            lastIndex: 0,
+            value: value
+        };
         searchExpressions(elem,data,prop);
-        if(!isAdded && prop.x){
-            arr.push(prop);
+        if(prop.k){
+            container.addDynamicProperty(prop);
         }
 
         return prop;
+    };
+
+    function getShapeValueAtTime(frameNum) {
+        //For now this caching object is created only when needed instead of creating it when the shape is initialized.
+        if (!this._cachingAtTime) {
+            this._cachingAtTime = {
+                shapeValue: shape_pool.clone(this.pv),
+                lastIndex: 0,
+                lastTime: initialDefaultFrame
+            };
+        }
+        if(frameNum !== this._cachingAtTime.lastTime) {
+            this._cachingAtTime.lastTime = frameNum;
+            frameNum *= this.elem.globalData.frameRate;
+            this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
+        }
+        return this._cachingAtTime.shapeValue;
     }
 
+    var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
+    var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
+
+    function ShapeExpressions(){}
+    ShapeExpressions.prototype = {
+        vertices: function(prop, time){
+            var shapePath = this.v;
+            if(time !== undefined) {
+                shapePath = this.getValueAtTime(time, 0);
+            }
+            var i, len = shapePath._length;
+            var vertices = shapePath[prop];
+            var points = shapePath.v;
+            var arr = createSizedArray(len);
+            for(i = 0; i < len; i += 1) {
+                if(prop === 'i' || prop === 'o') {
+                    arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
+                } else {
+                    arr[i] = [vertices[i][0], vertices[i][1]];
+                }
+                
+            }
+            return arr;
+        },
+        points: function(time){
+            return this.vertices('v', time);
+        },
+        inTangents: function(time){
+            return this.vertices('i', time);
+        },
+        outTangents: function(time){
+            return this.vertices('o', time);
+        },
+        isClosed: function(){
+            return this.v.c;
+        },
+        pointOnPath: function(perc, time){
+            var shapePath = this.v;
+            if(time !== undefined) {
+                shapePath = this.getValueAtTime(time, 0);
+            }
+            if(!this._segmentsLength) {
+                this._segmentsLength = bez.getSegmentsLength(shapePath);
+            }
+
+            var segmentsLength = this._segmentsLength;
+            var lengths = segmentsLength.lengths;
+            var lengthPos = segmentsLength.totalLength * perc;
+            var i = 0, len = lengths.length;
+            var j = 0, jLen;
+            var accumulatedLength = 0, pt;
+            while(i < len) {
+                if(accumulatedLength + lengths[i].addedLength > lengthPos) {
+                    var initIndex = i;
+                    var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
+                    var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
+                    pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
+                    break;
+                } else {
+                    accumulatedLength += lengths[i].addedLength;
+                }
+                i += 1;
+            }
+            if(!pt){
+                pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
+            }
+            return pt;
+        },
+        vectorOnPath: function(perc, time, vectorType){
+            //perc doesn't use triple equality because it can be a Number object as well as a primitive.
+            perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
+            var pt1 = this.pointOnPath(perc, time);
+            var pt2 = this.pointOnPath(perc + 0.001, time);
+            var xLength = pt2[0] - pt1[0];
+            var yLength = pt2[1] - pt1[1];
+            var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
+            var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
+            return unitVector;
+        },
+        tangentOnPath: function(perc, time){
+            return this.vectorOnPath(perc, time, 'tangent');
+        },
+        normalOnPath: function(perc, time){
+            return this.vectorOnPath(perc, time, 'normal');
+        },
+        setGroupProperty: setGroupProperty,
+        getValueAtTime: getStaticValueAtTime
+    };
+    extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
+    extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
+    KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
+    KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
+
     var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
     ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
         var prop = propertyGetShapeProp(elem,data,type, arr, trims);
-        prop.setGroupProperty = setGroupProperty;
-        if(prop.kf){
-            prop.getValueAtTime = getValueAtTime;
-        } else {
-            prop.getValueAtTime = getStaticValueAtTime;
-        }
-        var isAdded = prop.k;
-        if(data.ix !== undefined){
-            Object.defineProperty(prop,'propertyIndex',{
-                get: function(){
-                    return data.ix;
-                }
-            })
-        }
+        prop.propertyIndex = data.ix;
+        prop.lock = false;
         if(type === 3){
             searchExpressions(elem,data.pt,prop);
         } else if(type === 4){
             searchExpressions(elem,data.ks,prop);
         }
-        if(!isAdded && prop.x){
-            arr.push(prop);
+        if(prop.k){
+            elem.addDynamicProperty(prop);
         }
         return prop;
-    }
+    };
 
-    var propertyGetTextProp = PropertyFactory.getTextSelectorProp;
-    PropertyFactory.getTextSelectorProp = function(elem, data,arr){
+    var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
+    TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
         if(data.t === 1){
             return new TextExpressionSelectorProp(elem, data,arr);
         } else {
             return propertyGetTextProp(elem,data,arr);
         }
-    }
+    };
 }());
\ No newline at end of file
diff --git a/player/js/utils/expressions/ExpressionTextPropertyDecorator.js b/player/js/utils/expressions/ExpressionTextPropertyDecorator.js
new file mode 100644
index 0000000..8b9ffcc
--- /dev/null
+++ b/player/js/utils/expressions/ExpressionTextPropertyDecorator.js
@@ -0,0 +1,27 @@
+(function addDecorator() {
+
+    function searchExpressions(){
+        if(this.data.d.x){
+            this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
+            this.addEffect(this.getExpressionValue.bind(this));
+            return true;
+        }
+    }
+
+    TextProperty.prototype.getExpressionValue = function(currentValue) {
+        var newValue = this.calculateExpression(currentValue.t);
+        currentValue.t = newValue;
+        return currentValue;
+    }
+
+    TextProperty.prototype.searchProperty = function(){
+
+        var isKeyframed = this.searchKeyframes();
+        var hasExpressions = this.searchExpressions();
+        this.kf = isKeyframed || hasExpressions;
+        return this.kf;
+    };
+
+    TextProperty.prototype.searchExpressions = searchExpressions;
+    
+}());
\ No newline at end of file
diff --git a/player/js/utils/expressions/ExpressionValue.js b/player/js/utils/expressions/ExpressionValue.js
index 4cdbf33..2589285 100644
--- a/player/js/utils/expressions/ExpressionValue.js
+++ b/player/js/utils/expressions/ExpressionValue.js
@@ -1,29 +1,32 @@
 var ExpressionValue = (function() {
 	return function(elementProp, mult, type) {
+        mult = mult || 1;
         var expressionValue, arrayValue;
+
 		if (elementProp.k) {
             elementProp.getValue();
         }
-        var i, len, arrValue;
+        var i, len, arrValue, val;
         if (type) {
         	if(type === 'color') {
         		len = 4;
-		        expressionValue = Array.apply(null, {length: len});
-		        arrValue = Array.apply(null, {length: len});
+                expressionValue = createTypedArray('float32', len);
+                arrValue = createTypedArray('float32', len);
 		        for (i = 0; i < len; i += 1) {
-		            expressionValue[i] = arrValue[i] = (mult && i < 3) ? elementProp.v[i] * mult : 1;
+		            expressionValue[i] = arrValue[i] = (i < 3) ? elementProp.v[i] * mult : 1;
 		        }
 	        	expressionValue.value = arrValue;
         	}
-        } else if (typeof elementProp.v === 'number' || elementProp.v instanceof Number){
-            expressionValue = mult ? new Number(elementProp.v * mult) : new Number(elementProp.v);
-            expressionValue.value = mult ? elementProp.v * mult : elementProp.v;
+        } else if (elementProp.propType === 'unidimensional'){
+            val = elementProp.v * mult;
+            expressionValue = new Number(val);
+            expressionValue.value = val;
         } else {
-        	len = elementProp.v.length;
-	        expressionValue = Array.apply(null, {length: len});
-	        arrValue = Array.apply(null, {length: len});
+        	len = elementProp.pv.length;
+            expressionValue = createTypedArray('float32', len);
+            arrValue = createTypedArray('float32', len);
 	        for (i = 0; i < len; i += 1) {
-	            expressionValue[i] = arrValue[i] = mult ? elementProp.v[i] * mult : elementProp.v[i];
+	            expressionValue[i] = arrValue[i] = elementProp.v[i] * mult;
 	        }
 	        expressionValue.value = arrValue;
         }
@@ -37,7 +40,9 @@
             }
         };
         expressionValue.valueAtTime = elementProp.getValueAtTime;
+        expressionValue.speedAtTime = elementProp.getSpeedAtTime;
+        expressionValue.velocityAtTime = elementProp.getVelocityAtTime;
         expressionValue.propertyGroup = elementProp.propertyGroup;
         return expressionValue;
-	}
-}())
\ No newline at end of file
+	};
+}());
\ No newline at end of file
diff --git a/player/js/utils/expressions/LayerInterface.js b/player/js/utils/expressions/LayerInterface.js
index f47ef8e..d178107 100644
--- a/player/js/utils/expressions/LayerInterface.js
+++ b/player/js/utils/expressions/LayerInterface.js
@@ -1,8 +1,16 @@
 var LayerExpressionInterface = (function (){
-    function toWorld(arr){
+    function toWorld(arr, time){
         var toWorldMat = new Matrix();
         toWorldMat.reset();
-        this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
+        var transformMat;
+        if(time) {
+            //Todo implement value at time on transform properties
+            //transformMat = this._elem.finalTransform.mProp.getValueAtTime(time);
+            transformMat = this._elem.finalTransform.mProp;
+        } else {
+            transformMat = this._elem.finalTransform.mProp;
+        }
+        transformMat.applyToMatrix(toWorldMat);
         if(this._elem.hierarchy && this._elem.hierarchy.length){
             var i, len = this._elem.hierarchy.length;
             for(i=0;i<len;i+=1){
@@ -12,6 +20,27 @@
         }
         return toWorldMat.applyToPointArray(arr[0],arr[1],arr[2]||0);
     }
+    function fromWorld(arr, time){
+        var toWorldMat = new Matrix();
+        toWorldMat.reset();
+        var transformMat;
+        if(time) {
+            //Todo implement value at time on transform properties
+            //transformMat = this._elem.finalTransform.mProp.getValueAtTime(time);
+            transformMat = this._elem.finalTransform.mProp;
+        } else {
+            transformMat = this._elem.finalTransform.mProp;
+        }
+        transformMat.applyToMatrix(toWorldMat);
+        if(this._elem.hierarchy && this._elem.hierarchy.length){
+            var i, len = this._elem.hierarchy.length;
+            for(i=0;i<len;i+=1){
+                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
+            }
+            return toWorldMat.inversePoint(arr);
+        }
+        return toWorldMat.inversePoint(arr);
+    }
     function fromComp(arr){
         var toWorldMat = new Matrix();
         toWorldMat.reset();
@@ -26,13 +55,17 @@
         return toWorldMat.inversePoint(arr);
     }
 
+    function sampleImage() {
+        return [1,1,1,1];
+    }
+
 
     return function(elem){
 
-        var transformInterface = TransformExpressionInterface(elem.transform);
+        var transformInterface;
 
         function _registerMaskInterface(maskManager){
-            _thisLayerFunction.mask = maskManager.getMask.bind(maskManager);
+            _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
         }
         function _registerEffectsInterface(effects){
             _thisLayerFunction.effect = effects;
@@ -45,6 +78,7 @@
                 case 2:
                     return _thisLayerFunction.shapeInterface;
                 case 1:
+                case 6:
                 case "Transform":
                 case "transform":
                 case "ADBE Transform Group":
@@ -55,93 +89,51 @@
             }
         }
         _thisLayerFunction.toWorld = toWorld;
+        _thisLayerFunction.fromWorld = fromWorld;
         _thisLayerFunction.toComp = toWorld;
         _thisLayerFunction.fromComp = fromComp;
+        _thisLayerFunction.sampleImage = sampleImage;
+        _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
         _thisLayerFunction._elem = elem;
-        Object.defineProperty(_thisLayerFunction, 'hasParent', {
-            get: function(){
-                return !!elem.hierarchy;
-            }
-        });
-        Object.defineProperty(_thisLayerFunction, 'parent', {
-            get: function(){
-                return elem.hierarchy[0].layerInterface;
-            }
-        });
-        Object.defineProperty(_thisLayerFunction, "rotation", {
-            get: function(){
-                return transformInterface.rotation;
-            }
-        });
-        Object.defineProperty(_thisLayerFunction, "scale", {
-            get: function () {
-                return transformInterface.scale;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "position", {
-            get: function () {
-                return transformInterface.position;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "anchorPoint", {
-            get: function () {
-                return transformInterface.anchorPoint;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "transform", {
-            get: function () {
-                return transformInterface;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "width", {
-            get: function () {
-                if(elem.data.ty === 0) {
-                    return elem.data.w
+        transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
+        var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
+        Object.defineProperties(_thisLayerFunction,{
+            hasParent: {
+                get: function(){
+                    return elem.hierarchy.length;
                 }
-                return 100;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "height", {
-            get: function () {
-                if(elem.data.ty === 0) {
-                    return elem.data.h
+            },
+            parent: {
+                get: function(){
+                    return elem.hierarchy[0].layerInterface;
                 }
-                return 100;
+            },
+            rotation: getDescriptor(transformInterface, 'rotation'),
+            scale: getDescriptor(transformInterface, 'scale'),
+            position: getDescriptor(transformInterface, 'position'),
+            opacity: getDescriptor(transformInterface, 'opacity'),
+            anchorPoint: anchorPointDescriptor,
+            anchor_point: anchorPointDescriptor,
+            transform: {
+                get: function () {
+                    return transformInterface;
+                }
+            },
+            active: {
+                get: function(){
+                    return elem.isInRange;
+                }
             }
         });
 
-        Object.defineProperty(_thisLayerFunction, "source", {
-            get: function () {
-                return elem.data.refId;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "_name", { value:elem.data.nm });
-        Object.defineProperty(_thisLayerFunction, "content", {
-            get: function(){
-                return _thisLayerFunction.shapeInterface;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "active", {
-            get: function(){
-                return elem.isVisible;
-            }
-        });
-
-        Object.defineProperty(_thisLayerFunction, "text", {
-            get: function(){
-                return _thisLayerFunction.textInterface;
-            }
-        });
+        _thisLayerFunction.startTime = elem.data.st;
+        _thisLayerFunction.index = elem.data.ind;
+        _thisLayerFunction.source = elem.data.refId;
+        _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
+        _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
 
         _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
         _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
         return _thisLayerFunction;
-    }
+    };
 }());
diff --git a/player/js/utils/expressions/MaskInterface.js b/player/js/utils/expressions/MaskInterface.js
new file mode 100644
index 0000000..fafeaaf
--- /dev/null
+++ b/player/js/utils/expressions/MaskInterface.js
@@ -0,0 +1,37 @@
+var MaskManagerInterface = (function(){
+
+	function MaskInterface(mask, data){
+		this._mask = mask;
+		this._data = data;
+	}
+	Object.defineProperty(MaskInterface.prototype, 'maskPath', {
+        get: function(){
+                if(this._mask.prop.k){
+                    this._mask.prop.getValue();
+                }
+                return this._mask.prop;
+            }
+        });
+
+	var MaskManager = function(maskManager, elem){
+		var _maskManager = maskManager;
+		var _elem = elem;
+		var _masksInterfaces = createSizedArray(maskManager.viewData.length);
+		var i, len = maskManager.viewData.length;
+		for(i = 0; i < len; i += 1) {
+			_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
+		}
+
+		var maskFunction = function(name){
+			i = 0;
+		    while(i<len){
+		        if(maskManager.masksProperties[i].nm === name){
+		            return _masksInterfaces[i];
+		        }
+		        i += 1;
+		    }
+		};
+		return maskFunction;
+	};
+	return MaskManager;
+}());
diff --git a/player/js/utils/expressions/ProjectInterface.js b/player/js/utils/expressions/ProjectInterface.js
index 7567c35..6efacad 100644
--- a/player/js/utils/expressions/ProjectInterface.js
+++ b/player/js/utils/expressions/ProjectInterface.js
@@ -10,7 +10,7 @@
             while(i<len){
                 if(this.compositions[i].data && this.compositions[i].data.nm === name){
                     if(this.compositions[i].prepareFrame) {
-                        this.compositions[i].prepareFrame(this.currentFrame);
+                        this.compositions[i].prepareFrame(this.compositions[i].data.xt ? this.currentFrame : this.compositions[i].renderedFrame);
                     }
                     return this.compositions[i].compInterface;
                 }
@@ -26,5 +26,5 @@
 
 
         return _thisProjectFunction;
-    }
+    };
 }());
\ No newline at end of file
diff --git a/player/js/utils/expressions/ShapeInterface.js b/player/js/utils/expressions/ShapeInterface.js
index a3b01db..60ff03e 100644
--- a/player/js/utils/expressions/ShapeInterface.js
+++ b/player/js/utils/expressions/ShapeInterface.js
@@ -1,786 +1,637 @@
 var ShapeExpressionInterface = (function(){
-    var ob = {
-        createShapeInterface:createShapeInterface,
-        createGroupInterface:createGroupInterface,
-        createTrimInterface:createTrimInterface,
-        createStrokeInterface:createStrokeInterface,
-        createTransformInterface:createTransformInterface,
-        createEllipseInterface:createEllipseInterface,
-        createStarInterface:createStarInterface,
-        createRectInterface:createRectInterface,
-        createRoundedInterface:createRoundedInterface,
-        createRepatearInterface:createRepatearInterface,
-        createPathInterface:createPathInterface,
-        createFillInterface:createFillInterface
-    };
-    function createShapeInterface(shapes,view,propertyGroup){
-        return shapeInterfaceFactory(shapes,view,propertyGroup);
-    }
-    function createGroupInterface(shapes,view,propertyGroup){
-        return groupInterfaceFactory(shapes,view,propertyGroup);
-    }
-    function createFillInterface(shape,view,propertyGroup){
-        return fillInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createStrokeInterface(shape,view,propertyGroup){
-        return strokeInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createTrimInterface(shape,view,propertyGroup){
-        return trimInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createTransformInterface(shape,view,propertyGroup){
-        return transformInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createEllipseInterface(shape,view,propertyGroup){
-        return ellipseInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createStarInterface(shape,view,propertyGroup){
-        return starInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createRectInterface(shape,view,propertyGroup){
-        return rectInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createRoundedInterface(shape,view,propertyGroup){
-        return roundedInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createRepatearInterface(shape,view,propertyGroup){
-        return repeaterInterfaceFactory(shape,view,propertyGroup);
-    }
-    function createPathInterface(shape,view,propertyGroup){
-        return pathInterfaceFactory(shape,view,propertyGroup);
-    }
 
     function iterateElements(shapes,view, propertyGroup){
         var arr = [];
         var i, len = shapes ? shapes.length : 0;
         for(i=0;i<len;i+=1){
             if(shapes[i].ty == 'gr'){
-                arr.push(ShapeExpressionInterface.createGroupInterface(shapes[i],view[i],propertyGroup));
+                arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
             }else if(shapes[i].ty == 'fl'){
-                arr.push(ShapeExpressionInterface.createFillInterface(shapes[i],view[i],propertyGroup));
+                arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
             }else if(shapes[i].ty == 'st'){
-                arr.push(ShapeExpressionInterface.createStrokeInterface(shapes[i],view[i],propertyGroup));
+                arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
             }else if(shapes[i].ty == 'tm'){
-                arr.push(ShapeExpressionInterface.createTrimInterface(shapes[i],view[i],propertyGroup));
+                arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
             }else if(shapes[i].ty == 'tr'){
-                //arr.push(ShapeExpressionInterface.createTransformInterface(shapes[i],view[i],propertyGroup));
+                //arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
             }else if(shapes[i].ty == 'el'){
-                arr.push(ShapeExpressionInterface.createEllipseInterface(shapes[i],view[i],propertyGroup));
+                arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
             }else if(shapes[i].ty == 'sr'){
-                arr.push(ShapeExpressionInterface.createStarInterface(shapes[i],view[i],propertyGroup));
+                arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
             } else if(shapes[i].ty == 'sh'){
-                arr.push(ShapeExpressionInterface.createPathInterface(shapes[i],view[i],propertyGroup));
+                arr.push(pathInterfaceFactory(shapes[i],view[i],propertyGroup));
             } else if(shapes[i].ty == 'rc'){
-                arr.push(ShapeExpressionInterface.createRectInterface(shapes[i],view[i],propertyGroup));
+                arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
             } else if(shapes[i].ty == 'rd'){
-                arr.push(ShapeExpressionInterface.createRoundedInterface(shapes[i],view[i],propertyGroup));
+                arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
             } else if(shapes[i].ty == 'rp'){
-                arr.push(ShapeExpressionInterface.createRepatearInterface(shapes[i],view[i],propertyGroup));
-            } else{
-                //console.log(shapes[i].ty);
+                arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
             }
         }
         return arr;
     }
 
-    var shapeInterfaceFactory = (function(){
-        return function(shapes,view,propertyGroup){
-            var interfaces;
-            function _interfaceFunction(value){
-                if(typeof value === 'number'){
-                    return interfaces[value-1];
-                } else {
-                    var i = 0, len = interfaces.length;
-                    while(i<len){
-                        if(interfaces[i]._name === value){
-                            return interfaces[i];
-                        }
-                        i+=1;
-                    }
+    function contentsInterfaceFactory(shape,view, propertyGroup){
+       var interfaces;
+       var interfaceFunction = function _interfaceFunction(value){
+           var i = 0, len = interfaces.length;
+            while(i<len){
+                if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
+                   return interfaces[i];
                 }
+                i+=1;
             }
-            _interfaceFunction.propertyGroup = propertyGroup;
-            interfaces = iterateElements(shapes, view, _interfaceFunction);
-            return _interfaceFunction;
-        }
-    }());
+            if(typeof value === 'number'){
+               return interfaces[value-1];
+            }
+       };
+       interfaceFunction.propertyGroup = function(val){
+           if(val === 1){
+               return interfaceFunction;
+           } else{
+               return propertyGroup(val-1);
+           }
+       };
+       interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
+       interfaceFunction.numProperties = interfaces.length;
+       interfaceFunction.propertyIndex = shape.cix;
+       interfaceFunction._name = shape.nm;
 
-    var contentsInterfaceFactory = (function(){
-       return function(shape,view, propertyGroup){
-           var interfaces;
-           var interfaceFunction = function _interfaceFunction(value){
-               var i = 0, len = interfaces.length;
-                while(i<len){
-                    if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
-                       return interfaces[i];
-                    }
-                    i+=1;
-                }
-                if(typeof value === 'number'){
-                   return interfaces[value-1];
-                }
-           };
-           interfaceFunction.propertyGroup = function(val){
-               if(val === 1){
-                   return interfaceFunction;
-               } else{
-                   return propertyGroup(val-1);
-               }
-           };
-           interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
-           interfaceFunction.numProperties = interfaces.length;
-           interfaceFunction.propertyIndex = shape.cix;
+       return interfaceFunction;
+   }
 
-           return interfaceFunction;
-       }
-    }());
-
-    var groupInterfaceFactory = (function(){
-        return function(shape,view, propertyGroup){
-            var interfaceFunction = function _interfaceFunction(value){
-                switch(value){
-                    case 'ADBE Vectors Group':
-                    case 'Contents':
-                    case 2:
-                        return interfaceFunction.content;
-                    case 'ADBE Vector Transform Group':
-                    case 3:
-                    default:
-                        return interfaceFunction.transform;
-                }
-                /*if(value === 'ADBE Vector Transform Group'){
+    function groupInterfaceFactory(shape,view, propertyGroup){
+        var interfaceFunction = function _interfaceFunction(value){
+            switch(value){
+                case 'ADBE Vectors Group':
+                case 'Contents':
+                case 2:
+                    return interfaceFunction.content;
+                //Not necessary for now. Keeping them here in case a new case appears
+                //case 'ADBE Vector Transform Group':
+                //case 3:
+                default:
                     return interfaceFunction.transform;
-                    var i = 0, len = interfaces.length;
-                    while(i<len){
-                        if(interfaces[i].ty === 'tr'){
-                            return interfaces[i];
-                        }
-                        i+=1;
-                    }
-                    return null;
-                }
-                if(typeof value === 'number'){
-                    return interfaces[value-1];
-                } else {
-                    var i = 0, len = interfaces.length;
-                    while(i<len){
-                        if(interfaces[i]._name === value){
-                            return interfaces[i];
-                        }
-                        i+=1;
-                    }
-                }*/
             }
-            interfaceFunction.propertyGroup = function(val){
-                if(val === 1){
-                    return interfaceFunction;
-                } else{
-                    return propertyGroup(val-1);
-                }
-            };
-            var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
-            var transformInterface = ShapeExpressionInterface.createTransformInterface(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-            interfaceFunction.content = content;
-            interfaceFunction.transform = transformInterface;
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            //interfaceFunction.content = interfaceFunction;
-            interfaceFunction.numProperties = shape.np;
-            interfaceFunction.propertyIndex = shape.ix;
-            interfaceFunction.nm = shape.nm;
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+        };
+        interfaceFunction.propertyGroup = function(val){
+            if(val === 1){
+                return interfaceFunction;
+            } else{
+                return propertyGroup(val-1);
+            }
+        };
+        var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
+        var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
+        interfaceFunction.content = content;
+        interfaceFunction.transform = transformInterface;
+        Object.defineProperty(interfaceFunction, '_name', {
+            get: function(){
+                return shape.nm;
+            }
+        });
+        //interfaceFunction.content = interfaceFunction;
+        interfaceFunction.numProperties = shape.np;
+        interfaceFunction.propertyIndex = shape.ix;
+        interfaceFunction.nm = shape.nm;
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
+
+    function fillInterfaceFactory(shape,view,propertyGroup){
+        function interfaceFunction(val){
+            if(val === 'Color' || val === 'color'){
+                return interfaceFunction.color;
+            } else if(val === 'Opacity' || val === 'opacity'){
+                return interfaceFunction.opacity;
+            }
         }
-    }());
-
-    var fillInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-
-            function interfaceFunction(val){
-                if(val === 'Color' || val === 'color'){
-                    return interfaceFunction.color;
-                } else if(val === 'Opacity' || val === 'opacity'){
-                    return interfaceFunction.opacity;
-                }
-            }
-            Object.defineProperty(interfaceFunction, 'color', {
-                get: function(){
+        Object.defineProperties(interfaceFunction, {
+            'color': {
+                get: function() {
                     return ExpressionValue(view.c, 1 / view.c.mult, 'color');
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'opacity', {
-                get: function(){
+            },
+            'opacity': {
+                get: function() {
                     return ExpressionValue(view.o, 100);
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', { value: shape.nm });
-            Object.defineProperty(interfaceFunction, 'mn', { value: shape.mn });
+            },
+            '_name': { value: shape.nm },
+            'mn': { value: shape.mn }
+        });
 
-            view.c.setGroupProperty(propertyGroup);
-            view.o.setGroupProperty(propertyGroup);
-            return interfaceFunction;
+        view.c.setGroupProperty(propertyGroup);
+        view.o.setGroupProperty(propertyGroup);
+        return interfaceFunction;
+    }
+
+    function strokeInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val === 1){
+                return ob;
+            } else{
+                return propertyGroup(val-1);
+            }
         }
-    }());
-
-    var strokeInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val === 1){
-                    return ob;
-                } else{
-                    return propertyGroup(val-1);
-                }
-            };
-            function _dashPropertyGroup(val){
-                if(val === 1){
-                    return dashOb;
-                } else{
-                    return _propertyGroup(val-1);
-                }
-            };
-            function addPropertyToDashOb(i) {
-                Object.defineProperty(dashOb, shape.d[i].nm, {
-                    get: function(){
-                        return ExpressionValue(view.d.dataProps[i].p)
-                    }
-                });
+        function _dashPropertyGroup(val){
+            if(val === 1){
+                return dashOb;
+            } else{
+                return _propertyGroup(val-1);
             }
-            var i, len = shape.d ? shape.d.length : 0;
-            var dashOb = {}
-            for (i = 0; i < len; i += 1) {
-                addPropertyToDashOb(i);
-                view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
-            }
-
-            function interfaceFunction(val){
-                if(val === 'Color' || val === 'color'){
-                    return interfaceFunction.color;
-                } else if(val === 'Opacity' || val === 'opacity'){
-                    return interfaceFunction.opacity;
-                } else if(val === 'Stroke Width' || val === 'stroke width'){
-                    return interfaceFunction.strokeWidth;
-                }
-            }
-            Object.defineProperty(interfaceFunction, 'color', {
+        }
+        function addPropertyToDashOb(i) {
+            Object.defineProperty(dashOb, shape.d[i].nm, {
                 get: function(){
+                    return ExpressionValue(view.d.dataProps[i].p);
+                }
+            });
+        }
+        var i, len = shape.d ? shape.d.length : 0;
+        var dashOb = {};
+        for (i = 0; i < len; i += 1) {
+            addPropertyToDashOb(i);
+            view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
+        }
+
+        function interfaceFunction(val){
+            if(val === 'Color' || val === 'color'){
+                return interfaceFunction.color;
+            } else if(val === 'Opacity' || val === 'opacity'){
+                return interfaceFunction.opacity;
+            } else if(val === 'Stroke Width' || val === 'stroke width'){
+                return interfaceFunction.strokeWidth;
+            }
+        }
+        Object.defineProperties(interfaceFunction, {
+            'color': {
+                get: function() {
                     return ExpressionValue(view.c, 1 / view.c.mult, 'color');
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'opacity', {
-                get: function(){
+            },
+            'opacity': {
+                get: function() {
                     return ExpressionValue(view.o, 100);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'strokeWidth', {
-                get: function(){
+            },
+            'strokeWidth': {
+                get: function() {
                     return ExpressionValue(view.w);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'dash', {
-                get: function(){
+            },
+            'dash': {
+                get: function() {
                     return dashOb;
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', { value: shape.nm });
-            Object.defineProperty(interfaceFunction, 'mn', { value: shape.mn });
+            },
+            '_name': { value: shape.nm },
+            'mn': { value: shape.mn }
+        });
 
-            view.c.setGroupProperty(_propertyGroup);
-            view.o.setGroupProperty(_propertyGroup);
-            view.w.setGroupProperty(_propertyGroup);
-            return interfaceFunction;
+        view.c.setGroupProperty(_propertyGroup);
+        view.o.setGroupProperty(_propertyGroup);
+        view.w.setGroupProperty(_propertyGroup);
+        return interfaceFunction;
+    }
+
+    function trimInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        interfaceFunction.propertyIndex = shape.ix;
 
-    var trimInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        view.s.setGroupProperty(_propertyGroup);
+        view.e.setGroupProperty(_propertyGroup);
+        view.o.setGroupProperty(_propertyGroup);
+
+        function interfaceFunction(val){
+            if(val === shape.e.ix || val === 'End' || val === 'end'){
+                return interfaceFunction.end;
             }
-            interfaceFunction.propertyIndex = shape.ix;
-
-            view.s.setGroupProperty(_propertyGroup);
-            view.e.setGroupProperty(_propertyGroup);
-            view.o.setGroupProperty(_propertyGroup);
-
-            function interfaceFunction(val){
-                if(val === shape.e.ix || val === 'End' || val === 'end'){
-                    return interfaceFunction.end;
-                }
-                if(val === shape.s.ix){
-                    return interfaceFunction.start;
-                }
-                if(val === shape.o.ix){
-                    return interfaceFunction.offset;
-                }
+            if(val === shape.s.ix){
+                return interfaceFunction.start;
             }
-            interfaceFunction.propertyIndex = shape.ix;
-            Object.defineProperty(interfaceFunction, 'start', {
-                get: function(){
+            if(val === shape.o.ix){
+                return interfaceFunction.offset;
+            }
+        }
+        interfaceFunction.propertyIndex = shape.ix;
+
+        Object.defineProperties(interfaceFunction, {
+            'start': {
+                get: function() {
                     return ExpressionValue(view.s, 1 / view.s.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'end', {
-                get: function(){
+            },
+            'end': {
+                get: function() {
                     return ExpressionValue(view.e, 1 / view.e.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'offset', {
-                get: function(){
+            },
+            'offset': {
+                get: function() {
                     return ExpressionValue(view.o);
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
+
+    function transformInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        view.transform.mProps.o.setGroupProperty(_propertyGroup);
+        view.transform.mProps.p.setGroupProperty(_propertyGroup);
+        view.transform.mProps.a.setGroupProperty(_propertyGroup);
+        view.transform.mProps.s.setGroupProperty(_propertyGroup);
+        view.transform.mProps.r.setGroupProperty(_propertyGroup);
+        if(view.transform.mProps.sk){
+            view.transform.mProps.sk.setGroupProperty(_propertyGroup);
+            view.transform.mProps.sa.setGroupProperty(_propertyGroup);
+        }
+        view.transform.op.setGroupProperty(_propertyGroup);
 
-    var transformInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        function interfaceFunction(value){
+            if(shape.a.ix === value || value === 'Anchor Point'){
+                return interfaceFunction.anchorPoint;
             }
-            view.transform.mProps.o.setGroupProperty(_propertyGroup);
-            view.transform.mProps.p.setGroupProperty(_propertyGroup);
-            view.transform.mProps.a.setGroupProperty(_propertyGroup);
-            view.transform.mProps.s.setGroupProperty(_propertyGroup);
-            view.transform.mProps.r.setGroupProperty(_propertyGroup);
-            if(view.transform.mProps.sk){
-                view.transform.mProps.sk.setGroupProperty(_propertyGroup);
-                view.transform.mProps.sa.setGroupProperty(_propertyGroup);
+            if(shape.o.ix === value || value === 'Opacity'){
+                return interfaceFunction.opacity;
             }
-            view.transform.op.setGroupProperty(_propertyGroup);
+            if(shape.p.ix === value || value === 'Position'){
+                return interfaceFunction.position;
+            }
+            if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
+                return interfaceFunction.rotation;
+            }
+            if(shape.s.ix === value || value === 'Scale'){
+                return interfaceFunction.scale;
+            }
+            if(shape.sk && shape.sk.ix === value || value === 'Skew'){
+                return interfaceFunction.skew;
+            }
+            if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
+                return interfaceFunction.skewAxis;
+            }
 
-            function interfaceFunction(value){
-                if(shape.a.ix === value){
-                    return interfaceFunction.anchorPoint;
-                }
-                if(shape.o.ix === value){
-                    return interfaceFunction.opacity;
-                }
-                if(shape.p.ix === value){
-                    return interfaceFunction.position;
-                }
-                if(shape.r.ix === value){
-                    return interfaceFunction.rotation;
-                }
-                if(shape.s.ix === value){
-                    return interfaceFunction.scale;
-                }
-                if(shape.sk && shape.sk.ix === value){
-                    return interfaceFunction.skew;
-                }
-                if(shape.sa && shape.sa.ix === value){
-                    return interfaceFunction.skewAxis;
-                }
-                if(value === 'Opacity') {
-                    return interfaceFunction.opacity;
-                }
-                if(value === 'Position') {
-                    return interfaceFunction.position;
-                }
-                if(value === 'Anchor Point') {
-                    return interfaceFunction.anchorPoint;
-                }
-                if(value === 'Scale') {
-                    return interfaceFunction.scale;
-                }
-                if(value === 'Rotation' || value === 'ADBE Vector Rotation') {
-                    return interfaceFunction.rotation;
-                }
-                if(value === 'Skew') {
-                    return interfaceFunction.skew;
-                }
-                if(value === 'Skew Axis') {
-                    return interfaceFunction.skewAxis;
-                }
-
-            }
-            Object.defineProperty(interfaceFunction, 'opacity', {
+        }
+        Object.defineProperties(interfaceFunction, {
+            'opacity': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.o, 1/view.transform.mProps.o.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'position', {
+            },
+            'position': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.p);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'anchorPoint', {
+            },
+            'anchorPoint': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.a);
                 }
-            });
-            var scaleArray = [];
-            Object.defineProperty(interfaceFunction, 'scale', {
+            },
+            'scale': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.s, 1 / view.transform.mProps.s.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'rotation', {
+            },
+            'rotation': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.r, 1 / view.transform.mProps.r.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'skew', {
+            },
+            'skew': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.sk);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'skewAxis', {
+            },
+            'skewAxis': {
                 get: function(){
                     return ExpressionValue(view.transform.mProps.sa);
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.ty = 'tr';
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
-        }
-    }());
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.ty = 'tr';
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
 
-    var ellipseInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+    function ellipseInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
             }
-            interfaceFunction.propertyIndex = shape.ix;
-            var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-            prop.s.setGroupProperty(_propertyGroup);
-            prop.p.setGroupProperty(_propertyGroup);
-            function interfaceFunction(value){
-                if(shape.p.ix === value){
-                    return interfaceFunction.position;
-                }
-                if(shape.s.ix === value){
-                    return interfaceFunction.size;
-                }
+        }
+        interfaceFunction.propertyIndex = shape.ix;
+        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+        prop.s.setGroupProperty(_propertyGroup);
+        prop.p.setGroupProperty(_propertyGroup);
+        function interfaceFunction(value){
+            if(shape.p.ix === value){
+                return interfaceFunction.position;
             }
-            Object.defineProperty(interfaceFunction, 'size', {
+            if(shape.s.ix === value){
+                return interfaceFunction.size;
+            }
+        }
+        Object.defineProperties(interfaceFunction, {
+            'size': {
                 get: function(){
                     return ExpressionValue(prop.s);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'position', {
+            },
+            'position': {
                 get: function(){
                     return ExpressionValue(prop.p);
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
+
+    function starInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+        interfaceFunction.propertyIndex = shape.ix;
+        prop.or.setGroupProperty(_propertyGroup);
+        prop.os.setGroupProperty(_propertyGroup);
+        prop.pt.setGroupProperty(_propertyGroup);
+        prop.p.setGroupProperty(_propertyGroup);
+        prop.r.setGroupProperty(_propertyGroup);
+        if(shape.ir){
+            prop.ir.setGroupProperty(_propertyGroup);
+            prop.is.setGroupProperty(_propertyGroup);
+        }
 
-    var starInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        function interfaceFunction(value){
+            if(shape.p.ix === value){
+                return interfaceFunction.position;
             }
-            var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-            interfaceFunction.propertyIndex = shape.ix;
-            prop.or.setGroupProperty(_propertyGroup);
-            prop.os.setGroupProperty(_propertyGroup);
-            prop.pt.setGroupProperty(_propertyGroup);
-            prop.p.setGroupProperty(_propertyGroup);
-            prop.r.setGroupProperty(_propertyGroup);
-            if(shape.ir){
-                prop.ir.setGroupProperty(_propertyGroup);
-                prop.is.setGroupProperty(_propertyGroup);
+            if(shape.r.ix === value){
+                return interfaceFunction.rotation;
+            }
+            if(shape.pt.ix === value){
+                return interfaceFunction.points;
+            }
+            if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
+                return interfaceFunction.outerRadius;
+            }
+            if(shape.os.ix === value){
+                return interfaceFunction.outerRoundness;
+            }
+            if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
+                return interfaceFunction.innerRadius;
+            }
+            if(shape.is && shape.is.ix === value){
+                return interfaceFunction.innerRoundness;
             }
 
-            function interfaceFunction(value){
-                if(shape.p.ix === value){
-                    return interfaceFunction.position;
-                }
-                if(shape.r.ix === value){
-                    return interfaceFunction.rotation;
-                }
-                if(shape.pt.ix === value){
-                    return interfaceFunction.points;
-                }
-                if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                    return interfaceFunction.outerRadius;
-                }
-                if(shape.os.ix === value){
-                    return interfaceFunction.outerRoundness;
-                }
-                if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                    return interfaceFunction.innerRadius;
-                }
-                if(shape.is && shape.is.ix === value){
-                    return interfaceFunction.innerRoundness;
-                }
-
-            }
-            Object.defineProperty(interfaceFunction, 'position', {
-                get: function(){
+        }
+        Object.defineProperties(interfaceFunction, {
+            'position': {
+                get: function() {
                     return ExpressionValue(prop.p);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'rotation', {
-                get: function(){
+            },
+            'rotation': {
+                get: function() {
                     return ExpressionValue(prop.r, 1 / prop.r.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'points', {
-                get: function(){
+            },
+            'points': {
+                get: function() {
                     return ExpressionValue(prop.pt);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'outerRadius', {
-                get: function(){
+            },
+            'outerRadius': {
+                get: function() {
                     return ExpressionValue(prop.or);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'outerRoundness', {
+            },
+            'outerRoundness': {
                 get: function(){
                     return ExpressionValue(prop.os);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'innerRadius', {
+            },
+            'innerRadius': {
                 get: function(){
                     if(!prop.ir){
                         return 0;
                     }
                     return ExpressionValue(prop.ir);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'innerRoundness', {
+            },
+            'innerRoundness': {
                 get: function(){
                     if(!prop.is){
                         return 0;
                     }
                     return ExpressionValue(prop.is, 1 / prop.is.mult);
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
+
+    function rectInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+        interfaceFunction.propertyIndex = shape.ix;
+        prop.p.setGroupProperty(_propertyGroup);
+        prop.s.setGroupProperty(_propertyGroup);
+        prop.r.setGroupProperty(_propertyGroup);
 
-    var rectInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        function interfaceFunction(value){
+            if(shape.p.ix === value){
+                return interfaceFunction.position;
             }
-            var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-            interfaceFunction.propertyIndex = shape.ix;
-            prop.p.setGroupProperty(_propertyGroup);
-            prop.s.setGroupProperty(_propertyGroup);
-            prop.r.setGroupProperty(_propertyGroup);
-
-            function interfaceFunction(value){
-                if(shape.p.ix === value){
-                    return interfaceFunction.position;
-                }
-                if(shape.r.ix === value){
-                    return interfaceFunction.rotation;
-                }
-                if(shape.pt.ix === value){
-                    return interfaceFunction.points;
-                }
-                if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                    return interfaceFunction.outerRadius;
-                }
-                if(shape.os.ix === value){
-                    return interfaceFunction.outerRoundness;
-                }
-                if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                    return interfaceFunction.innerRadius;
-                }
-                if(shape.is && shape.is.ix === value){
-                    return interfaceFunction.innerRoundness;
-                }
-
+            if(shape.r.ix === value){
+                return interfaceFunction.roundness;
             }
-            Object.defineProperty(interfaceFunction, 'position', {
+            if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
+                return interfaceFunction.size;
+            }
+
+        }
+        Object.defineProperties(interfaceFunction, {
+            'position': {
                 get: function(){
                     return ExpressionValue(prop.p);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'roundness', {
+            },
+            'roundness': {
                 get: function(){
                     return ExpressionValue(prop.r);
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'size', {
+            },
+            'size': {
                 get: function(){
                     return ExpressionValue(prop.s);
                 }
-            });
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
 
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+    function roundedInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        var prop = view;
+        interfaceFunction.propertyIndex = shape.ix;
+        prop.rd.setGroupProperty(_propertyGroup);
 
-    var roundedInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        function interfaceFunction(value){
+            if(shape.r.ix === value || 'Round Corners 1' === value){
+                return interfaceFunction.radius;
             }
-            var prop = view;
-            interfaceFunction.propertyIndex = shape.ix;
-            prop.rd.setGroupProperty(_propertyGroup);
 
-            function interfaceFunction(value){
-                if(shape.r.ix === value || 'Round Corners 1' === value){
-                    return interfaceFunction.radius;
-                }
-
-            }
-            Object.defineProperty(interfaceFunction, 'radius', {
-                get: function(){
+        }
+        Object.defineProperties(interfaceFunction, {
+            'radius': {
+                get: function() {
                     return ExpressionValue(prop.rd);
                 }
-            });
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
 
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+    function repeaterInterfaceFactory(shape,view,propertyGroup){
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        var prop = view;
+        interfaceFunction.propertyIndex = shape.ix;
+        prop.c.setGroupProperty(_propertyGroup);
+        prop.o.setGroupProperty(_propertyGroup);
 
-    var repeaterInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        function interfaceFunction(value){
+            if(shape.c.ix === value || 'Copies' === value){
+                return interfaceFunction.copies;
+            } else if(shape.o.ix === value || 'Offset' === value){
+                return interfaceFunction.offset;
             }
-            var prop = view;
-            interfaceFunction.propertyIndex = shape.ix;
-            prop.c.setGroupProperty(_propertyGroup);
-            prop.o.setGroupProperty(_propertyGroup);
 
-            function interfaceFunction(value){
-                if(shape.c.ix === value || 'Copies' === value){
-                    return interfaceFunction.copies;
-                } else if(shape.o.ix === value || 'Offset' === value){
-                    return interfaceFunction.offset;
-                }
-
-            }
-            Object.defineProperty(interfaceFunction, 'copies', {
+        }
+        Object.defineProperties(interfaceFunction, {
+            'copies': {
                 get: function(){
                     return ExpressionValue(prop.c);
                 }
-            });
-
-            Object.defineProperty(interfaceFunction, 'offset', {
+            },
+            'offset': {
                 get: function(){
                     return ExpressionValue(prop.o);
                 }
-            });
+            },
+            '_name': { value: shape.nm }
+        });
+        interfaceFunction.mn = shape.mn;
+        return interfaceFunction;
+    }
 
-            Object.defineProperty(interfaceFunction, '_name', {
-                get: function(){
-                    return shape.nm;
-                }
-            });
-            interfaceFunction.mn = shape.mn;
-            return interfaceFunction;
+    function pathInterfaceFactory(shape,view,propertyGroup){
+        var prop = view.sh;
+        function _propertyGroup(val){
+            if(val == 1){
+                return interfaceFunction;
+            } else {
+                return propertyGroup(--val);
+            }
         }
-    }());
+        prop.setGroupProperty(_propertyGroup);
 
-    var pathInterfaceFactory = (function(){
-        return function(shape,view,propertyGroup){
-            var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-            function _propertyGroup(val){
-                if(val == 1){
-                    return interfaceFunction;
-                } else {
-                    return propertyGroup(--val);
-                }
+        function interfaceFunction(val){
+            if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
+                return interfaceFunction.path;
             }
-            prop.setGroupProperty(_propertyGroup);
-
-            function interfaceFunction(val){
-                if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path'){
-                    return interfaceFunction.path;
-                }
-            }
-            Object.defineProperty(interfaceFunction, 'path', {
+        }
+        Object.defineProperties(interfaceFunction, {
+            'path': {
                 get: function(){
                     if(prop.k){
                         prop.getValue();
                     }
-                    return prop.v;
-                    //return shape_pool.clone(prop.v);
+                    return prop;
                 }
-            });
-            Object.defineProperty(interfaceFunction, 'shape', {
+            },
+            'shape': {
                 get: function(){
                     if(prop.k){
                         prop.getValue();
                     }
-                    return prop.v;
-                    //return shape_pool.clone(prop.v);
+                    return prop;
                 }
-            });
-            Object.defineProperty(interfaceFunction, '_name', { value: shape.nm });
-            Object.defineProperty(interfaceFunction, 'ix', { value: shape.ix });
-            Object.defineProperty(interfaceFunction, 'mn', { value: shape.mn });
-            return interfaceFunction;
+            },
+            '_name': { value: shape.nm },
+            'ix': { value: shape.ix },
+            'mn': { value: shape.mn }
+        });
+        return interfaceFunction;
+    }
+
+    return function(shapes,view,propertyGroup) {
+        var interfaces;
+        function _interfaceFunction(value){
+            if(typeof value === 'number'){
+                return interfaces[value-1];
+            } else {
+                var i = 0, len = interfaces.length;
+                while(i<len){
+                    if(interfaces[i]._name === value){
+                        return interfaces[i];
+                    }
+                    i+=1;
+                }
+            }
         }
-    }());
-
-
-    return ob;
-}())
+        _interfaceFunction.propertyGroup = propertyGroup;
+        interfaces = iterateElements(shapes, view, _interfaceFunction);
+        return _interfaceFunction;
+    };
+}());
diff --git a/player/js/utils/expressions/TextInterface.js b/player/js/utils/expressions/TextInterface.js
index f5fb996..5f04bab 100644
--- a/player/js/utils/expressions/TextInterface.js
+++ b/player/js/utils/expressions/TextInterface.js
@@ -1,15 +1,20 @@
 var TextExpressionInterface = (function(){
 	return function(elem){
+        var _prevValue, _sourceText;
         function _thisLayerFunction(){
         }
         Object.defineProperty(_thisLayerFunction, "sourceText", {
             get: function(){
-            	if(!elem.currentTextDocumentData.t) {
-            		return ''
-            	}
-                return elem.currentTextDocumentData.t;
+                var stringValue = elem.textProperty.currentData.t;
+                if(stringValue !== _prevValue) {
+                    elem.textProperty.currentData.t = _prevValue;
+                    _sourceText = new String(stringValue);
+                    //If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
+                    _sourceText.value = stringValue ? stringValue : new String(stringValue);
+                }
+                return _sourceText;
             }
         });
         return _thisLayerFunction;
-    }
-}())
\ No newline at end of file
+    };
+}());
\ No newline at end of file
diff --git a/player/js/utils/expressions/TransformInterface.js b/player/js/utils/expressions/TransformInterface.js
index 71c6e88..6643199 100644
--- a/player/js/utils/expressions/TransformInterface.js
+++ b/player/js/utils/expressions/TransformInterface.js
@@ -5,80 +5,127 @@
                 case "scale":
                 case "Scale":
                 case "ADBE Scale":
+                case 6:
                     return _thisFunction.scale;
                 case "rotation":
                 case "Rotation":
                 case "ADBE Rotation":
                 case "ADBE Rotate Z":
+                case 10:
                     return _thisFunction.rotation;
+                case "ADBE Rotate X":
+                    return _thisFunction.xRotation;
+                case "ADBE Rotate Y":
+                    return _thisFunction.yRotation;
                 case "position":
                 case "Position":
                 case "ADBE Position":
-                    return transform.position;
+                case 2:
+                    return _thisFunction.position;
+                case 'ADBE Position_0':
+                    return _thisFunction.xPosition;
+                case 'ADBE Position_1':
+                    return _thisFunction.yPosition;
+                case 'ADBE Position_2':
+                    return _thisFunction.zPosition;
                 case "anchorPoint":
                 case "AnchorPoint":
                 case "Anchor Point":
                 case "ADBE AnchorPoint":
+                case 1:
                     return _thisFunction.anchorPoint;
                 case "opacity":
                 case "Opacity":
+                case 11:
                     return _thisFunction.opacity;
             }
         }
 
         Object.defineProperty(_thisFunction, "rotation", {
             get: function(){
-                return transform.rotation;
+                if(transform.r) {
+                    return ExpressionValue(transform.r, 1/degToRads);
+                } else {
+                    return ExpressionValue(transform.rz, 1/degToRads);
+                }
+            }
+        });
+
+        Object.defineProperty(_thisFunction, "xRotation", {
+            get: function(){
+                    return ExpressionValue(transform.rx, 1/degToRads);
+            }
+        });
+
+        Object.defineProperty(_thisFunction, "yRotation", {
+            get: function(){
+                    return ExpressionValue(transform.ry, 1/degToRads);
             }
         });
         Object.defineProperty(_thisFunction, "scale", {
             get: function () {
-                return transform.scale;
+                return ExpressionValue(transform.s, 100);
             }
         });
 
         Object.defineProperty(_thisFunction, "position", {
             get: function () {
-                return transform.position;
+                if(transform.p) {
+                    return ExpressionValue(transform.p);
+                } else {
+                    return [transform.px.v, transform.py.v, transform.pz ? transform.pz.v : 0];
+                }
             }
         });
 
         Object.defineProperty(_thisFunction, "xPosition", {
             get: function () {
-                return transform.xPosition;
+                return ExpressionValue(transform.px);
             }
         });
 
         Object.defineProperty(_thisFunction, "yPosition", {
             get: function () {
-                return transform.yPosition;
+                return ExpressionValue(transform.py);
+            }
+        });
+
+        Object.defineProperty(_thisFunction, "zPosition", {
+            get: function () {
+                return ExpressionValue(transform.pz);
             }
         });
 
         Object.defineProperty(_thisFunction, "anchorPoint", {
             get: function () {
-                return transform.anchorPoint;
+                return ExpressionValue(transform.a);
             }
         });
 
         Object.defineProperty(_thisFunction, "opacity", {
             get: function () {
-                return transform.opacity;
+                return ExpressionValue(transform.o, 100);
             }
         });
 
         Object.defineProperty(_thisFunction, "skew", {
             get: function () {
-                return transform.skew;
+                return ExpressionValue(transform.sk);
             }
         });
 
         Object.defineProperty(_thisFunction, "skewAxis", {
             get: function () {
-                return transform.skewAxis;
+                return ExpressionValue(transform.sa);
+            }
+        });
+
+        Object.defineProperty(_thisFunction, "orientation", {
+            get: function () {
+                return ExpressionValue(transform.or);
             }
         });
 
         return _thisFunction;
-    }
+    };
 }());
\ No newline at end of file
diff --git a/player/js/utils/featureSupport.js b/player/js/utils/featureSupport.js
index 8a32ebe..e2bbcf9 100644
--- a/player/js/utils/featureSupport.js
+++ b/player/js/utils/featureSupport.js
@@ -1,7 +1,7 @@
 var featureSupport = (function(){
 	var ob = {
 		maskType: true
-	}
+	};
 	if (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) {
 	   ob.maskType = false;
 	}
diff --git a/player/js/utils/filters.js b/player/js/utils/filters.js
index 26df309..12c8097 100644
--- a/player/js/utils/filters.js
+++ b/player/js/utils/filters.js
@@ -4,7 +4,7 @@
 	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
 
 	function createFilter(filId){
-        	var fil = document.createElementNS(svgNS,'filter');
+        	var fil = createNS('filter');
         	fil.setAttribute('id',filId);
                 fil.setAttribute('filterUnits','objectBoundingBox');
                 fil.setAttribute('x','0%');
@@ -15,12 +15,12 @@
 	}
 
 	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
+                var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type','matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 0 1');
+                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
                 return feColorMatrix;
 	}
 
 	return ob;
-}())
\ No newline at end of file
+}());
\ No newline at end of file
diff --git a/player/js/utils/functionExtensions.js b/player/js/utils/functionExtensions.js
index c312b24..df82c41 100644
--- a/player/js/utils/functionExtensions.js
+++ b/player/js/utils/functionExtensions.js
@@ -1,20 +1,19 @@
-function createElement(parent,child,params){
-    if(child){
-        child.prototype = Object.create(parent.prototype);
-        child.prototype.constructor = child;
-        child.prototype._parent = parent.prototype;
-    }else{
-        var instance = Object.create(parent.prototype,params);
-        var getType = {};
-        if(instance && getType.toString.call(instance.init) === '[object Function]'){
-            instance.init();
+function extendPrototype(sources,destination){
+    var i, len = sources.length, sourcePrototype;
+    for (i = 0;i < len;i += 1) {
+        sourcePrototype = sources[i].prototype;
+        for (var attr in sourcePrototype) {
+            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
         }
-        return instance;
     }
 }
 
-function extendPrototype(source,destination){
-    for (var attr in source.prototype) {
-        if (source.prototype.hasOwnProperty(attr)) destination.prototype[attr] = source.prototype[attr];
-    }
+function getDescriptor(object, prop) {
+    return Object.getOwnPropertyDescriptor(object, prop);
+}
+
+function createProxyFunction(prototype) {
+	function ProxyFunction(){}
+	ProxyFunction.prototype = prototype;
+	return ProxyFunction;
 }
\ No newline at end of file
diff --git a/player/js/utils/helpers/arrays.js b/player/js/utils/helpers/arrays.js
new file mode 100644
index 0000000..2532a93
--- /dev/null
+++ b/player/js/utils/helpers/arrays.js
@@ -0,0 +1,36 @@
+var createTypedArray = (function(){
+	function createRegularArray(type, len){
+		var i = 0, arr = [], value;
+		switch(type) {
+			case 'int16':
+			case 'uint8c':
+				value = 1;
+				break;
+			default:
+				value = 1.1;
+				break;
+		}
+		for(i = 0; i < len; i += 1) {
+			arr.push(value);
+		}
+		return arr;
+	}
+	function createTypedArray(type, len){
+		if(type === 'float32') {
+			return new Float32Array(len);
+		} else if(type === 'int16') {
+			return new Int16Array(len);
+		} else if(type === 'uint8c') {
+			return new Uint8ClampedArray(len);
+		}
+	}
+	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+		return createTypedArray;
+	} else {
+		return createRegularArray;
+	}
+}());
+
+function createSizedArray(len) {
+	return Array.apply(null,{length:len});
+}
\ No newline at end of file
diff --git a/player/js/utils/helpers/dynamicProperties.js b/player/js/utils/helpers/dynamicProperties.js
new file mode 100644
index 0000000..1c41c52
--- /dev/null
+++ b/player/js/utils/helpers/dynamicProperties.js
@@ -0,0 +1,26 @@
+function DynamicPropertyContainer(){};
+DynamicPropertyContainer.prototype = {
+	addDynamicProperty: function(prop) {
+		if(this.dynamicProperties.indexOf(prop) === -1) {
+	        this.dynamicProperties.push(prop);
+	        this.container.addDynamicProperty(this);
+	    	this._isAnimated = true;
+	    }
+	},
+	iterateDynamicProperties: function(){
+	    this._mdf = false;
+	    var i, len = this.dynamicProperties.length;
+	    for(i=0;i<len;i+=1){
+	        this.dynamicProperties[i].getValue();
+	        if(this.dynamicProperties[i]._mdf) {
+	            this._mdf = true;
+	        }
+	    }
+	},
+	initDynamicPropertyContainer: function(container){
+	    this.container = container;
+	    this.dynamicProperties = [];
+	    this._mdf = false;
+	    this._isAnimated = false;
+	}
+}
\ No newline at end of file
diff --git a/player/js/utils/helpers/html_elements.js b/player/js/utils/helpers/html_elements.js
new file mode 100644
index 0000000..f97952e
--- /dev/null
+++ b/player/js/utils/helpers/html_elements.js
@@ -0,0 +1,4 @@
+function createTag(type) {
+	//return {appendChild:function(){},setAttribute:function(){},style:{}}
+	return document.createElement(type);
+}
\ No newline at end of file
diff --git a/player/js/utils/helpers/svg_elements.js b/player/js/utils/helpers/svg_elements.js
new file mode 100644
index 0000000..2cf5066
--- /dev/null
+++ b/player/js/utils/helpers/svg_elements.js
@@ -0,0 +1,4 @@
+function createNS(type) {
+	//return {appendChild:function(){},setAttribute:function(){},style:{}}
+	return document.createElementNS(svgNS, type);
+}
\ No newline at end of file
diff --git a/player/js/utils/imagePreloader.js b/player/js/utils/imagePreloader.js
index 3a752e6..948a73c 100644
--- a/player/js/utils/imagePreloader.js
+++ b/player/js/utils/imagePreloader.js
@@ -3,6 +3,9 @@
     function imageLoaded(){
         this.loadedAssets += 1;
         if(this.loadedAssets === this.totalImages){
+            if(this.imagesLoadedCb) {
+                this.imagesLoadedCb(null);
+            }
         }
     }
 
@@ -23,12 +26,13 @@
     }
 
     function loadImage(path){
-        var img = document.createElement('img');
+        var img = createTag('img');
         img.addEventListener('load', imageLoaded.bind(this), false);
         img.addEventListener('error', imageLoaded.bind(this), false);
         img.src = path;
     }
-    function loadAssets(assets){
+    function loadAssets(assets, cb){
+        this.imagesLoadedCb = cb;
         this.totalAssets = assets.length;
         var i;
         for(i=0;i<this.totalAssets;i+=1){
@@ -47,14 +51,20 @@
         this.assetsPath = path || '';
     }
 
+    function destroy() {
+        this.imagesLoadedCb = null;
+    }
+
     return function ImagePreloader(){
         this.loadAssets = loadAssets;
         this.setAssetsPath = setAssetsPath;
         this.setPath = setPath;
+        this.destroy = destroy;
         this.assetsPath = '';
         this.path = '';
         this.totalAssets = 0;
         this.totalImages = 0;
         this.loadedAssets = 0;
-    }
+        this.imagesLoadedCb = null;
+    };
 }());
\ No newline at end of file
diff --git a/player/js/utils/pooling/bezier_length_pool.js b/player/js/utils/pooling/bezier_length_pool.js
new file mode 100644
index 0000000..f0840d3
--- /dev/null
+++ b/player/js/utils/pooling/bezier_length_pool.js
@@ -0,0 +1,11 @@
+var bezier_length_pool = (function(){
+
+	function create() {
+		return {
+            addedLength: 0,
+            percents: createTypedArray('float32', defaultCurveSegments),
+            lengths: createTypedArray('float32', defaultCurveSegments),
+        };
+	}
+	return pool_factory(8, create);
+}());
\ No newline at end of file
diff --git a/player/js/utils/pooling/point_pool.js b/player/js/utils/pooling/point_pool.js
index 3d442c1..9730531 100644
--- a/player/js/utils/pooling/point_pool.js
+++ b/player/js/utils/pooling/point_pool.js
@@ -1,45 +1,7 @@
 var point_pool = (function(){
-	var ob = {
-		newPoint: newPoint,
-		release: release
-		/*,getLength:function(){return _length}
-		,getCont:function(){return cont}*/
+
+	function create() {
+		return createTypedArray('float32', 2);
 	}
-
-	var _length = 0;
-	var _maxLength = 8;
-	var pool = Array.apply(null,{length:_maxLength});
-
-	//var cont = 0;
-
-	function newPoint(){
-		//window.bm_newPoint = window.bm_newPoint ? window.bm_newPoint + 1 : 1;
-		var point;
-		if(_length){
-			_length -= 1;
-			point = pool[_length];
-			//window.bm_reuse = window.bm_reuse ? window.bm_reuse + 1 : 1;
-		} else {
-			point = [0.1,0.1];
-			//cont++;
-			//console.log('new');
-			//window.bm_new = window.bm_new ? window.bm_new + 1 : 1;
-			//point._tst = cont++;
-		}
-		return point;
-	}
-
-	function release(point) {
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = point;
-		_length += 1;
-		//window.bm_release = window.bm_release ? window.bm_release + 1 : 1;
-		//console.log('release');
-	}
-
-
-	return ob;
+	return pool_factory(8, create);
 }());
\ No newline at end of file
diff --git a/player/js/utils/pooling/pool_factory.js b/player/js/utils/pooling/pool_factory.js
new file mode 100644
index 0000000..7335e58
--- /dev/null
+++ b/player/js/utils/pooling/pool_factory.js
@@ -0,0 +1,43 @@
+var pool_factory = (function() {
+	return function(initialLength, _create, _release, _clone) {
+
+		var _length = 0;
+		var _maxLength = initialLength;
+		var pool = createSizedArray(_maxLength);
+
+		var ob = {
+			newElement: newElement,
+			release: release
+		};
+
+		function newElement(){
+			var element;
+			if(_length){
+				_length -= 1;
+				element = pool[_length];
+			} else {
+				element = _create();
+			}
+			return element;
+		}
+
+		function release(element) {
+			if(_length === _maxLength) {
+				pool = pooling.double(pool);
+				_maxLength = _maxLength*2;
+			}
+			if (_release) {
+				_release(element);
+			}
+			pool[_length] = element;
+			_length += 1;
+		}
+
+		function clone() {
+			var clonedElement = newElement();
+			return _clone(clonedElement);
+		}
+
+		return ob;
+	};
+}());
diff --git a/player/js/utils/pooling/pooling.js b/player/js/utils/pooling/pooling.js
index a8c19ba..a42bb21 100644
--- a/player/js/utils/pooling/pooling.js
+++ b/player/js/utils/pooling/pooling.js
@@ -1,10 +1,10 @@
 var pooling = (function(){
 
 	function double(arr){
-		return arr.concat(Array.apply(null,{length:arr.length}))
+		return arr.concat(createSizedArray(arr.length));
 	}
 
 	return {
 		double: double
-	}
+	};
 }());
\ No newline at end of file
diff --git a/player/js/utils/pooling/segments_length_pool.js b/player/js/utils/pooling/segments_length_pool.js
new file mode 100644
index 0000000..8aa062a
--- /dev/null
+++ b/player/js/utils/pooling/segments_length_pool.js
@@ -0,0 +1,19 @@
+var segments_length_pool = (function(){
+
+	function create() {
+		return {
+			lengths: [],
+			totalLength: 0
+		};
+	}
+
+	function release(element) {
+		var i, len = element.lengths.length;
+		for(i=0;i<len;i+=1) {
+			bezier_length_pool.release(element.lengths[i]);
+		}
+		element.lengths.length = 0;
+	}
+
+	return pool_factory(8, create, release);
+}());
\ No newline at end of file
diff --git a/player/js/utils/pooling/shapeCollection_pool.js b/player/js/utils/pooling/shapeCollection_pool.js
index 16f5efc..00094c0 100644
--- a/player/js/utils/pooling/shapeCollection_pool.js
+++ b/player/js/utils/pooling/shapeCollection_pool.js
@@ -1,15 +1,12 @@
 var shapeCollection_pool = (function(){
 	var ob = {
 		newShapeCollection: newShapeCollection,
-		release: release,
-		clone: clone
-	}
+		release: release
+	};
 
 	var _length = 0;
 	var _maxLength = 4;
-	var pool = Array.apply(null,{length:_maxLength});
-
-	var cont = 0;
+	var pool = createSizedArray(_maxLength);
 
 	function newShapeCollection(){
 		var shapeCollection;
@@ -37,16 +34,5 @@
 		_length += 1;
 	}
 
-	function clone(shapeCollection, originCollection) {
-		release(shapeCollection);
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-
 	return ob;
 }());
\ No newline at end of file
diff --git a/player/js/utils/pooling/shape_pool.js b/player/js/utils/pooling/shape_pool.js
index 3b3dd3c..ea18906 100644
--- a/player/js/utils/pooling/shape_pool.js
+++ b/player/js/utils/pooling/shape_pool.js
@@ -1,31 +1,10 @@
 var shape_pool = (function(){
-	var ob = {
-		clone: clone,
-		newShape: newShape,
-		release: release,
-		releaseArray: releaseArray
-	}
 
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = Array.apply(null,{length:_maxLength});
-
-	function newShape(){
-		var shapePath;
-		if(_length){
-			_length -= 1;
-			shapePath = pool[_length];
-		} else {
-			shapePath = new ShapePath();
-		}
-		return shapePath;
+	function create() {
+		return new ShapePath();
 	}
 
 	function release(shapePath) {
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
 		var len = shapePath._length, i;
 		for(i = 0; i < len; i += 1) {
 			point_pool.release(shapePath.v[i]);
@@ -37,42 +16,23 @@
 		}
 		shapePath._length = 0;
 		shapePath.c = false;
-		pool[_length] = shapePath;
-		_length += 1;
 	}
 
-	function releaseArray(shapePathsCollection, length) {
-		while(length--) {
-			release(shapePathsCollection[length]);
-		}
-	}
-
-	function clone(shape, transform) {
-		var i, len = shape._length;
-		var cloned = newShape();
-		cloned._length = shape._length;
+	function clone(shape) {
+		var cloned = factory.newElement();
+		var i, len = shape._length === undefined ? shape.v.length : shape._length;
+		cloned.setLength(len);
 		cloned.c = shape.c;
-
 		var pt;
 		
 		for(i = 0; i < len; i += 1) {
-			if(transform){
-				pt = transform.applyToPointArray(shape.v[i][0],shape.v[i][1],0,2);
-				cloned.setXYAt(pt[0],pt[1],'v',i);
-				point_pool.release(pt);
-				pt = transform.applyToPointArray(shape.o[i][0],shape.o[i][1],0,2);
-				cloned.setXYAt(pt[0],pt[1],'o',i);
-				point_pool.release(pt);
-				pt = transform.applyToPointArray(shape.i[i][0],shape.i[i][1],0,2);
-				cloned.setXYAt(pt[0],pt[1],'i',i);
-				point_pool.release(pt);
-			}else{
-				cloned.setTripleAt(shape.v[i][0],shape.v[i][1],shape.o[i][0],shape.o[i][1],shape.i[i][0],shape.i[i][1], i);
-			}
+			cloned.setTripleAt(shape.v[i][0],shape.v[i][1],shape.o[i][0],shape.o[i][1],shape.i[i][0],shape.i[i][1], i);
 		}
-		return cloned
+		return cloned;
 	}
 
+	var factory = pool_factory(4, create, release);
+	factory.clone = clone;
 
-	return ob;
+	return factory;
 }());
\ No newline at end of file
diff --git a/player/js/utils/shapes/DashProperty.js b/player/js/utils/shapes/DashProperty.js
new file mode 100644
index 0000000..abe9983
--- /dev/null
+++ b/player/js/utils/shapes/DashProperty.js
@@ -0,0 +1,48 @@
+function DashProperty(elem, data, renderer) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.dataProps = createSizedArray(data.length);
+    this.renderer = renderer;
+    this.k = false;
+    this.dashStr = '';
+    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
+    this.dashoffset = createTypedArray('float32',  1);
+    this.initDynamicPropertyContainer(elem);
+    var i, len = data.length || 0, prop;
+    for(i = 0; i < len; i += 1) {
+        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
+        this.k = prop.k || this.k;
+        this.dataProps[i] = {n:data[i].n,p:prop};
+    }
+    if(!this.k){
+        this.getValue(true);
+    }
+    this._isAnimated = this.k;
+}
+
+DashProperty.prototype.getValue = function(forceRender) {
+    if(this.elem.globalData.frameId === this.frameId && !forceRender){
+        return;
+    }
+    this.frameId = this.elem.globalData.frameId;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || forceRender;
+    if (this._mdf) {
+        var i = 0, len = this.dataProps.length;
+        if(this.renderer === 'svg') {
+            this.dashStr = '';
+        }
+        for(i=0;i<len;i+=1){
+            if(this.dataProps[i].n != 'o'){
+                if(this.renderer === 'svg') {
+                    this.dashStr += ' ' + this.dataProps[i].p.v;
+                }else{
+                    this.dashArray[i] = this.dataProps[i].p.v;
+                }
+            }else{
+                this.dashoffset[0] = this.dataProps[i].p.v;
+            }
+        }
+    }
+};
+extendPrototype([DynamicPropertyContainer], DashProperty);
\ No newline at end of file
diff --git a/player/js/utils/shapes/GradientProperty.js b/player/js/utils/shapes/GradientProperty.js
new file mode 100644
index 0000000..7cff184
--- /dev/null
+++ b/player/js/utils/shapes/GradientProperty.js
@@ -0,0 +1,77 @@
+function GradientProperty(elem,data){
+    this.data = data;
+    this.c = createTypedArray('uint8c', data.p*4);
+    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
+    this.o = createTypedArray('float32', cLength);
+    this._cmdf = false;
+    this._omdf = false;
+    this._collapsable = this.checkCollapsable();
+    this._hasOpacity = cLength;
+    this.initDynamicPropertyContainer(elem);
+    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
+    this.k = this.prop.k;
+    this.getValue(true);
+}
+
+GradientProperty.prototype.comparePoints = function(values, points) {
+    var i = 0, len = this.o.length/2, diff;
+    while(i < len) {
+        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
+        if(diff > 0.01){
+            return false;
+        }
+        i += 1;
+    }
+    return true;
+};
+
+GradientProperty.prototype.checkCollapsable = function() {
+    if (this.o.length/2 !== this.c.length/4) {
+        return false;
+    }
+    if (this.data.k.k[0].s) {
+        var i = 0, len = this.data.k.k.length;
+        while (i < len) {
+            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
+                return false;
+            }
+            i += 1;
+        }
+    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
+        return false;
+    }
+    return true;
+};
+
+GradientProperty.prototype.getValue = function(forceRender){
+    this.prop.getValue();
+    this._mdf = false;
+    this._cmdf = false;
+    this._omdf = false;
+    if(this.prop._mdf || forceRender){
+        var i, len = this.data.p*4;
+        var mult, val;
+        for(i=0;i<len;i+=1){
+            mult = i%4 === 0 ? 100 : 255;
+            val = Math.round(this.prop.v[i]*mult);
+            if(this.c[i] !== val){
+                this.c[i] = val;
+                this._cmdf = !forceRender;
+            }
+        }
+        if(this.o.length){
+            len = this.prop.v.length;
+            for(i=this.data.p*4;i<len;i+=1){
+                mult = i%2 === 0 ? 100 : 1;
+                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
+                if(this.o[i-this.data.p*4] !== val){
+                    this.o[i-this.data.p*4] = val;
+                    this._omdf = !forceRender;
+                }
+            }
+        }
+        this._mdf = !forceRender;
+    }
+};
+
+extendPrototype([DynamicPropertyContainer], GradientProperty);
\ No newline at end of file
diff --git a/player/js/utils/shapes/MouseModifier.js b/player/js/utils/shapes/MouseModifier.js
index 6a775ce..afd2d25 100644
--- a/player/js/utils/shapes/MouseModifier.js
+++ b/player/js/utils/shapes/MouseModifier.js
@@ -1,10 +1,10 @@
-function MouseModifier(){};
-extendPrototype(ShapeModifier,MouseModifier);
+function MouseModifier(){}
+extendPrototype([ShapeModifier],MouseModifier);
 MouseModifier.prototype.processKeys = function(forceRender){
     if(this.elem.globalData.frameId === this.frameId && !forceRender){
         return;
     }
-    this.mdf = true;
+    this._mdf = true;
 
 };
 
@@ -16,7 +16,6 @@
     var i, len = path.v.length;
     var vValues = [],oValues = [],iValues = [];
     var dist;
-    //console.log(mouseCoords);
     var theta, x,y;
     //// OPTION A
     for(i=0;i<len;i+=1){
@@ -190,10 +189,10 @@
         var shapeData, newPaths = [];
         for(i=0;i<len;i+=1){
             shapeData = this.shapes[i];
-            if(!shapeData.shape.mdf && !this.mdf){
+            if(!shapeData.shape._mdf && !this._mdf){
                 shapeData.shape.paths = shapeData.last;
             } else {
-                shapeData.shape.mdf = true;
+                shapeData.shape._mdf = true;
                 shapePaths = shapeData.shape.paths;
                 jLen = shapePaths.length;
                 for(j=0;j<jLen;j+=1){
diff --git a/player/js/utils/shapes/RepeaterModifier.js b/player/js/utils/shapes/RepeaterModifier.js
index 87cb7cc..0b54adc 100644
--- a/player/js/utils/shapes/RepeaterModifier.js
+++ b/player/js/utils/shapes/RepeaterModifier.js
@@ -1,28 +1,16 @@
-function RepeaterModifier(){};
-extendPrototype(ShapeModifier,RepeaterModifier);
-RepeaterModifier.prototype.processKeys = function(forceRender){
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
-    }
-    this.mdf = forceRender ? true : false;
-    this.frameId = this.elem.globalData.frameId;
-    var i, len = this.dynamicProperties.length;
+function RepeaterModifier(){}
+extendPrototype([ShapeModifier], RepeaterModifier);
 
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        if(this.dynamicProperties[i].mdf){
-            this.mdf = true;
-        }
-    }
-};
 RepeaterModifier.prototype.initModifierProperties = function(elem,data){
     this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this.dynamicProperties);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this.dynamicProperties);
-    this.tr = PropertyFactory.getProp(elem,data.tr,2,null,this.dynamicProperties);
+    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
+    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
+    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
+    this.data = data;
     if(!this.dynamicProperties.length){
         this.getValue(true);
     }
+    this._isAnimated = !!this.dynamicProperties.length;
     this.pMatrix = new Matrix();
     this.rMatrix = new Matrix();
     this.sMatrix = new Matrix();
@@ -41,100 +29,171 @@
     sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
     sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
     sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-}
+};
 
-RepeaterModifier.prototype.processShapes = function(firstFrame){
-    if(!this.dynamicProperties.length){
-        this.mdf = false;
+RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
+    this.elem = elem;
+    this.arr = arr;
+    this.pos = pos;
+    this.elemsData = elemsData;
+    this._currentCopies = 0;
+    this._elements = [];
+    this._groups = [];
+    this.frameId = -1;
+    this.initDynamicPropertyContainer(elem);
+    this.initModifierProperties(elem,arr[pos]);
+    var cont = 0;
+    while(pos>0){
+        pos -= 1;
+        //this._elements.unshift(arr.splice(pos,1)[0]);
+        this._elements.unshift(arr[pos]);
+        cont += 1;
     }
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var shapeData, localShapeCollection, currentPath;
-    var copies = Math.ceil(this.c.v);
-    var offset = this.o.v;
-    var offsetModulo = offset%1;
-    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-    var k, pathData, shapeCollection, shapeCollectionList;
-    var tMat = this.tr.v.props;
-    var pProps = this.pMatrix.props;
-    var rProps = this.rMatrix.props;
-    var sProps = this.sMatrix.props;
-    var iteration = 0;
-    var l, lLen, tProps,transformers, maxLvl;
-    for(i=0;i<len;i+=1){
-        shapeData = this.shapes[i];
-        localShapeCollection = shapeData.localShapeCollection;
-        if(!(!shapeData.shape.mdf && !this.mdf && !firstFrame)){
-            localShapeCollection.releaseShapes();
-            shapeData.shape.mdf = true;
-            shapeCollection = shapeData.shape.paths;
-            shapeCollectionList = shapeCollection.shapes;
-            jLen = shapeCollection._length;
-            iteration = 0;
-            this.pMatrix.reset();
-            this.rMatrix.reset();
-            this.sMatrix.reset();
-            this.tMatrix.reset();
-            this.matrix.reset();
+    if(this.dynamicProperties.length){
+        this.k = true;
+    }else{
+        this.getValue(true);
+    }
+};
 
-            if(offset > 0) {
-                while(iteration<roundOffset){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                    iteration += 1;
-                }
-                if(offsetModulo){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                    iteration += offsetModulo;
-                }
-            } else if(roundOffset < 0) {
-                while(iteration>roundOffset){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                    iteration -= 1;
-                }
-                if(offsetModulo){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                    iteration -= offsetModulo;
-                }
+RepeaterModifier.prototype.resetElements = function(elements){
+    var i, len = elements.length;
+    for(i = 0; i < len; i += 1) {
+        elements[i]._processed = false;
+        if(elements[i].ty === 'gr'){
+            this.resetElements(elements[i].it);
+        }
+    }
+};
+
+RepeaterModifier.prototype.cloneElements = function(elements){
+    var i, len = elements.length;
+    var newElements = JSON.parse(JSON.stringify(elements));
+    this.resetElements(newElements);
+    return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
+    var i, len = elements.length;
+    for(i = 0; i < len ; i += 1) {
+        elements[i]._render = renderFlag;
+        if(elements[i].ty === 'gr') {
+            this.changeGroupRender(elements[i].it, renderFlag);
+        }
+    }
+};
+
+RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
+    var items, itemsTransform, i, dir, cont;
+    if(this._mdf || _isFirstFrame){
+        var copies = Math.ceil(this.c.v);
+        if(this._groups.length < copies){
+            while(this._groups.length < copies){
+                var group = {
+                    it:this.cloneElements(this._elements),
+                    ty:'gr'
+                };
+                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
+                
+                this.arr.splice(0,0,group);
+                this._groups.splice(0,0,group);
+                this._currentCopies += 1;
             }
-            for(j=0;j<jLen;j+=1){
-                currentPath = shapeCollectionList[j];
-                for(k=0;k<copies;k+=1) {
-                    if(k !== 0) {
-                        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                    }
-                    if(shapeData.data.transformers) {
-                        shapeData.data.lvl = 0;
-                        maxLvl = 0;
-                        lLen = shapeData.data.elements.length;
-                        for(l = 0; l < lLen; l += 1) {
-                            maxLvl = Math.max(maxLvl, shapeData.data.elements[l].st.lvl);
-                        } 
-                        transformers = shapeData.data.transformers;
-                        lLen = transformers.length;
-                        for(l = lLen - 1; l >= maxLvl; l -= 1) {
-                            tProps = transformers[l].mProps.v.props;
-                            this.matrix.transform(tProps[0],tProps[1],tProps[2],tProps[3],tProps[4],tProps[5],tProps[6],tProps[7],tProps[8],tProps[9],tProps[10],tProps[11],tProps[12],tProps[13],tProps[14],tProps[15]);
-                        }
-                    }
-                    if(iteration !== 0){
-                        this.matrix.transform(rProps[0],rProps[1],rProps[2],rProps[3],rProps[4],rProps[5],rProps[6],rProps[7],rProps[8],rProps[9],rProps[10],rProps[11],rProps[12],rProps[13],rProps[14],rProps[15]);
-                        this.matrix.transform(sProps[0],sProps[1],sProps[2],sProps[3],sProps[4],sProps[5],sProps[6],sProps[7],sProps[8],sProps[9],sProps[10],sProps[11],sProps[12],sProps[13],sProps[14],sProps[15]);
-                        this.matrix.transform(pProps[0],pProps[1],pProps[2],pProps[3],pProps[4],pProps[5],pProps[6],pProps[7],pProps[8],pProps[9],pProps[10],pProps[11],pProps[12],pProps[13],pProps[14],pProps[15]);
-                    }
-                    localShapeCollection.addShape(this.processPath(currentPath, this.matrix));
-                    this.matrix.reset();
-                    iteration += 1;
-                }
+            this.elem.reloadShapes();
+        }
+        cont = 0;
+        var renderFlag;
+        for(i = 0; i  <= this._groups.length - 1; i += 1){
+            renderFlag = cont < copies;
+            this._groups[i]._render = renderFlag;
+            this.changeGroupRender(this._groups[i].it, renderFlag);
+            cont += 1;
+        }
+        
+        this._currentCopies = copies;
+        ////
+
+        var offset = this.o.v;
+        var offsetModulo = offset%1;
+        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+        var k;
+        var tMat = this.tr.v.props;
+        var pProps = this.pMatrix.props;
+        var rProps = this.rMatrix.props;
+        var sProps = this.sMatrix.props;
+        this.pMatrix.reset();
+        this.rMatrix.reset();
+        this.sMatrix.reset();
+        this.tMatrix.reset();
+        this.matrix.reset();
+        var iteration = 0;
+
+        if(offset > 0) {
+            while(iteration<roundOffset){
+                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+                iteration += 1;
+            }
+            if(offsetModulo){
+                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+                iteration += offsetModulo;
+            }
+        } else if(offset < 0) {
+            while(iteration>roundOffset){
+                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+                iteration -= 1;
+            }
+            if(offsetModulo){
+                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
+                iteration -= offsetModulo;
             }
         }
-        shapeData.shape.paths = localShapeCollection;
+        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+        dir = this.data.m === 1 ? 1 : -1;
+        cont = this._currentCopies;
+        var j, jLen;
+        while(cont){
+            items = this.elemsData[i].it;
+            itemsTransform = items[items.length - 1].transform.mProps.v.props;
+            jLen = itemsTransform.length;
+            items[items.length - 1].transform.mProps._mdf = true;
+            items[items.length - 1].transform.op._mdf = true;
+            if(iteration !== 0){
+                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
+                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+                }
+                this.matrix.transform(rProps[0],rProps[1],rProps[2],rProps[3],rProps[4],rProps[5],rProps[6],rProps[7],rProps[8],rProps[9],rProps[10],rProps[11],rProps[12],rProps[13],rProps[14],rProps[15]);
+                this.matrix.transform(sProps[0],sProps[1],sProps[2],sProps[3],sProps[4],sProps[5],sProps[6],sProps[7],sProps[8],sProps[9],sProps[10],sProps[11],sProps[12],sProps[13],sProps[14],sProps[15]);
+                this.matrix.transform(pProps[0],pProps[1],pProps[2],pProps[3],pProps[4],pProps[5],pProps[6],pProps[7],pProps[8],pProps[9],pProps[10],pProps[11],pProps[12],pProps[13],pProps[14],pProps[15]);
+                
+                for(j=0;j<jLen;j+=1) {
+                    itemsTransform[j] = this.matrix.props[j];
+                }
+                this.matrix.reset();
+            } else {
+                this.matrix.reset();
+                for(j=0;j<jLen;j+=1) {
+                    itemsTransform[j] = this.matrix.props[j];
+                }
+            }
+            iteration += 1;
+            cont -= 1;
+            i += dir;
+        }
+    } else {
+        cont = this._currentCopies;
+        i = 0;
+        dir = 1;
+        while(cont){
+            items = this.elemsData[i].it;
+            itemsTransform = items[items.length - 1].transform.mProps.v.props;
+            items[items.length - 1].transform.mProps._mdf = false;
+            items[items.length - 1].transform.op._mdf = false;
+            cont -= 1;
+            i += dir;
+        }
     }
 };
 
-RepeaterModifier.prototype.processPath = function(path, transform) {
-    var clonedPath = shape_pool.clone(path, transform);
-    return clonedPath;
-};
-
+RepeaterModifier.prototype.addShape = function(){};
 
 ShapeModifiers.registerModifier('rp',RepeaterModifier);
\ No newline at end of file
diff --git a/player/js/utils/shapes/RoundCornersModifier.js b/player/js/utils/shapes/RoundCornersModifier.js
index 75928a8..2ad3678 100644
--- a/player/js/utils/shapes/RoundCornersModifier.js
+++ b/player/js/utils/shapes/RoundCornersModifier.js
@@ -1,30 +1,13 @@
-function RoundCornersModifier(){};
-extendPrototype(ShapeModifier,RoundCornersModifier);
-RoundCornersModifier.prototype.processKeys = function(forceRender){
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
-    }
-    this.mdf = forceRender ? true : false;
-    this.frameId = this.elem.globalData.frameId;
-    var i, len = this.dynamicProperties.length;
-
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        if(this.dynamicProperties[i].mdf){
-            this.mdf = true;
-        }
-    }
-}
+function RoundCornersModifier(){}
+extendPrototype([ShapeModifier],RoundCornersModifier);
 RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
     this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this.dynamicProperties);
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
+    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
+    this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
 RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newShape();
+    var cloned_path = shape_pool.newElement();
     cloned_path.c = path.c;
     var i, len = path._length;
     var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
@@ -53,12 +36,6 @@
                 oX = vX-(vX-currentV[0])*roundCorner;
                 oY = vY-(vY-currentV[1])*roundCorner;
                 cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                /*newV = [currentV[0]+(closerV[0]-currentV[0])*newPosPerc,currentV[1]-(currentV[1]-closerV[1])*newPosPerc];
-                newI = newV;
-                newO = [newV[0]-(newV[0]-currentV[0])*roundCorner,newV[1]-(newV[1]-currentV[1])*roundCorner];
-                cloned_path.v[index] = newV;
-                cloned_path.i[index] = newI;
-                cloned_path.o[index] = newO;*/
                 index += 1;
 
                 if(i === len - 1){
@@ -73,27 +50,17 @@
                 iX = vX-(vX-currentV[0])*roundCorner;
                 iY = vY-(vY-currentV[1])*roundCorner;
                 cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-
-                /*newV = [currentV[0]+(closerV[0]-currentV[0])*newPosPerc,currentV[1]+(closerV[1]-currentV[1])*newPosPerc];
-                newI = [newV[0]-(newV[0]-currentV[0])*roundCorner,newV[1]-(newV[1]-currentV[1])*roundCorner];
-                newO = newV;
-                cloned_path.v[index] = newV;
-                cloned_path.i[index] = newI;
-                cloned_path.o[index] = newO;*/
                 index += 1;
             }
         } else {
-            /*cloned_path.v[index] = path.v[i];
-            cloned_path.o[index] = path.o[i];
-            cloned_path.i[index] = path.i[i];*/
             cloned_path.setTripleAt(path.v[i][0],path.v[i][1],path.o[i][0],path.o[i][1],path.i[i][0],path.i[i][1],index);
             index += 1;
         }
     }
     return cloned_path;
-}
+};
 
-RoundCornersModifier.prototype.processShapes = function(firstFrame){
+RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
     var shapePaths;
     var i, len = this.shapes.length;
     var j, jLen;
@@ -105,9 +72,9 @@
             shapeData = this.shapes[i];
             newPaths = shapeData.shape.paths;
             localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape.mdf && !this.mdf && !firstFrame)){
+            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
                 localShapeCollection.releaseShapes();
-                shapeData.shape.mdf = true;
+                shapeData.shape._mdf = true;
                 shapePaths = shapeData.shape.paths.shapes;
                 jLen = shapeData.shape.paths._length;
                 for(j=0;j<jLen;j+=1){
@@ -119,9 +86,8 @@
 
     }
     if(!this.dynamicProperties.length){
-        this.mdf = false;
+        this._mdf = false;
     }
-}
-
+};
 
 ShapeModifiers.registerModifier('rd',RoundCornersModifier);
\ No newline at end of file
diff --git a/player/js/utils/shapes/ShapeCollection.js b/player/js/utils/shapes/ShapeCollection.js
index a7d1b22..a7f4f20 100644
--- a/player/js/utils/shapes/ShapeCollection.js
+++ b/player/js/utils/shapes/ShapeCollection.js
@@ -1,12 +1,12 @@
 function ShapeCollection(){
 	this._length = 0;
 	this._maxLength = 4;
-	this.shapes = Array.apply(null,{length:this._maxLength});
-};
+	this.shapes = createSizedArray(this._maxLength);
+}
 
 ShapeCollection.prototype.addShape = function(shapeData){
 	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(Array.apply(null,{length:this._maxLength}));
+		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
 		this._maxLength *= 2;
 	}
 	this.shapes[this._length] = shapeData;
diff --git a/player/js/utils/shapes/ShapeModifiers.js b/player/js/utils/shapes/ShapeModifiers.js
index 9f44740..32f9f98 100644
--- a/player/js/utils/shapes/ShapeModifiers.js
+++ b/player/js/utils/shapes/ShapeModifiers.js
@@ -10,8 +10,8 @@
         }
     }
 
-    function getModifier(nm,elem, data, dynamicProperties){
-        return new modifiers[nm](elem, data, dynamicProperties);
+    function getModifier(nm,elem, data){
+        return new modifiers[nm](elem, data);
     }
 
     return ob;
@@ -22,25 +22,34 @@
 ShapeModifier.prototype.addShapeToModifier = function(){};
 ShapeModifier.prototype.addShape = function(data){
     if(!this.closed){
-        this.shapes.push({shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()});
-        this.addShapeToModifier(data.sh);
+        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
+        this.shapes.push(shapeData);
+        this.addShapeToModifier(shapeData);
+        if(this._isAnimated) {
+            data.setAsAnimated();
+        }
     }
-}
-ShapeModifier.prototype.init = function(elem,data,dynamicProperties){
-    this.elem = elem;
-    this.frameId = -1;
+};
+ShapeModifier.prototype.init = function(elem,data){
     this.shapes = [];
-    this.dynamicProperties = [];
-    this.mdf = false;
+    this.elem = elem;
+    this.initDynamicPropertyContainer(elem);
+    this.initModifierProperties(elem,data);
+    this.frameId = initialDefaultFrame;
     this.closed = false;
     this.k = false;
-    this.isTrimming = false;
-    this.comp = elem.comp;
-    this.initModifierProperties(elem,data);
     if(this.dynamicProperties.length){
         this.k = true;
-        dynamicProperties.push(this);
     }else{
         this.getValue(true);
     }
-}
\ No newline at end of file
+};
+ShapeModifier.prototype.processKeys = function(){
+    if(this.elem.globalData.frameId === this.frameId){
+        return;
+    }
+    this.frameId = this.elem.globalData.frameId;
+    this.iterateDynamicProperties();
+};
+
+extendPrototype([DynamicPropertyContainer], ShapeModifier);
\ No newline at end of file
diff --git a/player/js/utils/shapes/ShapePath.js b/player/js/utils/shapes/ShapePath.js
index 05028e1..ae63e69 100644
--- a/player/js/utils/shapes/ShapePath.js
+++ b/player/js/utils/shapes/ShapePath.js
@@ -2,30 +2,34 @@
 	this.c = false;
 	this._length = 0;
 	this._maxLength = 8;
-	this.v = Array.apply(null,{length:this._maxLength});
-	this.o = Array.apply(null,{length:this._maxLength});
-	this.i = Array.apply(null,{length:this._maxLength});
-};
+	this.v = createSizedArray(this._maxLength);
+	this.o = createSizedArray(this._maxLength);
+	this.i = createSizedArray(this._maxLength);
+}
 
 ShapePath.prototype.setPathData = function(closed, len) {
 	this.c = closed;
-	while(len > this._maxLength){
-		this.doubleArrayLength();
-	}
+	this.setLength(len);
 	var i = 0;
 	while(i < len){
-		this.v[i] = point_pool.newPoint();
-		this.o[i] = point_pool.newPoint();
-		this.i[i] = point_pool.newPoint();
+		this.v[i] = point_pool.newElement();
+		this.o[i] = point_pool.newElement();
+		this.i[i] = point_pool.newElement();
 		i += 1;
 	}
+};
+
+ShapePath.prototype.setLength = function(len) {
+	while(this._maxLength < len) {
+		this.doubleArrayLength();
+	}
 	this._length = len;
 };
 
 ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(Array.apply(null,{length:this._maxLength}))
-	this.i = this.i.concat(Array.apply(null,{length:this._maxLength}))
-	this.o = this.o.concat(Array.apply(null,{length:this._maxLength}))
+	this.v = this.v.concat(createSizedArray(this._maxLength));
+	this.i = this.i.concat(createSizedArray(this._maxLength));
+	this.o = this.o.concat(createSizedArray(this._maxLength));
 	this._maxLength *= 2;
 };
 
@@ -47,7 +51,7 @@
 			break;
 	}
 	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newPoint();
+		arr[pos] = point_pool.newElement();
 	}
 	arr[pos][0] = x;
 	arr[pos][1] = y;
@@ -57,4 +61,24 @@
 	this.setXYAt(vX,vY,'v',pos, replace);
 	this.setXYAt(oX,oY,'o',pos, replace);
 	this.setXYAt(iX,iY,'i',pos, replace);
+};
+
+ShapePath.prototype.reverse = function() {
+	var newPath = new ShapePath();
+	newPath.setPathData(this.c, this._length);
+	var vertices = this.v, outPoints = this.o, inPoints = this.i;
+	var init = 0;
+	if (this.c) {
+		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+        init = 1;
+    }
+    var cnt = this._length - 1;
+    var len = this._length;
+
+    var i;
+    for (i = init; i < len; i += 1) {
+    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+        cnt -= 1;
+    }
+    return newPath;
 };
\ No newline at end of file
diff --git a/player/js/utils/shapes/ShapeProperty.js b/player/js/utils/shapes/ShapeProperty.js
index bfa2266..17f518e 100644
--- a/player/js/utils/shapes/ShapeProperty.js
+++ b/player/js/utils/shapes/ShapeProperty.js
@@ -2,161 +2,168 @@
 
     var initFrame = -999999;
 
-    function interpolateShape() {
-        if(this.elem.globalData.frameId === this.frameId){
-            return;
-        }
-        this.mdf = false;
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        if(!((this.lastFrame !== initFrame && ((this.lastFrame < this.keyframes[0].t-this.offsetTime && frameNum < this.keyframes[0].t-this.offsetTime) || (this.lastFrame > this.keyframes[this.keyframes.length - 1].t-this.offsetTime && frameNum > this.keyframes[this.keyframes.length - 1].t-this.offsetTime))))){
-            var keyPropS,keyPropE,isHold;
-            if(frameNum < this.keyframes[0].t-this.offsetTime){
-                keyPropS = this.keyframes[0].s[0];
-                isHold = true;
-                this._lastIndex = 0;
-            }else if(frameNum >= this.keyframes[this.keyframes.length - 1].t-this.offsetTime){
-                if(this.keyframes[this.keyframes.length - 2].h === 1){
-                    keyPropS = this.keyframes[this.keyframes.length - 1].s[0];
-                }else{
-                    keyPropS = this.keyframes[this.keyframes.length - 2].e[0];
-                }
-                isHold = true;
+    function interpolateShape(frameNum, previousValue, caching) {
+        var iterationIndex = caching.lastIndex;
+        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
+        var kf = this.keyframes;
+        if(frameNum < kf[0].t-this.offsetTime){
+            keyPropS = kf[0].s[0];
+            isHold = true;
+            iterationIndex = 0;
+        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
+            if(kf[kf.length - 2].h === 1){
+                keyPropS = kf[kf.length - 1].s[0];
             }else{
-                var i = this.lastFrame < initFrame ? this._lastIndex : 0;
-                var len = this.keyframes.length- 1,flag = true,keyData,nextKeyData, j, jLen, k, kLen;
-                while(flag){
-                    keyData = this.keyframes[i];
-                    nextKeyData = this.keyframes[i+1];
-                    if((nextKeyData.t - this.offsetTime) > frameNum){
-                        break;
-                    }
-                    if(i < len - 1){
-                        i += 1;
-                    }else{
-                        flag = false;
-                    }
-                }
-                isHold = keyData.h === 1;
-                this._lastIndex = i;
-
-                var perc;
-                if(!isHold){
-                    if(frameNum >= nextKeyData.t-this.offsetTime){
-                        perc = 1;
-                    }else if(frameNum < keyData.t-this.offsetTime){
-                        perc = 0;
-                    }else{
-                        var fnc;
-                        if(keyData.__fnct){
-                            fnc = keyData.__fnct;
-                        }else{
-                            fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                            keyData.__fnct = fnc;
-                        }
-                        perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                    }
-                    keyPropE = keyData.e[0];
-                }
-                keyPropS = keyData.s[0];
+                keyPropS = kf[kf.length - 2].e[0];
             }
-            jLen = this.v._length;
-            kLen = keyPropS.i[0].length;
-            var hasModified = false;
-            var vertexValue;
-            for(j=0;j<jLen;j+=1){
-                for(k=0;k<kLen;k+=1){
-                    if(isHold){
-                        vertexValue = keyPropS.i[j][k];
-                        if(this.v.i[j][k] !== vertexValue){
-                            this.v.i[j][k] = vertexValue;
-                            this.pv.i[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.o[j][k];
-                        if(this.v.o[j][k] !== vertexValue){
-                            this.v.o[j][k] = vertexValue;
-                            this.pv.o[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.v[j][k];
-                        if(this.v.v[j][k] !== vertexValue){
-                            this.v.v[j][k] = vertexValue;
-                            this.pv.v[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                    }else{
-                        vertexValue = keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                        if(this.v.i[j][k] !== vertexValue){
-                            this.v.i[j][k] = vertexValue;
-                            this.pv.i[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                        if(this.v.o[j][k] !== vertexValue){
-                            this.v.o[j][k] = vertexValue;
-                            this.pv.o[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                        vertexValue = keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                        if(this.v.v[j][k] !== vertexValue){
-                            this.v.v[j][k] = vertexValue;
-                            this.pv.v[j][k] = vertexValue;
-                            hasModified = true;
-                        }
-                    }
+            isHold = true;
+        }else{
+            var i = iterationIndex;
+            var len = kf.length- 1,flag = true,keyData,nextKeyData;
+            while(flag){
+                keyData = kf[i];
+                nextKeyData = kf[i+1];
+                if((nextKeyData.t - this.offsetTime) > frameNum){
+                    break;
+                }
+                if(i < len - 1){
+                    i += 1;
+                }else{
+                    flag = false;
                 }
             }
-            this.mdf = hasModified;
-            this.v.c = keyPropS.c;
-            this.paths = this.localShapeCollection;
+            isHold = keyData.h === 1;
+            iterationIndex = i;
+            if(!isHold){
+                if(frameNum >= nextKeyData.t-this.offsetTime){
+                    perc = 1;
+                }else if(frameNum < keyData.t-this.offsetTime){
+                    perc = 0;
+                }else{
+                    var fnc;
+                    if(keyData.__fnct){
+                        fnc = keyData.__fnct;
+                    }else{
+                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
+                        keyData.__fnct = fnc;
+                    }
+                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
+                }
+                keyPropE = keyData.e[0];
+            }
+            keyPropS = keyData.s[0];
         }
+        jLen = previousValue._length;
+        kLen = keyPropS.i[0].length;
+        caching.lastIndex = iterationIndex;
 
-        this.lastFrame = frameNum;
-        this.frameId = this.elem.globalData.frameId;
+        for(j=0;j<jLen;j+=1){
+            for(k=0;k<kLen;k+=1){
+                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
+                previousValue.i[j][k] = vertexValue;
+                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
+                previousValue.o[j][k] = vertexValue;
+                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
+                previousValue.v[j][k] = vertexValue;
+            }
+        }
     }
 
-    function getShapeValue(){
-        return this.v;
+    function interpolateShapeCurrentTime(){
+        var frameNum = this.comp.renderedFrame - this.offsetTime;
+        var initTime = this.keyframes[0].t - this.offsetTime;
+        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+        var lastFrame = this._caching.lastFrame;
+        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
+            ////
+            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+            this.interpolateShape(frameNum, this.pv, this._caching);
+            ////
+        }
+        this._caching.lastFrame = frameNum;
+        return this.pv;
     }
 
     function resetShape(){
         this.paths = this.localShapeCollection;
-        if(!this.k){
-            this.mdf = false;
-        }
     }
 
+    function shapesEqual(shape1, shape2) {
+        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
+            return false;
+        }
+        var i, len = shape1._length;
+        for(i = 0; i < len; i += 1) {
+            if(shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1] || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1] || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]){
+                return false;
+            }
+        }
+        return true;
+    }
+
+    function processEffectsSequence() {
+        if(this.lock || this.elem.globalData.frameId === this.frameId) {
+            return;
+        }
+        this.lock = true;
+        this.frameId = this.elem.globalData.frameId;
+        this._mdf = false;
+        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
+        var i, len = this.effectsSequence.length;
+        for(i = 0; i < len; i += 1) {
+            finalValue = this.effectsSequence[i](finalValue);
+        }
+        if(!shapesEqual(this.v, finalValue)) {
+            this.v = shape_pool.clone(finalValue);
+            this.localShapeCollection.releaseShapes();
+            this.localShapeCollection.addShape(this.v);
+            this._mdf = true;
+            this.paths = this.localShapeCollection;
+        }
+        this.lock = false;
+    };
+
     function ShapeProperty(elem, data, type){
+        this.propType = 'shape';
         this.comp = elem.comp;
+        this.container = elem;
+        this.elem = elem;
+        this.data = data;
         this.k = false;
-        this.mdf = false;
-        this.v = shape_pool.newShape();
+        this.kf = false;
+        this._mdf = false;
         var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v.v = pathData.v;
-        this.v.i = pathData.i;
-        this.v.o = pathData.o;
-        this.v.c = pathData.c;
-        this.v._length = this.v.v.length;
-        this.getValue = getShapeValue;
+        this.v = shape_pool.clone(pathData);
         this.pv = shape_pool.clone(this.v);
         this.localShapeCollection = shapeCollection_pool.newShapeCollection();
         this.paths = this.localShapeCollection;
         this.paths.addShape(this.v);
         this.reset = resetShape;
+        this.effectsSequence = [];
     }
 
+    function addEffect(effectFunction) {
+        this.effectsSequence.push(effectFunction);
+        this.container.addDynamicProperty(this);
+    }
+
+    ShapeProperty.prototype.interpolateShape = interpolateShape;
+    ShapeProperty.prototype.getValue = processEffectsSequence;
+    ShapeProperty.prototype.getValue = processEffectsSequence;
+    ShapeProperty.prototype.addEffect = addEffect;
+
     function KeyframedShapeProperty(elem,data,type){
+        this.propType = 'shape';
         this.comp = elem.comp;
         this.elem = elem;
+        this.container = elem;
         this.offsetTime = elem.data.st;
-        this._lastIndex = 0;
-        this.getValue = interpolateShape;
         this.keyframes = type === 3 ? data.pt.k : data.ks.k;
         this.k = true;
         this.kf = true;
         var i, len = this.keyframes[0].s[0].i.length;
         var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newShape();
+        this.v = shape_pool.newElement();
         this.v.setPathData(this.keyframes[0].s[0].c, len);
         this.pv = shape_pool.clone(this.v);
         this.localShapeCollection = shapeCollection_pool.newShapeCollection();
@@ -164,309 +171,210 @@
         this.paths.addShape(this.v);
         this.lastFrame = initFrame;
         this.reset = resetShape;
+        this._caching = {lastFrame: initFrame, lastIndex: 0};
+        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
     }
+    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+    KeyframedShapeProperty.prototype.addEffect = addEffect;
 
     var EllShapeProperty = (function(){
 
         var cPoint = roundCorner;
 
-        function convertEllToPath(){
-            var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-            if(this.d !== 3){
-                this.v.v[0][0] = p0;
-                this.v.v[0][1] = p1-s1;
-                this.v.v[1][0] = p0 + s0;
-                this.v.v[1][1] = p1;
-                this.v.v[2][0] = p0;
-                this.v.v[2][1] = p1+s1;
-                this.v.v[3][0] = p0 - s0;
-                this.v.v[3][1] = p1;
-                this.v.i[0][0] = p0 - s0*cPoint;
-                this.v.i[0][1] = p1 - s1;
-                this.v.i[1][0] = p0 + s0;
-                this.v.i[1][1] = p1 - s1*cPoint;
-                this.v.i[2][0] = p0 + s0*cPoint;
-                this.v.i[2][1] = p1 + s1;
-                this.v.i[3][0] = p0 - s0;
-                this.v.i[3][1] = p1 + s1*cPoint;
-                this.v.o[0][0] = p0 + s0*cPoint;
-                this.v.o[0][1] = p1 - s1;
-                this.v.o[1][0] = p0 + s0;
-                this.v.o[1][1] = p1 + s1*cPoint;
-                this.v.o[2][0] = p0 - s0*cPoint;
-                this.v.o[2][1] = p1 + s1;
-                this.v.o[3][0] = p0 - s0;
-                this.v.o[3][1] = p1 - s1*cPoint;
-            }else{
-                this.v.v[0][0] = p0;
-                this.v.v[0][1] = p1-s1;
-                this.v.v[1][0] = p0 - s0;
-                this.v.v[1][1] = p1;
-                this.v.v[2][0] = p0;
-                this.v.v[2][1] = p1+s1;
-                this.v.v[3][0] = p0 + s0;
-                this.v.v[3][1] = p1;
-                this.v.i[0][0] = p0 + s0*cPoint;
-                this.v.i[0][1] = p1 - s1;
-                this.v.i[1][0] = p0 - s0;
-                this.v.i[1][1] = p1 - s1*cPoint;
-                this.v.i[2][0] = p0 - s0*cPoint;
-                this.v.i[2][1] = p1 + s1;
-                this.v.i[3][0] = p0 + s0;
-                this.v.i[3][1] = p1 + s1*cPoint;
-                this.v.o[0][0] = p0 - s0*cPoint;
-                this.v.o[0][1] = p1 - s1;
-                this.v.o[1][0] = p0 - s0;
-                this.v.o[1][1] = p1 + s1*cPoint;
-                this.v.o[2][0] = p0 + s0*cPoint;
-                this.v.o[2][1] = p1 + s1;
-                this.v.o[3][0] = p0 + s0;
-                this.v.o[3][1] = p1 - s1*cPoint;
-            }
-        }
-
-        function processKeys(frameNum){
-            var i, len = this.dynamicProperties.length;
-            if(this.elem.globalData.frameId === this.frameId){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-
-            for(i=0;i<len;i+=1){
-                this.dynamicProperties[i].getValue(frameNum);
-                if(this.dynamicProperties[i].mdf){
-                    this.mdf = true;
-                }
-            }
-            if(this.mdf){
-                this.convertEllToPath();
-            }
-        }
-
-        return function EllShapeProperty(elem,data) {
+        function EllShapeProperty(elem,data) {
             /*this.v = {
-                v: Array.apply(null,{length:4}),
-                i: Array.apply(null,{length:4}),
-                o: Array.apply(null,{length:4}),
+                v: createSizedArray(4),
+                i: createSizedArray(4),
+                o: createSizedArray(4),
                 c: true
             };*/
-            this.v = shape_pool.newShape();
+            this.v = shape_pool.newElement();
             this.v.setPathData(true, 4);
             this.localShapeCollection = shapeCollection_pool.newShapeCollection();
             this.paths = this.localShapeCollection;
             this.localShapeCollection.addShape(this.v);
             this.d = data.d;
-            this.dynamicProperties = [];
             this.elem = elem;
             this.comp = elem.comp;
             this.frameId = -1;
-            this.mdf = false;
-            this.getValue = processKeys;
-            this.convertEllToPath = convertEllToPath;
-            this.reset = resetShape;
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this.dynamicProperties);
+            this.initDynamicPropertyContainer(elem);
+            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
+            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
             if(this.dynamicProperties.length){
                 this.k = true;
             }else{
+                this.k = false;
                 this.convertEllToPath();
             }
+        };
+
+        EllShapeProperty.prototype = {
+            reset: resetShape,
+            getValue: function (){
+                if(this.elem.globalData.frameId === this.frameId){
+                    return;
+                }
+                this.frameId = this.elem.globalData.frameId;
+                this.iterateDynamicProperties();
+
+                if(this._mdf){
+                    this.convertEllToPath();
+                }
+            },
+            convertEllToPath: function() {
+                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
+                var _cw = this.d !== 3;
+                var _v = this.v;
+                _v.v[0][0] = p0;
+                _v.v[0][1] = p1 - s1;
+                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+                _v.v[1][1] = p1;
+                _v.v[2][0] = p0;
+                _v.v[2][1] = p1 + s1;
+                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+                _v.v[3][1] = p1;
+                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+                _v.i[0][1] = p1 - s1;
+                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+                _v.i[1][1] = p1 - s1 * cPoint;
+                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+                _v.i[2][1] = p1 + s1;
+                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+                _v.i[3][1] = p1 + s1 * cPoint;
+                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+                _v.o[0][1] = p1 - s1;
+                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+                _v.o[1][1] = p1 + s1 * cPoint;
+                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+                _v.o[2][1] = p1 + s1;
+                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+                _v.o[3][1] = p1 - s1 * cPoint;
+            }
         }
+
+        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+
+        return EllShapeProperty;
     }());
 
     var StarShapeProperty = (function() {
 
-        function convertPolygonToPath(){
-            var numPts = Math.floor(this.pt.v);
-            var angle = Math.PI*2/numPts;
-            /*this.v.v.length = numPts;
-            this.v.i.length = numPts;
-            this.v.o.length = numPts;*/
-            var rad = this.or.v;
-            var roundness = this.os.v;
-            var perimSegment = 2*Math.PI*rad/(numPts*4);
-            var i, currentAng = -Math.PI/ 2;
-            var dir = this.data.d === 3 ? -1 : 1;
-            currentAng += this.r.v;
-            this.v._length = 0;
-            for(i=0;i<numPts;i+=1){
-                var x = rad * Math.cos(currentAng);
-                var y = rad * Math.sin(currentAng);
-                var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                x +=  + this.p.v[0];
-                y +=  + this.p.v[1];
-                this.v.setTripleAt(x,y,x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir,x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir, i, true);
-                /*this.v.v[i] = [x,y];
-                this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
-                this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];*/
-                currentAng += angle*dir;
-            }
-            this.paths.length = 0;
-            this.paths[0] = this.v;
-        }
-
-        function convertStarToPath() {
-            var numPts = Math.floor(this.pt.v)*2;
-            var angle = Math.PI*2/numPts;
-            /*this.v.v.length = numPts;
-            this.v.i.length = numPts;
-            this.v.o.length = numPts;*/
-            var longFlag = true;
-            var longRad = this.or.v;
-            var shortRad = this.ir.v;
-            var longRound = this.os.v;
-            var shortRound = this.is.v;
-            var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-            var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-            var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-            currentAng += this.r.v;
-            var dir = this.data.d === 3 ? -1 : 1;
-            this.v._length = 0;
-            for(i=0;i<numPts;i+=1){
-                rad = longFlag ? longRad : shortRad;
-                roundness = longFlag ? longRound : shortRound;
-                perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                var x = rad * Math.cos(currentAng);
-                var y = rad * Math.sin(currentAng);
-                var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                x +=  + this.p.v[0];
-                y +=  + this.p.v[1];
-                this.v.setTripleAt(x,y,x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir,x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir, i, true);
-
-                /*this.v.v[i] = [x,y];
-                this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
-                this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                this.v._length = numPts;*/
-                longFlag = !longFlag;
-                currentAng += angle*dir;
-            }
-        }
-
-        function processKeys() {
-            if(this.elem.globalData.frameId === this.frameId){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-            var i, len = this.dynamicProperties.length;
-
-            for(i=0;i<len;i+=1){
-                this.dynamicProperties[i].getValue();
-                if(this.dynamicProperties[i].mdf){
-                    this.mdf = true;
-                }
-            }
-            if(this.mdf){
-                this.convertToPath();
-            }
-        }
-
-        return function StarShapeProperty(elem,data) {
-            /*this.v = {
-                v: [],
-                i: [],
-                o: [],
-                c: true
-            };*/
-            this.v = shape_pool.newShape();
+        function StarShapeProperty(elem,data) {
+            this.v = shape_pool.newElement();
             this.v.setPathData(true, 0);
             this.elem = elem;
             this.comp = elem.comp;
             this.data = data;
             this.frameId = -1;
             this.d = data.d;
-            this.dynamicProperties = [];
-            this.mdf = false;
-            this.getValue = processKeys;
-            this.reset = resetShape;
+            this.initDynamicPropertyContainer(elem);
             if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this.dynamicProperties);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this.dynamicProperties);
-                this.convertToPath = convertStarToPath;
+                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
+                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
+                this.convertToPath = this.convertStarToPath;
             } else {
-                this.convertToPath = convertPolygonToPath;
+                this.convertToPath = this.convertPolygonToPath;
             }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this.dynamicProperties);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this.dynamicProperties);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this.dynamicProperties);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this.dynamicProperties);
+            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
+            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
+            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
+            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
+            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
             this.localShapeCollection = shapeCollection_pool.newShapeCollection();
             this.localShapeCollection.addShape(this.v);
             this.paths = this.localShapeCollection;
             if(this.dynamicProperties.length){
                 this.k = true;
             }else{
+                this.k = false;
                 this.convertToPath();
             }
+        };
+
+        StarShapeProperty.prototype = {
+            reset: resetShape,
+            getValue: function() {
+                if(this.elem.globalData.frameId === this.frameId){
+                    return;
+                }
+                this.frameId = this.elem.globalData.frameId;
+                this.iterateDynamicProperties();
+                if(this._mdf){
+                    this.convertToPath();
+                }
+            },
+            convertStarToPath: function() {
+                var numPts = Math.floor(this.pt.v)*2;
+                var angle = Math.PI*2/numPts;
+                /*this.v.v.length = numPts;
+                this.v.i.length = numPts;
+                this.v.o.length = numPts;*/
+                var longFlag = true;
+                var longRad = this.or.v;
+                var shortRad = this.ir.v;
+                var longRound = this.os.v;
+                var shortRound = this.is.v;
+                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
+                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
+                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
+                currentAng += this.r.v;
+                var dir = this.data.d === 3 ? -1 : 1;
+                this.v._length = 0;
+                for(i=0;i<numPts;i+=1){
+                    rad = longFlag ? longRad : shortRad;
+                    roundness = longFlag ? longRound : shortRound;
+                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+                    var x = rad * Math.cos(currentAng);
+                    var y = rad * Math.sin(currentAng);
+                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
+                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
+                    x +=  + this.p.v[0];
+                    y +=  + this.p.v[1];
+                    this.v.setTripleAt(x,y,x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir,x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir, i, true);
+
+                    /*this.v.v[i] = [x,y];
+                    this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
+                    this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
+                    this.v._length = numPts;*/
+                    longFlag = !longFlag;
+                    currentAng += angle*dir;
+                }
+            },
+            convertPolygonToPath: function() {
+                var numPts = Math.floor(this.pt.v);
+                var angle = Math.PI*2/numPts;
+                var rad = this.or.v;
+                var roundness = this.os.v;
+                var perimSegment = 2*Math.PI*rad/(numPts*4);
+                var i, currentAng = -Math.PI/ 2;
+                var dir = this.data.d === 3 ? -1 : 1;
+                currentAng += this.r.v;
+                this.v._length = 0;
+                for(i=0;i<numPts;i+=1){
+                    var x = rad * Math.cos(currentAng);
+                    var y = rad * Math.sin(currentAng);
+                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
+                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
+                    x +=  + this.p.v[0];
+                    y +=  + this.p.v[1];
+                    this.v.setTripleAt(x,y,x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir,x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir, i, true);
+                    currentAng += angle*dir;
+                }
+                this.paths.length = 0;
+                this.paths[0] = this.v;
+            }
+
         }
+        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
+
+        return StarShapeProperty;
     }());
 
     var RectShapeProperty = (function() {
-        function processKeys(frameNum){
-            if(this.elem.globalData.frameId === this.frameId){
-                return;
-            }
-            this.mdf = false;
-            this.frameId = this.elem.globalData.frameId;
-            var i, len = this.dynamicProperties.length;
 
-            for(i=0;i<len;i+=1){
-                this.dynamicProperties[i].getValue(frameNum);
-                if(this.dynamicProperties[i].mdf){
-                    this.mdf = true;
-                }
-            }
-            if(this.mdf){
-                this.convertRectToPath();
-            }
-
-        }
-
-        function convertRectToPath(){
-            var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-            var round = bm_min(v0,v1,this.r.v);
-            var cPoint = round*(1-roundCorner);
-            this.v._length = 0;
-
-            if(this.d === 2 || this.d === 1) {
-                this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                if(round!== 0){
-                    this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                    this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                    this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                    this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                    this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                    this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                } else {
-                    this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                    this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                }
-            }else{
-                this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                if(round!== 0){
-                    this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                    this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                    this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                    this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                    this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                    this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                    this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                } else {
-                    this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                    this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                    this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                }
-            }
-        }
-
-        return function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newShape();
+         function RectShapeProperty(elem,data) {
+            this.v = shape_pool.newElement();
             this.v.c = true;
             this.localShapeCollection = shapeCollection_pool.newShapeCollection();
             this.localShapeCollection.addShape(this.v);
@@ -475,23 +383,76 @@
             this.comp = elem.comp;
             this.frameId = -1;
             this.d = data.d;
-            this.dynamicProperties = [];
-            this.mdf = false;
-            this.getValue = processKeys;
-            this.convertRectToPath = convertRectToPath;
-            this.reset = resetShape;
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this.dynamicProperties);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this.dynamicProperties);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this.dynamicProperties);
+            this.initDynamicPropertyContainer(elem);
+            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
+            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
+            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
             if(this.dynamicProperties.length){
                 this.k = true;
             }else{
+                this.k = false;
                 this.convertRectToPath();
             }
+        };
+
+        RectShapeProperty.prototype = {
+            convertRectToPath: function (){
+                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
+                var round = bm_min(v0,v1,this.r.v);
+                var cPoint = round*(1-roundCorner);
+                this.v._length = 0;
+
+                if(this.d === 2 || this.d === 1) {
+                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
+                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
+                    if(round!== 0){
+                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
+                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
+                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
+                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
+                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
+                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
+                    } else {
+                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
+                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
+                    }
+                }else{
+                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
+                    if(round!== 0){
+                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
+                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
+                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
+                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
+                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
+                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
+                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
+                    } else {
+                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
+                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
+                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
+
+                    }
+                }
+            },
+            getValue: function(frameNum){
+                if(this.elem.globalData.frameId === this.frameId){
+                    return;
+                }
+                this.frameId = this.elem.globalData.frameId;
+                this.iterateDynamicProperties();
+                if(this._mdf){
+                    this.convertRectToPath();
+                }
+
+            },
+            reset: resetShape
         }
+        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+
+        return RectShapeProperty;
     }());
 
-    function getShapeProp(elem,data,type, arr){
+    function getShapeProp(elem,data,type){
         var prop;
         if(type === 3 || type === 4){
             var dataProp = type === 3 ? data.pt : data.ks;
@@ -509,12 +470,22 @@
             prop = new StarShapeProperty(elem, data);
         }
         if(prop.k){
-            arr.push(prop);
+            elem.addDynamicProperty(prop);
         }
         return prop;
     }
 
+    function getConstructorFunction() {
+        return ShapeProperty;
+    }
+
+    function getKeyframedConstructorFunction() {
+        return KeyframedShapeProperty;
+    }
+
     var ob = {};
     ob.getShapeProp = getShapeProp;
+    ob.getConstructorFunction = getConstructorFunction;
+    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
     return ob;
 }());
\ No newline at end of file
diff --git a/player/js/utils/shapes/TrimModifier.js b/player/js/utils/shapes/TrimModifier.js
index d9184e4..267b3cd 100644
--- a/player/js/utils/shapes/TrimModifier.js
+++ b/player/js/utils/shapes/TrimModifier.js
@@ -1,103 +1,52 @@
-function TrimModifier(){};
-extendPrototype(ShapeModifier,TrimModifier);
-TrimModifier.prototype.processKeys = function(forceRender){
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
-    }
-    this.mdf = forceRender ? true : false;
-    this.frameId = this.elem.globalData.frameId;
-    var i, len = this.dynamicProperties.length;
-
-    for(i=0;i<len;i+=1){
-        this.dynamicProperties[i].getValue();
-        if(this.dynamicProperties[i].mdf){
-            this.mdf = true;
-        }
-    }
-    if(this.mdf || forceRender){
-        var o = (this.o.v%360)/360;
-        if(o < 0){
-            o += 1;
-        }
-        var s = this.s.v + o;
-        var e = this.e.v + o;
-        if(s == e){
-
-        }
-        if(s>e){
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        this.sValue = s;
-        this.eValue = e;
-        this.oValue = o;
-    }
+function TrimModifier(){
 }
-TrimModifier.prototype.initModifierProperties = function(elem,data){
+extendPrototype([ShapeModifier], TrimModifier);
+TrimModifier.prototype.initModifierProperties = function(elem, data) {
+    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
     this.sValue = 0;
     this.eValue = 0;
-    this.oValue = 0;
     this.getValue = this.processKeys;
-    this.s = PropertyFactory.getProp(elem,data.s,0,0.01,this.dynamicProperties);
-    this.e = PropertyFactory.getProp(elem,data.e,0,0.01,this.dynamicProperties);
-    this.o = PropertyFactory.getProp(elem,data.o,0,0,this.dynamicProperties);
     this.m = data.m;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
+    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.getSegmentsLength = function(shapeData){
-    var closed = shapeData.c;
-    var pathV = shapeData.v;
-    var pathO = shapeData.o;
-    var pathI = shapeData.i;
-    var i, len = shapeData._length;
-    var lengths = [];
-    var totalLength = 0;
-    for(i=0;i<len-1;i+=1){
-        lengths[i] = bez.getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-        totalLength += lengths[i].addedLength;
-    }
-    if(closed){
-        lengths[i] = bez.getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-        totalLength += lengths[i].addedLength;
-    }
-    return {lengths:lengths,totalLength:totalLength};
-}
+TrimModifier.prototype.addShapeToModifier = function(shapeData){
+    shapeData.pathsData = [];
+};
 
 TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
-    var segments = []
-    if(e <= 1){
+    var segments = [];
+    if (e <= 1) {
         segments.push({
             s: s,
             e: e
-        })
-    }else if(s >= 1){
+        });
+    } else if (s >= 1) {
         segments.push({
             s: s - 1,
             e: e - 1
-        })
-    }else{
+        });
+    } else {
         segments.push({
             s: s,
             e: 1
-        })
+        });
         segments.push({
             s: 0,
             e: e - 1
-        })
+        });
     }
     var shapeSegments = [];
     var i, len = segments.length, segmentOb;
-    for(i = 0; i < len; i += 1) {
+    for (i = 0; i < len; i += 1) {
         segmentOb = segments[i];
         if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
             
         } else {
             var shapeS, shapeE;
-            if(segmentOb.s * totalModifierLength <= addedLength) {
+            if (segmentOb.s * totalModifierLength <= addedLength) {
                 shapeS = 0;
             } else {
                 shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
@@ -110,42 +59,73 @@
             shapeSegments.push([shapeS, shapeE]);
         }
     }
-    if(!shapeSegments.length){
-        shapeSegments.push([0,0]);
+    if (!shapeSegments.length) {
+        shapeSegments.push([0, 0]);
     }
     return shapeSegments;
-}
+};
 
-TrimModifier.prototype.processShapes = function(firstFrame){
+TrimModifier.prototype.releasePathsData = function(pathsData) {
+    var i, len = pathsData.length;
+    for (i = 0; i < len; i += 1) {
+        segments_length_pool.release(pathsData[i]);
+    }
+    pathsData.length = 0;
+    return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function(_isFirstFrame) {
+    var s, e;
+    if (this._mdf || _isFirstFrame) {
+        var o = (this.o.v % 360) / 360;
+        if (o < 0) {
+            o += 1;
+        }
+        s = this.s.v + o;
+        e = this.e.v + o;
+        if (s === e) {
+
+        }
+        if (s > e) {
+            var _s = s;
+            s = e;
+            e = _s;
+        }
+        s = Math.round(s*1000)/1000;
+        e = Math.round(e*1000)/1000;
+        this.sValue = s;
+        this.eValue = e;
+    } else {
+        s = this.sValue;
+        e = this.eValue;
+    }
     var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var s = this.sValue;
-    var e = this.eValue;
-    var pathsData,pathData, totalShapeLength, totalModifierLength = 0;
+    var i, len = this.shapes.length, j, jLen;
+    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
 
-    if(e === s){
-        for(i=0;i<len;i+=1){
+    if (e === s) {
+        for (i = 0; i < len; i += 1) {
             this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape.mdf = true;
+            this.shapes[i].shape._mdf = true;
             this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
         }
-    } else if(!((e === 1 && s === 0) || (e===0 && s === 1))){
+    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
         var segments = [], shapeData, localShapeCollection;
-        for(i=0;i<len;i+=1){
+        for (i = 0; i < len; i += 1) {
             shapeData = this.shapes[i];
-            if(!shapeData.shape.mdf && !this.mdf && !firstFrame && this.m !== 2){
+            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
                 shapeData.shape.paths = shapeData.localShapeCollection;
             } else {
                 shapePaths = shapeData.shape.paths;
                 jLen = shapePaths._length;
                 totalShapeLength = 0;
-                if(!shapeData.shape.mdf && shapeData.pathsData){
+                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
                     totalShapeLength = shapeData.totalShapeLength;
                 } else {
-                    pathsData = [];
-                    for(j=0;j<jLen;j+=1){
-                        pathData = this.getSegmentsLength(shapePaths.shapes[j]);
+                    pathsData = this.releasePathsData(shapeData.pathsData);
+                    for (j = 0; j < jLen; j += 1) {
+                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
                         pathsData.push(pathData);
                         totalShapeLength += pathData.totalLength;
                     }
@@ -154,58 +134,57 @@
                 }
 
                 totalModifierLength += totalShapeLength;
-                shapeData.shape.mdf = true;
+                shapeData.shape._mdf = true;
             }
         }
-        var shapeS = s, shapeE = e, addedLength = 0;
-        var j, jLen;
-        for(i = len - 1; i >= 0; i -= 1){
+        var shapeS = s, shapeE = e, addedLength = 0, edges;
+        for (i = len - 1; i >= 0; i -= 1) {
             shapeData = this.shapes[i];
-            if (shapeData.shape.mdf) {
+            if (shapeData.shape._mdf) {
                 localShapeCollection = shapeData.localShapeCollection;
                 localShapeCollection.releaseShapes();
-                if(this.m === 2 && len > 1) {
-                    var edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+                if (this.m === 2 && len > 1) {
+                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
                     addedLength += shapeData.totalShapeLength;
                 } else {
-                    edges = [[shapeS, shapeE]]
+                    edges = [[shapeS, shapeE]];
                 }
                 jLen = edges.length;
                 for (j = 0; j < jLen; j += 1) {
                     shapeS = edges[j][0];
                     shapeE = edges[j][1];
                     segments.length = 0;
-                    if(shapeE <= 1){
+                    if (shapeE <= 1) {
                         segments.push({
                             s:shapeData.totalShapeLength * shapeS,
                             e:shapeData.totalShapeLength * shapeE
-                        })
-                    }else if(shapeS >= 1){
+                        });
+                    } else if (shapeS >= 1) {
                         segments.push({
                             s:shapeData.totalShapeLength * (shapeS - 1),
                             e:shapeData.totalShapeLength * (shapeE - 1)
-                        })
-                    }else{
+                        });
+                    } else {
                         segments.push({
                             s:shapeData.totalShapeLength * shapeS,
                             e:shapeData.totalShapeLength
-                        })
+                        });
                         segments.push({
                             s:0,
-                            e:shapeData.totalShapeLength*(shapeE - 1)
-                        })
+                            e:shapeData.totalShapeLength * (shapeE - 1)
+                        });
                     }
                     var newShapesData = this.addShapes(shapeData,segments[0]);
                     if (segments[0].s !== segments[0].e) {
-                        var lastPos;
-                        if(segments.length > 1){
-                            if(shapeData.shape.v.c){
+                        if (segments.length > 1) {
+                            if (shapeData.shape.v.c) {
                                 var lastShape = newShapesData.pop();
                                 this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData,segments[1], lastShape);
+                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
                             } else {
                                 this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData,segments[1]);
+                                newShapesData = this.addShapes(shapeData, segments[1]);
                             }
                         } 
                         this.addPaths(newShapesData, localShapeCollection);
@@ -215,38 +194,39 @@
                 shapeData.shape.paths = localShapeCollection;
             }
         }
-    } else if(this.mdf){
-        for(i=0;i<len;i+=1){
-            this.shapes[i].shape.mdf = true;
+    } else if (this._mdf) {
+        for (i = 0; i < len; i += 1) {
+            this.shapes[i].shape._mdf = true;
         }
     }
-    if(!this.dynamicProperties.length){
-        this.mdf = false;
-    }
-}
+};
 
 TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
     var i, len = newPaths.length;
-    for(i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i])
+    for (i = 0; i < len; i += 1) {
+        localShapeCollection.addShape(newPaths[i]);
     }
-}
+};
 
-TrimModifier.prototype.addSegment = function(pt1,pt2,pt3,pt4,shapePath,pos, newShape) {
-    /*console.log(pt1, 'vertex: v, at: ', pos);
-    console.log(pt2, 'vertex: o, at: ', pos);
-    console.log(pt3, 'vertex: i, at: ', pos + 1);
-    console.log(pt4, 'vertex: v, at: ', pos + 1);
-    console.log('newShape: ', newShape);*/
-    shapePath.setXYAt(pt2[0],pt2[1],'o',pos);
-    shapePath.setXYAt(pt3[0],pt3[1],'i',pos + 1);
+TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
     if(newShape){
-        shapePath.setXYAt(pt1[0],pt1[1],'v',pos);
+        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
     }
-    shapePath.setXYAt(pt4[0],pt4[1],'v',pos + 1);
-}
+    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
 
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath){
+TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
+    shapePath.setXYAt(points[1], points[5], 'o', pos);
+    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+    if(newShape){
+        shapePath.setXYAt(points[0], points[4], 'v', pos);
+    }
+    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
     var pathsData = shapeData.pathsData;
     var shapePaths = shapeData.shape.paths.shapes;
     var i, len = shapeData.shape.paths._length, j, jLen;
@@ -257,8 +237,8 @@
     var shapes = [];
     var initPos;
     var newShape = true;
-    if(!shapePath){
-        shapePath = shape_pool.newShape();
+    if (!shapePath) {
+        shapePath = shape_pool.newElement();
         segmentCount = 0;
         initPos = 0;
     } else {
@@ -266,25 +246,26 @@
         initPos = shapePath._length;
     }
     shapes.push(shapePath);
-    for(i=0;i<len;i+=1){
+    for (i = 0; i < len; i += 1) {
         lengths = pathsData[i].lengths;
         shapePath.c = shapePaths[i].c;
         jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for(j=1;j<jLen;j+=1){
+        for (j = 1; j < jLen; j +=1) {
             currentLengthData = lengths[j-1];
-            if(addedLength + currentLengthData.addedLength < shapeSegment.s){
+            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
                 addedLength += currentLengthData.addedLength;
                 shapePath.c = false;
-            } else if(addedLength > shapeSegment.e){
+            } else if(addedLength > shapeSegment.e) {
                 shapePath.c = false;
                 break;
             } else {
-                if(shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength){
-                    this.addSegment(shapePaths[i].v[j-1],shapePaths[i].o[j-1],shapePaths[i].i[j],shapePaths[i].v[j],shapePath,segmentCount,newShape);
+                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
                     newShape = false;
                 } else {
-                    segment = bez.getNewSegment(shapePaths[i].v[j-1],shapePaths[i].v[j],shapePaths[i].o[j-1],shapePaths[i].i[j], (shapeSegment.s - addedLength)/currentLengthData.addedLength,(shapeSegment.e - addedLength)/currentLengthData.addedLength, lengths[j-1]);
-                    this.addSegment(segment.pt1,segment.pt3,segment.pt4,segment.pt2,shapePath,segmentCount,newShape);
+                    segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[j], shapePaths[i].o[j - 1], shapePaths[i].i[j], (shapeSegment.s - addedLength)/currentLengthData.addedLength,(shapeSegment.e - addedLength)/currentLengthData.addedLength, lengths[j-1]);
+                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
                     newShape = false;
                     shapePath.c = false;
                 }
@@ -292,16 +273,17 @@
                 segmentCount += 1;
             }
         }
-        if(shapePaths[i].c){
-            currentLengthData = lengths[j-1];
-            if(addedLength <= shapeSegment.e){
-                var segmentLength = lengths[j-1].addedLength;
-                if(shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength){
-                    this.addSegment(shapePaths[i].v[j-1],shapePaths[i].o[j-1],shapePaths[i].i[0],shapePaths[i].v[0],shapePath,segmentCount,newShape);
+        if (shapePaths[i].c) {
+            currentLengthData = lengths[j - 1];
+            if (addedLength <= shapeSegment.e) {
+                var segmentLength = lengths[j - 1].addedLength;
+                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
                     newShape = false;
-                }else{
-                    segment = bez.getNewSegment(shapePaths[i].v[j-1],shapePaths[i].v[0],shapePaths[i].o[j-1],shapePaths[i].i[0], (shapeSegment.s - addedLength)/segmentLength,(shapeSegment.e - addedLength)/segmentLength, lengths[j-1]);
-                    this.addSegment(segment.pt1,segment.pt3,segment.pt4,segment.pt2,shapePath,segmentCount,newShape);
+                } else {
+                    segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[0], shapePaths[i].o[j - 1], shapePaths[i].i[0], (shapeSegment.s - addedLength) / segmentLength, (shapeSegment.e - addedLength) / segmentLength, lengths[j - 1]);
+                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
                     newShape = false;
                     shapePath.c = false;
                 }
@@ -311,23 +293,22 @@
             addedLength += currentLengthData.addedLength;
             segmentCount += 1;
         }
-        if(shapePath._length){
-            shapePath.setXYAt(shapePath.v[initPos][0],shapePath.v[initPos][1],'i',initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0],shapePath.v[shapePath._length - 1][1],'o',shapePath._length - 1);
+        if (shapePath._length) {
+            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
         }
-        if(addedLength > shapeSegment.e){
+        if (addedLength > shapeSegment.e) {
             break;
         }
-        if(i<len-1){
-            shapePath = shape_pool.newShape();
+        if (i < len - 1) {
+            shapePath = shape_pool.newElement();
             newShape = true;
             shapes.push(shapePath);
             segmentCount = 0;
         }
     }
     return shapes;
-
-}
+};
 
 
-ShapeModifiers.registerModifier('tm',TrimModifier);
\ No newline at end of file
+ShapeModifiers.registerModifier('tm', TrimModifier);
\ No newline at end of file
diff --git a/player/js/utils/shapes/shapePathBuilder.js b/player/js/utils/shapes/shapePathBuilder.js
new file mode 100644
index 0000000..67ff949
--- /dev/null
+++ b/player/js/utils/shapes/shapePathBuilder.js
@@ -0,0 +1,45 @@
+var buildShapeString = function(pathNodes, length, closed, mat) {
+	if(length === 0) {
+            return '';
+        }
+        var _o = pathNodes.o;
+        var _i = pathNodes.i;
+        var _v = pathNodes.v;
+        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+        for(i = 1; i < length; i += 1) {
+            shapeString += " C" + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + " " + mat.applyToPointStringified(_i[i][0], _i[i][1]) + " " + mat.applyToPointStringified(_v[i][0], _v[i][1]);
+        }
+        if (closed && length) {
+            shapeString += " C" + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + " " + mat.applyToPointStringified(_i[0][0], _i[0][1]) + " " + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+            shapeString += 'z';
+        }
+        return shapeString;
+};
+
+var buildPIXIShape = function(pathNodes, length, closed, mat) {
+    if(length === 0) {
+            return '';
+    }
+    var _o = pathNodes.o;
+    var _i = pathNodes.i;
+    var _v = pathNodes.v;
+    var _PIXIcommands = [];
+    _PIXIcommands.push({
+        t:'m',
+        c:mat.applyToPointArray(_v[0][0], _v[0][1], 0)
+    })
+    var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+    for(i = 1; i < length; i += 1) {
+        _PIXIcommands.push({
+            t:'c',
+            c:mat.applyToPointArray(_o[i - 1][0], _o[i - 1][1], 0).concat(mat.applyToPointArray(_i[i][0], _i[i][1], 0)).concat(mat.applyToPointArray(_v[i][0], _v[i][1], 0))
+        })
+    }
+    if (closed && length) {
+        _PIXIcommands.push({
+            t:'c',
+            c:mat.applyToPointArray(_o[i - 1][0], _o[i - 1][1], 0).concat(mat.applyToPointArray(_i[0][0], _i[0][1], 0)).concat(mat.applyToPointArray(_v[0][0], _v[0][1], 0))
+        })
+    }
+    return _PIXIcommands;
+};
\ No newline at end of file
diff --git a/player/js/utils/text/LetterProps.js b/player/js/utils/text/LetterProps.js
new file mode 100644
index 0000000..a579360
--- /dev/null
+++ b/player/js/utils/text/LetterProps.js
@@ -0,0 +1,58 @@
+function LetterProps(o, sw, sc, fc, m, p){
+    this.o = o;
+    this.sw = sw;
+    this.sc = sc;
+    this.fc = fc;
+    this.m = m;
+    this.p = p;
+    this._mdf = {
+    	o: true,
+    	sw: !!sw,
+    	sc: !!sc,
+    	fc: !!fc,
+    	m: true,
+    	p: true
+    };
+}
+
+LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
+	this._mdf.o = false;
+	this._mdf.sw = false;
+	this._mdf.sc = false;
+	this._mdf.fc = false;
+	this._mdf.m = false;
+	this._mdf.p = false;
+	var updated = false;
+
+	if(this.o !== o) {
+		this.o = o;
+		this._mdf.o = true;
+		updated = true;
+	}
+	if(this.sw !== sw) {
+		this.sw = sw;
+		this._mdf.sw = true;
+		updated = true;
+	}
+	if(this.sc !== sc) {
+		this.sc = sc;
+		this._mdf.sc = true;
+		updated = true;
+	}
+	if(this.fc !== fc) {
+		this.fc = fc;
+		this._mdf.fc = true;
+		updated = true;
+	}
+	if(this.m !== m) {
+		this.m = m;
+		this._mdf.m = true;
+		updated = true;
+	}
+	if(p.length && (this.p[0] !== p[0] || this.p[1] !== p[1] || this.p[4] !== p[4] || this.p[5] !== p[5] || this.p[12] !== p[12] || this.p[13] !== p[13])) {
+		this.p = p;
+		this._mdf.p = true;
+		updated = true;
+	}
+	return updated;
+};
\ No newline at end of file
diff --git a/player/js/utils/text/TextAnimatorDataProperty.js b/player/js/utils/text/TextAnimatorDataProperty.js
new file mode 100644
index 0000000..cc9ff60
--- /dev/null
+++ b/player/js/utils/text/TextAnimatorDataProperty.js
@@ -0,0 +1,26 @@
+function TextAnimatorDataProperty(elem, animatorProps, container) {
+	var defaultData = {propType:false};
+	var getProp = PropertyFactory.getProp;
+	var textAnimator_animatables = animatorProps.a;
+	this.a = {
+		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
+		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
+		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
+		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
+		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
+		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
+		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
+		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
+		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
+		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
+		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
+		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
+		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
+		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
+		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
+		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
+	};
+
+	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
+    this.s.t = animatorProps.s.t;
+}
\ No newline at end of file
diff --git a/player/js/utils/text/TextAnimatorProperty.js b/player/js/utils/text/TextAnimatorProperty.js
new file mode 100644
index 0000000..4a77e7e
--- /dev/null
+++ b/player/js/utils/text/TextAnimatorProperty.js
@@ -0,0 +1,565 @@
+function TextAnimatorProperty(textData, renderType, elem){
+    this._isFirstFrame = true;
+	this._hasMaskedPath = false;
+	this._frameId = -1;
+	this._textData = textData;
+	this._renderType = renderType;
+    this._elem = elem;
+	this._animatorsData = createSizedArray(this._textData.a.length);
+	this._pathData = {};
+	this._moreOptions = {
+		alignment: {}
+	};
+	this.renderedLetters = [];
+    this.lettersChangedFlag = false;
+    this.initDynamicPropertyContainer(elem);
+
+}
+
+TextAnimatorProperty.prototype.searchProperties = function(){
+    var i, len = this._textData.a.length, animatorProps;
+    var getProp = PropertyFactory.getProp;
+    for(i=0;i<len;i+=1){
+        animatorProps = this._textData.a[i];
+        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+    }
+    if(this._textData.p && 'm' in this._textData.p){
+        this._pathData = {
+            f: getProp(this._elem,this._textData.p.f,0,0,this),
+            l: getProp(this._elem,this._textData.p.l,0,0,this),
+            r: this._textData.p.r,
+            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
+        };
+        this._hasMaskedPath = true;
+    } else {
+        this._hasMaskedPath = false;
+    }
+    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
+    this.lettersChangedFlag = lettersChangedFlag;
+    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+        return;
+    }
+    this._isFirstFrame = false;
+    var alignment = this._moreOptions.alignment.v;
+    var animators = this._animatorsData;
+    var textData = this._textData;
+    var matrixHelper = this.mHelper;
+    var renderType = this._renderType;
+    var renderedLettersCount = this.renderedLetters.length;
+    var data = this.data;
+    var xPos,yPos;
+    var i, len;
+    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
+    if(this._hasMaskedPath) {
+        mask = this._pathData.m;
+        if(!this._pathData.n || this._pathData._mdf){
+            var paths = mask.v;
+            if(this._pathData.r){
+                paths = paths.reverse();
+            }
+            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+            pathInfo = {
+                tLength: 0,
+                segments: []
+            };
+            len = paths._length - 1;
+            var pathData;
+            totalLength = 0;
+            for (i = 0; i < len; i += 1) {
+                pathData = {
+                    s: paths.v[i],
+                    e: paths.v[i + 1],
+                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
+                    ti: [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]
+                };
+                bez.buildBezierData(pathData);
+                pathInfo.tLength += pathData.bezierData.segmentLength;
+                pathInfo.segments.push(pathData);
+                totalLength += pathData.bezierData.segmentLength;
+            }
+            i = len;
+            if (mask.v.c) {
+                pathData = {
+                    s: paths.v[i],
+                    e: paths.v[0],
+                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
+                    ti: [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]
+                };
+                bez.buildBezierData(pathData);
+                pathInfo.tLength += pathData.bezierData.segmentLength;
+                pathInfo.segments.push(pathData);
+                totalLength += pathData.bezierData.segmentLength;
+            }
+            this._pathData.pi = pathInfo;
+        }
+        pathInfo = this._pathData.pi;
+
+        currentLength = this._pathData.f.v;
+        segmentInd = 0;
+        pointInd = 1;
+        segmentLength = 0;
+        flag = true;
+        segments = pathInfo.segments;
+        if (currentLength < 0 && mask.v.c) {
+            if (pathInfo.tLength < Math.abs(currentLength)) {
+                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+            }
+            segmentInd = segments.length - 1;
+            points = segments[segmentInd].bezierData.points;
+            pointInd = points.length - 1;
+            while (currentLength < 0) {
+                currentLength += points[pointInd].partialLength;
+                pointInd -= 1;
+                if (pointInd < 0) {
+                    segmentInd -= 1;
+                    points = segments[segmentInd].bezierData.points;
+                    pointInd = points.length - 1;
+                }
+            }
+
+        }
+        points = segments[segmentInd].bezierData.points;
+        prevPoint = points[pointInd - 1];
+        currentPoint = points[pointInd];
+        partialLength = currentPoint.partialLength;
+    }
+
+
+    len = letters.length;
+    xPos = 0;
+    yPos = 0;
+    var yOff = documentData.finalSize * 1.2 * 0.714;
+    var firstLine = true;
+    var animatorProps, animatorSelector;
+    var j, jLen;
+    var letterValue;
+
+    jLen = animators.length;
+    var lastLetter;
+
+    var mult, ind = -1, offf, xPathPos, yPathPos;
+    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
+    var elemOpacity;
+    var sc,sw,fc,k;
+    var lineLength = 0;
+    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
+
+    //
+    if(documentData.j === 2 || documentData.j === 1) {
+        var animatorJustifyOffset = 0;
+        var animatorFirstCharOffset = 0;
+        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+        var lastIndex = 0;
+        var isNewLine = true;
+
+        for (i = 0; i < len; i += 1) {
+            if (letters[i].n) {
+                if(animatorJustifyOffset) {
+                    animatorJustifyOffset += animatorFirstCharOffset;
+                }
+                while (lastIndex < i) {
+                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+                    lastIndex += 1;
+                }
+                animatorJustifyOffset = 0;
+                isNewLine = true;
+            } else {
+                for (j = 0; j < jLen; j += 1) {
+                    animatorProps = animators[j].a;
+                    if (animatorProps.t.propType) {
+                        if (isNewLine && documentData.j === 2) {
+                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+                        }
+                        animatorSelector = animators[j].s;
+                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+                        if (mult.length) {
+                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
+                        } else {
+                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
+                        }
+                    }
+                }
+                isNewLine = false;
+            }
+        }
+        if(animatorJustifyOffset) {
+            animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while(lastIndex < i) {
+            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+            lastIndex += 1;
+        }
+    }
+    //
+
+    for( i = 0; i < len; i += 1) {
+
+        matrixHelper.reset();
+        elemOpacity = 1;
+        if(letters[i].n) {
+            xPos = 0;
+            yPos += documentData.yOffset;
+            yPos += firstLine ? 1 : 0;
+            currentLength = initPathPos ;
+            firstLine = false;
+            lineLength = 0;
+            if(this._hasMaskedPath) {
+                segmentInd = initSegmentInd;
+                pointInd = initPointInd;
+                points = segments[segmentInd].bezierData.points;
+                prevPoint = points[pointInd - 1];
+                currentPoint = points[pointInd];
+                partialLength = currentPoint.partialLength;
+                segmentLength = 0;
+            }
+            letterO = letterSw = letterFc = letterM = '';
+            letterP = this.defaultPropsArray;
+        }else{
+            if(this._hasMaskedPath) {
+                if(currentLine !== letters[i].line){
+                    switch(documentData.j){
+                        case 1:
+                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
+                            break;
+                        case 2:
+                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
+                            break;
+                    }
+                    currentLine = letters[i].line;
+                }
+                if (ind !== letters[i].ind) {
+                    if (letters[ind]) {
+                        currentLength += letters[ind].extra;
+                    }
+                    currentLength += letters[i].an / 2;
+                    ind = letters[i].ind;
+                }
+                currentLength += alignment[0] * letters[i].an / 200;
+                var animatorOffset = 0;
+                for (j = 0; j < jLen; j += 1) {
+                    animatorProps = animators[j].a;
+                    if (animatorProps.p.propType) {
+                        animatorSelector = animators[j].s;
+                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+                        if(mult.length){
+                            animatorOffset += animatorProps.p.v[0] * mult[0];
+                        } else{
+                            animatorOffset += animatorProps.p.v[0] * mult;
+                        }
+
+                    }
+                    if (animatorProps.a.propType) {
+                        animatorSelector = animators[j].s;
+                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+                        if(mult.length){
+                            animatorOffset += animatorProps.a.v[0] * mult[0];
+                        } else{
+                            animatorOffset += animatorProps.a.v[0] * mult;
+                        }
+
+                    }
+                }
+                flag = true;
+                while (flag) {
+                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
+                        flag = false;
+                    } else if (points) {
+                        segmentLength += currentPoint.partialLength;
+                        pointInd += 1;
+                        if (pointInd >= points.length) {
+                            pointInd = 0;
+                            segmentInd += 1;
+                            if (!segments[segmentInd]) {
+                                if (mask.v.c) {
+                                    pointInd = 0;
+                                    segmentInd = 0;
+                                    points = segments[segmentInd].bezierData.points;
+                                } else {
+                                    segmentLength -= currentPoint.partialLength;
+                                    points = null;
+                                }
+                            } else {
+                                points = segments[segmentInd].bezierData.points;
+                            }
+                        }
+                        if (points) {
+                            prevPoint = currentPoint;
+                            currentPoint = points[pointInd];
+                            partialLength = currentPoint.partialLength;
+                        }
+                    }
+                }
+                offf = letters[i].an / 2 - letters[i].add;
+                matrixHelper.translate(-offf, 0, 0);
+            } else {
+                offf = letters[i].an/2 - letters[i].add;
+                matrixHelper.translate(-offf,0,0);
+
+                // Grouping alignment
+                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+            }
+
+            lineLength += letters[i].l/2;
+            for(j=0;j<jLen;j+=1){
+                animatorProps = animators[j].a;
+                if (animatorProps.t.propType) {
+                    animatorSelector = animators[j].s;
+                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+                    //This condition is to prevent applying tracking to first character in each line. Might be better to use a boolean "isNewLine"
+                    if(xPos !== 0 || documentData.j !== 0) {
+                        if(this._hasMaskedPath) {
+                            if(mult.length) {
+                                currentLength += animatorProps.t.v*mult[0];
+                            } else {
+                                currentLength += animatorProps.t.v*mult;
+                            }
+                        }else{
+                            if(mult.length) {
+                                xPos += animatorProps.t.v*mult[0];
+                            } else {
+                                xPos += animatorProps.t.v*mult;
+                            }
+                        }
+                    }
+                }
+            }
+            lineLength += letters[i].l/2;
+            if(documentData.strokeWidthAnim) {
+                sw = documentData.sw || 0;
+            }
+            if(documentData.strokeColorAnim) {
+                if(documentData.sc){
+                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
+                }else{
+                    sc = [0,0,0];
+                }
+            }
+            if(documentData.fillColorAnim && documentData.fc) {
+                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+            }
+            for(j=0;j<jLen;j+=1){
+                animatorProps = animators[j].a;
+                if (animatorProps.a.propType) {
+                    animatorSelector = animators[j].s;
+                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+
+                    if(mult.length){
+                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
+                    } else {
+                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
+                    }
+                }
+            }
+            for(j=0;j<jLen;j+=1){
+                animatorProps = animators[j].a;
+                if (animatorProps.s.propType) {
+                    animatorSelector = animators[j].s;
+                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+                    if(mult.length){
+                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
+                    } else {
+                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
+                    }
+                }
+            }
+            for(j=0;j<jLen;j+=1) {
+                animatorProps = animators[j].a;
+                animatorSelector = animators[j].s;
+                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+                if (animatorProps.sk.propType) {
+                    if(mult.length) {
+                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+                    } else {
+                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+                    }
+                }
+                if (animatorProps.r.propType) {
+                    if(mult.length) {
+                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+                    } else {
+                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
+                    }
+                }
+                if (animatorProps.ry.propType) {
+
+                    if(mult.length) {
+                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
+                    }else{
+                        matrixHelper.rotateY(animatorProps.ry.v*mult);
+                    }
+                }
+                if (animatorProps.rx.propType) {
+                    if(mult.length) {
+                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
+                    } else {
+                        matrixHelper.rotateX(animatorProps.rx.v*mult);
+                    }
+                }
+                if (animatorProps.o.propType) {
+                    if(mult.length) {
+                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
+                    } else {
+                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
+                    }
+                }
+                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+                    if(mult.length) {
+                        sw += animatorProps.sw.v*mult[0];
+                    } else {
+                        sw += animatorProps.sw.v*mult;
+                    }
+                }
+                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+                    for(k=0;k<3;k+=1){
+                        if(mult.length) {
+                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
+                        } else {
+                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
+                        }
+                    }
+                }
+                if (documentData.fillColorAnim && documentData.fc) {
+                    if(animatorProps.fc.propType){
+                        for(k=0;k<3;k+=1){
+                            if(mult.length) {
+                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
+                            } else {
+                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
+                            }
+                        }
+                    }
+                    if(animatorProps.fh.propType){
+                        if(mult.length) {
+                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
+                        } else {
+                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
+                        }
+                    }
+                    if(animatorProps.fs.propType){
+                        if(mult.length) {
+                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
+                        } else {
+                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
+                        }
+                    }
+                    if(animatorProps.fb.propType){
+                        if(mult.length) {
+                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
+                        } else {
+                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
+                        }
+                    }
+                }
+            }
+
+            for(j=0;j<jLen;j+=1){
+                animatorProps = animators[j].a;
+
+                if (animatorProps.p.propType) {
+                    animatorSelector = animators[j].s;
+                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
+                    if(this._hasMaskedPath) {
+                        if(mult.length) {
+                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+                        } else {
+                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+                        }
+                    }else{
+                        if(mult.length) {
+                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+                        } else {
+                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+                        
+                        }
+                    }
+                }
+            }
+            if(documentData.strokeWidthAnim){
+                letterSw = sw < 0 ? 0 : sw;
+            }
+            if(documentData.strokeColorAnim){
+                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
+            }
+            if(documentData.fillColorAnim && documentData.fc){
+                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
+            }
+
+            if(this._hasMaskedPath) {
+                matrixHelper.translate(0,-documentData.ls);
+
+                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
+                if (textData.p.p) {
+                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
+                    if (currentPoint.point[0] < prevPoint.point[0]) {
+                        rot += 180;
+                    }
+                    matrixHelper.rotate(-rot * Math.PI / 180);
+                }
+                matrixHelper.translate(xPathPos, yPathPos, 0);
+                currentLength -= alignment[0]*letters[i].an/200;
+                if(letters[i+1] && ind !== letters[i+1].ind){
+                    currentLength += letters[i].an / 2;
+                    currentLength += documentData.tr/1000*documentData.finalSize;
+                }
+            }else{
+
+                matrixHelper.translate(xPos,yPos,0);
+
+                if(documentData.ps){
+                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
+                }
+                switch(documentData.j){
+                    case 1:
+                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
+                        break;
+                    case 2:
+                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
+                        break;
+                }
+                matrixHelper.translate(0,-documentData.ls);
+                matrixHelper.translate(offf,0,0);
+                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
+                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
+            }
+            if(renderType === 'html'){
+                letterM = matrixHelper.toCSS();
+            }else if(renderType === 'svg'){
+                letterM = matrixHelper.to2dCSS();
+            }else{
+                letterP = [matrixHelper.props[0],matrixHelper.props[1],matrixHelper.props[2],matrixHelper.props[3],matrixHelper.props[4],matrixHelper.props[5],matrixHelper.props[6],matrixHelper.props[7],matrixHelper.props[8],matrixHelper.props[9],matrixHelper.props[10],matrixHelper.props[11],matrixHelper.props[12],matrixHelper.props[13],matrixHelper.props[14],matrixHelper.props[15]];
+            }
+            letterO = elemOpacity;
+        }
+
+        if(renderedLettersCount <= i) {
+            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
+            this.renderedLetters.push(letterValue);
+            renderedLettersCount += 1;
+            this.lettersChangedFlag = true;
+        } else {
+            letterValue = this.renderedLetters[i];
+            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+        }
+    }
+};
+
+TextAnimatorProperty.prototype.getValue = function(){
+	if(this._elem.globalData.frameId === this._frameId){
+        return;
+    }
+    this._frameId = this._elem.globalData.frameId;
+    this.iterateDynamicProperties();
+};
+
+TextAnimatorProperty.prototype.mHelper = new Matrix();
+TextAnimatorProperty.prototype.defaultPropsArray = [];
+extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
\ No newline at end of file
diff --git a/player/js/utils/text/TextProperty.js b/player/js/utils/text/TextProperty.js
new file mode 100644
index 0000000..9bec2f2
--- /dev/null
+++ b/player/js/utils/text/TextProperty.js
@@ -0,0 +1,454 @@
+function TextProperty(elem, data){
+	this._frameId = initialDefaultFrame;
+	this.pv = '';
+	this.v = '';
+	this.kf = false;
+	this._isFirstFrame = true;
+	this._mdf = false;
+	this.data = data;
+	this.elem = elem;
+    this.comp = this.elem.comp;
+	this.keysIndex = -1;
+    this.canResize = false;
+    this.minimumFontSize = 1;
+    this.effectsSequence = [];
+	this.currentData = {
+		ascent: 0,
+        boxWidth: this.defaultBoxWidth,
+        f: '',
+        fStyle: '',
+        fWeight: '',
+        fc: '',
+        j: '',
+        justifyOffset: '',
+        l: [],
+        lh: 0,
+        lineWidths: [],
+        ls: '',
+        of: '',
+        s: '',
+        sc: '',
+        sw: 0,
+        t: 0,
+        tr: 0,
+        sz:0,
+        ps:null,
+        fillColorAnim: false,
+        strokeColorAnim: false,
+        strokeWidthAnim: false,
+        yOffset: 0,
+        finalSize:0,
+        finalText:[],
+        finalLineHeight: 0,
+        __test: true
+
+	};
+    this.copyFromDocumentData(this.data.d.k[0].s);
+    
+    if(!this.searchProperty()) {
+        this.completeTextData(this.currentData);
+        this.keysIndex = 0;
+    }
+}
+
+TextProperty.prototype.defaultBoxWidth = [0,0];
+
+TextProperty.prototype.copyFromDocumentData = function(data) {
+    for(var s in data) {
+        this.currentData[s] = data[s];
+    }
+}
+
+TextProperty.prototype.setCurrentData = function(data, currentTextValue){
+        if(this.currentData !== data) {
+            if(!data.__complete) {
+                this.completeTextData(data);
+            }
+            this.copyFromDocumentData(data);
+            this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+            this.currentData.fillColorAnim = data.fillColorAnim || this.currentData.fillColorAnim;
+            this.currentData.strokeColorAnim = data.strokeColorAnim || this.currentData.strokeColorAnim;
+            this.currentData.strokeWidthAnim = data.strokeWidthAnim || this.currentData.strokeWidthAnim;
+            this._mdf = true;
+        } else if(currentTextValue !== this.currentData.t) {
+            this._mdf = true;
+            this.completeTextData(data);
+        }
+		/*var currentData = this.currentData;
+        currentData.ascent = data.ascent;
+        currentData.boxWidth = data.boxWidth ? data.boxWidth : currentData.boxWidth;
+        currentData.f = data.f;
+        currentData.fStyle = data.fStyle;
+        currentData.fWeight = data.fWeight;
+        currentData.fc = data.fc;
+        currentData.j = data.j;
+        currentData.justifyOffset = data.justifyOffset;
+        currentData.l = data.l;
+        currentData.lh = data.lh;
+        currentData.lineWidths = data.lineWidths;
+        currentData.ls = data.ls;
+        currentData.of = data.of;
+        currentData.s = data.s;
+        currentData.sc = data.sc;
+        currentData.sw = data.sw;
+        currentData.sz = data.sz;
+        currentData.ps = data.ps;
+        currentData.t = data.t;
+        currentData.tr = data.tr;
+        currentData.fillColorAnim = data.fillColorAnim || currentData.fillColorAnim;
+        currentData.strokeColorAnim = data.strokeColorAnim || currentData.strokeColorAnim;
+        currentData.strokeWidthAnim = data.strokeWidthAnim || currentData.strokeWidthAnim;
+        currentData.yOffset = data.yOffset;
+        currentData.finalSize = data.finalSize;
+        currentData.finalLineHeight = data.finalLineHeight;
+        currentData.finalText = data.finalText;*/
+};
+
+TextProperty.prototype.searchProperty = function() {
+    return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function() {
+    this.kf = this.data.d.k.length > 1;
+    if(this.kf) {
+        this.addEffect(this.getKeyframeValue.bind(this));
+    }
+    return this.kf;
+}
+
+TextProperty.prototype.addEffect = function(effectFunction) {
+	this.effectsSequence.push(effectFunction);
+    this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function(_finalValue) {
+    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+        return;
+    }
+    var currentTextValue = this.currentData.t;        
+    if(this.lock) {
+        this.setCurrentData(this.currentData, currentTextValue);
+        return;
+    }
+    this.lock = true;
+    this._mdf = false;
+    var multipliedValue;
+    var i, len = this.effectsSequence.length;
+    var finalValue = _finalValue || this.currentData;
+    for(i = 0; i < len; i += 1) {
+        finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setCurrentData(finalValue, currentTextValue);
+    this.pv = this.v = this.currentData;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+}
+
+TextProperty.prototype.getKeyframeValue = function(currentValue) {
+    var textKeys = this.data.d.k, textDocumentData;
+    var frameNum = this.elem.comp.renderedFrame;
+    var i = 0, len = textKeys.length;
+    while(i <= len - 1) {
+        textDocumentData = textKeys[i].s;
+        if(i === len - 1 || textKeys[i+1].t > frameNum){
+            break;
+        }
+        i += 1;
+    }
+    if(this.keysIndex !== i) {
+        currentValue = textDocumentData;
+        this.keysIndex = i;
+    }
+    return currentValue;
+};
+
+TextProperty.prototype.buildFinalText = function(text) {
+    var combinedCharacters = FontManager.getCombinedCharacterCodes();
+    var charactersArray = [];
+    var i = 0, len = text.length;
+    while (i < len) {
+        if (combinedCharacters.indexOf(text.charCodeAt(i)) !== -1) {
+            charactersArray[charactersArray.length - 1] += text.charAt(i);
+        } else {
+            charactersArray.push(text.charAt(i));
+        }
+        i += 1;
+    }
+    return charactersArray;
+}
+
+TextProperty.prototype.completeTextData = function(documentData) {
+    documentData.__complete = true;
+    var fontManager = this.elem.globalData.fontManager;
+    var data = this.data;
+    var letters = [];
+    var i, len;
+    var newLineFlag, index = 0, val;
+    var anchorGrouping = data.m.g;
+    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
+    var lineWidth = 0;
+    var maxLineWidth = 0;
+    var j, jLen;
+    var fontData = fontManager.getFontByName(documentData.f);
+    var charData, cLength = 0;
+    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
+
+    var fWeight = 'normal', fStyle = 'normal';
+    len = styles.length;
+    var styleName;
+    for(i=0;i<len;i+=1){
+        styleName = styles[i].toLowerCase();
+        switch(styleName) {
+            case 'italic':
+            fStyle = 'italic';
+            break;
+            case 'bold':
+            fWeight = '700';
+            break;
+            case 'black':
+            fWeight = '900';
+            break;
+            case 'medium':
+            fWeight = '500';
+            break;
+            case 'regular':
+            case 'normal':
+            fWeight = '400';
+            break;
+            case 'light':
+            case 'thin':
+            fWeight = '200';
+            break;
+        }
+    }
+    documentData.fWeight = fontData.fWeight || fWeight;
+    documentData.fStyle = fStyle;
+    len = documentData.t.length;
+    documentData.finalSize = documentData.s;
+    documentData.finalText = this.buildFinalText(documentData.t);
+    documentData.finalLineHeight = documentData.lh;
+    var trackingOffset = documentData.tr/1000*documentData.finalSize;
+    if(documentData.sz){
+        var flag = true;
+        var boxWidth = documentData.sz[0];
+        var boxHeight = documentData.sz[1];
+        var currentHeight, finalText;
+        while(flag) {
+            finalText = this.buildFinalText(documentData.t);
+            currentHeight = 0;
+            lineWidth = 0;
+            len = finalText.length;
+            trackingOffset = documentData.tr/1000*documentData.finalSize;
+            var lastSpaceIndex = -1;
+            for(i=0;i<len;i+=1){
+                newLineFlag = false;
+                if(finalText[i] === ' '){
+                    lastSpaceIndex = i;
+                }else if(finalText[i].charCodeAt(0) === 13){
+                    lineWidth = 0;
+                    newLineFlag = true;
+                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
+                }
+                if(fontManager.chars){
+                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
+                }else{
+                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
+                }
+                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
+                    if(lastSpaceIndex === -1){
+                        len += 1;
+                    } else {
+                        i = lastSpaceIndex;
+                    }
+                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
+                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
+                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+                    lastSpaceIndex = -1;
+                    lineWidth = 0;
+                }else {
+                    lineWidth += cLength;
+                    lineWidth += trackingOffset;
+                }
+            }
+            currentHeight += fontData.ascent*documentData.finalSize/100;
+            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+                documentData.finalSize -= 1;
+                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
+            } else {
+                documentData.finalText = finalText;
+                len = documentData.finalText.length;
+                flag = false;
+            }
+        }
+
+    }
+    lineWidth = - trackingOffset;
+    cLength = 0;
+    var uncollapsedSpaces = 0;
+    var currentChar;
+    for (i = 0;i < len ;i += 1) {
+        newLineFlag = false;
+        currentChar = documentData.finalText[i];
+        if(currentChar === ' '){
+            val = '\u00A0';
+        }else if(currentChar.charCodeAt(0) === 13){
+            uncollapsedSpaces = 0;
+            lineWidths.push(lineWidth);
+            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+            lineWidth = - 2 * trackingOffset;
+            val = '';
+            newLineFlag = true;
+            currentLine += 1;
+        }else{
+            val = documentData.finalText[i];
+        }
+        if(fontManager.chars){
+            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
+        }else{
+            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+        }
+
+        //
+        if(currentChar === ' '){
+            uncollapsedSpaces += cLength + trackingOffset;
+        } else {
+            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+            uncollapsedSpaces = 0;
+        }
+        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
+        if(anchorGrouping == 2){
+            currentSize += cLength;
+            if(val === '' || val === '\u00A0' || i === len - 1){
+                if(val === '' || val === '\u00A0'){
+                    currentSize -= cLength;
+                }
+                while(currentPos<=i){
+                    letters[currentPos].an = currentSize;
+                    letters[currentPos].ind = index;
+                    letters[currentPos].extra = cLength;
+                    currentPos += 1;
+                }
+                index += 1;
+                currentSize = 0;
+            }
+        }else if(anchorGrouping == 3){
+            currentSize += cLength;
+            if(val === '' || i === len - 1){
+                if(val === ''){
+                    currentSize -= cLength;
+                }
+                while(currentPos<=i){
+                    letters[currentPos].an = currentSize;
+                    letters[currentPos].ind = index;
+                    letters[currentPos].extra = cLength;
+                    currentPos += 1;
+                }
+                currentSize = 0;
+                index += 1;
+            }
+        }else{
+            letters[index].ind = index;
+            letters[index].extra = 0;
+            index += 1;
+        }
+    }
+    documentData.l = letters;
+    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+    lineWidths.push(lineWidth);
+    if(documentData.sz){
+        documentData.boxWidth = documentData.sz[0];
+        documentData.justifyOffset = 0;
+    }else{
+        documentData.boxWidth = maxLineWidth;
+        switch(documentData.j){
+            case 1:
+                documentData.justifyOffset = - documentData.boxWidth;
+                break;
+            case 2:
+                documentData.justifyOffset = - documentData.boxWidth/2;
+                break;
+            default:
+                documentData.justifyOffset = 0;
+        }
+    }
+    documentData.lineWidths = lineWidths;
+
+    var animators = data.a, animatorData, letterData;
+    jLen = animators.length;
+    var based, ind, indexes = [];
+    for(j=0;j<jLen;j+=1){
+        animatorData = animators[j];
+        if(animatorData.a.sc){
+            documentData.strokeColorAnim = true;
+        }
+        if(animatorData.a.sw){
+            documentData.strokeWidthAnim = true;
+        }
+        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
+            documentData.fillColorAnim = true;
+        }
+        ind = 0;
+        based = animatorData.s.b;
+        for(i=0;i<len;i+=1){
+            letterData = letters[i];
+            letterData.anIndexes[j] = ind;
+            if((based == 1 && letterData.val !== '') || (based == 2 && letterData.val !== '' && letterData.val !== '\u00A0') || (based == 3 && (letterData.n || letterData.val == '\u00A0' || i == len - 1)) || (based == 4 && (letterData.n || i == len - 1))){
+                if(animatorData.s.rn === 1){
+                    indexes.push(ind);
+                }
+                ind += 1;
+            }
+        }
+        data.a[j].s.totalChars = ind;
+        var currentInd = -1, newInd;
+        if(animatorData.s.rn === 1){
+            for(i = 0; i < len; i += 1){
+                letterData = letters[i];
+                if(currentInd != letterData.anIndexes[j]){
+                    currentInd = letterData.anIndexes[j];
+                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
+                }
+                letterData.anIndexes[j] = newInd;
+            }
+        }
+    }
+    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
+    documentData.ls = documentData.ls || 0;
+    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+};
+
+TextProperty.prototype.updateDocumentData = function(newData, index) {
+	index = index === undefined 
+    ? this.keysIndex === -1 
+        ? 0 
+        : this.keysIndex 
+    : index;
+    var dData = this.data.d.k[index].s;
+    for(var s in newData) {
+        dData[s] = newData[s];
+    }
+    this.recalculate(index);
+};
+
+TextProperty.prototype.recalculate = function(index) {
+    var dData = this.data.d.k[index].s;
+    dData.__complete = false;
+    this.keysIndex = this.kf ? -1 : 0;
+    this._isFirstFrame = true;
+    this.getValue(dData);
+}
+
+TextProperty.prototype.canResizeFont = function(_canResize) {
+    this.canResize = _canResize;
+    this.recalculate(this.keysIndex);
+};
+
+TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
+    this.minimumFontSize = Math.floor(_fontValue) || 1;
+    this.recalculate(this.keysIndex);
+};
diff --git a/player/js/utils/text/TextSelectorProperty.js b/player/js/utils/text/TextSelectorProperty.js
new file mode 100644
index 0000000..70f0cfc
--- /dev/null
+++ b/player/js/utils/text/TextSelectorProperty.js
@@ -0,0 +1,136 @@
+var TextSelectorProp = (function(){
+    var max = Math.max;
+    var min = Math.min;
+    var floor = Math.floor;
+
+    function TextSelectorProp(elem,data){
+        this._currentTextLength = -1;
+        this.k = false;
+        this.data = data;
+        this.elem = elem;
+        this.comp = elem.comp;
+        this.finalS = 0;
+        this.finalE = 0;
+        this.initDynamicPropertyContainer(elem);
+        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
+        if('e' in data){
+            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
+        }else{
+            this.e = {v:100};
+        }
+        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
+        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
+        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
+        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
+        if(!this.dynamicProperties.length){
+            this.getValue();
+        }
+    }
+
+    TextSelectorProp.prototype = {
+        getMult: function(ind) {
+            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+                this.getValue();
+            }
+            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+            var easer = BezierFactory.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get;
+            var mult = 0;
+            var s = this.finalS;
+            var e = this.finalE;
+            var type = this.data.sh;
+            if(type == 2){
+                if(e === s){
+                    mult = ind >= e ? 1 : 0;
+                }else{
+                    mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
+                }
+                mult = easer(mult);
+            }else if(type == 3){
+                if(e === s){
+                    mult = ind >= e ? 0 : 1;
+                }else{
+                    mult = 1 - max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
+                }
+
+                mult = easer(mult);
+            }else if(type == 4){
+                if(e === s){
+                    mult = 0;
+                }else{
+                    mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1));
+                    if(mult<0.5){
+                        mult *= 2;
+                    }else{
+                        mult = 1 - 2*(mult-0.5);
+                    }
+                }
+                mult = easer(mult);
+            }else if(type == 5){
+                if(e === s){
+                    mult = 0;
+                }else{
+                    var tot = e - s;
+                    /*ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
+                    ind = min(max(0,ind+0.5-s),e-s);
+                    var x = -tot/2+ind;
+                    var a = tot/2;
+                    mult = Math.sqrt(1 - (x*x)/(a*a));
+                }
+                mult = easer(mult);
+            }else if(type == 6){
+                if(e === s){
+                    mult = 0;
+                }else{
+                    ind = min(max(0,ind+0.5-s),e-s);
+                    mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind)/(e-s)))))/2;
+                    /*
+                     ind = Math.min(Math.max(s,ind),e-1);
+                     mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind-s)/(e-1-s)))))/2;
+                     mult = Math.max(mult,(1/(e-1-s))/(e-1-s));*/
+                }
+                mult = easer(mult);
+            }else {
+                if(ind >= floor(s)){
+                    if(ind-s < 0){
+                        mult = 1 - (s - ind);
+                    }else{
+                        mult = max(0,min(e-ind,1));
+                    }
+                }
+                mult = easer(mult);
+            }
+            return mult*this.a.v;
+        },
+        getValue: function(newCharsFlag) {
+            this.iterateDynamicProperties();
+            this._mdf = newCharsFlag || this._mdf;
+            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+            if(newCharsFlag && this.data.r === 2) {
+                this.e.v = this._currentTextLength;
+            }
+            var divisor = this.data.r === 2 ? 1 : 100 / this._currentTextLength;
+            var o = this.o.v/divisor;
+            var s = this.s.v/divisor + o;
+            var e = (this.e.v/divisor) + o;
+            if(s>e){
+                var _s = s;
+                s = e;
+                e = _s;
+            }
+            this.finalS = s;
+            this.finalE = e;
+        }
+    }
+    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
+
+    function getTextSelectorProp(elem, data,arr) {
+        return new TextSelectorProp(elem, data, arr);
+    }
+
+    return {
+        getTextSelectorProp: getTextSelectorProp
+    };
+}());
+
+    
\ No newline at end of file
diff --git a/player/js/utils/text_helper.js b/player/js/utils/text_helper.js
deleted file mode 100644
index 612315f..0000000
--- a/player/js/utils/text_helper.js
+++ /dev/null
@@ -1,404 +0,0 @@
-var TextData_Helper = (function(){
-    var ob = {};
-    var matrixHelper = new Matrix();
-
-
-
-    function getMult(ind,s,e,ne,xe,type){
-        var easer = bez.getEasingCurve(ne/100,0,1-xe/100,1);
-        var mult = 0;
-        if(type == 2){
-            if(e === s){
-                mult = ind >= e ? 1 : 0;
-            }else{
-                mult = Math.max(0,Math.min(0.5/(e-s) + (ind-s)/(e-s),1));
-            }
-            mult = easer('',mult,0,1,1);
-        }else if(type == 3){
-            if(e === s){
-                mult = ind >= e ? 0 : 1;
-            }else{
-                mult = 1 - Math.max(0,Math.min(0.5/(e-s) + (ind-s)/(e-s),1));
-            }
-
-            mult = easer('',mult,0,1,1);
-        }else if(type == 4){
-            if(e === s){
-                mult = ind >= e ? 0 : 1;
-            }else{
-                mult = Math.max(0,Math.min(0.5/(e-s) + (ind-s)/(e-s),1));
-                if(mult<.5){
-                    mult *= 2;
-                }else{
-                    mult = 1 - mult;
-                }
-            }
-        }else {
-            if(ind >= Math.floor(s)){
-                if(ind-s < 0){
-                    mult = 1 - (s - ind);
-                }else{
-                    mult = Math.max(0,Math.min(e-ind,1));
-                }
-            }
-        }
-        return mult;
-    }
-
-    function LetterProps(o,sw,sc,fc,m,p){
-        this.o = o;
-        this.sw = sw;
-        this.sc = sc;
-        this.fc = fc;
-        this.m = m;
-        this.props = p;
-    }
-
-    function getMeasures(data, num, renderType){
-        var xPos,yPos;
-        var i, len;
-        var documentData = data.t.d;
-        var letters = documentData.l;
-        if('m' in data.t.p) {
-            var mask = data.masksProperties[data.t.p.m];
-            var paths = mask.paths[num].pathNodes;
-            var pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths.v.length - 1;
-            var pathData;
-
-            for (i = 0; i < len; i += 1) {
-                pathData = {
-                    s: paths.v[i],
-                    e: paths.v[i + 1],
-                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
-                    ti: [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]
-                };
-                bez.buildBezierData(pathData);
-                pathInfo.tLength += pathData.bezierData.segmentLength;
-                pathInfo.segments.push(pathData);
-            }
-            i = len;
-            if (mask.cl) {
-                pathData = {
-                    s: paths.v[i],
-                    e: paths.v[0],
-                    to: [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]],
-                    ti: [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]
-                };
-                bez.buildBezierData(pathData);
-                pathInfo.tLength += pathData.bezierData.segmentLength;
-                pathInfo.segments.push(pathData);
-            }
-
-            var currentLength = data.renderedData[num].t.p[0], segmentInd = 0, pointInd = 1, currentPoint, prevPoint, points;
-            var segmentLength = 0, flag = true;
-            var segments = pathInfo.segments;
-            if (currentLength < 0 && mask.cl) {
-                if (pathInfo.tLength < Math.abs(currentLength)) {
-                    currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-                }
-                segmentInd = segments.length - 1;
-                points = segments[segmentInd].bezierData.points;
-                pointInd = points.length - 1;
-                while (currentLength < 0) {
-                    currentLength += points[pointInd].partialLength;
-                    pointInd -= 1;
-                    if (pointInd < 0) {
-                        segmentInd -= 1;
-                        points = segments[segmentInd].bezierData.points;
-                        pointInd = points.length - 1;
-                    }
-                }
-
-            }
-            points = segments[segmentInd].bezierData.points;
-            prevPoint = points[pointInd - 1];
-            currentPoint = points[pointInd];
-            var partialLength = currentPoint.partialLength;
-            var perc, tanAngle;
-        }
-
-
-        len = letters.length;
-        xPos = 0;
-        yPos = 0;
-        var yOff = data.t.d.s*1.2*.714;
-        var firstLine = true;
-        var renderedData = data.renderedData[num].t, animatorProps;
-        var j, jLen;
-        var lettersValue = new Array(len), letterValue, lettersChangedFlag = false;
-
-        jLen = renderedData.a.length;
-        var ranges = [], totalChars, divisor;
-        var lastLetters = data._letters, lastLetter;
-        for(j=0;j<jLen;j+=1){
-            totalChars = data.t.a[j].totalChars;
-            divisor = data.t.a[j].s.r === 2 ? 1 : 100/totalChars;
-            if(!('e' in renderedData.a[j].s)){
-                renderedData.a[j].s.e = data.t.a[j].s.r === 2 ? totalChars : 100;
-            }
-            var o = renderedData.a[j].s.o/divisor;
-            if(o === 0 && renderedData.a[j].s.s === 0 && renderedData.a[j].s.e === divisor){
-
-            }
-            var s = renderedData.a[j].s.s/divisor + o;
-            var e = (renderedData.a[j].s.e/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            ranges.push({s:s,e:e,ne:renderedData.a[j].s.ne,xe:renderedData.a[j].s.xe});
-        }
-
-        var mult, ind = -1, offf, xPathPos, yPathPos;
-        var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd;
-        var elemOpacity;
-        var sc,sw,fc,k;
-        var lineLength = 0;
-        var letterSw,letterSc,letterFc,letterM,letterP,letterO;
-
-        for( i = 0; i < len; i += 1) {
-            matrixHelper.reset();
-            switch(documentData.j){
-                case 1:
-                    matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0);
-                    break;
-                case 2:
-                    matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0);
-                    break;
-            }
-            elemOpacity = 1;
-            if(letters[i].n) {
-                xPos = 0;
-                yPos += documentData.yOffset;
-                yPos += firstLine ? 1 : 0;
-                currentLength = initPathPos ;
-                firstLine = false;
-                lineLength = 0;
-                if('m' in data.t.p) {
-                    segmentInd = initSegmentInd;
-                    pointInd = initPointInd;
-                    points = segments[segmentInd].bezierData.points;
-                    prevPoint = points[pointInd - 1];
-                    currentPoint = points[pointInd];
-                    partialLength = currentPoint.partialLength;
-                    segmentLength = 0;
-                }
-                lettersValue[i] = emptyProp;
-            }else{
-                if('m' in data.t.p) {
-                    if(ind !== letters[i].ind){
-                        if(letters[ind]){
-                            currentLength += letters[ind].extra;
-                        }
-                        currentLength += letters[i].an/2;
-                        ind = letters[i].ind;
-                    }
-                    currentLength += renderedData.m.a[0]*letters[i].an/200;
-                    var animatorOffset = 0;
-                    for(j=0;j<jLen;j+=1){
-                        animatorProps = renderedData.a[j].a;
-                        if ('p' in animatorProps && 's' in ranges[j]) {
-                            mult = getMult(letters[i].anIndexes[j],ranges[j].s,ranges[j].e,ranges[j].ne,ranges[j].xe,data.t.a[j].s.sh);
-
-                            animatorOffset += animatorProps.p[0] * mult;
-                        }
-                    }
-
-                    flag = true;
-                    while (flag) {
-                        if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                            matrixHelper.translate(xPathPos,yPathPos);
-                            if (data.t.p.p) {
-                                tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                                var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                                if (currentPoint.point[0] < prevPoint.point[0]) {
-                                    rot += 180;
-                                }
-                                matrixHelper.rotate(rot*Math.PI/180);
-                            }
-                            matrixHelper.translate(0,(renderedData.m.a[1]*yOff/100 + yPos));
-                            flag = false;
-                        } else if (points) {
-                            segmentLength += currentPoint.partialLength;
-                            pointInd += 1;
-                            if (pointInd >= points.length) {
-                                pointInd = 0;
-                                segmentInd += 1;
-                                if (!segments[segmentInd]) {
-                                    if (mask.cl) {
-                                        pointInd = 0;
-                                        segmentInd = 0;
-                                        points = segments[segmentInd].bezierData.points;
-                                    } else {
-                                        points = null;
-                                    }
-                                } else {
-                                    points = segments[segmentInd].bezierData.points;
-                                }
-                            }
-                            if (points) {
-                                prevPoint = currentPoint;
-                                currentPoint = points[pointInd];
-                                partialLength = currentPoint.partialLength;
-                            }
-                        }
-                    }
-                    offf = letters[i].an/2 - letters[i].add;
-                }else{
-                    matrixHelper.translate(xPos,yPos);
-                    offf = letters[i].an/2 - letters[i].add;
-                    matrixHelper.translate(offf,0);
-
-                    matrixHelper.translate(renderedData.m.a[0]*letters[i].an/200, renderedData.m.a[1]*yOff/100);
-                }
-
-                lineLength += letters[i].l/2;
-                for(j=0;j<jLen;j+=1){
-                    animatorProps = renderedData.a[j].a;
-                    if ('t' in animatorProps && 's' in ranges[j]) {
-                        mult = getMult(letters[i].anIndexes[j],ranges[j].s,ranges[j].e,ranges[j].ne,ranges[j].xe,data.t.a[j].s.sh);
-                        if('m' in data.t.p) {
-                            currentLength += animatorProps.t*mult;
-                        }else{
-                            xPos += animatorProps.t*mult;
-                        }
-                    }
-                }
-                lineLength += letters[i].l/2;
-
-                for(j=0;j<jLen;j+=1){
-                    animatorProps = renderedData.a[j].a;
-                    if ('p' in animatorProps && 's' in ranges[j]) {
-                        mult = getMult(letters[i].anIndexes[j],ranges[j].s,ranges[j].e,ranges[j].ne,ranges[j].xe,data.t.a[j].s.sh);
-                        if('m' in data.t.p) {
-                            matrixHelper.translate(0, animatorProps.p[1] * mult);
-                        }else{
-                            matrixHelper.translate(animatorProps.p[0] * mult, animatorProps.p[1] * mult);
-                        }
-                    }
-                }
-                if(documentData.strokeWidthAnim) {
-                    sw = data.t.d.sw || 0;
-                }
-                if(documentData.strokeColorAnim) {
-                    if(data.t.d.sc){
-                        sc = [data.t.d.sc[0], data.t.d.sc[1], data.t.d.sc[2]];
-                    }else{
-                        sc = [0,0,0];
-                    }
-                }
-                if(documentData.fillColorAnim) {
-                    fc = [data.t.d.fc[0], data.t.d.fc[1], data.t.d.fc[2]];
-                }
-                for(j=0;j<jLen;j+=1) {
-                    animatorProps = renderedData.a[j].a;
-                    mult = getMult(letters[i].anIndexes[j],ranges[j].s,ranges[j].e,ranges[j].ne,ranges[j].xe,data.t.a[j].s.sh);
-                    if ('r' in animatorProps && 's' in ranges[j]) {
-                        matrixHelper.rotate(animatorProps.r*mult*Math.PI/180);
-                    }
-                    if ('o' in animatorProps && 's' in ranges[j]) {
-                        elemOpacity += ((animatorProps.o/100)*mult - elemOpacity)*mult;
-                    }
-                    if (documentData.strokeWidthAnim && 'sw' in animatorProps && 's' in ranges[j]) {
-                        sw += animatorProps.sw*mult;
-                    }
-                    if (documentData.strokeColorAnim && 'sc' in animatorProps && 's' in ranges[j]) {
-                        for(k=0;k<3;k+=1){
-                            sc[k] = Math.round(sc[k] + (animatorProps.sc[k] - sc[k])*mult);
-                        }
-                    }
-                    if (documentData.fillColorAnim && 'fc' in animatorProps && 's' in ranges[j]) {
-                        for(k=0;k<3;k+=1){
-                            fc[k] = Math.round(fc[k] + (animatorProps.fc[k] - fc[k])*mult);
-                        }
-                    }
-                }
-                if(documentData.strokeWidthAnim){
-                    letterSw = sw < 0 ? 0 : sw;
-                }
-                if(documentData.strokeColorAnim){
-                    letterSc = 'rgb('+sc[0]+','+sc[1]+','+sc[2]+')';
-                }
-                if(documentData.fillColorAnim){
-                    letterFc = 'rgb('+fc[0]+','+fc[1]+','+fc[2]+')';
-                }
-                for(j=0;j<jLen;j+=1){
-                    animatorProps = renderedData.a[j].a;
-                    if ('s' in animatorProps && 's' in ranges[j]) {
-                        mult = getMult(letters[i].anIndexes[j],ranges[j].s,ranges[j].e,ranges[j].ne,ranges[j].xe,data.t.a[j].s.sh);
-                        matrixHelper.scale(1+((animatorProps.s[0]/100-1)*mult),1+((animatorProps.s[1]/100-1)*mult));
-                    }
-                }
-                for(j=0;j<jLen;j+=1){
-                    animatorProps = renderedData.a[j].a;
-                    if ('a' in animatorProps && 's' in ranges[j]) {
-                        mult = getMult(letters[i].anIndexes[j],ranges[j].s,ranges[j].e,ranges[j].ne,ranges[j].xe,data.t.a[j].s.sh);
-                        matrixHelper.translate(-animatorProps.a[0]*mult, -animatorProps.a[1]*mult);
-                    }
-                }
-
-                if('m' in data.t.p) {
-                    matrixHelper.translate(-renderedData.m.a[0]*letters[i].an/200, -renderedData.m.a[1]*yOff/100);
-                    currentLength -= renderedData.m.a[0]*letters[i].an/200;
-                    if(letters[i+1] && ind !== letters[i+1].ind){
-                        currentLength += letters[i].an / 2;
-                        currentLength += documentData.tr/1000*data.t.d.s;
-                    }
-                    matrixHelper.translate(-offf,0);
-                }else{
-                    matrixHelper.translate(-offf,0);
-                    matrixHelper.translate(-renderedData.m.a[0]*letters[i].an/200,-renderedData.m.a[1]*yOff/100);
-                    xPos += letters[i].l + documentData.tr/1000*data.t.d.s;
-                }
-                if(renderType === 'svg'){
-                    letterM = matrixHelper.toCSS();
-                }else{
-                    letterP = [matrixHelper.props[0],matrixHelper.props[1],matrixHelper.props[2],matrixHelper.props[3],matrixHelper.props[4],matrixHelper.props[5]];
-                }
-                letterO = elemOpacity;
-                if(lastLetters){
-                    lastLetter = lastLetters[i];
-                    if(lastLetter.o !== letterO || lastLetter.sw !== letterSw || lastLetter.sc !== letterSc || lastLetter.fc !== letterFc){
-                        lettersChangedFlag = true;
-                        letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-                    }else{
-                        if(renderType === 'svg' && lastLetter.m !== letterM){
-                            lettersChangedFlag = true;
-                            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM);
-                        }else if(renderType !== 'svg' && (lastLetter.props[1] !== matrixHelper.props[1] || lastLetter.props[2] !== matrixHelper.props[2] || lastLetter.props[3] !== matrixHelper.props[3] || lastLetter.props[4] !== matrixHelper.props[4] || lastLetter.props[5] !== matrixHelper.props[5])){
-                            lettersChangedFlag = true;
-                            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,null,[matrixHelper.props[0],matrixHelper.props[1],matrixHelper.props[2],matrixHelper.props[3],matrixHelper.props[4],matrixHelper.props[5]]);
-                        }else{
-                            letterValue = lastLetter;
-                        }
-                    }
-
-                }else{
-                    lettersChangedFlag = true;
-                    letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-                }
-                lettersValue[i] = letterValue;
-            }
-        }
-        if(lettersChangedFlag){
-            data.renderedData[num].t.l = lettersValue;
-            data._letters = lettersValue;
-        }else{
-            data.renderedData[num].t.l = lastLetters;
-        }
-    }
-
-    var emptyProp = new LetterProps();
-
-    ob.getMeasures = getMeasures;
-
-    return ob;
-}());