teleton 0.8.3 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +241 -301
  2. package/dist/{bootstrap-DDFVEMYI.js → bootstrap-SPDT3XBQ.js} +5 -7
  3. package/dist/{chunk-GHMXWAXI.js → chunk-2MZP75SH.js} +72 -202
  4. package/dist/chunk-35X3V6OW.js +139 -0
  5. package/dist/{chunk-LVTKJQ7O.js → chunk-4KURCUWD.js} +1 -1
  6. package/dist/{chunk-XDZDOKIF.js → chunk-5K4YDCVU.js} +1 -1
  7. package/dist/{chunk-7MWKT67G.js → chunk-6U6VA2OT.js} +520 -2187
  8. package/dist/{chunk-OIMAE24Q.js → chunk-7ZXUUDQQ.js} +18 -7
  9. package/dist/{chunk-AERHOXGC.js → chunk-FSL2MOYK.js} +236 -93
  10. package/dist/{chunk-LC4TV3KL.js → chunk-GUX6ZFVF.js} +1 -1
  11. package/dist/{chunk-CUE4UZXR.js → chunk-KYSAHDYE.js} +2 -2
  12. package/dist/{chunk-C4NKJT2Z.js → chunk-L3LPVF4Z.js} +1 -1
  13. package/dist/{chunk-EYWNOHMJ.js → chunk-L653KKCR.js} +1 -0
  14. package/dist/{chunk-ALKAAG4O.js → chunk-LD24DWWE.js} +4 -4
  15. package/dist/{chunk-33Z47EXI.js → chunk-LM6AL6LN.js} +2417 -867
  16. package/dist/chunk-M6M4DCDU.js +942 -0
  17. package/dist/{chunk-35MX4ZUI.js → chunk-PK3TVFBT.js} +2 -2
  18. package/dist/{chunk-2ERTYRHA.js → chunk-Z63KUQX4.js} +37 -13
  19. package/dist/cli/index.js +35 -25
  20. package/dist/{client-5KD25NOP.js → client-G62EZT6U.js} +3 -3
  21. package/dist/harden-permissions-6BLHRCQJ.js +100 -0
  22. package/dist/index.js +14 -14
  23. package/dist/{local-IHKJFQJS.js → local-HQ3UJ7KR.js} +2 -2
  24. package/dist/{memory-QMJRM3XJ.js → memory-BJH724PQ.js} +6 -5
  25. package/dist/{memory-hook-VUNWZ3NY.js → memory-hook-LUAKTXU5.js} +5 -5
  26. package/dist/{migrate-5VBAP52B.js → migrate-C4LBLOZH.js} +6 -5
  27. package/dist/{paths-XA2RJH4S.js → paths-WMVV7ZAJ.js} +1 -1
  28. package/dist/{server-JF6FX772.js → server-4J56HS62.js} +8 -15
  29. package/dist/{server-N4T7E25M.js → server-I6TYJ36S.js} +7 -15
  30. package/dist/{setup-server-IX3BFPPH.js → setup-server-VJ3MGUSM.js} +16 -17
  31. package/dist/{store-BY7S6IFN.js → store-2IGAMTES.js} +7 -6
  32. package/dist/{task-dependency-resolver-L6UUMTHK.js → task-dependency-resolver-CQ432Z7J.js} +1 -1
  33. package/dist/{task-executor-XBNJLUCS.js → task-executor-JELRREUV.js} +1 -1
  34. package/dist/{tool-index-FTERJSZK.js → tool-index-XPCMWBYY.js} +4 -4
  35. package/dist/{transcript-IM7G25OS.js → transcript-OEO3HA4Z.js} +2 -2
  36. package/dist/web/assets/{index-BfYCdwLI.js → index-Dn5ZH1Y6.js} +13 -13
  37. package/dist/web/assets/{index.es-DitvF-9H.js → index.es-eSR4Qv6s.js} +1 -1
  38. package/dist/web/index.html +1 -1
  39. package/package.json +2 -6
  40. package/src/templates/HEARTBEAT.md +5 -0
  41. package/dist/chunk-AEHTQI3H.js +0 -142
  42. package/dist/chunk-FUNF6H4W.js +0 -251
