var SVGAnim=function(root){SVGAnim.version="1.0";var GarbagePool=function(){this.EMPTY_POOL=[],this.REF_POOL=[]};GarbagePool.prototype.addEmpty=function(t){this.EMPTY_POOL.push(t)},GarbagePool.prototype.addRef=function(t,e){var i,a;for(i=0;i<this.REF_POOL.length;i+=1)if(this.REF_POOL[i].el.id==t.id){for(a=0;a<e.length;a+=1)this.REF_POOL[i].refs.push(e[a]);return}this.REF_POOL.push({el:t,refs:e})},GarbagePool.prototype.purge=function(){this.purgeEmptyPool(),this.purgeRefPool()},GarbagePool.prototype.purgeEmptyPool=function(){var t,e;for(t=this.EMPTY_POOL.length-1;t>-1;t-=1)0===(e=this.EMPTY_POOL[t]).children().length&&(e.remove(),this.EMPTY_POOL.splice(t,1))},GarbagePool.prototype.purgeRefPool=function(){var t,e,i,a;for(t=this.REF_POOL.length-1;t>-1;t-=1)for(a=this.REF_POOL[t],i=0,e=0;e<a.refs.length;e+=1)a.refs[e].removed&&(i+=1),i==a.refs.length&&(a.el.remove(),this.REF_POOL.splice(t,1))};var GP=new GarbagePool,Bitmap=function(t,e,i,a,r,n){var o=this,s=t.el;this.create=function(){var l,h;o.el=t.el.g(),o.id=a,o.el.attr({class:"shape",token:o.id}),o.children=[],o.isMask=!1,o.isMasked=!1,o.mask=null,o.maskTill=null;for(var p=0;p<e.m_data.DOMDocument.Bitmaps.length;p++)if(e.m_data.DOMDocument.Bitmaps[p].charid==i){var m=e.m_data.DOMDocument.Bitmaps[p].bitmapPath,c=t.el.paper.image(m);o.el.add(c)}l=n.split(","),h=new Snap.Matrix(l[0],l[1],l[2],l[3],l[4],l[5]),o.el.transform(h),r&&0!==parseInt(r)?(afterMC=t.getChildById(parseInt(r)),afterMC.isMasked?afterMC.el.parent().before(o.el):afterMC.el.before(o.el)):s.add(o.el)},this.create()},Text=function(t,e,i,a,r,n,o){var s=this,l=t.el;this.create=function(){var o,h,p;for(s.el=t.el.g(),s.id=a,s.el.attr({class:"text",token:s.id}),s.children=[],s.isMask=!1,s.isMasked=!1,s.mask=null,s.maskTill=null,o=0;o<e.m_data.DOMDocument.Text.length;o++)e.m_data.DOMDocument.Text[o].charid==i&&s.addText(e.m_data.DOMDocument.Text[o]);h=n.split(","),p=new Snap.Matrix(h[0],h[1],h[2],h[3],h[4],h[5]),s.el.transform(p),r&&0!==parseInt(r)?(afterMC=t.getChildById(parseInt(r)),afterMC.isMasked?afterMC.el.parent().before(s.el):afterMC.el.before(s.el)):l.add(s.el)},this.addText=function(t){var e,i,a,r,n,l,h,p,m,c,d,u,f;i=s.el.g(),u=o?o.split(","):[0,0,200,100],n=t.behaviour.lineMode,m=t.paras[0].alignment,d="single"==n?"central":"auto",l=t.paras[0].textRun[0].style.fontSize,h=t.paras[0].textRun[0].style.fontName,p=t.paras[0].textRun[0].style.fontColor,letterSpacing=t.paras[0].textRun[0].style.letterSpacing,"left"==m?c="start":"center"==m?c="middle":"right"==m&&(c="end"),f={"text-anchor":c,"dominant-baseline":d,"font-family":h,"font-size":l,"letter-spacing":letterSpacing,fill:p},"false"!==t.behaviour.isBorderDrawn&&(textRect=i.rect(u[0],u[1],u[2],u[3]),textRect.attr({stroke:"black",fill:"transparent"})),"single"==n?(e=i.text(0,0,t.txt),r=parseFloat(u[1])+parseFloat(u[3])/2):(e=s.multiLine(i,t,u,f),r=parseFloat(u[1])-2*parseFloat(t.paras[0].linespacing)),a="left"==m?parseFloat(u[0]):parseFloat(u[0])+parseFloat(u[2])/2,e.attr(f),e.transform("translate("+a+","+r+")")},this.multiLine=function(t,e,i,a){e.txt;for(var r,n,o,s=[],l="",h=parseFloat(i[2]),p=0;p>-1;)l+=e.txt.charAt(p),(n=t.text(0,0,l)).attr(a),(o=n.getBBox()).w>h?(newIndex=l.lastIndexOf(" "),r=l.slice(0,newIndex),s.push(r),p=p-(l.length-r.length)+2,l=""):p+=1,p>=e.txt.length&&(r=l.slice(0,newIndex),s.push(r),p=-1),n.remove();return text=t.text(0,0,s),text.selectAll("tspan").attr({x:0,dy:o.h+parseFloat(e.paras[0].linespacing)}),text},this.create()},Shape=function(t,e,i,a,r,n){var o=this,s=t.el;function l(t,e,i){var a;return(a=o.el.image(t).pattern(0,0,e.width,e.height)).attr({x:i.e,y:i.f}),a}this.create=function(){var l,h,p,m;for(o.el=t.el.g(),o.id=a,o.el.attr({class:"shape",token:o.id}),o.children=[],o.isMask=!1,o.isMasked=!1,o.mask=null,o.maskTill=null,l=0;l<e.m_data.DOMDocument.Shape.length;l++)if(e.m_data.DOMDocument.Shape[l].charid==i)for(h=0;h<e.m_data.DOMDocument.Shape[l].path.length;h++)o.addPath(l,h);p=n.split(","),m=new Snap.Matrix(p[0],p[1],p[2],p[3],p[4],p[5]),o.el.transform(m),r&&0!==parseInt(r)?(afterMC=t.getChildById(parseInt(r)),afterMC.isMasked?afterMC.el.parent().before(o.el):afterMC.el.before(o.el)):s.add(o.el)},this.addPath=function(t,i){var a;shape=o.el.path(),resourcePath=e.m_data.DOMDocument.Shape[t].path[i],a=resourcePath.d,shape.attr({fill:"transparent"}),shape.attr({d:a}),"Fill"==resourcePath.pathType?this.addFill(shape,resourcePath):"Stroke"==resourcePath.pathType&&this.addStroke(shape,resourcePath)},this.getFillColor=function(t){var e;return e=resourcePath.color,"rgba("+parseInt(e.substring(1,3),16)+","+parseInt(e.substring(3,5),16)+","+parseInt(e.substring(5,7),16)+","+resourcePath.colorOpacity+")"},this.getFillImage=function(e){var i,a,r,n;return i=e.patternTransform.split(","),0,a=new Snap.Matrix(i[0],i[1],i[1],i[3],i[4],i[5]),r=e.bitmapPath,(n=t.el.paper.select("defs pattern image"))&&n.attr("href")==r?fillImage=n.parent():fillImage=l(r,e,a),fillImage},this.getFillGradient=function(e,i,a){var r,n,o,s,l,h,p,m,c;for("linear"==i?(l="L(",l+=(r=parseFloat(e.x1))+", ",l+=(n=parseFloat(e.y1))+", ",l+=parseFloat(e.x2)+", ",l+=parseFloat(e.y2)+")"):(r=a.getBBox().x+a.getBBox().width/2+e.cx/10,n=a.getBBox().y+a.getBBox().height/2+e.cy/10,o=a.getBBox().x+a.getBBox().width/2+parseFloat(e.fx),s=a.getBBox().y+a.getBBox().height/2+parseFloat(e.fy),l="R(",l+=r+", ",l+=n+", ",l+=e.r+", ",l+=o+", ",l+=s+")"),h=0;h<e.stop.length;h+=1)m=e.stop[h].stopColor,c=void 0,l+="rgba("+(p=(c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(m))?{r:parseInt(c[1],16),g:parseInt(c[2],16),b:parseInt(c[3],16)}:null).r+","+p.g+","+p.b+","+e.stop[h].stopOpacity+")",l+=":",l+=e.stop[h].offset,h!==e.stop.length-1&&(l+="-");return t.el.paper.gradient(l)},this.addFill=function(t,e){var i,a,r,n,s;e.color&&(i=o.getFillColor(e),t.attr({fill:i})),e.image&&(n=e.image,a=o.getFillImage(n),t.attr({fill:a})),e.linearGradient&&(s=e.linearGradient,r=o.getFillGradient(s,"linear"),t.attr({fill:r})),e.radialGradient&&(s=e.radialGradient,r=o.getFillGradient(s,"radial",t),t.attr({fill:r}))},this.addStroke=function(t,e){var i;e.color&&(clr=e.color,i="rgba("+parseInt(clr.substring(1,3),16)+","+parseInt(clr.substring(3,5),16)+","+parseInt(clr.substring(5,7),16)+","+e.colorOpacity+")",t.attr({stroke:i,strokeWidth:e.strokeWidth}))},this.create()},MovieClip=function(t,e,i,a,r,n){var o,s="movieclip",l="svg"==e.type?e:e.el;a&&(this.id=a),r&&(this.name=r,s+=" "+r),this.el=l.g(),this.el.attr({class:s,token:this.id}),this.transform=n,this.m_timeline=t,this.m_currentFrameNo=0,this.m_frameCount=parseInt(this.m_timeline.frameCount),this._applyMask=!0,this._childIndex=0,this._scripts={},this._labels=[],this.children=[],this.events={},this.isMask=!1,this.isMasked=!1,this.mask=null,this.maskElement=null,this.maskTill=null,this.loops=!0,this.parentMC=null,this.rootMC=this,this.playing=!0,this.resourceManager=i,this.commandList=[],this.matrix=new Snap.Matrix,this.bBox={},void 0!==this.m_timeline.Label&&(this._labels=this.m_timeline.Label),void 0!==this.transform&&(o=this.transform.split(","),this.matrix=new Snap.Matrix(o[0],o[1],o[2],o[3],o[4],o[5]),this.el.transform(this.matrix))};MovieClip.prototype.addChild=function(t,e){e=e||0,this.insertAtIndex(t,e)},MovieClip.prototype._addChild=function(t,e){if(!t.name)do{this._childIndex++,t.name="instance"+this._childIndex}while(null!=this[t.name]);if(this[t.name]=t,t.parentMC=this,t.rootMC=null==this.parentMC?this:this.rootMC,e&&0!==parseInt(e)){var i=this.getChildById(parseInt(e));i.isMasked?i.el.parent().before(t.el):i.el.before(t.el)}else this.el.add(t.el)},MovieClip.prototype.addEventListener=function(t,e){null==this.events[t]&&(this.events[t]=[]),this.events[t].indexOf(e)<0&&this.events[t].push(e)},MovieClip.prototype.removeEventListener=function(t,e){if(null==t)this.events={};else{var i=this.events[t];if(null!=i)if(null==e)delete this.events[t];else{var a=i.indexOf(e);a>-1&&i.splice(a,1)}}},MovieClip.prototype.dispatchEvent=function(t){null==t.bubbles&&(t.bubbles=!0),null==t.stopPropagation&&(t.stopPropagation=!1),null==t.stopImmediatePropagation&&(t.stopImmediatePropagation=!1),null==t.target&&(t.target=this),t.currentTarget=this,null!=this.events[t.name]&&this.events[t.name].every(function(e){return e.apply(this,[t]),t.stopImmediatePropagation}),t.bubbles&&(t.stopPropagation||null==this.parentMC||this.parentMC.dispatchEvent(t))},MovieClip.prototype.getChildById=function(t){var e;for(e=0;e<this.children.length;e+=1)if(this.children[e].id==t)return this.children[e];return null},MovieClip.prototype.getChildIndexById=function(t){var e;for(e=0;e<this.children.length;e+=1)if(this.children[e].id==t)return e;return-1},MovieClip.prototype.removeChildById=function(t){var e;for(e=0;e<this.children.length;e+=1)if(this.children[e].id==t)return this.children.splice(e,1),!0;return!1},MovieClip.prototype.swapChildIndex=function(t,e){var i,a;for(i=0;i<this.children.length;i+=1)if(this.children[i].id==t){a=this.children.splice(i,1);break}for(i=0;i<this.children.length;i+=1)if(this.children[i].id==e){this.children.splice(i+1,0,a[0]);break}},MovieClip.prototype.insertAtIndex=function(t,e){var i;for(this._addChild(t,e),0===parseInt(e)&&this.children.unshift(t),i=0;i<this.children.length;i+=1)if(this.children[i].id==e){this.children.splice(i+1,0,t);break}},MovieClip.prototype.containsMask=function(){var t;for(t=0;t<this.children.length;t+=1)if(this.children[t].isMask)return!0;return!1},MovieClip.prototype.getFrameLabels=function(){return this._labels},MovieClip.prototype.getFrameNum=function(t){if("string"==typeof t){for(var e=this.getFrameLabels(),i=e.length,a=0;a<i;a++)if(t===e[a].name)return parseInt(e[a].frameNum);return-1}return t-1},MovieClip.prototype.getMatrix=function(){return this.matrix?this.matrix:new Snap.Matrix},MovieClip.prototype.getX=function(){var t=0;return this.matrix&&(t=this.matrix.x()),t},MovieClip.prototype.getY=function(){var t=0;return this.matrix&&(t=this.matrix.y()),t},MovieClip.prototype.getPath=function(){return null===this.parentMC?"root":this.parentMC.getPath()+"."+this.name},MovieClip.prototype.getRoot=function(){return null===this.parentMC?this:this.parentMC.getRoot()},MovieClip.prototype.mouseover=function(t){this.el.mouseover(t)},MovieClip.prototype.mouseout=function(t){this.el.mouseout(t)},MovieClip.prototype.mousedown=function(t){this.el.mousedown(t)},MovieClip.prototype.mousemove=function(t){this.el.mousemove(t)},MovieClip.prototype.click=function(t){this.el.click(t)},MovieClip.prototype.executeFrameScript=function(script){eval("(function () {"+script+"}).call(this);")},MovieClip.prototype.removeFrameScript=function(t){delete this._scripts[t]},MovieClip.prototype.addFrameScript=function(t,e){this._scripts[t]=e},MovieClip.prototype.getFrame=function(t){var e;for(e=0;e<this.m_timeline.Frame.length;e+=1)if(this.m_timeline.Frame[e].num==t)return this.m_timeline.Frame[e]},MovieClip.prototype._checkLoop=function(){this.m_currentFrameNo==this.m_frameCount&&this.loops&&this._loop()},MovieClip.prototype._loop=function(){var t,e,i,a;if(this.m_currentFrameNo=0,t=this.getFrame(this.m_currentFrameNo))for(e=t.Command,i=0;i<this.children.length;i+=1){for(a=!1,child=this.children[i],c=0;c<e.length;++c)if(cmdData=e[c],"Place"==cmdData.cmdType&&parseInt(child.id)==parseInt(cmdData.objectId)){a=!0;break}!1===a&&(command=new CMD.RemoveObjectCommand(child.id),this.commandList.push(command))}else this.clearChildren()},MovieClip.prototype.clearChildren=function(){var t,e,i;for(t=0;t<this.children.length;t+=1)e=this.children[t],i=new CMD.RemoveObjectCommand(e.id),this.commandList.push(i)},MovieClip.prototype._animate=function(){var t;for(this.playing&&(this.step_1_animTimeline(),this.step_2_enterFrame(),this.step_4_frameConstructed(),this.step_5_frameScripts(),this.step_6_exitFrame()),t=0;t<this.children.length;t+=1)this.children[t]._animate&&this.children[t]._animate();this._applyMask&&this.containsMask()&&(this._applyMask=!1,(new CMD.ApplyMaskCommand).execute(this,this.resourceManager));this.playing&&1===this.m_frameCount&&this.stop(),this.playing&&this.m_currentFrameNo++,GP.purge()},MovieClip.prototype._runCommands=function(t){var e,i,a;for(e=0;e<t.length;e+=1)switch(a=null,(i=t[e]).cmdType){case"Place":this.getChildById(i.objectId)?(a=new CMD.MoveObjectCommand(i.objectId,i.transformMatrix),this.commandList.push(a),a=new CMD.UpdateObjectCommand(i.objectId,i.placeAfter),this.commandList.push(a)):(a=new CMD.PlaceObjectCommand(i.charid,i.objectId,i.name,i.placeAfter,i.transformMatrix,i.bounds),this.commandList.push(a));break;case"Move":a=new CMD.MoveObjectCommand(i.objectId,i.transformMatrix),this.commandList.push(a);break;case"Remove":a=new CMD.RemoveObjectCommand(i.objectId),this.commandList.push(a);break;case"UpdateZOrder":a=new CMD.UpdateObjectCommand(i.objectId,i.placeAfter),this.commandList.push(a);break;case"UpdateVisibility":a=new CMD.UpdateVisibilityCommand(i.objectId,i.visibility),this.commandList.push(a);break;case"UpdateColorTransform":a=new CMD.UpdateColorTransformCommand(i.objectId,i.colorMatrix),this.commandList.push(a);break;case"UpdateBlendMode":break;case"UpdateMask":a=new CMD.UpdateMaskCommand(i.objectId,i.maskTill),this.commandList.push(a);break;case"AddFrameScript":a=new CMD.AddFrameScriptCommand(i.scriptId,i.script),this.commandList.push(a);break;case"RemoveFrameScript":a=new CMD.RemoveFrameScriptCommand(i.scriptId),this.commandList.push(a);break;case"SetFrameLabel":a=new CMD.SetFrameLabelCommand(i.Name),this.commandList.push(a)}this.containsMask()&&(a=new CMD.ApplyMaskCommand,this.commandList.push(a)),this.executeCommands(this.commandList,this.resourceManager)},MovieClip.prototype.step_1_animTimeline=function(t,e){var i,a;(void 0===t&&(t=!1),void 0===e&&(e=!1),this.playing)&&(this.commandList=[],this._checkLoop(),(a=this.getFrame(this.m_currentFrameNo))&&(i=a.Command,this._runCommands(i)))},MovieClip.prototype.step_2_enterFrame=function(){},MovieClip.prototype.step_3_addPending=function(){},MovieClip.prototype.step_4_frameConstructed=function(){},MovieClip.prototype.step_5_frameScripts=function(){for(var t in this._scripts)this._scripts.hasOwnProperty(t)&&this.executeFrameScript(this._scripts[t])},MovieClip.prototype.step_6_exitFrame=function(){this._scripts={}},MovieClip.prototype.play=function(){this._applyMask=!0,this.playing=!0},MovieClip.prototype.stop=function(){this.playing=!1},MovieClip.prototype.gotoAndStop=function(t){this._gotoAndPlayStop(t,!0)},MovieClip.prototype.gotoAndPlay=function(t){this._gotoAndPlayStop(t,!1)},MovieClip.prototype._gotoAndPlayStop=function(t,e){var i=this.getFrameNum(t);if(i>=0&&i<this.m_frameCount){if(this.play(),this.m_currentFrameNo!=i){var a;for(this.m_currentFrameNo>i&&(this.m_currentFrameNo=0);this.m_currentFrameNo<=i&&(a=this.m_currentFrameNo==i,this._seek(!0,a),!a);)this._scripts={},this.m_currentFrameNo++;this.step_4_frameConstructed(),this.step_5_frameScripts(),this.step_6_exitFrame()}this.playing&&e&&this.stop()}},MovieClip.prototype._seek=function(t,e){this.step_1_animTimeline(t,e);for(var i=0;i<this.children.length;i+=1)this.children[i]._seek&&this.children[i]._seek(t,e)},MovieClip.prototype.executeCommands=function(t,e){var i;for(i=0;i<t.length;i++)void 0!==t[i]&&t[i].execute(this,e)},MovieClip.prototype.log=function(){this.id.indexOf("svg")>-1&&Array.prototype.slice.call(arguments).unshift(this.id.toUpperCase())},MovieClip.prototype.setAlpha=function(t){this.el.node.style.opacity=t};var CMD={};function updateMaskContent(t,e){var i=e.maskElement,a=t.getChildById(e.id);i.clear(),clone=a.el.clone(),clone.attr({visibility:"visible"}),i.append(clone)}CMD.PlaceObjectCommand=function(t,e,i,a,r,n){this.m_charID=t,this.m_objectID=e,this.m_name=i,this.m_placeAfter=a,this.m_transform=r,this.m_bounds=n},CMD.PlaceObjectCommand.prototype.execute=function(t,e){var i,a,r,n,o,s=e.getShape(this.m_charID),l=e.getBitmap(this.m_charID),h=e.getText(this.m_charID);null!=s?(a=new Shape(t,e,this.m_charID,this.m_objectID,this.m_placeAfter,this.m_transform),t.insertAtIndex(a,this.m_placeAfter)):null!=l?(r=new Bitmap(t,e,this.m_charID,this.m_objectID,this.m_placeAfter,this.m_transform),t.insertAtIndex(r,this.m_placeAfter)):null!=h?(i=new Text(t,e,this.m_charID,this.m_objectID,this.m_placeAfter,this.m_transform,this.m_bounds),t.insertAtIndex(i,this.m_placeAfter)):(n=e.getMovieClip(this.m_charID))&&(o=new MovieClip(n,t,e,this.m_objectID,this.m_name,this.m_transform),t.insertAtIndex(o,this.m_placeAfter),o.play())},CMD.MoveObjectCommand=function(t,e){this.m_objectID=t,this.m_transform=e},CMD.MoveObjectCommand.prototype.execute=function(t,e){var i,a;i=this.m_transform.split(","),a=new Snap.Matrix(i[0],i[1],i[2],i[3],i[4],i[5]),child=t.getChildById(this.m_objectID),child.matrix=a,child.el.transform(a)},CMD.UpdateObjectCommand=function(t,e){this.m_objectID=t,this.m_placeAfter=e},CMD.UpdateObjectCommand.prototype.execute=function(t,e){},CMD.RemoveObjectCommand=function(t){this.m_objectID=t},CMD.RemoveObjectCommand.prototype.execute=function(t,e){var i=t.getChildById(this.m_objectID);i&&(i.el.remove(),t.removeChildById(this.m_objectID))},CMD.UpdateVisibilityCommand=function(t,e){this.m_objectID=t,this.m_visibility=e},CMD.UpdateVisibilityCommand.prototype.execute=function(t,e){var i,a;i=t.getChildById(this.m_objectID),a="true"==this.m_visibility?"visible":"hidden",i.el.attr({visibility:a})},CMD.UpdateMaskCommand=function(t,e){this.m_objectID=t,this.m_maskTill=e},CMD.UpdateMaskCommand.prototype.execute=function(t,e){var i,a,r;(i=t.getChildById(this.m_objectID)).isMask=!0,i.maskTill=this.m_maskTill,(a=t.el.mask()).attr("mask-type","alpha"),clone=i.el.clone(),clone.attr({visibility:"visible"}),(r=a.toDefs()).append(clone),i.maskElement=r,i.el.attr({visibility:"hidden"})},CMD.ApplyMaskCommand=function(){},CMD.ApplyMaskCommand.prototype.execute=function(t,e){var i,a,r=!1,n=null,o=null,s=null;for(i=0;i<t.children.length;i+=1)child=t.children[i],child.isMask?(updateMaskContent(t,child),r=!0,n=child,o=child.maskElement,s=child.maskTill,(a=t.el.g()).attr({class:"maskGroup"}),child.el.after(a),a.attr({mask:o}),GP.addEmpty(a),GP.addRef(o,[a]),child.id==child.maskTill&&(r=!1)):r&&(a.prepend(child.el),child.isMasked=!0,child.mask=n.id,child.id==s&&(r=!1,n=null,s=null))},CMD.UpdateColorTransformCommand=function(t,e){this.m_objectID=t,this.m_colorMatrix=e},CMD.UpdateColorTransformCommand.prototype.execute=function(t,e){var i,a;i=t.getChildById(this.m_objectID),a=this.m_colorMatrix.split(",",7),i.el.attr({opacity:parseFloat(a[6])})},CMD.AddFrameScriptCommand=function(t,e){this.m_scriptID=t,this.m_script=e},CMD.AddFrameScriptCommand.prototype.execute=function(t,e){t.addFrameScript(this.m_scriptID,this.m_script)},CMD.RemoveFrameScriptCommand=function(t){this.m_scriptID=t},CMD.RemoveFrameScriptCommand.prototype.execute=function(t,e){t.removeFrameScript(this.m_scriptID)},CMD.SetFrameLabelCommand=function(t){this.m_labelName=t},CMD.SetFrameLabelCommand.prototype.execute=function(t,e){};var ResourceManager=function(t){var e;this.m_shapes=[],this.m_movieClips=[],this.m_bitmaps=[],this.m_text=[],this.m_data=t;for(var i=0;i<this.m_data.DOMDocument.Shape.length;i++)e=this.m_data.DOMDocument.Shape[i].charid,this.m_shapes[e]=this.m_data.DOMDocument.Shape[i];for(var a=0;a<this.m_data.DOMDocument.Bitmaps.length;a++)e=this.m_data.DOMDocument.Bitmaps[a].charid,this.m_bitmaps[e]=this.m_data.DOMDocument.Bitmaps[a];for(var r=0;r<this.m_data.DOMDocument.Text.length;r++)e=this.m_data.DOMDocument.Text[r].charid,this.m_text[e]=this.m_data.DOMDocument.Text[r];if(void 0!==this.m_data.DOMDocument.Timeline)for(var n=0;n<this.m_data.DOMDocument.Timeline.length-1;n++)e=this.m_data.DOMDocument.Timeline[n].charid,this.m_movieClips[e]=this.m_data.DOMDocument.Timeline[n]};function SVGAnim(t,e,i,a,r){var n,o,s,l,h=this;function p(){h.mc._animate(),clearTimeout(s),n&&(s=setTimeout(p,1e3/a))}h.version="1.2.1",l="Snap.svg Animator v"+h.version,a=a||24,e=e||100,i=i||100,o=(r=r||{}).autoplay||!0,n=o,h.debug=!1,SVGAnim.prototype.toString=function(){return l},h.MovieClip=MovieClip,h.resourceManager=new ResourceManager(t),h.s=new Snap(e,i),id=h.s.id,h.s.attr("id",id),h.s.attr("viewBox",r.viewBox||"0 0 "+e+" "+i),h.s.attr("preserveAspectRatio",r.preserveAspectRatio||"xMidYMid meet"),function(e){var i,r,n;void 0!==h.rootAnimator&&h.rootAnimator.dispose();for(h.linkage={},n=t.DOMDocument.Timeline.length-1;n>-1;n-=1){if(void 0===t.DOMDocument.Timeline[n].linkageName){i=n;break}h.linkage[t.DOMDocument.Timeline[n].linkageName]=t.DOMDocument.Timeline[n]}r=h.resourceManager.m_data.DOMDocument.Timeline[i],h.mc=new MovieClip(r,h.s,h.resourceManager,id),s=setTimeout(p,1e3/a)}(h.s),h.debug&&(n=!1,window.addEventListener("keydown",function(t){switch(t.keyCode){case 39:p();break;case 32:h.mc.playing?h.stop():h.play()}})),this.play=function(){h.mc.play(),n=!0},this.stop=function(){h.mc.stop(),n=!1},this.setLoop=function(t){h.mc.loops=t},h.debug&&setInterval(function(){var t=document.getElementById("debug"),e="";t||((t=document.createElement("div")).id="debug",t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="black",t.style.color="white",t.style.padding="1em",document.body.appendChild(t));e+=h.mc.id+"<br/>",e+=h.mc.m_currentFrameNo+"<br/>",function t(i,a){var r,n;for(n=0;n<a.children.length;n+=1){for(r=0;r<i;r+=1)e+="-";e+=a.children[n].id+":"+a.children[n].children.length,a.children[n].isMask&&(e+=" (MASK till:"+a.children[n].maskTill+")"),a.children[n].isMasked&&(e+=" (masked by: "+a.children[n].mask+")"),e+="<br/>",t(i+5,a.children[n])}}(2,h.mc),t.innerHTML=e},100),o?h.play():p()}return ResourceManager.prototype.getShape=function(t){return this.m_shapes[t]},ResourceManager.prototype.getMovieClip=function(t){return this.m_movieClips[t]},ResourceManager.prototype.getBitmap=function(t){return this.m_bitmaps[t]},ResourceManager.prototype.getText=function(t){return this.m_text[t]},window.SVGAnim=SVGAnim,SVGAnim}(window||this);