@rabbitio/ui-kit 1.0.0-beta.2 → 1.0.0-beta.21
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.
- package/CHANGELOG.md +0 -0
- package/README.md +23 -16
- package/dist/index.cjs +4404 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8757 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +3692 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +4375 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +4406 -1
- package/dist/index.umd.js.map +1 -1
- package/index.js +1 -1
- package/package.json +17 -24
- package/src/common/amountUtils.js +423 -0
- package/src/common/errorUtils.js +27 -0
- package/src/common/fiatCurrenciesService.js +161 -0
- package/src/common/models/blockchain.js +10 -0
- package/src/common/models/coin.js +157 -0
- package/src/common/models/protocol.js +5 -0
- package/src/common/utils/cache.js +268 -0
- package/src/common/utils/emailAPI.js +18 -0
- package/src/common/utils/logging/logger.js +48 -0
- package/src/common/utils/logging/logsStorage.js +61 -0
- package/src/common/utils/safeStringify.js +50 -0
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +55 -0
- package/src/components/atoms/AssetIcon/asset-icon.module.scss +42 -0
- package/{stories → src/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/components/atoms/SupportChat/SupportChat.jsx +40 -0
- package/{stories → src/components}/atoms/buttons/Button/Button.jsx +6 -6
- package/{stories → src/components}/atoms/buttons/Button/Button.module.scss +6 -1
- package/src/components/hooks/useCallHandlingErrors.js +26 -0
- package/src/components/hooks/useReferredState.js +24 -0
- package/src/index.js +33 -0
- package/src/swaps-lib/external-apis/swapProvider.js +169 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +812 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +40 -0
- package/src/swaps-lib/models/existingSwap.js +58 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +115 -0
- package/src/swaps-lib/services/publicSwapService.js +602 -0
- package/src/swaps-lib/utils/swapUtils.js +209 -0
- package/stories/index.js +0 -2
- /package/{stories → src/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
package/dist/index.modern.js
CHANGED
|
@@ -1,2 +1,3693 @@
|
|
|
1
|
-
import{useState as m,useRef as _,useEffect as l}from"react";import{Link as t}from"react-router-dom";function p(m){var _={exports:{}};return m(_,_.exports),_.exports}var r="function"==typeof Symbol&&Symbol.for,e=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,x=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,y=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,u=r?Symbol.for("react.memo"):60115,f=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,S=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,T=r?Symbol.for("react.scope"):60119;function O(m){if("object"==typeof m&&null!==m){var _=m.$$typeof;switch(_){case e:switch(m=m.type){case x:case c:case o:case a:case s:case g:return m;default:switch(m=m&&m.$$typeof){case d:case y:case f:case u:case i:return m;default:return _}}case n:return _}}}function E(m){return O(m)===c}var k={AsyncMode:x,ConcurrentMode:c,ContextConsumer:d,ContextProvider:i,Element:e,ForwardRef:y,Fragment:o,Lazy:f,Memo:u,Portal:n,Profiler:a,StrictMode:s,Suspense:g,isAsyncMode:function(m){return E(m)||O(m)===x},isConcurrentMode:E,isContextConsumer:function(m){return O(m)===d},isContextProvider:function(m){return O(m)===i},isElement:function(m){return"object"==typeof m&&null!==m&&m.$$typeof===e},isForwardRef:function(m){return O(m)===y},isFragment:function(m){return O(m)===o},isLazy:function(m){return O(m)===f},isMemo:function(m){return O(m)===u},isPortal:function(m){return O(m)===n},isProfiler:function(m){return O(m)===a},isStrictMode:function(m){return O(m)===s},isSuspense:function(m){return O(m)===g},isValidElementType:function(m){return"string"==typeof m||"function"==typeof m||m===o||m===c||m===a||m===s||m===g||m===b||"object"==typeof m&&null!==m&&(m.$$typeof===f||m.$$typeof===u||m.$$typeof===i||m.$$typeof===d||m.$$typeof===y||m.$$typeof===S||m.$$typeof===w||m.$$typeof===T||m.$$typeof===v)},typeOf:O},P=p(function(m,_){"production"!==process.env.NODE_ENV&&function(){var m="function"==typeof Symbol&&Symbol.for,l=m?Symbol.for("react.element"):60103,t=m?Symbol.for("react.portal"):60106,p=m?Symbol.for("react.fragment"):60107,r=m?Symbol.for("react.strict_mode"):60108,e=m?Symbol.for("react.profiler"):60114,n=m?Symbol.for("react.provider"):60109,o=m?Symbol.for("react.context"):60110,s=m?Symbol.for("react.async_mode"):60111,a=m?Symbol.for("react.concurrent_mode"):60111,i=m?Symbol.for("react.forward_ref"):60112,d=m?Symbol.for("react.suspense"):60113,x=m?Symbol.for("react.suspense_list"):60120,c=m?Symbol.for("react.memo"):60115,y=m?Symbol.for("react.lazy"):60116,g=m?Symbol.for("react.block"):60121,b=m?Symbol.for("react.fundamental"):60117,u=m?Symbol.for("react.responder"):60118,f=m?Symbol.for("react.scope"):60119;function h(m){if("object"==typeof m&&null!==m){var _=m.$$typeof;switch(_){case l:var x=m.type;switch(x){case s:case a:case p:case e:case r:case d:return x;default:var g=x&&x.$$typeof;switch(g){case o:case i:case y:case c:case n:return g;default:return _}}case t:return _}}}var v=a,S=o,w=n,T=l,O=i,E=p,k=y,P=c,C=t,j=e,B=r,I=d,N=!1;function R(m){return h(m)===a}_.AsyncMode=s,_.ConcurrentMode=v,_.ContextConsumer=S,_.ContextProvider=w,_.Element=T,_.ForwardRef=O,_.Fragment=E,_.Lazy=k,_.Memo=P,_.Portal=C,_.Profiler=j,_.StrictMode=B,_.Suspense=I,_.isAsyncMode=function(m){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(m)||h(m)===s},_.isConcurrentMode=R,_.isContextConsumer=function(m){return h(m)===o},_.isContextProvider=function(m){return h(m)===n},_.isElement=function(m){return"object"==typeof m&&null!==m&&m.$$typeof===l},_.isForwardRef=function(m){return h(m)===i},_.isFragment=function(m){return h(m)===p},_.isLazy=function(m){return h(m)===y},_.isMemo=function(m){return h(m)===c},_.isPortal=function(m){return h(m)===t},_.isProfiler=function(m){return h(m)===e},_.isStrictMode=function(m){return h(m)===r},_.isSuspense=function(m){return h(m)===d},_.isValidElementType=function(m){return"string"==typeof m||"function"==typeof m||m===p||m===a||m===e||m===r||m===d||m===x||"object"==typeof m&&null!==m&&(m.$$typeof===y||m.$$typeof===c||m.$$typeof===n||m.$$typeof===o||m.$$typeof===i||m.$$typeof===b||m.$$typeof===u||m.$$typeof===f||m.$$typeof===g)},_.typeOf=h}()}),C=p(function(m){m.exports="production"===process.env.NODE_ENV?k:P}),j=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,N=function(){try{if(!Object.assign)return!1;var m=new String("abc");if(m[5]="de","5"===Object.getOwnPropertyNames(m)[0])return!1;for(var _={},l=0;l<10;l++)_["_"+String.fromCharCode(l)]=l;var t=Object.getOwnPropertyNames(_).map(function(m){return _[m]});if("0123456789"!==t.join(""))return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(m){p[m]=m}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},p)).join("")}catch(m){return!1}}()?Object.assign:function(m,_){for(var l,t,p=function(m){if(null==m)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(m)}(m),r=1;r<arguments.length;r++){for(var e in l=Object(arguments[r]))B.call(l,e)&&(p[e]=l[e]);if(j){t=j(l);for(var n=0;n<t.length;n++)I.call(l,t[n])&&(p[t[n]]=l[t[n]])}}return p},R=Function.call.bind(Object.prototype.hasOwnProperty),K="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",q=R,G=function(){};if("production"!==process.env.NODE_ENV){var M=K,D={},A=q;G=function(m){var _="Warning: "+m;"undefined"!=typeof console&&console.error(_);try{throw new Error(_)}catch(m){}}}function V(m,_,l,t,p){if("production"!==process.env.NODE_ENV)for(var r in m)if(A(m,r)){var e;try{if("function"!=typeof m[r]){var n=Error((t||"React class")+": "+l+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof m[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw n.name="Invariant Violation",n}e=m[r](_,r,t,l,null,M)}catch(m){e=m}if(!e||e instanceof Error||G((t||"React class")+": type specification of "+l+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof e+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),e instanceof Error&&!(e.message in D)){D[e.message]=!0;var o=p?p():"";G("Failed "+l+" type: "+e.message+(null!=o?o:""))}}}V.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(D={})};var Z=V,F=function(){};function W(){return null}function U(){}function z(){}"production"!==process.env.NODE_ENV&&(F=function(m){var _="Warning: "+m;"undefined"!=typeof console&&console.error(_);try{throw new Error(_)}catch(m){}}),z.resetWarningCache=U;var J=p(function(m){m.exports="production"!==process.env.NODE_ENV?function(m,_){var l="function"==typeof Symbol&&Symbol.iterator,t="<<anonymous>>",p={array:o("array"),bigint:o("bigint"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),symbol:o("symbol"),any:n(W),arrayOf:function(m){return n(function(_,l,t,p,r){if("function"!=typeof m)return new e("Property `"+r+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var n=_[l];if(!Array.isArray(n))return new e("Invalid "+p+" `"+r+"` of type `"+i(n)+"` supplied to `"+t+"`, expected an array.");for(var o=0;o<n.length;o++){var s=m(n,o,t,p,r+"["+o+"]",K);if(s instanceof Error)return s}return null})},element:n(function(_,l,t,p,r){var n=_[l];return m(n)?null:new e("Invalid "+p+" `"+r+"` of type `"+i(n)+"` supplied to `"+t+"`, expected a single ReactElement.")}),elementType:n(function(m,_,l,t,p){var r=m[_];return C.isValidElementType(r)?null:new e("Invalid "+t+" `"+p+"` of type `"+i(r)+"` supplied to `"+l+"`, expected a single ReactElement type.")}),instanceOf:function(m){return n(function(_,l,p,r,n){return _[l]instanceof m?null:new e("Invalid "+r+" `"+n+"` of type `"+((o=_[l]).constructor&&o.constructor.name?o.constructor.name:t)+"` supplied to `"+p+"`, expected instance of `"+(m.name||t)+"`.");var o})},node:n(function(m,_,l,t,p){return a(m[_])?null:new e("Invalid "+t+" `"+p+"` supplied to `"+l+"`, expected a ReactNode.")}),objectOf:function(m){return n(function(_,l,t,p,r){if("function"!=typeof m)return new e("Property `"+r+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var n=_[l],o=i(n);if("object"!==o)return new e("Invalid "+p+" `"+r+"` of type `"+o+"` supplied to `"+t+"`, expected an object.");for(var s in n)if(q(n,s)){var a=m(n,s,t,p,r+"."+s,K);if(a instanceof Error)return a}return null})},oneOf:function(m){return Array.isArray(m)?n(function(_,l,t,p,n){for(var o=_[l],s=0;s<m.length;s++)if(r(o,m[s]))return null;var a=JSON.stringify(m,function(m,_){return"symbol"===d(_)?String(_):_});return new e("Invalid "+p+" `"+n+"` of value `"+String(o)+"` supplied to `"+t+"`, expected one of "+a+".")}):("production"!==process.env.NODE_ENV&&F(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),W)},oneOfType:function(m){if(!Array.isArray(m))return"production"!==process.env.NODE_ENV&&F("Invalid argument supplied to oneOfType, expected an instance of array."),W;for(var _=0;_<m.length;_++){var l=m[_];if("function"!=typeof l)return F("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(l)+" at index "+_+"."),W}return n(function(_,l,t,p,r){for(var n=[],o=0;o<m.length;o++){var s=(0,m[o])(_,l,t,p,r,K);if(null==s)return null;s.data&&q(s.data,"expectedType")&&n.push(s.data.expectedType)}return new e("Invalid "+p+" `"+r+"` supplied to `"+t+"`"+(n.length>0?", expected one of type ["+n.join(", ")+"]":"")+".")})},shape:function(m){return n(function(_,l,t,p,r){var n=_[l],o=i(n);if("object"!==o)return new e("Invalid "+p+" `"+r+"` of type `"+o+"` supplied to `"+t+"`, expected `object`.");for(var a in m){var x=m[a];if("function"!=typeof x)return s(t,p,r,a,d(x));var c=x(n,a,t,p,r+"."+a,K);if(c)return c}return null})},exact:function(m){return n(function(_,l,t,p,r){var n=_[l],o=i(n);if("object"!==o)return new e("Invalid "+p+" `"+r+"` of type `"+o+"` supplied to `"+t+"`, expected `object`.");var a=N({},_[l],m);for(var x in a){var c=m[x];if(q(m,x)&&"function"!=typeof c)return s(t,p,r,x,d(c));if(!c)return new e("Invalid "+p+" `"+r+"` key `"+x+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(_[l],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(m),null," "));var y=c(n,x,t,p,r+"."+x,K);if(y)return y}return null})}};function r(m,_){return m===_?0!==m||1/m==1/_:m!=m&&_!=_}function e(m,_){this.message=m,this.data=_&&"object"==typeof _?_:{},this.stack=""}function n(m){if("production"!==process.env.NODE_ENV)var l={},p=0;function r(r,n,o,s,a,i,d){if(s=s||t,i=i||o,d!==K){if(_){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var c=s+":"+o;!l[c]&&p<3&&(F("You are manually calling a React.PropTypes validation function for the `"+i+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),l[c]=!0,p++)}}return null==n[o]?r?new e(null===n[o]?"The "+a+" `"+i+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+a+" `"+i+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:m(n,o,s,a,i)}var n=r.bind(null,!1);return n.isRequired=r.bind(null,!0),n}function o(m){return n(function(_,l,t,p,r,n){var o=_[l];return i(o)!==m?new e("Invalid "+p+" `"+r+"` of type `"+d(o)+"` supplied to `"+t+"`, expected `"+m+"`.",{expectedType:m}):null})}function s(m,_,l,t,p){return new e((m||"React class")+": "+_+" type `"+l+"."+t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+p+"`.")}function a(_){switch(typeof _){case"number":case"string":case"undefined":return!0;case"boolean":return!_;case"object":if(Array.isArray(_))return _.every(a);if(null===_||m(_))return!0;var t=function(m){var _=m&&(l&&m[l]||m["@@iterator"]);if("function"==typeof _)return _}(_);if(!t)return!1;var p,r=t.call(_);if(t!==_.entries){for(;!(p=r.next()).done;)if(!a(p.value))return!1}else for(;!(p=r.next()).done;){var e=p.value;if(e&&!a(e[1]))return!1}return!0;default:return!1}}function i(m){var _=typeof m;return Array.isArray(m)?"array":m instanceof RegExp?"object":function(m,_){return"symbol"===m||!!_&&("Symbol"===_["@@toStringTag"]||"function"==typeof Symbol&&_ instanceof Symbol)}(_,m)?"symbol":_}function d(m){if(null==m)return""+m;var _=i(m);if("object"===_){if(m instanceof Date)return"date";if(m instanceof RegExp)return"regexp"}return _}function x(m){var _=d(m);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}return e.prototype=Error.prototype,p.checkPropTypes=Z,p.resetWarningCache=Z.resetWarningCache,p.PropTypes=p,p}(C.isElement,!0):function(){function m(m,_,l,t,p,r){if(r!==K){var e=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw e.name="Invariant Violation",e}}function _(){return m}m.isRequired=m;var l={array:m,bigint:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:_,element:m,elementType:m,instanceOf:_,node:m,objectOf:_,oneOf:_,oneOfType:_,shape:_,exact:_,checkPropTypes:z,resetWarningCache:U};return l.PropTypes=l,l}()}),L={container:"_Og09u",button:"_Jk9i-","m-0":"_1KRN6","p-0":"_gcKRj","m-1":"_yWCA-","p-1":"_vnN2l","m-2":"_oVgmY","p-2":"_OguP4","m-3":"_Kh1Mk","p-3":"_Z3Isk","m-4":"_6MAp6","p-4":"_Diglh","m-5":"_TO5Nq","p-5":"_HXLSK","m-6":"_HUNIG","p-6":"_f4arD","m-7":"_mZxzR","p-7":"_wzNuy","m-8":"_RVlle","p-8":"_OjqW3","m-9":"_Dejbg","p-9":"_islrX","m-10":"_wj-xZ","p-10":"_xz5kd","ml-0":"_B6vO4","pl-0":"_d137A","ml-1":"_F964v","pl-1":"_cUcnb","ml-2":"_sAUua","pl-2":"_ineea","ml-3":"_Q7vDo","pl-3":"_RaOUn","ml-4":"_QXOxT","pl-4":"_IOfD0","ml-5":"_yxiUW","pl-5":"_Tppy4","ml-6":"_mMW5i","pl-6":"_74GpL","ml-7":"_fFz-u","pl-7":"_QJPKy","ml-8":"_6sPXU","pl-8":"_6-6Yi","ml-9":"_9eU2j","pl-9":"_5QdLq","ml-10":"_AppHk","pl-10":"_czH97","mr-0":"_vcD-O","pr-0":"_yLhIL","mr-1":"_oSLHt","pr-1":"_whfEJ","mr-2":"_nyXH6","pr-2":"_reUdF","mr-3":"_Rs2-c","pr-3":"_sGm42","mr-4":"_vobRL","pr-4":"_wpM-u","mr-5":"_q3dAo","pr-5":"_6PIFR","mr-6":"_ZqDGE","pr-6":"_gw5Dd","mr-7":"_lFAcr","pr-7":"_b36Iz","mr-8":"_PTl3K","pr-8":"_Znc0Y","mr-9":"_P1LS0","pr-9":"_n8V-T","mr-10":"_wdhB1","pr-10":"_xiGuq","mt-0":"_wTXui","pt-0":"_qv-eO","mt-1":"_EZHmH","pt-1":"_rVDqJ","mt-2":"_Vokqr","pt-2":"_Gy6Cr","mt-3":"_W8aoH","pt-3":"_r82YV","mt-4":"_muG0F","pt-4":"_CGaJi","mt-5":"_hiY1E","pt-5":"_7v6rs","mt-6":"_bQZSd","pt-6":"_jAtjI","mt-7":"_R5w8y","pt-7":"_4mWsy","mt-8":"_Sj-di","pt-8":"_-NNao","mt-9":"_Q-fHV","pt-9":"_r8woe","mt-10":"_bSMww","pt-10":"_avmlE","mb-0":"_iCCS3","pb-0":"_gwmOn","mb-1":"_Xl7QX","pb-1":"_WUz0H","mb-2":"_XgCgc","pb-2":"_jPgTM","mb-3":"_3teTS","pb-3":"_dG1rJ","mb-4":"_b9OzE","pb-4":"_IgI2C","mb-5":"_smDd1","pb-5":"_50YOa","mb-6":"_uJfnB","pb-6":"_kl0z7","mb-7":"_L-oZk","pb-7":"_3aui0","mb-8":"_SmtYl","pb-8":"_n-QXT","mb-9":"_mkkKF","pb-9":"_jS1HG","mb-10":"_KDXkK","pb-10":"_eFwJS","mx-0":"_e-HqA","px-0":"_BSmPJ","mx-1":"_x36PW","px-1":"_Gx2xG","mx-2":"_QNnpK","px-2":"_RRwnp","mx-3":"_ZPmuA","px-3":"_f61Ux","mx-4":"_DgyA6","px-4":"_BAKix","mx-5":"_vibgJ","px-5":"_bTxPW","mx-6":"_Yj9Z7","px-6":"_fhT5q","mx-7":"_q-6lp","px-7":"_DQb93","mx-8":"_6G9nX","px-8":"_o-551","mx-9":"_2cubL","px-9":"_4JCU0","mx-10":"_KxEiD","px-10":"_czVGr","my-0":"_CqLSs","py-0":"_8uC-B","my-1":"_ZZG5X","py-1":"_aYbyO","my-2":"_w8TwE","py-2":"_qpOCn","my-3":"_PkA2e","py-3":"_OMDQd","my-4":"_aNFBd","py-4":"_eCXIU","my-5":"_apq2l","py-5":"_mk-sc","my-6":"_sh1-C","py-6":"_ZobGH","my-7":"_8758c","py-7":"_1iT1D","my-8":"_bAfQx","py-8":"_WWkd-","my-9":"_ynwaZ","py-9":"_4bOJI","my-10":"_l-I5b","py-10":"_re6Jp","m-sm-0":"_UPkcx","p-sm-0":"_t5gDA","m-sm-1":"_Rx29j","p-sm-1":"_t6SQY","m-sm-2":"_TyVqN","p-sm-2":"_Z1ogo","m-sm-3":"_gbZcT","p-sm-3":"_Mb1ST","m-sm-4":"_cUvON","p-sm-4":"_Pi4BO","m-sm-5":"_GgM3g","p-sm-5":"_uPFJ2","m-sm-6":"_cCDZS","p-sm-6":"_-e-Jr","m-sm-7":"_f2nRJ","p-sm-7":"_B6vun","m-sm-8":"_pidE0","p-sm-8":"_Qf8oe","m-sm-9":"_OyLmR","p-sm-9":"_soKag","m-sm-10":"_Hnysz","p-sm-10":"_SceBA","ml-sm-0":"_-l5XN","pl-sm-0":"_23QUK","ml-sm-1":"_3nzoa","pl-sm-1":"_Ys-wQ","ml-sm-2":"_cnl0C","pl-sm-2":"_9zniH","ml-sm-3":"_COjSH","pl-sm-3":"_ZoalV","ml-sm-4":"_7PcV0","pl-sm-4":"_yBtfl","ml-sm-5":"_0t-j9","pl-sm-5":"_lrbtT","ml-sm-6":"_441I5","pl-sm-6":"_kDiN3","ml-sm-7":"_7LdG3","pl-sm-7":"_g0gh-","ml-sm-8":"_J0xVz","pl-sm-8":"_Y6n12","ml-sm-9":"_0WKKn","pl-sm-9":"_3Seov","ml-sm-10":"_LbfWV","pl-sm-10":"_yJT8F","mr-sm-0":"_5iTiW","pr-sm-0":"_Z-yPd","mr-sm-1":"_HjxwF","pr-sm-1":"_JibpI","mr-sm-2":"_osijT","pr-sm-2":"_tlR9d","mr-sm-3":"_xxUub","pr-sm-3":"_OM4YU","mr-sm-4":"_tZTrU","pr-sm-4":"_co3SR","mr-sm-5":"_ZV8NG","pr-sm-5":"_6lrgR","mr-sm-6":"_mgH6r","pr-sm-6":"_oirFH","mr-sm-7":"_cDefz","pr-sm-7":"_PbMd1","mr-sm-8":"_GEylU","pr-sm-8":"_w9iBc","mr-sm-9":"_U-I4Y","pr-sm-9":"_VM49L","mr-sm-10":"_A-Fqb","pr-sm-10":"_jAp4X","mt-sm-0":"_kxvbF","pt-sm-0":"_-1AUk","mt-sm-1":"_utpJq","pt-sm-1":"_5aGnP","mt-sm-2":"_hH5bv","pt-sm-2":"_Lf-Hs","mt-sm-3":"_QKQTL","pt-sm-3":"_pS4ep","mt-sm-4":"_cf-lt","pt-sm-4":"_lGSoR","mt-sm-5":"_gSiyG","pt-sm-5":"_WWQxH","mt-sm-6":"_u9dIF","pt-sm-6":"_3rt-l","mt-sm-7":"_9HdeB","pt-sm-7":"_zzUxk","mt-sm-8":"_6dlAC","pt-sm-8":"_gDL-V","mt-sm-9":"_o7STq","pt-sm-9":"_7uyRq","mt-sm-10":"_VRUs5","pt-sm-10":"_nuFOu","mb-sm-0":"_gYIh5","pb-sm-0":"_9EoF6","mb-sm-1":"_h47Qi","pb-sm-1":"_zEE-R","mb-sm-2":"_qNAln","pb-sm-2":"_lAEEB","mb-sm-3":"_qz2f7","pb-sm-3":"_zDV2S","mb-sm-4":"_HziQr","pb-sm-4":"_Z8Nr-","mb-sm-5":"_2-0Mg","pb-sm-5":"_jd6YT","mb-sm-6":"_29u0R","pb-sm-6":"_rv5lz","mb-sm-7":"_34gYX","pb-sm-7":"_QK5rm","mb-sm-8":"_GTTt-","pb-sm-8":"_i9KXS","mb-sm-9":"_aOWnz","pb-sm-9":"_he9qa","mb-sm-10":"_zzLEf","pb-sm-10":"_a3Kx7","mx-sm-0":"_BxA9q","px-sm-0":"_W9ngp","mx-sm-1":"_sw7Ji","px-sm-1":"_CC5F4","mx-sm-2":"_wNsfZ","px-sm-2":"_7HUQW","mx-sm-3":"_7SvR7","px-sm-3":"_MhTrn","mx-sm-4":"_iQFZf","px-sm-4":"_-Kc-C","mx-sm-5":"_uAYfU","px-sm-5":"_zSyRo","mx-sm-6":"_M9NRe","px-sm-6":"_rqh6J","mx-sm-7":"_xC2ZW","px-sm-7":"_2ldRI","mx-sm-8":"_IdyE1","px-sm-8":"_nEOT4","mx-sm-9":"_MZcKX","px-sm-9":"_gn7RL","mx-sm-10":"_qc1L8","px-sm-10":"_eqRhA","my-sm-0":"_Fz6F6","py-sm-0":"_xO1X5","my-sm-1":"_-FpA3","py-sm-1":"_nbaB5","my-sm-2":"_O9I74","py-sm-2":"_luGVj","my-sm-3":"_HiEIn","py-sm-3":"_CYpX7","my-sm-4":"_J6Y94","py-sm-4":"_wB9Cu","my-sm-5":"_NsPY8","py-sm-5":"_mLSOY","my-sm-6":"_KsNN2","py-sm-6":"_ksiG3","my-sm-7":"_I-MIQ","py-sm-7":"_8LmM-","my-sm-8":"_N9K-q","py-sm-8":"_UmDUW","my-sm-9":"_Kx729","py-sm-9":"_T07OJ","my-sm-10":"_IW66T","py-sm-10":"_4gdB-","m-lg-0":"_zIg6p","p-lg-0":"_JuNiH","m-lg-1":"_PYsvw","p-lg-1":"_lcX2G","m-lg-2":"_FqRzp","p-lg-2":"_61LiW","m-lg-3":"_lKWuo","p-lg-3":"_c-9AA","m-lg-4":"_5iPC8","p-lg-4":"_3ucGN","m-lg-5":"_ZcKza","p-lg-5":"_53nUa","m-lg-6":"_nf5Tb","p-lg-6":"_QOkP1","m-lg-7":"_Yaf7S","p-lg-7":"_fS5OB","m-lg-8":"_3hP03","p-lg-8":"_w90dv","m-lg-9":"_eTZmn","p-lg-9":"_rEjn2","m-lg-10":"_MRZfv","p-lg-10":"_GvH8S","ml-lg-0":"_dma-K","pl-lg-0":"_dtgDg","ml-lg-1":"_lSg5Q","pl-lg-1":"_3Bq7W","ml-lg-2":"_ai140","pl-lg-2":"_eHQz2","ml-lg-3":"_IjfYo","pl-lg-3":"_mhnHv","ml-lg-4":"_gB4r4","pl-lg-4":"_GZbML","ml-lg-5":"_i2xfh","pl-lg-5":"_x9yPX","ml-lg-6":"_SeQQZ","pl-lg-6":"_wS39q","ml-lg-7":"_r8f4e","pl-lg-7":"_irihU","ml-lg-8":"_1QsQf","pl-lg-8":"_GXSU9","ml-lg-9":"_MJYz8","pl-lg-9":"_yaJGg","ml-lg-10":"_-AsD8","pl-lg-10":"_yn9Yb","mr-lg-0":"_vjC97","pr-lg-0":"_V3kGD","mr-lg-1":"_wf9z-","pr-lg-1":"_McW7I","mr-lg-2":"_kheh0","pr-lg-2":"_Q9Upz","mr-lg-3":"_zCz0A","pr-lg-3":"_YtfCI","mr-lg-4":"_qQN9B","pr-lg-4":"_S9PbV","mr-lg-5":"_bDTdZ","pr-lg-5":"_AcAC1","mr-lg-6":"_Ei18A","pr-lg-6":"_5YQVo","mr-lg-7":"_x18aw","pr-lg-7":"_N8GDD","mr-lg-8":"_OaFkM","pr-lg-8":"_-9lBB","mr-lg-9":"_52zo-","pr-lg-9":"_9T-Cb","mr-lg-10":"_IXqTb","pr-lg-10":"_zJmVt","mt-lg-0":"_2g62L","pt-lg-0":"_XBXKM","mt-lg-1":"_HMX9J","pt-lg-1":"_7rDIG","mt-lg-2":"_Y6X7U","pt-lg-2":"_fyycG","mt-lg-3":"_DvRKb","pt-lg-3":"_QKOEA","mt-lg-4":"_7qwy-","pt-lg-4":"_wl7f7","mt-lg-5":"_r-Zpt","pt-lg-5":"_-SnjV","mt-lg-6":"_q-hht","pt-lg-6":"_sOK9J","mt-lg-7":"_SUp-d","pt-lg-7":"_PugoZ","mt-lg-8":"_3NhkP","pt-lg-8":"_1n7tp","mt-lg-9":"_N7-FS","pt-lg-9":"_dnC7J","mt-lg-10":"_8IqDn","pt-lg-10":"_zMpbv","mb-lg-0":"_v5nv6","pb-lg-0":"_PMrYJ","mb-lg-1":"_O-soc","pb-lg-1":"_11FYR","mb-lg-2":"_zEeyp","pb-lg-2":"_hXqMT","mb-lg-3":"_san6w","pb-lg-3":"_7Xb0V","mb-lg-4":"_2Vzmv","pb-lg-4":"_fMirW","mb-lg-5":"_pKo-L","pb-lg-5":"_xC4Fx","mb-lg-6":"_snApN","pb-lg-6":"_b9Dsw","mb-lg-7":"_bFu0D","pb-lg-7":"_0qgZX","mb-lg-8":"_Gf3om","pb-lg-8":"_hX-O2","mb-lg-9":"_zZ-9Y","pb-lg-9":"_jk292","mb-lg-10":"_gYyhL","pb-lg-10":"_aPUfC","mx-lg-0":"_tmMx3","px-lg-0":"_GxctH","mx-lg-1":"_Ky0cs","px-lg-1":"_oGNqQ","mx-lg-2":"_9mQLc","px-lg-2":"_laRSV","mx-lg-3":"_xZFwU","px-lg-3":"_BgGbp","mx-lg-4":"_8m58X","px-lg-4":"_hosE8","mx-lg-5":"_r-0ww","px-lg-5":"_pIVfH","mx-lg-6":"_-BStC","px-lg-6":"_v42m-","mx-lg-7":"_DVgVD","px-lg-7":"_olele","mx-lg-8":"_5Vgts","px-lg-8":"_vV7Sg","mx-lg-9":"_R6Pid","px-lg-9":"_qmY7B","mx-lg-10":"_NW4OT","px-lg-10":"_i8Zad","my-lg-0":"_7PFtp","py-lg-0":"_vhTEf","my-lg-1":"_1yOov","py-lg-1":"_oKB3P","my-lg-2":"_loQJ5","py-lg-2":"_S67Pf","my-lg-3":"_HNTDI","py-lg-3":"_LWHvE","my-lg-4":"_b-KHI","py-lg-4":"_0mixG","my-lg-5":"_Vlo-t","py-lg-5":"_xLHlx","my-lg-6":"_0KXBa","py-lg-6":"_9s-me","my-lg-7":"_60cF9","py-lg-7":"_qwIHZ","my-lg-8":"_suf27","py-lg-8":"_c6pD4","my-lg-9":"_KSJpX","py-lg-9":"_C6ZV-","my-lg-10":"_JA-YG","py-lg-10":"_YuxKJ","m-md-0":"_62Zm-","p-md-0":"_7qxYP","m-md-1":"_3xHIn","p-md-1":"_A0jQv","m-md-2":"_gn3k4","p-md-2":"_EpVD0","m-md-3":"_apmcB","p-md-3":"_ldRmv","m-md-4":"_BOjUR","p-md-4":"_93an6","m-md-5":"_W5v56","p-md-5":"_SIBoU","m-md-6":"_VBmMD","p-md-6":"_7ZqTb","m-md-7":"_5Jogx","p-md-7":"_KpbGF","m-md-8":"_lw6bA","p-md-8":"_D21Xs","m-md-9":"_buMId","p-md-9":"_87RlS","m-md-10":"_ojudf","p-md-10":"_sjNOB","ml-md-0":"_V1IX-","pl-md-0":"_ZTBpt","ml-md-1":"_4jtTs","pl-md-1":"_cY-xk","ml-md-2":"_ydZsR","pl-md-2":"_MJk1L","ml-md-3":"_ocW9e","pl-md-3":"_WuBzD","ml-md-4":"_eKU4l","pl-md-4":"_cgptP","ml-md-5":"_Ov-v8","pl-md-5":"_gDnV3","ml-md-6":"_o3eWU","pl-md-6":"_Cr8hz","ml-md-7":"_sX69x","pl-md-7":"_-Ci6A","ml-md-8":"_fGNjF","pl-md-8":"_PeKiX","ml-md-9":"_yVD5i","pl-md-9":"_gxUIi","ml-md-10":"_ZPQrh","pl-md-10":"_oL88W","mr-md-0":"_rETVL","pr-md-0":"_UePrS","mr-md-1":"_wGOhL","pr-md-1":"_lXRvw","mr-md-2":"_5zLmB","pr-md-2":"_gZGtH","mr-md-3":"_jFCGk","pr-md-3":"_iimql","mr-md-4":"_yhePq","pr-md-4":"_xtBfX","mr-md-5":"_KiBHO","pr-md-5":"_WCKkT","mr-md-6":"_Q8jWF","pr-md-6":"_mu6zn","mr-md-7":"_wgy4D","pr-md-7":"_HaN0x","mr-md-8":"_0hc4i","pr-md-8":"_RomM-","mr-md-9":"_vHSBw","pr-md-9":"_4D7JM","mr-md-10":"_4kgs5","pr-md-10":"_KbOqY","mt-md-0":"_PnJEf","pt-md-0":"_Wr2Ts","mt-md-1":"_ZhVjl","pt-md-1":"_0DgRY","mt-md-2":"_WCZNy","pt-md-2":"_632Ah","mt-md-3":"_I1rX1","pt-md-3":"_yLblG","mt-md-4":"_H6sYD","pt-md-4":"_EHXef","mt-md-5":"_A-e3J","pt-md-5":"_-sV7U","mt-md-6":"_hXU9-","pt-md-6":"_n13ly","mt-md-7":"_NvbHC","pt-md-7":"_og4j4","mt-md-8":"_K3M9K","pt-md-8":"_G0D0h","mt-md-9":"_gqgsH","pt-md-9":"_2DuSs","mt-md-10":"_Bd2SX","pt-md-10":"_4zQZt","mb-md-0":"_-zK4R","pb-md-0":"_-5KU3","mb-md-1":"_DsvDi","pb-md-1":"_iBeit","mb-md-2":"_1DyrC","pb-md-2":"_We5TJ","mb-md-3":"_gHMvz","pb-md-3":"_zYpR2","mb-md-4":"_OEEgj","pb-md-4":"_Rc-ZO","mb-md-5":"_qmwpY","pb-md-5":"_t53dC","mb-md-6":"_Z7IKd","pb-md-6":"_Tr1Mj","mb-md-7":"_VAOZd","pb-md-7":"_F6Hvf","mb-md-8":"_bDJti","pb-md-8":"_-Hyix","mb-md-9":"_5NMzS","pb-md-9":"_ka3la","mb-md-10":"_m7Y4u","pb-md-10":"_GKtFW","mx-md-0":"_S-sWu","px-md-0":"_Cbp07","mx-md-1":"_0cWET","px-md-1":"_B62bC","mx-md-2":"_fk8cj","px-md-2":"_hDUD4","mx-md-3":"_3rc6m","px-md-3":"_Ybukf","mx-md-4":"_Cc05e","px-md-4":"_WuZgX","mx-md-5":"_Bizql","px-md-5":"_-p46c","mx-md-6":"_9UcKL","px-md-6":"_JBebf","mx-md-7":"_v-pvB","px-md-7":"_rA-mH","mx-md-8":"_IuwmJ","px-md-8":"_q43Ow","mx-md-9":"_d-qUi","px-md-9":"_z4nCB","mx-md-10":"_kRlX7","px-md-10":"_c-33g","my-md-0":"_PDUR4","py-md-0":"_bYhI-","my-md-1":"_GuZMi","py-md-1":"_odsUL","my-md-2":"_PnosJ","py-md-2":"_eF79-","my-md-3":"_nqJqe","py-md-3":"_Wcv28","my-md-4":"_pg-Cw","py-md-4":"_TQVBc","my-md-5":"_oq3ru","py-md-5":"_ruQ8P","my-md-6":"_udw0b","py-md-6":"_vStkc","my-md-7":"_EHkUk","py-md-7":"_oGosV","my-md-8":"_Sr4G3","py-md-8":"_eDYMt","my-md-9":"_mmQcX","py-md-9":"_J0xZx","my-md-10":"_6PNQm","py-md-10":"_N-J8O","m-xl-0":"_b9ste","p-xl-0":"_09iuo","m-xl-1":"_6sC3f","p-xl-1":"_PtZdh","m-xl-2":"_9tNY-","p-xl-2":"_ovaeX","m-xl-3":"_P2BFM","p-xl-3":"_FEEeY","m-xl-4":"_PVfE9","p-xl-4":"_65pR5","m-xl-5":"_--nhA","p-xl-5":"_jsSAE","m-xl-6":"_R6Xge","p-xl-6":"_m8aQq","m-xl-7":"_siLSo","p-xl-7":"_v7l5L","m-xl-8":"_hHbXe","p-xl-8":"_Rqlns","m-xl-9":"_oGDyI","p-xl-9":"_s-jO5","m-xl-10":"_Acff7","p-xl-10":"_r1WLU","ml-xl-0":"_R-5jP","pl-xl-0":"_4Q5-9","ml-xl-1":"_KtDt9","pl-xl-1":"_WO0X1","ml-xl-2":"_1iTCd","pl-xl-2":"_cwGpB","ml-xl-3":"_U-UBZ","pl-xl-3":"_K6-fp","ml-xl-4":"_Qj-GA","pl-xl-4":"_3HWJh","ml-xl-5":"_tHgFt","pl-xl-5":"_HDbai","ml-xl-6":"_R5iu-","pl-xl-6":"_kiBpR","ml-xl-7":"_IBpxp","pl-xl-7":"_dnEPn","ml-xl-8":"_BKEU-","pl-xl-8":"_Na3WX","ml-xl-9":"_ChhZh","pl-xl-9":"_mn3TM","ml-xl-10":"_-UMhn","pl-xl-10":"_sYOxA","mr-xl-0":"_cpZo1","pr-xl-0":"_JNcnY","mr-xl-1":"_OCoEG","pr-xl-1":"_1muOs","mr-xl-2":"_jhx4t","pr-xl-2":"_vT9VS","mr-xl-3":"_Syl0-","pr-xl-3":"_Vh6yI","mr-xl-4":"_Andea","pr-xl-4":"_IELTR","mr-xl-5":"_tR-Dd","pr-xl-5":"_tFdrE","mr-xl-6":"_MfbBj","pr-xl-6":"_-RDRT","mr-xl-7":"_2TUZ4","pr-xl-7":"_FDwKR","mr-xl-8":"_JILtJ","pr-xl-8":"_vHCTj","mr-xl-9":"_7wU9i","pr-xl-9":"_SqcZw","mr-xl-10":"_V70NV","pr-xl-10":"_-KQQG","mt-xl-0":"_sKVTL","pt-xl-0":"_ZF6Hm","mt-xl-1":"_I5EGT","pt-xl-1":"_-Ig-5","mt-xl-2":"_RIFhP","pt-xl-2":"_zaWNn","mt-xl-3":"_dPd93","pt-xl-3":"_O4wYu","mt-xl-4":"_T1XOW","pt-xl-4":"_b6dFq","mt-xl-5":"_dTI2S","pt-xl-5":"_qyuWu","mt-xl-6":"_0pvAa","pt-xl-6":"_sSQ8V","mt-xl-7":"_P-2W8","pt-xl-7":"_ek09W","mt-xl-8":"_g4vXZ","pt-xl-8":"_b2MMp","mt-xl-9":"_6JmBY","pt-xl-9":"_EG1jC","mt-xl-10":"_tHeBK","pt-xl-10":"_nYubC","mb-xl-0":"_9fyt1","pb-xl-0":"_66Js3","mb-xl-1":"_ARk1H","pb-xl-1":"_kKNTV","mb-xl-2":"_0TmE5","pb-xl-2":"_Zysst","mb-xl-3":"_XiA7F","pb-xl-3":"_SO1hI","mb-xl-4":"_W-4kw","pb-xl-4":"_-sfn8","mb-xl-5":"_NTfVD","pb-xl-5":"_LFC-6","mb-xl-6":"_pp7Gy","pb-xl-6":"_j-vtb","mb-xl-7":"_wpFKE","pb-xl-7":"_BbnyF","mb-xl-8":"_4qmjI","pb-xl-8":"_7pytN","mb-xl-9":"_B3YZo","pb-xl-9":"_cRfJG","mb-xl-10":"_NMhPX","pb-xl-10":"_Ekqdk","mx-xl-0":"_SkbmN","px-xl-0":"_JKZdb","mx-xl-1":"_UKYJi","px-xl-1":"_f-FqJ","mx-xl-2":"_gwtRl","px-xl-2":"_CSJ3f","mx-xl-3":"_tg3Yl","px-xl-3":"_EWUVo","mx-xl-4":"_p2pqT","px-xl-4":"_3DzEy","mx-xl-5":"_0xDrA","px-xl-5":"_NUhX6","mx-xl-6":"_bhY09","px-xl-6":"_mUAfo","mx-xl-7":"_Lug5G","px-xl-7":"_2kUJp","mx-xl-8":"_kTsP1","px-xl-8":"_Chv-7","mx-xl-9":"_h9kIo","px-xl-9":"_gfikM","mx-xl-10":"_3Th0M","px-xl-10":"_A4Mab","my-xl-0":"_62UqO","py-xl-0":"_BkC6O","my-xl-1":"_QJWcf","py-xl-1":"_WWFRs","my-xl-2":"_tkrQM","py-xl-2":"_-qca8","my-xl-3":"_bpoTO","py-xl-3":"_OnKLk","my-xl-4":"_o-kvn","py-xl-4":"_Icmal","my-xl-5":"_cEkTF","py-xl-5":"_mPD3K","my-xl-6":"_b2wEf","py-xl-6":"_SPrOl","my-xl-7":"_BpIhB","py-xl-7":"_9p80f","my-xl-8":"_u3RLs","py-xl-8":"_mc-ae","my-xl-9":"_Q8X-B","py-xl-9":"_SAYlD","my-xl-10":"_vUbME","py-xl-10":"_JgNyS","background-shine":"_31QK4",path:"_LID96",line:"_w2-BZ",skeleton:"_rfGkx","skeleton-animate":"_UY78C","skeleton-dark":"_KmySi","skeleton-dark-animate":"_KF46B","skeleton-transparent":"_50VFe","skeleton-transparent-animate":"_Q6BCG","semi-transparent":"_y91i5",disable:"_87Qkw","full-width-on-tablets":"_wymzG","full-width-on-mobiles":"_uhhSq",xl:"_zdQKm",lg:"_jG9wj",md:"_QrK--",sm:"_jc1W9","small-padding-on-small-mobiles":"_rS2Bk",primary:"_d-gJO","primary-bordered":"_jjfA2","primary-transparent":"_AEbcr",transparent:"_w53db","transparent-bordered":"_WW-Ps","transparent-without-shadow":"_Ltn9c",white:"_csamW","button-primary-dots-wrapper":"_Dmv-l",show:"_GkptB","button-success-icon":"_xImUU","button-text":"_ur-Oh",hide:"_-5XCZ","button-with-icon":"_ZrOKh","button-with-icon-text":"_ixQmJ","big-icon":"_8e4E7"},Y={container:"_wfTsj","m-0":"_UeiuB","p-0":"_QD4AZ","m-1":"_wOM1E","p-1":"_kJ3GD","m-2":"_5G5Rf","p-2":"_dyuup","m-3":"_m4kZr","p-3":"_-aSKV","m-4":"_lqeth","p-4":"_WFhaj","m-5":"_bgee8","p-5":"_Y2Iup","m-6":"_c873k","p-6":"_Huak-","m-7":"_c2rt4","p-7":"_2dT3Y","m-8":"_7rQUz","p-8":"_fjzT8","m-9":"_jmGJQ","p-9":"_CTpOZ","m-10":"_lEJ9M","p-10":"_1LfZ2","ml-0":"_j6sNe","pl-0":"_i8R7s","ml-1":"_oM6Eu","pl-1":"_QllX8","ml-2":"_r3xcV","pl-2":"_fd0jL","ml-3":"_SP5MI","pl-3":"_wQD-b","ml-4":"_uV9BF","pl-4":"_k1Kla","ml-5":"_FTlGy","pl-5":"_k20cZ","ml-6":"_5gR0D","pl-6":"_ICAcq","ml-7":"_-PQGU","pl-7":"_VxSDF","ml-8":"_bKyKZ","pl-8":"_2DqEG","ml-9":"_1SlOv","pl-9":"_EIiNs","ml-10":"_5WCGB","pl-10":"_qdKd3","mr-0":"_JWuXP","pr-0":"_5aqFq","mr-1":"_GTimu","pr-1":"_VC6Mm","mr-2":"_iuK1E","pr-2":"_YREDe","mr-3":"_qttq2","pr-3":"_FRB7c","mr-4":"_tyLXy","pr-4":"_khAbL","mr-5":"_-pPmp","pr-5":"_Zn6P3","mr-6":"_UXDvD","pr-6":"_Pyjz-","mr-7":"_ydv6O","pr-7":"_W2-PF","mr-8":"_AeBpV","pr-8":"_GNhM6","mr-9":"_6r58X","pr-9":"_nDQS4","mr-10":"_z6oMu","pr-10":"_NqF8M","mt-0":"_5BywF","pt-0":"_G3lb7","mt-1":"_O8qGt","pt-1":"_KxUDK","mt-2":"_feZvx","pt-2":"_i4LGd","mt-3":"_8rWTr","pt-3":"_5KtzE","mt-4":"_22EES","pt-4":"_ktDxC","mt-5":"_hNJ8a","pt-5":"_l-BdA","mt-6":"_V7rTE","pt-6":"_yO380","mt-7":"_64Gbc","pt-7":"_slV9V","mt-8":"_PAPZ0","pt-8":"_SlH81","mt-9":"_OmKU7","pt-9":"_m4Y5T","mt-10":"_N7MOD","pt-10":"_5EmMY","mb-0":"_umP3K","pb-0":"_tdjdM","mb-1":"_RUpVI","pb-1":"_qhSG-","mb-2":"_UE6hY","pb-2":"_bhwY3","mb-3":"_gCNY5","pb-3":"_CT9SA","mb-4":"_hXf14","pb-4":"_dBd4j","mb-5":"_BJm2f","pb-5":"_osAXf","mb-6":"_sksVG","pb-6":"_vq2P1","mb-7":"_GGqWv","pb-7":"_Wp-xn","mb-8":"_ao8-b","pb-8":"_Fcz6J","mb-9":"_HTDCN","pb-9":"_j2geM","mb-10":"_tQ3f4","pb-10":"_k5-cY","mx-0":"_C-RwH","px-0":"_fGmBQ","mx-1":"_SJIAI","px-1":"_V6h6n","mx-2":"_RpAL-","px-2":"_MtnJr","mx-3":"_bJAjq","loading-dots":"_i9YR0",big:"_Gf-5X",dot:"_yU4CC","px-3":"_bKF6h","mx-4":"_2YwpF","px-4":"_sv9HO","mx-5":"_fyywB","px-5":"_PAvUg","mx-6":"_-7Y93","px-6":"_2HnrR","mx-7":"_mO0GJ","px-7":"_-XBUb","mx-8":"_rPzNl","px-8":"_lxUkB","mx-9":"_wtwwN","px-9":"_ewGa-","mx-10":"_CUJzg","px-10":"_9fyow","my-0":"_D3hCP","py-0":"_fUhkb","my-1":"_-gS0u","py-1":"_DCjg-","my-2":"_REwX3","py-2":"_5qEqQ","my-3":"_4P9yd","py-3":"_3Q6jo","my-4":"_pJ9JL","py-4":"_fvyEP","my-5":"_7HH0Y","py-5":"_pfPnT","my-6":"_HMzw4","py-6":"_nGGuj","my-7":"_ZQcHb","py-7":"_Q5rCt","my-8":"_yurdg","py-8":"_z2Rnm","my-9":"_SGsqH","py-9":"_RkTBo","my-10":"_hgG--","py-10":"_iKSyb","m-sm-0":"_hG8Pd","p-sm-0":"_paicL","m-sm-1":"_zYVem","p-sm-1":"_Iifls","m-sm-2":"_C0HAk","p-sm-2":"_tyMH8","m-sm-3":"_Nw8NT","p-sm-3":"_mOvjR","m-sm-4":"_auqaY","p-sm-4":"_nqq-T","m-sm-5":"_uC7a4","p-sm-5":"_QmBt-","m-sm-6":"_E1Mby","p-sm-6":"_2b-XB","m-sm-7":"_shE-L","p-sm-7":"_DZiE4","m-sm-8":"_VrAWC","p-sm-8":"_wBvI1","m-sm-9":"_nT5hR","p-sm-9":"_utagJ","m-sm-10":"_suXWh","p-sm-10":"_HqYvz","ml-sm-0":"_XKTYr","pl-sm-0":"_-69hr","ml-sm-1":"_EnQBB","pl-sm-1":"_OBDbZ","ml-sm-2":"_4uEtT","pl-sm-2":"_jxnnV","ml-sm-3":"_4dyy7","pl-sm-3":"_fcp9m","ml-sm-4":"_Su7vR","pl-sm-4":"_iGsH0","ml-sm-5":"_j5bIe","pl-sm-5":"_iiiem","ml-sm-6":"_OSCRC","pl-sm-6":"_a6Ij8","ml-sm-7":"_cESaw","pl-sm-7":"_PZAKp","ml-sm-8":"_u1e7W","pl-sm-8":"_MMjU3","ml-sm-9":"_AEo-h","pl-sm-9":"_g6Qm-","ml-sm-10":"_RSzPa","pl-sm-10":"_5lIjk","mr-sm-0":"_iq-8E","pr-sm-0":"_6e7Oo","mr-sm-1":"_eRKuI","pr-sm-1":"_HaKr0","mr-sm-2":"_sl8Y1","pr-sm-2":"_-eAaQ","mr-sm-3":"_hqMXk","pr-sm-3":"_-nPxR","mr-sm-4":"_PFLZC","pr-sm-4":"_bz8kn","mr-sm-5":"_IDOFd","pr-sm-5":"_YphYe","mr-sm-6":"_DFP8e","pr-sm-6":"_uffDW","mr-sm-7":"_K4gIP","pr-sm-7":"_mFIwC","mr-sm-8":"_ZnbXS","pr-sm-8":"_SJ5sd","mr-sm-9":"_I4pB1","pr-sm-9":"_7Be-A","mr-sm-10":"_BlQpX","pr-sm-10":"_zoDIK","mt-sm-0":"_PpfXn","pt-sm-0":"_MLL-T","mt-sm-1":"_sFLGW","pt-sm-1":"_cssHG","mt-sm-2":"_-CEBu","pt-sm-2":"_3164x","mt-sm-3":"_Q-yYF","pt-sm-3":"_aSP--","mt-sm-4":"_HCnTw","pt-sm-4":"_pkP3Z","mt-sm-5":"_wpfr4","pt-sm-5":"_090aI","mt-sm-6":"_1YJBr","pt-sm-6":"_jYnK3","mt-sm-7":"_1f6jW","pt-sm-7":"_yPAeS","mt-sm-8":"_dNsVh","pt-sm-8":"_5n5Di","mt-sm-9":"_4RACJ","pt-sm-9":"_lgByZ","mt-sm-10":"_SBIrM","pt-sm-10":"_YsBHF","mb-sm-0":"_-z2mG","pb-sm-0":"_uz-nV","mb-sm-1":"_bPTQE","pb-sm-1":"_qTKZa","mb-sm-2":"_DWs80","pb-sm-2":"_7Pkyh","mb-sm-3":"_c5AbJ","pb-sm-3":"_0BQOV","mb-sm-4":"_V1gvx","pb-sm-4":"_s56MP","mb-sm-5":"_abqTk","pb-sm-5":"_YVQSJ","mb-sm-6":"_URgQP","pb-sm-6":"_3cTRb","mb-sm-7":"_tbZgH","pb-sm-7":"_oprz5","mb-sm-8":"_1tsmq","pb-sm-8":"_rp6hG","mb-sm-9":"_HI-9l","pb-sm-9":"_FnTxa","mb-sm-10":"_RHo4c","pb-sm-10":"_PZUR0","mx-sm-0":"_AvLmU","px-sm-0":"_PtUTn","mx-sm-1":"_WdN3k","px-sm-1":"_ytExi","mx-sm-2":"_RWE1V","px-sm-2":"_vw43o","mx-sm-3":"_Cbm5H","px-sm-3":"_P-Cf6","mx-sm-4":"_pjfwR","px-sm-4":"_WtStS","mx-sm-5":"_9a-hP","px-sm-5":"_JMDVm","mx-sm-6":"_OS2my","px-sm-6":"_-GrIc","mx-sm-7":"_BCsIq","px-sm-7":"_WhZnF","mx-sm-8":"_1aj2C","px-sm-8":"_THUvZ","mx-sm-9":"_JGLYJ","px-sm-9":"_A-5uV","mx-sm-10":"_va7ij","px-sm-10":"_XIozX","my-sm-0":"_iYNXh","py-sm-0":"_A4kOE","my-sm-1":"_vMEVL","py-sm-1":"_Xp5yf","my-sm-2":"_VXJt9","py-sm-2":"_LFrIT","my-sm-3":"_KkriU","py-sm-3":"_5locy","my-sm-4":"_FbhGv","py-sm-4":"_lhkY0","my-sm-5":"_iI3NO","py-sm-5":"_YPAWx","my-sm-6":"_nsvtx","py-sm-6":"_fzqyr","my-sm-7":"_HCcpN","py-sm-7":"_yw1CE","my-sm-8":"_FvOZ-","py-sm-8":"_H3dR0","my-sm-9":"_AgJBK","py-sm-9":"_1xEHl","my-sm-10":"_TkKl8","py-sm-10":"_B3-Sv","m-lg-0":"_67BGW","p-lg-0":"_hLq7o","m-lg-1":"_7N5-4","p-lg-1":"_b-vnX","m-lg-2":"_7k7Vs","p-lg-2":"_Q2FO1","m-lg-3":"_ZTSBV","p-lg-3":"_rstCV","m-lg-4":"_juJVU","p-lg-4":"_-F4s-","m-lg-5":"_e2ifF","p-lg-5":"_U4gTc","m-lg-6":"_-4I70","p-lg-6":"_VEcMB","m-lg-7":"_LQqFi","p-lg-7":"_eX0vJ","m-lg-8":"_qPpjy","p-lg-8":"_Bhr2u","m-lg-9":"_DPuMB","p-lg-9":"_H5C3L","m-lg-10":"_1EPHM","p-lg-10":"_mVFm8","ml-lg-0":"_jLUCv","pl-lg-0":"_sdQR4","ml-lg-1":"_dO-42","pl-lg-1":"_RDmEN","ml-lg-2":"_zilrt","pl-lg-2":"_3ZlSF","ml-lg-3":"_ywVg2","pl-lg-3":"_EVjPm","ml-lg-4":"_PBq8D","pl-lg-4":"_-NNsy","ml-lg-5":"_EKt1p","pl-lg-5":"_AAU--","ml-lg-6":"_M3D3t","pl-lg-6":"_VXvIT","ml-lg-7":"_yRT7X","pl-lg-7":"_0XsPz","ml-lg-8":"_HazA-","pl-lg-8":"_JZBh1","ml-lg-9":"_BU6zu","pl-lg-9":"_UPban","ml-lg-10":"_17FL5","pl-lg-10":"_mtv0u","mr-lg-0":"_YxsrA","pr-lg-0":"_1Wmvv","mr-lg-1":"_cQiRZ","pr-lg-1":"_9oheo","mr-lg-2":"_hwBOD","pr-lg-2":"_3i51G","mr-lg-3":"_iwzVs","pr-lg-3":"_1oRFN","mr-lg-4":"_3NfjL","pr-lg-4":"_9OJfa","mr-lg-5":"_YokXX","pr-lg-5":"_owhix","mr-lg-6":"_5Grwo","pr-lg-6":"_r0hct","mr-lg-7":"_dSkGq","pr-lg-7":"_mohcn","mr-lg-8":"_NUor1","pr-lg-8":"_Sjzdu","mr-lg-9":"_Py-ID","pr-lg-9":"_cZdrq","mr-lg-10":"_Etrwm","pr-lg-10":"_YCNLZ","mt-lg-0":"_qEoXx","pt-lg-0":"_nAw0E","mt-lg-1":"_pzDlL","pt-lg-1":"_h8g2E","mt-lg-2":"_QBTy7","pt-lg-2":"_IQoFB","mt-lg-3":"_UGd6N","pt-lg-3":"_PBzO5","mt-lg-4":"_SCRsd","pt-lg-4":"_aFnaW","mt-lg-5":"_EvBB0","pt-lg-5":"_U2iJt","mt-lg-6":"_5mahS","pt-lg-6":"_bzKPx","mt-lg-7":"_E-ZPb","pt-lg-7":"_bspLi","mt-lg-8":"_UA8zu","pt-lg-8":"_3KcAQ","mt-lg-9":"_Ze8Hr","pt-lg-9":"_FKo1d","mt-lg-10":"_kIAZR","pt-lg-10":"_j2qBV","mb-lg-0":"_u8RSu","pb-lg-0":"_7uW-o","mb-lg-1":"_1MnIg","pb-lg-1":"_EeRag","mb-lg-2":"_D-pBo","pb-lg-2":"_TTAjX","mb-lg-3":"_ZldL-","pb-lg-3":"_racM9","mb-lg-4":"_bv3JQ","pb-lg-4":"_m4wR1","mb-lg-5":"_G-OW-","pb-lg-5":"_hTxUe","mb-lg-6":"_-r5uZ","pb-lg-6":"_Ri3sL","mb-lg-7":"_yay34","pb-lg-7":"_H0ybB","mb-lg-8":"_kWcyP","pb-lg-8":"_f7KWI","mb-lg-9":"_f-ap7","pb-lg-9":"_piZbL","mb-lg-10":"_7GnNB","pb-lg-10":"_8RaRH","mx-lg-0":"_E0yc1","px-lg-0":"_jXVGt","mx-lg-1":"_SLGEt","px-lg-1":"_sfpGl","mx-lg-2":"_TQdd5","px-lg-2":"_ZH4kx","mx-lg-3":"_ByYI-","px-lg-3":"_sa8fi","mx-lg-4":"_QFKsD","px-lg-4":"_S-owE","mx-lg-5":"_T-3pC","px-lg-5":"_592xL","mx-lg-6":"_nHCUC","px-lg-6":"_SHGGx","mx-lg-7":"_u8AGu","px-lg-7":"_HGDmM","mx-lg-8":"_DoojR","px-lg-8":"_-xfYS","mx-lg-9":"_a39AX","px-lg-9":"_otRdO","mx-lg-10":"_0jC0L","px-lg-10":"_o3uqZ","my-lg-0":"_fWar-","py-lg-0":"_1KGBQ","my-lg-1":"_rmTwc","py-lg-1":"_SNpLr","my-lg-2":"_nZTm1","py-lg-2":"_fo45m","my-lg-3":"_DP8Cy","py-lg-3":"_tWJ-N","my-lg-4":"_Unnfi","py-lg-4":"_TJ7sH","my-lg-5":"_xIoEe","py-lg-5":"_CH2tq","my-lg-6":"_-4iWK","py-lg-6":"_di773","my-lg-7":"_ZAyLn","py-lg-7":"_yxUoV","my-lg-8":"_AAbVi","py-lg-8":"_ijW6K","my-lg-9":"_2SOZJ","py-lg-9":"_904so","my-lg-10":"_RuT9u","py-lg-10":"_bM8I-","m-md-0":"_JzJkX","p-md-0":"_f8nh5","m-md-1":"_hBYXm","p-md-1":"_X1BU4","m-md-2":"_dnzT0","p-md-2":"_5y79V","m-md-3":"_eBoSQ","p-md-3":"_3KIpC","m-md-4":"_J4f2b","p-md-4":"_-GqF4","m-md-5":"_FaWzb","p-md-5":"_c-ssZ","m-md-6":"_R6a8a","p-md-6":"_3OwFZ","m-md-7":"_VwKx8","p-md-7":"_oICA0","m-md-8":"_D9SPT","p-md-8":"_WqmxK","m-md-9":"_K-6kd","p-md-9":"_RNgLg","m-md-10":"_X2S0Q","p-md-10":"_dUN9U","ml-md-0":"_KI-v9","pl-md-0":"_J-z-m","ml-md-1":"_40NhZ","pl-md-1":"_dwk56","ml-md-2":"_-gtX1","pl-md-2":"_M-jkC","ml-md-3":"_bbVwf","pl-md-3":"_RzC-C","ml-md-4":"_QmHWn","pl-md-4":"_2Lg6Z","ml-md-5":"_TwW16","pl-md-5":"_NvcKj","ml-md-6":"_wxYmK","pl-md-6":"_Ay-nQ","ml-md-7":"_7FRbu","pl-md-7":"_zQusT","ml-md-8":"_f0-0U","pl-md-8":"_rE4oG","ml-md-9":"_8sF7X","pl-md-9":"_RPdXC","ml-md-10":"_-3o3f","pl-md-10":"_JN4N-","mr-md-0":"_5uGyZ","pr-md-0":"_sHCfS","mr-md-1":"_T-APd","pr-md-1":"_EWggr","mr-md-2":"_-IV1z","pr-md-2":"_Mj-hm","mr-md-3":"_W4jcg","pr-md-3":"_rACeA","mr-md-4":"_NVp7l","pr-md-4":"_6LfUe","mr-md-5":"_VyxVE","pr-md-5":"_edWIM","mr-md-6":"_FZQF6","pr-md-6":"_LJpMl","mr-md-7":"_xwZ6q","pr-md-7":"_YflPE","mr-md-8":"_RiPLi","pr-md-8":"_HZNIr","mr-md-9":"_2ZsDj","pr-md-9":"_XBBrF","mr-md-10":"_-kG-G","pr-md-10":"_co3mI","mt-md-0":"_e6IV0","pt-md-0":"_eLP-0","mt-md-1":"_27KXx","pt-md-1":"_gQ2-y","mt-md-2":"_L6-1Q","pt-md-2":"_x7jaE","mt-md-3":"_r5yZl","pt-md-3":"_jTIZh","mt-md-4":"_TxxTT","pt-md-4":"_znNzQ","mt-md-5":"_aPml3","pt-md-5":"_o-WiU","mt-md-6":"_ePcku","pt-md-6":"_7PW3g","mt-md-7":"_qOy4h","pt-md-7":"_czEFY","mt-md-8":"_C5QNJ","pt-md-8":"_LXyGu","mt-md-9":"_BzCq8","pt-md-9":"_j6x7Q","mt-md-10":"_RyoZo","pt-md-10":"_HO6RH","mb-md-0":"_dBqjR","pb-md-0":"_Vtnl-","mb-md-1":"_4CIBM","pb-md-1":"_nkuIR","mb-md-2":"_jioqc","pb-md-2":"_KVlPp","mb-md-3":"_NVp7e","pb-md-3":"_51YgW","mb-md-4":"_6ZjBo","pb-md-4":"_5ewFY","mb-md-5":"_ttOxi","pb-md-5":"_VLqqB","mb-md-6":"_Vl1FM","pb-md-6":"_lj2o-","mb-md-7":"_fY9Hi","pb-md-7":"_vdqU0","mb-md-8":"_MBU95","pb-md-8":"_z-gSw","mb-md-9":"_Wr9dI","pb-md-9":"_D1Q7Q","mb-md-10":"_-resl","pb-md-10":"_Jamfb","mx-md-0":"_0r9rS","px-md-0":"_epgof","mx-md-1":"_aYYOb","px-md-1":"_g6u4x","mx-md-2":"_v6Jsi","px-md-2":"_e7lpx","mx-md-3":"_B5OpT","px-md-3":"_IJdST","mx-md-4":"_Vgq7O","px-md-4":"_q2tQ3","mx-md-5":"_udCxk","px-md-5":"_dkBwz","mx-md-6":"_HAAdk","px-md-6":"_gxcpD","mx-md-7":"_-wAGl","px-md-7":"_PBj8s","mx-md-8":"_51YzX","px-md-8":"_Ht55U","mx-md-9":"_UaNNS","px-md-9":"_A3qbp","mx-md-10":"_O9ir-","px-md-10":"_2jJOG","my-md-0":"_p6EfS","py-md-0":"_8FGSM","my-md-1":"_T6eYc","py-md-1":"_Jrh0m","my-md-2":"_oxohh","py-md-2":"_DTd2y","my-md-3":"_iGc8i","py-md-3":"_jqXbJ","my-md-4":"_wCkrO","py-md-4":"_4p1cz","my-md-5":"_m1Dhe","py-md-5":"_UFngr","my-md-6":"_FdWqj","py-md-6":"_utySi","my-md-7":"_TsKhD","py-md-7":"_8aght","my-md-8":"_H2tbJ","py-md-8":"_mX8dL","my-md-9":"_YP8V8","py-md-9":"_GEd1x","my-md-10":"_qnAfn","py-md-10":"_3MK3a","m-xl-0":"_QUeDl","p-xl-0":"_tpnY6","m-xl-1":"_JhTnG","p-xl-1":"_leasc","m-xl-2":"_rj70q","p-xl-2":"_nmUas","m-xl-3":"_SH7Mw","p-xl-3":"_2sLhA","m-xl-4":"_WKBLF","p-xl-4":"_JTlZn","m-xl-5":"_keccz","p-xl-5":"_W2L9n","m-xl-6":"_MmHtB","p-xl-6":"_16QWL","m-xl-7":"_qoXt8","p-xl-7":"_aZTjp","m-xl-8":"_Gl1CI","p-xl-8":"_u033S","m-xl-9":"_fgyK-","p-xl-9":"_gWQMQ","m-xl-10":"_1zthQ","p-xl-10":"_jYgaz","ml-xl-0":"_Gc0yF","pl-xl-0":"_7r0qa","ml-xl-1":"_riQOx","pl-xl-1":"_ZOf2r","ml-xl-2":"_aqpam","pl-xl-2":"_Kzewg","ml-xl-3":"_riGnY","pl-xl-3":"_fImnr","ml-xl-4":"_Spb-1","pl-xl-4":"_xqk-P","ml-xl-5":"_5ZrWS","pl-xl-5":"_KEqQd","ml-xl-6":"_6cdvz","pl-xl-6":"_RjL-8","ml-xl-7":"_hfyi5","pl-xl-7":"_-xSML","ml-xl-8":"_eHDDu","pl-xl-8":"_iDidv","ml-xl-9":"_Gg4Fk","pl-xl-9":"_fYSK3","ml-xl-10":"_1V3MM","pl-xl-10":"_4jnhK","mr-xl-0":"_8fnBs","pr-xl-0":"_Kemkd","mr-xl-1":"_4ox8d","pr-xl-1":"_zG2Y2","mr-xl-2":"_Pl4X2","pr-xl-2":"_EZpb9","mr-xl-3":"_efgC0","pr-xl-3":"_6hd7x","mr-xl-4":"_rp8M9","pr-xl-4":"_nsRMj","mr-xl-5":"_ayyUE","pr-xl-5":"_BHXMH","mr-xl-6":"_Ez0-c","pr-xl-6":"_xTS9o","mr-xl-7":"_KlyJI","pr-xl-7":"_w3-5z","mr-xl-8":"_onnmv","pr-xl-8":"_aQYpF","mr-xl-9":"_D4mrX","pr-xl-9":"_-MGmg","mr-xl-10":"_KmLe8","pr-xl-10":"_rxxtP","mt-xl-0":"_0-1Kw","pt-xl-0":"_jVAPE","mt-xl-1":"_dO4nc","pt-xl-1":"_oFjXt","mt-xl-2":"_njinL","pt-xl-2":"_EVcqW","mt-xl-3":"_k7EwU","pt-xl-3":"_oALYA","mt-xl-4":"_SSrqv","pt-xl-4":"_8ZIWU","mt-xl-5":"_PXga1","pt-xl-5":"_ewSdF","mt-xl-6":"_0hKMy","pt-xl-6":"_fmLlw","mt-xl-7":"_aBbeO","pt-xl-7":"_Ghd-T","mt-xl-8":"_QILjg","pt-xl-8":"_4401M","mt-xl-9":"_mdFN4","pt-xl-9":"_uBjA3","mt-xl-10":"_l3TPU","pt-xl-10":"_hIKVS","mb-xl-0":"_2Et8-","pb-xl-0":"_uBGMl","mb-xl-1":"_AnrEX","pb-xl-1":"_-PMBv","mb-xl-2":"_cr4lU","pb-xl-2":"_BVCap","mb-xl-3":"_PgCvP","pb-xl-3":"_69b-5","mb-xl-4":"_x5odK","pb-xl-4":"_LzoYk","mb-xl-5":"_3q-dE","pb-xl-5":"_DXCCv","mb-xl-6":"_I8Qbz","pb-xl-6":"_wK-Lg","mb-xl-7":"_NXT2E","pb-xl-7":"_hw62n","mb-xl-8":"_w5tOT","pb-xl-8":"_KA9xk","mb-xl-9":"_B5jk4","pb-xl-9":"_N5trL","mb-xl-10":"_JU9c5","pb-xl-10":"_kP-VE","mx-xl-0":"_jgBYj","px-xl-0":"_iLny2","mx-xl-1":"_1PpJT","px-xl-1":"_eAdDk","mx-xl-2":"_v1kJm","px-xl-2":"_hU50M","mx-xl-3":"_L1JqU","px-xl-3":"_lGvGI","mx-xl-4":"_KNNj2","px-xl-4":"_6-Kgj","mx-xl-5":"_r9t8u","px-xl-5":"_pI6ok","mx-xl-6":"_YO3KF","px-xl-6":"_LIjtn","mx-xl-7":"_Yz-3Z","px-xl-7":"_7xWar","mx-xl-8":"_NEAsT","px-xl-8":"_KSLjS","mx-xl-9":"_XqTby","px-xl-9":"_y5sVK","mx-xl-10":"_GysTi","px-xl-10":"_udCRM","my-xl-0":"_iWpWS","py-xl-0":"_cyc8U","my-xl-1":"_IcUiN","py-xl-1":"_bfKBO","my-xl-2":"_IFTOa","py-xl-2":"_sXWH4","my-xl-3":"_TXATm","py-xl-3":"_Vt5Ze","my-xl-4":"_GLPso","py-xl-4":"_dI2DM","my-xl-5":"_twkBw","py-xl-5":"_m7dMy","my-xl-6":"_a-KcP","py-xl-6":"_dLwS8","my-xl-7":"_qkPb4","py-xl-7":"_uZaN7","my-xl-8":"_2btRT","py-xl-8":"_qsAt5","my-xl-9":"_LpPEh","py-xl-9":"_v1Rtf","my-xl-10":"_xKXEK","py-xl-10":"_pZt9W","background-shine":"_K7sQH",path:"_ko8i0",line:"_uhBI-",skeleton:"_tfiqH","skeleton-animate":"_haT-0","skeleton-dark":"_ZpubN","skeleton-dark-animate":"_BVbU1","skeleton-transparent":"_p-CoM","skeleton-transparent-animate":"_YElIQ","semi-transparent":"_wSCsK","no-margins":"_lNgTM",dots:"_igFzN",colored:"_iCiK-",small:"_zvmsC","extra-small":"_6tLmp","align-left":"_jJMP1","align-right":"_jpWFr"};const Q=({size:m="small",isColored:_=!1,noMargins:l=!1,align:t=!1})=>h("div",{className:`${Y["loading-dots"]} ${Y[m]} ${l?` ${Y["no-margins"]}`:""} ${t?Y["align-"+t]:""}`},h("div",{className:`${Y.dot} ${_?` ${Y.colored}`:""}`}),h("div",{className:`${Y.dot} ${_?` ${Y.colored}`:""}`}),h("div",{className:`${Y.dot} ${_?` ${Y.colored}`:""}`}));Q.propTypes={size:J.oneOf(["big","small","extra-small"]),isColored:J.bool,noMargins:J.bool,align:J.oneOfType([J.oneOf(["left","right"]),J.bool])};const X=({size:p="xl",className:r="",mode:e="transparent",onClick:n=((m,_)=>{}),loader:o=!0,loading:s=!1,to:a="",fullWidthOnMobiles:i=!1,fullWidthOnTablets:d=!1,icon:x="",content:c="",isDisabled:y=!1,setClickTrigger:g=(m=>{}),isFormSubmittingButton:b=!1,bigIcon:u=!1,checkmarkOnClick:f=!1,propagatePrimaryButtonClick:v=!0,smallPaddingOnSmallMobiles:S=!1,handleError:w=((m,_)=>m(_))})=>{const[T,O]=m(s),[E,k]=m(!1),[P,C]=m(null),j=_();l(()=>{g(()=>j.current.click())},[j]),l(()=>{T&&n(()=>O(!1),P)},[T]);const B=m=>{if(T||y)return!1;!f||E||o||s||(k(!0),setTimeout(()=>{k(!1)},2e3)),m.persist(),!v&&m.stopPropagation(),o?(O(!0),C(m)):n(()=>O(!1),m)},I=`${L.button} ${L[p]} ${L[r]} ${L[e]}`+(i?` ${L["full-width-on-mobiles"]}`:"")+(d?` ${L["full-width-on-tablets"]}`:"")+(y?` ${L.disable}`:"")+(S?` ${L["small-padding-on-small-mobiles"]}`:"");return h(Fragment,null,b?h("input",{type:"submit",hidden:!0}):null,a?h(t,{className:I,onClick:m=>w(B,m),to:a,innerRef:j},x?h("div",{className:L["button-with-icon"]+(u?` ${L["big-icon"]}`:"")},h("img",{src:x,alt:"button icon"}),h("span",{className:L["button-with-icon-text"]},c)):c):h("div",{className:I,onClick:m=>w(B,m),ref:j},h("div",{className:`${L["button-primary-dots-wrapper"]} ${T&&o?L.show:""}`},o&&T?h(Q,{isColored:"white"===e}):null),h("div",{className:`${L["button-success-icon"]} ${L[e]} ${E?L.show:""}`}),x?h("div",{className:`${L["button-with-icon"]} ${T&&o||f&&E?L.hide:""} ${u?L["big-icon"]:""}`},h("img",{src:x,alt:"button icon"}),h("span",{className:L["button-with-icon-text"]},c)):h("span",{className:`${L["button-text"]} ${T&&o||f&&E?L.hide:""}`},c)))};X.propTypes={size:J.oneOf(["xl","lg","md","sm"]),className:J.string,mode:J.oneOf(["transparent","white","primary","primary-bordered","primary-transparent","transparent-bordered","transparent-without-shadow"]),onClick:J.func,loader:J.bool,loading:J.bool,to:J.string,fullWidthOnMobiles:J.bool,fullWidthOnTablets:J.bool,icon:J.string,content:J.node,isDisabled:J.bool,setClickTrigger:J.func,isFormSubmittingButton:J.bool,bigIcon:J.bool,checkmarkOnClick:J.bool,propagatePrimaryButtonClick:J.bool,smallPaddingOnSmallMobiles:J.bool,handleError:J.func},X.defaultProps={size:"xl",className:"",mode:"transparent",onClick:(m,_)=>{},loader:!0,loading:!1,to:"",fullWidthOnMobiles:!1,fullWidthOnTablets:!1,icon:"",content:"",isDisabled:!1,setClickTrigger:m=>{},isFormSubmittingButton:!1,bigIcon:!1,checkmarkOnClick:!1,propagatePrimaryButtonClick:!0,smallPaddingOnSmallMobiles:!1,handleError:m=>m()};export{X as Button,Q as LoadingDots};
|
|
1
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
import { BigNumber } from 'bignumber.js';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import EventBusInstance from 'eventbusjs';
|
|
5
|
+
|
|
6
|
+
function createCommonjsModule(fn) {
|
|
7
|
+
var module = { exports: {} };
|
|
8
|
+
return fn(module, module.exports), module.exports;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** @license React v16.13.1
|
|
12
|
+
* react-is.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
20
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
21
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
|
|
22
|
+
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
|
23
|
+
var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
|
|
24
|
+
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
|
25
|
+
|
|
26
|
+
var reactIs_production_min = {
|
|
27
|
+
AsyncMode: AsyncMode,
|
|
28
|
+
ConcurrentMode: ConcurrentMode,
|
|
29
|
+
ContextConsumer: ContextConsumer,
|
|
30
|
+
ContextProvider: ContextProvider,
|
|
31
|
+
Element: Element,
|
|
32
|
+
ForwardRef: ForwardRef,
|
|
33
|
+
Fragment: Fragment,
|
|
34
|
+
Lazy: Lazy,
|
|
35
|
+
Memo: Memo,
|
|
36
|
+
Portal: Portal,
|
|
37
|
+
Profiler: Profiler,
|
|
38
|
+
StrictMode: StrictMode,
|
|
39
|
+
Suspense: Suspense,
|
|
40
|
+
isAsyncMode: isAsyncMode,
|
|
41
|
+
isConcurrentMode: isConcurrentMode,
|
|
42
|
+
isContextConsumer: isContextConsumer,
|
|
43
|
+
isContextProvider: isContextProvider,
|
|
44
|
+
isElement: isElement,
|
|
45
|
+
isForwardRef: isForwardRef,
|
|
46
|
+
isFragment: isFragment,
|
|
47
|
+
isLazy: isLazy,
|
|
48
|
+
isMemo: isMemo,
|
|
49
|
+
isPortal: isPortal,
|
|
50
|
+
isProfiler: isProfiler,
|
|
51
|
+
isStrictMode: isStrictMode,
|
|
52
|
+
isSuspense: isSuspense,
|
|
53
|
+
isValidElementType: isValidElementType,
|
|
54
|
+
typeOf: typeOf
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @license React v16.13.1
|
|
58
|
+
* react-is.development.js
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the MIT license found in the
|
|
63
|
+
* LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if (process.env.NODE_ENV !== "production") {
|
|
71
|
+
(function() {
|
|
72
|
+
|
|
73
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
74
|
+
// nor polyfill, then a plain number is used for performance.
|
|
75
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
76
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
77
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
78
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
79
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
80
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
81
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
82
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
83
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
84
|
+
|
|
85
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
86
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
87
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
88
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
89
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
90
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
91
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
92
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
93
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
94
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
95
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
96
|
+
|
|
97
|
+
function isValidElementType(type) {
|
|
98
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
99
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function typeOf(object) {
|
|
103
|
+
if (typeof object === 'object' && object !== null) {
|
|
104
|
+
var $$typeof = object.$$typeof;
|
|
105
|
+
|
|
106
|
+
switch ($$typeof) {
|
|
107
|
+
case REACT_ELEMENT_TYPE:
|
|
108
|
+
var type = object.type;
|
|
109
|
+
|
|
110
|
+
switch (type) {
|
|
111
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
112
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
113
|
+
case REACT_FRAGMENT_TYPE:
|
|
114
|
+
case REACT_PROFILER_TYPE:
|
|
115
|
+
case REACT_STRICT_MODE_TYPE:
|
|
116
|
+
case REACT_SUSPENSE_TYPE:
|
|
117
|
+
return type;
|
|
118
|
+
|
|
119
|
+
default:
|
|
120
|
+
var $$typeofType = type && type.$$typeof;
|
|
121
|
+
|
|
122
|
+
switch ($$typeofType) {
|
|
123
|
+
case REACT_CONTEXT_TYPE:
|
|
124
|
+
case REACT_FORWARD_REF_TYPE:
|
|
125
|
+
case REACT_LAZY_TYPE:
|
|
126
|
+
case REACT_MEMO_TYPE:
|
|
127
|
+
case REACT_PROVIDER_TYPE:
|
|
128
|
+
return $$typeofType;
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
return $$typeof;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
case REACT_PORTAL_TYPE:
|
|
137
|
+
return $$typeof;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return undefined;
|
|
142
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
143
|
+
|
|
144
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
145
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
146
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
147
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
148
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
149
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
150
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
151
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
152
|
+
var Memo = REACT_MEMO_TYPE;
|
|
153
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
154
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
155
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
156
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
157
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
158
|
+
|
|
159
|
+
function isAsyncMode(object) {
|
|
160
|
+
{
|
|
161
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
162
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
163
|
+
|
|
164
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
169
|
+
}
|
|
170
|
+
function isConcurrentMode(object) {
|
|
171
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
172
|
+
}
|
|
173
|
+
function isContextConsumer(object) {
|
|
174
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
175
|
+
}
|
|
176
|
+
function isContextProvider(object) {
|
|
177
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
178
|
+
}
|
|
179
|
+
function isElement(object) {
|
|
180
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
181
|
+
}
|
|
182
|
+
function isForwardRef(object) {
|
|
183
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
184
|
+
}
|
|
185
|
+
function isFragment(object) {
|
|
186
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
187
|
+
}
|
|
188
|
+
function isLazy(object) {
|
|
189
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
190
|
+
}
|
|
191
|
+
function isMemo(object) {
|
|
192
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
193
|
+
}
|
|
194
|
+
function isPortal(object) {
|
|
195
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
196
|
+
}
|
|
197
|
+
function isProfiler(object) {
|
|
198
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
199
|
+
}
|
|
200
|
+
function isStrictMode(object) {
|
|
201
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
202
|
+
}
|
|
203
|
+
function isSuspense(object) {
|
|
204
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
exports.AsyncMode = AsyncMode;
|
|
208
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
209
|
+
exports.ContextConsumer = ContextConsumer;
|
|
210
|
+
exports.ContextProvider = ContextProvider;
|
|
211
|
+
exports.Element = Element;
|
|
212
|
+
exports.ForwardRef = ForwardRef;
|
|
213
|
+
exports.Fragment = Fragment;
|
|
214
|
+
exports.Lazy = Lazy;
|
|
215
|
+
exports.Memo = Memo;
|
|
216
|
+
exports.Portal = Portal;
|
|
217
|
+
exports.Profiler = Profiler;
|
|
218
|
+
exports.StrictMode = StrictMode;
|
|
219
|
+
exports.Suspense = Suspense;
|
|
220
|
+
exports.isAsyncMode = isAsyncMode;
|
|
221
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
222
|
+
exports.isContextConsumer = isContextConsumer;
|
|
223
|
+
exports.isContextProvider = isContextProvider;
|
|
224
|
+
exports.isElement = isElement;
|
|
225
|
+
exports.isForwardRef = isForwardRef;
|
|
226
|
+
exports.isFragment = isFragment;
|
|
227
|
+
exports.isLazy = isLazy;
|
|
228
|
+
exports.isMemo = isMemo;
|
|
229
|
+
exports.isPortal = isPortal;
|
|
230
|
+
exports.isProfiler = isProfiler;
|
|
231
|
+
exports.isStrictMode = isStrictMode;
|
|
232
|
+
exports.isSuspense = isSuspense;
|
|
233
|
+
exports.isValidElementType = isValidElementType;
|
|
234
|
+
exports.typeOf = typeOf;
|
|
235
|
+
})();
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
var reactIs = createCommonjsModule(function (module) {
|
|
240
|
+
|
|
241
|
+
if (process.env.NODE_ENV === 'production') {
|
|
242
|
+
module.exports = reactIs_production_min;
|
|
243
|
+
} else {
|
|
244
|
+
module.exports = reactIs_development;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
/*
|
|
249
|
+
object-assign
|
|
250
|
+
(c) Sindre Sorhus
|
|
251
|
+
@license MIT
|
|
252
|
+
*/
|
|
253
|
+
/* eslint-disable no-unused-vars */
|
|
254
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
255
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
256
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
257
|
+
|
|
258
|
+
function toObject(val) {
|
|
259
|
+
if (val === null || val === undefined) {
|
|
260
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return Object(val);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function shouldUseNative() {
|
|
267
|
+
try {
|
|
268
|
+
if (!Object.assign) {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
273
|
+
|
|
274
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
275
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
276
|
+
test1[5] = 'de';
|
|
277
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
282
|
+
var test2 = {};
|
|
283
|
+
for (var i = 0; i < 10; i++) {
|
|
284
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
285
|
+
}
|
|
286
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
287
|
+
return test2[n];
|
|
288
|
+
});
|
|
289
|
+
if (order2.join('') !== '0123456789') {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
294
|
+
var test3 = {};
|
|
295
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
296
|
+
test3[letter] = letter;
|
|
297
|
+
});
|
|
298
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
299
|
+
'abcdefghijklmnopqrst') {
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return true;
|
|
304
|
+
} catch (err) {
|
|
305
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
311
|
+
var from;
|
|
312
|
+
var to = toObject(target);
|
|
313
|
+
var symbols;
|
|
314
|
+
|
|
315
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
316
|
+
from = Object(arguments[s]);
|
|
317
|
+
|
|
318
|
+
for (var key in from) {
|
|
319
|
+
if (hasOwnProperty.call(from, key)) {
|
|
320
|
+
to[key] = from[key];
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (getOwnPropertySymbols) {
|
|
325
|
+
symbols = getOwnPropertySymbols(from);
|
|
326
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
327
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
328
|
+
to[symbols[i]] = from[symbols[i]];
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
return to;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the MIT license found in the
|
|
341
|
+
* LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
345
|
+
|
|
346
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
|
|
347
|
+
|
|
348
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
349
|
+
|
|
350
|
+
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
351
|
+
|
|
352
|
+
var has$1 = has$2;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
356
|
+
*
|
|
357
|
+
* This source code is licensed under the MIT license found in the
|
|
358
|
+
* LICENSE file in the root directory of this source tree.
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
var printWarning$1 = function() {};
|
|
362
|
+
|
|
363
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
364
|
+
var ReactPropTypesSecret = ReactPropTypesSecret$1;
|
|
365
|
+
var loggedTypeFailures = {};
|
|
366
|
+
var has = has$1;
|
|
367
|
+
|
|
368
|
+
printWarning$1 = function(text) {
|
|
369
|
+
var message = 'Warning: ' + text;
|
|
370
|
+
if (typeof console !== 'undefined') {
|
|
371
|
+
console.error(message);
|
|
372
|
+
}
|
|
373
|
+
try {
|
|
374
|
+
// --- Welcome to debugging React ---
|
|
375
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
376
|
+
// to find the callsite that caused this warning to fire.
|
|
377
|
+
throw new Error(message);
|
|
378
|
+
} catch (x) { /**/ }
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Assert that the values match with the type specs.
|
|
384
|
+
* Error messages are memorized and will only be shown once.
|
|
385
|
+
*
|
|
386
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
387
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
388
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
389
|
+
* @param {string} componentName Name of the component for error messages.
|
|
390
|
+
* @param {?Function} getStack Returns the component stack.
|
|
391
|
+
* @private
|
|
392
|
+
*/
|
|
393
|
+
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
394
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
395
|
+
for (var typeSpecName in typeSpecs) {
|
|
396
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
397
|
+
var error;
|
|
398
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
399
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
400
|
+
// After these have been cleaned up, we'll let them throw.
|
|
401
|
+
try {
|
|
402
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
403
|
+
// behavior as without this statement except with a better message.
|
|
404
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
405
|
+
var err = Error(
|
|
406
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
407
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
408
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
409
|
+
);
|
|
410
|
+
err.name = 'Invariant Violation';
|
|
411
|
+
throw err;
|
|
412
|
+
}
|
|
413
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
414
|
+
} catch (ex) {
|
|
415
|
+
error = ex;
|
|
416
|
+
}
|
|
417
|
+
if (error && !(error instanceof Error)) {
|
|
418
|
+
printWarning$1(
|
|
419
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
420
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
421
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
422
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
423
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
424
|
+
'shape all require an argument).'
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
428
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
429
|
+
// same error.
|
|
430
|
+
loggedTypeFailures[error.message] = true;
|
|
431
|
+
|
|
432
|
+
var stack = getStack ? getStack() : '';
|
|
433
|
+
|
|
434
|
+
printWarning$1(
|
|
435
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Resets warning cache when testing.
|
|
445
|
+
*
|
|
446
|
+
* @private
|
|
447
|
+
*/
|
|
448
|
+
checkPropTypes$1.resetWarningCache = function() {
|
|
449
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
450
|
+
loggedTypeFailures = {};
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
var checkPropTypes_1 = checkPropTypes$1;
|
|
455
|
+
|
|
456
|
+
var checkPropTypes = checkPropTypes_1;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the MIT license found in the
|
|
462
|
+
* LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
var printWarning = function() {};
|
|
473
|
+
|
|
474
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
475
|
+
printWarning = function(text) {
|
|
476
|
+
var message = 'Warning: ' + text;
|
|
477
|
+
if (typeof console !== 'undefined') {
|
|
478
|
+
console.error(message);
|
|
479
|
+
}
|
|
480
|
+
try {
|
|
481
|
+
// --- Welcome to debugging React ---
|
|
482
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
483
|
+
// to find the callsite that caused this warning to fire.
|
|
484
|
+
throw new Error(message);
|
|
485
|
+
} catch (x) {}
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function emptyFunctionThatReturnsNull() {
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
494
|
+
/* global Symbol */
|
|
495
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
496
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Returns the iterator method function contained on the iterable object.
|
|
500
|
+
*
|
|
501
|
+
* Be sure to invoke the function with the iterable as context:
|
|
502
|
+
*
|
|
503
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
504
|
+
* if (iteratorFn) {
|
|
505
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
506
|
+
* ...
|
|
507
|
+
* }
|
|
508
|
+
*
|
|
509
|
+
* @param {?object} maybeIterable
|
|
510
|
+
* @return {?function}
|
|
511
|
+
*/
|
|
512
|
+
function getIteratorFn(maybeIterable) {
|
|
513
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
514
|
+
if (typeof iteratorFn === 'function') {
|
|
515
|
+
return iteratorFn;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
521
|
+
* supplied to React components. Example usage:
|
|
522
|
+
*
|
|
523
|
+
* var Props = require('ReactPropTypes');
|
|
524
|
+
* var MyArticle = React.createClass({
|
|
525
|
+
* propTypes: {
|
|
526
|
+
* // An optional string prop named "description".
|
|
527
|
+
* description: Props.string,
|
|
528
|
+
*
|
|
529
|
+
* // A required enum prop named "category".
|
|
530
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
531
|
+
*
|
|
532
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
533
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
534
|
+
* },
|
|
535
|
+
* render: function() { ... }
|
|
536
|
+
* });
|
|
537
|
+
*
|
|
538
|
+
* A more formal specification of how these methods are used:
|
|
539
|
+
*
|
|
540
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
541
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
542
|
+
*
|
|
543
|
+
* Each and every declaration produces a function with the same signature. This
|
|
544
|
+
* allows the creation of custom validation functions. For example:
|
|
545
|
+
*
|
|
546
|
+
* var MyLink = React.createClass({
|
|
547
|
+
* propTypes: {
|
|
548
|
+
* // An optional string or URI prop named "href".
|
|
549
|
+
* href: function(props, propName, componentName) {
|
|
550
|
+
* var propValue = props[propName];
|
|
551
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
552
|
+
* !(propValue instanceof URI)) {
|
|
553
|
+
* return new Error(
|
|
554
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
555
|
+
* componentName
|
|
556
|
+
* );
|
|
557
|
+
* }
|
|
558
|
+
* }
|
|
559
|
+
* },
|
|
560
|
+
* render: function() {...}
|
|
561
|
+
* });
|
|
562
|
+
*
|
|
563
|
+
* @internal
|
|
564
|
+
*/
|
|
565
|
+
|
|
566
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
567
|
+
|
|
568
|
+
// Important!
|
|
569
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
570
|
+
var ReactPropTypes = {
|
|
571
|
+
array: createPrimitiveTypeChecker('array'),
|
|
572
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
573
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
574
|
+
func: createPrimitiveTypeChecker('function'),
|
|
575
|
+
number: createPrimitiveTypeChecker('number'),
|
|
576
|
+
object: createPrimitiveTypeChecker('object'),
|
|
577
|
+
string: createPrimitiveTypeChecker('string'),
|
|
578
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
579
|
+
|
|
580
|
+
any: createAnyTypeChecker(),
|
|
581
|
+
arrayOf: createArrayOfTypeChecker,
|
|
582
|
+
element: createElementTypeChecker(),
|
|
583
|
+
elementType: createElementTypeTypeChecker(),
|
|
584
|
+
instanceOf: createInstanceTypeChecker,
|
|
585
|
+
node: createNodeChecker(),
|
|
586
|
+
objectOf: createObjectOfTypeChecker,
|
|
587
|
+
oneOf: createEnumTypeChecker,
|
|
588
|
+
oneOfType: createUnionTypeChecker,
|
|
589
|
+
shape: createShapeTypeChecker,
|
|
590
|
+
exact: createStrictShapeTypeChecker,
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
595
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
596
|
+
*/
|
|
597
|
+
/*eslint-disable no-self-compare*/
|
|
598
|
+
function is(x, y) {
|
|
599
|
+
// SameValue algorithm
|
|
600
|
+
if (x === y) {
|
|
601
|
+
// Steps 1-5, 7-10
|
|
602
|
+
// Steps 6.b-6.e: +0 != -0
|
|
603
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
604
|
+
} else {
|
|
605
|
+
// Step 6.a: NaN == NaN
|
|
606
|
+
return x !== x && y !== y;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/*eslint-enable no-self-compare*/
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
613
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
614
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
615
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
616
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
617
|
+
*/
|
|
618
|
+
function PropTypeError(message, data) {
|
|
619
|
+
this.message = message;
|
|
620
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
621
|
+
this.stack = '';
|
|
622
|
+
}
|
|
623
|
+
// Make `instanceof Error` still work for returned errors.
|
|
624
|
+
PropTypeError.prototype = Error.prototype;
|
|
625
|
+
|
|
626
|
+
function createChainableTypeChecker(validate) {
|
|
627
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
628
|
+
var manualPropTypeCallCache = {};
|
|
629
|
+
var manualPropTypeWarningCount = 0;
|
|
630
|
+
}
|
|
631
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
632
|
+
componentName = componentName || ANONYMOUS;
|
|
633
|
+
propFullName = propFullName || propName;
|
|
634
|
+
|
|
635
|
+
if (secret !== ReactPropTypesSecret$1) {
|
|
636
|
+
if (throwOnDirectAccess) {
|
|
637
|
+
// New behavior only for users of `prop-types` package
|
|
638
|
+
var err = new Error(
|
|
639
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
640
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
641
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
642
|
+
);
|
|
643
|
+
err.name = 'Invariant Violation';
|
|
644
|
+
throw err;
|
|
645
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
646
|
+
// Old behavior for people using React.PropTypes
|
|
647
|
+
var cacheKey = componentName + ':' + propName;
|
|
648
|
+
if (
|
|
649
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
650
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
651
|
+
manualPropTypeWarningCount < 3
|
|
652
|
+
) {
|
|
653
|
+
printWarning(
|
|
654
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
655
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
656
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
657
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
658
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
659
|
+
);
|
|
660
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
661
|
+
manualPropTypeWarningCount++;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
if (props[propName] == null) {
|
|
666
|
+
if (isRequired) {
|
|
667
|
+
if (props[propName] === null) {
|
|
668
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
669
|
+
}
|
|
670
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
671
|
+
}
|
|
672
|
+
return null;
|
|
673
|
+
} else {
|
|
674
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
679
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
680
|
+
|
|
681
|
+
return chainedCheckType;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
685
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
686
|
+
var propValue = props[propName];
|
|
687
|
+
var propType = getPropType(propValue);
|
|
688
|
+
if (propType !== expectedType) {
|
|
689
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
690
|
+
// check, but we can offer a more precise error message here rather than
|
|
691
|
+
// 'of type `object`'.
|
|
692
|
+
var preciseType = getPreciseType(propValue);
|
|
693
|
+
|
|
694
|
+
return new PropTypeError(
|
|
695
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
696
|
+
{expectedType: expectedType}
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
return createChainableTypeChecker(validate);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function createAnyTypeChecker() {
|
|
705
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
709
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
710
|
+
if (typeof typeChecker !== 'function') {
|
|
711
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
712
|
+
}
|
|
713
|
+
var propValue = props[propName];
|
|
714
|
+
if (!Array.isArray(propValue)) {
|
|
715
|
+
var propType = getPropType(propValue);
|
|
716
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
717
|
+
}
|
|
718
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
719
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
720
|
+
if (error instanceof Error) {
|
|
721
|
+
return error;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
return createChainableTypeChecker(validate);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
function createElementTypeChecker() {
|
|
730
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
731
|
+
var propValue = props[propName];
|
|
732
|
+
if (!isValidElement(propValue)) {
|
|
733
|
+
var propType = getPropType(propValue);
|
|
734
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
735
|
+
}
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
738
|
+
return createChainableTypeChecker(validate);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
function createElementTypeTypeChecker() {
|
|
742
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
743
|
+
var propValue = props[propName];
|
|
744
|
+
if (!reactIs.isValidElementType(propValue)) {
|
|
745
|
+
var propType = getPropType(propValue);
|
|
746
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
747
|
+
}
|
|
748
|
+
return null;
|
|
749
|
+
}
|
|
750
|
+
return createChainableTypeChecker(validate);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
754
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
755
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
756
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
757
|
+
var actualClassName = getClassName(props[propName]);
|
|
758
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
759
|
+
}
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
return createChainableTypeChecker(validate);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function createEnumTypeChecker(expectedValues) {
|
|
766
|
+
if (!Array.isArray(expectedValues)) {
|
|
767
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
768
|
+
if (arguments.length > 1) {
|
|
769
|
+
printWarning(
|
|
770
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
771
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
772
|
+
);
|
|
773
|
+
} else {
|
|
774
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
return emptyFunctionThatReturnsNull;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
781
|
+
var propValue = props[propName];
|
|
782
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
783
|
+
if (is(propValue, expectedValues[i])) {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
789
|
+
var type = getPreciseType(value);
|
|
790
|
+
if (type === 'symbol') {
|
|
791
|
+
return String(value);
|
|
792
|
+
}
|
|
793
|
+
return value;
|
|
794
|
+
});
|
|
795
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
796
|
+
}
|
|
797
|
+
return createChainableTypeChecker(validate);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
801
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
802
|
+
if (typeof typeChecker !== 'function') {
|
|
803
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
804
|
+
}
|
|
805
|
+
var propValue = props[propName];
|
|
806
|
+
var propType = getPropType(propValue);
|
|
807
|
+
if (propType !== 'object') {
|
|
808
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
809
|
+
}
|
|
810
|
+
for (var key in propValue) {
|
|
811
|
+
if (has$1(propValue, key)) {
|
|
812
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
813
|
+
if (error instanceof Error) {
|
|
814
|
+
return error;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return null;
|
|
819
|
+
}
|
|
820
|
+
return createChainableTypeChecker(validate);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
824
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
825
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
826
|
+
return emptyFunctionThatReturnsNull;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
830
|
+
var checker = arrayOfTypeCheckers[i];
|
|
831
|
+
if (typeof checker !== 'function') {
|
|
832
|
+
printWarning(
|
|
833
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
834
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
835
|
+
);
|
|
836
|
+
return emptyFunctionThatReturnsNull;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
841
|
+
var expectedTypes = [];
|
|
842
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
843
|
+
var checker = arrayOfTypeCheckers[i];
|
|
844
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
845
|
+
if (checkerResult == null) {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
if (checkerResult.data && has$1(checkerResult.data, 'expectedType')) {
|
|
849
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
853
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
854
|
+
}
|
|
855
|
+
return createChainableTypeChecker(validate);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
function createNodeChecker() {
|
|
859
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
860
|
+
if (!isNode(props[propName])) {
|
|
861
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
862
|
+
}
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
return createChainableTypeChecker(validate);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
869
|
+
return new PropTypeError(
|
|
870
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
871
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
876
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
877
|
+
var propValue = props[propName];
|
|
878
|
+
var propType = getPropType(propValue);
|
|
879
|
+
if (propType !== 'object') {
|
|
880
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
881
|
+
}
|
|
882
|
+
for (var key in shapeTypes) {
|
|
883
|
+
var checker = shapeTypes[key];
|
|
884
|
+
if (typeof checker !== 'function') {
|
|
885
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
886
|
+
}
|
|
887
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
888
|
+
if (error) {
|
|
889
|
+
return error;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return null;
|
|
893
|
+
}
|
|
894
|
+
return createChainableTypeChecker(validate);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
898
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
899
|
+
var propValue = props[propName];
|
|
900
|
+
var propType = getPropType(propValue);
|
|
901
|
+
if (propType !== 'object') {
|
|
902
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
903
|
+
}
|
|
904
|
+
// We need to check all keys in case some are required but missing from props.
|
|
905
|
+
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
|
906
|
+
for (var key in allKeys) {
|
|
907
|
+
var checker = shapeTypes[key];
|
|
908
|
+
if (has$1(shapeTypes, key) && typeof checker !== 'function') {
|
|
909
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
910
|
+
}
|
|
911
|
+
if (!checker) {
|
|
912
|
+
return new PropTypeError(
|
|
913
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
914
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
915
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
916
|
+
);
|
|
917
|
+
}
|
|
918
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
919
|
+
if (error) {
|
|
920
|
+
return error;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return null;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
return createChainableTypeChecker(validate);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
function isNode(propValue) {
|
|
930
|
+
switch (typeof propValue) {
|
|
931
|
+
case 'number':
|
|
932
|
+
case 'string':
|
|
933
|
+
case 'undefined':
|
|
934
|
+
return true;
|
|
935
|
+
case 'boolean':
|
|
936
|
+
return !propValue;
|
|
937
|
+
case 'object':
|
|
938
|
+
if (Array.isArray(propValue)) {
|
|
939
|
+
return propValue.every(isNode);
|
|
940
|
+
}
|
|
941
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
942
|
+
return true;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
946
|
+
if (iteratorFn) {
|
|
947
|
+
var iterator = iteratorFn.call(propValue);
|
|
948
|
+
var step;
|
|
949
|
+
if (iteratorFn !== propValue.entries) {
|
|
950
|
+
while (!(step = iterator.next()).done) {
|
|
951
|
+
if (!isNode(step.value)) {
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
} else {
|
|
956
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
957
|
+
while (!(step = iterator.next()).done) {
|
|
958
|
+
var entry = step.value;
|
|
959
|
+
if (entry) {
|
|
960
|
+
if (!isNode(entry[1])) {
|
|
961
|
+
return false;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
} else {
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
return true;
|
|
971
|
+
default:
|
|
972
|
+
return false;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
function isSymbol(propType, propValue) {
|
|
977
|
+
// Native Symbol.
|
|
978
|
+
if (propType === 'symbol') {
|
|
979
|
+
return true;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// falsy value can't be a Symbol
|
|
983
|
+
if (!propValue) {
|
|
984
|
+
return false;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
988
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
989
|
+
return true;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
993
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
994
|
+
return true;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1001
|
+
function getPropType(propValue) {
|
|
1002
|
+
var propType = typeof propValue;
|
|
1003
|
+
if (Array.isArray(propValue)) {
|
|
1004
|
+
return 'array';
|
|
1005
|
+
}
|
|
1006
|
+
if (propValue instanceof RegExp) {
|
|
1007
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1008
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1009
|
+
// passes PropTypes.object.
|
|
1010
|
+
return 'object';
|
|
1011
|
+
}
|
|
1012
|
+
if (isSymbol(propType, propValue)) {
|
|
1013
|
+
return 'symbol';
|
|
1014
|
+
}
|
|
1015
|
+
return propType;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1019
|
+
// See `createPrimitiveTypeChecker`.
|
|
1020
|
+
function getPreciseType(propValue) {
|
|
1021
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1022
|
+
return '' + propValue;
|
|
1023
|
+
}
|
|
1024
|
+
var propType = getPropType(propValue);
|
|
1025
|
+
if (propType === 'object') {
|
|
1026
|
+
if (propValue instanceof Date) {
|
|
1027
|
+
return 'date';
|
|
1028
|
+
} else if (propValue instanceof RegExp) {
|
|
1029
|
+
return 'regexp';
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
return propType;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1036
|
+
// For example, "undefined" or "of type array"
|
|
1037
|
+
function getPostfixForTypeWarning(value) {
|
|
1038
|
+
var type = getPreciseType(value);
|
|
1039
|
+
switch (type) {
|
|
1040
|
+
case 'array':
|
|
1041
|
+
case 'object':
|
|
1042
|
+
return 'an ' + type;
|
|
1043
|
+
case 'boolean':
|
|
1044
|
+
case 'date':
|
|
1045
|
+
case 'regexp':
|
|
1046
|
+
return 'a ' + type;
|
|
1047
|
+
default:
|
|
1048
|
+
return type;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
// Returns class name of the object, if any.
|
|
1053
|
+
function getClassName(propValue) {
|
|
1054
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1055
|
+
return ANONYMOUS;
|
|
1056
|
+
}
|
|
1057
|
+
return propValue.constructor.name;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1061
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1062
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1063
|
+
|
|
1064
|
+
return ReactPropTypes;
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1069
|
+
*
|
|
1070
|
+
* This source code is licensed under the MIT license found in the
|
|
1071
|
+
* LICENSE file in the root directory of this source tree.
|
|
1072
|
+
*/
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
function emptyFunction() {}
|
|
1077
|
+
function emptyFunctionWithReset() {}
|
|
1078
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1079
|
+
|
|
1080
|
+
var factoryWithThrowingShims = function() {
|
|
1081
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1082
|
+
if (secret === ReactPropTypesSecret$1) {
|
|
1083
|
+
// It is still safe when called from React.
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
var err = new Error(
|
|
1087
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1088
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1089
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1090
|
+
);
|
|
1091
|
+
err.name = 'Invariant Violation';
|
|
1092
|
+
throw err;
|
|
1093
|
+
} shim.isRequired = shim;
|
|
1094
|
+
function getShim() {
|
|
1095
|
+
return shim;
|
|
1096
|
+
} // Important!
|
|
1097
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1098
|
+
var ReactPropTypes = {
|
|
1099
|
+
array: shim,
|
|
1100
|
+
bigint: shim,
|
|
1101
|
+
bool: shim,
|
|
1102
|
+
func: shim,
|
|
1103
|
+
number: shim,
|
|
1104
|
+
object: shim,
|
|
1105
|
+
string: shim,
|
|
1106
|
+
symbol: shim,
|
|
1107
|
+
|
|
1108
|
+
any: shim,
|
|
1109
|
+
arrayOf: getShim,
|
|
1110
|
+
element: shim,
|
|
1111
|
+
elementType: shim,
|
|
1112
|
+
instanceOf: getShim,
|
|
1113
|
+
node: shim,
|
|
1114
|
+
objectOf: getShim,
|
|
1115
|
+
oneOf: getShim,
|
|
1116
|
+
oneOfType: getShim,
|
|
1117
|
+
shape: getShim,
|
|
1118
|
+
exact: getShim,
|
|
1119
|
+
|
|
1120
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
1121
|
+
resetWarningCache: emptyFunction
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1125
|
+
|
|
1126
|
+
return ReactPropTypes;
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
var require$$1 = factoryWithTypeCheckers;
|
|
1130
|
+
|
|
1131
|
+
var require$$2 = factoryWithThrowingShims;
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1135
|
+
*
|
|
1136
|
+
* This source code is licensed under the MIT license found in the
|
|
1137
|
+
* LICENSE file in the root directory of this source tree.
|
|
1138
|
+
*/
|
|
1139
|
+
|
|
1140
|
+
var propTypes = createCommonjsModule(function (module) {
|
|
1141
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1142
|
+
var ReactIs = reactIs;
|
|
1143
|
+
|
|
1144
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1145
|
+
// http://fb.me/prop-types-in-prod
|
|
1146
|
+
var throwOnDirectAccess = true;
|
|
1147
|
+
module.exports = require$$1(ReactIs.isElement, throwOnDirectAccess);
|
|
1148
|
+
} else {
|
|
1149
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1150
|
+
// http://fb.me/prop-types-in-prod
|
|
1151
|
+
module.exports = require$$2();
|
|
1152
|
+
}
|
|
1153
|
+
});
|
|
1154
|
+
|
|
1155
|
+
var PropTypes = propTypes;
|
|
1156
|
+
|
|
1157
|
+
var styles$1 = {"container":"_lIpAT","button":"_sS-Yj","m-0":"_hBGrg","p-0":"_fOezx","m-1":"_R79vC","p-1":"_BGhZS","m-2":"_4WQa1","p-2":"_-hkj1","m-3":"_ePtXr","p-3":"_ihe2B","m-4":"_KplPo","p-4":"_2vDkp","m-5":"_4AqfI","p-5":"_FfAMs","m-6":"_53MvX","p-6":"_e-x4J","m-7":"_EtdrG","p-7":"_FLCe5","m-8":"_1IHYX","p-8":"_fZzmM","m-9":"_QsD9D","p-9":"_6Sr2Q","m-10":"_LvJdU","p-10":"_ah-tz","ml-0":"_De6uE","pl-0":"_aQ1ph","ml-1":"_5Bwy4","pl-1":"_j4wAR","ml-2":"_qeK50","pl-2":"_VC868","ml-3":"_LuNZb","pl-3":"_3fxbv","ml-4":"_XiU0I","pl-4":"_hPWPx","ml-5":"_xkmy7","pl-5":"_vZWUx","ml-6":"_HJ-Oe","pl-6":"_nx5bN","ml-7":"_L-cTm","pl-7":"_XyNJZ","ml-8":"_GUJTt","pl-8":"_O-OPx","ml-9":"_4DBUs","pl-9":"_W5E4J","ml-10":"_TsFNa","pl-10":"_a07G-","mr-0":"_KuY5-","pr-0":"_Zv2gF","mr-1":"_IylJL","pr-1":"_DIaMC","mr-2":"_wodzN","pr-2":"_x7vGR","mr-3":"_cg-WA","pr-3":"_-GR0e","mr-4":"_zip09","pr-4":"_mrzBz","mr-5":"_Z3SdR","pr-5":"_FOt7u","mr-6":"_DX3gj","pr-6":"_caE8K","mr-7":"_SRVDr","pr-7":"_7h7Xw","mr-8":"_bvjcP","pr-8":"_WxJl8","mr-9":"_CDXo1","pr-9":"_uftSg","mr-10":"_WqvBW","pr-10":"_75aX1","mt-0":"_lfLEb","pt-0":"_FszNW","mt-1":"_xtok6","pt-1":"_cDFtN","mt-2":"_j96uZ","pt-2":"_BX40s","mt-3":"_3--yt","pt-3":"_qkmXr","mt-4":"_DhLUo","pt-4":"_AG7V9","mt-5":"_Gn5bX","pt-5":"_5-rlk","mt-6":"_c6g6t","pt-6":"_iWQbs","mt-7":"_6X-oB","pt-7":"_i82Td","mt-8":"_uK93t","pt-8":"_ESUrY","mt-9":"_LmSrq","pt-9":"_BgZxc","mt-10":"_mPy8r","pt-10":"_ddKoS","mb-0":"_gs1hc","pb-0":"_k94Xn","mb-1":"_8XN6g","pb-1":"_lJSHs","mb-2":"_y04oG","pb-2":"_cNkcX","mb-3":"_3-Ex4","pb-3":"_UlTDL","mb-4":"_ZchCM","pb-4":"_PrDJ0","mb-5":"_Al-qI","pb-5":"_9ExxH","mb-6":"_38fJH","pb-6":"_YPJnw","mb-7":"_ViLUm","pb-7":"_YtQHK","mb-8":"_Jm2m3","pb-8":"_hQSln","mb-9":"_73cuP","pb-9":"_Hm-oe","mb-10":"_90atw","pb-10":"_GxdOW","mx-0":"_786dB","px-0":"_b-KUL","mx-1":"_1sw2D","px-1":"_pfikG","mx-2":"_ZCsfc","px-2":"_-E-rP","mx-3":"_Vzqfk","px-3":"_Evygh","mx-4":"_g6XKX","px-4":"_hzPZK","mx-5":"_6Yusw","px-5":"_43D2o","mx-6":"_l7jig","px-6":"_X4DAB","mx-7":"_xCEJ4","px-7":"_kFsKL","mx-8":"_bcZ3x","px-8":"_qKJ-o","mx-9":"_pmzk-","px-9":"_5kFZh","mx-10":"_ZtyHL","px-10":"_RzSP4","my-0":"_iGkHt","py-0":"_tFXK8","my-1":"_9p151","py-1":"_1ExYH","my-2":"_hDX-y","py-2":"_j2Iqz","my-3":"_ZoP-i","py-3":"_JiyfX","my-4":"_6dHeQ","py-4":"_Val1l","my-5":"_yF8w9","py-5":"_3Do00","my-6":"_5ATW7","py-6":"_EqQi0","my-7":"_6Kng-","py-7":"_kFB05","my-8":"_fqkrf","py-8":"_wkYlc","my-9":"_yC6ha","py-9":"_nR4hK","my-10":"_46v2E","py-10":"_yjbuZ","m-sm-0":"_mXg7O","p-sm-0":"_sRkzF","m-sm-1":"_uh76t","p-sm-1":"_mnvOq","m-sm-2":"_-Lxwk","p-sm-2":"_9AoV6","m-sm-3":"_k6uGI","p-sm-3":"_FPlck","m-sm-4":"_XWNGm","p-sm-4":"_UhY4z","m-sm-5":"_nqmEm","p-sm-5":"_O3yzT","m-sm-6":"_1C7QT","p-sm-6":"_yR3CC","m-sm-7":"_vlqMl","p-sm-7":"_otIfI","m-sm-8":"_f-GUL","p-sm-8":"_oMnLQ","m-sm-9":"_Klhy3","p-sm-9":"_xYdqe","m-sm-10":"_jg7tY","p-sm-10":"_-28KU","ml-sm-0":"_6hhVb","pl-sm-0":"_WV4uZ","ml-sm-1":"_u--dD","pl-sm-1":"_k2dSZ","ml-sm-2":"_ng1Wx","pl-sm-2":"_A6pLt","ml-sm-3":"_OKwcI","pl-sm-3":"_uxcE6","ml-sm-4":"_dHy5x","pl-sm-4":"_loKKN","ml-sm-5":"_pWXnn","pl-sm-5":"_6KcZ0","ml-sm-6":"_8DdT4","pl-sm-6":"_atdfH","ml-sm-7":"_-BksR","pl-sm-7":"_B6uGl","ml-sm-8":"_rL6Yi","pl-sm-8":"_L0Gt6","ml-sm-9":"_sDCuc","pl-sm-9":"_5ndTT","ml-sm-10":"_d0sOv","pl-sm-10":"_MzCci","mr-sm-0":"_TxpxL","pr-sm-0":"_ReTjB","mr-sm-1":"_ZDd-C","pr-sm-1":"_6ux6P","mr-sm-2":"_SbIys","pr-sm-2":"_0dAjY","mr-sm-3":"_WT-FE","pr-sm-3":"_hgzpB","mr-sm-4":"_ovLOk","pr-sm-4":"_YVXRD","mr-sm-5":"_3gKfj","pr-sm-5":"_GKqKE","mr-sm-6":"_EJ3Ig","pr-sm-6":"_pKU7W","mr-sm-7":"_MfWyc","pr-sm-7":"_439vk","mr-sm-8":"_HsLqa","pr-sm-8":"_Afu8-","mr-sm-9":"_k-uXQ","pr-sm-9":"_GSZg6","mr-sm-10":"_buR-E","pr-sm-10":"_GoGHq","mt-sm-0":"_3eC5V","pt-sm-0":"_w0Row","mt-sm-1":"_lFsar","pt-sm-1":"_rhMZX","mt-sm-2":"_HchNc","pt-sm-2":"_Xyn5a","mt-sm-3":"_INU0e","pt-sm-3":"_i9zkC","mt-sm-4":"_d1xqQ","pt-sm-4":"_eMU-M","mt-sm-5":"_gYMLN","pt-sm-5":"_sG2g-","mt-sm-6":"_U4BDm","pt-sm-6":"_nagya","mt-sm-7":"_f4nLP","pt-sm-7":"_3jMHw","mt-sm-8":"_hZW3J","pt-sm-8":"_woC7I","mt-sm-9":"_SFf2s","pt-sm-9":"_nuLoR","mt-sm-10":"_k1lF9","pt-sm-10":"_WG3-N","mb-sm-0":"_fQPR-","pb-sm-0":"_eL6LV","mb-sm-1":"_Z7gTR","pb-sm-1":"_OdGhD","mb-sm-2":"_dkjwo","pb-sm-2":"_kKhvE","mb-sm-3":"_meX0E","pb-sm-3":"_kh7Ku","mb-sm-4":"_rrb92","pb-sm-4":"_aytJc","mb-sm-5":"_wPkH4","pb-sm-5":"_1nZ-9","mb-sm-6":"_MkdDA","pb-sm-6":"_BxNLc","mb-sm-7":"_Nfm1A","pb-sm-7":"_-r452","mb-sm-8":"_K1omF","pb-sm-8":"_4-6gt","mb-sm-9":"_OUWsR","pb-sm-9":"_7DXr5","mb-sm-10":"_wZv7f","pb-sm-10":"_21WIP","mx-sm-0":"_hCRDg","px-sm-0":"_Bdj31","mx-sm-1":"_sx6bH","px-sm-1":"_jQXbZ","mx-sm-2":"_aCjIb","px-sm-2":"_-DBsZ","mx-sm-3":"_p2bFN","px-sm-3":"_d6ice","mx-sm-4":"_GZmNE","px-sm-4":"_7D10W","mx-sm-5":"_tKkEN","px-sm-5":"_J2iH5","mx-sm-6":"_iJju-","px-sm-6":"_m2ygK","mx-sm-7":"_chPCu","px-sm-7":"_C0aVt","mx-sm-8":"_twRB-","px-sm-8":"_6DezI","mx-sm-9":"_z1iZL","px-sm-9":"_HLE-F","mx-sm-10":"_F58U0","px-sm-10":"_Mat2S","my-sm-0":"_nADuT","py-sm-0":"_yu79u","my-sm-1":"_TEHyf","py-sm-1":"_MkRV5","my-sm-2":"_wfxJN","py-sm-2":"_qjIa5","my-sm-3":"_ch7TX","py-sm-3":"_0ZM5Q","my-sm-4":"_KQyj3","py-sm-4":"_npV56","my-sm-5":"_antvz","py-sm-5":"_qK29t","my-sm-6":"_PIZw6","py-sm-6":"_kwzra","my-sm-7":"_IPjVc","py-sm-7":"_NPJ-2","my-sm-8":"_Sxu2p","py-sm-8":"_VUG-4","my-sm-9":"_mLy-T","py-sm-9":"_U-1Tz","my-sm-10":"_6LGF-","py-sm-10":"_1I7Qo","m-lg-0":"_7JHxT","p-lg-0":"_dZxSG","m-lg-1":"_ap69K","p-lg-1":"_yAiEU","m-lg-2":"_cu0Gq","p-lg-2":"_p2Nvp","m-lg-3":"_ipTnO","p-lg-3":"_uekmi","m-lg-4":"_Ocj1U","p-lg-4":"_T5xZ0","m-lg-5":"_9QwAr","p-lg-5":"_S73RR","m-lg-6":"_TQDUS","p-lg-6":"_SVpzt","m-lg-7":"_u7-7x","p-lg-7":"_tVwwR","m-lg-8":"_VMheR","p-lg-8":"_dnoel","m-lg-9":"_bs68b","p-lg-9":"_-fPka","m-lg-10":"_JaRq8","p-lg-10":"_222SK","ml-lg-0":"_snW5C","pl-lg-0":"_cbC4p","ml-lg-1":"_ZcZqo","pl-lg-1":"_Ox1R-","ml-lg-2":"_GYhhL","pl-lg-2":"_RQnGa","ml-lg-3":"_PUix3","pl-lg-3":"_TXjNe","ml-lg-4":"_ctO4e","pl-lg-4":"_HGdnK","ml-lg-5":"_0kAql","pl-lg-5":"_j374-","ml-lg-6":"_DTSzU","pl-lg-6":"_f8fRt","ml-lg-7":"_SOGpN","pl-lg-7":"_ftCov","ml-lg-8":"_yyg3O","pl-lg-8":"_es-pp","ml-lg-9":"_ujiYm","pl-lg-9":"_hEH2f","ml-lg-10":"_sOymp","pl-lg-10":"_zABMD","mr-lg-0":"_bZvOK","pr-lg-0":"_1MjdX","mr-lg-1":"_lVGe-","pr-lg-1":"_hJzV5","mr-lg-2":"_9az71","pr-lg-2":"_vBVKt","mr-lg-3":"_SK-xp","pr-lg-3":"_BymTx","mr-lg-4":"_C-P-K","pr-lg-4":"_oDktY","mr-lg-5":"_e8X2c","pr-lg-5":"_XugCG","mr-lg-6":"_CycFS","pr-lg-6":"_aXn7x","mr-lg-7":"_woi9n","pr-lg-7":"_Xz9XT","mr-lg-8":"_p4H3g","pr-lg-8":"_2GHoq","mr-lg-9":"_OZukC","pr-lg-9":"_ckY7k","mr-lg-10":"_tu3W5","pr-lg-10":"_9v3FG","mt-lg-0":"_I-1g6","pt-lg-0":"_cUyFD","mt-lg-1":"_c94QP","pt-lg-1":"_g75ry","mt-lg-2":"_XiT9Y","pt-lg-2":"_OzwIr","mt-lg-3":"_TZnYh","pt-lg-3":"_qC-3V","mt-lg-4":"_ClD8h","pt-lg-4":"_n1T93","mt-lg-5":"_yfqL8","pt-lg-5":"_oRkf6","mt-lg-6":"_6sndc","pt-lg-6":"_zKuFI","mt-lg-7":"_61kz3","pt-lg-7":"_5Q2hr","mt-lg-8":"_s2ReT","pt-lg-8":"_Ap8SS","mt-lg-9":"_bV6Hp","pt-lg-9":"_G5Dl9","mt-lg-10":"_hSJ91","pt-lg-10":"_amgjj","mb-lg-0":"_p-7me","pb-lg-0":"_ys8Fm","mb-lg-1":"_ZFPzR","pb-lg-1":"_Low3Q","mb-lg-2":"_UKfD5","pb-lg-2":"_Z4xYz","mb-lg-3":"_WYCZq","pb-lg-3":"_lOmpq","mb-lg-4":"_3f13Q","pb-lg-4":"_tfvEW","mb-lg-5":"_DxAtv","pb-lg-5":"_lN1KV","mb-lg-6":"_pEAAo","pb-lg-6":"_9pLfP","mb-lg-7":"_lZzWZ","pb-lg-7":"_E76Lg","mb-lg-8":"_Biywb","pb-lg-8":"_PKNGt","mb-lg-9":"_af7LP","pb-lg-9":"_769vF","mb-lg-10":"_p6W2n","pb-lg-10":"_44r6t","mx-lg-0":"_noonL","px-lg-0":"_g6n-m","mx-lg-1":"_V3fJC","px-lg-1":"_h-048","mx-lg-2":"_VBXFM","px-lg-2":"_yXjeI","mx-lg-3":"_anxPB","px-lg-3":"_umXxh","mx-lg-4":"_arYWt","px-lg-4":"_v21qY","mx-lg-5":"_VJrBv","px-lg-5":"_Wg7-s","mx-lg-6":"_qiDC7","px-lg-6":"_1VXpg","mx-lg-7":"_d0c15","px-lg-7":"_sfSeF","mx-lg-8":"_2gYLA","px-lg-8":"_DEL7d","mx-lg-9":"_KmU1j","px-lg-9":"_Qs2ud","mx-lg-10":"_cEBsK","px-lg-10":"_mQH7b","my-lg-0":"_ag2WO","py-lg-0":"_lnVBo","my-lg-1":"_xEHQX","py-lg-1":"_9Tj2M","my-lg-2":"_Iqbzp","py-lg-2":"_8tcVx","my-lg-3":"_caNHW","py-lg-3":"_XJ-2h","my-lg-4":"_6q91a","py-lg-4":"_EwkV-","my-lg-5":"_vAyw8","py-lg-5":"_5fbq2","my-lg-6":"_15LIk","py-lg-6":"_HIyvD","my-lg-7":"_kBk-L","py-lg-7":"_t5Eqq","my-lg-8":"_7QdOv","py-lg-8":"_mWXQT","my-lg-9":"_AgF1j","py-lg-9":"_Hw03a","my-lg-10":"_lgtEt","py-lg-10":"_VLUO-","m-md-0":"_bZzK1","p-md-0":"_hf1u1","m-md-1":"_D90hf","p-md-1":"_T8Wci","m-md-2":"_OV2C9","p-md-2":"_GFg-F","m-md-3":"_tOGww","p-md-3":"_p0NdJ","m-md-4":"_gUtm-","p-md-4":"_92JAP","m-md-5":"_V4DwP","p-md-5":"_KzYIR","m-md-6":"_RYzMI","p-md-6":"_bV-UI","m-md-7":"_bZ8rT","p-md-7":"_sz5lw","m-md-8":"_Tt85A","p-md-8":"_o9XsL","m-md-9":"_5Z2zG","p-md-9":"_QFUvw","m-md-10":"_o-CSv","p-md-10":"_I0UW7","ml-md-0":"_Ec-jt","pl-md-0":"_AsNUW","ml-md-1":"_FkvyK","pl-md-1":"_eWpHd","ml-md-2":"_C-N9j","pl-md-2":"_f4IXC","ml-md-3":"_i4rpE","pl-md-3":"_u1wxV","ml-md-4":"_bfpFB","pl-md-4":"_LFkDV","ml-md-5":"_ChenT","pl-md-5":"_Tseed","ml-md-6":"_5OVzE","pl-md-6":"_kKZuw","ml-md-7":"_HkEvd","pl-md-7":"_-UCQ1","ml-md-8":"_Mil4J","pl-md-8":"_ibj8N","ml-md-9":"_hZgvD","pl-md-9":"_x58o7","ml-md-10":"_aNTRb","pl-md-10":"_B9Ytk","mr-md-0":"_5fzNR","pr-md-0":"_UcmnK","mr-md-1":"_7GSVQ","pr-md-1":"_lKZ6y","mr-md-2":"_Vuc2l","pr-md-2":"_OWoeF","mr-md-3":"_GfGNW","pr-md-3":"_039xq","mr-md-4":"_XUUw7","pr-md-4":"_hNdK8","mr-md-5":"_PchvO","pr-md-5":"_YBTBv","mr-md-6":"_irZPz","pr-md-6":"_xez9v","mr-md-7":"_IWCJD","pr-md-7":"_Nymwz","mr-md-8":"_1ypEg","pr-md-8":"_hJvwk","mr-md-9":"_AisV-","pr-md-9":"_6jqua","mr-md-10":"_LdBUv","pr-md-10":"_Rhahl","mt-md-0":"_iI75A","pt-md-0":"_GCK2h","mt-md-1":"_QoRcE","pt-md-1":"_Q3gZh","mt-md-2":"_rzNrf","pt-md-2":"_mrtOR","mt-md-3":"_-Xx-x","pt-md-3":"_vhZY4","mt-md-4":"_Ie5M9","pt-md-4":"_Bv-Vz","mt-md-5":"_sC4OE","pt-md-5":"_sZzfz","mt-md-6":"_b8qW3","pt-md-6":"_sca5l","mt-md-7":"_Pn6m9","pt-md-7":"_9klOR","mt-md-8":"_oY4i-","pt-md-8":"_QpcKU","mt-md-9":"_-PssV","pt-md-9":"_IBITO","mt-md-10":"_hmDGa","pt-md-10":"_rPOnf","mb-md-0":"_KsSuI","pb-md-0":"_E01ZW","mb-md-1":"_mu8n4","pb-md-1":"_obt8N","mb-md-2":"_4uUmS","pb-md-2":"_eCQut","mb-md-3":"_gckFx","pb-md-3":"_v76WA","mb-md-4":"_HNG1G","pb-md-4":"_WF2cS","mb-md-5":"_y0d7f","pb-md-5":"_Ulg5o","mb-md-6":"_gGNca","pb-md-6":"_L6tTJ","mb-md-7":"_JFKoe","pb-md-7":"_cotbI","mb-md-8":"_zWuLC","pb-md-8":"_PZ98d","mb-md-9":"_0OLPw","pb-md-9":"_diSZ0","mb-md-10":"_tZv9r","pb-md-10":"_8DINx","mx-md-0":"_TlILw","px-md-0":"_nYb1A","mx-md-1":"_8F9Eu","px-md-1":"_zdtgY","mx-md-2":"_Hf2VU","px-md-2":"_R7ntT","mx-md-3":"_7koGZ","px-md-3":"_SjYZ0","mx-md-4":"_mfX1U","px-md-4":"_wpmO4","mx-md-5":"_yWbVN","px-md-5":"_c-PDJ","mx-md-6":"_F98A-","px-md-6":"_k2aB-","mx-md-7":"_PyjZi","px-md-7":"_1p7LO","mx-md-8":"_at5B-","px-md-8":"_Wlop7","mx-md-9":"_MP-IT","px-md-9":"_ZEJLn","mx-md-10":"_t-qxH","px-md-10":"_m2jcH","my-md-0":"_mamXD","py-md-0":"_XfnLL","my-md-1":"_wltQA","py-md-1":"_kMSov","my-md-2":"_PB9Lu","py-md-2":"_ZHQxJ","my-md-3":"_ROfrO","py-md-3":"_5pjW-","my-md-4":"_asOWk","py-md-4":"_521lJ","my-md-5":"_sfKXT","py-md-5":"_0hhLg","my-md-6":"_vBIkT","py-md-6":"_mh-mU","my-md-7":"_SbaIW","py-md-7":"_4U--m","my-md-8":"_8Ml4g","py-md-8":"_8CAbC","my-md-9":"_2W5Vi","py-md-9":"_ifVgs","my-md-10":"_jOwwL","py-md-10":"_xGEHg","m-xl-0":"_Cmi8h","p-xl-0":"_YOJnv","m-xl-1":"_IlYRc","p-xl-1":"_qg39r","m-xl-2":"_NZu1F","p-xl-2":"_ChCeZ","m-xl-3":"_wCJFO","p-xl-3":"_s5DXB","m-xl-4":"_-ooyS","p-xl-4":"_1rcFF","m-xl-5":"_2--cB","p-xl-5":"_0s8cD","m-xl-6":"_zMbs-","p-xl-6":"_qAR79","m-xl-7":"_sRWyz","p-xl-7":"_ykFCJ","m-xl-8":"_dj226","p-xl-8":"_XLB7-","m-xl-9":"_eM-R4","p-xl-9":"_QuQVl","m-xl-10":"_UUuwy","p-xl-10":"_nDqX9","ml-xl-0":"_LL8WU","pl-xl-0":"_AIPph","ml-xl-1":"_pKFo-","pl-xl-1":"_tQEXN","ml-xl-2":"_F-wn7","pl-xl-2":"_wcxv3","ml-xl-3":"_M94zg","pl-xl-3":"_I3KoK","ml-xl-4":"_0PzeG","pl-xl-4":"_lzci3","ml-xl-5":"_XRI4C","pl-xl-5":"_XlhyA","ml-xl-6":"_GjzL0","pl-xl-6":"_ASrOm","ml-xl-7":"_-0WjA","pl-xl-7":"_hx5P8","ml-xl-8":"_XlbUH","pl-xl-8":"_Vonli","ml-xl-9":"_LwuSL","pl-xl-9":"_MxuFJ","ml-xl-10":"_v7xZI","pl-xl-10":"_Tvo-Z","mr-xl-0":"_SzVWx","pr-xl-0":"_K1dhq","mr-xl-1":"_JOZtq","pr-xl-1":"_c1i37","mr-xl-2":"_R3B8Q","pr-xl-2":"_63cME","mr-xl-3":"_91LCJ","pr-xl-3":"_WxNaS","mr-xl-4":"_BauAg","pr-xl-4":"_V6rST","mr-xl-5":"_H0Uy4","pr-xl-5":"_idyBA","mr-xl-6":"_lIBS-","pr-xl-6":"_hm7f2","mr-xl-7":"_DcV1a","pr-xl-7":"_L9DAM","mr-xl-8":"_M62Cx","pr-xl-8":"_nso5O","mr-xl-9":"_M-vkg","pr-xl-9":"_Jm-de","mr-xl-10":"_V5v9Y","pr-xl-10":"_jt-a5","mt-xl-0":"_YPHmA","pt-xl-0":"_XVXEh","mt-xl-1":"_pJbYc","pt-xl-1":"_i-ZXc","mt-xl-2":"_SHsME","pt-xl-2":"_ak-Hh","mt-xl-3":"_wzbs7","pt-xl-3":"_py3lR","mt-xl-4":"_HBXKA","pt-xl-4":"_GQBlv","mt-xl-5":"_5d6Ee","pt-xl-5":"_KFPkO","mt-xl-6":"_Yf-yF","pt-xl-6":"_1e6oC","mt-xl-7":"_kg9lU","pt-xl-7":"_SHs7f","mt-xl-8":"_KXugL","pt-xl-8":"_VyRfA","mt-xl-9":"_EOyB7","pt-xl-9":"_5KMcS","mt-xl-10":"_8W-Zj","pt-xl-10":"_cz8iz","mb-xl-0":"_rWALs","pb-xl-0":"_LpkfT","mb-xl-1":"_RzmHQ","pb-xl-1":"_6ad54","mb-xl-2":"_Ajc4e","pb-xl-2":"_SbX8t","mb-xl-3":"_vSzzB","pb-xl-3":"_yidEJ","mb-xl-4":"_mrCP3","pb-xl-4":"_3TrW-","mb-xl-5":"_6j8-6","pb-xl-5":"_D1WrN","mb-xl-6":"_XDRU9","pb-xl-6":"_dcA8T","mb-xl-7":"_-i7kC","pb-xl-7":"_81QE4","mb-xl-8":"_X9-zp","pb-xl-8":"_HTClM","mb-xl-9":"_klb-D","pb-xl-9":"_RReN9","mb-xl-10":"_vPsb7","pb-xl-10":"_OVfeI","mx-xl-0":"_YNCB1","px-xl-0":"_hiVA4","mx-xl-1":"_k6kz-","px-xl-1":"_rONSC","mx-xl-2":"_pBneY","px-xl-2":"_po-3F","mx-xl-3":"_Bpbr7","px-xl-3":"_KdGyy","mx-xl-4":"_brh6E","px-xl-4":"_qqxT0","mx-xl-5":"_BfzzU","px-xl-5":"_R-Rw5","mx-xl-6":"_sSR5n","px-xl-6":"_thByS","mx-xl-7":"_r5nPW","px-xl-7":"_Qn6um","mx-xl-8":"_J9EDO","px-xl-8":"_9rkVI","mx-xl-9":"_Mltks","px-xl-9":"_g-Ham","mx-xl-10":"_sbya6","px-xl-10":"_8-jLj","my-xl-0":"_5yWBG","py-xl-0":"_xbHHG","my-xl-1":"_PlYBL","py-xl-1":"_F3Fon","my-xl-2":"_tsmUe","py-xl-2":"_a-0sQ","my-xl-3":"_sY3wJ","py-xl-3":"_iMcG-","my-xl-4":"_oHAzn","py-xl-4":"_SVfuw","my-xl-5":"_PvaIf","py-xl-5":"_J1xNt","my-xl-6":"_opQCd","py-xl-6":"_BykWn","my-xl-7":"_wYtgV","py-xl-7":"_rWN6g","my-xl-8":"_QHTpr","py-xl-8":"_6lwHD","my-xl-9":"_sKUSa","py-xl-9":"_HEg44","my-xl-10":"_mR1Ig","py-xl-10":"_-KK9e","background-shine":"_GS93D","path":"_Yio2J","line":"_hUBrW","skeleton":"_jhzCK","skeleton-animate":"_E3Vdv","skeleton-dark":"_wQ36Y","skeleton-dark-animate":"_j-rmG","skeleton-transparent":"_trTiX","skeleton-transparent-animate":"_4QQUW","semi-transparent":"_jW9cZ","disable":"_07-2N","full-width-on-tablets":"_at3Is","full-width-on-mobiles":"_7mVhH","xl":"_YBEjy","lg":"_4T1JY","md":"_y81Q7","sm":"_HlFvs","small-padding-on-small-mobiles":"_pC5i6","primary":"_rf33o","primary-bordered":"_bpdoC","primary-transparent":"_FNwOe","transparent":"_9LspZ","transparent-bordered":"_HgM7r","transparent-without-shadow":"_tkp-m","white":"_bv597","white-flat":"_IhewT","button-primary-dots-wrapper":"_OEKG8","show":"_MQYPo","button-success-icon":"_Y24W2","button-text":"_o-rLq","hide":"_4GC9-","button-with-icon":"_m1W6m","button-with-icon-text":"_75-fw","big-icon":"_gHcQi"};
|
|
1158
|
+
|
|
1159
|
+
var styles = {"container":"_a5RSj","m-0":"_wcoyj","p-0":"_Rd5sE","m-1":"_vAsxv","p-1":"_KZ14Z","m-2":"_Bvk20","p-2":"_Z7fhL","m-3":"_ZqDCi","p-3":"_CiGc9","m-4":"_8JK-L","p-4":"_FadoA","m-5":"_baCle","p-5":"_cvJqX","m-6":"_P3lUT","p-6":"_ZmGGH","m-7":"_5Tnff","p-7":"_-t7z9","m-8":"_1JxUQ","p-8":"_EATOh","m-9":"_pJGV0","p-9":"_B762d","m-10":"_Z3rGU","p-10":"_0ULM0","ml-0":"_ZSfG7","pl-0":"_hjKq0","ml-1":"_srwbU","pl-1":"_oz-sG","ml-2":"_RnILi","pl-2":"_-nAjZ","ml-3":"_lges5","pl-3":"_AwVsn","ml-4":"_p4arL","pl-4":"_upAfC","ml-5":"_-iEnG","pl-5":"_bqApa","ml-6":"_uF0xd","pl-6":"_WUUFo","ml-7":"_eXFZs","pl-7":"_ZforM","ml-8":"_2AA5o","pl-8":"_u6bF0","ml-9":"_19IxL","pl-9":"_vmLg6","ml-10":"_eyqFK","pl-10":"_mr36J","mr-0":"_6RpFz","pr-0":"_fgnzi","mr-1":"_fBjrA","pr-1":"_QrC2Y","mr-2":"_0Y6RC","pr-2":"_5kZkr","mr-3":"_iaZj-","pr-3":"_A-IQ7","mr-4":"_zBHHn","pr-4":"_pHQ4t","mr-5":"_1JTCi","pr-5":"_ODvHf","mr-6":"_n6Enr","pr-6":"_XNdBl","mr-7":"_YfaVy","pr-7":"_ZfZDh","mr-8":"_le3sp","pr-8":"_K1rvN","mr-9":"_mL6UV","pr-9":"_76mZn","mr-10":"_fo-sf","pr-10":"_xvsK1","mt-0":"_1uBdK","pt-0":"_30qg7","mt-1":"_NKlWd","pt-1":"_3yj99","mt-2":"_lLyiG","pt-2":"_GsXqc","mt-3":"_zC55o","pt-3":"_3OZTc","mt-4":"_v1VXO","pt-4":"_sFrdR","mt-5":"_qbBFx","pt-5":"_DQrF8","mt-6":"_dJG8P","pt-6":"_Zxte7","mt-7":"_sUtkp","pt-7":"_9B1r5","mt-8":"_Qrnld","pt-8":"_7xBV7","mt-9":"_OPKw2","pt-9":"_cXhnD","mt-10":"_m5k36","pt-10":"_b9nMR","mb-0":"_7AyaR","pb-0":"_u0vFs","mb-1":"_ivpnr","pb-1":"_1dkPf","mb-2":"_D8KfL","pb-2":"_wzuIB","mb-3":"_zwh5E","pb-3":"_rT8wS","mb-4":"_wpLh9","pb-4":"_AGvn8","mb-5":"_-phDB","pb-5":"_r4HWg","mb-6":"_RZI7I","pb-6":"_-t4Gs","mb-7":"_Vw-z1","pb-7":"_qwD1B","mb-8":"_f3nKh","pb-8":"_Sk1Fn","mb-9":"_2MDAw","pb-9":"_jZbwv","mb-10":"_gRDI3","pb-10":"_W7OVZ","mx-0":"_I6mmv","px-0":"_BVRG5","mx-1":"_b7fTJ","px-1":"_bZf6u","mx-2":"_FoGd8","px-2":"_-vX3t","mx-3":"_0H3Cj","loading-dots":"_pnWN9","big":"_k0j0g","dot":"_9LXS6","px-3":"_ggifM","mx-4":"_leP-v","px-4":"_7Kcun","mx-5":"_sBxud","px-5":"_oJO7X","mx-6":"_F-Una","px-6":"_Bl-A8","mx-7":"_NVWrT","px-7":"_Bn6vR","mx-8":"_OK9GD","px-8":"_iv1v2","mx-9":"_WVtLI","px-9":"_ntW3v","mx-10":"_21M1-","px-10":"_BjXo-","my-0":"_3v8p4","py-0":"_EBmV-","my-1":"_DcOh5","py-1":"_udCfN","my-2":"_Lk0RK","py-2":"_wIENK","my-3":"_nsOf5","py-3":"_No-oK","my-4":"_L1ycy","py-4":"_42DgQ","my-5":"_3bZSh","py-5":"_XjTMT","my-6":"_Ty-GG","py-6":"_7Dr5E","my-7":"_PILBF","py-7":"_vyvsk","my-8":"_AkmkO","py-8":"_X0xg-","my-9":"_VSxcf","py-9":"_Hq-yp","my-10":"_FxwFR","py-10":"_BnN2G","m-sm-0":"_EZHgz","p-sm-0":"_oKPqX","m-sm-1":"_gdysh","p-sm-1":"_-7KK8","m-sm-2":"_BLBqZ","p-sm-2":"_IgrmD","m-sm-3":"_zbrA7","p-sm-3":"_eimPJ","m-sm-4":"_7RaaP","p-sm-4":"_0-Cvi","m-sm-5":"_PhCOs","p-sm-5":"_CIKFA","m-sm-6":"_8WC3P","p-sm-6":"_2FqT5","m-sm-7":"_D7sDK","p-sm-7":"_L3EpN","m-sm-8":"_mG6-A","p-sm-8":"_D2Gx9","m-sm-9":"_2tGFi","p-sm-9":"_8n6VA","m-sm-10":"_G-MMA","p-sm-10":"_pgJzb","ml-sm-0":"_BF125","pl-sm-0":"_81k6q","ml-sm-1":"_JSywC","pl-sm-1":"_1eoeN","ml-sm-2":"_q5cSf","pl-sm-2":"_A6Li5","ml-sm-3":"_-7C1-","pl-sm-3":"_lBIcx","ml-sm-4":"_bvj1N","pl-sm-4":"_SQmLb","ml-sm-5":"_pwy33","pl-sm-5":"_iuqDu","ml-sm-6":"_CNiYb","pl-sm-6":"_tQ2J-","ml-sm-7":"_Zuec-","pl-sm-7":"_iJF5q","ml-sm-8":"_lP-ls","pl-sm-8":"_1xIwn","ml-sm-9":"_Jld-6","pl-sm-9":"_pfOVT","ml-sm-10":"_TGfAU","pl-sm-10":"_MYgNP","mr-sm-0":"_CEiPO","pr-sm-0":"_rZ5kD","mr-sm-1":"_-bdjz","pr-sm-1":"_nRBRL","mr-sm-2":"_17O3E","pr-sm-2":"_uBaUj","mr-sm-3":"_5oO1d","pr-sm-3":"_jQWXm","mr-sm-4":"_peO4Y","pr-sm-4":"_P2f3n","mr-sm-5":"_AUc3q","pr-sm-5":"_7TR99","mr-sm-6":"_e3d5h","pr-sm-6":"_QqPl1","mr-sm-7":"_Yc1cR","pr-sm-7":"_5fd5H","mr-sm-8":"_z4g3-","pr-sm-8":"_gY3T9","mr-sm-9":"_P9chP","pr-sm-9":"_G4k6A","mr-sm-10":"_QWMD2","pr-sm-10":"_2POWv","mt-sm-0":"_xYS0m","pt-sm-0":"_gYD3b","mt-sm-1":"_08rCY","pt-sm-1":"_UsP-z","mt-sm-2":"_HWQec","pt-sm-2":"_cjIgZ","mt-sm-3":"_gZV20","pt-sm-3":"_zJZJm","mt-sm-4":"_4FE5W","pt-sm-4":"_VpJhv","mt-sm-5":"_eu88H","pt-sm-5":"_V7qwC","mt-sm-6":"_09LyL","pt-sm-6":"_n8bba","mt-sm-7":"_q-ASs","pt-sm-7":"_3b9S8","mt-sm-8":"_iTxDv","pt-sm-8":"_--Hdk","mt-sm-9":"_OaVE-","pt-sm-9":"_cd-UP","mt-sm-10":"_ZIr-H","pt-sm-10":"_6jYkb","mb-sm-0":"_YgN23","pb-sm-0":"_F8F6A","mb-sm-1":"_4QH8u","pb-sm-1":"_A2I8v","mb-sm-2":"_jrZxh","pb-sm-2":"_2VL1m","mb-sm-3":"_IB8uX","pb-sm-3":"_meger","mb-sm-4":"_-gCVy","pb-sm-4":"_R-qMm","mb-sm-5":"_YwvXh","pb-sm-5":"_pyu5v","mb-sm-6":"_qwhTX","pb-sm-6":"_l61nc","mb-sm-7":"_0KfeR","pb-sm-7":"_YXuNM","mb-sm-8":"_75fJr","pb-sm-8":"_jp-Qe","mb-sm-9":"_V0wM-","pb-sm-9":"_vMKpc","mb-sm-10":"_sxEY8","pb-sm-10":"_k2mOD","mx-sm-0":"_qPF9i","px-sm-0":"_cl18e","mx-sm-1":"_LvMUO","px-sm-1":"_RcIbD","mx-sm-2":"_xLMK5","px-sm-2":"_GCL1S","mx-sm-3":"_t0q4o","px-sm-3":"_cuiW8","mx-sm-4":"_pHjdd","px-sm-4":"_LDu1N","mx-sm-5":"_cYpLd","px-sm-5":"_24Yji","mx-sm-6":"_pXCM6","px-sm-6":"_uoSDI","mx-sm-7":"_qbXoQ","px-sm-7":"_0RlFx","mx-sm-8":"_3f-s3","px-sm-8":"_xAS-y","mx-sm-9":"_vx3dZ","px-sm-9":"_ndXm6","mx-sm-10":"_6lFsZ","px-sm-10":"_EZ6Qr","my-sm-0":"_0t-Cg","py-sm-0":"_N3sbI","my-sm-1":"_jdmVi","py-sm-1":"_GlMKb","my-sm-2":"_yFRs8","py-sm-2":"_LNRZQ","my-sm-3":"_qSuwF","py-sm-3":"_ON3vd","my-sm-4":"_1h6pX","py-sm-4":"_TZg0h","my-sm-5":"_vT295","py-sm-5":"_J1zu8","my-sm-6":"_7LuwF","py-sm-6":"_qbbdP","my-sm-7":"_9vKuY","py-sm-7":"_C9gzg","my-sm-8":"_Nx1-S","py-sm-8":"_8lmEZ","my-sm-9":"_LxGxx","py-sm-9":"_3y4jy","my-sm-10":"_61y0C","py-sm-10":"_fxmBa","m-lg-0":"_PJydR","p-lg-0":"_3o1cd","m-lg-1":"_MAdi8","p-lg-1":"_JDc1V","m-lg-2":"_pEH2Q","p-lg-2":"_Ic9tL","m-lg-3":"_P6cGt","p-lg-3":"_nzx-g","m-lg-4":"_9bH-j","p-lg-4":"_KdZTF","m-lg-5":"_hxjaE","p-lg-5":"_LDamm","m-lg-6":"_xXtVI","p-lg-6":"_ZWhTL","m-lg-7":"_mPnVe","p-lg-7":"_lJnBT","m-lg-8":"_J-MQA","p-lg-8":"_MGs60","m-lg-9":"_ixlkP","p-lg-9":"_Lru1O","m-lg-10":"_eH6ht","p-lg-10":"_ugZzQ","ml-lg-0":"_6z3OE","pl-lg-0":"_PDwaH","ml-lg-1":"_GMcN9","pl-lg-1":"_NoDTB","ml-lg-2":"_PQ5AQ","pl-lg-2":"_8-Pu6","ml-lg-3":"_PktVo","pl-lg-3":"_JTpEZ","ml-lg-4":"_zIcyb","pl-lg-4":"_e4YYS","ml-lg-5":"_HrlcA","pl-lg-5":"_cwG3s","ml-lg-6":"_Xf7Wv","pl-lg-6":"_XYe-E","ml-lg-7":"_vnGAT","pl-lg-7":"_NnScU","ml-lg-8":"_9z7Tj","pl-lg-8":"_DDEn1","ml-lg-9":"_sxSQp","pl-lg-9":"_-r39c","ml-lg-10":"_kppNg","pl-lg-10":"_1mgTz","mr-lg-0":"_WtS6h","pr-lg-0":"_NKNU9","mr-lg-1":"_kxaOQ","pr-lg-1":"_8OvSK","mr-lg-2":"_bTQt8","pr-lg-2":"_yQerd","mr-lg-3":"_f7H9P","pr-lg-3":"_Kwfoa","mr-lg-4":"_lkF5d","pr-lg-4":"_b7tIe","mr-lg-5":"_H4e5a","pr-lg-5":"_pxwBt","mr-lg-6":"_I81Hq","pr-lg-6":"_1Xwlf","mr-lg-7":"_gtO-Y","pr-lg-7":"_vjm3Z","mr-lg-8":"_ZfEr1","pr-lg-8":"_je0MD","mr-lg-9":"_h43Co","pr-lg-9":"_Lnbh5","mr-lg-10":"_HoaFo","pr-lg-10":"_3puFA","mt-lg-0":"_a7pDC","pt-lg-0":"_-URo7","mt-lg-1":"_Ot-U1","pt-lg-1":"_rMvMf","mt-lg-2":"_95ooz","pt-lg-2":"_vkEgW","mt-lg-3":"_9XqX5","pt-lg-3":"_b-oGK","mt-lg-4":"_eYL6E","pt-lg-4":"_zgUGu","mt-lg-5":"_BqCaM","pt-lg-5":"_Y9PL4","mt-lg-6":"_0aOPb","pt-lg-6":"_nvMum","mt-lg-7":"_-pNQS","pt-lg-7":"_funa7","mt-lg-8":"_sDweY","pt-lg-8":"_S1hmu","mt-lg-9":"_Y4BpR","pt-lg-9":"_J3203","mt-lg-10":"_Jm-dV","pt-lg-10":"_0WSnk","mb-lg-0":"_4uWrE","pb-lg-0":"_qy0mb","mb-lg-1":"_jUNMm","pb-lg-1":"_pUTOt","mb-lg-2":"_aGqhb","pb-lg-2":"_xAKUw","mb-lg-3":"_kado5","pb-lg-3":"_htLgL","mb-lg-4":"_mWWU1","pb-lg-4":"_gqGWe","mb-lg-5":"_ceycQ","pb-lg-5":"_RzNIh","mb-lg-6":"_VLMG4","pb-lg-6":"_-8-Aj","mb-lg-7":"_HBnRW","pb-lg-7":"_ZsIEk","mb-lg-8":"_bj2r5","pb-lg-8":"_cBnkL","mb-lg-9":"_w3001","pb-lg-9":"_Kua-7","mb-lg-10":"_wZKsF","pb-lg-10":"_GX-Wb","mx-lg-0":"_-G50w","px-lg-0":"_OTPQl","mx-lg-1":"_JJ9DD","px-lg-1":"_jedSl","mx-lg-2":"_n9zl3","px-lg-2":"_Cg-Eq","mx-lg-3":"_6ZhL3","px-lg-3":"_0oPYT","mx-lg-4":"_H9sE1","px-lg-4":"_aV3U2","mx-lg-5":"_Y2BNn","px-lg-5":"_EzRHI","mx-lg-6":"_fp9jU","px-lg-6":"_wghWL","mx-lg-7":"_zB5Qv","px-lg-7":"_gclTH","mx-lg-8":"_Qxq2x","px-lg-8":"_M7akr","mx-lg-9":"_Vfhs-","px-lg-9":"_Rv7m-","mx-lg-10":"_lni3U","px-lg-10":"_gdVVu","my-lg-0":"_rMuza","py-lg-0":"_MZopi","my-lg-1":"_Thq10","py-lg-1":"_BXQnr","my-lg-2":"_lHRe-","py-lg-2":"_6MiWj","my-lg-3":"_-vobr","py-lg-3":"_xtsGY","my-lg-4":"_m2hen","py-lg-4":"_-069Y","my-lg-5":"_nTHzp","py-lg-5":"_r4pes","my-lg-6":"_LTkTV","py-lg-6":"_13TOF","my-lg-7":"_Em859","py-lg-7":"_mJzVF","my-lg-8":"_T8EVh","py-lg-8":"_h2ol5","my-lg-9":"_T-LZJ","py-lg-9":"_QIrnZ","my-lg-10":"_EY0q7","py-lg-10":"_hvU2E","m-md-0":"_u8Not","p-md-0":"_PVgyV","m-md-1":"_y-q4l","p-md-1":"_7X2x6","m-md-2":"_r3IGF","p-md-2":"_abaFH","m-md-3":"_rH0Ca","p-md-3":"_m-V0R","m-md-4":"_NQj-k","p-md-4":"_xjGzA","m-md-5":"_41oza","p-md-5":"_cgf0Z","m-md-6":"_lelHI","p-md-6":"_2C8Oa","m-md-7":"_w1Eil","p-md-7":"_EtEzw","m-md-8":"_Q8a3D","p-md-8":"_5nsxA","m-md-9":"_LzOqJ","p-md-9":"_7LEzr","m-md-10":"_CRNVR","p-md-10":"_ClNNV","ml-md-0":"_3abXz","pl-md-0":"_7BRiC","ml-md-1":"_Jbe0V","pl-md-1":"_Ok-KV","ml-md-2":"_5SO4-","pl-md-2":"_IvJ88","ml-md-3":"_NWLcP","pl-md-3":"_XASwl","ml-md-4":"_La-jA","pl-md-4":"_M8vz7","ml-md-5":"_4UZJ3","pl-md-5":"_ikRMN","ml-md-6":"_GpxKA","pl-md-6":"_-vp4I","ml-md-7":"_qZisY","pl-md-7":"_UspU5","ml-md-8":"_xTqIg","pl-md-8":"_8LLNG","ml-md-9":"_u3Wi6","pl-md-9":"_yukVA","ml-md-10":"_BJ3Kb","pl-md-10":"_Ncx33","mr-md-0":"_-dCKD","pr-md-0":"_p4Xdb","mr-md-1":"_DZXj3","pr-md-1":"_YZLPN","mr-md-2":"_IEATr","pr-md-2":"_OGWz-","mr-md-3":"_UxMFq","pr-md-3":"_qMmI8","mr-md-4":"_KEt4t","pr-md-4":"_nLevO","mr-md-5":"_AMVPM","pr-md-5":"_3m10o","mr-md-6":"_fzrrj","pr-md-6":"_Wbjjj","mr-md-7":"_mZWrU","pr-md-7":"_mqIEB","mr-md-8":"_5p3E5","pr-md-8":"_NyrXd","mr-md-9":"_gez8y","pr-md-9":"_qLaJ8","mr-md-10":"_TR-zd","pr-md-10":"_SqjX-","mt-md-0":"_Okpug","pt-md-0":"_xIGF1","mt-md-1":"_kkttT","pt-md-1":"_6Fntk","mt-md-2":"_jjt3V","pt-md-2":"_MBCLj","mt-md-3":"_AcRpn","pt-md-3":"_9e4N3","mt-md-4":"_TEYLB","pt-md-4":"_G-b2b","mt-md-5":"_ADYmJ","pt-md-5":"_-PW2W","mt-md-6":"_IiBSh","pt-md-6":"_oOMKv","mt-md-7":"_LzMKR","pt-md-7":"_P93Fk","mt-md-8":"_ZPChR","pt-md-8":"_IjZLd","mt-md-9":"_OYWyj","pt-md-9":"_6VDq-","mt-md-10":"_NFUMl","pt-md-10":"_9N5Rs","mb-md-0":"_KNEZM","pb-md-0":"_dlRtG","mb-md-1":"_2TJCJ","pb-md-1":"_FYJz-","mb-md-2":"_p5q4o","pb-md-2":"_W20R5","mb-md-3":"_QMtNI","pb-md-3":"_X4ghG","mb-md-4":"_ROsHu","pb-md-4":"_LLz3c","mb-md-5":"_FKlov","pb-md-5":"_qQje5","mb-md-6":"_zHdHt","pb-md-6":"_7vH68","mb-md-7":"_5-25V","pb-md-7":"_a5Jzs","mb-md-8":"_9NPzr","pb-md-8":"_NpZZI","mb-md-9":"_F5182","pb-md-9":"_2SM3y","mb-md-10":"_R3bvz","pb-md-10":"_Sop9H","mx-md-0":"_OUA4d","px-md-0":"_s-0Qy","mx-md-1":"_cBeVb","px-md-1":"_34ZBT","mx-md-2":"_-dnuU","px-md-2":"_0-UrT","mx-md-3":"_CewFh","px-md-3":"_ZrFGb","mx-md-4":"_5Cvub","px-md-4":"_9CpfN","mx-md-5":"_O1iRv","px-md-5":"_dnUx0","mx-md-6":"_QmgAB","px-md-6":"_vP8Uq","mx-md-7":"_PcZ9w","px-md-7":"_5l4s3","mx-md-8":"_isOXv","px-md-8":"_cvHBA","mx-md-9":"_LIRJ0","px-md-9":"_09Gju","mx-md-10":"_b-TCB","px-md-10":"_5UoX8","my-md-0":"_wrYvU","py-md-0":"_Fwd2A","my-md-1":"_vBwvs","py-md-1":"_vl1f-","my-md-2":"_7g5va","py-md-2":"_D0JS-","my-md-3":"_8DN0N","py-md-3":"_qvNWl","my-md-4":"_o5Mnp","py-md-4":"_rFfbU","my-md-5":"_7XZDH","py-md-5":"_1B0Rr","my-md-6":"_s09ut","py-md-6":"_jnQRw","my-md-7":"_PgL1b","py-md-7":"_T4779","my-md-8":"_R0d0D","py-md-8":"_Fkri-","my-md-9":"_FM-XK","py-md-9":"_H-snR","my-md-10":"_Z49JP","py-md-10":"_01G-F","m-xl-0":"_H4Jyh","p-xl-0":"_WMtq9","m-xl-1":"_FeJPz","p-xl-1":"_00t3r","m-xl-2":"_svLno","p-xl-2":"_2C22I","m-xl-3":"_T5qYA","p-xl-3":"_dcbn0","m-xl-4":"_Xl89-","p-xl-4":"_Ctf-y","m-xl-5":"_ZWihS","p-xl-5":"_Lzig2","m-xl-6":"_jljvY","p-xl-6":"_X1owU","m-xl-7":"_l1myf","p-xl-7":"_T1fTP","m-xl-8":"_FWU16","p-xl-8":"_R2T50","m-xl-9":"_2TtzQ","p-xl-9":"_-142y","m-xl-10":"_975wG","p-xl-10":"_DPori","ml-xl-0":"_9Zc9q","pl-xl-0":"_On2x0","ml-xl-1":"_IryvS","pl-xl-1":"_J2DXA","ml-xl-2":"_S7cyp","pl-xl-2":"_YxNk9","ml-xl-3":"_6eyqg","pl-xl-3":"_cwyGU","ml-xl-4":"_TbIDB","pl-xl-4":"_JKpl8","ml-xl-5":"_P17BD","pl-xl-5":"_w8ccI","ml-xl-6":"_fUJPM","pl-xl-6":"_mgqKZ","ml-xl-7":"_p-Fn9","pl-xl-7":"_eMF8n","ml-xl-8":"_VO2-y","pl-xl-8":"_O9n-E","ml-xl-9":"_wqX4W","pl-xl-9":"_wDG35","ml-xl-10":"_-TNE-","pl-xl-10":"_jyfgf","mr-xl-0":"_9aQeC","pr-xl-0":"_zWCV0","mr-xl-1":"_vL8LJ","pr-xl-1":"_yA6nk","mr-xl-2":"_ZkYxH","pr-xl-2":"_-LN7c","mr-xl-3":"_WtPxc","pr-xl-3":"_Yn0F0","mr-xl-4":"_M1pzN","pr-xl-4":"_zX1qM","mr-xl-5":"_HWX7s","pr-xl-5":"_0jJWY","mr-xl-6":"_cG-JL","pr-xl-6":"_o2-cg","mr-xl-7":"_g0V5o","pr-xl-7":"_seBWS","mr-xl-8":"_1Rg0L","pr-xl-8":"_uZxYI","mr-xl-9":"_DJD2r","pr-xl-9":"_WXY42","mr-xl-10":"_-EWpt","pr-xl-10":"_W-0Oq","mt-xl-0":"_A3mxM","pt-xl-0":"_mG8-q","mt-xl-1":"_eSV7Q","pt-xl-1":"_9SJkd","mt-xl-2":"_mdspA","pt-xl-2":"_GloWk","mt-xl-3":"_Fn9WR","pt-xl-3":"_l5z5Q","mt-xl-4":"_J5EuO","pt-xl-4":"_z4jGH","mt-xl-5":"_SjIc3","pt-xl-5":"_inlrN","mt-xl-6":"_9iy8O","pt-xl-6":"_FGdNq","mt-xl-7":"_DNLb-","pt-xl-7":"_FDvwW","mt-xl-8":"_cB8Ua","pt-xl-8":"_sFRzN","mt-xl-9":"_iFCES","pt-xl-9":"_M8U3T","mt-xl-10":"_zrBn9","pt-xl-10":"_kYhdD","mb-xl-0":"_AVjLW","pb-xl-0":"_S2OiP","mb-xl-1":"_vnN5p","pb-xl-1":"_ukgJ7","mb-xl-2":"_wZjwy","pb-xl-2":"_rINJ4","mb-xl-3":"_MFAs1","pb-xl-3":"_BjtEQ","mb-xl-4":"_72dvy","pb-xl-4":"_bCnbX","mb-xl-5":"_Uyt6r","pb-xl-5":"_F3Ibd","mb-xl-6":"_iBLUD","pb-xl-6":"_yjY5Y","mb-xl-7":"_6TfYx","pb-xl-7":"_QdVWm","mb-xl-8":"_p-cIL","pb-xl-8":"_saIeH","mb-xl-9":"_Z3PUh","pb-xl-9":"_f8cy7","mb-xl-10":"_ndw2F","pb-xl-10":"_Yxkus","mx-xl-0":"_Bb6PX","px-xl-0":"_M5EOJ","mx-xl-1":"_iWwKY","px-xl-1":"_nWXZF","mx-xl-2":"_OCB5d","px-xl-2":"_GIqDO","mx-xl-3":"_mskG2","px-xl-3":"_-TVSP","mx-xl-4":"_rp-dc","px-xl-4":"_rfQsy","mx-xl-5":"_FgYNJ","px-xl-5":"_yA-K0","mx-xl-6":"_KJ12G","px-xl-6":"_gmhRk","mx-xl-7":"_XF8NS","px-xl-7":"_C0zhm","mx-xl-8":"_rOBd5","px-xl-8":"_FZf4w","mx-xl-9":"_GosX1","px-xl-9":"_zvpad","mx-xl-10":"_uU6kY","px-xl-10":"_XfRJ5","my-xl-0":"_zhez-","py-xl-0":"_-Dum7","my-xl-1":"_QvfIQ","py-xl-1":"_66V5-","my-xl-2":"_e84Sk","py-xl-2":"_pOej1","my-xl-3":"_uv8an","py-xl-3":"_6iY-g","my-xl-4":"_Ur6W4","py-xl-4":"_JPq7T","my-xl-5":"_3GKlh","py-xl-5":"_Gcnsl","my-xl-6":"_JrBH1","py-xl-6":"_IP0ND","my-xl-7":"_7BzpU","py-xl-7":"_BIUqI","my-xl-8":"_mZ-p0","py-xl-8":"_Sdn5j","my-xl-9":"_P3V1N","py-xl-9":"_Z9lbF","my-xl-10":"_VAfcF","py-xl-10":"_X4Bq6","background-shine":"_361tW","path":"_qtb88","line":"_XQ9Yw","skeleton":"_BQ0X7","skeleton-animate":"_vEv3B","skeleton-dark":"_l5qsf","skeleton-dark-animate":"_yk159","skeleton-transparent":"_857E4","skeleton-transparent-animate":"_RzhIE","semi-transparent":"_LacS6","no-margins":"_bmB3S","dots":"_5kMd-","colored":"_-lTGD","small":"_GTU1q","extra-small":"_BEmi7","align-left":"_HuG6N","align-right":"_U3h5U"};
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* LoadingDots Component - Displays a loading animation with dots.
|
|
1163
|
+
* This component allows customization of size, color, margins, and alignment.
|
|
1164
|
+
*
|
|
1165
|
+
* @component
|
|
1166
|
+
* @param {Object} props - The props of the component.
|
|
1167
|
+
* @param {('big'|'small'|'extra-small')} [props.size='small'] - Sets the size of the loading dots.
|
|
1168
|
+
* @param {boolean} [props.isColored=false] - If true, the dots will be colored, otherwise they will be monochrome.
|
|
1169
|
+
* @param {boolean} [props.noMargins=false] - If true, removes the margins around the loading dots.
|
|
1170
|
+
* @param {(boolean|'left'|'right')} [props.align=false] - Aligns the loading dots to the left or right if specified, otherwise centered.
|
|
1171
|
+
* @returns {React.ReactElement} A React component that renders the loading dots animation.
|
|
1172
|
+
*/
|
|
1173
|
+
const LoadingDots = ({
|
|
1174
|
+
size: _size = "small",
|
|
1175
|
+
isColored: _isColored = false,
|
|
1176
|
+
noMargins: _noMargins = false,
|
|
1177
|
+
align: _align = false
|
|
1178
|
+
}) => {
|
|
1179
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1180
|
+
className: `${styles["loading-dots"]} ${styles[_size]} ${_noMargins ? ` ${styles["no-margins"]}` : ""} ${_align ? styles["align-" + _align] : ""}`
|
|
1181
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1182
|
+
className: `${styles.dot} ${_isColored ? ` ${styles.colored}` : ""}`
|
|
1183
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1184
|
+
className: `${styles.dot} ${_isColored ? ` ${styles.colored}` : ""}`
|
|
1185
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1186
|
+
className: `${styles.dot} ${_isColored ? ` ${styles.colored}` : ""}`
|
|
1187
|
+
}));
|
|
1188
|
+
};
|
|
1189
|
+
LoadingDots.propTypes = {
|
|
1190
|
+
size: PropTypes.oneOf(["big", "small", "extra-small"]),
|
|
1191
|
+
isColored: PropTypes.bool,
|
|
1192
|
+
noMargins: PropTypes.bool,
|
|
1193
|
+
align: PropTypes.oneOfType([PropTypes.oneOf(["left", "right"]), PropTypes.bool])
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* Button component - A versatile and customizable button for React applications.
|
|
1198
|
+
* It supports various sizes, styles, and functionalities, including loaders, icons, and handling of click events.
|
|
1199
|
+
* This component can also be used as a link if "to" is provided.
|
|
1200
|
+
*
|
|
1201
|
+
* @component
|
|
1202
|
+
* @param {Object} props
|
|
1203
|
+
* @param {('xl'|'lg'|'md'|'sm')} [props.size='xl'] - Sets the size of the button.
|
|
1204
|
+
* @param {string} [props.className=''] - An optional custom CSS class name for additional styling.
|
|
1205
|
+
* @param {string} [props.mode='transparent'] - Determines the button's visual style.
|
|
1206
|
+
* @param {Function} [props.onClick=(resetButtonLoader, event) => {}] - Callback function that triggers on button click.
|
|
1207
|
+
* @param {boolean} [props.loader=true] - If true, displays a loader animation on the button when clicked.
|
|
1208
|
+
* @param {boolean} [props.loading=false] - Controls the actual display of the loader if `loader` is true.
|
|
1209
|
+
* @param {string} [props.to=''] - The path for the button to act as a link.
|
|
1210
|
+
* @param {boolean} [props.fullWidthOnMobiles=false] - Expands the button to full width on mobiles.
|
|
1211
|
+
* @param {boolean} [props.fullWidthOnTablets=false] - Expands the button to full width on tablets.
|
|
1212
|
+
* @param {string} [props.icon=''] - The path to the button's icon.
|
|
1213
|
+
* @param {React.ReactNode} [props.content=''] - The text or content displayed inside the button.
|
|
1214
|
+
* @param {boolean} [props.isDisabled=false] - Disables the button if true.
|
|
1215
|
+
* @param {Function} [props.setClickTrigger=(p) => {}] - Function to programmatically trigger a button click.
|
|
1216
|
+
* @param {boolean} [props.isFormSubmittingButton=false] - If true, adds a hidden `<input type="submit">`.
|
|
1217
|
+
* @param {boolean} [props.bigIcon=false] - If true, displays a larger icon on the button.
|
|
1218
|
+
* @param {boolean} [props.checkmarkOnClick=false] - Shows a checkmark instead of content for a few seconds after click.
|
|
1219
|
+
* @param {boolean} [props.propagatePrimaryButtonClick=true] - Propagates the primary button click event if true.
|
|
1220
|
+
* @param {boolean} [props.smallPaddingOnSmallMobiles=false] - Enables smaller paddings for extra-small screen sizes.
|
|
1221
|
+
* @param {Function} [props.handleError=(func) => func()] - Function to handle errors during button click events.
|
|
1222
|
+
* @returns {React.ReactElement}
|
|
1223
|
+
*/
|
|
1224
|
+
const Button = ({
|
|
1225
|
+
size: _size = "xl",
|
|
1226
|
+
className: _className = "",
|
|
1227
|
+
mode: _mode = "transparent",
|
|
1228
|
+
onClick: _onClick = (resetButtonLoader, event) => {},
|
|
1229
|
+
loader: _loader = true,
|
|
1230
|
+
loading: _loading = false,
|
|
1231
|
+
to: _to = "",
|
|
1232
|
+
fullWidthOnMobiles: _fullWidthOnMobiles = false,
|
|
1233
|
+
fullWidthOnTablets: _fullWidthOnTablets = false,
|
|
1234
|
+
icon: _icon = "",
|
|
1235
|
+
content: _content = "",
|
|
1236
|
+
isDisabled: _isDisabled = false,
|
|
1237
|
+
setClickTrigger: _setClickTrigger = p => {},
|
|
1238
|
+
isFormSubmittingButton: _isFormSubmittingButton = false,
|
|
1239
|
+
bigIcon: _bigIcon = false,
|
|
1240
|
+
checkmarkOnClick: _checkmarkOnClick = false,
|
|
1241
|
+
propagatePrimaryButtonClick: _propagatePrimaryButtonClick = true,
|
|
1242
|
+
smallPaddingOnSmallMobiles: _smallPaddingOnSmallMobiles = false,
|
|
1243
|
+
handleError: _handleError = (func, event) => func(event)
|
|
1244
|
+
}) => {
|
|
1245
|
+
const [isLoading, setIsLoading] = useState(_loading);
|
|
1246
|
+
const [isCheckShown, setIsCheckShown] = useState(false);
|
|
1247
|
+
const [event, setEvent] = useState(null);
|
|
1248
|
+
const buttonRef = useRef();
|
|
1249
|
+
useEffect(() => {
|
|
1250
|
+
_setClickTrigger(() => buttonRef.current.click());
|
|
1251
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1252
|
+
}, [buttonRef]);
|
|
1253
|
+
useEffect(() => {
|
|
1254
|
+
if (isLoading) {
|
|
1255
|
+
_onClick(() => setIsLoading(false), event);
|
|
1256
|
+
}
|
|
1257
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1258
|
+
}, [isLoading]);
|
|
1259
|
+
const buttonClick = e => {
|
|
1260
|
+
if (isLoading || _isDisabled) {
|
|
1261
|
+
return false;
|
|
1262
|
+
}
|
|
1263
|
+
if (_checkmarkOnClick && !isCheckShown && !_loader && !_loading) {
|
|
1264
|
+
setIsCheckShown(true);
|
|
1265
|
+
setTimeout(() => {
|
|
1266
|
+
setIsCheckShown(false);
|
|
1267
|
+
}, 2000);
|
|
1268
|
+
}
|
|
1269
|
+
e.persist(); // Persisting React's SyntheticEvent to be able to use it in any async context
|
|
1270
|
+
!_propagatePrimaryButtonClick && e.stopPropagation();
|
|
1271
|
+
if (_loader) {
|
|
1272
|
+
setIsLoading(true);
|
|
1273
|
+
setEvent(e);
|
|
1274
|
+
} else {
|
|
1275
|
+
_onClick(() => setIsLoading(false), e);
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
const classNames = `${styles$1.button} ${styles$1[_size]} ${styles$1[_className]} ${styles$1[_mode]}` + (_fullWidthOnMobiles ? ` ${styles$1["full-width-on-mobiles"]}` : "") + (_fullWidthOnTablets ? ` ${styles$1["full-width-on-tablets"]}` : "") + (_isDisabled ? ` ${styles$1.disable}` : "") + (_smallPaddingOnSmallMobiles ? ` ${styles$1["small-padding-on-small-mobiles"]}` : "");
|
|
1279
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, _isFormSubmittingButton ? /*#__PURE__*/React.createElement("input", {
|
|
1280
|
+
type: "submit",
|
|
1281
|
+
hidden: true
|
|
1282
|
+
}) : null, _to ? /*#__PURE__*/React.createElement("a", {
|
|
1283
|
+
className: classNames,
|
|
1284
|
+
onClick: e => _handleError(buttonClick, e),
|
|
1285
|
+
href: _to,
|
|
1286
|
+
ref: buttonRef
|
|
1287
|
+
}, _icon ? /*#__PURE__*/React.createElement("div", {
|
|
1288
|
+
className: styles$1["button-with-icon"] + (_bigIcon ? ` ${styles$1["big-icon"]}` : "")
|
|
1289
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
1290
|
+
src: _icon,
|
|
1291
|
+
alt: "button icon"
|
|
1292
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1293
|
+
className: styles$1["button-with-icon-text"]
|
|
1294
|
+
}, _content)) : _content) : /*#__PURE__*/React.createElement("div", {
|
|
1295
|
+
className: classNames,
|
|
1296
|
+
onClick: e => _handleError(buttonClick, e),
|
|
1297
|
+
ref: buttonRef
|
|
1298
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1299
|
+
className: `${styles$1["button-primary-dots-wrapper"]} ${isLoading && _loader ? styles$1.show : ""}`
|
|
1300
|
+
}, _loader && isLoading ? /*#__PURE__*/React.createElement(LoadingDots, {
|
|
1301
|
+
isColored: _mode === "white"
|
|
1302
|
+
}) : null), /*#__PURE__*/React.createElement("div", {
|
|
1303
|
+
className: `${styles$1["button-success-icon"]} ${styles$1[_mode]} ${isCheckShown ? styles$1["show"] : ""}`
|
|
1304
|
+
}), _icon ? /*#__PURE__*/React.createElement("div", {
|
|
1305
|
+
className: `${styles$1["button-with-icon"]} ${isLoading && _loader || _checkmarkOnClick && isCheckShown ? styles$1["hide"] : ""} ${_bigIcon ? styles$1["big-icon"] : ""}`
|
|
1306
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
1307
|
+
src: _icon,
|
|
1308
|
+
alt: "button icon"
|
|
1309
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1310
|
+
className: styles$1["button-with-icon-text"]
|
|
1311
|
+
}, _content)) : /*#__PURE__*/React.createElement("span", {
|
|
1312
|
+
className: `${styles$1["button-text"]} ${isLoading && _loader || _checkmarkOnClick && isCheckShown ? styles$1["hide"] : ""}`
|
|
1313
|
+
}, _content)));
|
|
1314
|
+
};
|
|
1315
|
+
Button.propTypes = {
|
|
1316
|
+
size: PropTypes.oneOf(["xl", "lg", "md", "sm"]),
|
|
1317
|
+
className: PropTypes.string,
|
|
1318
|
+
mode: PropTypes.oneOf(["transparent", "white", "white-flat", "primary", "primary-bordered", "primary-transparent", "transparent-bordered", "transparent-without-shadow"]),
|
|
1319
|
+
onClick: PropTypes.func,
|
|
1320
|
+
loader: PropTypes.bool,
|
|
1321
|
+
loading: PropTypes.bool,
|
|
1322
|
+
to: PropTypes.string,
|
|
1323
|
+
fullWidthOnMobiles: PropTypes.bool,
|
|
1324
|
+
fullWidthOnTablets: PropTypes.bool,
|
|
1325
|
+
icon: PropTypes.string,
|
|
1326
|
+
content: PropTypes.node,
|
|
1327
|
+
isDisabled: PropTypes.bool,
|
|
1328
|
+
setClickTrigger: PropTypes.func,
|
|
1329
|
+
isFormSubmittingButton: PropTypes.bool,
|
|
1330
|
+
bigIcon: PropTypes.bool,
|
|
1331
|
+
checkmarkOnClick: PropTypes.bool,
|
|
1332
|
+
propagatePrimaryButtonClick: PropTypes.bool,
|
|
1333
|
+
smallPaddingOnSmallMobiles: PropTypes.bool,
|
|
1334
|
+
handleError: PropTypes.func
|
|
1335
|
+
};
|
|
1336
|
+
Button.defaultProps = {
|
|
1337
|
+
size: "xl",
|
|
1338
|
+
className: "",
|
|
1339
|
+
mode: "transparent",
|
|
1340
|
+
onClick: (resetButtonLoader, event) => {},
|
|
1341
|
+
loader: true,
|
|
1342
|
+
loading: false,
|
|
1343
|
+
to: "",
|
|
1344
|
+
fullWidthOnMobiles: false,
|
|
1345
|
+
fullWidthOnTablets: false,
|
|
1346
|
+
icon: "",
|
|
1347
|
+
content: "",
|
|
1348
|
+
isDisabled: false,
|
|
1349
|
+
setClickTrigger: p => {},
|
|
1350
|
+
isFormSubmittingButton: false,
|
|
1351
|
+
bigIcon: false,
|
|
1352
|
+
checkmarkOnClick: false,
|
|
1353
|
+
propagatePrimaryButtonClick: true,
|
|
1354
|
+
smallPaddingOnSmallMobiles: false,
|
|
1355
|
+
handleError: func => func()
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
const SupportChat = ({
|
|
1359
|
+
url,
|
|
1360
|
+
websiteToken,
|
|
1361
|
+
welcomeMessage: _welcomeMessage = ""
|
|
1362
|
+
}) => {
|
|
1363
|
+
useEffect(() => {
|
|
1364
|
+
window.chatwootSettings = {
|
|
1365
|
+
position: "right",
|
|
1366
|
+
type: "standard",
|
|
1367
|
+
launcherTitle: _welcomeMessage
|
|
1368
|
+
};
|
|
1369
|
+
(function (d, t) {
|
|
1370
|
+
var BASE_URL = url;
|
|
1371
|
+
var g = d.createElement(t),
|
|
1372
|
+
s = d.getElementsByTagName(t)[0];
|
|
1373
|
+
g.src = BASE_URL + "/packs/js/sdk.js";
|
|
1374
|
+
g.defer = true;
|
|
1375
|
+
g.async = true;
|
|
1376
|
+
s.parentNode.insertBefore(g, s);
|
|
1377
|
+
g.onload = function () {
|
|
1378
|
+
window.chatwootSDK.run({
|
|
1379
|
+
websiteToken: websiteToken,
|
|
1380
|
+
baseUrl: BASE_URL
|
|
1381
|
+
});
|
|
1382
|
+
};
|
|
1383
|
+
})(document, "script");
|
|
1384
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1385
|
+
}, []);
|
|
1386
|
+
return null;
|
|
1387
|
+
};
|
|
1388
|
+
SupportChat.propTypes = {
|
|
1389
|
+
url: PropTypes.string.isRequired,
|
|
1390
|
+
websiteToken: PropTypes.string.isRequired,
|
|
1391
|
+
welcomeMessage: PropTypes.string
|
|
1392
|
+
};
|
|
1393
|
+
SupportChat.defaultProps = {
|
|
1394
|
+
welcomeMessage: ""
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
var s = {"container":"_DYS-g","m-0":"_85R9d","p-0":"_wi0-U","m-1":"_YoewO","p-1":"_vuJBW","m-2":"_ruaYI","p-2":"_dO-cg","m-3":"_3Oh59","p-3":"_x4uSr","m-4":"_zN8us","p-4":"_rjv4I","m-5":"_5T1F-","p-5":"_-nWHT","m-6":"_Skgdf","p-6":"_Oux4z","m-7":"_yKPSq","p-7":"_sOsqF","m-8":"_8EoDT","p-8":"_G4M7b","m-9":"_ZZJBC","p-9":"_2PU3N","m-10":"_XRmXO","p-10":"_lhLN8","ml-0":"_SIynD","pl-0":"_VCLgc","ml-1":"_9vhMT","pl-1":"_4O5ig","ml-2":"_f1saV","pl-2":"_sHxk9","ml-3":"_kiltH","pl-3":"_jUw5Z","ml-4":"_CF1wj","pl-4":"_eXCZ1","ml-5":"_HZlH9","pl-5":"_6xbwv","ml-6":"_jNpyz","pl-6":"_k5lHk","ml-7":"_LgB9F","pl-7":"_ol9Tb","ml-8":"_I25tR","pl-8":"_TN4dc","ml-9":"_ywWxC","pl-9":"_4UsSQ","ml-10":"_9rfct","pl-10":"_LoViP","mr-0":"_-1PzO","pr-0":"_Ekco3","mr-1":"_EfRd0","pr-1":"_GspC-","mr-2":"_91QSK","pr-2":"_dU7Vb","mr-3":"_tW92i","pr-3":"_qNnnG","mr-4":"_XC1FW","pr-4":"_09RVw","mr-5":"_I4KRh","pr-5":"_eag2b","mr-6":"_E-KDc","pr-6":"_0d7JN","mr-7":"_9GUd-","pr-7":"_5Jseh","mr-8":"_Z-z3u","pr-8":"_rjPRa","mr-9":"_R2d68","pr-9":"_YI-lc","mr-10":"_ORX-B","pr-10":"_F5ib8","mt-0":"_OAl4b","pt-0":"_iJ5QU","mt-1":"_x72-c","pt-1":"_DGuKS","mt-2":"_ZYCC4","pt-2":"_6oj3E","mt-3":"_ADXHX","pt-3":"_asJoO","mt-4":"_Bz8Hu","pt-4":"_N7CCb","mt-5":"_OyQQ8","pt-5":"_C46Cf","mt-6":"_Bfrcj","pt-6":"_NN4sF","mt-7":"_RWFV0","pt-7":"_zUauA","mt-8":"_v7txm","pt-8":"_qgvMl","mt-9":"_9s32w","pt-9":"_aJZt7","mt-10":"_feBhr","pt-10":"_EfI4E","mb-0":"_RUzt9","pb-0":"_0Zjn8","mb-1":"_EmcPj","pb-1":"_zuqTv","mb-2":"_jYcdG","pb-2":"_fjMa6","mb-3":"_Lcgzu","pb-3":"_MHHa3","mb-4":"_Aoo0-","pb-4":"_B1ap3","mb-5":"_xdjCc","pb-5":"_lnrC3","mb-6":"_TFmkS","pb-6":"_YNj2R","mb-7":"_i0-JZ","pb-7":"_qSvSL","mb-8":"_7ziqB","pb-8":"_W-Cdi","mb-9":"_lUUVq","pb-9":"_LrgoL","mb-10":"_xX8mu","pb-10":"_DU6C6","mx-0":"_71D1Q","px-0":"_U8dyv","mx-1":"_2VhDN","px-1":"_d8Tlo","mx-2":"_uDkn4","px-2":"_a6Z6h","mx-3":"_W9yqm","px-3":"_MCbca","mx-4":"_sIDVk","px-4":"_wZ8Qz","mx-5":"_-6tEi","px-5":"_8vfpL","mx-6":"_mbXa9","px-6":"_LcSh5","mx-7":"_mF9-c","px-7":"_TfjhQ","mx-8":"_RG7wu","px-8":"_19Sdb","mx-9":"_JkKgx","px-9":"_Ir3LH","mx-10":"_70tWA","px-10":"_d1BrW","my-0":"_0PauS","py-0":"_FP0FE","my-1":"_znn6s","py-1":"_-FHoU","my-2":"_EqZco","py-2":"_fuTfe","my-3":"_D2LQ5","py-3":"_YWhnK","my-4":"_kCXTL","py-4":"_j1vj6","my-5":"_naEoR","py-5":"_QK3Z-","my-6":"_L1TOy","py-6":"_dQH-e","my-7":"_sVZ3Y","py-7":"_Fi779","my-8":"_1mAkX","py-8":"_yTTVv","my-9":"_jCeMV","py-9":"_qfn2C","my-10":"_eqneu","py-10":"_Atu-j","m-sm-0":"_hsKWE","p-sm-0":"_j3m-2","m-sm-1":"_NQOee","p-sm-1":"_sB5mJ","m-sm-2":"_KivoH","p-sm-2":"_YjE2j","m-sm-3":"_kObhZ","p-sm-3":"_TDlKW","m-sm-4":"_aJWH3","p-sm-4":"_Vntgp","m-sm-5":"_k-Hjs","p-sm-5":"_mJt7k","m-sm-6":"_Yxxob","p-sm-6":"_E5a-A","m-sm-7":"_M1OJO","p-sm-7":"_-5OJr","m-sm-8":"_UYrWD","p-sm-8":"_FJeV6","m-sm-9":"_DosWW","p-sm-9":"_T9yES","m-sm-10":"_tLYqH","p-sm-10":"_5dbE7","ml-sm-0":"_PM9wP","pl-sm-0":"_0Eoi7","ml-sm-1":"_Mb-hF","pl-sm-1":"_n4rCF","ml-sm-2":"_JJgiX","pl-sm-2":"_WOdAR","ml-sm-3":"_umhPB","pl-sm-3":"_tETqx","ml-sm-4":"_PQ088","pl-sm-4":"_ON2pV","ml-sm-5":"_IrMTT","pl-sm-5":"_12IZU","ml-sm-6":"_s8vHJ","pl-sm-6":"_9Od-S","ml-sm-7":"_4uuhE","pl-sm-7":"_TTrnJ","ml-sm-8":"_6TEO5","pl-sm-8":"_ZEPSH","ml-sm-9":"_I05iS","pl-sm-9":"_F5rHi","ml-sm-10":"_AJZ2R","pl-sm-10":"_zgudu","mr-sm-0":"_AD7v0","pr-sm-0":"_katlS","mr-sm-1":"_RMNwS","pr-sm-1":"_SC0VS","mr-sm-2":"_YFbee","pr-sm-2":"_I2cqm","mr-sm-3":"_KJzfk","pr-sm-3":"_aDNge","mr-sm-4":"_ERg9u","pr-sm-4":"_wlgHy","mr-sm-5":"_spxY0","pr-sm-5":"_pAEEu","mr-sm-6":"_HM7Z6","pr-sm-6":"_rf9My","mr-sm-7":"_b-V6W","pr-sm-7":"_YFXWV","mr-sm-8":"_96NiE","pr-sm-8":"_0ynKz","mr-sm-9":"_9NqL0","pr-sm-9":"_ZEN2v","mr-sm-10":"_oxmC7","pr-sm-10":"_AsAlz","mt-sm-0":"_Yl8e7","pt-sm-0":"_fkSmd","mt-sm-1":"_l4X69","pt-sm-1":"_i7WdP","mt-sm-2":"_ggYWK","pt-sm-2":"_3-z2g","mt-sm-3":"_IzZ-y","pt-sm-3":"_c3PEq","mt-sm-4":"_BbTvo","pt-sm-4":"_iAXVy","mt-sm-5":"_RNscW","pt-sm-5":"_7dHkj","mt-sm-6":"_iKCRS","pt-sm-6":"_an673","mt-sm-7":"_1Atcr","pt-sm-7":"_KA-HC","mt-sm-8":"_45ifh","pt-sm-8":"_26wBi","mt-sm-9":"_VaqUk","pt-sm-9":"_cx10Q","mt-sm-10":"_83RI-","pt-sm-10":"_vTZq7","mb-sm-0":"_IDhal","pb-sm-0":"_3IjzN","mb-sm-1":"_sjxoK","pb-sm-1":"_fmWwG","mb-sm-2":"_GNlxw","pb-sm-2":"_r3zJV","mb-sm-3":"_FFWRt","pb-sm-3":"_arvvr","mb-sm-4":"_qaIKp","pb-sm-4":"_wSca9","mb-sm-5":"_-cXAZ","pb-sm-5":"_grIUD","mb-sm-6":"_PUPyR","pb-sm-6":"_nA8VL","mb-sm-7":"_t7JYD","pb-sm-7":"_OpbJn","mb-sm-8":"_x1wdN","pb-sm-8":"_3Z-mA","mb-sm-9":"_BPrSY","pb-sm-9":"_b-NQ7","mb-sm-10":"_lSN9Q","pb-sm-10":"_E7xwy","mx-sm-0":"_-cSXk","px-sm-0":"_VlISI","mx-sm-1":"_6derN","px-sm-1":"_in01f","mx-sm-2":"_nskhZ","px-sm-2":"_Thnqg","mx-sm-3":"_xR8rV","px-sm-3":"_zUOaf","mx-sm-4":"_0c-bw","px-sm-4":"_X-g0R","mx-sm-5":"_p3iVv","px-sm-5":"_RdgSR","mx-sm-6":"_vK8xL","px-sm-6":"_xGpLP","mx-sm-7":"_uvb2q","px-sm-7":"_YvDjG","mx-sm-8":"_8nvEy","px-sm-8":"_L3gRg","mx-sm-9":"_pRh4Y","px-sm-9":"_5yig0","mx-sm-10":"_syXdz","px-sm-10":"_TfV9e","my-sm-0":"_WXfoP","py-sm-0":"_SBx-N","my-sm-1":"_dPEq6","py-sm-1":"_UrxQl","my-sm-2":"_ULvTZ","py-sm-2":"_I4Sll","my-sm-3":"_YVvfW","py-sm-3":"_9qflx","my-sm-4":"_j4ltv","py-sm-4":"_u-NN2","my-sm-5":"_mC1LQ","py-sm-5":"_6Wcc2","my-sm-6":"_eE8rw","py-sm-6":"_AeFpW","my-sm-7":"_CAnzA","py-sm-7":"_7h-Vs","my-sm-8":"_Z9Aft","py-sm-8":"_Ww8LU","my-sm-9":"_3sbBd","py-sm-9":"_ZcdCh","my-sm-10":"_PGBDh","py-sm-10":"_i6Fc2","m-lg-0":"_PkOb8","p-lg-0":"_3UpkE","m-lg-1":"_nCbz9","p-lg-1":"_1lThO","m-lg-2":"_ARtYq","p-lg-2":"_vHeBX","m-lg-3":"_cpKBp","p-lg-3":"_n-7p1","m-lg-4":"_1bWgj","p-lg-4":"_niPSW","m-lg-5":"_T9s09","p-lg-5":"_OS1Yy","m-lg-6":"_GvZeA","p-lg-6":"_8cgsA","m-lg-7":"_d0oC7","p-lg-7":"_TuBYJ","m-lg-8":"_slAc2","p-lg-8":"_ay3FH","m-lg-9":"_r3-kR","p-lg-9":"_IuC-U","m-lg-10":"_9P6I9","p-lg-10":"_RUR7-","ml-lg-0":"_xf3wx","pl-lg-0":"_Q-8ZY","ml-lg-1":"_4tg9Q","pl-lg-1":"_2rsuI","ml-lg-2":"_-YU8G","pl-lg-2":"_Eds1N","ml-lg-3":"_tD4RQ","pl-lg-3":"_R0Rk2","ml-lg-4":"_pZcNJ","pl-lg-4":"_5jvIR","ml-lg-5":"_sjk-4","pl-lg-5":"_RwLHv","ml-lg-6":"_dyXyT","pl-lg-6":"_nVLAC","ml-lg-7":"_FPuf8","pl-lg-7":"_M5bYC","ml-lg-8":"_Uet9k","pl-lg-8":"_UrAQv","ml-lg-9":"_VPraG","pl-lg-9":"_8HJkV","ml-lg-10":"_ILHbQ","pl-lg-10":"_QaxaT","mr-lg-0":"_2QrJI","pr-lg-0":"_0XJPD","mr-lg-1":"_qSATY","pr-lg-1":"_fzyzB","mr-lg-2":"_pY4IE","pr-lg-2":"_lc7Gu","mr-lg-3":"_KeRuW","pr-lg-3":"_zc2cu","mr-lg-4":"_RvxVY","pr-lg-4":"_v5XDn","mr-lg-5":"_Kipoo","pr-lg-5":"_K-vHR","mr-lg-6":"_1nl-K","pr-lg-6":"_nVUH-","mr-lg-7":"_M1Ue1","pr-lg-7":"_B75ua","mr-lg-8":"_CmlKz","pr-lg-8":"_FnY12","mr-lg-9":"_8-uRA","pr-lg-9":"_1DG22","mr-lg-10":"_vzMQh","pr-lg-10":"_2iqul","mt-lg-0":"_1eCp-","pt-lg-0":"_ucRUw","mt-lg-1":"_9YQ4e","pt-lg-1":"_pzmV0","mt-lg-2":"_1Z7OF","pt-lg-2":"_FUFhX","mt-lg-3":"_HPI-W","pt-lg-3":"_NwVgV","mt-lg-4":"_duZYq","pt-lg-4":"_h0NfP","mt-lg-5":"_sszGU","pt-lg-5":"_nNi-i","mt-lg-6":"_YYWl4","pt-lg-6":"_rqDrl","mt-lg-7":"_MmkeY","pt-lg-7":"_TZx0T","mt-lg-8":"_mdoth","pt-lg-8":"_2pGPR","mt-lg-9":"_csumg","pt-lg-9":"_BIWSR","mt-lg-10":"_TN07y","pt-lg-10":"_ojQGh","mb-lg-0":"_eXETo","pb-lg-0":"_FeL5F","mb-lg-1":"_Zc1bw","pb-lg-1":"_34sNS","mb-lg-2":"_2XgD-","pb-lg-2":"_OTB4o","mb-lg-3":"_xJ4EC","pb-lg-3":"_-Uc7P","mb-lg-4":"_thqbO","pb-lg-4":"_lqHuw","mb-lg-5":"_gDmAe","pb-lg-5":"_zAiLu","mb-lg-6":"_96HP2","pb-lg-6":"_TCehU","mb-lg-7":"_1Guas","pb-lg-7":"_vn7-Z","mb-lg-8":"_Cc-m8","pb-lg-8":"_dbCuX","mb-lg-9":"_U5Qon","pb-lg-9":"_b54cM","mb-lg-10":"_cGYyA","pb-lg-10":"_U5qus","mx-lg-0":"_TDPp0","px-lg-0":"_hUlWn","mx-lg-1":"_uh5DO","px-lg-1":"_N8r0e","mx-lg-2":"_vsfWJ","px-lg-2":"_LaBP6","mx-lg-3":"_JxquV","px-lg-3":"_Tb8mk","mx-lg-4":"_wDKd1","px-lg-4":"_lIguL","mx-lg-5":"_RSd-x","px-lg-5":"_Mdf1f","mx-lg-6":"_uvK2D","px-lg-6":"_4k20p","mx-lg-7":"_iXTh7","px-lg-7":"_W2faz","mx-lg-8":"_HHM9t","px-lg-8":"_n54Rq","mx-lg-9":"_douwI","px-lg-9":"_KWSHJ","mx-lg-10":"_L-r4v","px-lg-10":"_qeSLU","my-lg-0":"_U9qcF","py-lg-0":"_sSD4U","my-lg-1":"_vNl2c","py-lg-1":"_Cfkag","my-lg-2":"_gVDuB","py-lg-2":"_FwQsB","my-lg-3":"_oiJaa","py-lg-3":"_FASGS","my-lg-4":"_va2Tm","py-lg-4":"_EPTkJ","my-lg-5":"_jvYOP","py-lg-5":"_NTxiG","my-lg-6":"_8Y7Xj","py-lg-6":"_Nrsd7","my-lg-7":"_-e9e5","py-lg-7":"_NOh2l","my-lg-8":"_nyCDl","py-lg-8":"_fpL5p","my-lg-9":"_BbcqH","py-lg-9":"_VlI3L","my-lg-10":"_OGNmd","py-lg-10":"_Q-3bw","m-md-0":"_P6WIc","p-md-0":"_3YuAI","m-md-1":"_VwK3z","p-md-1":"_ArFsR","m-md-2":"_5Hp7o","p-md-2":"_-R4rJ","m-md-3":"_J55VC","p-md-3":"_TxlAj","m-md-4":"_FHPQG","p-md-4":"_iZW10","m-md-5":"_Kiuiv","p-md-5":"_0Qiry","m-md-6":"_Ja9dp","p-md-6":"_GBAS-","m-md-7":"_uuE4u","p-md-7":"_kAuu-","m-md-8":"_CaU4W","p-md-8":"_GbyMJ","m-md-9":"_brWmN","p-md-9":"_-1z0O","m-md-10":"_dIML4","p-md-10":"_eJliD","ml-md-0":"_nuVMQ","pl-md-0":"_PCyiw","ml-md-1":"_NX2qp","pl-md-1":"_yJ39l","ml-md-2":"_BV1WB","pl-md-2":"_x24YX","ml-md-3":"_kvTBw","pl-md-3":"_7G7wo","ml-md-4":"_s1oaO","pl-md-4":"_nTHBq","ml-md-5":"_2AyzN","pl-md-5":"_VmocP","ml-md-6":"_QEhdf","pl-md-6":"_Ywy9t","ml-md-7":"_Mybnc","pl-md-7":"_zHudI","ml-md-8":"_AT4F-","pl-md-8":"_1-CLq","ml-md-9":"_cZ0UL","pl-md-9":"_AKT8q","ml-md-10":"_uo54H","pl-md-10":"_2Edrz","mr-md-0":"_8NtcB","pr-md-0":"_BN5kR","mr-md-1":"_hIIXR","pr-md-1":"_KWi0C","mr-md-2":"_kP9GD","pr-md-2":"_fo1s0","mr-md-3":"_ptgO9","pr-md-3":"_AIGLm","mr-md-4":"_GJNi6","pr-md-4":"_-ZfQA","mr-md-5":"_hW-OG","pr-md-5":"_ePqmc","mr-md-6":"_ghuDl","pr-md-6":"_C9rlZ","mr-md-7":"_bIHB6","pr-md-7":"_xPHzJ","mr-md-8":"_6ZssD","pr-md-8":"_-N-QR","mr-md-9":"_T-XzG","pr-md-9":"_k8hdA","mr-md-10":"_26xvU","pr-md-10":"_U6Fpn","mt-md-0":"_ZIFgT","pt-md-0":"_6JBhp","mt-md-1":"_lIu84","pt-md-1":"_yPyiK","mt-md-2":"_sWcbm","pt-md-2":"_-7S2K","mt-md-3":"_-Zt6X","pt-md-3":"_pmFds","mt-md-4":"_dlz9t","pt-md-4":"_HQv-M","mt-md-5":"_9tUBj","pt-md-5":"_Jdc38","mt-md-6":"_BEZDD","pt-md-6":"_c3r6r","mt-md-7":"_KSCEr","pt-md-7":"_-Tpjo","mt-md-8":"_O-cOs","pt-md-8":"_DPwEz","mt-md-9":"_eBVAf","pt-md-9":"_Fnftl","mt-md-10":"_tlAu5","pt-md-10":"_ufMho","mb-md-0":"_NKFtN","pb-md-0":"_QEyOV","mb-md-1":"_t8EVs","pb-md-1":"_hVqy6","mb-md-2":"_Dwa5p","pb-md-2":"_A6iqX","mb-md-3":"_DAzrF","pb-md-3":"_o9L2-","mb-md-4":"_zMG5y","pb-md-4":"_wC2az","mb-md-5":"_LYF0o","pb-md-5":"_rrbij","mb-md-6":"_tUQcN","pb-md-6":"_MgAD-","mb-md-7":"_9lVsl","pb-md-7":"_Z7z8R","mb-md-8":"_CMrj4","pb-md-8":"_X4Qb0","mb-md-9":"_dQuWg","pb-md-9":"_98aa5","mb-md-10":"_tjfzH","pb-md-10":"_n5Id2","mx-md-0":"_kbQ3E","px-md-0":"_LWqO4","mx-md-1":"_8dqNC","px-md-1":"_QBFBY","mx-md-2":"_QXy6I","px-md-2":"_vBqGQ","mx-md-3":"_asgRe","px-md-3":"_i67O7","mx-md-4":"_-9eXp","px-md-4":"_ZQIEY","mx-md-5":"_l4FN1","px-md-5":"_vYBmq","mx-md-6":"_j4Fiy","px-md-6":"_BLvHs","mx-md-7":"_hg5ZA","px-md-7":"_OclOz","mx-md-8":"_NNMXz","px-md-8":"_KUBjL","mx-md-9":"_x5vxD","px-md-9":"_x1Hj-","mx-md-10":"_RnJFW","px-md-10":"_laoTv","my-md-0":"_gAG5i","py-md-0":"_KQkB8","my-md-1":"_90Emt","py-md-1":"_a93vq","my-md-2":"_wzerE","py-md-2":"_vpawj","my-md-3":"_ijUtT","py-md-3":"_9G-7C","my-md-4":"_GfQTx","py-md-4":"_vGRDM","my-md-5":"_MVaN3","py-md-5":"_5Ju4e","my-md-6":"_StvD2","py-md-6":"_03iO9","my-md-7":"_nlUi8","py-md-7":"_e58lN","my-md-8":"_VKoKR","py-md-8":"_Xa5lD","my-md-9":"_nLjef","py-md-9":"_88ryZ","my-md-10":"_-f4Oc","py-md-10":"_60CJ8","m-xl-0":"_YdUVc","p-xl-0":"_ceNl-","m-xl-1":"_cn-PK","p-xl-1":"_8pBVr","m-xl-2":"_UNu8h","p-xl-2":"_6mIBX","m-xl-3":"_LXA70","p-xl-3":"_nkNjg","m-xl-4":"_DH3uC","p-xl-4":"_b631X","m-xl-5":"_PU5TK","p-xl-5":"_Y9Pj5","m-xl-6":"_DQUfX","p-xl-6":"_cmXs1","m-xl-7":"_Hr4dN","p-xl-7":"_pwyLG","m-xl-8":"_XkBIo","p-xl-8":"_oSfQ1","m-xl-9":"_TXGD8","p-xl-9":"_r8XiA","m-xl-10":"_cbucW","p-xl-10":"_FnUT2","ml-xl-0":"_Lc2b0","pl-xl-0":"_8ofmI","ml-xl-1":"_yOkOl","pl-xl-1":"_5cZix","ml-xl-2":"_F0JQw","pl-xl-2":"_pWIp6","ml-xl-3":"_9CDHy","pl-xl-3":"_M9MOq","ml-xl-4":"_L6LLW","pl-xl-4":"_NZlEo","ml-xl-5":"_Milvj","pl-xl-5":"_N-hPa","ml-xl-6":"_HEU-c","pl-xl-6":"_x-uz3","ml-xl-7":"_xVYoD","pl-xl-7":"_TV3yu","ml-xl-8":"_WVmm8","pl-xl-8":"_Wsfh3","ml-xl-9":"_Rse0C","pl-xl-9":"_p-0My","ml-xl-10":"_LN1Pv","pl-xl-10":"_WtXyv","mr-xl-0":"_aQ8fC","pr-xl-0":"_x7HY1","mr-xl-1":"_rzUKT","pr-xl-1":"_ggRzA","mr-xl-2":"_j88Jb","pr-xl-2":"_6Ztzi","mr-xl-3":"_RNldP","pr-xl-3":"_uC4PP","mr-xl-4":"_14KPU","pr-xl-4":"_RoGxi","mr-xl-5":"_MYSFB","pr-xl-5":"_0fjNm","mr-xl-6":"_aK553","pr-xl-6":"_B-5Vf","mr-xl-7":"_nLta-","pr-xl-7":"_AhsZ-","mr-xl-8":"_emyPo","pr-xl-8":"_Dc6lK","mr-xl-9":"_MqsWc","pr-xl-9":"_j4A-H","mr-xl-10":"_v7rIi","pr-xl-10":"_aIhOc","mt-xl-0":"_1KMHA","pt-xl-0":"_SmBQC","mt-xl-1":"_FpHTe","pt-xl-1":"_tRIkV","mt-xl-2":"_ISAHh","pt-xl-2":"_KcOk8","mt-xl-3":"_cklRo","pt-xl-3":"_MqQSr","mt-xl-4":"_iaWfp","pt-xl-4":"_mcXBl","mt-xl-5":"_qNaL5","pt-xl-5":"_3tRQZ","mt-xl-6":"_MjyPP","pt-xl-6":"_wGTYM","mt-xl-7":"_WkpWd","pt-xl-7":"_-fXMT","mt-xl-8":"_xgRm6","pt-xl-8":"_mNE0F","mt-xl-9":"_tHRgU","pt-xl-9":"_pUanr","mt-xl-10":"_75l23","pt-xl-10":"_VjjB-","mb-xl-0":"_wNZHn","pb-xl-0":"_6weX6","mb-xl-1":"_xbDsG","pb-xl-1":"_WLHB6","mb-xl-2":"_JCck5","pb-xl-2":"_Ef822","mb-xl-3":"_-Izvj","pb-xl-3":"_kizTx","mb-xl-4":"_wDLLt","pb-xl-4":"_6vfXW","mb-xl-5":"_qa8hX","pb-xl-5":"_2cdIL","mb-xl-6":"_PPuX7","pb-xl-6":"_SYsiu","mb-xl-7":"_au29R","pb-xl-7":"_Wo-v3","mb-xl-8":"_7DCh1","pb-xl-8":"_8Qtxz","mb-xl-9":"_U5ePL","pb-xl-9":"_QdSRg","mb-xl-10":"_xwDK-","pb-xl-10":"_5HXQF","mx-xl-0":"_U-5An","px-xl-0":"_t0GQI","mx-xl-1":"_l2Q9y","px-xl-1":"_-6SLy","mx-xl-2":"_OO5ra","px-xl-2":"_DpWnU","mx-xl-3":"_umWwt","px-xl-3":"_gLeFm","mx-xl-4":"_O6nxp","px-xl-4":"_RXch7","mx-xl-5":"_GLCbl","px-xl-5":"_wOP1U","mx-xl-6":"_n1gJF","px-xl-6":"_jHA8-","mx-xl-7":"_ZG5zQ","px-xl-7":"_33-Bi","mx-xl-8":"_wGBwu","px-xl-8":"_jnqCE","mx-xl-9":"_-q541","px-xl-9":"_hQqb-","mx-xl-10":"_oOjVu","px-xl-10":"_8iBI4","my-xl-0":"_5V5-G","py-xl-0":"_ZIETe","my-xl-1":"_VhBbg","py-xl-1":"_qkd1g","my-xl-2":"_MONRd","py-xl-2":"_wBVYq","my-xl-3":"_oUD7x","py-xl-3":"_9C1YA","my-xl-4":"_akz7W","py-xl-4":"_sczsh","my-xl-5":"_CEcRg","py-xl-5":"_xFnw3","my-xl-6":"_RReJQ","py-xl-6":"_gx-E-","my-xl-7":"_NTw09","py-xl-7":"_VniPR","my-xl-8":"_zhVnN","py-xl-8":"_e-lj8","my-xl-9":"_p5Z-c","py-xl-9":"_L1zCc","my-xl-10":"_NqJ-Z","py-xl-10":"_LGmu1","background-shine":"_HkIXJ","path":"_VW1Ys","line":"_x1Ry-","skeleton":"_rh5J1","skeleton-animate":"_ukRhW","skeleton-dark":"_SuY0j","skeleton-dark-animate":"_wHz7j","skeleton-transparent":"_DehL2","skeleton-transparent-animate":"_nwZzB","semi-transparent":"_KJuSy","asset-icon":"_V0pcT","small":"_AXy-6","asset-icon-primary":"_wDjNx","asset-icon-secondary":"_uTjfo"};
|
|
1398
|
+
|
|
1399
|
+
const AssetIcon = ({
|
|
1400
|
+
assetIconSrc,
|
|
1401
|
+
assetIconProtocolSrc: _assetIconProtocolSrc = null,
|
|
1402
|
+
fallbackSrc: _fallbackSrc = null,
|
|
1403
|
+
small: _small = false
|
|
1404
|
+
}) => {
|
|
1405
|
+
const handleFailedLoad = e => {
|
|
1406
|
+
e.target.onerror = null;
|
|
1407
|
+
e.target.src = _fallbackSrc;
|
|
1408
|
+
};
|
|
1409
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1410
|
+
className: s["asset-icon"] + (_small ? " " + s["small"] : "")
|
|
1411
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
1412
|
+
src: assetIconSrc,
|
|
1413
|
+
className: s["asset-icon-primary"] + (_small ? " " + s["small"] : ""),
|
|
1414
|
+
alt: " ",
|
|
1415
|
+
onError: handleFailedLoad
|
|
1416
|
+
}), _assetIconProtocolSrc ? /*#__PURE__*/React.createElement("img", {
|
|
1417
|
+
src: _assetIconProtocolSrc,
|
|
1418
|
+
className: s["asset-icon-secondary"] + (_small ? " " + s["small"] : ""),
|
|
1419
|
+
alt: " ",
|
|
1420
|
+
onError: handleFailedLoad
|
|
1421
|
+
}) : "");
|
|
1422
|
+
};
|
|
1423
|
+
AssetIcon.propTypes = {
|
|
1424
|
+
assetIconSrc: PropTypes.string.isRequired,
|
|
1425
|
+
assetIconProtocolSrc: PropTypes.string,
|
|
1426
|
+
fallbackSrc: PropTypes.string,
|
|
1427
|
+
small: PropTypes.bool
|
|
1428
|
+
};
|
|
1429
|
+
AssetIcon.defaultProps = {
|
|
1430
|
+
assetIconProtocolSrc: null,
|
|
1431
|
+
fallbackSrc: null,
|
|
1432
|
+
small: false
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
class LogsStorage {
|
|
1436
|
+
static saveLog(log) {
|
|
1437
|
+
this._inMemoryStorage.push(log);
|
|
1438
|
+
}
|
|
1439
|
+
static getInMemoryLogs() {
|
|
1440
|
+
return this._inMemoryStorage;
|
|
1441
|
+
}
|
|
1442
|
+
static getAllLogs() {
|
|
1443
|
+
let storedLogs = "";
|
|
1444
|
+
if (typeof window !== "undefined") {
|
|
1445
|
+
storedLogs = localStorage.getItem(this._logsStorageId);
|
|
1446
|
+
}
|
|
1447
|
+
return `${storedLogs}\n${this._inMemoryStorage.join("\n")}`;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* @param logger {Logger}
|
|
1452
|
+
*/
|
|
1453
|
+
static saveToTheDisk(logger) {
|
|
1454
|
+
try {
|
|
1455
|
+
const MAX_LOCAL_STORAGE_VOLUME_BYTES = 5 * 1024 * 1024;
|
|
1456
|
+
const MAX_LOGS_STORAGE_BYTES = MAX_LOCAL_STORAGE_VOLUME_BYTES * 0.65;
|
|
1457
|
+
if (typeof window !== "undefined") {
|
|
1458
|
+
const existingLogs = localStorage.getItem(this._logsStorageId);
|
|
1459
|
+
const logsString = `${existingLogs}\n${this._inMemoryStorage.join("\n")}`;
|
|
1460
|
+
const lettersCountToRemove = logsString.length - Math.round(MAX_LOGS_STORAGE_BYTES / 2);
|
|
1461
|
+
if (lettersCountToRemove > 0) {
|
|
1462
|
+
localStorage.setItem(this._logsStorageId, logsString.slice(lettersCountToRemove, logsString.length));
|
|
1463
|
+
} else {
|
|
1464
|
+
localStorage.setItem(this._logsStorageId, logsString);
|
|
1465
|
+
}
|
|
1466
|
+
this._inMemoryStorage = [];
|
|
1467
|
+
}
|
|
1468
|
+
} catch (e) {
|
|
1469
|
+
logger == null || logger.logError(e, "saveToTheDisk", "Failed to save logs to disk");
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
static removeAllClientLogs() {
|
|
1473
|
+
if (typeof window !== "undefined") {
|
|
1474
|
+
if (localStorage.getItem("doNotRemoveClientLogsWhenSignedOut") !== "true") {
|
|
1475
|
+
localStorage.removeItem(this._logsStorageId);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
this._inMemoryStorage = [];
|
|
1479
|
+
}
|
|
1480
|
+
static setDoNotRemoveClientLogsWhenSignedOut(value) {
|
|
1481
|
+
if (typeof window !== "undefined") {
|
|
1482
|
+
localStorage.setItem("doNotRemoveClientLogsWhenSignedOut", value);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
LogsStorage._inMemoryStorage = [];
|
|
1487
|
+
LogsStorage._logsStorageId = "clietnLogs_j203fj2D0n-d1";
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Stringify given object by use of JSON.stringify but handles circular structures and "response", "request" properties
|
|
1491
|
+
* to avoid stringing redundant data when printing errors containing request/response objects.
|
|
1492
|
+
*
|
|
1493
|
+
* @param object - object to be stringed
|
|
1494
|
+
* @param indent - custom indentation
|
|
1495
|
+
* @return {string} - stringed object
|
|
1496
|
+
*/
|
|
1497
|
+
function safeStringify(object, indent = 2) {
|
|
1498
|
+
let cache = [];
|
|
1499
|
+
if (typeof object === "string" || typeof object === "function" || typeof object === "number" || typeof object === "undefined" || typeof object === "boolean") {
|
|
1500
|
+
return String(object);
|
|
1501
|
+
}
|
|
1502
|
+
const retVal = JSON.stringify(object, (key, value) => {
|
|
1503
|
+
if (key.toLowerCase().includes("request")) {
|
|
1504
|
+
return JSON.stringify({
|
|
1505
|
+
body: value == null ? void 0 : value.body,
|
|
1506
|
+
query: value == null ? void 0 : value.query,
|
|
1507
|
+
headers: value == null ? void 0 : value.headers
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
if (key.toLowerCase().includes("response")) {
|
|
1511
|
+
return JSON.stringify({
|
|
1512
|
+
statusText: value == null ? void 0 : value.statusText,
|
|
1513
|
+
status: value == null ? void 0 : value.status,
|
|
1514
|
+
data: value == null ? void 0 : value.data,
|
|
1515
|
+
headers: value == null ? void 0 : value.headers
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
return typeof value === "object" && value !== null ? cache.includes(value) ? "duplicated reference" // Duplicated references were found, discarding this key
|
|
1519
|
+
: cache.push(value) && value // Store value in our collection
|
|
1520
|
+
: value;
|
|
1521
|
+
}, indent);
|
|
1522
|
+
cache = null;
|
|
1523
|
+
return retVal;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
class Logger {
|
|
1527
|
+
/**
|
|
1528
|
+
* Logs to client logs storage.
|
|
1529
|
+
*
|
|
1530
|
+
* WARNING! this method should ce used carefully for critical logging as we have the restriction for storing logs
|
|
1531
|
+
* on client side as we store them inside the local storage. Please see details inside storage.js
|
|
1532
|
+
* @param logString {string} log string
|
|
1533
|
+
* @param source {string} source of the log entry
|
|
1534
|
+
*/
|
|
1535
|
+
static log(logString, source) {
|
|
1536
|
+
const timestamp = new Date().toISOString();
|
|
1537
|
+
LogsStorage.saveLog(`${timestamp}|${source}:${logString}`);
|
|
1538
|
+
}
|
|
1539
|
+
static logError(e, settingFunction, additionalMessage = "", onlyToConsole = false) {
|
|
1540
|
+
var _e$errorDescription, _e$howToFix;
|
|
1541
|
+
let message = `\nFunction call ${settingFunction != null ? settingFunction : ""} failed. Error message: ${e == null ? void 0 : e.message}. ${additionalMessage} `;
|
|
1542
|
+
message += `${(_e$errorDescription = e == null ? void 0 : e.errorDescription) != null ? _e$errorDescription : ""}${(_e$howToFix = e == null ? void 0 : e.howToFix) != null ? _e$howToFix : ""}` + ((e == null ? void 0 : e.httpStatus) === 403 ? "Authentication has expired or was lost. " : "");
|
|
1543
|
+
if (e != null && e.response) {
|
|
1544
|
+
try {
|
|
1545
|
+
const responseData = safeStringify({
|
|
1546
|
+
response: e.response
|
|
1547
|
+
});
|
|
1548
|
+
responseData && (message += `\n${responseData}. `);
|
|
1549
|
+
} catch (e) {}
|
|
1550
|
+
}
|
|
1551
|
+
const finalErrorText = message + ". " + safeStringify(e);
|
|
1552
|
+
// eslint-disable-next-line no-console
|
|
1553
|
+
console.error(finalErrorText, e);
|
|
1554
|
+
if (!onlyToConsole) {
|
|
1555
|
+
this.log(finalErrorText, "logError");
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
function useCallHandlingErrors() {
|
|
1561
|
+
const [, setState] = useState();
|
|
1562
|
+
return useCallback(async (functionToBeCalled, event) => {
|
|
1563
|
+
try {
|
|
1564
|
+
await functionToBeCalled(event);
|
|
1565
|
+
} catch (error) {
|
|
1566
|
+
Logger.logError(error, (functionToBeCalled == null ? void 0 : functionToBeCalled.name) || "errorBoundaryTrigger", "Caught by ErrorBoundary");
|
|
1567
|
+
// Triggering ErrorBoundary
|
|
1568
|
+
setState(() => {
|
|
1569
|
+
throw error;
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
}, []);
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* Adds reference to standard state variable. It is helpful to be able to use state variable value inside
|
|
1577
|
+
* event handlers and other callbacks without the need to call setState(prev => { value = prev; return prev; }).
|
|
1578
|
+
*
|
|
1579
|
+
* @param initialValue {any} to be passed to useState
|
|
1580
|
+
* @return {[React.Ref, function]} reference to state variable and its setter
|
|
1581
|
+
*/
|
|
1582
|
+
function useReferredState(initialValue) {
|
|
1583
|
+
const [state, setState] = React.useState(initialValue);
|
|
1584
|
+
const reference = React.useRef(state);
|
|
1585
|
+
const setReferredState = value => {
|
|
1586
|
+
if (value && {}.toString.call(value) === "[object Function]") {
|
|
1587
|
+
value = value(reference.current);
|
|
1588
|
+
}
|
|
1589
|
+
reference.current = value;
|
|
1590
|
+
setState(value);
|
|
1591
|
+
};
|
|
1592
|
+
return [reference, setReferredState];
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* This function improves the passed error object (its message) by adding the passed function name
|
|
1597
|
+
* and additional message to it.
|
|
1598
|
+
* This is useful as Javascript doesn't guarantee the stack-traces, so we should manually add these details to errors
|
|
1599
|
+
* to be able to troubleshoot.
|
|
1600
|
+
*
|
|
1601
|
+
* @param e {Error}
|
|
1602
|
+
* @param settingFunction {string}
|
|
1603
|
+
* @param [additionalMessage=""] {string|undefined}
|
|
1604
|
+
* @throws {Error} always rethrows the original passed error but with an improved message
|
|
1605
|
+
*/
|
|
1606
|
+
function improveAndRethrow(e, settingFunction, additionalMessage = "") {
|
|
1607
|
+
const message = improvedErrorMessage(e, settingFunction, additionalMessage);
|
|
1608
|
+
if (e) {
|
|
1609
|
+
e.message = message;
|
|
1610
|
+
throw e; // to preserve existing stacktrace if present
|
|
1611
|
+
}
|
|
1612
|
+
throw new Error(message);
|
|
1613
|
+
}
|
|
1614
|
+
function improvedErrorMessage(e, settingFunction, additionalMessage) {
|
|
1615
|
+
let message = `\nFunction call ${settingFunction != null ? settingFunction : ""} failed. `;
|
|
1616
|
+
e && e.message && (message += `Error message: ${e.message}. `);
|
|
1617
|
+
additionalMessage && (message += `${additionalMessage} `);
|
|
1618
|
+
return message;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
class FiatCurrenciesService {
|
|
1622
|
+
static getFullCurrencyNameByCode(code = "") {
|
|
1623
|
+
const data = fiatCurrenciesList.find(currencyData => currencyData[0] === code.toUpperCase());
|
|
1624
|
+
return data && data[2] || null;
|
|
1625
|
+
}
|
|
1626
|
+
static isCodeValid(code) {
|
|
1627
|
+
return !!fiatCurrenciesList.find(currenciesData => currenciesData[0] === code);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* Returns currency symbol by code if present
|
|
1632
|
+
*
|
|
1633
|
+
* @param code {string} currency code
|
|
1634
|
+
* @return {string|null} code or null if there is no symbol for the currency
|
|
1635
|
+
*/
|
|
1636
|
+
static getCurrencySymbolByCode(code = "") {
|
|
1637
|
+
var _data$;
|
|
1638
|
+
const data = fiatCurrenciesList.find(currencyData => currencyData[0] === code.toUpperCase());
|
|
1639
|
+
return (_data$ = data == null ? void 0 : data[1]) != null ? _data$ : null;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* @param code {string}
|
|
1644
|
+
* @return {number|null}
|
|
1645
|
+
*/
|
|
1646
|
+
static getCurrencyDecimalCountByCode(code = "") {
|
|
1647
|
+
var _data$2;
|
|
1648
|
+
const data = fiatCurrenciesList.find(currencyData => currencyData[0] === code.toUpperCase());
|
|
1649
|
+
return (_data$2 = data == null ? void 0 : data[3]) != null ? _data$2 : null;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
const fiatCurrenciesList = [["USD", "$", "US Dollar", 2], ["CAD", "CA$", "Canadian Dollar", 2], ["EUR", "€", "Euro", 2], ["AED", "AED", "UAE Dirham", 2], ["AFN", "؋", "Afghan Afghani", 0], ["ALL", "ALL", "Albanian Lek", 0], ["AMD", "֏", "Armenian Dram", 0], ["ARS", "AR$", "Argentine Peso", 2], ["AUD", "AU$", "Australian Dollar", 2], ["AZN", "₼", "Azerbaijani Manat", 2], ["BAM", "KM", "Bosnia-Herzegovina Convertible Mark", 2], ["BDT", "Tk", "Bangladeshi Taka", 2], ["BGN", "BGN", "Bulgarian Lev", 2], ["BHD", "BD", "Bahraini Dinar", 3], ["BIF", "FBu", "Burundian Franc", 0], ["BND", "BN$", "Brunei Dollar", 2], ["BOB", "Bs", "Bolivian Boliviano", 2], ["BRL", "R$", "Brazilian Real", 2], ["BWP", "BWP", "Botswanan Pula", 2], ["BYN", "Br", "Belarusian Ruble", 2], ["BZD", "BZ$", "Belize Dollar", 2], ["CDF", "CDF", "Congolese Franc", 2], ["CHF", "CHF", "Swiss Franc", 2], ["CLP", "CL$", "Chilean Peso", 0], ["CNY", "CN¥", "Chinese Yuan", 2], ["COP", "CO$", "Colombian Peso", 0], ["CRC", "₡", "Costa Rican Colón", 0], ["CVE", "CV$", "Cape Verdean Escudo", 2], ["CZK", "Kč", "Czech Republic Koruna", 2], ["DJF", "Fdj", "Djiboutian Franc", 0], ["DKK", "Dkr", "Danish Krone", 2], ["DOP", "RD$", "Dominican Peso", 2], ["DZD", "DA", "Algerian Dinar", 2], ["EEK", "Ekr", "Estonian Kroon", 2], ["EGP", "EGP", "Egyptian Pound", 2], ["ERN", "Nfk", "Eritrean Nakfa", 2], ["ETB", "Br", "Ethiopian Birr", 2], ["GBP", "£", "British Pound Sterling", 2], ["GEL", "₾", "Georgian Lari", 2], ["GHS", "₵", "Ghanaian Cedi", 2], ["GNF", "FG", "Guinean Franc", 0], ["GTQ", "GTQ", "Guatemalan Quetzal", 2], ["HKD", "HK$", "Hong Kong Dollar", 2], ["HNL", "HNL", "Honduran Lempira", 2], ["HRK", "kn", "Croatian Kuna", 2], ["HUF", "Ft", "Hungarian Forint", 0], ["IDR", "Rp", "Indonesian Rupiah", 0], ["ILS", "₪", "Israeli New Sheqel", 2], ["INR", "₹", "Indian Rupee", 2], ["IQD", "IQD", "Iraqi Dinar", 0], ["IRR", "﷼", "Iranian Rial", 0], ["ISK", "Ikr", "Icelandic Króna", 0], ["JMD", "J$", "Jamaican Dollar", 2], ["JOD", "JD", "Jordanian Dinar", 3], ["JPY", "¥", "Japanese Yen", 0], ["KES", "Ksh", "Kenyan Shilling", 2], ["KHR", "KHR", "Cambodian Riel", 2], ["KMF", "CF", "Comorian Franc", 0], ["KRW", "₩", "South Korean Won", 0], ["KWD", "KD", "Kuwaiti Dinar", 3], ["KZT", "₸", "Kazakhstani Tenge", 2], ["LBP", "LB£", "Lebanese Pound", 0], ["LKR", "SLRs", "Sri Lankan Rupee", 2], ["LTL", "Lt", "Lithuanian Litas", 2], ["LVL", "Ls", "Latvian Lats", 2], ["LYD", "LD", "Libyan Dinar", 3], ["MAD", "MAD", "Moroccan Dirham", 2], ["MDL", "MDL", "Moldovan Leu", 2], ["MGA", "MGA", "Malagasy Ariary", 0], ["MKD", "MKD", "Macedonian Denar", 2], ["MMK", "MMK", "Myanma Kyat", 0], ["MNT", "₮", "Mongolian Tugrik", 0], ["MOP", "MOP$", "Macanese Pataca", 2], ["MUR", "MURs", "Mauritian Rupee", 0], ["MXN", "MX$", "Mexican Peso", 2], ["MYR", "RM", "Malaysian Ringgit", 2], ["MZN", "MTn", "Mozambican Metical", 2], ["NAD", "N$", "Namibian Dollar", 2], ["NGN", "₦", "Nigerian Naira", 2], ["NIO", "C$", "Nicaraguan Córdoba", 2], ["NOK", "Nkr", "Norwegian Krone", 2], ["NPR", "NPRs", "Nepalese Rupee", 2], ["NZD", "NZ$", "New Zealand Dollar", 2], ["OMR", "OMR", "Omani Rial", 3], ["PAB", "B/.", "Panamanian Balboa", 2], ["PEN", "S/.", "Peruvian Nuevo Sol", 2], ["PHP", "₱", "Philippine Peso", 2], ["PKR", "PKRs", "Pakistani Rupee", 0], ["PLN", "zł", "Polish Zloty", 2], ["PYG", "₲", "Paraguayan Guarani", 0], ["QAR", "QR", "Qatari Rial", 2], ["RON", "RON", "Romanian Leu", 2], ["RSD", "din.", "Serbian Dinar", 0], ["RUB", "₽", "Russian Ruble", 2], ["RWF", "RWF", "Rwandan Franc", 0], ["SAR", "SR", "Saudi Riyal", 2], ["SDG", "SDG", "Sudanese Pound", 2], ["SEK", "Skr", "Swedish Krona", 2], ["SGD", "S$", "Singapore Dollar", 2], ["SOS", "Ssh", "Somali Shilling", 0], ["SYP", "SY£", "Syrian Pound", 0], ["THB", "฿", "Thai Baht", 2], ["TND", "DT", "Tunisian Dinar", 3], ["TOP", "T$", "Tongan Paʻanga", 2], ["TRY", "₺", "Turkish Lira", 2], ["TTD", "TT$", "Trinidad and Tobago Dollar", 2], ["TWD", "NT$", "New Taiwan Dollar", 2], ["TZS", "TSh", "Tanzanian Shilling", 0], ["UAH", "₴", "Ukrainian Hryvnia", 2], ["UGX", "USh", "Ugandan Shilling", 0], ["UYU", "$U", "Uruguayan Peso", 2], ["UZS", "UZS", "Uzbekistan Som", 0], ["VEF", "Bs.F.", "Venezuelan Bolívar", 2], ["VND", "₫", "Vietnamese Dong", 0], ["XAF", "FCFA", "CFA Franc BEAC", 0], ["XOF", "CFA", "CFA Franc BCEAO", 0], ["YER", "﷼", "Yemeni Rial", 0], ["ZAR", "R", "South African Rand", 2], ["ZMK", "ZK", "Zambian Kwacha", 0], ["ZWL", "ZWL$", "Zimbabwean Dollar", 0]];
|
|
1653
|
+
|
|
1654
|
+
function _extends() {
|
|
1655
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1656
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1657
|
+
var source = arguments[i];
|
|
1658
|
+
for (var key in source) {
|
|
1659
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1660
|
+
target[key] = source[key];
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
return target;
|
|
1665
|
+
};
|
|
1666
|
+
return _extends.apply(this, arguments);
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
// TODO: [dev] return addCommasToAmountString internal method to encapsulate commas adding
|
|
1670
|
+
|
|
1671
|
+
class AmountUtils {
|
|
1672
|
+
static fiatXs(amount, code) {
|
|
1673
|
+
return this.fiat(amount, code, {
|
|
1674
|
+
extraSmallLength: true
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Universal method for rendering of fiat amounts, taking into account the rules of
|
|
1680
|
+
* the passed fiat currency code.
|
|
1681
|
+
*
|
|
1682
|
+
* TODO: [feature, high] remove 'number' from accepted types list task_id=1e692bcfabbe487a9d1638fc8ff17448
|
|
1683
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed
|
|
1684
|
+
* @param currencyCode {string|null} The currency code. Can be omitted if { ticker: false } in the config
|
|
1685
|
+
* @param [passedParams={}] {object} Formatting parameters
|
|
1686
|
+
* @return {string} Formatted fiat amount string
|
|
1687
|
+
*/
|
|
1688
|
+
static fiat(amount, currencyCode, passedParams = {}) {
|
|
1689
|
+
try {
|
|
1690
|
+
const params = _extends({}, this.defaultFiatParams, passedParams);
|
|
1691
|
+
if (this._checkIfAmountInvalid(amount, true) || typeof currencyCode !== "string") return "NULL";
|
|
1692
|
+
const currencySymbol = FiatCurrenciesService.getCurrencySymbolByCode(currencyCode);
|
|
1693
|
+
const currencyDecimalCount = FiatCurrenciesService.getCurrencyDecimalCountByCode(currencyCode);
|
|
1694
|
+
const trimmedByMaxDigits = BigNumber(amount).toFixed(currencyDecimalCount, BigNumber.ROUND_FLOOR);
|
|
1695
|
+
let processedAmount = BigNumber(trimmedByMaxDigits);
|
|
1696
|
+
if (params.collapsible && processedAmount.gte(BigNumber("1000000"))) {
|
|
1697
|
+
processedAmount = this._collapseToMillionsAndFormat(processedAmount, this.collapsedDecimalCount, params);
|
|
1698
|
+
} else {
|
|
1699
|
+
const limitResult = this._limitTotalAmountLengthIfNeeded(trimmedByMaxDigits, params);
|
|
1700
|
+
processedAmount = BigNumber(limitResult.processedAmount).toFormat(); // Adds commas to integer part
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
// Add the currency code or currency symbol, if symbol is enabled and available
|
|
1704
|
+
if (params.ticker) {
|
|
1705
|
+
if (typeof currencySymbol === "string" && params.enableCurrencySymbols) {
|
|
1706
|
+
processedAmount = currencySymbol + (currencySymbol.length > 1 ? " " : "") + processedAmount;
|
|
1707
|
+
} else {
|
|
1708
|
+
processedAmount = processedAmount + " " + currencyCode;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
return processedAmount;
|
|
1712
|
+
} catch (e) {
|
|
1713
|
+
improveAndRethrow(e, "fiat", `Passed: ${amount}`);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
static cryptoWoTicker(amount, digits) {
|
|
1717
|
+
return this.crypto(amount, null, digits, {
|
|
1718
|
+
ticker: false
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
static cryptoWoTickerXs(amount, digits) {
|
|
1722
|
+
return this.crypto(amount, null, digits, {
|
|
1723
|
+
ticker: false,
|
|
1724
|
+
extraSmallLength: true
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
static cryptoXs(amount, ticker, digits) {
|
|
1728
|
+
return this.crypto(amount, ticker, digits, {
|
|
1729
|
+
extraSmallLength: true,
|
|
1730
|
+
periods: false
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
static cryptoFull(amount, ticker, digits) {
|
|
1734
|
+
return this.crypto(amount, ticker, digits, {
|
|
1735
|
+
collapsible: false,
|
|
1736
|
+
trim: false,
|
|
1737
|
+
limitTotalLength: false
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Universal method for rendering of crypto amounts, taking into account the rules of
|
|
1743
|
+
* the passed ticker. Requires the number of digits after period to be less of equal to
|
|
1744
|
+
* the number of digits, supported by the passed ticker.
|
|
1745
|
+
*
|
|
1746
|
+
* @param amount {BigNumber|string|null|undefined} The number value to be formatted
|
|
1747
|
+
* @param ticker {string|null} Coin ticker
|
|
1748
|
+
* @param [digits=8] {number} max digits after the dot
|
|
1749
|
+
* @param passedParams {object} Formatting parameters
|
|
1750
|
+
* @return {string} Formatted crypto amount string
|
|
1751
|
+
*/
|
|
1752
|
+
static crypto(amount, ticker, digits = this.significantDecimalCount, passedParams) {
|
|
1753
|
+
try {
|
|
1754
|
+
const params = _extends({}, this.defaultCryptoParams, passedParams);
|
|
1755
|
+
if (this._checkIfAmountInvalid(amount) || typeof ticker !== "string" && params.ticker) return "NULL";
|
|
1756
|
+
let addPeriods = false;
|
|
1757
|
+
const amountBigNumber = BigNumber(amount);
|
|
1758
|
+
let processedAmount = amountBigNumber.toFixed(digits, BigNumber.ROUND_FLOOR);
|
|
1759
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(processedAmount);
|
|
1760
|
+
const originalAmountDecimalPlaces = BigNumber(processedAmount).decimalPlaces();
|
|
1761
|
+
// Check decimal count and throw an error, if the amount has more decimal digits than supported by the asset
|
|
1762
|
+
if (originalAmountDecimalPlaces > digits) {
|
|
1763
|
+
const errorMessage = `An attempt to render a crypto value with too many digits after period was made: ${amount}, allowed digits: ${digits}. This is a no-op, since the logical and visually rendered values would differ, which is not acceptable for crypto amounts. Please trim the amount before rendering, using the trimCryptoAmountByCoin(amount, coin) method.`;
|
|
1764
|
+
// throw new Error(errorMessage);
|
|
1765
|
+
// eslint-disable-next-line no-console
|
|
1766
|
+
console.log(errorMessage, "crypto");
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
// Shortening the value to general significant number of digits after period
|
|
1770
|
+
if (params.trim) {
|
|
1771
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(amountBigNumber.toFixed(this.significantDecimalCount, BigNumber.ROUND_FLOOR));
|
|
1772
|
+
addPeriods = originalAmountDecimalPlaces > this.significantDecimalCount;
|
|
1773
|
+
}
|
|
1774
|
+
const limitResult = this._limitTotalAmountLengthIfNeeded(processedAmount, params);
|
|
1775
|
+
processedAmount = limitResult.processedAmount;
|
|
1776
|
+
addPeriods || (addPeriods = limitResult.addPeriods);
|
|
1777
|
+
let wereMillionsCollapsed = false;
|
|
1778
|
+
if (params.collapsible && amountBigNumber.gte("1000000")) {
|
|
1779
|
+
// Collapse the 1M+ amounts if applicable
|
|
1780
|
+
processedAmount = this._collapseToMillionsAndFormat(BigNumber(processedAmount), this.collapsedDecimalCount, params);
|
|
1781
|
+
wereMillionsCollapsed = true;
|
|
1782
|
+
} else {
|
|
1783
|
+
// Add separators to integer part of the amount
|
|
1784
|
+
processedAmount = BigNumber(processedAmount).toFormat();
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
// Adding periods, if the amount was shortened
|
|
1788
|
+
if (params.periods && addPeriods && !wereMillionsCollapsed) {
|
|
1789
|
+
processedAmount = processedAmount + this.periods;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
// Adding an adaptive (printable/full) ticker
|
|
1793
|
+
if (params.ticker && ticker) {
|
|
1794
|
+
processedAmount = processedAmount + " " + ticker;
|
|
1795
|
+
}
|
|
1796
|
+
return processedAmount;
|
|
1797
|
+
} catch (e) {
|
|
1798
|
+
improveAndRethrow(e, "crypto", `Passed: ${amount}, ${ticker}, ${digits}`);
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
static _checkIfAmountInvalid(amount, allowNumbers = false) {
|
|
1802
|
+
return amount == null || amount === "" || !BigNumber.isBigNumber(amount) && typeof amount !== "string" && (!allowNumbers || typeof amount !== "number");
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* Trims all digits after period that exceed the number of digits provided.
|
|
1807
|
+
* Use this everywhere when calculating some amount value to ensure the result is correct in terms
|
|
1808
|
+
* of max digits allowed by specific currency.
|
|
1809
|
+
*
|
|
1810
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
1811
|
+
* HEX strings also allowed "0x..." and JS hex numbers
|
|
1812
|
+
* @param digits {number} allowed digits
|
|
1813
|
+
* @return {string|null} String with trimmed number or null for invalid amount
|
|
1814
|
+
*/
|
|
1815
|
+
static trim(amount, digits) {
|
|
1816
|
+
try {
|
|
1817
|
+
if (this._checkIfAmountInvalid(amount, true)) return null;
|
|
1818
|
+
return BigNumber(amount).toFixed(digits, BigNumber.ROUND_FLOOR);
|
|
1819
|
+
} catch (e) {
|
|
1820
|
+
improveAndRethrow(e, "trim", `Passed: ${amount}, ${digits}`);
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
1826
|
+
* HEX strings also allowed "0x..." and JS hex numbers
|
|
1827
|
+
* @return {string|null}
|
|
1828
|
+
*/
|
|
1829
|
+
static intStr(amount) {
|
|
1830
|
+
return this.trim(amount, 0);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Shortens the line length by using a "1.52M" representation of big amounts.
|
|
1835
|
+
*
|
|
1836
|
+
* @param amountBigNumber {BigNumber} The number value to be trimmed
|
|
1837
|
+
* @param decimalCount {number} The number of digits after period to keep in millions representation
|
|
1838
|
+
* @param params {object} params object
|
|
1839
|
+
* @return {string} A shortened string, converted into "millions" format, if the amount exceeds 1 million
|
|
1840
|
+
*/
|
|
1841
|
+
static _collapseToMillionsAndFormat(amountBigNumber, decimalCount, params = {}) {
|
|
1842
|
+
try {
|
|
1843
|
+
// TODO: [feature, moderate] use local format here - take from JS locales (comma/dot etc.)
|
|
1844
|
+
const millionBigNumber = BigNumber("1000000");
|
|
1845
|
+
const millions = amountBigNumber.div(millionBigNumber).toFixed(decimalCount, BigNumber.ROUND_FLOOR);
|
|
1846
|
+
const limitedResult = this._limitTotalAmountLengthIfNeeded(millions, params);
|
|
1847
|
+
const formatted = BigNumber(limitedResult.processedAmount).toFormat();
|
|
1848
|
+
return formatted + "M";
|
|
1849
|
+
} catch (e) {
|
|
1850
|
+
improveAndRethrow(e, "_collapseAmountAndFormat", `Passed: ${amountBigNumber.toFixed()}, ${decimalCount}`);
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* @param amountString {string} The amount to be restricted by length
|
|
1856
|
+
* @param params {object} Params object used for formatting
|
|
1857
|
+
* @return {{processedAmount:string, addPeriods: boolean}} A shortened string
|
|
1858
|
+
*/
|
|
1859
|
+
static _limitTotalAmountLengthIfNeeded(amountString, params) {
|
|
1860
|
+
try {
|
|
1861
|
+
let addPeriods = false;
|
|
1862
|
+
if (params.limitTotalLength || params.extraSmallLength) {
|
|
1863
|
+
const maxLength = params.extraSmallLength ? this.extraSmallMaxTotalLength : this.maxTotalLength;
|
|
1864
|
+
if (amountString.length > maxLength) {
|
|
1865
|
+
const delta = amountString.length - maxLength;
|
|
1866
|
+
const currentDecimalsCount = BigNumber(amountString).decimalPlaces();
|
|
1867
|
+
const newDecimalCount = currentDecimalsCount - delta;
|
|
1868
|
+
amountString = BigNumber(amountString).toFixed(newDecimalCount > 2 ? newDecimalCount : 2, BigNumber.ROUND_FLOOR);
|
|
1869
|
+
addPeriods = currentDecimalsCount > newDecimalCount;
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
return {
|
|
1873
|
+
addPeriods: addPeriods,
|
|
1874
|
+
processedAmount: amountString
|
|
1875
|
+
};
|
|
1876
|
+
} catch (e) {
|
|
1877
|
+
improveAndRethrow(e, "_limitTotalAmountLengthIfNeeded", `Passed: ${amountString}, ${params}`);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Safely composes rate string (handles small/big rates)
|
|
1883
|
+
*
|
|
1884
|
+
* @param leftTicker {string}
|
|
1885
|
+
* @param rightTicker {string}
|
|
1886
|
+
* @param rate {number|string|BigNumber}
|
|
1887
|
+
* @param [rightCurrencyDigitsAfterDots=8] {number}
|
|
1888
|
+
* @return {string}
|
|
1889
|
+
*/
|
|
1890
|
+
static composeRateText(leftTicker, rightTicker, rate, rightCurrencyDigitsAfterDots = this.significantDecimalCount) {
|
|
1891
|
+
try {
|
|
1892
|
+
/* Here we try to calculate a clear rate for the user. The difficulty is that the rate value can be pretty
|
|
1893
|
+
* small as some coins have significantly higher price than the other. For such cases we calculate
|
|
1894
|
+
* not the "1 <coin_A> is X <coin B>" but "Y <coin_A> is X <coin B>" where Y is one of the powers of 100.
|
|
1895
|
+
*/
|
|
1896
|
+
let leftNumber = BigNumber("1");
|
|
1897
|
+
const multiplier = BigNumber("100");
|
|
1898
|
+
const maxAttemptsToGetRate = 10;
|
|
1899
|
+
let right = null;
|
|
1900
|
+
const rateBigNumber = BigNumber(rate);
|
|
1901
|
+
for (let i = 0; i < maxAttemptsToGetRate; ++i) {
|
|
1902
|
+
const rightNumberAttempt = rateBigNumber.times(leftNumber).toFixed(rightCurrencyDigitsAfterDots, BigNumber.ROUND_FLOOR);
|
|
1903
|
+
if (!BigNumber(rightNumberAttempt).eq(BigNumber("0"))) {
|
|
1904
|
+
right = BigNumber(rightNumberAttempt);
|
|
1905
|
+
break;
|
|
1906
|
+
} else {
|
|
1907
|
+
leftNumber = leftNumber.times(multiplier);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
const leftAmountString = AmountUtils.intStr(leftNumber);
|
|
1911
|
+
const rightAmountString = right != null ? right.toFixed(rightCurrencyDigitsAfterDots, BigNumber.ROUND_FLOOR) : null;
|
|
1912
|
+
return `${leftAmountString} ${leftTicker} ~ ${rightAmountString != null ? rightAmountString : "?"} ${rightTicker}`;
|
|
1913
|
+
} catch (e) {
|
|
1914
|
+
// eslint-disable-next-line no-console
|
|
1915
|
+
console.log("composeRateText", e);
|
|
1916
|
+
}
|
|
1917
|
+
return "-";
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* @param numberAsAString {string}
|
|
1922
|
+
* @return {string}
|
|
1923
|
+
*/
|
|
1924
|
+
static removeRedundantRightZerosFromNumberString(numberAsAString) {
|
|
1925
|
+
try {
|
|
1926
|
+
var _right2;
|
|
1927
|
+
const parts = ("" + numberAsAString).split(".");
|
|
1928
|
+
let right = parts[1];
|
|
1929
|
+
while ((_right = right) != null && _right.length && right[right.length - 1] === "0") {
|
|
1930
|
+
var _right;
|
|
1931
|
+
right = right.slice(0, right.length - 1);
|
|
1932
|
+
}
|
|
1933
|
+
return `${parts[0]}${(_right2 = right) != null && _right2.length ? `.${right}` : ""}`;
|
|
1934
|
+
} catch (e) {
|
|
1935
|
+
improveAndRethrow(e, "removeRedundantRightZerosFromNumberString", `Passed: ${numberAsAString}`);
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
AmountUtils.significantDecimalCount = 8;
|
|
1940
|
+
AmountUtils.collapsedDecimalCount = 2;
|
|
1941
|
+
AmountUtils.maxTotalLength = 12;
|
|
1942
|
+
AmountUtils.extraSmallMaxTotalLength = 9;
|
|
1943
|
+
// >=10 breaks transactions list (mobile) and it is hard to avoid this
|
|
1944
|
+
AmountUtils.periods = "..";
|
|
1945
|
+
AmountUtils.defaultFiatParams = {
|
|
1946
|
+
ticker: true,
|
|
1947
|
+
// If true, currency code will be shown
|
|
1948
|
+
enableCurrencySymbols: true,
|
|
1949
|
+
// Enables currency symbols where available. Requires "ticker: true"
|
|
1950
|
+
collapsible: true,
|
|
1951
|
+
// Enables minimization of amounts over 1 million (example: 1.52M)
|
|
1952
|
+
limitTotalLength: true,
|
|
1953
|
+
// Limits the total amount length to maxTotalLength
|
|
1954
|
+
extraSmallLength: false // Limits the total amount length to extraSmallMaxTotalLength
|
|
1955
|
+
};
|
|
1956
|
+
AmountUtils.defaultCryptoParams = {
|
|
1957
|
+
ticker: true,
|
|
1958
|
+
// If true, asset ticker will be shown
|
|
1959
|
+
collapsible: true,
|
|
1960
|
+
// Enables minimization of amounts over 1 million (example: 1.52M)
|
|
1961
|
+
trim: true,
|
|
1962
|
+
// Cuts the right part of the amount if necessary, and adds ".." in the end
|
|
1963
|
+
limitTotalLength: true,
|
|
1964
|
+
// Limits the total amount length to maxTotalLength
|
|
1965
|
+
extraSmallLength: false,
|
|
1966
|
+
// Limits the total amount length to extraSmallMaxTotalLength
|
|
1967
|
+
periods: true // Whether we add periods ("..") as suffix for trimmed numbers
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
class Blockchain {
|
|
1971
|
+
/**
|
|
1972
|
+
* @param name {string} latin printable name of blockchain
|
|
1973
|
+
* @param supportedProtocols {Protocol[]}
|
|
1974
|
+
*/
|
|
1975
|
+
constructor(name, supportedProtocols = []) {
|
|
1976
|
+
this.name = name;
|
|
1977
|
+
this.supportedProtocols = supportedProtocols;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
class Protocol {
|
|
1982
|
+
constructor(protocolName) {
|
|
1983
|
+
this.protocol = protocolName;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* The model for cryptocurrency coins.
|
|
1989
|
+
*
|
|
1990
|
+
* WARNING: this class should not be instantiated directly. Use only predefined singleton Coin (or descendants) instances.
|
|
1991
|
+
*/
|
|
1992
|
+
class Coin {
|
|
1993
|
+
/**
|
|
1994
|
+
* Creates new coin
|
|
1995
|
+
*
|
|
1996
|
+
* @param latinName {string} the coin name in latin symbols like "Bitcoin"
|
|
1997
|
+
* @param ticker {string} the coin symbol/ticker/code like 'BTC'. Always upper case. A unique coin identifier
|
|
1998
|
+
* @param tickerPrintable {string} ticker but in printable format. Useful for tokens based on external blockchains
|
|
1999
|
+
* like ERC20 or TRC20. It is not friendly to display USDTERC20 or BUSDTRC20 - more neat options are just
|
|
2000
|
+
* USDT and BUSD. Note that you should always care about user's understanding of what coin he/she is working
|
|
2001
|
+
* with as printable ticker for USDTERC20 and USDTTRC20 are the same.
|
|
2002
|
+
* @param digitsCountAfterComma {number} count of digits after the comma. E.g. 8 for bitcoin
|
|
2003
|
+
* @param maxValue {number|null} max possible value for cryptocurrency. Null means that the currency has no max possible value
|
|
2004
|
+
* @param atomName {string} name of the coin's atomic value. Like 'satoshi' for bitcoin
|
|
2005
|
+
* @param mainnet {Network} main network for this coin
|
|
2006
|
+
* @param testnet {Network} test network for this coin
|
|
2007
|
+
* @param minConfirmations {number} min confirmations count to treat the coin's transaction confirmed
|
|
2008
|
+
* @param payableEntityStringForFeeRate {string|null} the payable fee entity like byte for bitcoin or gas for ether if present
|
|
2009
|
+
* @param feeOptionsTimeStringsSortedDesc {string[]} array of 4 strings for fee options when sending coins. Should be sorted from the highest time to the smallest
|
|
2010
|
+
* @param feeRatesExpirationTimeMs {number} number of milliseconds to treat the fee rates as expired
|
|
2011
|
+
* @param blockchain {Blockchain} blockchain object
|
|
2012
|
+
* @param [protocol] {Protocol|null} token/coin protocol if relevant
|
|
2013
|
+
* @param [tokenAddress] {string|null} address of contract of this token (if the coin is token)
|
|
2014
|
+
* @param [doesUseLowerCaseAddresses] {boolean} flag to clarify whether we can use lower case addresses to ensure more robust comparisons
|
|
2015
|
+
* @param [doesUseOutputs=false] {boolean} true if this coin uses inputs/outputs concept and false if it uses just balances
|
|
2016
|
+
*/
|
|
2017
|
+
constructor(latinName, ticker, tickerPrintable, digitsCountAfterComma, maxValue, atomName, mainnet, testnet, minConfirmations, payableEntityStringForFeeRate, feeOptionsTimeStringsSortedDesc, feeRatesExpirationTimeMs, blockchain, protocol = null, tokenAddress = null, doesUseLowerCaseAddresses = true, doesUseOutputs = false) {
|
|
2018
|
+
this.latinName = latinName;
|
|
2019
|
+
this.ticker = ticker;
|
|
2020
|
+
this.tickerPrintable = tickerPrintable;
|
|
2021
|
+
this.digits = digitsCountAfterComma;
|
|
2022
|
+
this.maxValue = maxValue;
|
|
2023
|
+
this.atomName = atomName;
|
|
2024
|
+
this.mainnet = mainnet;
|
|
2025
|
+
this.testnet = testnet;
|
|
2026
|
+
this.minConfirmations = minConfirmations;
|
|
2027
|
+
this.payableEntityStringForFeeRate = payableEntityStringForFeeRate;
|
|
2028
|
+
this.feeOptionsTimeStringsSortedDesc = feeOptionsTimeStringsSortedDesc;
|
|
2029
|
+
this.feeRatesExpirationTimeMs = feeRatesExpirationTimeMs;
|
|
2030
|
+
this.protocol = protocol;
|
|
2031
|
+
this.blockchain = blockchain;
|
|
2032
|
+
// TODO: [bug, critical] use testnet property for testnet contract address as it blocks the app work in testnets
|
|
2033
|
+
this.tokenAddress = tokenAddress;
|
|
2034
|
+
this.feeCoin = this;
|
|
2035
|
+
this._significantDigits = 8;
|
|
2036
|
+
this.doesUseLowerCaseAddresses = doesUseLowerCaseAddresses;
|
|
2037
|
+
this.doesUseOutputs = doesUseOutputs;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* Sets fee coin
|
|
2042
|
+
*
|
|
2043
|
+
* @param feeCoin {Coin} some tokens use another coin to charge transaction fee as they work on top of some external
|
|
2044
|
+
* blockchain. So pass here the coin the token uses for fee charging. Like for ERC20 token the fee coin is ETH.
|
|
2045
|
+
* By default, the creating coin will be set as a value for this field.
|
|
2046
|
+
*/
|
|
2047
|
+
setFeeCoin(feeCoin) {
|
|
2048
|
+
this.feeCoin = feeCoin;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Checks whether this coin uses another coin (blockchain) to charge fee for transactions (means works on base of
|
|
2053
|
+
* some external blockchain).
|
|
2054
|
+
*
|
|
2055
|
+
* @return {boolean} true if this coin uses external blockchain to perform transactions and charge fee
|
|
2056
|
+
*/
|
|
2057
|
+
doesUseDifferentCoinFee() {
|
|
2058
|
+
return this.feeCoin !== this;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
/**
|
|
2062
|
+
* Converts the given atoms string/number to string representing the same amount in coin itself - floating point number
|
|
2063
|
+
*
|
|
2064
|
+
* @param atoms {string} atoms positive integer amount
|
|
2065
|
+
* @return {string} coin amount floating point number as a string
|
|
2066
|
+
*/
|
|
2067
|
+
atomsToCoinAmount(atoms) {
|
|
2068
|
+
throw new Error("Not implemented in base Coin");
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Converts the given coins amount string/number to string representing the same amount in coin atoms - integer number
|
|
2073
|
+
*
|
|
2074
|
+
* @param coinsAmount {string} coins positive floating point amount
|
|
2075
|
+
* @return {string} coin atoms amount integer number as a string
|
|
2076
|
+
*/
|
|
2077
|
+
coinAmountToAtoms(coinsAmount) {
|
|
2078
|
+
throw new Error("Not implemented in base Coin");
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
/**
|
|
2082
|
+
* Composes URL to view the tx with given id in the external blockchain explorer
|
|
2083
|
+
*
|
|
2084
|
+
* @param txId {string} id of transaction
|
|
2085
|
+
* @return {string} URL string
|
|
2086
|
+
*/
|
|
2087
|
+
composeUrlToTransactionExplorer(txId) {
|
|
2088
|
+
throw new Error("Not implemented in base Coin");
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/**
|
|
2092
|
+
* Most of the cryptocurrencies has specific fee rate or fee price metric. This value usually has specific measure
|
|
2093
|
+
* like satoshi/byte or gWei/gas. This function adds the described denomination string to the given amount
|
|
2094
|
+
* as a suffix and returns the result string ready to be show to a user.
|
|
2095
|
+
*
|
|
2096
|
+
* @param coinAtomsString {string} coin atoms positive integer amount
|
|
2097
|
+
* @return {string} string of coin amount and fee rate units
|
|
2098
|
+
*/
|
|
2099
|
+
coinAtomsFeeRateToCommonlyUsedAmountFormatWithDenominationString(coinAtomsString) {
|
|
2100
|
+
throw new Error("Not implemented in base Coin");
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Check whether this coin support transaction prioritisation during the sending process.
|
|
2105
|
+
*
|
|
2106
|
+
* @return {boolean} true if support transaction prioritisation and false otherwise
|
|
2107
|
+
*/
|
|
2108
|
+
doesSupportTransactionPrioritisation() {
|
|
2109
|
+
return Array.isArray(this.feeOptionsTimeStringsSortedDesc);
|
|
2110
|
+
}
|
|
2111
|
+
tickerAndProtocol() {
|
|
2112
|
+
try {
|
|
2113
|
+
var _ref;
|
|
2114
|
+
return `${this.tickerPrintable}${this.protocol ? (_ref = " " + this.protocol.protocol) != null ? _ref : "" : ""}`;
|
|
2115
|
+
} catch (e) {
|
|
2116
|
+
improveAndRethrow(e, "tickerAndProtocol");
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* TODO: [tests, critical] Ued by payments logic
|
|
2123
|
+
*
|
|
2124
|
+
* Simple cache based on Map.
|
|
2125
|
+
* Provides ability to store event-dependent data.
|
|
2126
|
+
*/
|
|
2127
|
+
class Cache {
|
|
2128
|
+
/**
|
|
2129
|
+
* @param eventBus {EventBus} EventBus.js lib instance
|
|
2130
|
+
* @param [noSessionEvents=[]] {string[]} array of events that will be treated as "no session"
|
|
2131
|
+
*/
|
|
2132
|
+
constructor(eventBus, noSessionEvents = []) {
|
|
2133
|
+
this._cache = new Map();
|
|
2134
|
+
this._eventDependentDataKeys = [];
|
|
2135
|
+
this._noSessionEvents = noSessionEvents;
|
|
2136
|
+
this._eventBus = eventBus;
|
|
2137
|
+
}
|
|
2138
|
+
_setupIntervalClearingExpired() {
|
|
2139
|
+
let _cleaner = function cleaner() {
|
|
2140
|
+
try {
|
|
2141
|
+
for (const key of this._cache.keys()) {
|
|
2142
|
+
const item = this._cache.get(key);
|
|
2143
|
+
if (item && item.ttlMs && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
2144
|
+
this._cache.delete(key);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
} catch (e) {
|
|
2148
|
+
improveAndRethrow(e, "_intervalClearingExpiredCache");
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
_cleaner = _cleaner.bind(this);
|
|
2152
|
+
setInterval(_cleaner, 1000);
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* Puts data to cache
|
|
2157
|
+
*
|
|
2158
|
+
* @param key {string} string key for this data
|
|
2159
|
+
* @param data {any} any data
|
|
2160
|
+
* @param ttlMs {number|null} optional milliseconds number for cache lifetime
|
|
2161
|
+
* @throws {Error} when the data is null/undefined because these values for data are reserved for internal logic
|
|
2162
|
+
*/
|
|
2163
|
+
put(key, data, ttlMs = null) {
|
|
2164
|
+
try {
|
|
2165
|
+
if (typeof key !== "string" || data == null) {
|
|
2166
|
+
throw new Error(`Trying to cache corrupted data: ${key}, ${data}`);
|
|
2167
|
+
}
|
|
2168
|
+
this._cache.set(key, {
|
|
2169
|
+
data: data,
|
|
2170
|
+
addedMsTimestamp: Date.now(),
|
|
2171
|
+
ttlMs: ttlMs
|
|
2172
|
+
});
|
|
2173
|
+
} catch (e) {
|
|
2174
|
+
improveAndRethrow(e, "cache.put");
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
putSessionDependentData(key, data, ttlMs = null) {
|
|
2178
|
+
this._putEventDependentData(key, data, this._noSessionEvents, ttlMs);
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
/**
|
|
2182
|
+
* Puts data to cache and adds its key to list of keys that should be related by each of given events.
|
|
2183
|
+
*
|
|
2184
|
+
* @param key {string} key for cache
|
|
2185
|
+
* @param data {any} any caching data
|
|
2186
|
+
* @param events {string[]} list of events forcing putting data to be removed when triggered
|
|
2187
|
+
* @param ttlMs {|null} optional time to live for this cache item
|
|
2188
|
+
* @throws {Error} when the data is null/undefined because these values for data are reserved for internal logic
|
|
2189
|
+
*/
|
|
2190
|
+
putEventDependentData(key, data, events, ttlMs = null) {
|
|
2191
|
+
this._putEventDependentData(key, data, events, ttlMs);
|
|
2192
|
+
}
|
|
2193
|
+
_putEventDependentData(key, data, events, ttlMs = null) {
|
|
2194
|
+
try {
|
|
2195
|
+
if (typeof key !== "string" || data == null) {
|
|
2196
|
+
throw new Error(`Trying to cache corrupted data: ${key}, ${data}`);
|
|
2197
|
+
}
|
|
2198
|
+
this._cache.set(key, {
|
|
2199
|
+
data: data,
|
|
2200
|
+
addedMsTimestamp: Date.now(),
|
|
2201
|
+
ttlMs: ttlMs
|
|
2202
|
+
});
|
|
2203
|
+
for (let event of events) {
|
|
2204
|
+
const eventAndKeys = this._eventDependentDataKeys.find(item => item[0] === event);
|
|
2205
|
+
if (eventAndKeys) {
|
|
2206
|
+
eventAndKeys.push(key);
|
|
2207
|
+
} else {
|
|
2208
|
+
this._eventDependentDataKeys.push([event, key]);
|
|
2209
|
+
this._eventBus.addEventListener(event, () => {
|
|
2210
|
+
try {
|
|
2211
|
+
const keys = this._eventDependentDataKeys.find(item => item[0] === event);
|
|
2212
|
+
(keys != null ? keys : [event]).slice(1).forEach(key => this._cache.delete(key));
|
|
2213
|
+
} catch (e) {
|
|
2214
|
+
Logger.logError(e, "cache.removing-for-event", `Event: ${event}`);
|
|
2215
|
+
}
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
} catch (e) {
|
|
2220
|
+
improveAndRethrow(e, "cache.putEventDependentData");
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
// TODO: [feature, low] add clearing of expired data by schedule
|
|
2225
|
+
get(key) {
|
|
2226
|
+
try {
|
|
2227
|
+
const item = this._cache.get(key);
|
|
2228
|
+
if (item) {
|
|
2229
|
+
if (item.addedMsTimestamp && item.ttlMs !== null && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
2230
|
+
this._cache.delete(key);
|
|
2231
|
+
return null;
|
|
2232
|
+
} else {
|
|
2233
|
+
return item.data;
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
return null;
|
|
2237
|
+
} catch (e) {
|
|
2238
|
+
improveAndRethrow(e, "cache.get");
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
getLastUpdateTimestamp(key) {
|
|
2242
|
+
var _this$_cache$get$adde, _this$_cache$get;
|
|
2243
|
+
return (_this$_cache$get$adde = (_this$_cache$get = this._cache.get(key)) == null ? void 0 : _this$_cache$get.addedMsTimestamp) != null ? _this$_cache$get$adde : null;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* Updates the timestamp of the last update for specified key to the provided value.
|
|
2248
|
+
* Can be useful when TTL is controlled outside this class.
|
|
2249
|
+
*
|
|
2250
|
+
* @param key {string}
|
|
2251
|
+
* @param timestamp {number}
|
|
2252
|
+
* @return {boolean}
|
|
2253
|
+
*/
|
|
2254
|
+
setLastUpdateTimestamp(key, timestamp) {
|
|
2255
|
+
try {
|
|
2256
|
+
const item = this._cache.get(key);
|
|
2257
|
+
if (item != null && typeof timestamp === "number") {
|
|
2258
|
+
this._cache.set(key, _extends({}, item, {
|
|
2259
|
+
addedTimestampMs: timestamp
|
|
2260
|
+
}));
|
|
2261
|
+
return true;
|
|
2262
|
+
}
|
|
2263
|
+
return false;
|
|
2264
|
+
} catch (e) {
|
|
2265
|
+
improveAndRethrow("cache.setLastUpdateTimestamp");
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
invalidate(key) {
|
|
2269
|
+
try {
|
|
2270
|
+
this._cache.delete(key);
|
|
2271
|
+
} catch (e) {
|
|
2272
|
+
improveAndRethrow(e, "cache.invalidate");
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
invalidateContaining(keyPart) {
|
|
2276
|
+
if (typeof keyPart !== "string" || keyPart === "") {
|
|
2277
|
+
throw new Error("Trying to invalidate containing wrong key or empty key: " + keyPart);
|
|
2278
|
+
}
|
|
2279
|
+
try {
|
|
2280
|
+
const matchedKeys = Array.from(this._cache.keys()).filter(key => typeof key === "string" && new RegExp(keyPart).test(key));
|
|
2281
|
+
for (let i = 0; i < matchedKeys.length; ++i) {
|
|
2282
|
+
this._cache.delete(matchedKeys[i]);
|
|
2283
|
+
}
|
|
2284
|
+
} catch (e) {
|
|
2285
|
+
improveAndRethrow(e, "invalidateContaining");
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
clear() {
|
|
2289
|
+
this._cache.clear();
|
|
2290
|
+
this._sessionDependentDataKeys = [];
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
/**
|
|
2294
|
+
* Saves given data string to persistent cache.
|
|
2295
|
+
* NOTE: we have no TTL here, implement if needed.
|
|
2296
|
+
*
|
|
2297
|
+
* WARNING: use only when really needed and don't store big data as we use localStorage
|
|
2298
|
+
* under the hood and its capacity is restricted.
|
|
2299
|
+
*
|
|
2300
|
+
* @param uniqueKey {string} the key should be unique
|
|
2301
|
+
* @param data {string} only string data allowed
|
|
2302
|
+
*/
|
|
2303
|
+
putClientPersistentData(uniqueKey, data) {
|
|
2304
|
+
try {
|
|
2305
|
+
if (typeof window !== "undefined") {
|
|
2306
|
+
localStorage.setItem(uniqueKey, data);
|
|
2307
|
+
}
|
|
2308
|
+
} catch (e) {
|
|
2309
|
+
improveAndRethrow(e, "cache.putClientPersistentData");
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
/**
|
|
2314
|
+
* @param uniqueKey {string}
|
|
2315
|
+
* @return {string|null}
|
|
2316
|
+
*/
|
|
2317
|
+
getClientPersistentData(uniqueKey) {
|
|
2318
|
+
try {
|
|
2319
|
+
if (typeof window !== "undefined") {
|
|
2320
|
+
return localStorage.getItem(uniqueKey);
|
|
2321
|
+
}
|
|
2322
|
+
return null;
|
|
2323
|
+
} catch (e) {
|
|
2324
|
+
improveAndRethrow(e, "cache.getClientPersistentData");
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
/**
|
|
2329
|
+
* Only makes effect if the TTL is not null.
|
|
2330
|
+
*
|
|
2331
|
+
* @param key {string}
|
|
2332
|
+
* @param ttlMs {number|null}
|
|
2333
|
+
*/
|
|
2334
|
+
markCacheItemAsExpiredButDontRemove(key, ttlMs = null) {
|
|
2335
|
+
try {
|
|
2336
|
+
const item = this._cache.get(key);
|
|
2337
|
+
const ttlFinalMs = ttlMs != null ? ttlMs : item == null ? void 0 : item.ttlMs;
|
|
2338
|
+
if (item != null && ttlFinalMs) {
|
|
2339
|
+
this._cache.set(key, {
|
|
2340
|
+
data: item.data,
|
|
2341
|
+
addedMsTimestamp: Date.now() - ttlFinalMs - 1,
|
|
2342
|
+
ttlMs: ttlFinalMs
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2345
|
+
} catch (e) {
|
|
2346
|
+
improveAndRethrow(e, "cache.markCacheItemAsExpiredButDontRemove");
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
class EmailsApi {
|
|
2352
|
+
static async sendEmail(subject, body) {
|
|
2353
|
+
try {
|
|
2354
|
+
const url = `${window.location.protocol + "//" + window.location.host}/api/v1/${this.serverEndpointEntity}`;
|
|
2355
|
+
await axios.post(url, {
|
|
2356
|
+
subject,
|
|
2357
|
+
body
|
|
2358
|
+
});
|
|
2359
|
+
} catch (e) {
|
|
2360
|
+
improveAndRethrow(e, "sendEmail", subject + body);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
EmailsApi.serverEndpointEntity = "emails";
|
|
2365
|
+
|
|
2366
|
+
class ExistingSwap {
|
|
2367
|
+
/**
|
|
2368
|
+
* @param swapId {string}
|
|
2369
|
+
* @param status {SwapProvider.SWAP_STATUSES}
|
|
2370
|
+
* @param createdAt {number}
|
|
2371
|
+
* @param expiresAt {number}
|
|
2372
|
+
* @param confirmations {number}
|
|
2373
|
+
* @param rate {string}
|
|
2374
|
+
* @param refundAddress {string}
|
|
2375
|
+
* @param fromCoin {Coin}
|
|
2376
|
+
* @param fromAmount {string}
|
|
2377
|
+
* @param fromTransactionId {string}
|
|
2378
|
+
* @param toCoin {Coin}
|
|
2379
|
+
* @param toAmount {string}
|
|
2380
|
+
* @param toTransactionId {string|null}
|
|
2381
|
+
* @param toAddress {string}
|
|
2382
|
+
* @param partner {string}
|
|
2383
|
+
*/
|
|
2384
|
+
constructor(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress,
|
|
2385
|
+
// TODO: [refactoring, moderate] toAddress is not quite clear. How about recipientAddress? task_id=0815a111c99543b78d374217eadbde4f
|
|
2386
|
+
partner) {
|
|
2387
|
+
this.swapId = swapId;
|
|
2388
|
+
this.status = status;
|
|
2389
|
+
this.createdAt = createdAt;
|
|
2390
|
+
this.expiresAt = expiresAt;
|
|
2391
|
+
this.confirmations = confirmations;
|
|
2392
|
+
this.rate = rate;
|
|
2393
|
+
this.refundAddress = refundAddress;
|
|
2394
|
+
this.payToAddress = payToAddress;
|
|
2395
|
+
this.fromCoin = fromCoin;
|
|
2396
|
+
this.fromTransactionId = fromTransactionId;
|
|
2397
|
+
this.fromAmount = fromAmount;
|
|
2398
|
+
this.fromTransactionLink = fromTransactionLink;
|
|
2399
|
+
this.toCoin = toCoin;
|
|
2400
|
+
this.toTransactionId = toTransactionId;
|
|
2401
|
+
this.toTransactionLink = toTransactionLink;
|
|
2402
|
+
this.toAmount = toAmount;
|
|
2403
|
+
this.toAddress = toAddress;
|
|
2404
|
+
this.partner = partner;
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
class ExistingSwapWithFiatData extends ExistingSwap {
|
|
2409
|
+
/**
|
|
2410
|
+
* @param swapId {string}
|
|
2411
|
+
* @param status {SwapProvider.SWAP_STATUSES}
|
|
2412
|
+
* @param createdAt {number}
|
|
2413
|
+
* @param expiresAt {number}
|
|
2414
|
+
* @param confirmations {number}
|
|
2415
|
+
* @param rate {string}
|
|
2416
|
+
* @param refundAddress {string}
|
|
2417
|
+
* @param fromCoin {Coin}
|
|
2418
|
+
* @param fromAmount {string}
|
|
2419
|
+
* @param fromTransactionId {string}
|
|
2420
|
+
* @param toCoin {Coin}
|
|
2421
|
+
* @param toAmount {string}
|
|
2422
|
+
* @param toTransactionId {string|null}
|
|
2423
|
+
* @param toAddress {string}
|
|
2424
|
+
* @param partner {string}
|
|
2425
|
+
* @param fromAmountFiat {number}
|
|
2426
|
+
* @param toAmountFiat {number}
|
|
2427
|
+
* @param fiatCurrencyCode {string}
|
|
2428
|
+
* @param fiatCurrencyDecimals {number}
|
|
2429
|
+
*/
|
|
2430
|
+
constructor(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
2431
|
+
super(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner);
|
|
2432
|
+
this.fromAmountFiat = fromAmountFiat;
|
|
2433
|
+
this.toAmountFiat = toAmountFiat;
|
|
2434
|
+
this.fiatCurrencyCode = fiatCurrencyCode;
|
|
2435
|
+
this.fiatCurrencyDecimals = fiatCurrencyDecimals;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
/**
|
|
2439
|
+
* @param existingSwap {ExistingSwap}
|
|
2440
|
+
* @param fromAmountFiat {number}
|
|
2441
|
+
* @param toAmountFiat {number}
|
|
2442
|
+
* @param fiatCurrencyCode {string}
|
|
2443
|
+
* @param fiatCurrencyDecimals {number}
|
|
2444
|
+
* @return {ExistingSwapWithFiatData}
|
|
2445
|
+
*/
|
|
2446
|
+
static fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
2447
|
+
return new ExistingSwapWithFiatData(existingSwap.swapId, existingSwap.status, existingSwap.createdAt, existingSwap.expiresAt, existingSwap.confirmations, existingSwap.rate, existingSwap.refundAddress, existingSwap.payToAddress, existingSwap.fromCoin, existingSwap.fromAmount, existingSwap.fromTransactionId, existingSwap.fromTransactionLink, existingSwap.toCoin, existingSwap.toAmount, existingSwap.toTransactionId, existingSwap.toTransactionLink, existingSwap.toAddress, existingSwap.partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
class BaseSwapCreationInfo {
|
|
2452
|
+
/**
|
|
2453
|
+
* @param fromCoin {Coin}
|
|
2454
|
+
* @param toCoin {Coin}
|
|
2455
|
+
* @param fromAmountCoins {string}
|
|
2456
|
+
* @param toAmountCoins {string}
|
|
2457
|
+
* @param rate {string}
|
|
2458
|
+
* @param rawSwapData {Object}
|
|
2459
|
+
* @param min {string}
|
|
2460
|
+
* @param fiatMin {number}
|
|
2461
|
+
* @param max {string}
|
|
2462
|
+
* @param fiatMax {number}
|
|
2463
|
+
* @param durationMinutesRange {string}
|
|
2464
|
+
*/
|
|
2465
|
+
constructor(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
|
|
2466
|
+
this.fromCoin = fromCoin;
|
|
2467
|
+
this.toCoin = toCoin;
|
|
2468
|
+
this.fromAmountCoins = fromAmountCoins;
|
|
2469
|
+
this.toAmountCoins = toAmountCoins;
|
|
2470
|
+
this.rate = rate;
|
|
2471
|
+
this.rawSwapData = rawSwapData;
|
|
2472
|
+
this.min = min;
|
|
2473
|
+
this.fiatMin = fiatMin;
|
|
2474
|
+
this.max = max;
|
|
2475
|
+
this.fiatMax = fiatMax;
|
|
2476
|
+
this.durationMinutesRange = durationMinutesRange;
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
class SwapProvider {
|
|
2481
|
+
/**
|
|
2482
|
+
* @return {Promise<void>}
|
|
2483
|
+
*/
|
|
2484
|
+
async initialize() {
|
|
2485
|
+
throw new Error("Not implemented in base");
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* @return {number} milliseconds TTL
|
|
2490
|
+
*/
|
|
2491
|
+
getSwapCreationInfoTtlMs() {
|
|
2492
|
+
throw new Error("Not implemented in base");
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* Retrieves all deposit currencies supported by this swap provider.
|
|
2497
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2498
|
+
*
|
|
2499
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2500
|
+
*/
|
|
2501
|
+
async getDepositCurrencies() {
|
|
2502
|
+
throw new Error("Not implemented in base");
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
/**
|
|
2506
|
+
* Retrieves all withdrawable currencies supported by this swap provider.
|
|
2507
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2508
|
+
*
|
|
2509
|
+
* @param [exceptCurrency=null] {Coin|null}
|
|
2510
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2511
|
+
*/
|
|
2512
|
+
async getWithdrawalCurrencies(exceptCurrency = null) {
|
|
2513
|
+
throw new Error("Not implemented in base");
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
/**
|
|
2517
|
+
* Retrieves URL for coin icon or fallback if not found.
|
|
2518
|
+
*
|
|
2519
|
+
* @param coin {Coin|string} coin or rabbit-format of coin ticker
|
|
2520
|
+
* @return {string}
|
|
2521
|
+
*/
|
|
2522
|
+
getIconUrl(coin) {
|
|
2523
|
+
throw new Error("Not implemented in base");
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
/**
|
|
2527
|
+
* Retrieves coin to USDT rate.
|
|
2528
|
+
*
|
|
2529
|
+
* @param coin {Coin}
|
|
2530
|
+
* @return {{result: true, rate: string}|{result: false}}
|
|
2531
|
+
*/
|
|
2532
|
+
async getCoinToUSDTRate(coin) {
|
|
2533
|
+
throw new Error("Not implemented in base");
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
/**
|
|
2537
|
+
* Retrieves estimation for swapping giving coins amount.
|
|
2538
|
+
* null min or max signals there is no corresponding limitation. undefined means that the limits were not retrieved.
|
|
2539
|
+
* For fail result on of SwapProvider.NO_SWAPS_REASONS or SwapProvider.COMMON_ERRORS reasons will be returned.
|
|
2540
|
+
*
|
|
2541
|
+
* @param fromCoin {Coin}
|
|
2542
|
+
* @param toCoin {Coin}
|
|
2543
|
+
* @param amountCoins {string}
|
|
2544
|
+
* @param [fromCoinToUsdRate=null] pass if you want to increase the min amount returned
|
|
2545
|
+
* by provider with some fixed "insurance" amount to cover min amount fluctuations.
|
|
2546
|
+
* @return {Promise<({
|
|
2547
|
+
* result: false,
|
|
2548
|
+
* reason: string,
|
|
2549
|
+
* smallestMin: (string|null|undefined),
|
|
2550
|
+
* greatestMax: (string|null|undefined),
|
|
2551
|
+
* }|{
|
|
2552
|
+
* result: true,
|
|
2553
|
+
* min: (string|null),
|
|
2554
|
+
* max: (string|null),
|
|
2555
|
+
* smallestMin: (string|null),
|
|
2556
|
+
* greatestMax: (string|null),
|
|
2557
|
+
* rate: (string|null),
|
|
2558
|
+
* durationMinutesRange: string,
|
|
2559
|
+
* [rawSwapData]: Object
|
|
2560
|
+
* })>}
|
|
2561
|
+
*/
|
|
2562
|
+
async getSwapInfo(fromCoin, toCoin, amountCoins, fromCoinToUsdRate = null) {
|
|
2563
|
+
throw new Error("Not implemented in base");
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
/**
|
|
2567
|
+
* For fail result we return one of SwapProvider.CREATION_FAIL_REASONS or SwapProvider.COMMON_ERRORS.
|
|
2568
|
+
*
|
|
2569
|
+
* @param fromCoin {Coin}
|
|
2570
|
+
* @param toCoin {Coin}
|
|
2571
|
+
* @param amount {string}
|
|
2572
|
+
* @param toAddress {string}
|
|
2573
|
+
* @param refundAddress {string}
|
|
2574
|
+
* @param rawSwapData {Object|null}
|
|
2575
|
+
* @param clientIpAddress {string}
|
|
2576
|
+
* @return {Promise<({
|
|
2577
|
+
* result: true,
|
|
2578
|
+
* swapId: string,
|
|
2579
|
+
* fromCoin: Coin,
|
|
2580
|
+
* fromAmount: string,
|
|
2581
|
+
* fromAddress: string,
|
|
2582
|
+
* toCoin: Coin,
|
|
2583
|
+
* toAmount: string,
|
|
2584
|
+
* toAddress: string,
|
|
2585
|
+
* rate: string
|
|
2586
|
+
* }|{
|
|
2587
|
+
* result: false,
|
|
2588
|
+
* reason: string,
|
|
2589
|
+
* partner: string
|
|
2590
|
+
* })>}
|
|
2591
|
+
*/
|
|
2592
|
+
async createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, rawSwapData = null, clientIpAddress) {
|
|
2593
|
+
throw new Error("Not implemented in base");
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
/**
|
|
2597
|
+
* Retrieves details and status for swaps by given ids.
|
|
2598
|
+
* If some swap is not found by id then there is no item in return list.
|
|
2599
|
+
*
|
|
2600
|
+
* @param swapIds {string[]}
|
|
2601
|
+
* @return {Promise<{result: false, reason: string}|{result:true, swaps: ExistingSwap[]}>}
|
|
2602
|
+
*/
|
|
2603
|
+
async getExistingSwapsDetailsAndStatus(swapIds) {
|
|
2604
|
+
throw new Error("Not implemented in base");
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
/**
|
|
2608
|
+
* @param ticker {string}
|
|
2609
|
+
* @return {Coin|null}
|
|
2610
|
+
*/
|
|
2611
|
+
getCoinByTickerIfPresent(ticker) {
|
|
2612
|
+
throw new Error("Not implemented in base");
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
/**
|
|
2616
|
+
* @param asset {Coin}
|
|
2617
|
+
* @param address {string}
|
|
2618
|
+
* @return {boolean}
|
|
2619
|
+
*/
|
|
2620
|
+
isAddressValidForAsset(asset, address) {
|
|
2621
|
+
throw new Error("Not implemented in base");
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
SwapProvider.COMMON_ERRORS = {
|
|
2625
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded"
|
|
2626
|
+
};
|
|
2627
|
+
SwapProvider.NO_SWAPS_REASONS = {
|
|
2628
|
+
TOO_LOW: "tooLow",
|
|
2629
|
+
TOO_HIGH: "tooHigh",
|
|
2630
|
+
NOT_SUPPORTED: "notSupported"
|
|
2631
|
+
};
|
|
2632
|
+
SwapProvider.CREATION_FAIL_REASONS = {
|
|
2633
|
+
RETRIABLE_FAIL: "retriableFail"
|
|
2634
|
+
};
|
|
2635
|
+
SwapProvider.SWAP_STATUSES = {
|
|
2636
|
+
WAITING_FOR_PAYMENT: "waiting_for_payment",
|
|
2637
|
+
// public +
|
|
2638
|
+
CONFIRMING: "confirming",
|
|
2639
|
+
PAYMENT_RECEIVED: "payment_received",
|
|
2640
|
+
// public +
|
|
2641
|
+
EXCHANGING: "exchanging",
|
|
2642
|
+
// session full // public +
|
|
2643
|
+
COMPLETED: "completed",
|
|
2644
|
+
// session full // public +
|
|
2645
|
+
REFUNDED: "refunded",
|
|
2646
|
+
// session full // public +
|
|
2647
|
+
EXPIRED: "expired",
|
|
2648
|
+
// public +
|
|
2649
|
+
FAILED: "failed" // public +
|
|
2650
|
+
};
|
|
2651
|
+
|
|
2652
|
+
const BANNED_PARTNERS = ["stealthex", "changee", "coincraddle"];
|
|
2653
|
+
const FALLBACK_ICON_URL = "https://rabbit.io/asset-icons/fallback.svg";
|
|
2654
|
+
class SwapspaceSwapProvider extends SwapProvider {
|
|
2655
|
+
constructor(apiKeysProxyUrl, cache, customCoinBuilder = (coin, network) => null, useRestrictedCoinsSet = true) {
|
|
2656
|
+
super();
|
|
2657
|
+
this._supportedCoins = [];
|
|
2658
|
+
this._URL = `${apiKeysProxyUrl}/swapspace`;
|
|
2659
|
+
this._maxRateDigits = 20;
|
|
2660
|
+
this.useRestrictedCoinsSet = useRestrictedCoinsSet;
|
|
2661
|
+
this._customCoinBuilder = customCoinBuilder;
|
|
2662
|
+
this._cache = cache;
|
|
2663
|
+
}
|
|
2664
|
+
getSwapCreationInfoTtlMs() {
|
|
2665
|
+
/* Actually 2 minutes and only relevant for some partners, but we use it
|
|
2666
|
+
* (and even a bit smaller value) for better consistency */
|
|
2667
|
+
return 110000;
|
|
2668
|
+
}
|
|
2669
|
+
async getDepositCurrencies() {
|
|
2670
|
+
const loggerSource = "getDepositCurrencies";
|
|
2671
|
+
try {
|
|
2672
|
+
var _this$_supportedCoins;
|
|
2673
|
+
await this._fetchSupportedCurrenciesIfNeeded();
|
|
2674
|
+
Logger.log(`We have ${(_this$_supportedCoins = this._supportedCoins) == null ? void 0 : _this$_supportedCoins.length} supported coins, getting depositable`, loggerSource);
|
|
2675
|
+
return {
|
|
2676
|
+
result: true,
|
|
2677
|
+
coins: this._supportedCoins.filter(item => item.deposit).map(item => item.coin)
|
|
2678
|
+
};
|
|
2679
|
+
} catch (e) {
|
|
2680
|
+
var _e$response;
|
|
2681
|
+
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 429) {
|
|
2682
|
+
return {
|
|
2683
|
+
result: false,
|
|
2684
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2687
|
+
improveAndRethrow(e, loggerSource);
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
async getWithdrawalCurrencies(exceptCurrency = null) {
|
|
2691
|
+
const loggerSource = "getWithdrawalCurrencies";
|
|
2692
|
+
try {
|
|
2693
|
+
var _this$_supportedCoins2;
|
|
2694
|
+
await this._fetchSupportedCurrenciesIfNeeded();
|
|
2695
|
+
Logger.log(`We have ${(_this$_supportedCoins2 = this._supportedCoins) == null ? void 0 : _this$_supportedCoins2.length} supported coins, getting withdrawable`, loggerSource);
|
|
2696
|
+
return {
|
|
2697
|
+
result: true,
|
|
2698
|
+
coins: this._supportedCoins.filter(item => {
|
|
2699
|
+
var _item$coin;
|
|
2700
|
+
return item.withdrawal && (!exceptCurrency || ((_item$coin = item.coin) == null ? void 0 : _item$coin.ticker) !== (exceptCurrency == null ? void 0 : exceptCurrency.ticker));
|
|
2701
|
+
}).map(item => item.coin)
|
|
2702
|
+
};
|
|
2703
|
+
} catch (e) {
|
|
2704
|
+
var _e$response2;
|
|
2705
|
+
if ((e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status) === 429) {
|
|
2706
|
+
return {
|
|
2707
|
+
result: false,
|
|
2708
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
2709
|
+
};
|
|
2710
|
+
}
|
|
2711
|
+
improveAndRethrow(e, loggerSource);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
async initialize() {
|
|
2715
|
+
await this._fetchSupportedCurrenciesIfNeeded();
|
|
2716
|
+
}
|
|
2717
|
+
getIconUrl(coinOrTicker) {
|
|
2718
|
+
const loggerSource = "getIconUrl";
|
|
2719
|
+
try {
|
|
2720
|
+
var _this$_supportedCoins4, _this$_supportedCoins5;
|
|
2721
|
+
let coin = coinOrTicker;
|
|
2722
|
+
if (!(coinOrTicker instanceof Coin)) {
|
|
2723
|
+
var _this$_supportedCoins3;
|
|
2724
|
+
coin = (_this$_supportedCoins3 = this._supportedCoins.find(i => i.coin.ticker === coinOrTicker)) == null ? void 0 : _this$_supportedCoins3.coin;
|
|
2725
|
+
}
|
|
2726
|
+
return (_this$_supportedCoins4 = (_this$_supportedCoins5 = this._supportedCoins.find(item => {
|
|
2727
|
+
var _item$coin2, _coin;
|
|
2728
|
+
return ((_item$coin2 = item.coin) == null ? void 0 : _item$coin2.ticker) === ((_coin = coin) == null ? void 0 : _coin.ticker);
|
|
2729
|
+
})) == null ? void 0 : _this$_supportedCoins5.iconURL) != null ? _this$_supportedCoins4 : FALLBACK_ICON_URL;
|
|
2730
|
+
} catch (e) {
|
|
2731
|
+
improveAndRethrow(e, loggerSource);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
async _fetchSupportedCurrenciesIfNeeded() {
|
|
2735
|
+
const loggerSource = "_fetchSupportedCurrenciesIfNeeded";
|
|
2736
|
+
try {
|
|
2737
|
+
var _this$_supportedCoins6;
|
|
2738
|
+
if (!((_this$_supportedCoins6 = this._supportedCoins) != null && _this$_supportedCoins6.length)) {
|
|
2739
|
+
var _rawResponse$data, _rawResponse$data2;
|
|
2740
|
+
const rawResponse = await axios.get(`${this._URL}/api/v2/currencies`);
|
|
2741
|
+
Logger.log(`Retrieved ${rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length} currencies`, loggerSource);
|
|
2742
|
+
this._supportedCoins = ((_rawResponse$data2 = rawResponse == null ? void 0 : rawResponse.data) != null ? _rawResponse$data2 : []).map(item => {
|
|
2743
|
+
let coin = this._customCoinBuilder(item.code, item.network);
|
|
2744
|
+
if (!coin && !this.useRestrictedCoinsSet) {
|
|
2745
|
+
/** Building coin object for coin that isn't supported OOB in Rabbit.
|
|
2746
|
+
* We are doing this way to be able to use extended coins set for swaps.
|
|
2747
|
+
* These temporary built coins are only for in-swap use, and we omit some usual
|
|
2748
|
+
* coin details here.
|
|
2749
|
+
* Ideally we should add some new abstractions e.g. BaseCoin:
|
|
2750
|
+
* Coin will extend BaseCoin, SwapCoin will extend BaseCoin etc.
|
|
2751
|
+
* But for now it is reasonable to use this simpler approach.
|
|
2752
|
+
*/
|
|
2753
|
+
const code = item.code.toUpperCase();
|
|
2754
|
+
const network = item.network.toUpperCase();
|
|
2755
|
+
const ticker = `${code}${code === network ? "" : network}`;
|
|
2756
|
+
const defaultDecimalPlacesForCoinNotSupportedOOB = 8;
|
|
2757
|
+
const defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
2758
|
+
coin = new Coin(item.name, ticker, code, defaultDecimalPlacesForCoinNotSupportedOOB, null, "", null, null, defaultMinConfirmationsForCoinNotSupportedOOB, null, [], 60000, null,
|
|
2759
|
+
// We cannot recognize blockchain from swapspace data
|
|
2760
|
+
code !== network ? new Protocol(network) : null,
|
|
2761
|
+
// TODO: [dev] maybe we should recognize standard protocols?
|
|
2762
|
+
item.contractAddress || null, false);
|
|
2763
|
+
}
|
|
2764
|
+
if (coin) {
|
|
2765
|
+
var _item$deposit, _item$withdrawal, _item$validationRegex;
|
|
2766
|
+
return {
|
|
2767
|
+
coin: coin,
|
|
2768
|
+
code: item.code,
|
|
2769
|
+
network: item.network,
|
|
2770
|
+
extraId: item.extraIdName,
|
|
2771
|
+
isPopular: !!(item != null && item.popular),
|
|
2772
|
+
iconURL: item.icon ? `https://storage.swapspace.co${item.icon}` : FALLBACK_ICON_URL,
|
|
2773
|
+
deposit: (_item$deposit = item.deposit) != null ? _item$deposit : false,
|
|
2774
|
+
withdrawal: (_item$withdrawal = item.withdrawal) != null ? _item$withdrawal : false,
|
|
2775
|
+
validationRegexp: (_item$validationRegex = item.validationRegexp) != null ? _item$validationRegex : null
|
|
2776
|
+
};
|
|
2777
|
+
}
|
|
2778
|
+
return [];
|
|
2779
|
+
}).flat();
|
|
2780
|
+
this._putPopularCoinsFirst();
|
|
2781
|
+
}
|
|
2782
|
+
} catch (e) {
|
|
2783
|
+
improveAndRethrow(e, loggerSource);
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
/**
|
|
2788
|
+
* This method sort internal list putting popular (as swapspace thinks) coins to the top.
|
|
2789
|
+
* This is just for users of this API if they don't care about the sorting - we just improve a list a bit this way.
|
|
2790
|
+
* @private
|
|
2791
|
+
*/
|
|
2792
|
+
_putPopularCoinsFirst() {
|
|
2793
|
+
this._supportedCoins.sort((i1, i2) => {
|
|
2794
|
+
if (i1.isPopular && !i2.isPopular) return -1;
|
|
2795
|
+
if (i2.isPopular && !i1.isPopular) return 1;
|
|
2796
|
+
return i1.coin.ticker > i2.coin.ticker ? 1 : i1.coin.ticker < i2.coin.ticker ? -1 : 0;
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2799
|
+
async getCoinToUSDTRate(coin) {
|
|
2800
|
+
const loggerSource = "getCoinToUSDTRate";
|
|
2801
|
+
try {
|
|
2802
|
+
var _this$_supportedCoins7;
|
|
2803
|
+
if (!coin) return null;
|
|
2804
|
+
await this._fetchSupportedCurrenciesIfNeeded();
|
|
2805
|
+
|
|
2806
|
+
// Using USDT TRC20 as usually fee in this network is smaller than ERC20 and this network is widely used for USDT
|
|
2807
|
+
const usdtTrc20 = (_this$_supportedCoins7 = this._supportedCoins.find(i => i.coin.ticker === "USDTTRC20")) == null ? void 0 : _this$_supportedCoins7.coin;
|
|
2808
|
+
if (!usdtTrc20) {
|
|
2809
|
+
return {
|
|
2810
|
+
result: false
|
|
2811
|
+
};
|
|
2812
|
+
}
|
|
2813
|
+
const cached = this._cache.get("swapspace_usdt_rate_" + coin.ticker);
|
|
2814
|
+
if (cached != null) {
|
|
2815
|
+
return {
|
|
2816
|
+
result: true,
|
|
2817
|
+
rate: cached
|
|
2818
|
+
};
|
|
2819
|
+
}
|
|
2820
|
+
Logger.log("Loading USDT->coin rate as not found in cache:", coin == null ? void 0 : coin.ticker);
|
|
2821
|
+
const result = await this.getSwapInfo(usdtTrc20, coin, "5000");
|
|
2822
|
+
if (!result.result) {
|
|
2823
|
+
return {
|
|
2824
|
+
result: false
|
|
2825
|
+
};
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
// This calculation is not precise as we cannot recognize the actual fee and network fee. Just approximate.
|
|
2829
|
+
const standardSwapspaceFeeMultiplier = 1.002; // usually 0.2%
|
|
2830
|
+
const rate = BigNumber(1).div(BigNumber(result.rate).times(standardSwapspaceFeeMultiplier)).toString();
|
|
2831
|
+
this._cache.put("swapspace_usdt_rate_" + coin.ticker, rate, 15 * 60000 // 15 minutes
|
|
2832
|
+
);
|
|
2833
|
+
return {
|
|
2834
|
+
result: true,
|
|
2835
|
+
rate: rate
|
|
2836
|
+
};
|
|
2837
|
+
} catch (e) {
|
|
2838
|
+
improveAndRethrow(e, loggerSource);
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
getCoinByTickerIfPresent(ticker) {
|
|
2842
|
+
try {
|
|
2843
|
+
var _item$coin3;
|
|
2844
|
+
const item = this._supportedCoins.find(i => i.coin.ticker === ticker);
|
|
2845
|
+
return (_item$coin3 = item == null ? void 0 : item.coin) != null ? _item$coin3 : null;
|
|
2846
|
+
} catch (e) {
|
|
2847
|
+
improveAndRethrow(e, "getCoinByTickerIfPresent");
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
async getSwapInfo(fromCoin, toCoin, amountCoins, fromCoinToUsdRate = null) {
|
|
2851
|
+
const loggerSource = "getSwapInfo";
|
|
2852
|
+
try {
|
|
2853
|
+
var _response$data;
|
|
2854
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || BigNumber(amountCoins).lt("0")) {
|
|
2855
|
+
throw new Error(`Wrong input params: ${amountCoins} ${fromCoin.ticker} -> ${toCoin.ticker}` + (fromCoin instanceof Coin) + (toCoin instanceof Coin));
|
|
2856
|
+
}
|
|
2857
|
+
const fromCoinSwapspaceDetails = this._supportedCoins.find(i => {
|
|
2858
|
+
var _i$coin;
|
|
2859
|
+
return ((_i$coin = i.coin) == null ? void 0 : _i$coin.ticker) === (fromCoin == null ? void 0 : fromCoin.ticker);
|
|
2860
|
+
});
|
|
2861
|
+
const toCoinSwapspaceDetails = this._supportedCoins.find(i => {
|
|
2862
|
+
var _i$coin2;
|
|
2863
|
+
return ((_i$coin2 = i.coin) == null ? void 0 : _i$coin2.ticker) === (toCoin == null ? void 0 : toCoin.ticker);
|
|
2864
|
+
});
|
|
2865
|
+
if (!fromCoinSwapspaceDetails || !toCoinSwapspaceDetails) {
|
|
2866
|
+
throw new Error("Failed to find swapspace coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
2867
|
+
}
|
|
2868
|
+
/* Here we use not documented parameter 'estimated=false'. This parameter controls whether we want to use
|
|
2869
|
+
* cached rate values stored in swapspace cache. Their support says they store at most for 30 sec.
|
|
2870
|
+
* But we are better off using the most actual rates.
|
|
2871
|
+
*/
|
|
2872
|
+
const response = await axios.get(`${this._URL}/api/v2/amounts?fromCurrency=${fromCoinSwapspaceDetails.code}&fromNetwork=${fromCoinSwapspaceDetails.network}&toNetwork=${toCoinSwapspaceDetails.network}&toCurrency=${toCoinSwapspaceDetails.code}&amount=${amountCoins}&float=true&estimated=false`);
|
|
2873
|
+
Logger.log(`Retrieved ${response == null || (_response$data = response.data) == null ? void 0 : _response$data.length} options`, loggerSource);
|
|
2874
|
+
const options = Array.isArray(response.data) ? response.data : [];
|
|
2875
|
+
const exchangesSupportingThePair = options.filter(exchange => (exchange == null ? void 0 : exchange.exists) && !BANNED_PARTNERS.find(bannedPartner => bannedPartner === (exchange == null ? void 0 : exchange.partner)) && (exchange == null ? void 0 : exchange.fixed) === false && (exchange.min === 0 || exchange.max === 0 || exchange.max > exchange.min || (typeof exchange.min !== "number" || typeof exchange.max !== "number") && exchange.toAmount > 0));
|
|
2876
|
+
Logger.log(`${exchangesSupportingThePair == null ? void 0 : exchangesSupportingThePair.length} of them have exist=true`, loggerSource);
|
|
2877
|
+
if (!exchangesSupportingThePair.length) {
|
|
2878
|
+
return {
|
|
2879
|
+
result: false,
|
|
2880
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
2881
|
+
};
|
|
2882
|
+
}
|
|
2883
|
+
const availableExchanges = exchangesSupportingThePair.filter(exchange => typeof (exchange == null ? void 0 : exchange.toAmount) === "number" && exchange.toAmount > 0);
|
|
2884
|
+
Logger.log(`Available (having amountTo): ${safeStringify(availableExchanges)}`, loggerSource);
|
|
2885
|
+
// min=0 or max=0 means there is no limit for the partner
|
|
2886
|
+
let smallestMin = null;
|
|
2887
|
+
if (exchangesSupportingThePair.find(ex => BigNumber(ex.min).isZero()) == null) {
|
|
2888
|
+
smallestMin = exchangesSupportingThePair.reduce((prev, cur) => {
|
|
2889
|
+
if (typeof cur.min === "number" && (prev === null || BigNumber(cur.min).lt(prev))) return BigNumber(cur.min);
|
|
2890
|
+
return prev;
|
|
2891
|
+
}, null);
|
|
2892
|
+
}
|
|
2893
|
+
let greatestMax = null;
|
|
2894
|
+
if (exchangesSupportingThePair.find(ex => BigNumber(ex.max).isZero()) == null) {
|
|
2895
|
+
greatestMax = exchangesSupportingThePair.reduce((prev, cur) => {
|
|
2896
|
+
if (typeof cur.max === "number" && (prev === null || BigNumber(cur.max).gt(prev))) return BigNumber(cur.max);
|
|
2897
|
+
return prev;
|
|
2898
|
+
}, null);
|
|
2899
|
+
}
|
|
2900
|
+
let extraCoinsToFitMinMax = "0";
|
|
2901
|
+
if (typeof fromCoinToUsdRate === "string" && BigNumber(fromCoinToUsdRate).gt("0")) {
|
|
2902
|
+
const extraUsdToFitMinMax = BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
2903
|
+
extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
2904
|
+
}
|
|
2905
|
+
if (smallestMin instanceof BigNumber) {
|
|
2906
|
+
smallestMin = AmountUtils.trim(smallestMin.plus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
2907
|
+
}
|
|
2908
|
+
if (greatestMax instanceof BigNumber) {
|
|
2909
|
+
if (greatestMax > extraCoinsToFitMinMax) {
|
|
2910
|
+
greatestMax = AmountUtils.trim(greatestMax.minus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
2911
|
+
} else {
|
|
2912
|
+
greatestMax = "0";
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
if (availableExchanges.length) {
|
|
2916
|
+
var _bestOpt$duration;
|
|
2917
|
+
const sorted = availableExchanges.sort((op1, op2) => op2.toAmount - op1.toAmount);
|
|
2918
|
+
const bestOpt = sorted[0];
|
|
2919
|
+
Logger.log(`Returning first option after sorting: ${safeStringify(bestOpt)}`, loggerSource);
|
|
2920
|
+
let max = null;
|
|
2921
|
+
let min = null;
|
|
2922
|
+
if (extraCoinsToFitMinMax != null) {
|
|
2923
|
+
if (typeof bestOpt.max === "number" && bestOpt.max !== 0) {
|
|
2924
|
+
max = BigNumber(bestOpt.max).minus(extraCoinsToFitMinMax);
|
|
2925
|
+
max = AmountUtils.trim(max.lt(0) ? "0" : max, fromCoin.digits);
|
|
2926
|
+
}
|
|
2927
|
+
if (typeof bestOpt.min === "number" && bestOpt.min !== 0) {
|
|
2928
|
+
min = AmountUtils.trim(BigNumber(bestOpt.min).plus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
const rate = bestOpt.toAmount && bestOpt.fromAmount ? BigNumber(bestOpt.toAmount).div(bestOpt.fromAmount) : null;
|
|
2932
|
+
return {
|
|
2933
|
+
result: true,
|
|
2934
|
+
min: min,
|
|
2935
|
+
max: max,
|
|
2936
|
+
smallestMin: smallestMin,
|
|
2937
|
+
greatestMax: greatestMax,
|
|
2938
|
+
rate: rate != null ? AmountUtils.trim(rate, this._maxRateDigits) : null,
|
|
2939
|
+
durationMinutesRange: (_bestOpt$duration = bestOpt.duration) != null ? _bestOpt$duration : null,
|
|
2940
|
+
rawSwapData: bestOpt
|
|
2941
|
+
};
|
|
2942
|
+
}
|
|
2943
|
+
const result = {
|
|
2944
|
+
result: false,
|
|
2945
|
+
reason: smallestMin && BigNumber(amountCoins).lt(smallestMin) ? SwapProvider.NO_SWAPS_REASONS.TOO_LOW : greatestMax && BigNumber(amountCoins).gt(greatestMax) ? SwapProvider.NO_SWAPS_REASONS.TOO_HIGH : SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
|
|
2946
|
+
smallestMin: smallestMin,
|
|
2947
|
+
greatestMax: greatestMax
|
|
2948
|
+
};
|
|
2949
|
+
Logger.log(`Returning result ${safeStringify(result)}`, loggerSource);
|
|
2950
|
+
return result;
|
|
2951
|
+
} catch (e) {
|
|
2952
|
+
var _e$response3;
|
|
2953
|
+
if ((e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.status) === 429) {
|
|
2954
|
+
return {
|
|
2955
|
+
result: false,
|
|
2956
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
2957
|
+
};
|
|
2958
|
+
}
|
|
2959
|
+
Logger.log(`Internal swapspace/rabbit error when getting swap options ${safeStringify(e)}`, loggerSource);
|
|
2960
|
+
improveAndRethrow(e, loggerSource);
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
async createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, rawSwapData, clientIpAddress) {
|
|
2964
|
+
const loggerSource = "createSwap";
|
|
2965
|
+
const partner = rawSwapData == null ? void 0 : rawSwapData.partner;
|
|
2966
|
+
try {
|
|
2967
|
+
var _this$_supportedCoins8, _this$_supportedCoins9;
|
|
2968
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amount !== "string" || typeof toAddress !== "string" || typeof refundAddress !== "string") {
|
|
2969
|
+
throw new Error(`Invalid input: ${fromCoin} ${toCoin} ${amount} ${toAddress} ${refundAddress}`);
|
|
2970
|
+
}
|
|
2971
|
+
if (typeof partner !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.fromCurrency) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.fromNetwork) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.toCurrency) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.toNetwork) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.id) !== "string" // can be just empty
|
|
2972
|
+
) {
|
|
2973
|
+
throw new Error(`Invalid raw swap data: ${safeStringify(rawSwapData)}`);
|
|
2974
|
+
}
|
|
2975
|
+
await this._fetchSupportedCurrenciesIfNeeded();
|
|
2976
|
+
const toCurrencyExtraId = (_this$_supportedCoins8 = (_this$_supportedCoins9 = this._supportedCoins.find(item => {
|
|
2977
|
+
var _item$coin4;
|
|
2978
|
+
return ((_item$coin4 = item.coin) == null ? void 0 : _item$coin4.ticker) === (toCoin == null ? void 0 : toCoin.ticker);
|
|
2979
|
+
})) == null ? void 0 : _this$_supportedCoins9.extraId) != null ? _this$_supportedCoins8 : "";
|
|
2980
|
+
const requestData = {
|
|
2981
|
+
partner: partner,
|
|
2982
|
+
fromCurrency: rawSwapData == null ? void 0 : rawSwapData.fromCurrency,
|
|
2983
|
+
fromNetwork: rawSwapData == null ? void 0 : rawSwapData.fromNetwork,
|
|
2984
|
+
toCurrency: rawSwapData == null ? void 0 : rawSwapData.toCurrency,
|
|
2985
|
+
toNetwork: rawSwapData == null ? void 0 : rawSwapData.toNetwork,
|
|
2986
|
+
address: toAddress,
|
|
2987
|
+
amount: amount,
|
|
2988
|
+
fixed: false,
|
|
2989
|
+
extraId: toCurrencyExtraId != null ? toCurrencyExtraId : "",
|
|
2990
|
+
rateId: rawSwapData == null ? void 0 : rawSwapData.id,
|
|
2991
|
+
userIp: clientIpAddress,
|
|
2992
|
+
refund: refundAddress
|
|
2993
|
+
};
|
|
2994
|
+
Logger.log(`Sending create request: ${safeStringify(requestData)}`, loggerSource);
|
|
2995
|
+
const response = await axios.post(`${this._URL}/api/v2/exchange`, requestData);
|
|
2996
|
+
const result = response.data;
|
|
2997
|
+
Logger.log(`Creation result ${safeStringify(result)}`, loggerSource);
|
|
2998
|
+
if (result != null && result.id) {
|
|
2999
|
+
var _result$from, _result$from2, _result$to, _result$to2, _result$from4, _result$from5, _result$to4, _result$to5;
|
|
3000
|
+
if (typeof (result == null || (_result$from = result.from) == null ? void 0 : _result$from.amount) !== "number" || typeof (result == null || (_result$from2 = result.from) == null ? void 0 : _result$from2.address) !== "string" || typeof (result == null || (_result$to = result.to) == null ? void 0 : _result$to.amount) !== "number" || typeof (result == null || (_result$to2 = result.to) == null ? void 0 : _result$to2.address) !== "string") throw new Error(`Wrong swap creation result ${result}`);
|
|
3001
|
+
/* We use the returned rate preferably but if the retrieved
|
|
3002
|
+
* rate 0/null/undefined we calculate it manually */
|
|
3003
|
+
let rate = result.rate;
|
|
3004
|
+
if (typeof rate !== "number" || BigNumber(rate).isZero()) {
|
|
3005
|
+
var _result$to3, _result$from3;
|
|
3006
|
+
rate = BigNumber(result == null || (_result$to3 = result.to) == null ? void 0 : _result$to3.amount).div(result == null || (_result$from3 = result.from) == null ? void 0 : _result$from3.amount);
|
|
3007
|
+
} else {
|
|
3008
|
+
rate = BigNumber(rate);
|
|
3009
|
+
}
|
|
3010
|
+
return {
|
|
3011
|
+
result: true,
|
|
3012
|
+
swapId: result == null ? void 0 : result.id,
|
|
3013
|
+
fromCoin: fromCoin,
|
|
3014
|
+
fromAmount: AmountUtils.trim(result == null || (_result$from4 = result.from) == null ? void 0 : _result$from4.amount, fromCoin.digits),
|
|
3015
|
+
fromAddress: result == null || (_result$from5 = result.from) == null ? void 0 : _result$from5.address,
|
|
3016
|
+
toCoin: toCoin,
|
|
3017
|
+
toAmount: AmountUtils.trim(result == null || (_result$to4 = result.to) == null ? void 0 : _result$to4.amount, toCoin.digits),
|
|
3018
|
+
toAddress: result == null || (_result$to5 = result.to) == null ? void 0 : _result$to5.address,
|
|
3019
|
+
rate: AmountUtils.trim(rate, this._maxRateDigits)
|
|
3020
|
+
};
|
|
3021
|
+
}
|
|
3022
|
+
const errorMessage = `Swap creation succeeded but the response is wrong: ${safeStringify(response)}`;
|
|
3023
|
+
Logger.log(errorMessage, loggerSource);
|
|
3024
|
+
throw new Error(errorMessage);
|
|
3025
|
+
} catch (e) {
|
|
3026
|
+
var _e$response4, _e$response5;
|
|
3027
|
+
Logger.logError(e, loggerSource, `Failed to create swap. Error is: ${safeStringify(e)}`);
|
|
3028
|
+
const composeFailResult = reason => ({
|
|
3029
|
+
result: false,
|
|
3030
|
+
reason: reason,
|
|
3031
|
+
partner: partner
|
|
3032
|
+
});
|
|
3033
|
+
const status = e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.status;
|
|
3034
|
+
const data = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.data;
|
|
3035
|
+
if (status === 429) {
|
|
3036
|
+
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
3037
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3038
|
+
}
|
|
3039
|
+
const texts422 = ["Pair cannot be processed by", "Currency not found", "Amount maximum is", "Amount minimum is"];
|
|
3040
|
+
const text403 = "IP address is forbidden";
|
|
3041
|
+
if (typeof data === "string" && (status === 403 && data.includes(text403) || status === 422 && texts422.find(text => data.includes(text)))) {
|
|
3042
|
+
Logger.log(`Returning retriable fail: ${status} - ${data}, ${partner}`, loggerSource);
|
|
3043
|
+
return composeFailResult(SwapProvider.CREATION_FAIL_REASONS.RETRIABLE_FAIL);
|
|
3044
|
+
}
|
|
3045
|
+
Logger.log(`Internal swapspace/rabbit error for ${partner}: ${safeStringify(e)}`, loggerSource);
|
|
3046
|
+
improveAndRethrow(e, loggerSource);
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
_mapSwapspaceStatusToRabbitStatus(status, isExpiredByTime) {
|
|
3050
|
+
switch (status) {
|
|
3051
|
+
case "waiting":
|
|
3052
|
+
if (isExpiredByTime) {
|
|
3053
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
3054
|
+
}
|
|
3055
|
+
return SwapProvider.SWAP_STATUSES.WAITING_FOR_PAYMENT;
|
|
3056
|
+
case "confirming":
|
|
3057
|
+
return SwapProvider.SWAP_STATUSES.CONFIRMING;
|
|
3058
|
+
case "exchanging":
|
|
3059
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
3060
|
+
case "sending":
|
|
3061
|
+
return SwapProvider.SWAP_STATUSES.PAYMENT_RECEIVED;
|
|
3062
|
+
case "finished":
|
|
3063
|
+
return SwapProvider.SWAP_STATUSES.COMPLETED;
|
|
3064
|
+
case "verifying":
|
|
3065
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
3066
|
+
case "refunded":
|
|
3067
|
+
return SwapProvider.SWAP_STATUSES.REFUNDED;
|
|
3068
|
+
case "expired":
|
|
3069
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
3070
|
+
case "failed":
|
|
3071
|
+
return SwapProvider.SWAP_STATUSES.FAILED;
|
|
3072
|
+
default:
|
|
3073
|
+
throw new Error(`Unknown swapspace status: ${status}`);
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
async getExistingSwapsDetailsAndStatus(swapIds) {
|
|
3077
|
+
var _this = this;
|
|
3078
|
+
const loggerSource = "getExistingSwapsDetailsAndStatus";
|
|
3079
|
+
try {
|
|
3080
|
+
if (swapIds.find(id => typeof id !== "string")) {
|
|
3081
|
+
throw new Error("Swap id is not string: " + safeStringify(swapIds));
|
|
3082
|
+
}
|
|
3083
|
+
const getNotFailingOn404 = async function getNotFailingOn404(swapId) {
|
|
3084
|
+
try {
|
|
3085
|
+
return await axios.get(`${_this._URL}/api/v2/exchange/${swapId}`);
|
|
3086
|
+
} catch (error) {
|
|
3087
|
+
var _error$response;
|
|
3088
|
+
if ((error == null || (_error$response = error.response) == null ? void 0 : _error$response.status) === 404) return [];
|
|
3089
|
+
throw error;
|
|
3090
|
+
}
|
|
3091
|
+
};
|
|
3092
|
+
const responses = await Promise.all(swapIds.map(swapId => getNotFailingOn404(swapId)));
|
|
3093
|
+
const wo404 = responses.flat();
|
|
3094
|
+
const swaps = wo404.map(r => r.data).map((swap, index) => {
|
|
3095
|
+
var _this$_supportedCoins10, _this$_supportedCoins11;
|
|
3096
|
+
const fromCoin = (_this$_supportedCoins10 = this._supportedCoins.find(i => i.code === swap.from.code && i.network === swap.from.network)) == null ? void 0 : _this$_supportedCoins10.coin;
|
|
3097
|
+
const toCoin = (_this$_supportedCoins11 = this._supportedCoins.find(i => i.code === swap.to.code && i.network === swap.to.network)) == null ? void 0 : _this$_supportedCoins11.coin;
|
|
3098
|
+
if (!fromCoin || !toCoin) {
|
|
3099
|
+
return []; // We skip swaps with not supported coins for now
|
|
3100
|
+
}
|
|
3101
|
+
const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
|
|
3102
|
+
const expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
|
|
3103
|
+
const isExpiredByTime = expiresAt > Date.now();
|
|
3104
|
+
const status = this._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
3105
|
+
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
3106
|
+
const addressToSendCoinsToSwapspace = swap.from.address;
|
|
3107
|
+
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, this._maxRateDigits), swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, swap.blockExplorerTransactionUrl.to, swap.to.address, swap.partner);
|
|
3108
|
+
}).flat();
|
|
3109
|
+
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
3110
|
+
return {
|
|
3111
|
+
result: true,
|
|
3112
|
+
swaps: swaps
|
|
3113
|
+
};
|
|
3114
|
+
} catch (e) {
|
|
3115
|
+
var _e$response6, _e$response7;
|
|
3116
|
+
Logger.logError(e, loggerSource, `Failed to get swap details. Error is: ${safeStringify(e)}`);
|
|
3117
|
+
const composeFailResult = reason => ({
|
|
3118
|
+
result: false,
|
|
3119
|
+
reason: reason
|
|
3120
|
+
});
|
|
3121
|
+
const status = e == null || (_e$response6 = e.response) == null ? void 0 : _e$response6.status;
|
|
3122
|
+
const data = e == null || (_e$response7 = e.response) == null ? void 0 : _e$response7.data;
|
|
3123
|
+
if (status === 429) {
|
|
3124
|
+
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
3125
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3126
|
+
}
|
|
3127
|
+
improveAndRethrow(e, loggerSource);
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
isAddressValidForAsset(asset, address) {
|
|
3131
|
+
try {
|
|
3132
|
+
const assetData = this._supportedCoins.find(i => {
|
|
3133
|
+
var _i$coin3;
|
|
3134
|
+
return ((_i$coin3 = i.coin) == null ? void 0 : _i$coin3.ticker) === (asset == null ? void 0 : asset.ticker);
|
|
3135
|
+
});
|
|
3136
|
+
if (assetData) {
|
|
3137
|
+
let corrected = assetData.validationRegexp.trim();
|
|
3138
|
+
corrected = corrected[0] === "/" ? corrected.slice(1) : corrected;
|
|
3139
|
+
corrected = corrected[corrected.length - 1] === "/" ? corrected.slice(0, corrected.length - 1) : corrected;
|
|
3140
|
+
return address.match(corrected) != null;
|
|
3141
|
+
}
|
|
3142
|
+
} catch (e) {
|
|
3143
|
+
Logger.logError(e, "isAddressValidForAsset");
|
|
3144
|
+
}
|
|
3145
|
+
return false;
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
class SwapUtils {
|
|
3150
|
+
/**
|
|
3151
|
+
* Retrieves min and max limits for swapping giving currencies.
|
|
3152
|
+
* Returns also conversion rate if possible with predefined amount logic.
|
|
3153
|
+
* Rate is how many "to" coins does 1 "from" coin contain.
|
|
3154
|
+
*
|
|
3155
|
+
* In case of errors returns one of reasons
|
|
3156
|
+
* - SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3157
|
+
* - one of SwapProvider.COMMON_ERRORS.*
|
|
3158
|
+
*
|
|
3159
|
+
* @param swapProvider {SwapProvider}
|
|
3160
|
+
* @param fromCoin {Coin} enabled coin (to swap amount from)
|
|
3161
|
+
* @param toCoin {Coin}
|
|
3162
|
+
* @return {Promise<{
|
|
3163
|
+
* result: true,
|
|
3164
|
+
* min: string,
|
|
3165
|
+
* fiatMin: (number|null),
|
|
3166
|
+
* max: string,
|
|
3167
|
+
* fiatMax: (number|null),
|
|
3168
|
+
* rate: (string|null),
|
|
3169
|
+
* }|{
|
|
3170
|
+
* result: false,
|
|
3171
|
+
* reason: string
|
|
3172
|
+
* }>}
|
|
3173
|
+
*/
|
|
3174
|
+
static async getInitialSwapData(swapProvider, fromCoin, toCoin) {
|
|
3175
|
+
const loggerSource = "getInitialSwapData";
|
|
3176
|
+
try {
|
|
3177
|
+
/* We use some amount here that should fit at least some of the limits of the swap providers.
|
|
3178
|
+
* So we are going to get some rate to be used as the default for the on-flight calculations before we get
|
|
3179
|
+
* the exact rate (that should be retrieved by getSwapCreationInfo method) for a specific amount.
|
|
3180
|
+
*/
|
|
3181
|
+
const defaultAmountUsd = BigNumber("300");
|
|
3182
|
+
const coinUsdRate = await swapProvider.getCoinToUSDTRate(fromCoin);
|
|
3183
|
+
const coinAmountForDefaultUsdAmount = AmountUtils.trim(coinUsdRate.result ? defaultAmountUsd.div(coinUsdRate == null ? void 0 : coinUsdRate.rate) : defaultAmountUsd, fromCoin.digits);
|
|
3184
|
+
Logger.log(`Init: ${coinAmountForDefaultUsdAmount} ${fromCoin.ticker}->${toCoin.ticker}`, loggerSource);
|
|
3185
|
+
const details = await swapProvider.getSwapInfo(fromCoin, toCoin, coinAmountForDefaultUsdAmount);
|
|
3186
|
+
if (!details) {
|
|
3187
|
+
throw new Error("The details are empty: " + safeStringify(details));
|
|
3188
|
+
}
|
|
3189
|
+
if (!details.result) {
|
|
3190
|
+
Logger.log(`Failed with reason: ${details.reason}. ${fromCoin.ticker}->${toCoin.ticker}`, loggerSource);
|
|
3191
|
+
if ((details == null ? void 0 : details.reason) === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED || (details == null ? void 0 : details.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3192
|
+
return {
|
|
3193
|
+
result: false,
|
|
3194
|
+
reason: details.reason
|
|
3195
|
+
};
|
|
3196
|
+
} else {
|
|
3197
|
+
throw new Error("Unhandled error case: " + (details == null ? void 0 : details.reason));
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
let fiatMin = null;
|
|
3201
|
+
let fiatMax = null;
|
|
3202
|
+
if ((coinUsdRate == null ? void 0 : coinUsdRate.rate) != null) {
|
|
3203
|
+
const usdDecimals = FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
3204
|
+
fiatMin = BigNumber(details == null ? void 0 : details.smallestMin).times(coinUsdRate.rate).toFixed(usdDecimals);
|
|
3205
|
+
fiatMax = BigNumber(details == null ? void 0 : details.greatestMax).times(coinUsdRate.rate).toFixed(usdDecimals);
|
|
3206
|
+
}
|
|
3207
|
+
const result = {
|
|
3208
|
+
result: true,
|
|
3209
|
+
min: details == null ? void 0 : details.smallestMin,
|
|
3210
|
+
fiatMin: fiatMin,
|
|
3211
|
+
max: details == null ? void 0 : details.greatestMax,
|
|
3212
|
+
fiatMax: fiatMax,
|
|
3213
|
+
rate: AmountUtils.trim(details.rate, 30)
|
|
3214
|
+
};
|
|
3215
|
+
Logger.log(`Returning: ${safeStringify(result)}`, loggerSource);
|
|
3216
|
+
return result;
|
|
3217
|
+
} catch (e) {
|
|
3218
|
+
Logger.logError(e, loggerSource, `Failed to init swap: ${safeStringify(e)}`);
|
|
3219
|
+
improveAndRethrow(e, loggerSource);
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
static safeHandleRequestsLimitExceeding() {
|
|
3223
|
+
(async function () {
|
|
3224
|
+
try {
|
|
3225
|
+
await EmailsApi.sendEmail("AUTOMATIC EMAIL - SWAPSPACE REQUESTS LIMIT EXCEEDED", "Requests limit exceeded. Urgently ask swaps provider support for limit increasing");
|
|
3226
|
+
} catch (e) {
|
|
3227
|
+
Logger.log(`Failed to handle limit exceeding ${safeStringify(e)}`, "_safeHandleRequestsLimitExceeding");
|
|
3228
|
+
}
|
|
3229
|
+
})();
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
/**
|
|
3233
|
+
* If some swap is not found by id then there is no item in return list.
|
|
3234
|
+
*
|
|
3235
|
+
* @param swapProvider {SwapProvider}
|
|
3236
|
+
* @param swapIds {string[]}
|
|
3237
|
+
* @return {Promise<{
|
|
3238
|
+
* result: true,
|
|
3239
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
3240
|
+
* }|{
|
|
3241
|
+
* result: false,
|
|
3242
|
+
* reason: string
|
|
3243
|
+
* }>}
|
|
3244
|
+
*/
|
|
3245
|
+
static async getExistingSwapsDetailsWithFiatAmounts(swapProvider, swapIds) {
|
|
3246
|
+
try {
|
|
3247
|
+
const result = await swapProvider.getExistingSwapsDetailsAndStatus(swapIds);
|
|
3248
|
+
if (result.result) {
|
|
3249
|
+
const extendedSwaps = [];
|
|
3250
|
+
for (let swap of result.swaps) {
|
|
3251
|
+
if (swap.status === SwapProvider.SWAP_STATUSES.REFUNDED) {
|
|
3252
|
+
const rate = await swapProvider.getCoinToUSDTRate(swap.fromCoin);
|
|
3253
|
+
extendedSwaps.push(ExistingSwapWithFiatData.fromExistingSwap(swap, (rate == null ? void 0 : rate.rate) != null ? BigNumber(swap.fromAmount).times(rate.rate).toNumber() : null, (rate == null ? void 0 : rate.rate) != null ? BigNumber(swap.toAmount).times(rate.rate).toNumber() : null, "USD", FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")));
|
|
3254
|
+
} else {
|
|
3255
|
+
const [fromCoinFiatRate, toConFiatRate] = await Promise.all([swapProvider.getCoinToUSDTRate(swap.fromCoin), swapProvider.getCoinToUSDTRate(swap.toCoin)]);
|
|
3256
|
+
extendedSwaps.push(ExistingSwapWithFiatData.fromExistingSwap(swap, (fromCoinFiatRate == null ? void 0 : fromCoinFiatRate.rate) != null ? BigNumber(swap.fromAmount).times(fromCoinFiatRate.rate).toNumber() : null, (toConFiatRate == null ? void 0 : toConFiatRate.rate) != null ? BigNumber(swap.toAmount).times(toConFiatRate.rate).toNumber() : null, "USD", FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")));
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
result.swaps = extendedSwaps;
|
|
3260
|
+
}
|
|
3261
|
+
return result;
|
|
3262
|
+
} catch (e) {
|
|
3263
|
+
improveAndRethrow(e, "getExistingSwapsDetailsWithFiatAmounts");
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
|
|
3268
|
+
class PublicSwapService {
|
|
3269
|
+
constructor(API_KEYS_PROXY_URL, cache) {
|
|
3270
|
+
this._swapProvider = new SwapspaceSwapProvider(API_KEYS_PROXY_URL, cache, () => null, false);
|
|
3271
|
+
}
|
|
3272
|
+
async initialize() {
|
|
3273
|
+
try {
|
|
3274
|
+
await this._swapProvider.initialize();
|
|
3275
|
+
} catch (e) {
|
|
3276
|
+
Logger.logError(e, "PublicSwapService.initialize");
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
async getDepositCurrenciesListForPublicSwap() {
|
|
3280
|
+
try {
|
|
3281
|
+
return await this._getCurrenciesListForPublicSwap(false);
|
|
3282
|
+
} catch (e) {
|
|
3283
|
+
improveAndRethrow(e, "getDepositCurrenciesListForPublicSwap");
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
async getWithdrawCurrenciesListForPublicSwap() {
|
|
3287
|
+
try {
|
|
3288
|
+
return await this._getCurrenciesListForPublicSwap(true);
|
|
3289
|
+
} catch (e) {
|
|
3290
|
+
improveAndRethrow(e, "getWithdrawCurrenciesListForPublicSwap");
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
async _getCurrenciesListForPublicSwap(withdraw = false) {
|
|
3294
|
+
const loggerSource = "getCurrenciesListForPublicSwap";
|
|
3295
|
+
try {
|
|
3296
|
+
var _result$coins;
|
|
3297
|
+
const result = withdraw ? await this._swapProvider.getWithdrawalCurrencies() : await this._swapProvider.getDepositCurrencies();
|
|
3298
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3299
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3300
|
+
return {
|
|
3301
|
+
result: false,
|
|
3302
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3303
|
+
};
|
|
3304
|
+
}
|
|
3305
|
+
Logger.log(`Retrieved ${result == null || (_result$coins = result.coins) == null ? void 0 : _result$coins.length} supported currencies for swap`, loggerSource);
|
|
3306
|
+
if (result.coins.length > 1) {
|
|
3307
|
+
let temp = result.coins[0];
|
|
3308
|
+
result.coins[0] = result.coins[1];
|
|
3309
|
+
result.coins[1] = temp;
|
|
3310
|
+
}
|
|
3311
|
+
return {
|
|
3312
|
+
result: true,
|
|
3313
|
+
coins: result.coins
|
|
3314
|
+
};
|
|
3315
|
+
} catch (e) {
|
|
3316
|
+
improveAndRethrow(e, loggerSource);
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* Retrieves initial data for swapping two coins.
|
|
3322
|
+
*
|
|
3323
|
+
* @param fromCoin {Coin}
|
|
3324
|
+
* @param toCoin {Coin}
|
|
3325
|
+
* @return {Promise<{
|
|
3326
|
+
* result: true,
|
|
3327
|
+
* min: string,
|
|
3328
|
+
* fiatMin: (number|null),
|
|
3329
|
+
* max: string,
|
|
3330
|
+
* fiatMax: (number|null),
|
|
3331
|
+
* rate: (string|null)
|
|
3332
|
+
* }|{
|
|
3333
|
+
* result: false,
|
|
3334
|
+
* reason: string
|
|
3335
|
+
* }>}
|
|
3336
|
+
*/
|
|
3337
|
+
async getInitialPublicSwapData(fromCoin, toCoin) {
|
|
3338
|
+
try {
|
|
3339
|
+
const result = await SwapUtils.getInitialSwapData(this._swapProvider, fromCoin, toCoin);
|
|
3340
|
+
if (!result.result) {
|
|
3341
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3342
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3343
|
+
return {
|
|
3344
|
+
result: false,
|
|
3345
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3346
|
+
};
|
|
3347
|
+
}
|
|
3348
|
+
if (result.reason === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED) {
|
|
3349
|
+
return {
|
|
3350
|
+
result: false,
|
|
3351
|
+
reason: PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.PAIR_NOT_SUPPORTED
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
return result;
|
|
3356
|
+
} catch (e) {
|
|
3357
|
+
improveAndRethrow(e, "getInitialPublicSwapData");
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
/**
|
|
3362
|
+
* Retrieves swap details that can be used to create swap.
|
|
3363
|
+
*
|
|
3364
|
+
* @param fromCoin {Coin}
|
|
3365
|
+
* @param toCoin {Coin}
|
|
3366
|
+
* @param fromAmountCoins {string}
|
|
3367
|
+
* @return {Promise<{
|
|
3368
|
+
* result: false,
|
|
3369
|
+
* reason: string,
|
|
3370
|
+
* min: (string|null),
|
|
3371
|
+
* max: (string|null),
|
|
3372
|
+
* rate: (string|undefined),
|
|
3373
|
+
* fiatMin: (number|null),
|
|
3374
|
+
* fiatMax: (number|null)
|
|
3375
|
+
* }|{
|
|
3376
|
+
* result: true,
|
|
3377
|
+
* swapCreationInfo: BaseSwapCreationInfo
|
|
3378
|
+
* }>}
|
|
3379
|
+
*/
|
|
3380
|
+
async getPublicSwapDetails(fromCoin, toCoin, fromAmountCoins) {
|
|
3381
|
+
const loggerSource = "getPublicSwapDetails";
|
|
3382
|
+
try {
|
|
3383
|
+
var _await$this$_swapProv, _await$this$_swapProv2, _result$swapCreationI, _result$swapCreationI2;
|
|
3384
|
+
const coinUsdtRate = (_await$this$_swapProv = (_await$this$_swapProv2 = await this._swapProvider.getCoinToUSDTRate(fromCoin)) == null ? void 0 : _await$this$_swapProv2.rate) != null ? _await$this$_swapProv : null;
|
|
3385
|
+
const details = await this._swapProvider.getSwapInfo(fromCoin, toCoin, fromAmountCoins, coinUsdtRate);
|
|
3386
|
+
const min = details.result ? details.min : details.smallestMin;
|
|
3387
|
+
const max = details.result ? details.max : details.greatestMax;
|
|
3388
|
+
let fiatMin = null,
|
|
3389
|
+
fiatMax = null;
|
|
3390
|
+
if (coinUsdtRate != null) {
|
|
3391
|
+
if (min != null) {
|
|
3392
|
+
fiatMin = BigNumber(min).times(coinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
3393
|
+
}
|
|
3394
|
+
if (max != null) {
|
|
3395
|
+
fiatMax = BigNumber(max).times(coinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
const composeFailResult = reason => {
|
|
3399
|
+
var _details$rate;
|
|
3400
|
+
return {
|
|
3401
|
+
result: false,
|
|
3402
|
+
reason: reason,
|
|
3403
|
+
min: min != null ? min : null,
|
|
3404
|
+
fiatMin: fiatMin,
|
|
3405
|
+
max: max != null ? max : null,
|
|
3406
|
+
fiatMax: fiatMax,
|
|
3407
|
+
rate: (_details$rate = details.rate) != null ? _details$rate : null
|
|
3408
|
+
};
|
|
3409
|
+
};
|
|
3410
|
+
if (!details.result) {
|
|
3411
|
+
if ((details == null ? void 0 : details.reason) === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED) return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.PAIR_NOT_SUPPORTED);else if ((details == null ? void 0 : details.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3412
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3413
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
const fromAmountBigNumber = BigNumber(fromAmountCoins);
|
|
3417
|
+
if (typeof min === "string" && fromAmountBigNumber.lt(min)) {
|
|
3418
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
|
|
3419
|
+
} else if (typeof max === "string" && fromAmountBigNumber.gt(max)) {
|
|
3420
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
|
|
3421
|
+
}
|
|
3422
|
+
const toAmountCoins = AmountUtils.trim(fromAmountBigNumber.times(details.rate), fromCoin.digits);
|
|
3423
|
+
const result = {
|
|
3424
|
+
result: true,
|
|
3425
|
+
swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange)
|
|
3426
|
+
};
|
|
3427
|
+
Logger.log(`Result: ${safeStringify({
|
|
3428
|
+
result: result.result,
|
|
3429
|
+
swapCreationInfo: _extends({}, result.swapCreationInfo, {
|
|
3430
|
+
fromCoin: result == null || (_result$swapCreationI = result.swapCreationInfo) == null || (_result$swapCreationI = _result$swapCreationI.fromCoin) == null ? void 0 : _result$swapCreationI.ticker,
|
|
3431
|
+
toCoin: result == null || (_result$swapCreationI2 = result.swapCreationInfo) == null || (_result$swapCreationI2 = _result$swapCreationI2.toCoin) == null ? void 0 : _result$swapCreationI2.ticker
|
|
3432
|
+
})
|
|
3433
|
+
})}`, loggerSource);
|
|
3434
|
+
return result;
|
|
3435
|
+
} catch (e) {
|
|
3436
|
+
improveAndRethrow(e, loggerSource);
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
/**
|
|
3441
|
+
* Creates swap by given params.
|
|
3442
|
+
*
|
|
3443
|
+
* @param fromCoin {Coin}
|
|
3444
|
+
* @param toCoin {Coin}
|
|
3445
|
+
* @param fromAmount {string}
|
|
3446
|
+
* @param swapCreationInfo {BaseSwapCreationInfo}
|
|
3447
|
+
* @param toAddress {string}
|
|
3448
|
+
* @param refundAddress {string}
|
|
3449
|
+
* @param clientIp {string}
|
|
3450
|
+
* @return {Promise<{
|
|
3451
|
+
* result: true,
|
|
3452
|
+
* fiatCurrencyCode: string,
|
|
3453
|
+
* toCoin: Coin,
|
|
3454
|
+
* fromAmountFiat: (number|null),
|
|
3455
|
+
* address: string,
|
|
3456
|
+
* durationMinutesRange: string,
|
|
3457
|
+
* fromAmount: string,
|
|
3458
|
+
* toAmount: string,
|
|
3459
|
+
* toAmountFiat: (number|null),
|
|
3460
|
+
* fiatCurrencyDecimals: number,
|
|
3461
|
+
* fromCoin: Coin,
|
|
3462
|
+
* rate: string,
|
|
3463
|
+
* swapId: string
|
|
3464
|
+
* }|{
|
|
3465
|
+
* result: false,
|
|
3466
|
+
* reason: string
|
|
3467
|
+
* }>}
|
|
3468
|
+
*/
|
|
3469
|
+
async createPublicSwap(fromCoin, toCoin, fromAmount, swapCreationInfo, toAddress, refundAddress, clientIp) {
|
|
3470
|
+
const loggerSource = "createPublicSwap";
|
|
3471
|
+
try {
|
|
3472
|
+
var _swapCreationInfo$fro, _swapCreationInfo$toC;
|
|
3473
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof fromAmount !== "string" || typeof toAddress !== "string" || typeof refundAddress !== "string" || !(swapCreationInfo instanceof BaseSwapCreationInfo)) {
|
|
3474
|
+
throw new Error(`Wrong input: ${fromCoin.ticker} ${toCoin.ticker} ${fromAmount} ${swapCreationInfo}`);
|
|
3475
|
+
}
|
|
3476
|
+
Logger.log(`Start: ${fromAmount} ${fromCoin.ticker} -> ${toCoin.ticker}. Details: ${safeStringify(_extends({}, swapCreationInfo, {
|
|
3477
|
+
fromCoin: swapCreationInfo == null || (_swapCreationInfo$fro = swapCreationInfo.fromCoin) == null ? void 0 : _swapCreationInfo$fro.ticker,
|
|
3478
|
+
toCoin: swapCreationInfo == null || (_swapCreationInfo$toC = swapCreationInfo.toCoin) == null ? void 0 : _swapCreationInfo$toC.ticker
|
|
3479
|
+
}))}`, loggerSource);
|
|
3480
|
+
const result = await this._swapProvider.createSwap(fromCoin, toCoin, fromAmount, toAddress, refundAddress, swapCreationInfo.rawSwapData, clientIp);
|
|
3481
|
+
Logger.log(`Created:${safeStringify(_extends({}, result, {
|
|
3482
|
+
fromCoin: fromCoin == null ? void 0 : fromCoin.ticker,
|
|
3483
|
+
toCoin: toCoin == null ? void 0 : toCoin.ticker
|
|
3484
|
+
}))}`, loggerSource);
|
|
3485
|
+
if (!(result != null && result.result)) {
|
|
3486
|
+
if ((result == null ? void 0 : result.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3487
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3488
|
+
return {
|
|
3489
|
+
result: false,
|
|
3490
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3491
|
+
};
|
|
3492
|
+
}
|
|
3493
|
+
if ((result == null ? void 0 : result.reason) === SwapProvider.CREATION_FAIL_REASONS.RETRIABLE_FAIL) {
|
|
3494
|
+
// TODO: [feature, high] implement retrying if one partner fail and we have another partners task_id=a07e367e488f4a4899613ac9056fa359
|
|
3495
|
+
// return {
|
|
3496
|
+
// result: false,
|
|
3497
|
+
// reason: PublicSwapService.SWAP_CREATION_FAIL_REASONS.RETRIABLE_FAIL,
|
|
3498
|
+
// };
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
if (result.result && result != null && result.swapId) {
|
|
3502
|
+
let fromAmountFiat = null,
|
|
3503
|
+
toAmountFiat = null;
|
|
3504
|
+
try {
|
|
3505
|
+
var _await$this$_swapProv3, _await$this$_swapProv4, _await$this$_swapProv5, _await$this$_swapProv6;
|
|
3506
|
+
const fromCoinUsdtRate = (_await$this$_swapProv3 = (_await$this$_swapProv4 = await this._swapProvider.getCoinToUSDTRate(fromCoin)) == null ? void 0 : _await$this$_swapProv4.rate) != null ? _await$this$_swapProv3 : null;
|
|
3507
|
+
const toCoinUsdtRate = (_await$this$_swapProv5 = (_await$this$_swapProv6 = await this._swapProvider.getCoinToUSDTRate(fromCoin)) == null ? void 0 : _await$this$_swapProv6.rate) != null ? _await$this$_swapProv5 : null;
|
|
3508
|
+
if (fromCoinUsdtRate != null && result.fromAmount != null) {
|
|
3509
|
+
fromAmountFiat = BigNumber(result.fromAmount).times(fromCoinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
3510
|
+
}
|
|
3511
|
+
if (toCoinUsdtRate != null && result.toAmount != null) {
|
|
3512
|
+
toAmountFiat = BigNumber(result.toAmount).times(toCoinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
3513
|
+
}
|
|
3514
|
+
} catch (e) {
|
|
3515
|
+
Logger.logError(e, loggerSource, "Failed to calculate fiat amounts for result");
|
|
3516
|
+
}
|
|
3517
|
+
EventBusInstance.dispatch(PublicSwapService.PUBLIC_SWAP_CREATED_EVENT, null, fromCoin.ticker, toCoin.ticker, fromAmountFiat);
|
|
3518
|
+
const toReturn = {
|
|
3519
|
+
result: true,
|
|
3520
|
+
swapId: result.swapId,
|
|
3521
|
+
fromCoin: fromCoin,
|
|
3522
|
+
toCoin: toCoin,
|
|
3523
|
+
fromAmount: result.fromAmount,
|
|
3524
|
+
toAmount: result.toAmount,
|
|
3525
|
+
fromAmountFiat: fromAmountFiat,
|
|
3526
|
+
toAmountFiat: toAmountFiat,
|
|
3527
|
+
fiatCurrencyCode: "USD",
|
|
3528
|
+
fiatCurrencyDecimals: PublicSwapService._fiatDecimalsCount,
|
|
3529
|
+
rate: result.rate,
|
|
3530
|
+
durationMinutesRange: swapCreationInfo.durationMinutesRange,
|
|
3531
|
+
address: result.fromAddress // CRITICAL: this is the address to send coins to swaps provider
|
|
3532
|
+
};
|
|
3533
|
+
this._savePublicSwapIdLocally(result.swapId);
|
|
3534
|
+
Logger.log(`Returning: ${safeStringify(_extends({}, toReturn, {
|
|
3535
|
+
fromCoin: fromCoin == null ? void 0 : fromCoin.ticker,
|
|
3536
|
+
toCoin: toCoin == null ? void 0 : toCoin.ticker
|
|
3537
|
+
}))}`, loggerSource);
|
|
3538
|
+
return toReturn;
|
|
3539
|
+
}
|
|
3540
|
+
throw new Error(`Unexpected result from provider ${safeStringify(result)}`);
|
|
3541
|
+
} catch (e) {
|
|
3542
|
+
improveAndRethrow(e, loggerSource);
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
/**
|
|
3547
|
+
* Retrieves swap details and status for existing swaps by their ids.
|
|
3548
|
+
*
|
|
3549
|
+
* @param swapIds {string[]}
|
|
3550
|
+
* @return {Promise<{
|
|
3551
|
+
* result: true,
|
|
3552
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
3553
|
+
* }|{
|
|
3554
|
+
* result: false,
|
|
3555
|
+
* reason: string
|
|
3556
|
+
* }>}
|
|
3557
|
+
* error reason is one of PUBLIC_SWAPS_COMMON_ERRORS
|
|
3558
|
+
*/
|
|
3559
|
+
async getPublicExistingSwapDetailsAndStatus(swapIds) {
|
|
3560
|
+
const loggerSource = "getPublicExistingSwapDetailsAndStatus";
|
|
3561
|
+
try {
|
|
3562
|
+
const result = await SwapUtils.getExistingSwapsDetailsWithFiatAmounts(this._swapProvider, swapIds);
|
|
3563
|
+
if (!(result != null && result.result)) {
|
|
3564
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3565
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3566
|
+
return {
|
|
3567
|
+
result: false,
|
|
3568
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3569
|
+
};
|
|
3570
|
+
}
|
|
3571
|
+
throw new Error("Unknown reason: " + (result == null ? void 0 : result.reason));
|
|
3572
|
+
}
|
|
3573
|
+
return result;
|
|
3574
|
+
} catch (e) {
|
|
3575
|
+
improveAndRethrow(e, loggerSource);
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
/**
|
|
3580
|
+
* Retrieves the whole available swaps history by ids saved locally.
|
|
3581
|
+
*
|
|
3582
|
+
* @return {Promise<{
|
|
3583
|
+
* result: true,
|
|
3584
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
3585
|
+
* }|{
|
|
3586
|
+
* result: false,
|
|
3587
|
+
* reason: string
|
|
3588
|
+
* }>}
|
|
3589
|
+
*/
|
|
3590
|
+
async getPublicSwapsHistory() {
|
|
3591
|
+
try {
|
|
3592
|
+
const swapIds = this._getPublicSwapIdsSavedLocally();
|
|
3593
|
+
if (swapIds.length) {
|
|
3594
|
+
return await this.getPublicExistingSwapDetailsAndStatus(swapIds);
|
|
3595
|
+
}
|
|
3596
|
+
return {
|
|
3597
|
+
result: true,
|
|
3598
|
+
swaps: []
|
|
3599
|
+
};
|
|
3600
|
+
} catch (e) {
|
|
3601
|
+
improveAndRethrow(e, "getPublicSwapsHistory");
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
|
|
3605
|
+
/**
|
|
3606
|
+
* @param swapId {string}
|
|
3607
|
+
* @private
|
|
3608
|
+
*/
|
|
3609
|
+
_savePublicSwapIdLocally(swapId) {
|
|
3610
|
+
if (typeof window !== "undefined") {
|
|
3611
|
+
try {
|
|
3612
|
+
const saved = localStorage.getItem("publicSwapIds");
|
|
3613
|
+
const ids = typeof saved === "string" && saved.length > 0 ? saved.split(",") : [];
|
|
3614
|
+
ids.push(swapId);
|
|
3615
|
+
localStorage.setItem("publicSwapIds", ids.join(","));
|
|
3616
|
+
} catch (e) {
|
|
3617
|
+
improveAndRethrow(e, "_savePublicSwapIdLocally");
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
/**
|
|
3623
|
+
* @private
|
|
3624
|
+
* @return {string[]}
|
|
3625
|
+
*/
|
|
3626
|
+
_getPublicSwapIdsSavedLocally() {
|
|
3627
|
+
if (typeof window !== "undefined") {
|
|
3628
|
+
try {
|
|
3629
|
+
const saved = localStorage.getItem("publicSwapIds");
|
|
3630
|
+
return typeof saved === "string" && saved.length > 0 ? saved.split(",") : [];
|
|
3631
|
+
} catch (e) {
|
|
3632
|
+
improveAndRethrow(e, "_getPublicSwapIdsSavedLocally");
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
/**
|
|
3638
|
+
* @param coinOrTicker {Coin|string}
|
|
3639
|
+
* @return {string} icon URL (ready to use)
|
|
3640
|
+
*/
|
|
3641
|
+
getAssetIconUrl(coinOrTicker) {
|
|
3642
|
+
return this._swapProvider.getIconUrl(coinOrTicker);
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
/**
|
|
3646
|
+
* @param ticker {string}
|
|
3647
|
+
* @return {Coin|null}
|
|
3648
|
+
*/
|
|
3649
|
+
getCoinByTickerIfPresent(ticker) {
|
|
3650
|
+
return this._swapProvider.getCoinByTickerIfPresent(ticker);
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
/**
|
|
3654
|
+
* TODO: [feature, moderate] add other fiat currencies support. task_id=5490e21b8b9c4f89a2247b28db3c9e0a
|
|
3655
|
+
* @param asset {Coin}
|
|
3656
|
+
* @return {Promise<string|null>}
|
|
3657
|
+
*/
|
|
3658
|
+
async getAssetToUsdtRate(asset) {
|
|
3659
|
+
try {
|
|
3660
|
+
var _result$rate;
|
|
3661
|
+
const result = await this._swapProvider.getCoinToUSDTRate(asset);
|
|
3662
|
+
return (_result$rate = result == null ? void 0 : result.rate) != null ? _result$rate : null;
|
|
3663
|
+
} catch (e) {
|
|
3664
|
+
improveAndRethrow(e, "getAssetToUsdtRate");
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
/**
|
|
3669
|
+
* @param asset {Coin}
|
|
3670
|
+
* @param address {string}
|
|
3671
|
+
* @return {boolean}
|
|
3672
|
+
*/
|
|
3673
|
+
isAddressValidForAsset(asset, address) {
|
|
3674
|
+
try {
|
|
3675
|
+
return this._swapProvider.isAddressValidForAsset(asset, address);
|
|
3676
|
+
} catch (e) {
|
|
3677
|
+
improveAndRethrow(e, "isAddressValidForAsset");
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
PublicSwapService.PUBLIC_SWAP_CREATED_EVENT = "publicSwapCreatedEvent";
|
|
3682
|
+
PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS = {
|
|
3683
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded"
|
|
3684
|
+
};
|
|
3685
|
+
PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS = {
|
|
3686
|
+
AMOUNT_LESS_THAN_MIN_SWAPPABLE: "amountLessThanMinSwappable",
|
|
3687
|
+
AMOUNT_HIGHER_THAN_MAX_SWAPPABLE: "amountHigherThanMaxSwappable",
|
|
3688
|
+
PAIR_NOT_SUPPORTED: "pairNotSupported"
|
|
3689
|
+
};
|
|
3690
|
+
PublicSwapService._fiatDecimalsCount = FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
3691
|
+
|
|
3692
|
+
export { AmountUtils, AssetIcon, BaseSwapCreationInfo, Blockchain, Button, Cache, Coin, EmailsApi, ExistingSwap, ExistingSwapWithFiatData, FiatCurrenciesService, LoadingDots, Logger, LogsStorage, Protocol, PublicSwapService, SupportChat, SwapProvider, SwapUtils, SwapspaceSwapProvider, improveAndRethrow, safeStringify, useCallHandlingErrors, useReferredState };
|
|
2
3693
|
//# sourceMappingURL=index.modern.js.map
|