@@ -1,4 +1,4 @@
1
- import{g as getDefaultExportFromCjs,r as reactExports,R as React}from"./index-BfYCdwLI.js";var lottie$2={exports:{}},lottie$1=lottie$2.exports,hasRequiredLottie;function requireLottie(){return hasRequiredLottie||(hasRequiredLottie=1,(function(module,exports$1){typeof document<"u"&&typeof navigator<"u"&&(function(t,e){module.exports=e()})(lottie$1,(function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var r,i=t.length,s;for(r=0;r<i;r+=1){s=t[r].prototype;for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e.prototype[n]=s[n])}}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}var audioControllerFactory=(function(){function t(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(r){this.audios.push(r)},pause:function(){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].pause()},resume:function(){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].resume()},setRate:function(r){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].setRate(r)},createAudio:function(r){return this.audioFactory?this.audioFactory(r):window.Howl?new window.Howl({src:[r]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(r){this.audioFactory=r},setVolume:function(r){this._volume=r,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}})(),createTypedArray=(function(){function t(r,i){var s=0,n=[],a;switch(r){case"int16":case"uint8c":a=1;break;default:a=1.1;break}for(s=0;s<i;s+=1)n.push(a);return n}function e(r,i){return r==="float32"?new Float32Array(i):r==="int16"?new Int16Array(i):r==="uint8c"?new Uint8ClampedArray(i):t(r,i)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:t})();function createSizedArray(t){return Array.apply(null,{length:t})}function _typeof$6(t){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(t)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e,r=t.length;for(e=0;e<r;e+=1)BMMath[t[e]]=Math[t[e]]})(),BMMath.random=Math.random,BMMath.abs=function(t){var e=_typeof$6(t);if(e==="object"&&t.length){var r=createSizedArray(t.length),i,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;function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-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 BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}var createElementID=(function(){var t=0;return function(){return t+=1,idPrefix$1+"__lottie_element_"+t}})();function HSVtoRGB(t,e,r){var i,s,n,a,h,o,f,d;switch(a=Math.floor(t*6),h=t*6-a,o=r*(1-e),f=r*(1-h*e),d=r*(1-(1-h)*e),a%6){case 0:i=r,s=d,n=o;break;case 1:i=f,s=r,n=o;break;case 2:i=o,s=r,n=d;break;case 3:i=o,s=f,n=r;break;case 4:i=d,s=o,n=r;break;case 5:i=r,s=o,n=f;break}return[i,s,n]}function RGBtoHSV(t,e,r){var i=Math.max(t,e,r),s=Math.min(t,e,r),n=i-s,a,h=i===0?0:n/i,o=i/255;switch(i){case s:a=0;break;case t:a=e-r+n*(e<r?6:0),a/=6*n;break;case e:a=r-t+n*2,a/=6*n;break;case r:a=t-e+n*4,a/=6*n;break}return[a,h,o]}function addSaturationToRGB(t,e){var r=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);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(t[0]*255,t[1]*255,t[2]*255);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(t[0]*255,t[1]*255,t[2]*255);return r[0]+=e/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=(function(){var t=[],e,r;for(e=0;e<256;e+=1)r=e.toString(16),t[e]=r.length===1?"0"+r:r;return function(i,s,n){return i<0&&(i=0),s<0&&(s=0),n<0&&(n=0),"#"+t[i]+t[s]+t[n]}})(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=(function(){var t=1,e=[],r,i,s={onmessage:function(){},postMessage:function(b){r({data:b})}},n={postMessage:function(b){s.onmessage({data:b})}};function a(c){if(window.Worker&&window.Blob&&getWebWorker()){var b=new Blob(["var _workerSelf = self; self.onmessage = ",c.toString()],{type:"text/javascript"}),v=URL.createObjectURL(b);return new Worker(v)}return r=c,s}function h(){i||(i=a(function(b){function v(){function C(I,_){var T,g,P=I.length,k,M,V,D;for(g=0;g<P;g+=1)if(T=I[g],"ks"in T&&!T.completed){if(T.completed=!0,T.hasMask){var B=T.masksProperties;for(M=B.length,k=0;k<M;k+=1)if(B[k].pt.k.i)E(B[k].pt.k);else for(D=B[k].pt.k.length,V=0;V<D;V+=1)B[k].pt.k[V].s&&E(B[k].pt.k[V].s[0]),B[k].pt.k[V].e&&E(B[k].pt.k[V].e[0])}T.ty===0?(T.layers=l(T.refId,_),C(T.layers,_)):T.ty===4?y(T.shapes):T.ty===5&&O(T)}}function p(I,_){if(I){var T=0,g=I.length;for(T=0;T<g;T+=1)I[T].t===1&&(I[T].data.layers=l(I[T].data.refId,_),C(I[T].data.layers,_))}}function u(I,_){for(var T=0,g=_.length;T<g;){if(_[T].id===I)return _[T];T+=1}return null}function l(I,_){var T=u(I,_);return T?T.layers.__used?JSON.parse(JSON.stringify(T.layers)):(T.layers.__used=!0,T.layers):null}function y(I){var _,T=I.length,g,P;for(_=T-1;_>=0;_-=1)if(I[_].ty==="sh")if(I[_].ks.k.i)E(I[_].ks.k);else for(P=I[_].ks.k.length,g=0;g<P;g+=1)I[_].ks.k[g].s&&E(I[_].ks.k[g].s[0]),I[_].ks.k[g].e&&E(I[_].ks.k[g].e[0]);else I[_].ty==="gr"&&y(I[_].it)}function E(I){var _,T=I.i.length;for(_=0;_<T;_+=1)I.i[_][0]+=I.v[_][0],I.i[_][1]+=I.v[_][1],I.o[_][0]+=I.v[_][0],I.o[_][1]+=I.v[_][1]}function x(I,_){var T=_?_.split("."):[100,100,100];return I[0]>T[0]?!0:T[0]>I[0]?!1:I[1]>T[1]?!0:T[1]>I[1]?!1:I[2]>T[2]?!0:T[2]>I[2]?!1:null}var A=(function(){var I=[4,4,14];function _(g){var P=g.t.d;g.t.d={k:[{s:P,t:0}]}}function T(g){var P,k=g.length;for(P=0;P<k;P+=1)g[P].ty===5&&_(g[P])}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})(),F=(function(){var I=[4,7,99];return function(_){if(_.chars&&!x(I,_.v)){var T,g=_.chars.length;for(T=0;T<g;T+=1){var P=_.chars[T];P.data&&P.data.shapes&&(y(P.data.shapes),P.data.ip=0,P.data.op=99999,P.data.st=0,P.data.sr=1,P.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},_.chars[T].t||(P.data.shapes.push({ty:"no"}),P.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}})(),w=(function(){var I=[5,7,15];function _(g){var P=g.t.p;typeof P.a=="number"&&(P.a={a:0,k:P.a}),typeof P.p=="number"&&(P.p={a:0,k:P.p}),typeof P.r=="number"&&(P.r={a:0,k:P.r})}function T(g){var P,k=g.length;for(P=0;P<k;P+=1)g[P].ty===5&&_(g[P])}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})(),z=(function(){var I=[4,1,9];function _(g){var P,k=g.length,M,V;for(P=0;P<k;P+=1)if(g[P].ty==="gr")_(g[P].it);else if(g[P].ty==="fl"||g[P].ty==="st")if(g[P].c.k&&g[P].c.k[0].i)for(V=g[P].c.k.length,M=0;M<V;M+=1)g[P].c.k[M].s&&(g[P].c.k[M].s[0]/=255,g[P].c.k[M].s[1]/=255,g[P].c.k[M].s[2]/=255,g[P].c.k[M].s[3]/=255),g[P].c.k[M].e&&(g[P].c.k[M].e[0]/=255,g[P].c.k[M].e[1]/=255,g[P].c.k[M].e[2]/=255,g[P].c.k[M].e[3]/=255);else g[P].c.k[0]/=255,g[P].c.k[1]/=255,g[P].c.k[2]/=255,g[P].c.k[3]/=255}function T(g){var P,k=g.length;for(P=0;P<k;P+=1)g[P].ty===4&&_(g[P].shapes)}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})(),R=(function(){var I=[4,4,18];function _(g){var P,k=g.length,M,V;for(P=k-1;P>=0;P-=1)if(g[P].ty==="sh")if(g[P].ks.k.i)g[P].ks.k.c=g[P].closed;else for(V=g[P].ks.k.length,M=0;M<V;M+=1)g[P].ks.k[M].s&&(g[P].ks.k[M].s[0].c=g[P].closed),g[P].ks.k[M].e&&(g[P].ks.k[M].e[0].c=g[P].closed);else g[P].ty==="gr"&&_(g[P].it)}function T(g){var P,k,M=g.length,V,D,B,H;for(k=0;k<M;k+=1){if(P=g[k],P.hasMask){var j=P.masksProperties;for(D=j.length,V=0;V<D;V+=1)if(j[V].pt.k.i)j[V].pt.k.c=j[V].cl;else for(H=j[V].pt.k.length,B=0;B<H;B+=1)j[V].pt.k[B].s&&(j[V].pt.k[B].s[0].c=j[V].cl),j[V].pt.k[B].e&&(j[V].pt.k[B].e[0].c=j[V].cl)}P.ty===4&&_(P.shapes)}}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})();function L(I){I.__complete||(z(I),A(I),F(I),w(I),R(I),C(I.layers,I.assets),p(I.chars,I.assets),I.__complete=!0)}function O(I){I.t.a.length===0&&"m"in I.t.p}var G={};return G.completeData=L,G.checkColors=z,G.checkChars=F,G.checkPathProperties=w,G.checkShapes=R,G.completeLayers=C,G}if(n.dataManager||(n.dataManager=v()),n.assetLoader||(n.assetLoader=(function(){function C(u){var l=u.getResponseHeader("content-type");return l&&u.responseType==="json"&&l.indexOf("json")!==-1||u.response&&_typeof$5(u.response)==="object"?u.response:u.response&&typeof u.response=="string"?JSON.parse(u.response):u.responseText?JSON.parse(u.responseText):null}function p(u,l,y,E){var x,A=new XMLHttpRequest;try{A.responseType="json"}catch{}A.onreadystatechange=function(){if(A.readyState===4)if(A.status===200)x=C(A),y(x);else try{x=C(A),y(x)}catch(F){E&&E(F)}};try{A.open(["G","E","T"].join(""),u,!0)}catch{A.open(["G","E","T"].join(""),l+"/"+u,!0)}A.send()}return{load:p}})()),b.data.type==="loadAnimation")n.assetLoader.load(b.data.path,b.data.fullPath,function(C){n.dataManager.completeData(C),n.postMessage({id:b.data.id,payload:C,status:"success"})},function(){n.postMessage({id:b.data.id,status:"error"})});else if(b.data.type==="complete"){var m=b.data.animation;n.dataManager.completeData(m),n.postMessage({id:b.data.id,payload:m,status:"success"})}else b.data.type==="loadData"&&n.assetLoader.load(b.data.path,b.data.fullPath,function(C){n.postMessage({id:b.data.id,payload:C,status:"success"})},function(){n.postMessage({id:b.data.id,status:"error"})})}),i.onmessage=function(c){var b=c.data,v=b.id,m=e[v];e[v]=null,b.status==="success"?m.onComplete(b.payload):m.onError&&m.onError()})}function o(c,b){t+=1;var v="processId_"+t;return e[v]={onComplete:c,onError:b},v}function f(c,b,v){h();var m=o(b,v);i.postMessage({type:"loadAnimation",path:c,fullPath:window.location.origin+window.location.pathname,id:m})}function d(c,b,v){h();var m=o(b,v);i.postMessage({type:"loadData",path:c,fullPath:window.location.origin+window.location.pathname,id:m})}function S(c,b,v){h();var m=o(b,v);i.postMessage({type:"complete",animation:c,id:m})}return{loadAnimation:f,loadData:d,completeAnimation:S}})(),ImagePreloader=(function(){var t=(function(){var p=createTag("canvas");p.width=1,p.height=1;var u=p.getContext("2d");return u.fillStyle="rgba(0,0,0,0)",u.fillRect(0,0,1,1),p})();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(p,u,l){var y="";if(p.e)y=p.p;else if(u){var E=p.p;E.indexOf("images/")!==-1&&(E=E.split("/")[1]),y=u+E}else y=l,y+=p.u?p.u:"",y+=p.p;return y}function s(p){var u=0,l=setInterval((function(){var y=p.getBBox();(y.width||u>500)&&(this._imageLoaded(),clearInterval(l)),u+=1}).bind(this),50)}function n(p){var u=i(p,this.assetsPath,this.path),l=createNS("image");isSafari?this.testImageLoaded(l):l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",(function(){y.img=t,this._imageLoaded()}).bind(this),!1),l.setAttributeNS("http://www.w3.org/1999/xlink","href",u),this._elementHelper.append?this._elementHelper.append(l):this._elementHelper.appendChild(l);var y={img:l,assetData:p};return y}function a(p){var u=i(p,this.assetsPath,this.path),l=createTag("img");l.crossOrigin="anonymous",l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",(function(){y.img=t,this._imageLoaded()}).bind(this),!1),l.src=u;var y={img:l,assetData:p};return y}function h(p){var u={assetData:p},l=i(p,this.assetsPath,this.path);return dataManager.loadData(l,(function(y){u.img=y,this._footageLoaded()}).bind(this),(function(){u.img={},this._footageLoaded()}).bind(this)),u}function o(p,u){this.imagesLoadedCb=u;var l,y=p.length;for(l=0;l<y;l+=1)p[l].layers||(!p[l].t||p[l].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(p[l]))):p[l].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(p[l]))))}function f(p){this.path=p||""}function d(p){this.assetsPath=p||""}function S(p){for(var u=0,l=this.images.length;u<l;){if(this.images[u].assetData===p)return this.images[u].img;u+=1}return null}function c(){this.imagesLoadedCb=null,this.images.length=0}function b(){return this.totalImages===this.loadedAssets}function v(){return this.totalFootages===this.loadedFootagesCount}function m(p,u){p==="svg"?(this._elementHelper=u,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function C(){this._imageLoaded=e.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=s.bind(this),this.createFootageData=h.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return C.prototype={loadAssets:o,setAssetsPath:d,setPath:f,loadedImages:b,loadedFootages:v,destroy:c,getAsset:S,createImgData:a,createImageData:n,imageLoaded:e,footageLoaded:r,setCacheType:m},C})();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,r){if(this._cbs[e])for(var i=this._cbs[e],s=0;s<i.length;s+=1)i[s](r)},addEventListener:function(e,r){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(r),(function(){this.removeEventListener(e,r)}).bind(this)},removeEventListener:function(e,r){if(!r)this._cbs[e]=null;else if(this._cbs[e]){for(var i=0,s=this._cbs[e].length;i<s;)this._cbs[e][i]===r&&(this._cbs[e].splice(i,1),i-=1,s-=1),i+=1;this._cbs[e].length||(this._cbs[e]=null)}}};var markerParser=(function(){function t(e){for(var r=e.split(`\r
1
+ import{g as getDefaultExportFromCjs,r as reactExports,R as React}from"./index-Dn5ZH1Y6.js";var lottie$2={exports:{}},lottie$1=lottie$2.exports,hasRequiredLottie;function requireLottie(){return hasRequiredLottie||(hasRequiredLottie=1,(function(module,exports$1){typeof document<"u"&&typeof navigator<"u"&&(function(t,e){module.exports=e()})(lottie$1,(function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var r,i=t.length,s;for(r=0;r<i;r+=1){s=t[r].prototype;for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e.prototype[n]=s[n])}}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}var audioControllerFactory=(function(){function t(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(r){this.audios.push(r)},pause:function(){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].pause()},resume:function(){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].resume()},setRate:function(r){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].setRate(r)},createAudio:function(r){return this.audioFactory?this.audioFactory(r):window.Howl?new window.Howl({src:[r]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(r){this.audioFactory=r},setVolume:function(r){this._volume=r,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}})(),createTypedArray=(function(){function t(r,i){var s=0,n=[],a;switch(r){case"int16":case"uint8c":a=1;break;default:a=1.1;break}for(s=0;s<i;s+=1)n.push(a);return n}function e(r,i){return r==="float32"?new Float32Array(i):r==="int16"?new Int16Array(i):r==="uint8c"?new Uint8ClampedArray(i):t(r,i)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:t})();function createSizedArray(t){return Array.apply(null,{length:t})}function _typeof$6(t){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(t)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e,r=t.length;for(e=0;e<r;e+=1)BMMath[t[e]]=Math[t[e]]})(),BMMath.random=Math.random,BMMath.abs=function(t){var e=_typeof$6(t);if(e==="object"&&t.length){var r=createSizedArray(t.length),i,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;function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-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 BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}var createElementID=(function(){var t=0;return function(){return t+=1,idPrefix$1+"__lottie_element_"+t}})();function HSVtoRGB(t,e,r){var i,s,n,a,h,o,f,d;switch(a=Math.floor(t*6),h=t*6-a,o=r*(1-e),f=r*(1-h*e),d=r*(1-(1-h)*e),a%6){case 0:i=r,s=d,n=o;break;case 1:i=f,s=r,n=o;break;case 2:i=o,s=r,n=d;break;case 3:i=o,s=f,n=r;break;case 4:i=d,s=o,n=r;break;case 5:i=r,s=o,n=f;break}return[i,s,n]}function RGBtoHSV(t,e,r){var i=Math.max(t,e,r),s=Math.min(t,e,r),n=i-s,a,h=i===0?0:n/i,o=i/255;switch(i){case s:a=0;break;case t:a=e-r+n*(e<r?6:0),a/=6*n;break;case e:a=r-t+n*2,a/=6*n;break;case r:a=t-e+n*4,a/=6*n;break}return[a,h,o]}function addSaturationToRGB(t,e){var r=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);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(t[0]*255,t[1]*255,t[2]*255);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(t[0]*255,t[1]*255,t[2]*255);return r[0]+=e/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=(function(){var t=[],e,r;for(e=0;e<256;e+=1)r=e.toString(16),t[e]=r.length===1?"0"+r:r;return function(i,s,n){return i<0&&(i=0),s<0&&(s=0),n<0&&(n=0),"#"+t[i]+t[s]+t[n]}})(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=(function(){var t=1,e=[],r,i,s={onmessage:function(){},postMessage:function(b){r({data:b})}},n={postMessage:function(b){s.onmessage({data:b})}};function a(c){if(window.Worker&&window.Blob&&getWebWorker()){var b=new Blob(["var _workerSelf = self; self.onmessage = ",c.toString()],{type:"text/javascript"}),v=URL.createObjectURL(b);return new Worker(v)}return r=c,s}function h(){i||(i=a(function(b){function v(){function C(I,_){var T,g,P=I.length,k,M,V,D;for(g=0;g<P;g+=1)if(T=I[g],"ks"in T&&!T.completed){if(T.completed=!0,T.hasMask){var B=T.masksProperties;for(M=B.length,k=0;k<M;k+=1)if(B[k].pt.k.i)E(B[k].pt.k);else for(D=B[k].pt.k.length,V=0;V<D;V+=1)B[k].pt.k[V].s&&E(B[k].pt.k[V].s[0]),B[k].pt.k[V].e&&E(B[k].pt.k[V].e[0])}T.ty===0?(T.layers=l(T.refId,_),C(T.layers,_)):T.ty===4?y(T.shapes):T.ty===5&&O(T)}}function p(I,_){if(I){var T=0,g=I.length;for(T=0;T<g;T+=1)I[T].t===1&&(I[T].data.layers=l(I[T].data.refId,_),C(I[T].data.layers,_))}}function u(I,_){for(var T=0,g=_.length;T<g;){if(_[T].id===I)return _[T];T+=1}return null}function l(I,_){var T=u(I,_);return T?T.layers.__used?JSON.parse(JSON.stringify(T.layers)):(T.layers.__used=!0,T.layers):null}function y(I){var _,T=I.length,g,P;for(_=T-1;_>=0;_-=1)if(I[_].ty==="sh")if(I[_].ks.k.i)E(I[_].ks.k);else for(P=I[_].ks.k.length,g=0;g<P;g+=1)I[_].ks.k[g].s&&E(I[_].ks.k[g].s[0]),I[_].ks.k[g].e&&E(I[_].ks.k[g].e[0]);else I[_].ty==="gr"&&y(I[_].it)}function E(I){var _,T=I.i.length;for(_=0;_<T;_+=1)I.i[_][0]+=I.v[_][0],I.i[_][1]+=I.v[_][1],I.o[_][0]+=I.v[_][0],I.o[_][1]+=I.v[_][1]}function x(I,_){var T=_?_.split("."):[100,100,100];return I[0]>T[0]?!0:T[0]>I[0]?!1:I[1]>T[1]?!0:T[1]>I[1]?!1:I[2]>T[2]?!0:T[2]>I[2]?!1:null}var A=(function(){var I=[4,4,14];function _(g){var P=g.t.d;g.t.d={k:[{s:P,t:0}]}}function T(g){var P,k=g.length;for(P=0;P<k;P+=1)g[P].ty===5&&_(g[P])}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})(),F=(function(){var I=[4,7,99];return function(_){if(_.chars&&!x(I,_.v)){var T,g=_.chars.length;for(T=0;T<g;T+=1){var P=_.chars[T];P.data&&P.data.shapes&&(y(P.data.shapes),P.data.ip=0,P.data.op=99999,P.data.st=0,P.data.sr=1,P.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},_.chars[T].t||(P.data.shapes.push({ty:"no"}),P.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}})(),w=(function(){var I=[5,7,15];function _(g){var P=g.t.p;typeof P.a=="number"&&(P.a={a:0,k:P.a}),typeof P.p=="number"&&(P.p={a:0,k:P.p}),typeof P.r=="number"&&(P.r={a:0,k:P.r})}function T(g){var P,k=g.length;for(P=0;P<k;P+=1)g[P].ty===5&&_(g[P])}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})(),z=(function(){var I=[4,1,9];function _(g){var P,k=g.length,M,V;for(P=0;P<k;P+=1)if(g[P].ty==="gr")_(g[P].it);else if(g[P].ty==="fl"||g[P].ty==="st")if(g[P].c.k&&g[P].c.k[0].i)for(V=g[P].c.k.length,M=0;M<V;M+=1)g[P].c.k[M].s&&(g[P].c.k[M].s[0]/=255,g[P].c.k[M].s[1]/=255,g[P].c.k[M].s[2]/=255,g[P].c.k[M].s[3]/=255),g[P].c.k[M].e&&(g[P].c.k[M].e[0]/=255,g[P].c.k[M].e[1]/=255,g[P].c.k[M].e[2]/=255,g[P].c.k[M].e[3]/=255);else g[P].c.k[0]/=255,g[P].c.k[1]/=255,g[P].c.k[2]/=255,g[P].c.k[3]/=255}function T(g){var P,k=g.length;for(P=0;P<k;P+=1)g[P].ty===4&&_(g[P].shapes)}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})(),R=(function(){var I=[4,4,18];function _(g){var P,k=g.length,M,V;for(P=k-1;P>=0;P-=1)if(g[P].ty==="sh")if(g[P].ks.k.i)g[P].ks.k.c=g[P].closed;else for(V=g[P].ks.k.length,M=0;M<V;M+=1)g[P].ks.k[M].s&&(g[P].ks.k[M].s[0].c=g[P].closed),g[P].ks.k[M].e&&(g[P].ks.k[M].e[0].c=g[P].closed);else g[P].ty==="gr"&&_(g[P].it)}function T(g){var P,k,M=g.length,V,D,B,H;for(k=0;k<M;k+=1){if(P=g[k],P.hasMask){var j=P.masksProperties;for(D=j.length,V=0;V<D;V+=1)if(j[V].pt.k.i)j[V].pt.k.c=j[V].cl;else for(H=j[V].pt.k.length,B=0;B<H;B+=1)j[V].pt.k[B].s&&(j[V].pt.k[B].s[0].c=j[V].cl),j[V].pt.k[B].e&&(j[V].pt.k[B].e[0].c=j[V].cl)}P.ty===4&&_(P.shapes)}}return function(g){if(x(I,g.v)&&(T(g.layers),g.assets)){var P,k=g.assets.length;for(P=0;P<k;P+=1)g.assets[P].layers&&T(g.assets[P].layers)}}})();function L(I){I.__complete||(z(I),A(I),F(I),w(I),R(I),C(I.layers,I.assets),p(I.chars,I.assets),I.__complete=!0)}function O(I){I.t.a.length===0&&"m"in I.t.p}var G={};return G.completeData=L,G.checkColors=z,G.checkChars=F,G.checkPathProperties=w,G.checkShapes=R,G.completeLayers=C,G}if(n.dataManager||(n.dataManager=v()),n.assetLoader||(n.assetLoader=(function(){function C(u){var l=u.getResponseHeader("content-type");return l&&u.responseType==="json"&&l.indexOf("json")!==-1||u.response&&_typeof$5(u.response)==="object"?u.response:u.response&&typeof u.response=="string"?JSON.parse(u.response):u.responseText?JSON.parse(u.responseText):null}function p(u,l,y,E){var x,A=new XMLHttpRequest;try{A.responseType="json"}catch{}A.onreadystatechange=function(){if(A.readyState===4)if(A.status===200)x=C(A),y(x);else try{x=C(A),y(x)}catch(F){E&&E(F)}};try{A.open(["G","E","T"].join(""),u,!0)}catch{A.open(["G","E","T"].join(""),l+"/"+u,!0)}A.send()}return{load:p}})()),b.data.type==="loadAnimation")n.assetLoader.load(b.data.path,b.data.fullPath,function(C){n.dataManager.completeData(C),n.postMessage({id:b.data.id,payload:C,status:"success"})},function(){n.postMessage({id:b.data.id,status:"error"})});else if(b.data.type==="complete"){var m=b.data.animation;n.dataManager.completeData(m),n.postMessage({id:b.data.id,payload:m,status:"success"})}else b.data.type==="loadData"&&n.assetLoader.load(b.data.path,b.data.fullPath,function(C){n.postMessage({id:b.data.id,payload:C,status:"success"})},function(){n.postMessage({id:b.data.id,status:"error"})})}),i.onmessage=function(c){var b=c.data,v=b.id,m=e[v];e[v]=null,b.status==="success"?m.onComplete(b.payload):m.onError&&m.onError()})}function o(c,b){t+=1;var v="processId_"+t;return e[v]={onComplete:c,onError:b},v}function f(c,b,v){h();var m=o(b,v);i.postMessage({type:"loadAnimation",path:c,fullPath:window.location.origin+window.location.pathname,id:m})}function d(c,b,v){h();var m=o(b,v);i.postMessage({type:"loadData",path:c,fullPath:window.location.origin+window.location.pathname,id:m})}function S(c,b,v){h();var m=o(b,v);i.postMessage({type:"complete",animation:c,id:m})}return{loadAnimation:f,loadData:d,completeAnimation:S}})(),ImagePreloader=(function(){var t=(function(){var p=createTag("canvas");p.width=1,p.height=1;var u=p.getContext("2d");return u.fillStyle="rgba(0,0,0,0)",u.fillRect(0,0,1,1),p})();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(p,u,l){var y="";if(p.e)y=p.p;else if(u){var E=p.p;E.indexOf("images/")!==-1&&(E=E.split("/")[1]),y=u+E}else y=l,y+=p.u?p.u:"",y+=p.p;return y}function s(p){var u=0,l=setInterval((function(){var y=p.getBBox();(y.width||u>500)&&(this._imageLoaded(),clearInterval(l)),u+=1}).bind(this),50)}function n(p){var u=i(p,this.assetsPath,this.path),l=createNS("image");isSafari?this.testImageLoaded(l):l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",(function(){y.img=t,this._imageLoaded()}).bind(this),!1),l.setAttributeNS("http://www.w3.org/1999/xlink","href",u),this._elementHelper.append?this._elementHelper.append(l):this._elementHelper.appendChild(l);var y={img:l,assetData:p};return y}function a(p){var u=i(p,this.assetsPath,this.path),l=createTag("img");l.crossOrigin="anonymous",l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",(function(){y.img=t,this._imageLoaded()}).bind(this),!1),l.src=u;var y={img:l,assetData:p};return y}function h(p){var u={assetData:p},l=i(p,this.assetsPath,this.path);return dataManager.loadData(l,(function(y){u.img=y,this._footageLoaded()}).bind(this),(function(){u.img={},this._footageLoaded()}).bind(this)),u}function o(p,u){this.imagesLoadedCb=u;var l,y=p.length;for(l=0;l<y;l+=1)p[l].layers||(!p[l].t||p[l].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(p[l]))):p[l].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(p[l]))))}function f(p){this.path=p||""}function d(p){this.assetsPath=p||""}function S(p){for(var u=0,l=this.images.length;u<l;){if(this.images[u].assetData===p)return this.images[u].img;u+=1}return null}function c(){this.imagesLoadedCb=null,this.images.length=0}function b(){return this.totalImages===this.loadedAssets}function v(){return this.totalFootages===this.loadedFootagesCount}function m(p,u){p==="svg"?(this._elementHelper=u,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function C(){this._imageLoaded=e.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=s.bind(this),this.createFootageData=h.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return C.prototype={loadAssets:o,setAssetsPath:d,setPath:f,loadedImages:b,loadedFootages:v,destroy:c,getAsset:S,createImgData:a,createImageData:n,imageLoaded:e,footageLoaded:r,setCacheType:m},C})();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,r){if(this._cbs[e])for(var i=this._cbs[e],s=0;s<i.length;s+=1)i[s](r)},addEventListener:function(e,r){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(r),(function(){this.removeEventListener(e,r)}).bind(this)},removeEventListener:function(e,r){if(!r)this._cbs[e]=null;else if(this._cbs[e]){for(var i=0,s=this._cbs[e].length;i<s;)this._cbs[e][i]===r&&(this._cbs[e].splice(i,1),i-=1,s-=1),i+=1;this._cbs[e].length||(this._cbs[e]=null)}}};var markerParser=(function(){function t(e){for(var r=e.split(`\r
2
2
  `),i={},s,n=0,a=0;a<r.length;a+=1)s=r[a].split(":"),s.length===2&&(i[s[0]]=s[1].trim(),n+=1);if(n===0)throw new Error;return i}return function(e){for(var r=[],i=0;i<e.length;i+=1){var s=e[i],n={time:s.tm,duration:s.dr};try{n.payload=JSON.parse(e[i].cm)}catch{try{n.payload=t(e[i].cm)}catch{n.payload={name:e[i].cm}}}r.push(n)}return r}})(),ProjectInterface=(function(){function t(e){this.compositions.push(e)}return function(){function e(r){for(var i=0,s=this.compositions.length;i<s;){if(this.compositions[i].data&&this.compositions[i].data.nm===r)return this.compositions[i].prepareFrame&&this.compositions[i].data.xt&&this.compositions[i].prepareFrame(this.currentFrame),this.compositions[i].compInterface;i+=1}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}})(),renderers={},registerRenderer=function(e,r){renderers[e]=r};function getRenderer(t){return renderers[t]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var t in renderers)if(renderers[t])return t;return""}function _typeof$4(t){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(t)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var r=getRenderer(e);this.renderer=new r(this,t.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,t.loop===""||t.loop===null||t.loop===void 0||t.loop===!0?this.loop=!0:t.loop===!1?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(t,"autoloadSegments")?t.autoloadSegments:!0,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(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")),dataManager.loadAnimation(t.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(t){dataManager.completeAnimation(t,this.configAnimation)},AnimationItem.prototype.setData=function(t,e){e&&_typeof$4(e)!=="object"&&(e=JSON.parse(e));var r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";s==="false"?r.loop=!1:s==="true"?r.loop=!0:s!==""&&(r.loop=parseInt(s,10));var n=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:i.getNamedItem("bm-autoplay")?i.getNamedItem("bm-autoplay").value:!0;r.autoplay=n!=="false",r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"";var a=i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"";a==="false"&&(r.prerender=!1),r.path?this.setParams(r):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,r,i=e.length,s=t.layers,n,a=s.length;for(n=0;n<a;n+=1)for(r=0;r<i;){if(e[r].id===s[n].id){e[r]=s[n];break}r+=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,r=0;r<i;r+=1)this.animationData.assets.push(t.assets[r]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(t){this.animationData=t;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||t.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(r,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.markers=markerParser(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(t,e){var r=typeof t=="number"?t:void 0,i=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(r,i)},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},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._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(t){for(var e,r=0;r<this.markers.length;r+=1)if(e=this.markers[r],e.payload&&e.payload.name===t)return e;return null},AnimationItem.prototype.goToAndStop=function(t,e,r){if(!(r&&this.name!==r)){var i=Number(t);if(isNaN(i)){var s=this.getMarkerData(t);s&&this.goToAndStop(s.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(t,e,r){if(!(r&&this.name!==r)){var i=Number(t);if(isNaN(i)){var s=this.getMarkerData(t);s&&(s.duration?this.playSegments([s.time,s.time+s.duration],!0):this.goToAndStop(s.time,!0))}else this.goToAndStop(i,e,r);this.play()}},AnimationItem.prototype.advanceTime=function(t){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(r=!0,e=0)):this.setCurrentRawFrameValue(e),r&&(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.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,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.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),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)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,r!==-1&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),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):!1},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=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.setLoop=function(t){this.loop=t},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;r.indexOf("images/")!==-1&&(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;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(t,e,r){try{var i=this.renderer.getElementByPath(t);i.updateDocumentData(e,r)}catch{}},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.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(t,this.drawnFrameEvent);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)}t==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),t==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),t==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),t==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),t==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var animationManager=(function(){var t={},e=[],r=0,i=0,s=0,n=!0,a=!1;function h(_){for(var T=0,g=_.target;T<i;)e[T].animation===g&&(e.splice(T,1),T-=1,i-=1,g.isPaused||S()),T+=1}function o(_,T){if(!_)return null;for(var g=0;g<i;){if(e[g].elem===_&&e[g].elem!==null)return e[g].animation;g+=1}var P=new AnimationItem;return c(P,_),P.setData(_,T),P}function f(){var _,T=e.length,g=[];for(_=0;_<T;_+=1)g.push(e[_].animation);return g}function d(){s+=1,z()}function S(){s-=1}function c(_,T){_.addEventListener("destroy",h),_.addEventListener("_active",d),_.addEventListener("_idle",S),e.push({elem:T,animation:_}),i+=1}function b(_){var T=new AnimationItem;return c(T,null),T.setParams(_),T}function v(_,T){var g;for(g=0;g<i;g+=1)e[g].animation.setSpeed(_,T)}function m(_,T){var g;for(g=0;g<i;g+=1)e[g].animation.setDirection(_,T)}function C(_){var T;for(T=0;T<i;T+=1)e[T].animation.play(_)}function p(_){var T=_-r,g;for(g=0;g<i;g+=1)e[g].animation.advanceTime(T);r=_,s&&!a?window.requestAnimationFrame(p):n=!0}function u(_){r=_,window.requestAnimationFrame(p)}function l(_){var T;for(T=0;T<i;T+=1)e[T].animation.pause(_)}function y(_,T,g){var P;for(P=0;P<i;P+=1)e[P].animation.goToAndStop(_,T,g)}function E(_){var T;for(T=0;T<i;T+=1)e[T].animation.stop(_)}function x(_){var T;for(T=0;T<i;T+=1)e[T].animation.togglePause(_)}function A(_){var T;for(T=i-1;T>=0;T-=1)e[T].animation.destroy(_)}function F(_,T,g){var P=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),k,M=P.length;for(k=0;k<M;k+=1)g&&P[k].setAttribute("data-bm-type",g),o(P[k],_);if(T&&M===0){g||(g="svg");var V=document.getElementsByTagName("body")[0];V.innerText="";var D=createTag("div");D.style.width="100%",D.style.height="100%",D.setAttribute("data-bm-type",g),V.appendChild(D),o(D,_)}}function w(){var _;for(_=0;_<i;_+=1)e[_].animation.resize()}function z(){!a&&s&&n&&(window.requestAnimationFrame(u),n=!1)}function R(){a=!0}function L(){a=!1,z()}function O(_,T){var g;for(g=0;g<i;g+=1)e[g].animation.setVolume(_,T)}function G(_){var T;for(T=0;T<i;T+=1)e[T].animation.mute(_)}function I(_){var T;for(T=0;T<i;T+=1)e[T].animation.unmute(_)}return t.registerAnimation=o,t.loadAnimation=b,t.setSpeed=v,t.setDirection=m,t.play=C,t.pause=l,t.stop=E,t.togglePause=x,t.searchAnimations=F,t.resize=w,t.goToAndStop=y,t.destroy=A,t.freeze=R,t.unfreeze=L,t.setVolume=O,t.mute=G,t.unmute=I,t.getRegisteredAnimations=f,t})(),BezierFactory=(function(){var t={};t.getBezierEasing=r;var e={};function r(u,l,y,E,x){var A=x||("bez_"+u+"_"+l+"_"+y+"_"+E).replace(/\./g,"p");if(e[A])return e[A];var F=new p([u,l,y,E]);return e[A]=F,F}var i=4,s=.001,n=1e-7,a=10,h=11,o=1/(h-1),f=typeof Float32Array=="function";function d(u,l){return 1-3*l+3*u}function S(u,l){return 3*l-6*u}function c(u){return 3*u}function b(u,l,y){return((d(l,y)*u+S(l,y))*u+c(l))*u}function v(u,l,y){return 3*d(l,y)*u*u+2*S(l,y)*u+c(l)}function m(u,l,y,E,x){var A,F,w=0;do F=l+(y-l)/2,A=b(F,E,x)-u,A>0?y=F:l=F;while(Math.abs(A)>n&&++w<a);return F}function C(u,l,y,E){for(var x=0;x<i;++x){var A=v(l,y,E);if(A===0)return l;var F=b(l,y,E)-u;l-=F/A}return l}function p(u){this._p=u,this._mSampleValues=f?new Float32Array(h):new Array(h),this._precomputed=!1,this.get=this.get.bind(this)}return p.prototype={get:function(l){var y=this._p[0],E=this._p[1],x=this._p[2],A=this._p[3];return this._precomputed||this._precompute(),y===E&&x===A?l:l===0?0:l===1?1:b(this._getTForX(l),E,A)},_precompute:function(){var l=this._p[0],y=this._p[1],E=this._p[2],x=this._p[3];this._precomputed=!0,(l!==y||E!==x)&&this._calcSampleValues()},_calcSampleValues:function(){for(var l=this._p[0],y=this._p[2],E=0;E<h;++E)this._mSampleValues[E]=b(E*o,l,y)},_getTForX:function(l){for(var y=this._p[0],E=this._p[2],x=this._mSampleValues,A=0,F=1,w=h-1;F!==w&&x[F]<=l;++F)A+=o;--F;var z=(l-x[F])/(x[F+1]-x[F]),R=A+z*o,L=v(R,y,E);return L>=s?C(l,R,y,E):L===0?R:m(l,A,A+o,y,E)}},t})(),pooling=(function(){function t(e){return e.concat(createSizedArray(e.length))}return{double:t}})(),poolFactory=(function(){return function(t,e,r){var i=0,s=t,n=createSizedArray(s),a={newElement:h,release:o};function h(){var f;return i?(i-=1,f=n[i]):f=e(),f}function o(f){i===s&&(n=pooling.double(n),s*=2),r&&r(f),n[i]=f,i+=1}return a}})(),bezierLengthPool=(function(){function t(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)})(),segmentsLengthPool=(function(){function t(){return{lengths:[],totalLength:0}}function e(r){var i,s=r.lengths.length;for(i=0;i<s;i+=1)bezierLengthPool.release(r.lengths[i]);r.lengths.length=0}return poolFactory(8,t,e)})();function bezFunction(){var t=Math;function e(c,b,v,m,C,p){var u=c*m+b*C+v*p-C*m-p*c-v*b;return u>-.001&&u<.001}function r(c,b,v,m,C,p,u,l,y){if(v===0&&p===0&&y===0)return e(c,b,m,C,u,l);var E=t.sqrt(t.pow(m-c,2)+t.pow(C-b,2)+t.pow(p-v,2)),x=t.sqrt(t.pow(u-c,2)+t.pow(l-b,2)+t.pow(y-v,2)),A=t.sqrt(t.pow(u-m,2)+t.pow(l-C,2)+t.pow(y-p,2)),F;return E>x?E>A?F=E-x-A:F=A-x-E:A>x?F=A-x-E:F=x-E-A,F>-1e-4&&F<1e-4}var i=(function(){return function(c,b,v,m){var C=getDefaultCurveSegments(),p,u,l,y,E,x=0,A,F=[],w=[],z=bezierLengthPool.newElement();for(l=v.length,p=0;p<C;p+=1){for(E=p/(C-1),A=0,u=0;u<l;u+=1)y=bmPow(1-E,3)*c[u]+3*bmPow(1-E,2)*E*v[u]+3*(1-E)*bmPow(E,2)*m[u]+bmPow(E,3)*b[u],F[u]=y,w[u]!==null&&(A+=bmPow(F[u]-w[u],2)),w[u]=F[u];A&&(A=bmSqrt(A),x+=A),z.percents[p]=E,z.lengths[p]=x}return z.addedLength=x,z}})();function s(c){var b=segmentsLengthPool.newElement(),v=c.c,m=c.v,C=c.o,p=c.i,u,l=c._length,y=b.lengths,E=0;for(u=0;u<l-1;u+=1)y[u]=i(m[u],m[u+1],C[u],p[u+1]),E+=y[u].addedLength;return v&&l&&(y[u]=i(m[u],m[0],C[u],p[0]),E+=y[u].addedLength),b.totalLength=E,b}function n(c){this.segmentLength=0,this.points=new Array(c)}function a(c,b){this.partialLength=c,this.point=b}var h=(function(){var c={};return function(b,v,m,C){var p=(b[0]+"_"+b[1]+"_"+v[0]+"_"+v[1]+"_"+m[0]+"_"+m[1]+"_"+C[0]+"_"+C[1]).replace(/\./g,"p");if(!c[p]){var u=getDefaultCurveSegments(),l,y,E,x,A,F=0,w,z,R=null;b.length===2&&(b[0]!==v[0]||b[1]!==v[1])&&e(b[0],b[1],v[0],v[1],b[0]+m[0],b[1]+m[1])&&e(b[0],b[1],v[0],v[1],v[0]+C[0],v[1]+C[1])&&(u=2);var L=new n(u);for(E=m.length,l=0;l<u;l+=1){for(z=createSizedArray(E),A=l/(u-1),w=0,y=0;y<E;y+=1)x=bmPow(1-A,3)*b[y]+3*bmPow(1-A,2)*A*(b[y]+m[y])+3*(1-A)*bmPow(A,2)*(v[y]+C[y])+bmPow(A,3)*v[y],z[y]=x,R!==null&&(w+=bmPow(z[y]-R[y],2));w=bmSqrt(w),F+=w,L.points[l]=new a(w,z),R=z}L.segmentLength=F,c[p]=L}return c[p]}})();function o(c,b){var v=b.percents,m=b.lengths,C=v.length,p=bmFloor((C-1)*c),u=c*b.addedLength,l=0;if(p===C-1||p===0||u===m[p])return v[p];for(var y=m[p]>u?-1:1,E=!0;E;)if(m[p]<=u&&m[p+1]>u?(l=(u-m[p])/(m[p+1]-m[p]),E=!1):p+=y,p<0||p>=C-1){if(p===C-1)return v[p];E=!1}return v[p]+(v[p+1]-v[p])*l}function f(c,b,v,m,C,p){var u=o(C,p),l=1-u,y=t.round((l*l*l*c[0]+(u*l*l+l*u*l+l*l*u)*v[0]+(u*u*l+l*u*u+u*l*u)*m[0]+u*u*u*b[0])*1e3)/1e3,E=t.round((l*l*l*c[1]+(u*l*l+l*u*l+l*l*u)*v[1]+(u*u*l+l*u*u+u*l*u)*m[1]+u*u*u*b[1])*1e3)/1e3;return[y,E]}var d=createTypedArray("float32",8);function S(c,b,v,m,C,p,u){C<0?C=0:C>1&&(C=1);var l=o(C,u);p=p>1?1:p;var y=o(p,u),E,x=c.length,A=1-l,F=1-y,w=A*A*A,z=l*A*A*3,R=l*l*A*3,L=l*l*l,O=A*A*F,G=l*A*F+A*l*F+A*A*y,I=l*l*F+A*l*y+l*A*y,_=l*l*y,T=A*F*F,g=l*F*F+A*y*F+A*F*y,P=l*y*F+A*y*y+l*F*y,k=l*y*y,M=F*F*F,V=y*F*F+F*y*F+F*F*y,D=y*y*F+F*y*y+y*F*y,B=y*y*y;for(E=0;E<x;E+=1)d[E*4]=t.round((w*c[E]+z*v[E]+R*m[E]+L*b[E])*1e3)/1e3,d[E*4+1]=t.round((O*c[E]+G*v[E]+I*m[E]+_*b[E])*1e3)/1e3,d[E*4+2]=t.round((T*c[E]+g*v[E]+P*m[E]+k*b[E])*1e3)/1e3,d[E*4+3]=t.round((M*c[E]+V*v[E]+D*m[E]+B*b[E])*1e3)/1e3;return d}return{getSegmentsLength:s,getNewSegment:S,getPointInSegment:f,buildBezierData:h,pointOnLine2D:e,pointOnLine3D:r}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var r=this.offsetTime,i;this.propType==="multidimensional"&&(i=createTypedArray("float32",this.pv.length));for(var s=e.lastIndex,n=s,a=this.keyframes.length-1,h=!0,o,f,d;h;){if(o=this.keyframes[n],f=this.keyframes[n+1],n===a-1&&t>=f.t-r){o.h&&(o=f),s=0;break}if(f.t-r>t){s=n;break}n<a-1?n+=1:(s=0,h=!1)}d=this.keyframesMetadata[n]||{};var S,c,b,v,m,C,p=f.t-r,u=o.t-r,l;if(o.to){d.bezierData||(d.bezierData=bez.buildBezierData(o.s,f.s||o.e,o.to,o.ti));var y=d.bezierData;if(t>=p||t<u){var E=t>=p?y.points.length-1:0;for(c=y.points[E].point.length,S=0;S<c;S+=1)i[S]=y.points[E].point[S]}else{d.__fnct?C=d.__fnct:(C=BezierFactory.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n).get,d.__fnct=C),b=C((t-u)/(p-u));var x=y.segmentLength*b,A,F=e.lastFrame<t&&e._lastKeyframeIndex===n?e._lastAddedLength:0;for(m=e.lastFrame<t&&e._lastKeyframeIndex===n?e._lastPoint:0,h=!0,v=y.points.length;h;){if(F+=y.points[m].partialLength,x===0||b===0||m===y.points.length-1){for(c=y.points[m].point.length,S=0;S<c;S+=1)i[S]=y.points[m].point[S];break}else if(x>=F&&x<F+y.points[m+1].partialLength){for(A=(x-F)/y.points[m+1].partialLength,c=y.points[m].point.length,S=0;S<c;S+=1)i[S]=y.points[m].point[S]+(y.points[m+1].point[S]-y.points[m].point[S])*A;break}m<v-1?m+=1:h=!1}e._lastPoint=m,e._lastAddedLength=F-y.points[m].partialLength,e._lastKeyframeIndex=n}}else{var w,z,R,L,O;if(a=o.s.length,l=f.s||o.e,this.sh&&o.h!==1)if(t>=p)i[0]=l[0],i[1]=l[1],i[2]=l[2];else if(t<=u)i[0]=o.s[0],i[1]=o.s[1],i[2]=o.s[2];else{var G=createQuaternion(o.s),I=createQuaternion(l),_=(t-u)/(p-u);quaternionToEuler(i,slerp(G,I,_))}else for(n=0;n<a;n+=1)o.h!==1&&(t>=p?b=1:t<u?b=0:(o.o.x.constructor===Array?(d.__fnct||(d.__fnct=[]),d.__fnct[n]?C=d.__fnct[n]:(w=o.o.x[n]===void 0?o.o.x[0]:o.o.x[n],z=o.o.y[n]===void 0?o.o.y[0]:o.o.y[n],R=o.i.x[n]===void 0?o.i.x[0]:o.i.x[n],L=o.i.y[n]===void 0?o.i.y[0]:o.i.y[n],C=BezierFactory.getBezierEasing(w,z,R,L).get,d.__fnct[n]=C)):d.__fnct?C=d.__fnct:(w=o.o.x,z=o.o.y,R=o.i.x,L=o.i.y,C=BezierFactory.getBezierEasing(w,z,R,L).get,o.keyframeMetadata=C),b=C((t-u)/(p-u)))),l=f.s||o.e,O=o.h===1?o.s[n]:o.s[n]+(l[n]-o.s[n])*b,this.propType==="multidimensional"?i[n]=O:i=O}return e.lastIndex=s,i}function slerp(t,e,r){var i=[],s=t[0],n=t[1],a=t[2],h=t[3],o=e[0],f=e[1],d=e[2],S=e[3],c,b,v,m,C;return b=s*o+n*f+a*d+h*S,b<0&&(b=-b,o=-o,f=-f,d=-d,S=-S),1-b>1e-6?(c=Math.acos(b),v=Math.sin(c),m=Math.sin((1-r)*c)/v,C=Math.sin(r*c)/v):(m=1-r,C=r),i[0]=m*s+C*o,i[1]=m*n+C*f,i[2]=m*a+C*d,i[3]=m*h+C*S,i}function quaternionToEuler(t,e){var r=e[0],i=e[1],s=e[2],n=e[3],a=Math.atan2(2*i*n-2*r*s,1-2*i*i-2*s*s),h=Math.asin(2*r*i+2*s*n),o=Math.atan2(2*r*n-2*i*s,1-2*r*r-2*s*s);t[0]=a/degToRads,t[1]=h/degToRads,t[2]=o/degToRads}function createQuaternion(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),n=Math.cos(r/2),a=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(r/2),f=Math.sin(i/2),d=s*n*a-h*o*f,S=h*o*a+s*n*f,c=h*n*a+s*o*f,b=s*o*a-h*n*f;return[S,c,b,d]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=r&&t>=r||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,mathAbs(this.v[r]-e)>1e-5&&(this.v[r]=e,this._mdf=!0),r+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function ValueProperty(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r: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=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(t,e,r,i){this.propType="multidimensional",this.mult=r||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 s,n=e.k.length;for(this.v=createTypedArray("float32",n),this.pv=createTypedArray("float32",n),this.vel=createTypedArray("float32",n),s=0;s<n;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(t,e,r,i){this.propType="multidimensional";var s,n=e.k.length,a,h,o,f;for(s=0;s<n-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,h=e.k[s+1].s,o=e.k[s].to,f=e.k[s].ti,(a.length===2&&!(a[0]===h[0]&&a[1]===h[1])&&bez.pointOnLine2D(a[0],a[1],h[0],h[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],h[0],h[1],h[0]+f[0],h[1]+f[1])||a.length===3&&!(a[0]===h[0]&&a[1]===h[1]&&a[2]===h[2])&&bez.pointOnLine3D(a[0],a[1],a[2],h[0],h[1],h[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],h[0],h[1],h[2],h[0]+f[0],h[1]+f[1],h[2]+f[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===h[0]&&a[1]===h[1]&&o[0]===0&&o[1]===0&&f[0]===0&&f[1]===0&&(a.length===2||a[2]===h[2]&&o[2]===0&&f[2]===0)&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var d=e.k[0].s.length;for(this.v=createTypedArray("float32",d),this.pv=createTypedArray("float32",d),s=0;s<d;s+=1)this.v[s]=initFrame,this.pv[s]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",d)},this.addEffect=addEffect}var PropertyFactory=(function(){function t(r,i,s,n,a){i.sid&&(i=r.globalData.slotManager.getProp(i));var h;if(!i.k.length)h=new ValueProperty(r,i,n,a);else if(typeof i.k[0]=="number")h=new MultiDimensionalProperty(r,i,n,a);else switch(s){case 0:h=new KeyframedValueProperty(r,i,n,a);break;case 1:h=new KeyframedMultidimensionalProperty(r,i,n,a);break}return h.effectsSequence.length&&a.addDynamicProperty(h),h}var e={getProp:t};return e})();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){this.dynamicProperties.indexOf(e)===-1&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var e,r=this.dynamicProperties.length;for(e=0;e<r;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=(function(){function t(){return createTypedArray("float32",2)}return poolFactory(8,t)})();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=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,r,i,s){var n;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":n=this.v;break;case"i":n=this.i;break;case"o":n=this.o;break;default:n=[];break}(!n[i]||n[i]&&!s)&&(n[i]=pointPool.newElement()),n[i][0]=t,n[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,n,a,h){this.setXYAt(t,e,"v",a,h),this.setXYAt(r,i,"o",a,h),this.setXYAt(s,n,"i",a,h)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var n=this._length-1,a=this._length,h;for(h=s;h<a;h+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],h,!1),n-=1;return t},ShapePath.prototype.length=function(){return this._length};var shapePool=(function(){function t(){return new ShapePath}function e(s){var n=s._length,a;for(a=0;a<n;a+=1)pointPool.release(s.v[a]),pointPool.release(s.i[a]),pointPool.release(s.o[a]),s.v[a]=null,s.i[a]=null,s.o[a]=null;s._length=0,s.c=!1}function r(s){var n=i.newElement(),a,h=s._length===void 0?s.v.length:s._length;for(n.setLength(h),n.c=s.c,a=0;a<h;a+=1)n.setTripleAt(s.v[a][0],s.v[a][1],s.o[a][0],s.o[a][1],s.i[a][0],s.i[a][1],a);return n}var i=poolFactory(4,t,e);return i.clone=r,i})();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}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)shapePool.release(this.shapes[t]);this._length=0};var shapeCollectionPool=(function(){var t={newShapeCollection:s,release:n},e=0,r=4,i=createSizedArray(r);function s(){var a;return e?(e-=1,a=i[e]):a=new ShapeCollection,a}function n(a){var h,o=a._length;for(h=0;h<o;h+=1)shapePool.release(a.shapes[h]);a._length=0,e===r&&(i=pooling.double(i),r*=2),i[e]=a,e+=1}return t})(),ShapePropertyFactory=(function(){var t=-999999;function e(p,u,l){var y=l.lastIndex,E,x,A,F,w,z,R,L,O,G=this.keyframes;if(p<G[0].t-this.offsetTime)E=G[0].s[0],A=!0,y=0;else if(p>=G[G.length-1].t-this.offsetTime)E=G[G.length-1].s?G[G.length-1].s[0]:G[G.length-2].e[0],A=!0;else{for(var I=y,_=G.length-1,T=!0,g,P,k;T&&(g=G[I],P=G[I+1],!(P.t-this.offsetTime>p));)I<_-1?I+=1:T=!1;if(k=this.keyframesMetadata[I]||{},A=g.h===1,y=I,!A){if(p>=P.t-this.offsetTime)L=1;else if(p<g.t-this.offsetTime)L=0;else{var M;k.__fnct?M=k.__fnct:(M=BezierFactory.getBezierEasing(g.o.x,g.o.y,g.i.x,g.i.y).get,k.__fnct=M),L=M((p-(g.t-this.offsetTime))/(P.t-this.offsetTime-(g.t-this.offsetTime)))}x=P.s?P.s[0]:g.e[0]}E=g.s[0]}for(z=u._length,R=E.i[0].length,l.lastIndex=y,F=0;F<z;F+=1)for(w=0;w<R;w+=1)O=A?E.i[F][w]:E.i[F][w]+(x.i[F][w]-E.i[F][w])*L,u.i[F][w]=O,O=A?E.o[F][w]:E.o[F][w]+(x.o[F][w]-E.o[F][w])*L,u.o[F][w]=O,O=A?E.v[F][w]:E.v[F][w]+(x.v[F][w]-E.v[F][w])*L,u.v[F][w]=O}function r(){var p=this.comp.renderedFrame-this.offsetTime,u=this.keyframes[0].t-this.offsetTime,l=this.keyframes[this.keyframes.length-1].t-this.offsetTime,y=this._caching.lastFrame;return y!==t&&(y<u&&p<u||y>l&&p>l)||(this._caching.lastIndex=y<p?this._caching.lastIndex:0,this.interpolateShape(p,this.pv,this._caching)),this._caching.lastFrame=p,this.pv}function i(){this.paths=this.localShapeCollection}function s(p,u){if(p._length!==u._length||p.c!==u.c)return!1;var l,y=p._length;for(l=0;l<y;l+=1)if(p.v[l][0]!==u.v[l][0]||p.v[l][1]!==u.v[l][1]||p.o[l][0]!==u.o[l][0]||p.o[l][1]!==u.o[l][1]||p.i[l][0]!==u.i[l][0]||p.i[l][1]!==u.i[l][1])return!1;return!0}function n(p){s(this.v,p)||(this.v=shapePool.clone(p),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var p;this.kf?p=this.pv:this.data.ks?p=this.data.ks.k:p=this.data.pt.k;var u,l=this.effectsSequence.length;for(u=0;u<l;u+=1)p=this.effectsSequence[u](p);this.setVValue(p),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function h(p,u,l){this.propType="shape",this.comp=p.comp,this.container=p,this.elem=p,this.data=u,this.k=!1,this.kf=!1,this._mdf=!1;var y=l===3?u.pt.k:u.ks.k;this.v=shapePool.clone(y),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=i,this.effectsSequence=[]}function o(p){this.effectsSequence.push(p),this.container.addDynamicProperty(this)}h.prototype.interpolateShape=e,h.prototype.getValue=a,h.prototype.setVValue=n,h.prototype.addEffect=o;function f(p,u,l){this.propType="shape",this.comp=p.comp,this.elem=p,this.container=p,this.offsetTime=p.data.st,this.keyframes=l===3?u.pt.k:u.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var y=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,y),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=t,this.reset=i,this._caching={lastFrame:t,lastIndex:0},this.effectsSequence=[r.bind(this)]}f.prototype.getValue=a,f.prototype.interpolateShape=e,f.prototype.setVValue=n,f.prototype.addEffect=o;var d=(function(){var p=roundCorner;function u(l,y){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=y.d,this.elem=l,this.comp=l.comp,this.frameId=-1,this.initDynamicPropertyContainer(l),this.p=PropertyFactory.getProp(l,y.p,1,0,this),this.s=PropertyFactory.getProp(l,y.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return u.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 y=this.p.v[0],E=this.p.v[1],x=this.s.v[0]/2,A=this.s.v[1]/2,F=this.d!==3,w=this.v;w.v[0][0]=y,w.v[0][1]=E-A,w.v[1][0]=F?y+x:y-x,w.v[1][1]=E,w.v[2][0]=y,w.v[2][1]=E+A,w.v[3][0]=F?y-x:y+x,w.v[3][1]=E,w.i[0][0]=F?y-x*p:y+x*p,w.i[0][1]=E-A,w.i[1][0]=F?y+x:y-x,w.i[1][1]=E-A*p,w.i[2][0]=F?y+x*p:y-x*p,w.i[2][1]=E+A,w.i[3][0]=F?y-x:y+x,w.i[3][1]=E+A*p,w.o[0][0]=F?y+x*p:y-x*p,w.o[0][1]=E-A,w.o[1][0]=F?y+x:y-x,w.o[1][1]=E+A*p,w.o[2][0]=F?y-x*p:y+x*p,w.o[2][1]=E+A,w.o[3][0]=F?y-x:y+x,w.o[3][1]=E-A*p}},extendPrototype([DynamicPropertyContainer],u),u})(),S=(function(){function p(u,l){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=u,this.comp=u.comp,this.data=l,this.frameId=-1,this.d=l.d,this.initDynamicPropertyContainer(u),l.sy===1?(this.ir=PropertyFactory.getProp(u,l.ir,0,0,this),this.is=PropertyFactory.getProp(u,l.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(u,l.pt,0,0,this),this.p=PropertyFactory.getProp(u,l.p,1,0,this),this.r=PropertyFactory.getProp(u,l.r,0,degToRads,this),this.or=PropertyFactory.getProp(u,l.or,0,0,this),this.os=PropertyFactory.getProp(u,l.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return p.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 l=Math.floor(this.pt.v)*2,y=Math.PI*2/l,E=!0,x=this.or.v,A=this.ir.v,F=this.os.v,w=this.is.v,z=2*Math.PI*x/(l*2),R=2*Math.PI*A/(l*2),L,O,G,I,_=-Math.PI/2;_+=this.r.v;var T=this.data.d===3?-1:1;for(this.v._length=0,L=0;L<l;L+=1){O=E?x:A,G=E?F:w,I=E?z:R;var g=O*Math.cos(_),P=O*Math.sin(_),k=g===0&&P===0?0:P/Math.sqrt(g*g+P*P),M=g===0&&P===0?0:-g/Math.sqrt(g*g+P*P);g+=+this.p.v[0],P+=+this.p.v[1],this.v.setTripleAt(g,P,g-k*I*G*T,P-M*I*G*T,g+k*I*G*T,P+M*I*G*T,L,!0),E=!E,_+=y*T}},convertPolygonToPath:function(){var l=Math.floor(this.pt.v),y=Math.PI*2/l,E=this.or.v,x=this.os.v,A=2*Math.PI*E/(l*4),F,w=-Math.PI*.5,z=this.data.d===3?-1:1;for(w+=this.r.v,this.v._length=0,F=0;F<l;F+=1){var R=E*Math.cos(w),L=E*Math.sin(w),O=R===0&&L===0?0:L/Math.sqrt(R*R+L*L),G=R===0&&L===0?0:-R/Math.sqrt(R*R+L*L);R+=+this.p.v[0],L+=+this.p.v[1],this.v.setTripleAt(R,L,R-O*A*x*z,L-G*A*x*z,R+O*A*x*z,L+G*A*x*z,F,!0),w+=y*z}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],p),p})(),c=(function(){function p(u,l){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=u,this.comp=u.comp,this.frameId=-1,this.d=l.d,this.initDynamicPropertyContainer(u),this.p=PropertyFactory.getProp(u,l.p,1,0,this),this.s=PropertyFactory.getProp(u,l.s,1,0,this),this.r=PropertyFactory.getProp(u,l.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return p.prototype={convertRectToPath:function(){var l=this.p.v[0],y=this.p.v[1],E=this.s.v[0]/2,x=this.s.v[1]/2,A=bmMin(E,x,this.r.v),F=A*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(l+E,y-x+A,l+E,y-x+A,l+E,y-x+F,0,!0),this.v.setTripleAt(l+E,y+x-A,l+E,y+x-F,l+E,y+x-A,1,!0),A!==0?(this.v.setTripleAt(l+E-A,y+x,l+E-A,y+x,l+E-F,y+x,2,!0),this.v.setTripleAt(l-E+A,y+x,l-E+F,y+x,l-E+A,y+x,3,!0),this.v.setTripleAt(l-E,y+x-A,l-E,y+x-A,l-E,y+x-F,4,!0),this.v.setTripleAt(l-E,y-x+A,l-E,y-x+F,l-E,y-x+A,5,!0),this.v.setTripleAt(l-E+A,y-x,l-E+A,y-x,l-E+F,y-x,6,!0),this.v.setTripleAt(l+E-A,y-x,l+E-F,y-x,l+E-A,y-x,7,!0)):(this.v.setTripleAt(l-E,y+x,l-E+F,y+x,l-E,y+x,2),this.v.setTripleAt(l-E,y-x,l-E,y-x+F,l-E,y-x,3))):(this.v.setTripleAt(l+E,y-x+A,l+E,y-x+F,l+E,y-x+A,0,!0),A!==0?(this.v.setTripleAt(l+E-A,y-x,l+E-A,y-x,l+E-F,y-x,1,!0),this.v.setTripleAt(l-E+A,y-x,l-E+F,y-x,l-E+A,y-x,2,!0),this.v.setTripleAt(l-E,y-x+A,l-E,y-x+A,l-E,y-x+F,3,!0),this.v.setTripleAt(l-E,y+x-A,l-E,y+x-F,l-E,y+x-A,4,!0),this.v.setTripleAt(l-E+A,y+x,l-E+A,y+x,l-E+F,y+x,5,!0),this.v.setTripleAt(l+E-A,y+x,l+E-F,y+x,l+E-A,y+x,6,!0),this.v.setTripleAt(l+E,y+x-A,l+E,y+x-A,l+E,y+x-F,7,!0)):(this.v.setTripleAt(l-E,y-x,l-E+F,y-x,l-E,y-x,1,!0),this.v.setTripleAt(l-E,y+x,l-E,y+x-F,l-E,y+x,2,!0),this.v.setTripleAt(l+E,y+x,l+E-F,y+x,l+E,y+x,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:i},extendPrototype([DynamicPropertyContainer],p),p})();function b(p,u,l){var y;if(l===3||l===4){var E=l===3?u.pt:u.ks,x=E.k;x.length?y=new f(p,u,l):y=new h(p,u,l)}else l===5?y=new c(p,u):l===6?y=new d(p,u):l===7&&(y=new S(p,u));return y.k&&p.addDynamicProperty(y),y}function v(){return h}function m(){return f}var C={};return C.getShapeProp=b,C.getConstructorFunction=v,C.getKeyframedConstructorFunction=m,C})();/*!
3
3
  Transformation Matrix v2.0
4
4
  (c) Epistemex 2014-2015
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8
8
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet" />
9
9
  <title>Teleton</title>
10
- <script type="module" crossorigin src="/assets/index-BfYCdwLI.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-Dn5ZH1Y6.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-DmlyQVhR.css">
12
12
  </head>
13
13
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teleton",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "workspaces": [
5
5
  "packages/*"
6
6
  ],
@@ -67,7 +67,7 @@
67
67
  "@hono/node-server": "^1.19.9",
68
68
  "@huggingface/transformers": "^3.8.1",
69
69
  "@inquirer/prompts": "^8.2.1",
70
- "@mariozechner/pi-ai": "^0.57.1",
70
+ "@mariozechner/pi-ai": "^0.58.1",
71
71
  "@modelcontextprotocol/sdk": "^1.26.0",
72
72
  "@sinclair/typebox": "^0.34.48",
73
73
  "@tavily/core": "^0.7.1",
@@ -78,7 +78,6 @@
78
78
  "chalk": "^5.6.2",
79
79
  "chokidar": "^5.0.0",
80
80
  "commander": "^14.0.3",
81
- "crypto-js": "^4.2.0",
82
81
  "grammy": "^1.40.0",
83
82
  "hono": "^4.11.9",
84
83
  "hono-rate-limiter": "^0.5.3",
@@ -113,9 +112,6 @@
113
112
  "typescript": "^5.7.0",
114
113
  "vitest": "^4.0.18"
115
114
  },
116
- "optionalDependencies": {
117
- "edge-tts": "^1.0.1"
118
- },
119
115
  "engines": {
120
116
  "node": ">=20.0.0"
121
117
  },
@@ -0,0 +1,5 @@
1
+ # Heartbeat
2
+
3
+ Add tasks below. The agent checks this file periodically.
4
+
5
+ - [ ] Example: Check TON wallet balance
@@ -1,142 +0,0 @@
1
- import {
2
- ConfigSchema
3
- } from "./chunk-AERHOXGC.js";
4
- import {
5
- getProviderMetadata
6
- } from "./chunk-6OOHHJ4N.js";
7
- import {
8
- TELETON_ROOT
9
- } from "./chunk-EYWNOHMJ.js";
10
- import {
11
- createLogger
12
- } from "./chunk-NQ6FZKCE.js";
13
-
14
- // src/config/loader.ts
15
- import { readFileSync, existsSync, writeFileSync, mkdirSync } from "fs";
16
- import { parse, stringify } from "yaml";
17
- import { homedir } from "os";
18
- import { dirname, join } from "path";
19
- var log = createLogger("Config");
20
- var DEFAULT_CONFIG_PATH = join(TELETON_ROOT, "config.yaml");
21
- function expandPath(path) {
22
- if (path.startsWith("~")) {
23
- return join(homedir(), path.slice(1));
24
- }
25
- return path;
26
- }
27
- function loadConfig(configPath = DEFAULT_CONFIG_PATH) {
28
- const fullPath = expandPath(configPath);
29
- if (!existsSync(fullPath)) {
30
- throw new Error(`Config file not found: ${fullPath}
31
- Run 'teleton setup' to create one.`);
32
- }
33
- let content;
34
- try {
35
- content = readFileSync(fullPath, "utf-8");
36
- } catch (error) {
37
- throw new Error(`Cannot read config file ${fullPath}: ${error.message}`);
38
- }
39
- let raw;
40
- try {
41
- raw = parse(content);
42
- } catch (error) {
43
- throw new Error(`Invalid YAML in ${fullPath}: ${error.message}`);
44
- }
45
- if (raw && typeof raw === "object" && "market" in raw) {
46
- log.warn("config.market is deprecated and ignored. Use market-api plugin instead.");
47
- delete raw.market;
48
- }
49
- const result = ConfigSchema.safeParse(raw);
50
- if (!result.success) {
51
- throw new Error(`Invalid config: ${result.error.message}`);
52
- }
53
- const config = result.data;
54
- const provider = config.agent.provider;
55
- if (provider !== "anthropic" && provider !== "claude-code" && !raw.agent?.model) {
56
- const meta = getProviderMetadata(provider);
57
- config.agent.model = meta.defaultModel;
58
- }
59
- config.telegram.session_path = expandPath(config.telegram.session_path);
60
- config.storage.sessions_file = expandPath(config.storage.sessions_file);
61
- config.storage.memory_file = expandPath(config.storage.memory_file);
62
- if (process.env.TELETON_API_KEY) {
63
- config.agent.api_key = process.env.TELETON_API_KEY;
64
- }
65
- if (process.env.TELETON_TG_API_ID) {
66
- const apiId = parseInt(process.env.TELETON_TG_API_ID, 10);
67
- if (isNaN(apiId)) {
68
- throw new Error(
69
- `Invalid TELETON_TG_API_ID environment variable: "${process.env.TELETON_TG_API_ID}" is not a valid integer`
70
- );
71
- }
72
- config.telegram.api_id = apiId;
73
- }
74
- if (process.env.TELETON_TG_API_HASH) {
75
- config.telegram.api_hash = process.env.TELETON_TG_API_HASH;
76
- }
77
- if (process.env.TELETON_TG_PHONE) {
78
- config.telegram.phone = process.env.TELETON_TG_PHONE;
79
- }
80
- if (process.env.TELETON_WEBUI_ENABLED) {
81
- config.webui.enabled = process.env.TELETON_WEBUI_ENABLED === "true";
82
- }
83
- if (process.env.TELETON_WEBUI_PORT) {
84
- const port = parseInt(process.env.TELETON_WEBUI_PORT, 10);
85
- if (!isNaN(port) && port >= 1024 && port <= 65535) {
86
- config.webui.port = port;
87
- }
88
- }
89
- if (process.env.TELETON_WEBUI_HOST) {
90
- config.webui.host = process.env.TELETON_WEBUI_HOST;
91
- if (!["127.0.0.1", "localhost", "::1"].includes(config.webui.host)) {
92
- log.warn(
93
- { host: config.webui.host },
94
- "WebUI bound to non-loopback address \u2014 ensure auth_token is set"
95
- );
96
- }
97
- }
98
- if (process.env.TELETON_API_ENABLED) {
99
- if (!config.api) config.api = { enabled: false, port: 7778, key_hash: "", allowed_ips: [] };
100
- config.api.enabled = process.env.TELETON_API_ENABLED === "true";
101
- }
102
- if (process.env.TELETON_API_PORT) {
103
- const port = parseInt(process.env.TELETON_API_PORT, 10);
104
- if (!isNaN(port) && port >= 1024 && port <= 65535) {
105
- if (!config.api) config.api = { enabled: false, port: 7778, key_hash: "", allowed_ips: [] };
106
- config.api.port = port;
107
- }
108
- }
109
- if (process.env.TELETON_BASE_URL) {
110
- try {
111
- new URL(process.env.TELETON_BASE_URL);
112
- config.agent.base_url = process.env.TELETON_BASE_URL;
113
- } catch {
114
- throw new Error(
115
- `Invalid TELETON_BASE_URL: "${process.env.TELETON_BASE_URL}" is not a valid URL`
116
- );
117
- }
118
- }
119
- if (process.env.TELETON_TAVILY_API_KEY) {
120
- config.tavily_api_key = process.env.TELETON_TAVILY_API_KEY;
121
- }
122
- if (process.env.TELETON_TONAPI_KEY) {
123
- config.tonapi_key = process.env.TELETON_TONAPI_KEY;
124
- }
125
- if (process.env.TELETON_TONCENTER_API_KEY) {
126
- config.toncenter_api_key = process.env.TELETON_TONCENTER_API_KEY;
127
- }
128
- return config;
129
- }
130
- function configExists(configPath = DEFAULT_CONFIG_PATH) {
131
- return existsSync(expandPath(configPath));
132
- }
133
- function getDefaultConfigPath() {
134
- return DEFAULT_CONFIG_PATH;
135
- }
136
-
137
- export {
138
- expandPath,
139
- loadConfig,
140
- configExists,
141
- getDefaultConfigPath
142
- };
@@ -1,251 +0,0 @@
1
- import {
2
- COINGECKO_API_URL,
3
- tonapiFetch
4
- } from "./chunk-VFA7QMCZ.js";
5
- import {
6
- fetchWithTimeout
7
- } from "./chunk-XQUHC3JZ.js";
8
- import {
9
- TELETON_ROOT
10
- } from "./chunk-EYWNOHMJ.js";
11
- import {
12
- createLogger
13
- } from "./chunk-NQ6FZKCE.js";
14
-
15
- // src/ton/endpoint.ts
16
- var ENDPOINT_CACHE_TTL_MS = 6e4;
17
- var ORBS_HOST = "ton.access.orbs.network";
18
- var ORBS_TOPOLOGY_URL = `https://${ORBS_HOST}/mngr/nodes?npm_version=2.3.3`;
19
- var TONCENTER_URL = `https://toncenter.com/api/v2/jsonRPC`;
20
- var _cache = null;
21
- var _toncenterApiKey;
22
- function setToncenterApiKey(key) {
23
- _toncenterApiKey = key;
24
- }
25
- function getToncenterApiKey() {
26
- return _toncenterApiKey;
27
- }
28
- async function discoverOrbsEndpoint() {
29
- const res = await fetch(ORBS_TOPOLOGY_URL, { signal: AbortSignal.timeout(5e3) });
30
- const nodes = await res.json();
31
- const healthy = nodes.filter(
32
- (n) => n.Healthy === "1" && n.Weight > 0 && n.Mngr?.health?.["v2-mainnet"]
33
- );
34
- if (healthy.length === 0) throw new Error("no healthy orbs nodes");
35
- const totalWeight = healthy.reduce((sum, n) => sum + n.Weight, 0);
36
- let r = Math.floor(Math.random() * totalWeight);
37
- let chosen = healthy[0];
38
- for (const node of healthy) {
39
- r -= node.Weight;
40
- if (r < 0) {
41
- chosen = node;
42
- break;
43
- }
44
- }
45
- return `https://${ORBS_HOST}/${chosen.NodeId}/1/mainnet/toncenter-api-v2/jsonRPC`;
46
- }
47
- async function getCachedHttpEndpoint() {
48
- if (_cache && Date.now() - _cache.ts < ENDPOINT_CACHE_TTL_MS) {
49
- return _cache.url;
50
- }
51
- let url;
52
- if (_toncenterApiKey) {
53
- try {
54
- const testUrl = `https://toncenter.com/api/v2/getAddressInformation?address=EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c`;
55
- const res = await fetch(testUrl, {
56
- headers: { "X-API-Key": _toncenterApiKey },
57
- signal: AbortSignal.timeout(5e3)
58
- });
59
- if (!res.ok) throw new Error(`TonCenter ${res.status}`);
60
- url = TONCENTER_URL;
61
- } catch {
62
- try {
63
- url = await discoverOrbsEndpoint();
64
- } catch {
65
- url = TONCENTER_URL;
66
- }
67
- }
68
- } else {
69
- try {
70
- url = await discoverOrbsEndpoint();
71
- } catch {
72
- url = TONCENTER_URL;
73
- }
74
- }
75
- _cache = { url, ts: Date.now() };
76
- return url;
77
- }
78
- function invalidateEndpointCache() {
79
- _cache = null;
80
- }
81
-
82
- // src/ton/wallet-service.ts
83
- import { mnemonicNew, mnemonicToPrivateKey, mnemonicValidate } from "@ton/crypto";
84
- import { WalletContractV5R1, TonClient, fromNano } from "@ton/ton";
85
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
86
- import { join, dirname } from "path";
87
- var log = createLogger("TON");
88
- var WALLET_FILE = join(TELETON_ROOT, "wallet.json");
89
- var _walletCache;
90
- var _keyPairCache = null;
91
- var _tonClientCache = null;
92
- async function generateWallet() {
93
- const mnemonic = await mnemonicNew(24);
94
- const keyPair = await mnemonicToPrivateKey(mnemonic);
95
- const wallet = WalletContractV5R1.create({
96
- workchain: 0,
97
- publicKey: keyPair.publicKey
98
- });
99
- const address = wallet.address.toString({ bounceable: true, testOnly: false });
100
- return {
101
- version: "w5r1",
102
- address,
103
- publicKey: keyPair.publicKey.toString("hex"),
104
- mnemonic,
105
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
106
- };
107
- }
108
- function saveWallet(wallet) {
109
- const dir = dirname(WALLET_FILE);
110
- if (!existsSync(dir)) {
111
- mkdirSync(dir, { recursive: true });
112
- }
113
- writeFileSync(WALLET_FILE, JSON.stringify(wallet, null, 2), { encoding: "utf-8", mode: 384 });
114
- _walletCache = void 0;
115
- _keyPairCache = null;
116
- }
117
- function loadWallet() {
118
- if (_walletCache !== void 0) return _walletCache;
119
- if (!existsSync(WALLET_FILE)) {
120
- _walletCache = null;
121
- return null;
122
- }
123
- try {
124
- const content = readFileSync(WALLET_FILE, "utf-8");
125
- const parsed = JSON.parse(content);
126
- if (!parsed.mnemonic || !Array.isArray(parsed.mnemonic) || parsed.mnemonic.length !== 24) {
127
- throw new Error("Invalid wallet.json: mnemonic must be a 24-word array");
128
- }
129
- _walletCache = parsed;
130
- return _walletCache;
131
- } catch (error) {
132
- log.error({ err: error }, "Failed to load wallet");
133
- _walletCache = null;
134
- return null;
135
- }
136
- }
137
- function walletExists() {
138
- return existsSync(WALLET_FILE);
139
- }
140
- async function importWallet(mnemonic) {
141
- const valid = await mnemonicValidate(mnemonic);
142
- if (!valid) {
143
- throw new Error("Invalid mnemonic: words do not form a valid TON seed phrase");
144
- }
145
- const keyPair = await mnemonicToPrivateKey(mnemonic);
146
- const wallet = WalletContractV5R1.create({
147
- workchain: 0,
148
- publicKey: keyPair.publicKey
149
- });
150
- const address = wallet.address.toString({ bounceable: true, testOnly: false });
151
- return {
152
- version: "w5r1",
153
- address,
154
- publicKey: keyPair.publicKey.toString("hex"),
155
- mnemonic,
156
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
157
- };
158
- }
159
- function getWalletAddress() {
160
- const wallet = loadWallet();
161
- return wallet?.address || null;
162
- }
163
- async function getCachedTonClient() {
164
- const endpoint = await getCachedHttpEndpoint();
165
- if (_tonClientCache && _tonClientCache.endpoint === endpoint) {
166
- return _tonClientCache.client;
167
- }
168
- const apiKey = getToncenterApiKey();
169
- const client = new TonClient({ endpoint, ...apiKey && { apiKey } });
170
- _tonClientCache = { client, endpoint };
171
- return client;
172
- }
173
- function invalidateTonClientCache() {
174
- _tonClientCache = null;
175
- invalidateEndpointCache();
176
- }
177
- async function getKeyPair() {
178
- if (_keyPairCache) return _keyPairCache;
179
- const wallet = loadWallet();
180
- if (!wallet) return null;
181
- _keyPairCache = await mnemonicToPrivateKey(wallet.mnemonic);
182
- return _keyPairCache;
183
- }
184
- async function getWalletBalance(address) {
185
- try {
186
- const client = await getCachedTonClient();
187
- const { Address } = await import("@ton/core");
188
- const addressObj = Address.parse(address);
189
- const balance = await client.getBalance(addressObj);
190
- const balanceFormatted = fromNano(balance);
191
- return {
192
- balance: balanceFormatted,
193
- balanceNano: balance.toString()
194
- };
195
- } catch (error) {
196
- log.error({ err: error }, "Failed to get balance");
197
- return null;
198
- }
199
- }
200
- var TON_PRICE_CACHE_TTL_MS = 3e4;
201
- var _tonPriceCache = null;
202
- async function getTonPrice() {
203
- if (_tonPriceCache && Date.now() - _tonPriceCache.timestamp < TON_PRICE_CACHE_TTL_MS) {
204
- return { ..._tonPriceCache };
205
- }
206
- try {
207
- const response = await tonapiFetch(`/rates?tokens=ton&currencies=usd`);
208
- if (response.ok) {
209
- const data = await response.json();
210
- const price = data?.rates?.TON?.prices?.USD;
211
- if (typeof price === "number" && price > 0) {
212
- _tonPriceCache = { usd: price, source: "TonAPI", timestamp: Date.now() };
213
- return _tonPriceCache;
214
- }
215
- }
216
- } catch {
217
- }
218
- try {
219
- const response = await fetchWithTimeout(
220
- `${COINGECKO_API_URL}/simple/price?ids=the-open-network&vs_currencies=usd`
221
- );
222
- if (!response.ok) {
223
- throw new Error(`CoinGecko API error: ${response.status}`);
224
- }
225
- const data = await response.json();
226
- const price = data["the-open-network"]?.usd;
227
- if (typeof price === "number" && price > 0) {
228
- _tonPriceCache = { usd: price, source: "CoinGecko", timestamp: Date.now() };
229
- return _tonPriceCache;
230
- }
231
- } catch (error) {
232
- log.error({ err: error }, "Failed to get TON price");
233
- }
234
- return null;
235
- }
236
-
237
- export {
238
- setToncenterApiKey,
239
- invalidateEndpointCache,
240
- generateWallet,
241
- saveWallet,
242
- loadWallet,
243
- walletExists,
244
- importWallet,
245
- getWalletAddress,
246
- getCachedTonClient,
247
- invalidateTonClientCache,
248
- getKeyPair,
249
- getWalletBalance,
250
- getTonPrice
251
- };