tonder-web-sdk 1.4.0
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/.env-example +1 -0
- package/.htaccess +1 -0
- package/README.md +204 -0
- package/cypress/e2e/1-getting-started/todo.cy.js +143 -0
- package/cypress/e2e/2-advanced-examples/actions.cy.js +299 -0
- package/cypress/e2e/2-advanced-examples/aliasing.cy.js +39 -0
- package/cypress/e2e/2-advanced-examples/assertions.cy.js +176 -0
- package/cypress/e2e/2-advanced-examples/connectors.cy.js +98 -0
- package/cypress/e2e/2-advanced-examples/cookies.cy.js +118 -0
- package/cypress/e2e/2-advanced-examples/cypress_api.cy.js +185 -0
- package/cypress/e2e/2-advanced-examples/files.cy.js +85 -0
- package/cypress/e2e/2-advanced-examples/location.cy.js +32 -0
- package/cypress/e2e/2-advanced-examples/misc.cy.js +104 -0
- package/cypress/e2e/2-advanced-examples/navigation.cy.js +56 -0
- package/cypress/e2e/2-advanced-examples/network_requests.cy.js +163 -0
- package/cypress/e2e/2-advanced-examples/querying.cy.js +114 -0
- package/cypress/e2e/2-advanced-examples/spies_stubs_clocks.cy.js +201 -0
- package/cypress/e2e/2-advanced-examples/storage.cy.js +110 -0
- package/cypress/e2e/2-advanced-examples/traversal.cy.js +121 -0
- package/cypress/e2e/2-advanced-examples/utilities.cy.js +108 -0
- package/cypress/e2e/2-advanced-examples/viewport.cy.js +58 -0
- package/cypress/e2e/2-advanced-examples/waiting.cy.js +30 -0
- package/cypress/e2e/2-advanced-examples/window.cy.js +22 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/support/commands.js +25 -0
- package/cypress/support/e2e.js +20 -0
- package/cypress.config.js +9 -0
- package/index.html +178 -0
- package/index.js.example +50 -0
- package/package.json +29 -0
- package/samples/react/README.md +70 -0
- package/samples/react/build/asset-manifest.json +16 -0
- package/samples/react/build/favicon.ico +0 -0
- package/samples/react/build/index.html +1 -0
- package/samples/react/build/logo192.png +0 -0
- package/samples/react/build/logo512.png +0 -0
- package/samples/react/build/manifest.json +25 -0
- package/samples/react/build/robots.txt +3 -0
- package/samples/react/build/static/css/main.073c9b0a.css +2 -0
- package/samples/react/build/static/css/main.073c9b0a.css.map +1 -0
- package/samples/react/build/static/js/787.b83ed06f.chunk.js +2 -0
- package/samples/react/build/static/js/787.b83ed06f.chunk.js.map +1 -0
- package/samples/react/build/static/js/main.0a848807.js +3 -0
- package/samples/react/build/static/js/main.0a848807.js.LICENSE.txt +39 -0
- package/samples/react/build/static/js/main.0a848807.js.map +1 -0
- package/samples/react/build/static/media/sdk-icons.b491623214b2af4cccdb.png +0 -0
- package/samples/react/package-lock.json +28973 -0
- package/samples/react/package.json +44 -0
- package/samples/react/public/favicon.ico +0 -0
- package/samples/react/public/index.html +43 -0
- package/samples/react/public/logo192.png +0 -0
- package/samples/react/public/logo512.png +0 -0
- package/samples/react/public/manifest.json +25 -0
- package/samples/react/public/robots.txt +3 -0
- package/samples/react/src/App.css +38 -0
- package/samples/react/src/App.js +22 -0
- package/samples/react/src/App.test.js +8 -0
- package/samples/react/src/assets/img/sdk-icons.png +0 -0
- package/samples/react/src/components/Cart.js +29 -0
- package/samples/react/src/components/ProductCard.js +27 -0
- package/samples/react/src/context/CartContext.js +116 -0
- package/samples/react/src/index.css +13 -0
- package/samples/react/src/index.js +17 -0
- package/samples/react/src/logo.svg +1 -0
- package/samples/react/src/reportWebVitals.js +13 -0
- package/samples/react/src/screens/Checkout.js +82 -0
- package/samples/react/src/screens/Store.js +21 -0
- package/samples/react/src/setupTests.js +5 -0
- package/samples/react/src/storeProducts.js +30 -0
- package/src/classes/3dsHandler.js +203 -0
- package/src/classes/checkout.js +125 -0
- package/src/classes/inlineCheckout.js +349 -0
- package/src/data/api.js +109 -0
- package/src/helpers/skyflow.js +139 -0
- package/src/helpers/styles.js +61 -0
- package/src/helpers/template.js +112 -0
- package/src/helpers/utils.js +68 -0
- package/src/index-dev.js +129 -0
- package/src/index.html +58 -0
- package/src/index.js +7 -0
- package/success.html +22 -0
- package/v1/bundle.min.js +18 -0
- package/webpack.config.js +66 -0
package/v1/bundle.min.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TonderSdk=e():t.TonderSdk=e()}(this,(()=>(()=>{var t={452:function(t,e,r){var n;t.exports=(n=r(249),r(269),r(214),r(888),r(109),function(){var t=n,e=t.lib.BlockCipher,r=t.algo,o=[],i=[],a=[],c=[],s=[],u=[],l=[],h=[],f=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var d=n^n<<1^n<<2^n<<3^n<<4;d=d>>>8^255&d^99,o[r]=d,i[d]=r;var v=t[r],y=t[v],g=t[y],m=257*t[d]^16843008*d;a[r]=m<<24|m>>>8,c[r]=m<<16|m>>>16,s[r]=m<<8|m>>>24,u[r]=m,m=16843009*g^65537*y^257*v^16843008*r,l[d]=m<<24|m>>>8,h[d]=m<<16|m>>>16,f[d]=m<<8|m>>>24,p[d]=m,r?(r=v^t[t[t[g^v]]],n^=t[t[n]]):r=n=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],a=0;a<n;a++)a<r?i[a]=e[a]:(u=i[a-1],a%r?r>6&&a%r==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=d[a/r|0]<<24),i[a]=i[a-r]^u);for(var c=this._invKeySchedule=[],s=0;s<n;s++){if(a=n-s,s%4)var u=i[a];else u=i[a-4];c[s]=s<4||a<=4?u:l[o[u>>>24]]^h[o[u>>>16&255]]^f[o[u>>>8&255]]^p[o[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,c,s,u,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,l,h,f,p,i),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,o,i,a,c){for(var s=this._nRounds,u=t[e]^r[0],l=t[e+1]^r[1],h=t[e+2]^r[2],f=t[e+3]^r[3],p=4,d=1;d<s;d++){var v=n[u>>>24]^o[l>>>16&255]^i[h>>>8&255]^a[255&f]^r[p++],y=n[l>>>24]^o[h>>>16&255]^i[f>>>8&255]^a[255&u]^r[p++],g=n[h>>>24]^o[f>>>16&255]^i[u>>>8&255]^a[255&l]^r[p++],m=n[f>>>24]^o[u>>>16&255]^i[l>>>8&255]^a[255&h]^r[p++];u=v,l=y,h=g,f=m}v=(c[u>>>24]<<24|c[l>>>16&255]<<16|c[h>>>8&255]<<8|c[255&f])^r[p++],y=(c[l>>>24]<<24|c[h>>>16&255]<<16|c[f>>>8&255]<<8|c[255&u])^r[p++],g=(c[h>>>24]<<24|c[f>>>16&255]<<16|c[u>>>8&255]<<8|c[255&l])^r[p++],m=(c[f>>>24]<<24|c[u>>>16&255]<<16|c[l>>>8&255]<<8|c[255&h])^r[p++],t[e]=v,t[e+1]=y,t[e+2]=g,t[e+3]=m},keySize:8});t.AES=e._createHelper(v)}(),n.AES)},109:function(t,e,r){var n;t.exports=(n=r(249),r(888),void(n.lib.Cipher||function(t){var e=n,r=e.lib,o=r.Base,i=r.WordArray,a=r.BufferedBlockAlgorithm,c=e.enc,s=(c.Utf8,c.Base64),u=e.algo.EvpKDF,l=r.Cipher=a.extend({cfg:o.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?b:g}return function(e){return{encrypt:function(r,n,o){return t(n).encrypt(e,r,n,o)},decrypt:function(r,n,o){return t(n).decrypt(e,r,n,o)}}}}()}),h=(r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),f=r.BlockCipherMode=o.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),p=h.CBC=function(){var e=f.extend();function r(e,r,n){var o,i=this._iv;i?(o=i,this._iv=t):o=this._prevBlock;for(var a=0;a<n;a++)e[r+a]^=o[a]}return e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,o=n.blockSize;r.call(this,t,e,o),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+o)}}),e.Decryptor=e.extend({processBlock:function(t,e){var n=this._cipher,o=n.blockSize,i=t.slice(e,e+o);n.decryptBlock(t,e),r.call(this,t,e,o),this._prevBlock=i}}),e}(),d=(e.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,o=n<<24|n<<16|n<<8|n,a=[],c=0;c<n;c+=4)a.push(o);var s=i.create(a,n);t.concat(s)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},v=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:d}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=o.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?i.create([1398893684,1701076831]).concat(r).concat(e):e).toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=i.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:e})}},g=r.SerializableCipher=o.extend({cfg:o.extend({format:y}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var o=t.createEncryptor(r,n),i=o.finalize(e),a=o.cfg;return v.create({ciphertext:i,key:r,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),m=(e.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=i.random(8));var o=u.create({keySize:e+r}).compute(t,n),a=i.create(o.words.slice(e),4*r);return o.sigBytes=4*e,v.create({key:o,iv:a,salt:n})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:m}),encrypt:function(t,e,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,t,e,o.key,n);return i.mixIn(o),i},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var o=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);return n.iv=o.iv,g.decrypt.call(this,t,e,o.key,n)}})}()))},249:function(t,e,r){var n;t.exports=(n=n||function(t,e){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(480)}catch(t){}var o=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),a={},c=a.lib={},s=c.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},u=c.WordArray=s.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var c=0;c<o;c+=4)e[n+c>>>2]=r[c>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(o());return new u.init(e,t)}}),l=a.enc={},h=l.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},f=l.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},d=c.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,c=i/(4*a),s=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*a,l=t.min(4*s,i);if(s){for(var h=0;h<s;h+=a)this._doProcessBlock(o,h);r=o.splice(0,s),n.sigBytes-=l}return new u.init(r,l)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),v=(c.Hasher=d.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new v.HMAC.init(t,r).finalize(e)}}}),a.algo={});return a}(Math),n)},269:function(t,e,r){var n;t.exports=(n=r(249),function(){var t=n,e=t.lib.WordArray;function r(t,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var c=n[t.charCodeAt(a-1)]<<a%4*2|n[t.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=c<<24-i%4*8,i++}return e.create(o,i)}t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c<r;c++)o.push(n.charAt(a>>>6*(3-c)&63));var s=n.charAt(64);if(s)for(;o.length%4;)o.push(s);return o.join("")},parse:function(t){var e=t.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var a=n.charAt(64);if(a){var c=t.indexOf(a);-1!==c&&(e=c)}return r(t,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},786:function(t,e,r){var n;t.exports=(n=r(249),function(){var t=n,e=t.lib.WordArray;function r(t,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var c=n[t.charCodeAt(a-1)]<<a%4*2|n[t.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=c<<24-i%4*8,i++}return e.create(o,i)}t.enc.Base64url={stringify:function(t,e=!0){var r=t.words,n=t.sigBytes,o=e?this._safe_map:this._map;t.clamp();for(var i=[],a=0;a<n;a+=3)for(var c=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(o.charAt(c>>>6*(3-s)&63));var u=o.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t,e=!0){var n=t.length,o=e?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<o.length;a++)i[o.charCodeAt(a)]=a}var c=o.charAt(64);if(c){var s=t.indexOf(c);-1!==s&&(n=s)}return r(t,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},298:function(t,e,r){var n;t.exports=(n=r(249),function(){var t=n,e=t.lib.WordArray,r=t.enc;function o(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o+=2){var i=e[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var r=t.length,n=[],o=0;o<r;o++)n[o>>>1]|=t.charCodeAt(o)<<16-o%2*16;return e.create(n,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i+=2){var a=o(e[i>>>2]>>>16-i%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(t){for(var r=t.length,n=[],i=0;i<r;i++)n[i>>>1]|=o(t.charCodeAt(i)<<16-i%2*16);return e.create(n,2*r)}}}(),n.enc.Utf16)},888:function(t,e,r){var n,o,i,a,c,s,u,l;t.exports=(l=r(249),r(783),r(824),o=(n=l).lib,i=o.Base,a=o.WordArray,c=n.algo,s=c.MD5,u=c.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),i=a.create(),c=i.words,s=n.keySize,u=n.iterations;c.length<s;){r&&o.update(r),r=o.update(t).finalize(e),o.reset();for(var l=1;l<u;l++)r=o.finalize(r),o.reset();i.concat(r)}return i.sigBytes=4*s,i}}),n.EvpKDF=function(t,e,r){return u.create(r).compute(t,e)},l.EvpKDF)},209:function(t,e,r){var n,o,i,a;t.exports=(a=r(249),r(109),o=(n=a).lib.CipherParams,i=n.enc.Hex,n.format.Hex={stringify:function(t){return t.ciphertext.toString(i)},parse:function(t){var e=i.parse(t);return o.create({ciphertext:e})}},a.format.Hex)},824:function(t,e,r){var n,o,i,a;t.exports=(n=r(249),i=(o=n).lib.Base,a=o.enc.Utf8,void(o.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=a.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),i=this._iKey=e.clone(),c=o.words,s=i.words,u=0;u<r;u++)c[u]^=1549556828,s[u]^=909522486;o.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))},354:function(t,e,r){var n;t.exports=(n=r(249),r(938),r(433),r(298),r(269),r(786),r(214),r(783),r(153),r(792),r(34),r(460),r(327),r(706),r(824),r(112),r(888),r(109),r(568),r(242),r(968),r(660),r(148),r(615),r(807),r(77),r(475),r(991),r(209),r(452),r(253),r(857),r(454),r(974),n)},433:function(t,e,r){var n;t.exports=(n=r(249),function(){if("function"==typeof ArrayBuffer){var t=n.lib.WordArray,e=t.init,r=t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=t[o]<<24-o%4*8;e.call(this,n,r)}else e.apply(this,arguments)};r.prototype=t}}(),n.lib.WordArray)},214:function(t,e,r){var n;t.exports=(n=r(249),function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,a=e.algo,c=[];!function(){for(var e=0;e<64;e++)c[e]=4294967296*t.abs(t.sin(e+1))|0}();var s=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,o=t[n];t[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=t[e+0],s=t[e+1],p=t[e+2],d=t[e+3],v=t[e+4],y=t[e+5],g=t[e+6],m=t[e+7],b=t[e+8],w=t[e+9],_=t[e+10],x=t[e+11],k=t[e+12],S=t[e+13],B=t[e+14],E=t[e+15],L=i[0],O=i[1],j=i[2],C=i[3];L=u(L,O,j,C,a,7,c[0]),C=u(C,L,O,j,s,12,c[1]),j=u(j,C,L,O,p,17,c[2]),O=u(O,j,C,L,d,22,c[3]),L=u(L,O,j,C,v,7,c[4]),C=u(C,L,O,j,y,12,c[5]),j=u(j,C,L,O,g,17,c[6]),O=u(O,j,C,L,m,22,c[7]),L=u(L,O,j,C,b,7,c[8]),C=u(C,L,O,j,w,12,c[9]),j=u(j,C,L,O,_,17,c[10]),O=u(O,j,C,L,x,22,c[11]),L=u(L,O,j,C,k,7,c[12]),C=u(C,L,O,j,S,12,c[13]),j=u(j,C,L,O,B,17,c[14]),L=l(L,O=u(O,j,C,L,E,22,c[15]),j,C,s,5,c[16]),C=l(C,L,O,j,g,9,c[17]),j=l(j,C,L,O,x,14,c[18]),O=l(O,j,C,L,a,20,c[19]),L=l(L,O,j,C,y,5,c[20]),C=l(C,L,O,j,_,9,c[21]),j=l(j,C,L,O,E,14,c[22]),O=l(O,j,C,L,v,20,c[23]),L=l(L,O,j,C,w,5,c[24]),C=l(C,L,O,j,B,9,c[25]),j=l(j,C,L,O,d,14,c[26]),O=l(O,j,C,L,b,20,c[27]),L=l(L,O,j,C,S,5,c[28]),C=l(C,L,O,j,p,9,c[29]),j=l(j,C,L,O,m,14,c[30]),L=h(L,O=l(O,j,C,L,k,20,c[31]),j,C,y,4,c[32]),C=h(C,L,O,j,b,11,c[33]),j=h(j,C,L,O,x,16,c[34]),O=h(O,j,C,L,B,23,c[35]),L=h(L,O,j,C,s,4,c[36]),C=h(C,L,O,j,v,11,c[37]),j=h(j,C,L,O,m,16,c[38]),O=h(O,j,C,L,_,23,c[39]),L=h(L,O,j,C,S,4,c[40]),C=h(C,L,O,j,a,11,c[41]),j=h(j,C,L,O,d,16,c[42]),O=h(O,j,C,L,g,23,c[43]),L=h(L,O,j,C,w,4,c[44]),C=h(C,L,O,j,k,11,c[45]),j=h(j,C,L,O,E,16,c[46]),L=f(L,O=h(O,j,C,L,p,23,c[47]),j,C,a,6,c[48]),C=f(C,L,O,j,m,10,c[49]),j=f(j,C,L,O,B,15,c[50]),O=f(O,j,C,L,y,21,c[51]),L=f(L,O,j,C,k,6,c[52]),C=f(C,L,O,j,d,10,c[53]),j=f(j,C,L,O,_,15,c[54]),O=f(O,j,C,L,s,21,c[55]),L=f(L,O,j,C,b,6,c[56]),C=f(C,L,O,j,E,10,c[57]),j=f(j,C,L,O,g,15,c[58]),O=f(O,j,C,L,S,21,c[59]),L=f(L,O,j,C,v,6,c[60]),C=f(C,L,O,j,x,10,c[61]),j=f(j,C,L,O,p,15,c[62]),O=f(O,j,C,L,w,21,c[63]),i[0]=i[0]+L|0,i[1]=i[1]+O|0,i[2]=i[2]+j|0,i[3]=i[3]+C|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;var i=t.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var c=this._hash,s=c.words,u=0;u<4;u++){var l=s[u];s[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return c},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,n,o,i,a){var c=t+(e&r|~e&n)+o+a;return(c<<i|c>>>32-i)+e}function l(t,e,r,n,o,i,a){var c=t+(e&n|r&~n)+o+a;return(c<<i|c>>>32-i)+e}function h(t,e,r,n,o,i,a){var c=t+(e^r^n)+o+a;return(c<<i|c>>>32-i)+e}function f(t,e,r,n,o,i,a){var c=t+(r^(e|~n))+o+a;return(c<<i|c>>>32-i)+e}e.MD5=i._createHelper(s),e.HmacMD5=i._createHmacHelper(s)}(Math),n.MD5)},568:function(t,e,r){var n;t.exports=(n=r(249),r(109),n.mode.CFB=function(){var t=n.lib.BlockCipherMode.extend();function e(t,e,r,n){var o,i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,n.encryptBlock(o,0);for(var a=0;a<r;a++)t[e+a]^=o[a]}return t.Encryptor=t.extend({processBlock:function(t,r){var n=this._cipher,o=n.blockSize;e.call(this,t,r,o,n),this._prevBlock=t.slice(r,r+o)}}),t.Decryptor=t.extend({processBlock:function(t,r){var n=this._cipher,o=n.blockSize,i=t.slice(r,r+o);e.call(this,t,r,o,n),this._prevBlock=i}}),t}(),n.mode.CFB)},968:function(t,e,r){var n;t.exports=(n=r(249),r(109),
|
|
2
|
+
/** @preserve
|
|
3
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
4
|
+
* derived from CryptoJS.mode.CTR
|
|
5
|
+
* Jan Hruby jhruby.web@gmail.com
|
|
6
|
+
*/
|
|
7
|
+
n.mode.CTRGladman=function(){var t=n.lib.BlockCipherMode.extend();function e(t){if(255==(t>>24&255)){var e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}else t+=1<<24;return t}function r(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var o=t.Encryptor=t.extend({processBlock:function(t,e){var n=this._cipher,o=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),r(a);var c=a.slice(0);n.encryptBlock(c,0);for(var s=0;s<o;s++)t[e+s]^=c[s]}});return t.Decryptor=o,t}(),n.mode.CTRGladman)},242:function(t,e,r){var n,o,i;t.exports=(i=r(249),r(109),i.mode.CTR=(n=i.lib.BlockCipherMode.extend(),o=n.Encryptor=n.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,o=this._iv,i=this._counter;o&&(i=this._counter=o.slice(0),this._iv=void 0);var a=i.slice(0);r.encryptBlock(a,0),i[n-1]=i[n-1]+1|0;for(var c=0;c<n;c++)t[e+c]^=a[c]}}),n.Decryptor=o,n),i.mode.CTR)},148:function(t,e,r){var n,o;t.exports=(o=r(249),r(109),o.mode.ECB=((n=o.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),n.Decryptor=n.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),n),o.mode.ECB)},660:function(t,e,r){var n,o,i;t.exports=(i=r(249),r(109),i.mode.OFB=(n=i.lib.BlockCipherMode.extend(),o=n.Encryptor=n.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,o=this._iv,i=this._keystream;o&&(i=this._keystream=o.slice(0),this._iv=void 0),r.encryptBlock(i,0);for(var a=0;a<n;a++)t[e+a]^=i[a]}}),n.Decryptor=o,n),i.mode.OFB)},615:function(t,e,r){var n;t.exports=(n=r(249),r(109),n.pad.AnsiX923={pad:function(t,e){var r=t.sigBytes,n=4*e,o=n-r%n,i=r+o-1;t.clamp(),t.words[i>>>2]|=o<<24-i%4*8,t.sigBytes+=o},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},n.pad.Ansix923)},807:function(t,e,r){var n;t.exports=(n=r(249),r(109),n.pad.Iso10126={pad:function(t,e){var r=4*e,o=r-t.sigBytes%r;t.concat(n.lib.WordArray.random(o-1)).concat(n.lib.WordArray.create([o<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},n.pad.Iso10126)},77:function(t,e,r){var n;t.exports=(n=r(249),r(109),n.pad.Iso97971={pad:function(t,e){t.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(t,e)},unpad:function(t){n.pad.ZeroPadding.unpad(t),t.sigBytes--}},n.pad.Iso97971)},991:function(t,e,r){var n;t.exports=(n=r(249),r(109),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},475:function(t,e,r){var n;t.exports=(n=r(249),r(109),n.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){var e=t.words,r=t.sigBytes-1;for(r=t.sigBytes-1;r>=0;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},n.pad.ZeroPadding)},112:function(t,e,r){var n,o,i,a,c,s,u,l,h;t.exports=(h=r(249),r(783),r(824),o=(n=h).lib,i=o.Base,a=o.WordArray,c=n.algo,s=c.SHA1,u=c.HMAC,l=c.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=u.create(r.hasher,t),o=a.create(),i=a.create([1]),c=o.words,s=i.words,l=r.keySize,h=r.iterations;c.length<l;){var f=n.update(e).finalize(i);n.reset();for(var p=f.words,d=p.length,v=f,y=1;y<h;y++){v=n.finalize(v),n.reset();for(var g=v.words,m=0;m<d;m++)p[m]^=g[m]}o.concat(f),s[0]++}return o.sigBytes=4*l,o}}),n.PBKDF2=function(t,e,r){return l.create(r).compute(t,e)},h.PBKDF2)},974:function(t,e,r){var n;t.exports=(n=r(249),r(269),r(214),r(888),r(109),function(){var t=n,e=t.lib.StreamCipher,r=t.algo,o=[],i=[],a=[],c=r.RabbitLegacy=e.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var o=0;o<4;o++)s.call(this);for(o=0;o<8;o++)n[o]^=r[o+4&7];if(e){var i=e.words,a=i[0],c=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),h=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=h,n[6]^=l,n[7]^=f,o=0;o<4;o++)s.call(this)}},_doProcessBlock:function(t,e){var r=this._X;s.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),t[e+n]^=o[n]},blockSize:4,ivSize:2});function s(){for(var t=this._X,e=this._C,r=0;r<8;r++)i[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<i[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<i[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<i[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<i[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<i[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<i[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<i[6]>>>0?1:0)|0,this._b=e[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],o=65535&n,c=n>>>16,s=((o*o>>>17)+o*c>>>15)+c*c,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=s^u}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(c)}(),n.RabbitLegacy)},454:function(t,e,r){var n;t.exports=(n=r(249),r(269),r(214),r(888),r(109),function(){var t=n,e=t.lib.StreamCipher,r=t.algo,o=[],i=[],a=[],c=r.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)s.call(this);for(r=0;r<8;r++)o[r]^=n[r+4&7];if(e){var i=e.words,a=i[0],c=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),h=u>>>16|4294901760&l,f=l<<16|65535&u;for(o[0]^=u,o[1]^=h,o[2]^=l,o[3]^=f,o[4]^=u,o[5]^=h,o[6]^=l,o[7]^=f,r=0;r<4;r++)s.call(this)}},_doProcessBlock:function(t,e){var r=this._X;s.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),t[e+n]^=o[n]},blockSize:4,ivSize:2});function s(){for(var t=this._X,e=this._C,r=0;r<8;r++)i[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<i[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<i[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<i[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<i[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<i[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<i[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<i[6]>>>0?1:0)|0,this._b=e[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=t[r]+e[r],o=65535&n,c=n>>>16,s=((o*o>>>17)+o*c>>>15)+c*c,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=s^u}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(c)}(),n.Rabbit)},857:function(t,e,r){var n;t.exports=(n=r(249),r(269),r(214),r(888),r(109),function(){var t=n,e=t.lib.StreamCipher,r=t.algo,o=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var a=o%r,c=e[a>>>2]>>>24-a%4*8&255;i=(i+n[o]+c)%256;var s=n[o];n[o]=n[i],n[i]=s}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var t=this._S,e=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+t[e=(e+1)%256])%256;var i=t[e];t[e]=t[r],t[r]=i,n|=t[(t[e]+t[r])%256]<<24-8*o}return this._i=e,this._j=r,n}t.RC4=e._createHelper(o);var a=r.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)i.call(this)}});t.RC4Drop=e._createHelper(a)}(),n.RC4)},706:function(t,e,r){var n;t.exports=(n=r(249),
|
|
8
|
+
/** @preserve
|
|
9
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
10
|
+
|
|
11
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
12
|
+
|
|
13
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
14
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
+
*/
|
|
18
|
+
function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,a=e.algo,c=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),f=o.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,o=t[n];t[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i,a,p,w,_,x,k,S,B,E,L,O=this._hash.words,j=h.words,C=f.words,P=c.words,T=s.words,A=u.words,H=l.words;for(x=i=O[0],k=a=O[1],S=p=O[2],B=w=O[3],E=_=O[4],r=0;r<80;r+=1)L=i+t[e+P[r]]|0,L+=r<16?d(a,p,w)+j[0]:r<32?v(a,p,w)+j[1]:r<48?y(a,p,w)+j[2]:r<64?g(a,p,w)+j[3]:m(a,p,w)+j[4],L=(L=b(L|=0,A[r]))+_|0,i=_,_=w,w=b(p,10),p=a,a=L,L=x+t[e+T[r]]|0,L+=r<16?m(k,S,B)+C[0]:r<32?g(k,S,B)+C[1]:r<48?y(k,S,B)+C[2]:r<64?v(k,S,B)+C[3]:d(k,S,B)+C[4],L=(L=b(L|=0,H[r]))+E|0,x=E,E=B,B=b(S,10),S=k,k=L;L=O[1]+p+B|0,O[1]=O[2]+w+E|0,O[2]=O[3]+_+x|0,O[3]=O[4]+i+k|0,O[4]=O[0]+a+S|0,O[0]=L},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var o=this._hash,i=o.words,a=0;a<5;a++){var c=i[a];i[a]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return o},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,r){return t^e^r}function v(t,e,r){return t&e|~t&r}function y(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function m(t,e,r){return t^(e|~r)}function b(t,e){return t<<e|t>>>32-e}e.RIPEMD160=i._createHelper(p),e.HmacRIPEMD160=i._createHmacHelper(p)}(Math),n.RIPEMD160)},783:function(t,e,r){var n,o,i,a,c,s,u,l;t.exports=(l=r(249),o=(n=l).lib,i=o.WordArray,a=o.Hasher,c=n.algo,s=[],u=c.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|t[e+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var h=(n<<5|n>>>27)+c+s[u];h+=u<20?1518500249+(o&i|~o&a):u<40?1859775393+(o^i^a):u<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,c=a,a=i,i=o<<30|o>>>2,o=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),n.SHA1=a._createHelper(u),n.HmacSHA1=a._createHmacHelper(u),l.SHA1)},792:function(t,e,r){var n,o,i,a,c,s;t.exports=(s=r(249),r(153),o=(n=s).lib.WordArray,i=n.algo,a=i.SHA256,c=i.SHA224=a.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),n.SHA224=a._createHelper(c),n.HmacSHA224=a._createHmacHelper(c),s.SHA224)},153:function(t,e,r){var n;t.exports=(n=r(249),function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,a=e.algo,c=[],s=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,o=0;o<64;)e(n)&&(o<8&&(c[o]=r(t.pow(n,.5))),s[o]=r(t.pow(n,1/3)),o++),n++}();var u=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(c.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],l=r[5],h=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var d=u[p-15],v=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,y=u[p-2],g=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[p]=v+u[p-7]+g+u[p-16]}var m=n&o^n&i^o&i,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&l^~c&h)+s[p]+u[p];f=h,h=l,l=c,c=a+w|0,a=i,i=o,o=n,n=w+(b+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0,r[5]=r[5]+l|0,r[6]=r[6]+h|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=t.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(l),e.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)},327:function(t,e,r){var n;t.exports=(n=r(249),r(938),function(t){var e=n,r=e.lib,o=r.WordArray,i=r.Hasher,a=e.x64.Word,c=e.algo,s=[],u=[],l=[];!function(){for(var t=1,e=0,r=0;r<24;r++){s[t+5*e]=(r+1)*(r+2)/2%64;var n=(2*t+3*e)%5;t=e%5,e=n}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var o=1,i=0;i<24;i++){for(var c=0,h=0,f=0;f<7;f++){if(1&o){var p=(1<<f)-1;p<32?h^=1<<p:c^=1<<p-32}128&o?o=o<<1^113:o<<=1}l[i]=a.create(c,h)}}();var h=[];!function(){for(var t=0;t<25;t++)h[t]=a.create()}();var f=c.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,n=this.blockSize/2,o=0;o<n;o++){var i=t[e+2*o],a=t[e+2*o+1];i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(O=r[o]).high^=a,O.low^=i}for(var c=0;c<24;c++){for(var f=0;f<5;f++){for(var p=0,d=0,v=0;v<5;v++)p^=(O=r[f+5*v]).high,d^=O.low;var y=h[f];y.high=p,y.low=d}for(f=0;f<5;f++){var g=h[(f+4)%5],m=h[(f+1)%5],b=m.high,w=m.low;for(p=g.high^(b<<1|w>>>31),d=g.low^(w<<1|b>>>31),v=0;v<5;v++)(O=r[f+5*v]).high^=p,O.low^=d}for(var _=1;_<25;_++){var x=(O=r[_]).high,k=O.low,S=s[_];S<32?(p=x<<S|k>>>32-S,d=k<<S|x>>>32-S):(p=k<<S-32|x>>>64-S,d=x<<S-32|k>>>64-S);var B=h[u[_]];B.high=p,B.low=d}var E=h[0],L=r[0];for(E.high=L.high,E.low=L.low,f=0;f<5;f++)for(v=0;v<5;v++){var O=r[_=f+5*v],j=h[_],C=h[(f+1)%5+5*v],P=h[(f+2)%5+5*v];O.high=j.high^~C.high&P.high,O.low=j.low^~C.low&P.low}O=r[0];var T=l[c];O.high^=T.high,O.low^=T.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var a=this._state,c=this.cfg.outputLength/8,s=c/8,u=[],l=0;l<s;l++){var h=a[l],f=h.high,p=h.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new o.init(u,c)},clone:function(){for(var t=i.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=i._createHelper(f),e.HmacSHA3=i._createHmacHelper(f)}(Math),n.SHA3)},460:function(t,e,r){var n,o,i,a,c,s,u,l;t.exports=(l=r(249),r(938),r(34),o=(n=l).x64,i=o.Word,a=o.WordArray,c=n.algo,s=c.SHA512,u=c.SHA384=s.extend({_doReset:function(){this._hash=new a.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=16,t}}),n.SHA384=s._createHelper(u),n.HmacSHA384=s._createHmacHelper(u),l.SHA384)},34:function(t,e,r){var n;t.exports=(n=r(249),r(938),function(){var t=n,e=t.lib.Hasher,r=t.x64,o=r.Word,i=r.WordArray,a=t.algo;function c(){return o.create.apply(o,arguments)}var s=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],u=[];!function(){for(var t=0;t<80;t++)u[t]=c()}();var l=a.SHA512=e.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],l=r[5],h=r[6],f=r[7],p=n.high,d=n.low,v=o.high,y=o.low,g=i.high,m=i.low,b=a.high,w=a.low,_=c.high,x=c.low,k=l.high,S=l.low,B=h.high,E=h.low,L=f.high,O=f.low,j=p,C=d,P=v,T=y,A=g,H=m,z=b,D=w,I=_,M=x,R=k,N=S,F=B,U=E,G=L,W=O,K=0;K<80;K++){var X,V,Y=u[K];if(K<16)V=Y.high=0|t[e+2*K],X=Y.low=0|t[e+2*K+1];else{var q=u[K-15],J=q.high,Z=q.low,$=(J>>>1|Z<<31)^(J>>>8|Z<<24)^J>>>7,Q=(Z>>>1|J<<31)^(Z>>>8|J<<24)^(Z>>>7|J<<25),tt=u[K-2],et=tt.high,rt=tt.low,nt=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,ot=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),it=u[K-7],at=it.high,ct=it.low,st=u[K-16],ut=st.high,lt=st.low;V=(V=(V=$+at+((X=Q+ct)>>>0<Q>>>0?1:0))+nt+((X+=ot)>>>0<ot>>>0?1:0))+ut+((X+=lt)>>>0<lt>>>0?1:0),Y.high=V,Y.low=X}var ht,ft=I&R^~I&F,pt=M&N^~M&U,dt=j&P^j&A^P&A,vt=C&T^C&H^T&H,yt=(j>>>28|C<<4)^(j<<30|C>>>2)^(j<<25|C>>>7),gt=(C>>>28|j<<4)^(C<<30|j>>>2)^(C<<25|j>>>7),mt=(I>>>14|M<<18)^(I>>>18|M<<14)^(I<<23|M>>>9),bt=(M>>>14|I<<18)^(M>>>18|I<<14)^(M<<23|I>>>9),wt=s[K],_t=wt.high,xt=wt.low,kt=G+mt+((ht=W+bt)>>>0<W>>>0?1:0),St=gt+vt;G=F,W=U,F=R,U=N,R=I,N=M,I=z+(kt=(kt=(kt=kt+ft+((ht+=pt)>>>0<pt>>>0?1:0))+_t+((ht+=xt)>>>0<xt>>>0?1:0))+V+((ht+=X)>>>0<X>>>0?1:0))+((M=D+ht|0)>>>0<D>>>0?1:0)|0,z=A,D=H,A=P,H=T,P=j,T=C,j=kt+(yt+dt+(St>>>0<gt>>>0?1:0))+((C=ht+St|0)>>>0<ht>>>0?1:0)|0}d=n.low=d+C,n.high=p+j+(d>>>0<C>>>0?1:0),y=o.low=y+T,o.high=v+P+(y>>>0<T>>>0?1:0),m=i.low=m+H,i.high=g+A+(m>>>0<H>>>0?1:0),w=a.low=w+D,a.high=b+z+(w>>>0<D>>>0?1:0),x=c.low=x+M,c.high=_+I+(x>>>0<M>>>0?1:0),S=l.low=S+N,l.high=k+R+(S>>>0<N>>>0?1:0),E=h.low=E+U,h.high=B+F+(E>>>0<U>>>0?1:0),O=f.low=O+W,f.high=L+G+(O>>>0<W>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(n+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l)}(),n.SHA512)},253:function(t,e,r){var n;t.exports=(n=r(249),r(269),r(214),r(888),r(109),function(){var t=n,e=t.lib,r=e.WordArray,o=e.BlockCipher,i=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=i.DES=o.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var n=a[r]-1;e[r]=t[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var u=o[i]=[],l=s[i];for(r=0;r<24;r++)u[r/6|0]|=e[(c[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=e[28+(c[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=o[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var o=r[n],i=this._lBlock,a=this._rBlock,c=0,s=0;s<8;s++)c|=u[s][((a^o[s])&l[s])>>>0];this._lBlock=a,this._rBlock=i^c}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function p(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}t.DES=o._createHelper(h);var d=i.TripleDES=o.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),n=t.length<4?t.slice(0,2):t.slice(2,4),o=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=h.createEncryptor(r.create(e)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(o))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=o._createHelper(d)}(),n.TripleDES)},938:function(t,e,r){var n;t.exports=(n=r(249),function(t){var e=n,r=e.lib,o=r.Base,i=r.WordArray,a=e.x64={};a.Word=o.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=o.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:8*e.length},toX32:function(){for(var t=this.words,e=t.length,r=[],n=0;n<e;n++){var o=t[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var t=o.clone.call(this),e=t.words=this.words.slice(0),r=e.length,n=0;n<r;n++)e[n]=e[n].clone();return t}})}(),n)},480:()=>{}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Checkout:()=>u,InlineCheckout:()=>ut});var t=r(354);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function c(t,e,r){return(e=s(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){var r=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}var u=function(){function e(r){var n=this,o=r.apiKey,a=r.type,s=void 0===a?"payment":a,u=r.backgroundColor,l=void 0===u?"#141414":u,h=r.color,f=void 0===h?"#EBEBEB":h,p=r.cb,d=void 0===p?function(){}:p,v=r.url,y=void 0===v?"http://checkout.tonder.io/#/":v;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"generateButton",(function(t){n.buttonText=t||n.buttonText,n.tonderButton=document.createElement("button"),n.tonderButton.innerHTML=n.buttonText,n.stylishButton(n.tonderButton),n.tonderButton.onclick=n.openCheckout})),c(this,"getButton",(function(t){var e=t.buttonText;return n.generateButton(e),n.tonderButton})),c(this,"mountButton",(function(t){var e=t.buttonText;n.generateButton(e);var r=document.getElementById("tonder-checkout");try{r.innerHTML="",r.append(n.tonderButton)}catch(t){console.error(t)}})),c(this,"stylishButton",(function(t){t.style.backgroundColor=n.backgroundColor,t.style.color=n.color,t.style.display="flex",t.style.justifyContent="center",t.style.border="none",t.style.padding="1rem",t.style.borderRadius="10px",t.style.fontSize="1rem",t.style.width="100%",t.style.boxShadow="0 3px 6px 0 rgba(0,0,0,0.16)"})),c(this,"setOrder",(function(t){var e=t.products,r=t.email,o=t.shippingCost,a={};return e&&(a.products=e),r&&(a.email=r),o&&(a.shippingCost=o),n.order=i(i({},n.order),a),n.order})),c(this,"openTabListener",(function(t,e){var r=setInterval((function(){t.closed&&(clearInterval(r),e.disabled=!1,e.innerHTML=n.buttonText)}),500)})),c(this,"openCheckout",(function(){var e=n.getUrlParams(),r=t.AES.encrypt(e,"url-params-encrypt").toString(),o=encodeURIComponent(r);n.params="?"+o;var i=window.open(n.url+n.params,"_blank","width=1200,height=$800,left=0,top=0");n.tonderButton.disabled=!0,n.tonderButton.innerHTML='\n <div class="loader"></div>\n <style>\n .loader {\n border: 4px solid '.concat(n.color,";\n border-radius: 50%;\n border-top: 4px solid ").concat(n.backgroundColor,";\n width: 0.625rem;\n height: 0.625rem;\n -webkit-animation: spin 2s linear infinite; /* Safari */\n animation: spin 2s linear infinite;\n }\n\n /* Safari */\n @-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); }\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n "),n.openTabListener(i,n.tonderButton)})),c(this,"getUrlParams",(function(){var t=i(i({apiKey:n.apiKey},n.order),{},{type:n.type});return t.products&&(t.products=JSON.stringify(t.products)),new URLSearchParams(t).toString()})),this.url=y,this.apiKey=o,this.type=s,this.backgroundColor=l,this.color=f,this.params="",this.order={},this.buttonText="Proceder al pago",this.cb=d,window.addEventListener("message",this.receiveMessage.bind(this),!1)}var r,n,o;return r=e,(n=[{key:"receiveMessage",value:function(t){try{var e=JSON.parse(t.data);this.cb(e)}catch(e){this.cb(t.data)}}}])&&a(r.prototype,n),o&&a(r,o),Object.defineProperty(r,"prototype",{writable:!1}),e}();function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function h(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new L(o||[]);return n(a,"_invoke",{value:k(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p={};function d(){}function v(){}function y(){}var g={};s(g,i,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(O([])));b&&b!==e&&r.call(b,i)&&(g=b);var w=y.prototype=d.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(n,i,a,c){var s=f(t[n],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==l(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(s.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function k(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=S(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=f(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return v.prototype=y,n(w,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:v,configurable:!0}),v.displayName=s(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},_(x.prototype),s(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(w),s(w,c,"Generator"),s(w,i,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function f(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,c,"next",t)}function c(t){f(i,n,o,a,c,"throw",t)}a(void 0)}))}}function d(t,e,r){return v.apply(this,arguments)}function v(){return(v=p(h().mark((function t(e,r,n){var o,i;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.OpenPay;case 2:return(o=t.sent).setId(e),o.setApiKey(r),o.setSandboxMode(!0),t.next=8,o.deviceData.setup({signal:n});case 8:return i=t.sent,t.abrupt("return",i);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t,e,r){return g.apply(this,arguments)}function g(){return g=p(h().mark((function t(e,r,n){var o,i;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(e,"/api/v1/payments/business/").concat(r),{headers:{Authorization:"Token ".concat(r)},signal:n});case 2:return o=t.sent,t.next=5,o.json();case 5:return i=t.sent,t.abrupt("return",i);case 7:case"end":return t.stop()}}),t)}))),g.apply(this,arguments)}function m(t,e,r,n){return b.apply(this,arguments)}function b(){return(b=p(h().mark((function t(e,r,n,o){var i,a,c,s;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="".concat(e,"/api/v1/customer/"),a={email:n},t.next=4,fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Token ".concat(r)},signal:o,body:JSON.stringify(a)});case 4:if(201!==(c=t.sent).status){t.next=12;break}return t.next=8,c.json();case 8:return s=t.sent,t.abrupt("return",s);case 12:throw new Error("Error: ".concat(c.statusText));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function w(t,e,r){return _.apply(this,arguments)}function _(){return(_=p(h().mark((function t(e,r,n){var o,i,a,c;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="".concat(e,"/api/v1/orders/"),i=n,t.next=4,fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Token ".concat(r)},body:JSON.stringify(i)});case 4:if(201!==(a=t.sent).status){t.next=12;break}return t.next=8,a.json();case 8:return c=t.sent,t.abrupt("return",c);case 12:throw new Error("Error: ".concat(a.statusText));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,e,r){return k.apply(this,arguments)}function k(){return(k=p(h().mark((function t(e,r,n){var o,i,a,c;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="".concat(e,"/api/v1/business/").concat(n.business_pk,"/payments/"),i=n,t.next=4,fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Token ".concat(r)},body:JSON.stringify(i)});case 4:if(!((a=t.sent).status>=200&&a.status<=299)){t.next=12;break}return t.next=8,a.json();case 8:return c=t.sent,t.abrupt("return",c);case 12:throw new Error("Error: ".concat(a.statusText));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t,e,r){return B.apply(this,arguments)}function B(){return(B=p(h().mark((function t(e,r,n){var o,i,a,c;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o="".concat(e,"/api/v1/checkout-router/"),i=n,t.next=5,fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Token ".concat(r)},body:JSON.stringify(i)});case 5:if(!((a=t.sent).status>=200&&a.status<=299)){t.next=13;break}return t.next=9,a.json();case 9:return c=t.sent,t.abrupt("return",c);case 13:throw new Error("Failed to start checkout router");case 14:t.next=19;break;case 16:throw t.prev=16,t.t0=t.catch(0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,16]])})))).apply(this,arguments)}function E(t){var e=document.getElementById("msgError");e.classList.add("error-container"),e.innerHTML=t,setTimeout((function(){try{document.querySelector("#tonderPayButton").disabled=!1}catch(t){}e.classList.remove("error-container"),e.innerHTML=""}),3e3)}var L={inputStyles:{base:{border:"1px solid #e0e0e0",padding:"10px 7px",borderRadius:"5px",color:"#1d1d1d",marginTop:"2px",backgroundColor:"white",fontFamily:'"Inter", sans-serif',fontSize:"16px","&::placeholder":{color:"#ccc"}},cardIcon:{position:"absolute",left:"6px",bottom:"calc(50% - 12px)"},complete:{color:"#4caf50"},empty:{},focus:{},invalid:{border:"1px solid #f44336"},global:{"@import":'url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap")'}},labelStyles:{base:{fontSize:"12px",fontWeight:"500",fontFamily:'"Inter", sans-serif'}},errorTextStyles:{base:{fontSize:"12px",fontWeight:"500",color:"#f44336",fontFamily:'"Inter", sans-serif'}},labels:{cardLabel:"",cvvLabel:"",expiryMonthLabel:"",expiryYearLabel:""},placeholders:{cardPlaceholder:"",cvvPlaceholder:"",expiryMonthPlaceholder:"",expiryYearPlaceholder:""}};function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==O(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===O(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new B(o||[]);return n(a,"_invoke",{value:_(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(E([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=d.prototype=f.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var s=l(t[n],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==O(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(s.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function A(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function H(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){A(i,n,o,a,c,"next",t)}function c(t){A(i,n,o,a,c,"throw",t)}a(void 0)}))}}function z(t,e,r,n,o){return D.apply(this,arguments)}function D(){return D=H(T().mark((function t(e,r,n,o,i){var a,c,s,u,l,h,f,p,d,v,y,g=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=g.length>5&&void 0!==g[5]?g[5]:{},t.next=3,Skyflow.init({vaultID:e,vaultURL:r,getBearerToken:function(){var t=H(T().mark((function t(){var e,r;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(n,"/api/v1/vault-token/"),{method:"GET",headers:{Authorization:"Token ".concat(o)},signal:i});case 2:if(!(e=t.sent).ok){t.next=10;break}return t.next=6,e.json();case 6:return r=t.sent,t.abrupt("return",r.token);case 10:throw new Error("Failed to retrieve bearer token");case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),options:{logLevel:Skyflow.LogLevel.ERROR,env:Skyflow.Env.DEV}});case 3:return c=t.sent,t.next=6,c.container(Skyflow.ContainerType.COLLECT);case 6:return s=t.sent,u=0===Object.keys(a).length?L:a,(l=C({},u.inputStyles.base)).textIndent="44px",h={type:Skyflow.ValidationRuleType.LENGTH_MATCH_RULE,params:{max:70}},t.next=13,s.create(C(C({table:"cards",column:"cardholder_name"},u),{},{label:"Titular de la tarjeta",placeholder:"Nombre como aparece en la tarjeta",type:Skyflow.ElementType.CARDHOLDER_NAME,validations:[h]}));case 13:return(f=t.sent).setError("Inválido"),t.next=17,s.create(C(C({table:"cards",column:"card_number"},u),{},{inputStyles:C(C({},u.inputStyles),{},{base:l}),label:"Número de tarjeta",placeholder:"1234 1234 1234 1234",type:Skyflow.ElementType.CARD_NUMBER}));case 17:return(p=t.sent).setError("Inválido"),t.next=21,s.create(C(C({table:"cards",column:"cvv"},u),{},{label:"CVC/CVV",placeholder:"3-4 dígitos",type:Skyflow.ElementType.CVV}));case 21:return(d=t.sent).setError("Inválido"),t.next=25,s.create(C(C({table:"cards",column:"expiration_month"},u),{},{label:"Fecha de expiración",placeholder:"MM",type:Skyflow.ElementType.EXPIRATION_MONTH}));case 25:return(v=t.sent).setError("Inválido"),t.next=29,s.create(C(C({table:"cards",column:"expiration_year"},u),{},{label:"",placeholder:"AA",type:Skyflow.ElementType.EXPIRATION_YEAR}));case 29:return(y=t.sent).setError("Inválido"),t.next=33,I(p,d,v,y,f);case 33:return t.abrupt("return",s);case 34:case"end":return t.stop()}}),t)}))),D.apply(this,arguments)}function I(t,e,r,n,o){return M.apply(this,arguments)}function M(){return(M=H(T().mark((function t(e,r,n,o,i){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.mount("#collectCardNumber"),r.mount("#collectCvv"),n.mount("#collectExpirationMonth"),o.mount("#collectExpirationYear"),i.mount("#collectCardholderName");case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function N(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new B(o||[]);return n(a,"_invoke",{value:_(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(E([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=d.prototype=f.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var s=l(t[n],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==R(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(s.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function F(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],s=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||G(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){if(t){if("string"==typeof t)return W(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W(t,e):void 0}}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function K(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==R(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===R(i)?i:String(i)),n)}var o,i}var X=function(){function t(e){var r=e.payload,n=void 0===r?null:r,o=e.apiKey,i=e.baseUrl,a=e.successUrl;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.apiKey=o,this.payload=n,this.successUrl=a}var e,r,n,o,i;return e=t,r=[{key:"saveVerifyTransactionUrl",value:function(){var t,e,r,n=null===(t=this.payload)||void 0===t||null===(e=t.next_action)||void 0===e||null===(r=e.redirect_to_url)||void 0===r?void 0:r.verify_transaction_status_url;n&&localStorage.setItem("verify_transaction_status_url",n)}},{key:"removeVerifyTransactionUrl",value:function(){localStorage.removeItem("verify_transaction_status_url")}},{key:"getVerifyTransactionUrl",value:function(){return localStorage.getItem("verify_transaction_status_url")}},{key:"redirectTo3DS",value:function(){var t,e,r,n=null===(t=this.payload)||void 0===t||null===(e=t.next_action)||void 0===e||null===(r=e.redirect_to_url)||void 0===r?void 0:r.url;return n?(this.saveVerifyTransactionUrl(),window.location=n,!0):(console.log("No redirection found"),!1)}},{key:"getURLParameters",value:function(){var t,e={},r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=G(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(new URLSearchParams(window.location.search));try{for(r.s();!(t=r.n()).done;){var n=U(t.value,2),o=n[0],i=n[1];e[o]=i}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"verifyTransactionStatus",value:(o=N().mark((function t(){var e,r,n;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.getVerifyTransactionUrl())){t.next=23;break}return r="".concat(this.baseUrl).concat(e),t.prev=3,t.next=6,fetch(r,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Token ".concat(this.apiKey)}});case 6:if(200!==(n=t.sent).status){t.next=14;break}return this.removeVerifyTransactionUrl(),window.location=this.successUrl,console.log("La transacción se verificó con éxito."),t.abrupt("return",n);case 14:console.error("La verificación de la transacción falló.");case 15:t.next=21;break;case 17:return t.prev=17,t.t0=t.catch(3),console.error("Error al verificar la transacción:",t.t0),t.abrupt("return",t.t0);case 21:t.next=24;break;case 23:console.log("No verify_transaction_status_url found");case 24:case"end":return t.stop()}}),t,this,[[3,17]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){F(i,r,n,a,c,"next",t)}function c(t){F(i,r,n,a,c,"throw",t)}a(void 0)}))},function(){return i.apply(this,arguments)})}],r&&K(e.prototype,r),n&&K(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function Y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Y=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new B(o||[]);return n(a,"_invoke",{value:_(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function p(){}function d(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(E([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=d.prototype=f.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var s=l(t[n],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==V(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(s.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=d,n(m,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function q(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function J(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){q(i,n,o,a,c,"next",t)}function c(t){q(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tt(n.key),n)}}function $(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Q(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tt(t){var e=function(t,e){if("object"!==V(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==V(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===V(e)?e:String(e)}function et(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var rt=new WeakSet,nt=new WeakSet,ot=new WeakSet,it=new WeakSet,at=new WeakSet,ct=new WeakSet,st=new WeakSet,ut=function(){function t(e){var r=e.apiKey,n=e.returnUrl,o=e.successUrl,i=e.renderPaymentButton,a=void 0!==i&&i,c=e.callBack,s=void 0===c?function(){}:c,u=e.styles;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,st),$(this,ct),$(this,at),$(this,it),$(this,ot),$(this,nt),$(this,rt),Q(this,"customer",{}),Q(this,"items",[]),Q(this,"baseUrl","http://localhost:8000"),Q(this,"collectContainer",null),Q(this,"merchantData",{}),Q(this,"cartTotal",null),this.apiKeyTonder=r,this.returnUrl=n,this.successUrl=o,this.renderPaymentButton=a,this.callBack=s,this.customStyles=u,this.abortController=new AbortController,this.process3ds=new X({apiKey:r,baseUrl:this.baseUrl,successUrl:o})}var e,r,n,o;return e=t,r=[{key:"payment",value:function(t){var e=this;return new Promise(function(){var r=J(Y().mark((function r(n,o){var i,a,c,s;return Y().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,et(e,ot,pt).call(e,t.customer),e.setCartTotal(null===(i=t.cart)||void 0===i?void 0:i.total),e.setCartItems(null===(a=t.cart)||void 0===a?void 0:a.items),r.next=6,et(e,st,bt).call(e);case 6:(c=r.sent)&&(s=new X({payload:c}),e.callBack(c),s.redirectTo3DS(),n(c)),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),o(r.t0);case 13:case"end":return r.stop()}}),r,null,[[0,10]])})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"setCartItems",value:function(t){console.log("items: ",t),this.cartItems=t}},{key:"setCartTotal",value:function(t){console.log("total: ",t),this.cartTotal=t,et(this,it,dt).call(this)}},{key:"setCallback",value:function(t){this.cb=t}},{key:"injectCheckout",value:function(){var e=this;if(!t.injected){this.process3ds.verifyTransactionStatus();var r=setInterval((function(){document.querySelector("#tonder-checkout")&&(document.querySelector("#tonder-checkout").innerHTML='\n<div class="container-tonder">\n <div id="collectCardholderName" class="empty-div"></div>\n <div id="collectCardNumber" class="empty-div"></div>\n <div class="collect-row">\n <div id="collectExpirationMonth" class="empty-div"></div>\n <div id="collectExpirationYear" class="expiration-year"></div>\n <div id="collectCvv" class="empty-div"></div>\n </div>\n <div id="msgError"></div>\n <button id="tonderPayButton" class="pay-button">Pagar</button>\n</div>\n\n<style>\n.container-tonder {\n background-color: #F9F9F9;\n margin: 0 auto !important;\n padding: 30px 10px 30px 10px;\n overflow: hidden;\n transition: max-height 0.5s ease-out;\n max-width: 600px;\n border: solid 1px #e3e3e3;\n max-height: 100vh;\n}\n\n.collect-row {\n display: flex !important;\n justify-content: space-between !important;\n width: 100% !important;\n}\n\n.collect-row > :first-child {\n min-width: 120px; !important\n}\n\n.expiration-year {\n padding-top: 25px !important;\n}\n\n.empty-div {\n height: 80px !important;\n margin-top: 2px;\n margin-bottom: 4px;\n margin-left: 10px !important;\n margin-right: 10px !important;\n}\n\n.error-container{\n color: red !important;\n background-color: #FFDBDB !important;\n margin-bottom: 13px !important;\n font-size: 80% !important;\n padding: 8px 10px !important;\n border-radius: 10px !important;\n text-align: left !important;\n}\n\n.pay-button {\n font-size: 16px;\n font-weight: bold;\n min-height: 2.3rem;\n border-radius: 0.5rem;\n cursor: pointer;\n width: 100%;\n padding: 1rem;\n text-align: center;\n border: none;\n background-color: #000;\n color: #fff;\n margin-bottom: 10px;\n display: none;\n}\n\n.lds-dual-ring {\n display: inline-block;\n width: 14px;\n height: 14px;\n}\n\n.lds-dual-ring:after {\n content: " ";\n display: block;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n border: 6px solid #fff;\n border-color: #fff transparent #fff transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n}\n@keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n\n@media screen and (max-width: 600px) {\n .payment_method_zplit {\n font-size: 16px !important;\n width: 100% !important;\n }\n\n .payment_method_zplit label img {\n display: none !important;\n }\n}\n\n</style>\n',et(e,ct,gt).call(e),clearInterval(r),t.injected=!0)}),500)}}},{key:"getCustomer",value:(o=J(Y().mark((function t(e,r){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,m(this.baseUrl,this.apiKeyTonder,e,r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"removeCheckout",value:function(){t.injected=!1,this.abortController.abort(),this.abortController=new AbortController,clearInterval(this.injectInterval),console.log("InlineCheckout removed from DOM and cleaned up.")}}],r&&Z(e.prototype,r),n&&Z(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function lt(){var t=this;if(this.renderPaymentButton){var e=document.querySelector("#tonderPayButton");e?(e.style.display="block",e.textContent="Pagar $".concat(this.cartTotal),e.onclick=function(){var r=J(Y().mark((function r(n){return Y().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n.preventDefault(),r.next=3,et(t,nt,ht).call(t,e);case 3:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()):console.error("Pay button not found")}}function ht(t){return ft.apply(this,arguments)}function ft(){return(ft=J(Y().mark((function t(e){var r,n;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.innerHTML,e.innerHTML='<div class="lds-dual-ring"></div>',t.prev=2,t.next=5,this.payment(this.customer);case 5:n=t.sent,this.callBack(n),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),console.error("Payment error:",t.t0);case 12:return t.prev=12,e.innerHTML=r,t.finish(12);case 15:case"end":return t.stop()}}),t,this,[[2,9,12,15]])})))).apply(this,arguments)}function pt(t){console.log("customer: ",t),t&&(this.firstName=null==t?void 0:t.firstName,this.lastName=null==t?void 0:t.lastName,this.country=null==t?void 0:t.country,this.address=null==t?void 0:t.street,this.city=null==t?void 0:t.city,this.state=null==t?void 0:t.state,this.postCode=null==t?void 0:t.postCode,this.email=null==t?void 0:t.email,this.phone=null==t?void 0:t.phone)}function dt(){var t=document.querySelector("#tonderPayButton");t&&(t.textContent="Pagar $".concat(this.cartTotal))}function vt(){return yt.apply(this,arguments)}function yt(){return(yt=J(Y().mark((function t(){return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this.baseUrl,this.apiKeyTonder,this.abortController.signal);case 2:return this.merchantData=t.sent,t.abrupt("return",this.merchantData);case 4:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function gt(){return mt.apply(this,arguments)}function mt(){return(mt=J(Y().mark((function t(){var e,r,n;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return et(this,rt,lt).call(this),t.next=3,et(this,at,vt).call(this);case 3:return e=t.sent,r=e.vault_id,n=e.vault_url,t.next=8,z(r,n,this.baseUrl,this.apiKeyTonder,this.abortController.signal,this.customStyles);case 8:this.collectContainer=t.sent;case 9:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function bt(){return wt.apply(this,arguments)}function wt(){return(wt=J(Y().mark((function t(){var e,r,n,o,i,a,c,s,u,l,h,f,p,v,y,g,m,b;return Y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{document.querySelector("#tonderPayButton").disabled=!0}catch(t){}return e=this.merchantData,r=e.openpay_keys,n=e.reference,o=e.business,i=Number(this.cartTotal),a=null,t.prev=4,t.next=7,this.collectContainer.collect();case 7:return c=t.sent,t.next=10,c.records[0].fields;case 10:a=t.sent,t.next=17;break;case 13:throw t.prev=13,t.t0=t.catch(4),E("Por favor, verifica todos los campos de tu tarjeta"),t.t0;case 17:if(t.prev=17,!r.merchant_id||!r.public_key){t.next=22;break}return t.next=21,d(r.merchant_id,r.public_key,this.abortController.signal);case 21:s=t.sent;case 22:return t.next=24,this.getCustomer(this.email,this.abortController.signal);case 24:return u=t.sent,l=u.auth_token,h={business:this.apiKeyTonder,client:l,billing_address_id:null,shipping_address_id:null,amount:i,status:"A",reference:n,is_oneclick:!0,items:this.cartItems},console.log("orderItems: ",h),t.next=30,w(this.baseUrl,this.apiKeyTonder,h);case 30:return f=t.sent,p=new Date,v=p.toISOString(),y={business_pk:o.pk,amount:i,date:v,order:f.id},t.next=36,x(this.baseUrl,this.apiKeyTonder,y);case 36:return g=t.sent,m={card:a,name:a.cardholder_name,last_name:"",email_client:this.email,phone_number:this.phone,return_url:this.returnUrl,id_product:"no_id",quantity_product:1,id_ship:"0",instance_id_ship:"0",amount:i,title_ship:"shipping",description:"transaction",device_session_id:s||null,token_id:"",order_id:f.id,business_id:o.pk,payment_id:g.pk,source:"sdk"},t.next=40,S(this.baseUrl,this.apiKeyTonder,m);case 40:if(!(b=t.sent)){t.next=46;break}try{document.querySelector("#tonderPayButton").disabled=!1}catch(t){}return t.abrupt("return",b);case 46:return E("No se ha podido procesar el pago"),t.abrupt("return",!1);case 48:t.next=55;break;case 50:throw t.prev=50,t.t1=t.catch(17),console.log(t.t1),E("Ha ocurrido un error"),t.t1;case 55:case"end":return t.stop()}}),t,this,[[4,13],[17,50]])})))).apply(this,arguments)}Q(ut,"injected",!1)})(),n})()));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
3
|
+
const TerserPlugin = require('terser-webpack-plugin');
|
|
4
|
+
const webpack = require('webpack');
|
|
5
|
+
|
|
6
|
+
module.exports = (env, argv) => {
|
|
7
|
+
const isProduction = argv.mode === 'production';
|
|
8
|
+
|
|
9
|
+
const plugins = [
|
|
10
|
+
new webpack.DefinePlugin({
|
|
11
|
+
'process.env.BASE_URL': JSON.stringify(process.env.BASE_URL),
|
|
12
|
+
})
|
|
13
|
+
];
|
|
14
|
+
if (!isProduction) {
|
|
15
|
+
plugins.push(new HtmlWebpackPlugin({
|
|
16
|
+
template: 'src/index.html'
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
mode: isProduction ? 'production' : 'development',
|
|
22
|
+
entry: isProduction ? './src/index.js': './src/index-dev.js',
|
|
23
|
+
output: {
|
|
24
|
+
path: path.resolve(__dirname, 'v1'),
|
|
25
|
+
filename: isProduction ? 'bundle.min.js' : 'bundle.js',
|
|
26
|
+
library: 'TonderSdk',
|
|
27
|
+
libraryTarget: 'umd',
|
|
28
|
+
globalObject: 'this',
|
|
29
|
+
},
|
|
30
|
+
devtool: isProduction ? false : 'inline-source-map',
|
|
31
|
+
devServer: {
|
|
32
|
+
static: {
|
|
33
|
+
directory: path.join(__dirname, 'dist'),
|
|
34
|
+
},
|
|
35
|
+
host: '0.0.0.0',
|
|
36
|
+
port: 8080,
|
|
37
|
+
allowedHosts: 'all',
|
|
38
|
+
},
|
|
39
|
+
module: {
|
|
40
|
+
rules: [
|
|
41
|
+
{
|
|
42
|
+
test: /\.css$/,
|
|
43
|
+
use: ['style-loader', 'css-loader'],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
test: /\.js$/,
|
|
47
|
+
exclude: /node_modules/,
|
|
48
|
+
use: {
|
|
49
|
+
loader: 'babel-loader',
|
|
50
|
+
options: {
|
|
51
|
+
presets: ['@babel/preset-env'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
plugins: plugins,
|
|
58
|
+
optimization: {
|
|
59
|
+
minimizer: [
|
|
60
|
+
new TerserPlugin({
|
|
61
|
+
extractComments: false,
|
|
62
|
+
}),
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
};
|